ext-debug.js 1.2 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457
  1. /*
  2. This file is part of Ext JS 6.6.0.258
  3. Copyright (c) 2011-2018 Sencha Inc
  4. Contact: http://www.sencha.com/contact
  5. This version of Sencha Ext JS 6.6.0.258 is licensed commercially for a limited period for evaluation
  6. purposes only. Production use or use beyond the applicable evaluation period is prohibited
  7. under this license.
  8. If your trial has expired, please contact the sales department at http://www.sencha.com/contact.
  9. Version: 6.6.0.258 Build date: 2018-06-20 05:27:03 (a26fc5ffb54acf6e1afd5f18c467b14161985898)
  10. */
  11. var Ext = Ext || {};
  12. (function(manifest){
  13. if(!Ext.manifest) {
  14. Ext.manifest = manifest;
  15. } else {
  16. for(var name in manifest) {
  17. Ext.manifest[name] = manifest[name];
  18. }
  19. }
  20. })({
  21. "paths": {
  22. "Ext": "../classic/classic/src",
  23. "Ext.AbstractManager": "../packages/core/src/AbstractManager.js",
  24. "Ext.Ajax": "../packages/core/src/Ajax.js",
  25. "Ext.AnimationQueue": "../packages/core/src/AnimationQueue.js",
  26. "Ext.ComponentManager": "../packages/core/src/ComponentManager.js",
  27. "Ext.ComponentQuery": "../packages/core/src/ComponentQuery.js",
  28. "Ext.Deferred": "../packages/core/src/Deferred.js",
  29. "Ext.Evented": "../packages/core/src/Evented.js",
  30. "Ext.Factory": "../packages/core/src/mixin/Factoryable.js",
  31. "Ext.GlobalEvents": "../packages/core/src/GlobalEvents.js",
  32. "Ext.Glyph": "../packages/core/src/Glyph.js",
  33. "Ext.JSON": "../packages/core/src/JSON.js",
  34. "Ext.Mixin": "../packages/core/src/class/Mixin.js",
  35. "Ext.Msg": "../classic/classic/src/window/MessageBox.js",
  36. "Ext.Progress": "../packages/core/src/Progress.js",
  37. "Ext.ProgressBase": "../packages/core/src/ProgressBase.js",
  38. "Ext.Promise": "../packages/core/src/Promise.js",
  39. "Ext.String.format": "../packages/core/src/Template.js",
  40. "Ext.TaskQueue": "../packages/core/src/TaskQueue.js",
  41. "Ext.Template": "../packages/core/src/Template.js",
  42. "Ext.Widget": "../packages/core/src/Widget.js",
  43. "Ext.XTemplate": "../packages/core/src/XTemplate.js",
  44. "Ext.app": "../packages/core/src/app",
  45. "Ext.data": "../packages/core/src/data",
  46. "Ext.direct": "../packages/core/src/direct",
  47. "Ext.dom": "../packages/core/src/dom",
  48. "Ext.dom.ButtonElement": "../classic/classic/src/dom/ButtonElement.js",
  49. "Ext.dom.Layer": "../classic/classic/src/dom/Layer.js",
  50. "Ext.drag": "../packages/core/src/drag",
  51. "Ext.event": "../packages/core/src/event",
  52. "Ext.event.publisher.MouseEnterLeave": "../classic/classic/src/event/publisher/MouseEnterLeave.js",
  53. "Ext.field": "../packages/core/src/field",
  54. "Ext.fx.Animation": "../packages/core/src/fx/Animation.js",
  55. "Ext.fx.Runner": "../packages/core/src/fx/Runner.js",
  56. "Ext.fx.State": "../packages/core/src/fx/State.js",
  57. "Ext.fx.animation": "../packages/core/src/fx/animation",
  58. "Ext.fx.easing": "../packages/core/src/fx/easing",
  59. "Ext.fx.runner": "../packages/core/src/fx/runner",
  60. "Ext.list": "../packages/core/src/list",
  61. "Ext.mixin": "../packages/core/src/mixin",
  62. "Ext.parse": "../packages/core/src/parse",
  63. "Ext.perf": "../packages/core/src/perf",
  64. "Ext.plugin.Abstract": "../packages/core/src/plugin/Abstract.js",
  65. "Ext.plugin.AbstractClipboard": "../packages/core/src/plugin/AbstractClipboard.js",
  66. "Ext.plugin.MouseEnter": "../packages/core/src/plugin/MouseEnter.js",
  67. "Ext.promise": "../packages/core/src/promise",
  68. "Ext.route": "../packages/core/src/route",
  69. "Ext.scroll.Scroller": "../packages/core/src/scroll/Scroller.js",
  70. "Ext.sparkline": "../packages/core/src/sparkline",
  71. "Ext.util": "../packages/core/src/util",
  72. "Ext.util.Animate": "../classic/classic/src/util/Animate.js",
  73. "Ext.util.ComponentDragger": "../classic/classic/src/util/ComponentDragger.js",
  74. "Ext.util.ElementContainer": "../classic/classic/src/util/ElementContainer.js",
  75. "Ext.util.Floating": "../classic/classic/src/util/Floating.js",
  76. "Ext.util.Format.format": "../packages/core/src/Template.js",
  77. "Ext.util.Memento": "../classic/classic/src/util/Memento.js",
  78. "Ext.util.ProtoElement": "../classic/classic/src/util/ProtoElement.js",
  79. "Ext.util.Queue": "../classic/classic/src/util/Queue.js",
  80. "Ext.util.Renderable": "../classic/classic/src/util/Renderable.js",
  81. "Ext.util.StoreHolder": "../classic/classic/src/util/StoreHolder.js",
  82. "Ext.util.TsvDecoder": "../packages/core/src/util/TSV.js"
  83. },
  84. "loadOrder": [
  85. {
  86. "path": "../packages/core/src/class/Mixin.js",
  87. "requires": [],
  88. "uses": [],
  89. "idx": 0
  90. },
  91. {
  92. "path": "../packages/core/src/util/DelayedTask.js",
  93. "requires": [],
  94. "uses": [
  95. 76
  96. ],
  97. "idx": 1
  98. },
  99. {
  100. "path": "../packages/core/src/util/Event.js",
  101. "requires": [
  102. 1
  103. ],
  104. "uses": [
  105. 24
  106. ],
  107. "idx": 2
  108. },
  109. {
  110. "path": "../packages/core/src/mixin/Identifiable.js",
  111. "requires": [],
  112. "uses": [],
  113. "idx": 3
  114. },
  115. {
  116. "path": "../packages/core/src/mixin/Observable.js",
  117. "requires": [
  118. 0,
  119. 2,
  120. 3
  121. ],
  122. "uses": [
  123. 51
  124. ],
  125. "idx": 4
  126. },
  127. {
  128. "path": "../packages/core/src/util/HashMap.js",
  129. "requires": [
  130. 4
  131. ],
  132. "uses": [],
  133. "idx": 5
  134. },
  135. {
  136. "path": "../packages/core/src/AbstractManager.js",
  137. "requires": [
  138. 5
  139. ],
  140. "uses": [],
  141. "idx": 6
  142. },
  143. {
  144. "path": "../packages/core/src/promise/Consequence.js",
  145. "requires": [],
  146. "uses": [
  147. 8
  148. ],
  149. "idx": 7
  150. },
  151. {
  152. "path": "../packages/core/src/promise/Deferred.js",
  153. "requires": [
  154. 7
  155. ],
  156. "uses": [
  157. 9
  158. ],
  159. "idx": 8
  160. },
  161. {
  162. "path": "../packages/core/src/promise/Promise.js",
  163. "requires": [
  164. 8
  165. ],
  166. "uses": [],
  167. "idx": 9
  168. },
  169. {
  170. "path": "../packages/core/src/Promise.js",
  171. "requires": [
  172. 9
  173. ],
  174. "uses": [
  175. 8
  176. ],
  177. "idx": 10
  178. },
  179. {
  180. "path": "../packages/core/src/Deferred.js",
  181. "requires": [
  182. 8,
  183. 10
  184. ],
  185. "uses": [
  186. 9
  187. ],
  188. "idx": 11
  189. },
  190. {
  191. "path": "../packages/core/src/mixin/Factoryable.js",
  192. "requires": [],
  193. "uses": [],
  194. "idx": 12
  195. },
  196. {
  197. "path": "../packages/core/src/data/request/Base.js",
  198. "requires": [
  199. 11,
  200. 12
  201. ],
  202. "uses": [
  203. 17
  204. ],
  205. "idx": 13
  206. },
  207. {
  208. "path": "../packages/core/src/data/flash/BinaryXhr.js",
  209. "requires": [],
  210. "uses": [
  211. 76
  212. ],
  213. "idx": 14
  214. },
  215. {
  216. "path": "../packages/core/src/data/request/Ajax.js",
  217. "requires": [
  218. 13,
  219. 14
  220. ],
  221. "uses": [],
  222. "idx": 15
  223. },
  224. {
  225. "path": "../packages/core/src/data/request/Form.js",
  226. "requires": [
  227. 13
  228. ],
  229. "uses": [],
  230. "idx": 16
  231. },
  232. {
  233. "path": "../packages/core/src/data/Connection.js",
  234. "requires": [
  235. 4,
  236. 11,
  237. 14,
  238. 15,
  239. 16
  240. ],
  241. "uses": [
  242. 12,
  243. 49
  244. ],
  245. "idx": 17
  246. },
  247. {
  248. "path": "../packages/core/src/Ajax.js",
  249. "requires": [
  250. 17
  251. ],
  252. "uses": [],
  253. "idx": 18
  254. },
  255. {
  256. "path": "../packages/core/src/AnimationQueue.js",
  257. "requires": [],
  258. "uses": [],
  259. "idx": 19
  260. },
  261. {
  262. "path": "../packages/core/src/mixin/Bufferable.js",
  263. "requires": [
  264. 0
  265. ],
  266. "uses": [],
  267. "idx": 20
  268. },
  269. {
  270. "path": "../packages/core/src/ComponentManager.js",
  271. "requires": [
  272. 20
  273. ],
  274. "uses": [
  275. 24,
  276. 36,
  277. 49,
  278. 88
  279. ],
  280. "idx": 21
  281. },
  282. {
  283. "path": "../packages/core/src/util/Operators.js",
  284. "requires": [],
  285. "uses": [],
  286. "idx": 22
  287. },
  288. {
  289. "path": "../packages/core/src/util/LruCache.js",
  290. "requires": [
  291. 5
  292. ],
  293. "uses": [],
  294. "idx": 23
  295. },
  296. {
  297. "path": "../packages/core/src/ComponentQuery.js",
  298. "requires": [
  299. 21,
  300. 22,
  301. 23
  302. ],
  303. "uses": [
  304. 92
  305. ],
  306. "idx": 24
  307. },
  308. {
  309. "path": "../packages/core/src/Evented.js",
  310. "requires": [
  311. 4
  312. ],
  313. "uses": [],
  314. "idx": 25
  315. },
  316. {
  317. "path": "../packages/core/src/util/Positionable.js",
  318. "requires": [],
  319. "uses": [
  320. 34,
  321. 49
  322. ],
  323. "idx": 26
  324. },
  325. {
  326. "path": "../packages/core/src/dom/UnderlayPool.js",
  327. "requires": [],
  328. "uses": [
  329. 49
  330. ],
  331. "idx": 27
  332. },
  333. {
  334. "path": "../packages/core/src/dom/Underlay.js",
  335. "requires": [
  336. 27
  337. ],
  338. "uses": [],
  339. "idx": 28
  340. },
  341. {
  342. "path": "../packages/core/src/dom/Shadow.js",
  343. "requires": [
  344. 28
  345. ],
  346. "uses": [],
  347. "idx": 29
  348. },
  349. {
  350. "path": "../packages/core/src/dom/Shim.js",
  351. "requires": [
  352. 28
  353. ],
  354. "uses": [],
  355. "idx": 30
  356. },
  357. {
  358. "path": "../packages/core/src/dom/ElementEvent.js",
  359. "requires": [
  360. 2
  361. ],
  362. "uses": [
  363. 37
  364. ],
  365. "idx": 31
  366. },
  367. {
  368. "path": "../packages/core/src/event/publisher/Publisher.js",
  369. "requires": [],
  370. "uses": [],
  371. "idx": 32
  372. },
  373. {
  374. "path": "../packages/core/src/util/Offset.js",
  375. "requires": [],
  376. "uses": [],
  377. "idx": 33
  378. },
  379. {
  380. "path": "../packages/core/src/util/Region.js",
  381. "requires": [
  382. 33
  383. ],
  384. "uses": [
  385. 49
  386. ],
  387. "idx": 34
  388. },
  389. {
  390. "path": "../packages/core/src/util/Point.js",
  391. "requires": [
  392. 34
  393. ],
  394. "uses": [],
  395. "idx": 35
  396. },
  397. {
  398. "path": "../packages/core/src/event/Event.js",
  399. "requires": [
  400. 35
  401. ],
  402. "uses": [
  403. 37,
  404. 76
  405. ],
  406. "idx": 36
  407. },
  408. {
  409. "path": "../packages/core/src/event/publisher/Dom.js",
  410. "requires": [
  411. 32,
  412. 36
  413. ],
  414. "uses": [
  415. 76
  416. ],
  417. "idx": 37
  418. },
  419. {
  420. "path": "../packages/core/src/event/publisher/Gesture.js",
  421. "requires": [
  422. 19,
  423. 35,
  424. 37
  425. ],
  426. "uses": [
  427. 36,
  428. 49,
  429. 296,
  430. 307,
  431. 308,
  432. 309,
  433. 310,
  434. 311,
  435. 312,
  436. 313,
  437. 314,
  438. 315,
  439. 316,
  440. 317
  441. ],
  442. "idx": 38
  443. },
  444. {
  445. "path": "../packages/core/src/mixin/Templatable.js",
  446. "requires": [
  447. 0
  448. ],
  449. "uses": [
  450. 49
  451. ],
  452. "idx": 39
  453. },
  454. {
  455. "path": "../packages/core/src/TaskQueue.js",
  456. "requires": [
  457. 19
  458. ],
  459. "uses": [],
  460. "idx": 40
  461. },
  462. {
  463. "path": "../packages/core/src/util/sizemonitor/Abstract.js",
  464. "requires": [
  465. 39,
  466. 40
  467. ],
  468. "uses": [],
  469. "idx": 41
  470. },
  471. {
  472. "path": "../packages/core/src/util/sizemonitor/Scroll.js",
  473. "requires": [
  474. 41
  475. ],
  476. "uses": [
  477. 40
  478. ],
  479. "idx": 42
  480. },
  481. {
  482. "path": "../packages/core/src/util/SizeMonitor.js",
  483. "requires": [
  484. 42
  485. ],
  486. "uses": [],
  487. "idx": 43
  488. },
  489. {
  490. "path": "../packages/core/src/event/publisher/ElementSize.js",
  491. "requires": [
  492. 32,
  493. 43
  494. ],
  495. "uses": [
  496. 40
  497. ],
  498. "idx": 44
  499. },
  500. {
  501. "path": "../packages/core/src/util/paintmonitor/Abstract.js",
  502. "requires": [],
  503. "uses": [
  504. 49
  505. ],
  506. "idx": 45
  507. },
  508. {
  509. "path": "../packages/core/src/util/paintmonitor/CssAnimation.js",
  510. "requires": [
  511. 45
  512. ],
  513. "uses": [],
  514. "idx": 46
  515. },
  516. {
  517. "path": "../packages/core/src/util/PaintMonitor.js",
  518. "requires": [
  519. 46
  520. ],
  521. "uses": [],
  522. "idx": 47
  523. },
  524. {
  525. "path": "../packages/core/src/event/publisher/ElementPaint.js",
  526. "requires": [
  527. 32,
  528. 40,
  529. 47
  530. ],
  531. "uses": [],
  532. "idx": 48
  533. },
  534. {
  535. "path": "../packages/core/src/dom/Element.js",
  536. "requires": [
  537. 4,
  538. 26,
  539. 29,
  540. 30,
  541. 31,
  542. 37,
  543. 38,
  544. 44,
  545. 48
  546. ],
  547. "uses": [
  548. 32,
  549. 34,
  550. 36,
  551. 74,
  552. 75,
  553. 76,
  554. 92,
  555. 99,
  556. 240,
  557. 297,
  558. 318,
  559. 329,
  560. 331
  561. ],
  562. "idx": 49
  563. },
  564. {
  565. "path": "../packages/core/src/util/Filter.js",
  566. "requires": [],
  567. "uses": [],
  568. "idx": 50
  569. },
  570. {
  571. "path": "../packages/core/src/util/Observable.js",
  572. "requires": [
  573. 4
  574. ],
  575. "uses": [],
  576. "idx": 51
  577. },
  578. {
  579. "path": "../packages/core/src/util/AbstractMixedCollection.js",
  580. "requires": [
  581. 50,
  582. 51
  583. ],
  584. "uses": [],
  585. "idx": 52
  586. },
  587. {
  588. "path": "../packages/core/src/util/Sorter.js",
  589. "requires": [],
  590. "uses": [],
  591. "idx": 53
  592. },
  593. {
  594. "path": "../packages/core/src/util/Sortable.js",
  595. "requires": [
  596. 53
  597. ],
  598. "uses": [
  599. 55
  600. ],
  601. "idx": 54
  602. },
  603. {
  604. "path": "../packages/core/src/util/MixedCollection.js",
  605. "requires": [
  606. 52,
  607. 54
  608. ],
  609. "uses": [],
  610. "idx": 55
  611. },
  612. {
  613. "path": "../packages/core/src/util/TaskRunner.js",
  614. "requires": [],
  615. "uses": [],
  616. "idx": 56
  617. },
  618. {
  619. "path": "../classic/classic/src/fx/target/Target.js",
  620. "requires": [],
  621. "uses": [],
  622. "idx": 57
  623. },
  624. {
  625. "path": "../classic/classic/src/fx/target/Element.js",
  626. "requires": [
  627. 57
  628. ],
  629. "uses": [],
  630. "idx": 58
  631. },
  632. {
  633. "path": "../classic/classic/src/fx/target/ElementCSS.js",
  634. "requires": [
  635. 58
  636. ],
  637. "uses": [],
  638. "idx": 59
  639. },
  640. {
  641. "path": "../classic/classic/src/fx/target/CompositeElement.js",
  642. "requires": [
  643. 58
  644. ],
  645. "uses": [],
  646. "idx": 60
  647. },
  648. {
  649. "path": "../classic/classic/src/fx/target/CompositeElementCSS.js",
  650. "requires": [
  651. 59,
  652. 60
  653. ],
  654. "uses": [],
  655. "idx": 61
  656. },
  657. {
  658. "path": "../classic/classic/src/fx/target/Sprite.js",
  659. "requires": [
  660. 57
  661. ],
  662. "uses": [],
  663. "idx": 62
  664. },
  665. {
  666. "path": "../classic/classic/src/fx/target/CompositeSprite.js",
  667. "requires": [
  668. 62
  669. ],
  670. "uses": [],
  671. "idx": 63
  672. },
  673. {
  674. "path": "../classic/classic/src/fx/target/Component.js",
  675. "requires": [
  676. 57
  677. ],
  678. "uses": [
  679. 76
  680. ],
  681. "idx": 64
  682. },
  683. {
  684. "path": "../classic/classic/src/fx/Queue.js",
  685. "requires": [
  686. 5
  687. ],
  688. "uses": [],
  689. "idx": 65
  690. },
  691. {
  692. "path": "../classic/classic/src/fx/Manager.js",
  693. "requires": [
  694. 55,
  695. 56,
  696. 58,
  697. 59,
  698. 60,
  699. 61,
  700. 62,
  701. 63,
  702. 64,
  703. 65
  704. ],
  705. "uses": [],
  706. "idx": 66
  707. },
  708. {
  709. "path": "../classic/classic/src/fx/Animator.js",
  710. "requires": [
  711. 51,
  712. 66
  713. ],
  714. "uses": [
  715. 72
  716. ],
  717. "idx": 67
  718. },
  719. {
  720. "path": "../classic/classic/src/fx/CubicBezier.js",
  721. "requires": [],
  722. "uses": [],
  723. "idx": 68
  724. },
  725. {
  726. "path": "../classic/classic/src/fx/Easing.js",
  727. "requires": [
  728. 68
  729. ],
  730. "uses": [],
  731. "idx": 69
  732. },
  733. {
  734. "path": "../classic/classic/src/fx/DrawPath.js",
  735. "requires": [],
  736. "uses": [],
  737. "idx": 70
  738. },
  739. {
  740. "path": "../classic/classic/src/fx/PropertyHandler.js",
  741. "requires": [
  742. 70
  743. ],
  744. "uses": [],
  745. "idx": 71
  746. },
  747. {
  748. "path": "../classic/classic/src/fx/Anim.js",
  749. "requires": [
  750. 51,
  751. 66,
  752. 67,
  753. 68,
  754. 69,
  755. 71
  756. ],
  757. "uses": [],
  758. "idx": 72
  759. },
  760. {
  761. "path": "../classic/classic/src/util/Animate.js",
  762. "requires": [
  763. 66,
  764. 72
  765. ],
  766. "uses": [],
  767. "idx": 73
  768. },
  769. {
  770. "path": "../packages/core/src/dom/Fly.js",
  771. "requires": [
  772. 49
  773. ],
  774. "uses": [],
  775. "idx": 74
  776. },
  777. {
  778. "path": "../packages/core/src/dom/CompositeElementLite.js",
  779. "requires": [
  780. 74
  781. ],
  782. "uses": [
  783. 49
  784. ],
  785. "idx": 75
  786. },
  787. {
  788. "path": "../packages/core/src/GlobalEvents.js",
  789. "requires": [
  790. 4,
  791. 49
  792. ],
  793. "uses": [
  794. 21
  795. ],
  796. "idx": 76
  797. },
  798. {
  799. "path": "../packages/core/src/Glyph.js",
  800. "requires": [],
  801. "uses": [],
  802. "idx": 77
  803. },
  804. {
  805. "path": "../packages/core/src/JSON.js",
  806. "requires": [],
  807. "uses": [],
  808. "idx": 78
  809. },
  810. {
  811. "path": "../packages/core/src/Manifest.js",
  812. "requires": [],
  813. "uses": [],
  814. "idx": 79
  815. },
  816. {
  817. "path": "../packages/core/src/mixin/Inheritable.js",
  818. "requires": [
  819. 0
  820. ],
  821. "uses": [
  822. 21
  823. ],
  824. "idx": 80
  825. },
  826. {
  827. "path": "../packages/core/src/mixin/Bindable.js",
  828. "requires": [],
  829. "uses": [
  830. 12
  831. ],
  832. "idx": 81
  833. },
  834. {
  835. "path": "../packages/core/src/mixin/ComponentDelegation.js",
  836. "requires": [
  837. 0,
  838. 4
  839. ],
  840. "uses": [
  841. 2
  842. ],
  843. "idx": 82
  844. },
  845. {
  846. "path": "../packages/core/src/plugin/Abstract.js",
  847. "requires": [],
  848. "uses": [],
  849. "idx": 83
  850. },
  851. {
  852. "path": "../packages/core/src/mixin/Pluggable.js",
  853. "requires": [
  854. 83
  855. ],
  856. "uses": [],
  857. "idx": 84
  858. },
  859. {
  860. "path": "../packages/core/src/mixin/Keyboard.js",
  861. "requires": [
  862. 0
  863. ],
  864. "uses": [
  865. 36
  866. ],
  867. "idx": 85
  868. },
  869. {
  870. "path": "../packages/core/src/mixin/Focusable.js",
  871. "requires": [],
  872. "uses": [
  873. 21,
  874. 24,
  875. 36,
  876. 49
  877. ],
  878. "idx": 86
  879. },
  880. {
  881. "path": "../packages/core/src/mixin/Accessible.js",
  882. "requires": [
  883. 0
  884. ],
  885. "uses": [],
  886. "idx": 87
  887. },
  888. {
  889. "path": "../packages/core/src/Widget.js",
  890. "requires": [
  891. 12,
  892. 25,
  893. 49,
  894. 80,
  895. 81,
  896. 82,
  897. 84,
  898. 85,
  899. 86,
  900. 87
  901. ],
  902. "uses": [
  903. 21,
  904. 24,
  905. 95
  906. ],
  907. "idx": 88
  908. },
  909. {
  910. "path": "../packages/core/src/ProgressBase.js",
  911. "requires": [],
  912. "uses": [
  913. 95
  914. ],
  915. "idx": 89
  916. },
  917. {
  918. "path": "../packages/core/src/Progress.js",
  919. "requires": [
  920. 88,
  921. 89
  922. ],
  923. "uses": [],
  924. "idx": 90
  925. },
  926. {
  927. "path": "../packages/core/src/util/Format.js",
  928. "requires": [],
  929. "uses": [
  930. 92,
  931. 240
  932. ],
  933. "idx": 91
  934. },
  935. {
  936. "path": "../packages/core/src/Template.js",
  937. "requires": [
  938. 91
  939. ],
  940. "uses": [
  941. 240
  942. ],
  943. "idx": 92
  944. },
  945. {
  946. "path": "../packages/core/src/util/XTemplateParser.js",
  947. "requires": [],
  948. "uses": [],
  949. "idx": 93
  950. },
  951. {
  952. "path": "../packages/core/src/util/XTemplateCompiler.js",
  953. "requires": [
  954. 93
  955. ],
  956. "uses": [],
  957. "idx": 94
  958. },
  959. {
  960. "path": "../packages/core/src/XTemplate.js",
  961. "requires": [
  962. 92,
  963. 94
  964. ],
  965. "uses": [],
  966. "idx": 95
  967. },
  968. {
  969. "path": "../packages/core/src/app/EventDomain.js",
  970. "requires": [
  971. 2
  972. ],
  973. "uses": [],
  974. "idx": 96
  975. },
  976. {
  977. "path": "../packages/core/src/app/domain/Component.js",
  978. "requires": [
  979. 88,
  980. 96
  981. ],
  982. "uses": [],
  983. "idx": 97
  984. },
  985. {
  986. "path": "../classic/classic/src/util/ProtoElement.js",
  987. "requires": [],
  988. "uses": [
  989. 49,
  990. 240
  991. ],
  992. "idx": 98
  993. },
  994. {
  995. "path": "../packages/core/src/dom/CompositeElement.js",
  996. "requires": [
  997. 75
  998. ],
  999. "uses": [],
  1000. "idx": 99
  1001. },
  1002. {
  1003. "path": "../classic/classic/src/plugin/Manager.js",
  1004. "requires": [],
  1005. "uses": [],
  1006. "idx": 100
  1007. },
  1008. {
  1009. "path": "../packages/core/src/util/CSS.js",
  1010. "requires": [],
  1011. "uses": [
  1012. 49
  1013. ],
  1014. "idx": 101
  1015. },
  1016. {
  1017. "path": "../packages/core/src/fx/easing/Abstract.js",
  1018. "requires": [],
  1019. "uses": [],
  1020. "idx": 102
  1021. },
  1022. {
  1023. "path": "../packages/core/src/fx/easing/Linear.js",
  1024. "requires": [
  1025. 102
  1026. ],
  1027. "uses": [],
  1028. "idx": 103
  1029. },
  1030. {
  1031. "path": "../packages/core/src/util/translatable/Abstract.js",
  1032. "requires": [
  1033. 12,
  1034. 25,
  1035. 103
  1036. ],
  1037. "uses": [
  1038. 19
  1039. ],
  1040. "idx": 104
  1041. },
  1042. {
  1043. "path": "../packages/core/src/util/translatable/Dom.js",
  1044. "requires": [
  1045. 104
  1046. ],
  1047. "uses": [],
  1048. "idx": 105
  1049. },
  1050. {
  1051. "path": "../packages/core/src/util/translatable/ScrollPosition.js",
  1052. "requires": [
  1053. 105
  1054. ],
  1055. "uses": [],
  1056. "idx": 106
  1057. },
  1058. {
  1059. "path": "../packages/core/src/scroll/Scroller.js",
  1060. "requires": [
  1061. 11,
  1062. 12,
  1063. 20,
  1064. 25,
  1065. 101,
  1066. 106
  1067. ],
  1068. "uses": [
  1069. 76
  1070. ],
  1071. "idx": 107
  1072. },
  1073. {
  1074. "path": "../classic/classic/src/util/Floating.js",
  1075. "requires": [],
  1076. "uses": [
  1077. 21,
  1078. 49,
  1079. 74,
  1080. 403
  1081. ],
  1082. "idx": 108
  1083. },
  1084. {
  1085. "path": "../classic/classic/src/util/ElementContainer.js",
  1086. "requires": [],
  1087. "uses": [],
  1088. "idx": 109
  1089. },
  1090. {
  1091. "path": "../classic/classic/src/util/Renderable.js",
  1092. "requires": [
  1093. 49
  1094. ],
  1095. "uses": [
  1096. 95,
  1097. 114,
  1098. 240
  1099. ],
  1100. "idx": 110
  1101. },
  1102. {
  1103. "path": "../classic/classic/src/state/Provider.js",
  1104. "requires": [
  1105. 51
  1106. ],
  1107. "uses": [],
  1108. "idx": 111
  1109. },
  1110. {
  1111. "path": "../classic/classic/src/state/Manager.js",
  1112. "requires": [
  1113. 111
  1114. ],
  1115. "uses": [],
  1116. "idx": 112
  1117. },
  1118. {
  1119. "path": "../classic/classic/src/state/Stateful.js",
  1120. "requires": [
  1121. 56,
  1122. 112
  1123. ],
  1124. "uses": [],
  1125. "idx": 113
  1126. },
  1127. {
  1128. "path": "../classic/classic/src/Component.js",
  1129. "requires": [
  1130. 21,
  1131. 24,
  1132. 26,
  1133. 51,
  1134. 73,
  1135. 76,
  1136. 80,
  1137. 81,
  1138. 82,
  1139. 83,
  1140. 85,
  1141. 86,
  1142. 87,
  1143. 98,
  1144. 99,
  1145. 100,
  1146. 107,
  1147. 108,
  1148. 109,
  1149. 110,
  1150. 113
  1151. ],
  1152. "uses": [
  1153. 1,
  1154. 49,
  1155. 66,
  1156. 95,
  1157. 240,
  1158. 398,
  1159. 399,
  1160. 400,
  1161. 403,
  1162. 411,
  1163. 413,
  1164. 479,
  1165. 626,
  1166. 645
  1167. ],
  1168. "idx": 114
  1169. },
  1170. {
  1171. "path": "../classic/classic/src/layout/container/border/Region.js",
  1172. "requires": [],
  1173. "uses": [],
  1174. "idx": 115
  1175. },
  1176. {
  1177. "path": "../packages/core/src/app/EventBus.js",
  1178. "requires": [
  1179. 97
  1180. ],
  1181. "uses": [
  1182. 96
  1183. ],
  1184. "idx": 116
  1185. },
  1186. {
  1187. "path": "../packages/core/src/app/domain/Global.js",
  1188. "requires": [
  1189. 76,
  1190. 96
  1191. ],
  1192. "uses": [],
  1193. "idx": 117
  1194. },
  1195. {
  1196. "path": "../packages/core/src/route/Handler.js",
  1197. "requires": [],
  1198. "uses": [],
  1199. "idx": 118
  1200. },
  1201. {
  1202. "path": "../packages/core/src/route/Action.js",
  1203. "requires": [],
  1204. "uses": [
  1205. 11
  1206. ],
  1207. "idx": 119
  1208. },
  1209. {
  1210. "path": "../packages/core/src/route/Route.js",
  1211. "requires": [
  1212. 118,
  1213. 119
  1214. ],
  1215. "uses": [
  1216. 10,
  1217. 122
  1218. ],
  1219. "idx": 120
  1220. },
  1221. {
  1222. "path": "../packages/core/src/util/History.js",
  1223. "requires": [
  1224. 51
  1225. ],
  1226. "uses": [],
  1227. "idx": 121
  1228. },
  1229. {
  1230. "path": "../packages/core/src/route/Router.js",
  1231. "requires": [
  1232. 119,
  1233. 120,
  1234. 121
  1235. ],
  1236. "uses": [
  1237. 118
  1238. ],
  1239. "idx": 122
  1240. },
  1241. {
  1242. "path": "../packages/core/src/route/Mixin.js",
  1243. "requires": [
  1244. 0,
  1245. 118,
  1246. 122
  1247. ],
  1248. "uses": [
  1249. 121
  1250. ],
  1251. "idx": 123
  1252. },
  1253. {
  1254. "path": "../packages/core/src/app/BaseController.js",
  1255. "requires": [
  1256. 4,
  1257. 116,
  1258. 117,
  1259. 123
  1260. ],
  1261. "uses": [
  1262. 219
  1263. ],
  1264. "idx": 124
  1265. },
  1266. {
  1267. "path": "../packages/core/src/app/Util.js",
  1268. "requires": [],
  1269. "uses": [],
  1270. "idx": 125
  1271. },
  1272. {
  1273. "path": "../packages/core/src/util/CollectionKey.js",
  1274. "requires": [
  1275. 3
  1276. ],
  1277. "uses": [],
  1278. "idx": 126
  1279. },
  1280. {
  1281. "path": "../packages/core/src/util/Grouper.js",
  1282. "requires": [
  1283. 53
  1284. ],
  1285. "uses": [],
  1286. "idx": 127
  1287. },
  1288. {
  1289. "path": "../packages/core/src/util/Collection.js",
  1290. "requires": [
  1291. 4,
  1292. 50,
  1293. 53,
  1294. 126,
  1295. 127
  1296. ],
  1297. "uses": [
  1298. 172,
  1299. 173,
  1300. 174
  1301. ],
  1302. "idx": 128
  1303. },
  1304. {
  1305. "path": "../packages/core/src/data/Range.js",
  1306. "requires": [
  1307. 1
  1308. ],
  1309. "uses": [],
  1310. "idx": 129
  1311. },
  1312. {
  1313. "path": "../packages/core/src/util/ObjectTemplate.js",
  1314. "requires": [
  1315. 95
  1316. ],
  1317. "uses": [],
  1318. "idx": 130
  1319. },
  1320. {
  1321. "path": "../packages/core/src/data/schema/Role.js",
  1322. "requires": [],
  1323. "uses": [
  1324. 12
  1325. ],
  1326. "idx": 131
  1327. },
  1328. {
  1329. "path": "../packages/core/src/data/schema/Association.js",
  1330. "requires": [
  1331. 131
  1332. ],
  1333. "uses": [],
  1334. "idx": 132
  1335. },
  1336. {
  1337. "path": "../packages/core/src/data/schema/OneToOne.js",
  1338. "requires": [
  1339. 132
  1340. ],
  1341. "uses": [],
  1342. "idx": 133
  1343. },
  1344. {
  1345. "path": "../packages/core/src/data/schema/ManyToOne.js",
  1346. "requires": [
  1347. 132
  1348. ],
  1349. "uses": [],
  1350. "idx": 134
  1351. },
  1352. {
  1353. "path": "../packages/core/src/data/schema/ManyToMany.js",
  1354. "requires": [
  1355. 132
  1356. ],
  1357. "uses": [],
  1358. "idx": 135
  1359. },
  1360. {
  1361. "path": "../packages/core/src/util/Inflector.js",
  1362. "requires": [],
  1363. "uses": [],
  1364. "idx": 136
  1365. },
  1366. {
  1367. "path": "../packages/core/src/data/schema/Namer.js",
  1368. "requires": [
  1369. 12,
  1370. 136
  1371. ],
  1372. "uses": [],
  1373. "idx": 137
  1374. },
  1375. {
  1376. "path": "../packages/core/src/data/schema/Schema.js",
  1377. "requires": [
  1378. 12,
  1379. 130,
  1380. 133,
  1381. 134,
  1382. 135,
  1383. 137
  1384. ],
  1385. "uses": [],
  1386. "idx": 138
  1387. },
  1388. {
  1389. "path": "../packages/core/src/data/AbstractStore.js",
  1390. "requires": [
  1391. 4,
  1392. 12,
  1393. 50,
  1394. 128,
  1395. 129,
  1396. 138
  1397. ],
  1398. "uses": [
  1399. 178
  1400. ],
  1401. "idx": 139
  1402. },
  1403. {
  1404. "path": "../packages/core/src/data/Error.js",
  1405. "requires": [],
  1406. "uses": [],
  1407. "idx": 140
  1408. },
  1409. {
  1410. "path": "../packages/core/src/data/ErrorCollection.js",
  1411. "requires": [
  1412. 55,
  1413. 140
  1414. ],
  1415. "uses": [
  1416. 149
  1417. ],
  1418. "idx": 141
  1419. },
  1420. {
  1421. "path": "../packages/core/src/data/operation/Operation.js",
  1422. "requires": [],
  1423. "uses": [],
  1424. "idx": 142
  1425. },
  1426. {
  1427. "path": "../packages/core/src/data/operation/Create.js",
  1428. "requires": [
  1429. 142
  1430. ],
  1431. "uses": [],
  1432. "idx": 143
  1433. },
  1434. {
  1435. "path": "../packages/core/src/data/operation/Destroy.js",
  1436. "requires": [
  1437. 142
  1438. ],
  1439. "uses": [],
  1440. "idx": 144
  1441. },
  1442. {
  1443. "path": "../packages/core/src/data/operation/Read.js",
  1444. "requires": [
  1445. 142
  1446. ],
  1447. "uses": [],
  1448. "idx": 145
  1449. },
  1450. {
  1451. "path": "../packages/core/src/data/operation/Update.js",
  1452. "requires": [
  1453. 142
  1454. ],
  1455. "uses": [],
  1456. "idx": 146
  1457. },
  1458. {
  1459. "path": "../packages/core/src/data/SortTypes.js",
  1460. "requires": [],
  1461. "uses": [],
  1462. "idx": 147
  1463. },
  1464. {
  1465. "path": "../packages/core/src/data/validator/Validator.js",
  1466. "requires": [
  1467. 12
  1468. ],
  1469. "uses": [],
  1470. "idx": 148
  1471. },
  1472. {
  1473. "path": "../packages/core/src/data/field/Field.js",
  1474. "requires": [
  1475. 12,
  1476. 147,
  1477. 148
  1478. ],
  1479. "uses": [],
  1480. "idx": 149
  1481. },
  1482. {
  1483. "path": "../packages/core/src/data/field/Boolean.js",
  1484. "requires": [
  1485. 149
  1486. ],
  1487. "uses": [],
  1488. "idx": 150
  1489. },
  1490. {
  1491. "path": "../packages/core/src/data/field/Date.js",
  1492. "requires": [
  1493. 149
  1494. ],
  1495. "uses": [],
  1496. "idx": 151
  1497. },
  1498. {
  1499. "path": "../packages/core/src/data/field/Integer.js",
  1500. "requires": [
  1501. 149
  1502. ],
  1503. "uses": [],
  1504. "idx": 152
  1505. },
  1506. {
  1507. "path": "../packages/core/src/data/field/Number.js",
  1508. "requires": [
  1509. 152
  1510. ],
  1511. "uses": [],
  1512. "idx": 153
  1513. },
  1514. {
  1515. "path": "../packages/core/src/data/field/String.js",
  1516. "requires": [
  1517. 149
  1518. ],
  1519. "uses": [],
  1520. "idx": 154
  1521. },
  1522. {
  1523. "path": "../packages/core/src/data/identifier/Generator.js",
  1524. "requires": [
  1525. 12
  1526. ],
  1527. "uses": [],
  1528. "idx": 155
  1529. },
  1530. {
  1531. "path": "../packages/core/src/data/identifier/Sequential.js",
  1532. "requires": [
  1533. 155
  1534. ],
  1535. "uses": [],
  1536. "idx": 156
  1537. },
  1538. {
  1539. "path": "../packages/core/src/data/Model.js",
  1540. "requires": [
  1541. 138,
  1542. 141,
  1543. 142,
  1544. 143,
  1545. 144,
  1546. 145,
  1547. 146,
  1548. 148,
  1549. 149,
  1550. 150,
  1551. 151,
  1552. 152,
  1553. 153,
  1554. 154,
  1555. 155,
  1556. 156
  1557. ],
  1558. "uses": [
  1559. 12,
  1560. 159,
  1561. 239
  1562. ],
  1563. "idx": 157
  1564. },
  1565. {
  1566. "path": "../packages/core/src/data/ResultSet.js",
  1567. "requires": [],
  1568. "uses": [],
  1569. "idx": 158
  1570. },
  1571. {
  1572. "path": "../packages/core/src/data/reader/Reader.js",
  1573. "requires": [
  1574. 4,
  1575. 12,
  1576. 23,
  1577. 95,
  1578. 158
  1579. ],
  1580. "uses": [
  1581. 138
  1582. ],
  1583. "idx": 159
  1584. },
  1585. {
  1586. "path": "../packages/core/src/data/writer/Writer.js",
  1587. "requires": [
  1588. 12
  1589. ],
  1590. "uses": [],
  1591. "idx": 160
  1592. },
  1593. {
  1594. "path": "../packages/core/src/data/proxy/Proxy.js",
  1595. "requires": [
  1596. 4,
  1597. 12,
  1598. 138,
  1599. 159,
  1600. 160
  1601. ],
  1602. "uses": [
  1603. 142,
  1604. 143,
  1605. 144,
  1606. 145,
  1607. 146,
  1608. 157,
  1609. 187
  1610. ],
  1611. "idx": 161
  1612. },
  1613. {
  1614. "path": "../packages/core/src/data/proxy/Client.js",
  1615. "requires": [
  1616. 161
  1617. ],
  1618. "uses": [],
  1619. "idx": 162
  1620. },
  1621. {
  1622. "path": "../packages/core/src/data/proxy/Memory.js",
  1623. "requires": [
  1624. 162
  1625. ],
  1626. "uses": [
  1627. 50,
  1628. 54
  1629. ],
  1630. "idx": 163
  1631. },
  1632. {
  1633. "path": "../packages/core/src/data/ProxyStore.js",
  1634. "requires": [
  1635. 139,
  1636. 142,
  1637. 143,
  1638. 144,
  1639. 145,
  1640. 146,
  1641. 157,
  1642. 161,
  1643. 163
  1644. ],
  1645. "uses": [
  1646. 138
  1647. ],
  1648. "idx": 164
  1649. },
  1650. {
  1651. "path": "../packages/core/src/util/Group.js",
  1652. "requires": [
  1653. 128
  1654. ],
  1655. "uses": [],
  1656. "idx": 165
  1657. },
  1658. {
  1659. "path": "../packages/core/src/data/Group.js",
  1660. "requires": [
  1661. 165
  1662. ],
  1663. "uses": [],
  1664. "idx": 166
  1665. },
  1666. {
  1667. "path": "../packages/core/src/data/LocalStore.js",
  1668. "requires": [
  1669. 0,
  1670. 166
  1671. ],
  1672. "uses": [
  1673. 128
  1674. ],
  1675. "idx": 167
  1676. },
  1677. {
  1678. "path": "../packages/core/src/data/proxy/Server.js",
  1679. "requires": [
  1680. 161
  1681. ],
  1682. "uses": [
  1683. 92,
  1684. 236
  1685. ],
  1686. "idx": 168
  1687. },
  1688. {
  1689. "path": "../packages/core/src/data/proxy/Ajax.js",
  1690. "requires": [
  1691. 18,
  1692. 168
  1693. ],
  1694. "uses": [],
  1695. "idx": 169
  1696. },
  1697. {
  1698. "path": "../packages/core/src/data/reader/Json.js",
  1699. "requires": [
  1700. 78,
  1701. 159
  1702. ],
  1703. "uses": [],
  1704. "idx": 170
  1705. },
  1706. {
  1707. "path": "../packages/core/src/data/writer/Json.js",
  1708. "requires": [
  1709. 160
  1710. ],
  1711. "uses": [],
  1712. "idx": 171
  1713. },
  1714. {
  1715. "path": "../packages/core/src/util/SorterCollection.js",
  1716. "requires": [
  1717. 53,
  1718. 128
  1719. ],
  1720. "uses": [],
  1721. "idx": 172
  1722. },
  1723. {
  1724. "path": "../packages/core/src/util/FilterCollection.js",
  1725. "requires": [
  1726. 50,
  1727. 128
  1728. ],
  1729. "uses": [],
  1730. "idx": 173
  1731. },
  1732. {
  1733. "path": "../packages/core/src/util/GroupCollection.js",
  1734. "requires": [
  1735. 128,
  1736. 165,
  1737. 172,
  1738. 173
  1739. ],
  1740. "uses": [],
  1741. "idx": 174
  1742. },
  1743. {
  1744. "path": "../packages/core/src/data/Store.js",
  1745. "requires": [
  1746. 1,
  1747. 157,
  1748. 164,
  1749. 167,
  1750. 169,
  1751. 170,
  1752. 171,
  1753. 174
  1754. ],
  1755. "uses": [
  1756. 127,
  1757. 178
  1758. ],
  1759. "idx": 175
  1760. },
  1761. {
  1762. "path": "../packages/core/src/data/reader/Array.js",
  1763. "requires": [
  1764. 170
  1765. ],
  1766. "uses": [],
  1767. "idx": 176
  1768. },
  1769. {
  1770. "path": "../packages/core/src/data/ArrayStore.js",
  1771. "requires": [
  1772. 163,
  1773. 175,
  1774. 176
  1775. ],
  1776. "uses": [],
  1777. "idx": 177
  1778. },
  1779. {
  1780. "path": "../packages/core/src/data/StoreManager.js",
  1781. "requires": [
  1782. 55,
  1783. 177
  1784. ],
  1785. "uses": [
  1786. 12,
  1787. 163,
  1788. 171,
  1789. 175,
  1790. 176
  1791. ],
  1792. "idx": 178
  1793. },
  1794. {
  1795. "path": "../packages/core/src/app/domain/Store.js",
  1796. "requires": [
  1797. 96,
  1798. 139
  1799. ],
  1800. "uses": [],
  1801. "idx": 179
  1802. },
  1803. {
  1804. "path": "../packages/core/src/app/Controller.js",
  1805. "requires": [
  1806. 21,
  1807. 97,
  1808. 124,
  1809. 125,
  1810. 178,
  1811. 179
  1812. ],
  1813. "uses": [
  1814. 24,
  1815. 138
  1816. ],
  1817. "idx": 180
  1818. },
  1819. {
  1820. "path": "../packages/core/src/app/Application.js",
  1821. "requires": [
  1822. 55,
  1823. 121,
  1824. 180
  1825. ],
  1826. "uses": [
  1827. 122
  1828. ],
  1829. "idx": 181
  1830. },
  1831. {
  1832. "path": "../packages/core/src/app/Profile.js",
  1833. "requires": [
  1834. 4,
  1835. 180
  1836. ],
  1837. "uses": [],
  1838. "idx": 182
  1839. },
  1840. {
  1841. "path": "../packages/core/src/app/domain/View.js",
  1842. "requires": [
  1843. 88,
  1844. 96
  1845. ],
  1846. "uses": [],
  1847. "idx": 183
  1848. },
  1849. {
  1850. "path": "../packages/core/src/app/ViewController.js",
  1851. "requires": [
  1852. 12,
  1853. 124,
  1854. 183
  1855. ],
  1856. "uses": [],
  1857. "idx": 184
  1858. },
  1859. {
  1860. "path": "../packages/core/src/util/Bag.js",
  1861. "requires": [],
  1862. "uses": [],
  1863. "idx": 185
  1864. },
  1865. {
  1866. "path": "../packages/core/src/util/Scheduler.js",
  1867. "requires": [
  1868. 4,
  1869. 185
  1870. ],
  1871. "uses": [
  1872. 76
  1873. ],
  1874. "idx": 186
  1875. },
  1876. {
  1877. "path": "../packages/core/src/data/Batch.js",
  1878. "requires": [
  1879. 4
  1880. ],
  1881. "uses": [],
  1882. "idx": 187
  1883. },
  1884. {
  1885. "path": "../packages/core/src/data/matrix/Slice.js",
  1886. "requires": [],
  1887. "uses": [],
  1888. "idx": 188
  1889. },
  1890. {
  1891. "path": "../packages/core/src/data/matrix/Side.js",
  1892. "requires": [
  1893. 188
  1894. ],
  1895. "uses": [],
  1896. "idx": 189
  1897. },
  1898. {
  1899. "path": "../packages/core/src/data/matrix/Matrix.js",
  1900. "requires": [
  1901. 189
  1902. ],
  1903. "uses": [],
  1904. "idx": 190
  1905. },
  1906. {
  1907. "path": "../packages/core/src/data/session/ChangesVisitor.js",
  1908. "requires": [],
  1909. "uses": [],
  1910. "idx": 191
  1911. },
  1912. {
  1913. "path": "../packages/core/src/data/session/ChildChangesVisitor.js",
  1914. "requires": [
  1915. 191
  1916. ],
  1917. "uses": [],
  1918. "idx": 192
  1919. },
  1920. {
  1921. "path": "../packages/core/src/data/session/BatchVisitor.js",
  1922. "requires": [],
  1923. "uses": [
  1924. 187
  1925. ],
  1926. "idx": 193
  1927. },
  1928. {
  1929. "path": "../packages/core/src/mixin/Dirty.js",
  1930. "requires": [],
  1931. "uses": [],
  1932. "idx": 194
  1933. },
  1934. {
  1935. "path": "../packages/core/src/data/Session.js",
  1936. "requires": [
  1937. 4,
  1938. 138,
  1939. 187,
  1940. 190,
  1941. 191,
  1942. 192,
  1943. 193,
  1944. 194
  1945. ],
  1946. "uses": [],
  1947. "idx": 195
  1948. },
  1949. {
  1950. "path": "../packages/core/src/util/Schedulable.js",
  1951. "requires": [],
  1952. "uses": [],
  1953. "idx": 196
  1954. },
  1955. {
  1956. "path": "../packages/core/src/app/bind/BaseBinding.js",
  1957. "requires": [
  1958. 196
  1959. ],
  1960. "uses": [],
  1961. "idx": 197
  1962. },
  1963. {
  1964. "path": "../packages/core/src/app/bind/Binding.js",
  1965. "requires": [
  1966. 197
  1967. ],
  1968. "uses": [],
  1969. "idx": 198
  1970. },
  1971. {
  1972. "path": "../packages/core/src/app/bind/AbstractStub.js",
  1973. "requires": [
  1974. 196,
  1975. 198
  1976. ],
  1977. "uses": [],
  1978. "idx": 199
  1979. },
  1980. {
  1981. "path": "../packages/core/src/app/bind/Stub.js",
  1982. "requires": [
  1983. 198,
  1984. 199
  1985. ],
  1986. "uses": [
  1987. 204
  1988. ],
  1989. "idx": 200
  1990. },
  1991. {
  1992. "path": "../packages/core/src/app/bind/LinkStub.js",
  1993. "requires": [
  1994. 200
  1995. ],
  1996. "uses": [],
  1997. "idx": 201
  1998. },
  1999. {
  2000. "path": "../packages/core/src/app/bind/RootStub.js",
  2001. "requires": [
  2002. 199,
  2003. 200,
  2004. 201
  2005. ],
  2006. "uses": [],
  2007. "idx": 202
  2008. },
  2009. {
  2010. "path": "../packages/core/src/app/bind/Multi.js",
  2011. "requires": [
  2012. 197
  2013. ],
  2014. "uses": [],
  2015. "idx": 203
  2016. },
  2017. {
  2018. "path": "../packages/core/src/app/bind/Formula.js",
  2019. "requires": [
  2020. 23,
  2021. 196
  2022. ],
  2023. "uses": [],
  2024. "idx": 204
  2025. },
  2026. {
  2027. "path": "../packages/core/src/util/Fly.js",
  2028. "requires": [],
  2029. "uses": [],
  2030. "idx": 205
  2031. },
  2032. {
  2033. "path": "../packages/core/src/parse/Tokenizer.js",
  2034. "requires": [
  2035. 205
  2036. ],
  2037. "uses": [],
  2038. "idx": 206
  2039. },
  2040. {
  2041. "path": "../packages/core/src/parse/Symbol.js",
  2042. "requires": [],
  2043. "uses": [],
  2044. "idx": 207
  2045. },
  2046. {
  2047. "path": "../packages/core/src/parse/symbol/Constant.js",
  2048. "requires": [
  2049. 207
  2050. ],
  2051. "uses": [],
  2052. "idx": 208
  2053. },
  2054. {
  2055. "path": "../packages/core/src/parse/symbol/Infix.js",
  2056. "requires": [
  2057. 207
  2058. ],
  2059. "uses": [],
  2060. "idx": 209
  2061. },
  2062. {
  2063. "path": "../packages/core/src/parse/symbol/InfixRight.js",
  2064. "requires": [
  2065. 209
  2066. ],
  2067. "uses": [],
  2068. "idx": 210
  2069. },
  2070. {
  2071. "path": "../packages/core/src/parse/symbol/Paren.js",
  2072. "requires": [
  2073. 207
  2074. ],
  2075. "uses": [],
  2076. "idx": 211
  2077. },
  2078. {
  2079. "path": "../packages/core/src/parse/symbol/Prefix.js",
  2080. "requires": [
  2081. 207
  2082. ],
  2083. "uses": [],
  2084. "idx": 212
  2085. },
  2086. {
  2087. "path": "../packages/core/src/parse/Parser.js",
  2088. "requires": [
  2089. 205,
  2090. 206,
  2091. 208,
  2092. 210,
  2093. 211,
  2094. 212
  2095. ],
  2096. "uses": [
  2097. 207,
  2098. 209
  2099. ],
  2100. "idx": 213
  2101. },
  2102. {
  2103. "path": "../packages/core/src/app/bind/Parser.js",
  2104. "requires": [
  2105. 91,
  2106. 213
  2107. ],
  2108. "uses": [],
  2109. "idx": 214
  2110. },
  2111. {
  2112. "path": "../packages/core/src/app/bind/Template.js",
  2113. "requires": [
  2114. 91,
  2115. 214
  2116. ],
  2117. "uses": [],
  2118. "idx": 215
  2119. },
  2120. {
  2121. "path": "../packages/core/src/app/bind/TemplateBinding.js",
  2122. "requires": [
  2123. 197,
  2124. 203,
  2125. 215
  2126. ],
  2127. "uses": [],
  2128. "idx": 216
  2129. },
  2130. {
  2131. "path": "../packages/core/src/data/ChainedStore.js",
  2132. "requires": [
  2133. 139,
  2134. 167
  2135. ],
  2136. "uses": [
  2137. 92,
  2138. 178
  2139. ],
  2140. "idx": 217
  2141. },
  2142. {
  2143. "path": "../packages/core/src/app/ViewModel.js",
  2144. "requires": [
  2145. 3,
  2146. 12,
  2147. 186,
  2148. 195,
  2149. 201,
  2150. 202,
  2151. 203,
  2152. 204,
  2153. 216,
  2154. 217
  2155. ],
  2156. "uses": [
  2157. 1,
  2158. 138
  2159. ],
  2160. "idx": 218
  2161. },
  2162. {
  2163. "path": "../packages/core/src/app/domain/Controller.js",
  2164. "requires": [
  2165. 96,
  2166. 180
  2167. ],
  2168. "uses": [
  2169. 124
  2170. ],
  2171. "idx": 219
  2172. },
  2173. {
  2174. "path": "../packages/core/src/direct/Manager.js",
  2175. "requires": [
  2176. 4,
  2177. 55
  2178. ],
  2179. "uses": [
  2180. 92
  2181. ],
  2182. "idx": 220
  2183. },
  2184. {
  2185. "path": "../packages/core/src/direct/Provider.js",
  2186. "requires": [
  2187. 4,
  2188. 220
  2189. ],
  2190. "uses": [
  2191. 18
  2192. ],
  2193. "idx": 221
  2194. },
  2195. {
  2196. "path": "../packages/core/src/app/domain/Direct.js",
  2197. "requires": [
  2198. 96,
  2199. 221
  2200. ],
  2201. "uses": [],
  2202. "idx": 222
  2203. },
  2204. {
  2205. "path": "../packages/core/src/data/PageMap.js",
  2206. "requires": [
  2207. 23
  2208. ],
  2209. "uses": [],
  2210. "idx": 223
  2211. },
  2212. {
  2213. "path": "../packages/core/src/data/BufferedStore.js",
  2214. "requires": [
  2215. 50,
  2216. 53,
  2217. 127,
  2218. 164,
  2219. 223
  2220. ],
  2221. "uses": [
  2222. 172,
  2223. 173,
  2224. 174
  2225. ],
  2226. "idx": 224
  2227. },
  2228. {
  2229. "path": "../packages/core/src/data/proxy/Direct.js",
  2230. "requires": [
  2231. 168,
  2232. 220
  2233. ],
  2234. "uses": [],
  2235. "idx": 225
  2236. },
  2237. {
  2238. "path": "../packages/core/src/data/DirectStore.js",
  2239. "requires": [
  2240. 175,
  2241. 225
  2242. ],
  2243. "uses": [],
  2244. "idx": 226
  2245. },
  2246. {
  2247. "path": "../packages/core/src/data/JsonP.js",
  2248. "requires": [],
  2249. "uses": [],
  2250. "idx": 227
  2251. },
  2252. {
  2253. "path": "../packages/core/src/data/proxy/JsonP.js",
  2254. "requires": [
  2255. 168,
  2256. 227
  2257. ],
  2258. "uses": [],
  2259. "idx": 228
  2260. },
  2261. {
  2262. "path": "../packages/core/src/data/JsonPStore.js",
  2263. "requires": [
  2264. 170,
  2265. 175,
  2266. 228
  2267. ],
  2268. "uses": [],
  2269. "idx": 229
  2270. },
  2271. {
  2272. "path": "../packages/core/src/data/JsonStore.js",
  2273. "requires": [
  2274. 169,
  2275. 170,
  2276. 171,
  2277. 175
  2278. ],
  2279. "uses": [],
  2280. "idx": 230
  2281. },
  2282. {
  2283. "path": "../packages/core/src/data/ModelManager.js",
  2284. "requires": [
  2285. 138
  2286. ],
  2287. "uses": [
  2288. 157
  2289. ],
  2290. "idx": 231
  2291. },
  2292. {
  2293. "path": "../packages/core/src/data/NodeInterface.js",
  2294. "requires": [
  2295. 4,
  2296. 150,
  2297. 152,
  2298. 154,
  2299. 171
  2300. ],
  2301. "uses": [
  2302. 138
  2303. ],
  2304. "idx": 232
  2305. },
  2306. {
  2307. "path": "../packages/core/src/mixin/Queryable.js",
  2308. "requires": [],
  2309. "uses": [
  2310. 24
  2311. ],
  2312. "idx": 233
  2313. },
  2314. {
  2315. "path": "../packages/core/src/data/TreeModel.js",
  2316. "requires": [
  2317. 157,
  2318. 232,
  2319. 233
  2320. ],
  2321. "uses": [],
  2322. "idx": 234
  2323. },
  2324. {
  2325. "path": "../packages/core/src/data/NodeStore.js",
  2326. "requires": [
  2327. 175,
  2328. 232,
  2329. 234
  2330. ],
  2331. "uses": [
  2332. 157
  2333. ],
  2334. "idx": 235
  2335. },
  2336. {
  2337. "path": "../packages/core/src/data/Request.js",
  2338. "requires": [],
  2339. "uses": [],
  2340. "idx": 236
  2341. },
  2342. {
  2343. "path": "../packages/core/src/data/TreeStore.js",
  2344. "requires": [
  2345. 53,
  2346. 175,
  2347. 232,
  2348. 234
  2349. ],
  2350. "uses": [
  2351. 157
  2352. ],
  2353. "idx": 237
  2354. },
  2355. {
  2356. "path": "../packages/core/src/data/Types.js",
  2357. "requires": [
  2358. 147
  2359. ],
  2360. "uses": [],
  2361. "idx": 238
  2362. },
  2363. {
  2364. "path": "../packages/core/src/data/Validation.js",
  2365. "requires": [
  2366. 157
  2367. ],
  2368. "uses": [],
  2369. "idx": 239
  2370. },
  2371. {
  2372. "path": "../packages/core/src/dom/Helper.js",
  2373. "requires": [],
  2374. "uses": [
  2375. 92
  2376. ],
  2377. "idx": 240
  2378. },
  2379. {
  2380. "path": "../packages/core/src/dom/Query.js",
  2381. "requires": [
  2382. 22,
  2383. 240
  2384. ],
  2385. "uses": [
  2386. 23
  2387. ],
  2388. "idx": 241
  2389. },
  2390. {
  2391. "path": "../packages/core/src/data/reader/Xml.js",
  2392. "requires": [
  2393. 159,
  2394. 241
  2395. ],
  2396. "uses": [],
  2397. "idx": 242
  2398. },
  2399. {
  2400. "path": "../packages/core/src/data/writer/Xml.js",
  2401. "requires": [
  2402. 160
  2403. ],
  2404. "uses": [],
  2405. "idx": 243
  2406. },
  2407. {
  2408. "path": "../packages/core/src/data/XmlStore.js",
  2409. "requires": [
  2410. 169,
  2411. 175,
  2412. 242,
  2413. 243
  2414. ],
  2415. "uses": [],
  2416. "idx": 244
  2417. },
  2418. {
  2419. "path": "../packages/core/src/data/identifier/Negative.js",
  2420. "requires": [
  2421. 156
  2422. ],
  2423. "uses": [],
  2424. "idx": 245
  2425. },
  2426. {
  2427. "path": "../packages/core/src/data/identifier/Uuid.js",
  2428. "requires": [
  2429. 155
  2430. ],
  2431. "uses": [],
  2432. "idx": 246
  2433. },
  2434. {
  2435. "path": "../packages/core/src/data/proxy/WebStorage.js",
  2436. "requires": [
  2437. 156,
  2438. 162
  2439. ],
  2440. "uses": [
  2441. 53,
  2442. 92,
  2443. 158
  2444. ],
  2445. "idx": 247
  2446. },
  2447. {
  2448. "path": "../packages/core/src/data/proxy/LocalStorage.js",
  2449. "requires": [
  2450. 247
  2451. ],
  2452. "uses": [],
  2453. "idx": 248
  2454. },
  2455. {
  2456. "path": "../packages/core/src/data/proxy/Rest.js",
  2457. "requires": [
  2458. 169
  2459. ],
  2460. "uses": [],
  2461. "idx": 249
  2462. },
  2463. {
  2464. "path": "../packages/core/src/data/proxy/SessionStorage.js",
  2465. "requires": [
  2466. 247
  2467. ],
  2468. "uses": [],
  2469. "idx": 250
  2470. },
  2471. {
  2472. "path": "../packages/core/src/data/schema/BelongsTo.js",
  2473. "requires": [],
  2474. "uses": [],
  2475. "idx": 251
  2476. },
  2477. {
  2478. "path": "../packages/core/src/data/schema/HasMany.js",
  2479. "requires": [],
  2480. "uses": [],
  2481. "idx": 252
  2482. },
  2483. {
  2484. "path": "../packages/core/src/data/schema/HasOne.js",
  2485. "requires": [],
  2486. "uses": [],
  2487. "idx": 253
  2488. },
  2489. {
  2490. "path": "../packages/core/src/data/schema/Reference.js",
  2491. "requires": [],
  2492. "uses": [],
  2493. "idx": 254
  2494. },
  2495. {
  2496. "path": "../packages/core/src/data/summary/Base.js",
  2497. "requires": [
  2498. 12
  2499. ],
  2500. "uses": [],
  2501. "idx": 255
  2502. },
  2503. {
  2504. "path": "../packages/core/src/data/summary/Sum.js",
  2505. "requires": [
  2506. 255
  2507. ],
  2508. "uses": [],
  2509. "idx": 256
  2510. },
  2511. {
  2512. "path": "../packages/core/src/data/summary/Average.js",
  2513. "requires": [
  2514. 256
  2515. ],
  2516. "uses": [],
  2517. "idx": 257
  2518. },
  2519. {
  2520. "path": "../packages/core/src/data/summary/Count.js",
  2521. "requires": [
  2522. 255
  2523. ],
  2524. "uses": [],
  2525. "idx": 258
  2526. },
  2527. {
  2528. "path": "../packages/core/src/data/summary/Max.js",
  2529. "requires": [
  2530. 255
  2531. ],
  2532. "uses": [],
  2533. "idx": 259
  2534. },
  2535. {
  2536. "path": "../packages/core/src/data/summary/Min.js",
  2537. "requires": [
  2538. 255
  2539. ],
  2540. "uses": [],
  2541. "idx": 260
  2542. },
  2543. {
  2544. "path": "../packages/core/src/data/validator/AbstractDate.js",
  2545. "requires": [
  2546. 148
  2547. ],
  2548. "uses": [],
  2549. "idx": 261
  2550. },
  2551. {
  2552. "path": "../packages/core/src/data/validator/Bound.js",
  2553. "requires": [
  2554. 148
  2555. ],
  2556. "uses": [
  2557. 92
  2558. ],
  2559. "idx": 262
  2560. },
  2561. {
  2562. "path": "../packages/core/src/data/validator/Format.js",
  2563. "requires": [
  2564. 148
  2565. ],
  2566. "uses": [],
  2567. "idx": 263
  2568. },
  2569. {
  2570. "path": "../packages/core/src/data/validator/CIDRv4.js",
  2571. "requires": [
  2572. 263
  2573. ],
  2574. "uses": [],
  2575. "idx": 264
  2576. },
  2577. {
  2578. "path": "../packages/core/src/data/validator/CIDRv6.js",
  2579. "requires": [
  2580. 263
  2581. ],
  2582. "uses": [],
  2583. "idx": 265
  2584. },
  2585. {
  2586. "path": "../packages/core/src/data/validator/Number.js",
  2587. "requires": [
  2588. 148
  2589. ],
  2590. "uses": [
  2591. 91
  2592. ],
  2593. "idx": 266
  2594. },
  2595. {
  2596. "path": "../packages/core/src/data/validator/Currency.js",
  2597. "requires": [
  2598. 266
  2599. ],
  2600. "uses": [
  2601. 91
  2602. ],
  2603. "idx": 267
  2604. },
  2605. {
  2606. "path": "../packages/core/src/data/validator/CurrencyUS.js",
  2607. "requires": [
  2608. 267
  2609. ],
  2610. "uses": [],
  2611. "idx": 268
  2612. },
  2613. {
  2614. "path": "../packages/core/src/data/validator/Date.js",
  2615. "requires": [
  2616. 261
  2617. ],
  2618. "uses": [],
  2619. "idx": 269
  2620. },
  2621. {
  2622. "path": "../packages/core/src/data/validator/DateTime.js",
  2623. "requires": [
  2624. 261
  2625. ],
  2626. "uses": [],
  2627. "idx": 270
  2628. },
  2629. {
  2630. "path": "../packages/core/src/data/validator/Email.js",
  2631. "requires": [
  2632. 263
  2633. ],
  2634. "uses": [],
  2635. "idx": 271
  2636. },
  2637. {
  2638. "path": "../packages/core/src/data/validator/List.js",
  2639. "requires": [
  2640. 148
  2641. ],
  2642. "uses": [],
  2643. "idx": 272
  2644. },
  2645. {
  2646. "path": "../packages/core/src/data/validator/Exclusion.js",
  2647. "requires": [
  2648. 272
  2649. ],
  2650. "uses": [],
  2651. "idx": 273
  2652. },
  2653. {
  2654. "path": "../packages/core/src/data/validator/IPAddress.js",
  2655. "requires": [
  2656. 263
  2657. ],
  2658. "uses": [],
  2659. "idx": 274
  2660. },
  2661. {
  2662. "path": "../packages/core/src/data/validator/Inclusion.js",
  2663. "requires": [
  2664. 272
  2665. ],
  2666. "uses": [],
  2667. "idx": 275
  2668. },
  2669. {
  2670. "path": "../packages/core/src/data/validator/Length.js",
  2671. "requires": [
  2672. 262
  2673. ],
  2674. "uses": [],
  2675. "idx": 276
  2676. },
  2677. {
  2678. "path": "../packages/core/src/data/validator/Presence.js",
  2679. "requires": [
  2680. 148
  2681. ],
  2682. "uses": [],
  2683. "idx": 277
  2684. },
  2685. {
  2686. "path": "../packages/core/src/data/validator/NotNull.js",
  2687. "requires": [
  2688. 277
  2689. ],
  2690. "uses": [],
  2691. "idx": 278
  2692. },
  2693. {
  2694. "path": "../packages/core/src/data/validator/Phone.js",
  2695. "requires": [
  2696. 263
  2697. ],
  2698. "uses": [],
  2699. "idx": 279
  2700. },
  2701. {
  2702. "path": "../packages/core/src/data/validator/Range.js",
  2703. "requires": [
  2704. 262
  2705. ],
  2706. "uses": [],
  2707. "idx": 280
  2708. },
  2709. {
  2710. "path": "../packages/core/src/data/validator/Time.js",
  2711. "requires": [
  2712. 261
  2713. ],
  2714. "uses": [],
  2715. "idx": 281
  2716. },
  2717. {
  2718. "path": "../packages/core/src/data/validator/Url.js",
  2719. "requires": [
  2720. 263
  2721. ],
  2722. "uses": [],
  2723. "idx": 282
  2724. },
  2725. {
  2726. "path": "../packages/core/src/data/virtual/Group.js",
  2727. "requires": [],
  2728. "uses": [],
  2729. "idx": 283
  2730. },
  2731. {
  2732. "path": "../packages/core/src/data/virtual/Page.js",
  2733. "requires": [],
  2734. "uses": [],
  2735. "idx": 284
  2736. },
  2737. {
  2738. "path": "../packages/core/src/data/virtual/PageMap.js",
  2739. "requires": [
  2740. 284
  2741. ],
  2742. "uses": [],
  2743. "idx": 285
  2744. },
  2745. {
  2746. "path": "../packages/core/src/data/virtual/Range.js",
  2747. "requires": [
  2748. 129
  2749. ],
  2750. "uses": [],
  2751. "idx": 286
  2752. },
  2753. {
  2754. "path": "../packages/core/src/data/virtual/Store.js",
  2755. "requires": [
  2756. 164,
  2757. 172,
  2758. 173,
  2759. 285,
  2760. 286
  2761. ],
  2762. "uses": [
  2763. 127,
  2764. 128,
  2765. 283
  2766. ],
  2767. "idx": 287
  2768. },
  2769. {
  2770. "path": "../packages/core/src/direct/Event.js",
  2771. "requires": [],
  2772. "uses": [],
  2773. "idx": 288
  2774. },
  2775. {
  2776. "path": "../packages/core/src/direct/RemotingEvent.js",
  2777. "requires": [
  2778. 288
  2779. ],
  2780. "uses": [
  2781. 220
  2782. ],
  2783. "idx": 289
  2784. },
  2785. {
  2786. "path": "../packages/core/src/direct/ExceptionEvent.js",
  2787. "requires": [
  2788. 289
  2789. ],
  2790. "uses": [],
  2791. "idx": 290
  2792. },
  2793. {
  2794. "path": "../packages/core/src/direct/JsonProvider.js",
  2795. "requires": [
  2796. 221
  2797. ],
  2798. "uses": [
  2799. 220,
  2800. 290
  2801. ],
  2802. "idx": 291
  2803. },
  2804. {
  2805. "path": "../packages/core/src/direct/PollingProvider.js",
  2806. "requires": [
  2807. 18,
  2808. 56,
  2809. 290,
  2810. 291
  2811. ],
  2812. "uses": [
  2813. 220,
  2814. 389
  2815. ],
  2816. "idx": 292
  2817. },
  2818. {
  2819. "path": "../packages/core/src/direct/RemotingMethod.js",
  2820. "requires": [],
  2821. "uses": [],
  2822. "idx": 293
  2823. },
  2824. {
  2825. "path": "../packages/core/src/direct/Transaction.js",
  2826. "requires": [],
  2827. "uses": [],
  2828. "idx": 294
  2829. },
  2830. {
  2831. "path": "../packages/core/src/direct/RemotingProvider.js",
  2832. "requires": [
  2833. 1,
  2834. 55,
  2835. 220,
  2836. 291,
  2837. 293,
  2838. 294
  2839. ],
  2840. "uses": [
  2841. 78,
  2842. 290
  2843. ],
  2844. "idx": 295
  2845. },
  2846. {
  2847. "path": "../packages/core/src/dom/GarbageCollector.js",
  2848. "requires": [],
  2849. "uses": [
  2850. 49
  2851. ],
  2852. "idx": 296
  2853. },
  2854. {
  2855. "path": "../packages/core/src/dom/TouchAction.js",
  2856. "requires": [
  2857. 35,
  2858. 49
  2859. ],
  2860. "uses": [],
  2861. "idx": 297
  2862. },
  2863. {
  2864. "path": "../packages/core/src/drag/Constraint.js",
  2865. "requires": [
  2866. 12
  2867. ],
  2868. "uses": [
  2869. 34
  2870. ],
  2871. "idx": 298
  2872. },
  2873. {
  2874. "path": "../packages/core/src/drag/Info.js",
  2875. "requires": [
  2876. 10
  2877. ],
  2878. "uses": [],
  2879. "idx": 299
  2880. },
  2881. {
  2882. "path": "../packages/core/src/drag/Item.js",
  2883. "requires": [
  2884. 3,
  2885. 4
  2886. ],
  2887. "uses": [],
  2888. "idx": 300
  2889. },
  2890. {
  2891. "path": "../packages/core/src/drag/Manager.js",
  2892. "requires": [],
  2893. "uses": [
  2894. 49,
  2895. 80,
  2896. 299
  2897. ],
  2898. "idx": 301
  2899. },
  2900. {
  2901. "path": "../packages/core/src/drag/Source.js",
  2902. "requires": [
  2903. 76,
  2904. 298,
  2905. 300
  2906. ],
  2907. "uses": [
  2908. 12,
  2909. 299
  2910. ],
  2911. "idx": 302
  2912. },
  2913. {
  2914. "path": "../packages/core/src/drag/Target.js",
  2915. "requires": [
  2916. 300,
  2917. 301
  2918. ],
  2919. "uses": [],
  2920. "idx": 303
  2921. },
  2922. {
  2923. "path": "../packages/core/src/drag/proxy/None.js",
  2924. "requires": [
  2925. 12
  2926. ],
  2927. "uses": [],
  2928. "idx": 304
  2929. },
  2930. {
  2931. "path": "../packages/core/src/drag/proxy/Original.js",
  2932. "requires": [
  2933. 304
  2934. ],
  2935. "uses": [],
  2936. "idx": 305
  2937. },
  2938. {
  2939. "path": "../packages/core/src/drag/proxy/Placeholder.js",
  2940. "requires": [
  2941. 304
  2942. ],
  2943. "uses": [],
  2944. "idx": 306
  2945. },
  2946. {
  2947. "path": "../packages/core/src/event/gesture/Recognizer.js",
  2948. "requires": [
  2949. 3,
  2950. 38
  2951. ],
  2952. "uses": [],
  2953. "idx": 307
  2954. },
  2955. {
  2956. "path": "../packages/core/src/event/gesture/SingleTouch.js",
  2957. "requires": [
  2958. 307
  2959. ],
  2960. "uses": [],
  2961. "idx": 308
  2962. },
  2963. {
  2964. "path": "../packages/core/src/event/gesture/DoubleTap.js",
  2965. "requires": [
  2966. 308
  2967. ],
  2968. "uses": [
  2969. 49
  2970. ],
  2971. "idx": 309
  2972. },
  2973. {
  2974. "path": "../packages/core/src/event/gesture/Drag.js",
  2975. "requires": [
  2976. 308
  2977. ],
  2978. "uses": [
  2979. 49
  2980. ],
  2981. "idx": 310
  2982. },
  2983. {
  2984. "path": "../packages/core/src/event/gesture/Swipe.js",
  2985. "requires": [
  2986. 308
  2987. ],
  2988. "uses": [],
  2989. "idx": 311
  2990. },
  2991. {
  2992. "path": "../packages/core/src/event/gesture/EdgeSwipe.js",
  2993. "requires": [
  2994. 311
  2995. ],
  2996. "uses": [
  2997. 49
  2998. ],
  2999. "idx": 312
  3000. },
  3001. {
  3002. "path": "../packages/core/src/event/gesture/LongPress.js",
  3003. "requires": [
  3004. 308
  3005. ],
  3006. "uses": [
  3007. 38,
  3008. 49,
  3009. 310
  3010. ],
  3011. "idx": 313
  3012. },
  3013. {
  3014. "path": "../packages/core/src/event/gesture/MultiTouch.js",
  3015. "requires": [
  3016. 307
  3017. ],
  3018. "uses": [],
  3019. "idx": 314
  3020. },
  3021. {
  3022. "path": "../packages/core/src/event/gesture/Pinch.js",
  3023. "requires": [
  3024. 314
  3025. ],
  3026. "uses": [],
  3027. "idx": 315
  3028. },
  3029. {
  3030. "path": "../packages/core/src/event/gesture/Rotate.js",
  3031. "requires": [
  3032. 314
  3033. ],
  3034. "uses": [],
  3035. "idx": 316
  3036. },
  3037. {
  3038. "path": "../packages/core/src/event/gesture/Tap.js",
  3039. "requires": [
  3040. 308
  3041. ],
  3042. "uses": [
  3043. 49
  3044. ],
  3045. "idx": 317
  3046. },
  3047. {
  3048. "path": "../packages/core/src/event/publisher/Focus.js",
  3049. "requires": [
  3050. 37,
  3051. 49,
  3052. 74,
  3053. 76
  3054. ],
  3055. "uses": [
  3056. 36
  3057. ],
  3058. "idx": 318
  3059. },
  3060. {
  3061. "path": "../packages/core/src/field/InputMask.js",
  3062. "requires": [],
  3063. "uses": [],
  3064. "idx": 319
  3065. },
  3066. {
  3067. "path": "../packages/core/src/fx/State.js",
  3068. "requires": [],
  3069. "uses": [],
  3070. "idx": 320
  3071. },
  3072. {
  3073. "path": "../packages/core/src/fx/animation/Abstract.js",
  3074. "requires": [
  3075. 12,
  3076. 25,
  3077. 320
  3078. ],
  3079. "uses": [],
  3080. "idx": 321
  3081. },
  3082. {
  3083. "path": "../packages/core/src/fx/animation/Slide.js",
  3084. "requires": [
  3085. 321
  3086. ],
  3087. "uses": [],
  3088. "idx": 322
  3089. },
  3090. {
  3091. "path": "../packages/core/src/fx/animation/SlideOut.js",
  3092. "requires": [
  3093. 322
  3094. ],
  3095. "uses": [],
  3096. "idx": 323
  3097. },
  3098. {
  3099. "path": "../packages/core/src/fx/animation/Fade.js",
  3100. "requires": [
  3101. 321
  3102. ],
  3103. "uses": [],
  3104. "idx": 324
  3105. },
  3106. {
  3107. "path": "../packages/core/src/fx/animation/FadeOut.js",
  3108. "requires": [
  3109. 324
  3110. ],
  3111. "uses": [],
  3112. "idx": 325
  3113. },
  3114. {
  3115. "path": "../packages/core/src/fx/animation/Flip.js",
  3116. "requires": [
  3117. 321
  3118. ],
  3119. "uses": [],
  3120. "idx": 326
  3121. },
  3122. {
  3123. "path": "../packages/core/src/fx/animation/Pop.js",
  3124. "requires": [
  3125. 321
  3126. ],
  3127. "uses": [],
  3128. "idx": 327
  3129. },
  3130. {
  3131. "path": "../packages/core/src/fx/animation/PopOut.js",
  3132. "requires": [
  3133. 327
  3134. ],
  3135. "uses": [],
  3136. "idx": 328
  3137. },
  3138. {
  3139. "path": "../packages/core/src/fx/Animation.js",
  3140. "requires": [
  3141. 322,
  3142. 323,
  3143. 324,
  3144. 325,
  3145. 326,
  3146. 327,
  3147. 328
  3148. ],
  3149. "uses": [
  3150. 321
  3151. ],
  3152. "idx": 329
  3153. },
  3154. {
  3155. "path": "../packages/core/src/fx/runner/Css.js",
  3156. "requires": [
  3157. 25,
  3158. 329
  3159. ],
  3160. "uses": [
  3161. 49
  3162. ],
  3163. "idx": 330
  3164. },
  3165. {
  3166. "path": "../packages/core/src/fx/runner/CssTransition.js",
  3167. "requires": [
  3168. 19,
  3169. 330
  3170. ],
  3171. "uses": [
  3172. 329
  3173. ],
  3174. "idx": 331
  3175. },
  3176. {
  3177. "path": "../packages/core/src/fx/Runner.js",
  3178. "requires": [
  3179. 331
  3180. ],
  3181. "uses": [],
  3182. "idx": 332
  3183. },
  3184. {
  3185. "path": "../packages/core/src/fx/animation/Cube.js",
  3186. "requires": [
  3187. 321
  3188. ],
  3189. "uses": [],
  3190. "idx": 333
  3191. },
  3192. {
  3193. "path": "../packages/core/src/fx/animation/Wipe.js",
  3194. "requires": [
  3195. 329
  3196. ],
  3197. "uses": [],
  3198. "idx": 334
  3199. },
  3200. {
  3201. "path": "../packages/core/src/fx/animation/WipeOut.js",
  3202. "requires": [
  3203. 334
  3204. ],
  3205. "uses": [],
  3206. "idx": 335
  3207. },
  3208. {
  3209. "path": "../packages/core/src/fx/easing/Bounce.js",
  3210. "requires": [
  3211. 102
  3212. ],
  3213. "uses": [],
  3214. "idx": 336
  3215. },
  3216. {
  3217. "path": "../packages/core/src/fx/easing/Momentum.js",
  3218. "requires": [
  3219. 102
  3220. ],
  3221. "uses": [],
  3222. "idx": 337
  3223. },
  3224. {
  3225. "path": "../packages/core/src/fx/easing/BoundMomentum.js",
  3226. "requires": [
  3227. 102,
  3228. 336,
  3229. 337
  3230. ],
  3231. "uses": [],
  3232. "idx": 338
  3233. },
  3234. {
  3235. "path": "../packages/core/src/fx/easing/EaseIn.js",
  3236. "requires": [
  3237. 103
  3238. ],
  3239. "uses": [],
  3240. "idx": 339
  3241. },
  3242. {
  3243. "path": "../packages/core/src/fx/easing/EaseOut.js",
  3244. "requires": [
  3245. 103
  3246. ],
  3247. "uses": [],
  3248. "idx": 340
  3249. },
  3250. {
  3251. "path": "../packages/core/src/fx/easing/Easing.js",
  3252. "requires": [
  3253. 103
  3254. ],
  3255. "uses": [],
  3256. "idx": 341
  3257. },
  3258. {
  3259. "path": "../packages/core/src/fx/runner/CssAnimation.js",
  3260. "requires": [
  3261. 330
  3262. ],
  3263. "uses": [
  3264. 329
  3265. ],
  3266. "idx": 342
  3267. },
  3268. {
  3269. "path": "../packages/core/src/list/AbstractTreeItem.js",
  3270. "requires": [
  3271. 88
  3272. ],
  3273. "uses": [],
  3274. "idx": 343
  3275. },
  3276. {
  3277. "path": "../packages/core/src/list/RootTreeItem.js",
  3278. "requires": [
  3279. 343
  3280. ],
  3281. "uses": [],
  3282. "idx": 344
  3283. },
  3284. {
  3285. "path": "../packages/core/src/mixin/ItemRippler.js",
  3286. "requires": [],
  3287. "uses": [],
  3288. "idx": 345
  3289. },
  3290. {
  3291. "path": "../packages/core/src/list/TreeItem.js",
  3292. "requires": [
  3293. 88,
  3294. 343
  3295. ],
  3296. "uses": [],
  3297. "idx": 346
  3298. },
  3299. {
  3300. "path": "../packages/core/src/list/Tree.js",
  3301. "requires": [
  3302. 88,
  3303. 344,
  3304. 345,
  3305. 346
  3306. ],
  3307. "uses": [
  3308. 157,
  3309. 178
  3310. ],
  3311. "idx": 347
  3312. },
  3313. {
  3314. "path": "../packages/core/src/mixin/ConfigProxy.js",
  3315. "requires": [
  3316. 0
  3317. ],
  3318. "uses": [],
  3319. "idx": 348
  3320. },
  3321. {
  3322. "path": "../packages/core/src/mixin/ConfigState.js",
  3323. "requires": [
  3324. 0
  3325. ],
  3326. "uses": [],
  3327. "idx": 349
  3328. },
  3329. {
  3330. "path": "../packages/core/src/mixin/Container.js",
  3331. "requires": [
  3332. 0
  3333. ],
  3334. "uses": [
  3335. 21
  3336. ],
  3337. "idx": 350
  3338. },
  3339. {
  3340. "path": "../packages/core/src/util/KeyMap.js",
  3341. "requires": [],
  3342. "uses": [],
  3343. "idx": 351
  3344. },
  3345. {
  3346. "path": "../packages/core/src/util/KeyNav.js",
  3347. "requires": [
  3348. 351
  3349. ],
  3350. "uses": [
  3351. 36
  3352. ],
  3353. "idx": 352
  3354. },
  3355. {
  3356. "path": "../packages/core/src/mixin/FocusableContainer.js",
  3357. "requires": [
  3358. 0,
  3359. 352
  3360. ],
  3361. "uses": [
  3362. 21
  3363. ],
  3364. "idx": 353
  3365. },
  3366. {
  3367. "path": "../packages/core/src/mixin/Hookable.js",
  3368. "requires": [
  3369. 0
  3370. ],
  3371. "uses": [],
  3372. "idx": 354
  3373. },
  3374. {
  3375. "path": "../packages/core/src/mixin/Mashup.js",
  3376. "requires": [
  3377. 0
  3378. ],
  3379. "uses": [
  3380. 92
  3381. ],
  3382. "idx": 355
  3383. },
  3384. {
  3385. "path": "../packages/core/src/mixin/Responsive.js",
  3386. "requires": [
  3387. 0,
  3388. 76
  3389. ],
  3390. "uses": [
  3391. 49
  3392. ],
  3393. "idx": 356
  3394. },
  3395. {
  3396. "path": "../packages/core/src/mixin/Selectable.js",
  3397. "requires": [
  3398. 0
  3399. ],
  3400. "uses": [
  3401. 128
  3402. ],
  3403. "idx": 357
  3404. },
  3405. {
  3406. "path": "../packages/core/src/mixin/StoreWatcher.js",
  3407. "requires": [],
  3408. "uses": [],
  3409. "idx": 358
  3410. },
  3411. {
  3412. "path": "../packages/core/src/mixin/StyleCacher.js",
  3413. "requires": [
  3414. 0
  3415. ],
  3416. "uses": [],
  3417. "idx": 359
  3418. },
  3419. {
  3420. "path": "../packages/core/src/mixin/Traversable.js",
  3421. "requires": [
  3422. 0
  3423. ],
  3424. "uses": [],
  3425. "idx": 360
  3426. },
  3427. {
  3428. "path": "../packages/core/src/perf/Accumulator.js",
  3429. "requires": [
  3430. 95
  3431. ],
  3432. "uses": [],
  3433. "idx": 361
  3434. },
  3435. {
  3436. "path": "../packages/core/src/perf/Monitor.js",
  3437. "requires": [
  3438. 361
  3439. ],
  3440. "uses": [],
  3441. "idx": 362
  3442. },
  3443. {
  3444. "path": "../packages/core/src/plugin/AbstractClipboard.js",
  3445. "requires": [
  3446. 83,
  3447. 351
  3448. ],
  3449. "uses": [
  3450. 49
  3451. ],
  3452. "idx": 363
  3453. },
  3454. {
  3455. "path": "../packages/core/src/plugin/MouseEnter.js",
  3456. "requires": [
  3457. 83
  3458. ],
  3459. "uses": [],
  3460. "idx": 364
  3461. },
  3462. {
  3463. "path": "../packages/core/src/sparkline/Shape.js",
  3464. "requires": [],
  3465. "uses": [],
  3466. "idx": 365
  3467. },
  3468. {
  3469. "path": "../packages/core/src/sparkline/CanvasBase.js",
  3470. "requires": [
  3471. 365
  3472. ],
  3473. "uses": [],
  3474. "idx": 366
  3475. },
  3476. {
  3477. "path": "../packages/core/src/sparkline/CanvasCanvas.js",
  3478. "requires": [
  3479. 366
  3480. ],
  3481. "uses": [],
  3482. "idx": 367
  3483. },
  3484. {
  3485. "path": "../packages/core/src/sparkline/VmlCanvas.js",
  3486. "requires": [
  3487. 366
  3488. ],
  3489. "uses": [],
  3490. "idx": 368
  3491. },
  3492. {
  3493. "path": "../packages/core/src/util/Color.js",
  3494. "requires": [],
  3495. "uses": [],
  3496. "idx": 369
  3497. },
  3498. {
  3499. "path": "../packages/core/src/sparkline/Base.js",
  3500. "requires": [
  3501. 88,
  3502. 95,
  3503. 367,
  3504. 368,
  3505. 369
  3506. ],
  3507. "uses": [],
  3508. "idx": 370
  3509. },
  3510. {
  3511. "path": "../packages/core/src/sparkline/BarBase.js",
  3512. "requires": [
  3513. 370
  3514. ],
  3515. "uses": [],
  3516. "idx": 371
  3517. },
  3518. {
  3519. "path": "../packages/core/src/sparkline/RangeMap.js",
  3520. "requires": [],
  3521. "uses": [],
  3522. "idx": 372
  3523. },
  3524. {
  3525. "path": "../packages/core/src/sparkline/Bar.js",
  3526. "requires": [
  3527. 371,
  3528. 372
  3529. ],
  3530. "uses": [],
  3531. "idx": 373
  3532. },
  3533. {
  3534. "path": "../packages/core/src/sparkline/Box.js",
  3535. "requires": [
  3536. 370
  3537. ],
  3538. "uses": [],
  3539. "idx": 374
  3540. },
  3541. {
  3542. "path": "../packages/core/src/sparkline/Bullet.js",
  3543. "requires": [
  3544. 370
  3545. ],
  3546. "uses": [],
  3547. "idx": 375
  3548. },
  3549. {
  3550. "path": "../packages/core/src/sparkline/Discrete.js",
  3551. "requires": [
  3552. 371
  3553. ],
  3554. "uses": [],
  3555. "idx": 376
  3556. },
  3557. {
  3558. "path": "../packages/core/src/sparkline/Line.js",
  3559. "requires": [
  3560. 370,
  3561. 372
  3562. ],
  3563. "uses": [],
  3564. "idx": 377
  3565. },
  3566. {
  3567. "path": "../packages/core/src/sparkline/Pie.js",
  3568. "requires": [
  3569. 370
  3570. ],
  3571. "uses": [],
  3572. "idx": 378
  3573. },
  3574. {
  3575. "path": "../packages/core/src/sparkline/TriState.js",
  3576. "requires": [
  3577. 371,
  3578. 372
  3579. ],
  3580. "uses": [],
  3581. "idx": 379
  3582. },
  3583. {
  3584. "path": "../packages/core/src/util/Base64.js",
  3585. "requires": [],
  3586. "uses": [],
  3587. "idx": 380
  3588. },
  3589. {
  3590. "path": "../packages/core/src/util/DelimitedValue.js",
  3591. "requires": [],
  3592. "uses": [],
  3593. "idx": 381
  3594. },
  3595. {
  3596. "path": "../packages/core/src/util/CSV.js",
  3597. "requires": [
  3598. 381
  3599. ],
  3600. "uses": [],
  3601. "idx": 382
  3602. },
  3603. {
  3604. "path": "../packages/core/src/util/ClickRepeater.js",
  3605. "requires": [
  3606. 4
  3607. ],
  3608. "uses": [],
  3609. "idx": 383
  3610. },
  3611. {
  3612. "path": "../packages/core/src/util/Cookies.js",
  3613. "requires": [],
  3614. "uses": [],
  3615. "idx": 384
  3616. },
  3617. {
  3618. "path": "../packages/core/src/util/ItemCollection.js",
  3619. "requires": [
  3620. 55
  3621. ],
  3622. "uses": [],
  3623. "idx": 385
  3624. },
  3625. {
  3626. "path": "../packages/core/src/util/LocalStorage.js",
  3627. "requires": [],
  3628. "uses": [],
  3629. "idx": 386
  3630. },
  3631. {
  3632. "path": "../packages/core/src/util/Spans.js",
  3633. "requires": [],
  3634. "uses": [],
  3635. "idx": 387
  3636. },
  3637. {
  3638. "path": "../packages/core/src/util/TSV.js",
  3639. "requires": [
  3640. 381
  3641. ],
  3642. "uses": [],
  3643. "idx": 388
  3644. },
  3645. {
  3646. "path": "../packages/core/src/util/TaskManager.js",
  3647. "requires": [
  3648. 56
  3649. ],
  3650. "uses": [],
  3651. "idx": 389
  3652. },
  3653. {
  3654. "path": "../packages/core/src/util/TextMetrics.js",
  3655. "requires": [
  3656. 49
  3657. ],
  3658. "uses": [
  3659. 74
  3660. ],
  3661. "idx": 390
  3662. },
  3663. {
  3664. "path": "../packages/core/src/util/paintmonitor/OverflowChange.js",
  3665. "requires": [
  3666. 45
  3667. ],
  3668. "uses": [],
  3669. "idx": 391
  3670. },
  3671. {
  3672. "path": "../packages/core/src/util/sizemonitor/OverflowChange.js",
  3673. "requires": [
  3674. 41
  3675. ],
  3676. "uses": [
  3677. 40
  3678. ],
  3679. "idx": 392
  3680. },
  3681. {
  3682. "path": "../packages/core/src/util/translatable/CssPosition.js",
  3683. "requires": [
  3684. 105
  3685. ],
  3686. "uses": [],
  3687. "idx": 393
  3688. },
  3689. {
  3690. "path": "../packages/core/src/util/translatable/CssTransform.js",
  3691. "requires": [
  3692. 105
  3693. ],
  3694. "uses": [],
  3695. "idx": 394
  3696. },
  3697. {
  3698. "path": "../packages/core/src/util/translatable/ScrollParent.js",
  3699. "requires": [
  3700. 105
  3701. ],
  3702. "uses": [],
  3703. "idx": 395
  3704. },
  3705. {
  3706. "path": "../classic/classic/src/Action.js",
  3707. "requires": [],
  3708. "uses": [],
  3709. "idx": 396
  3710. },
  3711. {
  3712. "path": "../classic/classic/src/ElementLoader.js",
  3713. "requires": [
  3714. 51
  3715. ],
  3716. "uses": [
  3717. 17,
  3718. 18
  3719. ],
  3720. "idx": 397
  3721. },
  3722. {
  3723. "path": "../classic/classic/src/ComponentLoader.js",
  3724. "requires": [
  3725. 397
  3726. ],
  3727. "uses": [],
  3728. "idx": 398
  3729. },
  3730. {
  3731. "path": "../classic/classic/src/layout/SizeModel.js",
  3732. "requires": [],
  3733. "uses": [],
  3734. "idx": 399
  3735. },
  3736. {
  3737. "path": "../classic/classic/src/layout/Layout.js",
  3738. "requires": [
  3739. 12,
  3740. 95,
  3741. 399
  3742. ],
  3743. "uses": [
  3744. 626
  3745. ],
  3746. "idx": 400
  3747. },
  3748. {
  3749. "path": "../classic/classic/src/layout/container/Container.js",
  3750. "requires": [
  3751. 95,
  3752. 109,
  3753. 400
  3754. ],
  3755. "uses": [
  3756. 240
  3757. ],
  3758. "idx": 401
  3759. },
  3760. {
  3761. "path": "../classic/classic/src/layout/container/Auto.js",
  3762. "requires": [
  3763. 401
  3764. ],
  3765. "uses": [
  3766. 95
  3767. ],
  3768. "idx": 402
  3769. },
  3770. {
  3771. "path": "../classic/classic/src/ZIndexManager.js",
  3772. "requires": [
  3773. 76,
  3774. 172,
  3775. 173
  3776. ],
  3777. "uses": [
  3778. 49,
  3779. 128
  3780. ],
  3781. "idx": 403
  3782. },
  3783. {
  3784. "path": "../classic/classic/src/container/Container.js",
  3785. "requires": [
  3786. 55,
  3787. 114,
  3788. 233,
  3789. 350,
  3790. 353,
  3791. 385,
  3792. 396,
  3793. 402,
  3794. 403
  3795. ],
  3796. "uses": [
  3797. 12,
  3798. 21,
  3799. 24,
  3800. 49
  3801. ],
  3802. "idx": 404
  3803. },
  3804. {
  3805. "path": "../classic/classic/src/layout/container/Editor.js",
  3806. "requires": [
  3807. 401
  3808. ],
  3809. "uses": [],
  3810. "idx": 405
  3811. },
  3812. {
  3813. "path": "../classic/classic/src/Editor.js",
  3814. "requires": [
  3815. 404,
  3816. 405
  3817. ],
  3818. "uses": [
  3819. 1,
  3820. 21
  3821. ],
  3822. "idx": 406
  3823. },
  3824. {
  3825. "path": "../classic/classic/src/EventManager.js",
  3826. "requires": [],
  3827. "uses": [
  3828. 76
  3829. ],
  3830. "idx": 407
  3831. },
  3832. {
  3833. "path": "../classic/classic/src/Gadget.js",
  3834. "requires": [],
  3835. "uses": [],
  3836. "idx": 408
  3837. },
  3838. {
  3839. "path": "../classic/classic/src/Img.js",
  3840. "requires": [
  3841. 77,
  3842. 114
  3843. ],
  3844. "uses": [],
  3845. "idx": 409
  3846. },
  3847. {
  3848. "path": "../classic/classic/src/util/StoreHolder.js",
  3849. "requires": [
  3850. 178
  3851. ],
  3852. "uses": [],
  3853. "idx": 410
  3854. },
  3855. {
  3856. "path": "../classic/classic/src/LoadMask.js",
  3857. "requires": [
  3858. 114,
  3859. 410
  3860. ],
  3861. "uses": [
  3862. 49,
  3863. 76,
  3864. 178
  3865. ],
  3866. "idx": 411
  3867. },
  3868. {
  3869. "path": "../classic/classic/src/layout/component/Component.js",
  3870. "requires": [
  3871. 400
  3872. ],
  3873. "uses": [],
  3874. "idx": 412
  3875. },
  3876. {
  3877. "path": "../classic/classic/src/layout/component/Auto.js",
  3878. "requires": [
  3879. 412
  3880. ],
  3881. "uses": [],
  3882. "idx": 413
  3883. },
  3884. {
  3885. "path": "../classic/classic/src/layout/component/ProgressBar.js",
  3886. "requires": [
  3887. 413
  3888. ],
  3889. "uses": [],
  3890. "idx": 414
  3891. },
  3892. {
  3893. "path": "../classic/classic/src/ProgressBar.js",
  3894. "requires": [
  3895. 89,
  3896. 92,
  3897. 99,
  3898. 114,
  3899. 389,
  3900. 414
  3901. ],
  3902. "uses": [
  3903. 72
  3904. ],
  3905. "idx": 415
  3906. },
  3907. {
  3908. "path": "../classic/classic/src/dom/ButtonElement.js",
  3909. "requires": [
  3910. 49
  3911. ],
  3912. "uses": [],
  3913. "idx": 416
  3914. },
  3915. {
  3916. "path": "../classic/classic/src/button/Manager.js",
  3917. "requires": [],
  3918. "uses": [],
  3919. "idx": 417
  3920. },
  3921. {
  3922. "path": "../classic/classic/src/menu/Manager.js",
  3923. "requires": [],
  3924. "uses": [
  3925. 21,
  3926. 107,
  3927. 114,
  3928. 590
  3929. ],
  3930. "idx": 418
  3931. },
  3932. {
  3933. "path": "../classic/classic/src/button/Button.js",
  3934. "requires": [
  3935. 77,
  3936. 114,
  3937. 233,
  3938. 383,
  3939. 390,
  3940. 416,
  3941. 417,
  3942. 418
  3943. ],
  3944. "uses": [
  3945. 49,
  3946. 534
  3947. ],
  3948. "idx": 419
  3949. },
  3950. {
  3951. "path": "../classic/classic/src/button/Split.js",
  3952. "requires": [
  3953. 419
  3954. ],
  3955. "uses": [
  3956. 49,
  3957. 417
  3958. ],
  3959. "idx": 420
  3960. },
  3961. {
  3962. "path": "../classic/classic/src/button/Cycle.js",
  3963. "requires": [
  3964. 420
  3965. ],
  3966. "uses": [],
  3967. "idx": 421
  3968. },
  3969. {
  3970. "path": "../classic/classic/src/layout/container/SegmentedButton.js",
  3971. "requires": [
  3972. 401
  3973. ],
  3974. "uses": [],
  3975. "idx": 422
  3976. },
  3977. {
  3978. "path": "../classic/classic/src/button/Segmented.js",
  3979. "requires": [
  3980. 404,
  3981. 419,
  3982. 422
  3983. ],
  3984. "uses": [],
  3985. "idx": 423
  3986. },
  3987. {
  3988. "path": "../classic/classic/src/panel/Bar.js",
  3989. "requires": [
  3990. 404
  3991. ],
  3992. "uses": [],
  3993. "idx": 424
  3994. },
  3995. {
  3996. "path": "../classic/classic/src/panel/Title.js",
  3997. "requires": [
  3998. 77,
  3999. 114
  4000. ],
  4001. "uses": [],
  4002. "idx": 425
  4003. },
  4004. {
  4005. "path": "../classic/classic/src/panel/Tool.js",
  4006. "requires": [
  4007. 77,
  4008. 114
  4009. ],
  4010. "uses": [
  4011. 534
  4012. ],
  4013. "idx": 426
  4014. },
  4015. {
  4016. "path": "../classic/classic/src/panel/Header.js",
  4017. "requires": [
  4018. 413,
  4019. 424,
  4020. 425,
  4021. 426
  4022. ],
  4023. "uses": [
  4024. 21
  4025. ],
  4026. "idx": 427
  4027. },
  4028. {
  4029. "path": "../classic/classic/src/layout/container/boxOverflow/None.js",
  4030. "requires": [
  4031. 12
  4032. ],
  4033. "uses": [],
  4034. "idx": 428
  4035. },
  4036. {
  4037. "path": "../classic/classic/src/layout/container/boxOverflow/Scroller.js",
  4038. "requires": [
  4039. 4,
  4040. 49,
  4041. 383,
  4042. 428
  4043. ],
  4044. "uses": [
  4045. 114
  4046. ],
  4047. "idx": 429
  4048. },
  4049. {
  4050. "path": "../classic/classic/src/dd/DragDropManager.js",
  4051. "requires": [
  4052. 34,
  4053. 35
  4054. ],
  4055. "uses": [
  4056. 49,
  4057. 462,
  4058. 534
  4059. ],
  4060. "idx": 430
  4061. },
  4062. {
  4063. "path": "../classic/classic/src/resizer/Splitter.js",
  4064. "requires": [
  4065. 95,
  4066. 114
  4067. ],
  4068. "uses": [
  4069. 458
  4070. ],
  4071. "idx": 431
  4072. },
  4073. {
  4074. "path": "../classic/classic/src/layout/container/Box.js",
  4075. "requires": [
  4076. 91,
  4077. 401,
  4078. 428,
  4079. 429,
  4080. 430,
  4081. 431
  4082. ],
  4083. "uses": [
  4084. 12,
  4085. 399,
  4086. 413
  4087. ],
  4088. "idx": 432
  4089. },
  4090. {
  4091. "path": "../classic/classic/src/layout/container/HBox.js",
  4092. "requires": [
  4093. 432
  4094. ],
  4095. "uses": [],
  4096. "idx": 433
  4097. },
  4098. {
  4099. "path": "../classic/classic/src/layout/container/VBox.js",
  4100. "requires": [
  4101. 432
  4102. ],
  4103. "uses": [],
  4104. "idx": 434
  4105. },
  4106. {
  4107. "path": "../classic/classic/src/toolbar/Toolbar.js",
  4108. "requires": [
  4109. 404,
  4110. 413,
  4111. 433,
  4112. 434
  4113. ],
  4114. "uses": [
  4115. 114,
  4116. 364,
  4117. 516,
  4118. 537,
  4119. 661,
  4120. 662
  4121. ],
  4122. "idx": 435
  4123. },
  4124. {
  4125. "path": "../classic/classic/src/dd/DragDrop.js",
  4126. "requires": [
  4127. 430
  4128. ],
  4129. "uses": [
  4130. 49
  4131. ],
  4132. "idx": 436
  4133. },
  4134. {
  4135. "path": "../classic/classic/src/dd/DD.js",
  4136. "requires": [
  4137. 430,
  4138. 436
  4139. ],
  4140. "uses": [
  4141. 49
  4142. ],
  4143. "idx": 437
  4144. },
  4145. {
  4146. "path": "../classic/classic/src/dd/DDProxy.js",
  4147. "requires": [
  4148. 437
  4149. ],
  4150. "uses": [
  4151. 430
  4152. ],
  4153. "idx": 438
  4154. },
  4155. {
  4156. "path": "../classic/classic/src/dd/StatusProxy.js",
  4157. "requires": [
  4158. 114
  4159. ],
  4160. "uses": [],
  4161. "idx": 439
  4162. },
  4163. {
  4164. "path": "../classic/classic/src/dd/DragSource.js",
  4165. "requires": [
  4166. 430,
  4167. 438,
  4168. 439
  4169. ],
  4170. "uses": [
  4171. 413
  4172. ],
  4173. "idx": 440
  4174. },
  4175. {
  4176. "path": "../classic/classic/src/panel/Proxy.js",
  4177. "requires": [],
  4178. "uses": [
  4179. 49
  4180. ],
  4181. "idx": 441
  4182. },
  4183. {
  4184. "path": "../classic/classic/src/panel/DD.js",
  4185. "requires": [
  4186. 440,
  4187. 441
  4188. ],
  4189. "uses": [],
  4190. "idx": 442
  4191. },
  4192. {
  4193. "path": "../classic/classic/src/layout/component/Dock.js",
  4194. "requires": [
  4195. 412
  4196. ],
  4197. "uses": [
  4198. 24,
  4199. 49,
  4200. 399
  4201. ],
  4202. "idx": 443
  4203. },
  4204. {
  4205. "path": "../classic/classic/src/util/Memento.js",
  4206. "requires": [],
  4207. "uses": [],
  4208. "idx": 444
  4209. },
  4210. {
  4211. "path": "../classic/classic/src/container/DockingContainer.js",
  4212. "requires": [
  4213. 49,
  4214. 55
  4215. ],
  4216. "uses": [
  4217. 24,
  4218. 240,
  4219. 385
  4220. ],
  4221. "idx": 445
  4222. },
  4223. {
  4224. "path": "../classic/classic/src/panel/Panel.js",
  4225. "requires": [
  4226. 49,
  4227. 55,
  4228. 72,
  4229. 95,
  4230. 404,
  4231. 427,
  4232. 435,
  4233. 442,
  4234. 443,
  4235. 444,
  4236. 445
  4237. ],
  4238. "uses": [
  4239. 1,
  4240. 21,
  4241. 34,
  4242. 91,
  4243. 98,
  4244. 99,
  4245. 114,
  4246. 240,
  4247. 352,
  4248. 402,
  4249. 413,
  4250. 426,
  4251. 479
  4252. ],
  4253. "idx": 446
  4254. },
  4255. {
  4256. "path": "../classic/classic/src/layout/container/Table.js",
  4257. "requires": [
  4258. 401
  4259. ],
  4260. "uses": [],
  4261. "idx": 447
  4262. },
  4263. {
  4264. "path": "../classic/classic/src/container/ButtonGroup.js",
  4265. "requires": [
  4266. 446,
  4267. 447
  4268. ],
  4269. "uses": [],
  4270. "idx": 448
  4271. },
  4272. {
  4273. "path": "../classic/classic/src/container/Monitor.js",
  4274. "requires": [],
  4275. "uses": [
  4276. 24,
  4277. 55
  4278. ],
  4279. "idx": 449
  4280. },
  4281. {
  4282. "path": "../classic/classic/src/plugin/Responsive.js",
  4283. "requires": [
  4284. 356
  4285. ],
  4286. "uses": [],
  4287. "idx": 450
  4288. },
  4289. {
  4290. "path": "../classic/classic/src/plugin/Viewport.js",
  4291. "requires": [
  4292. 450
  4293. ],
  4294. "uses": [
  4295. 49,
  4296. 399
  4297. ],
  4298. "idx": 451
  4299. },
  4300. {
  4301. "path": "../classic/classic/src/container/Viewport.js",
  4302. "requires": [
  4303. 356,
  4304. 404,
  4305. 451
  4306. ],
  4307. "uses": [],
  4308. "idx": 452
  4309. },
  4310. {
  4311. "path": "../classic/classic/src/layout/container/Anchor.js",
  4312. "requires": [
  4313. 402
  4314. ],
  4315. "uses": [],
  4316. "idx": 453
  4317. },
  4318. {
  4319. "path": "../classic/classic/src/dashboard/Panel.js",
  4320. "requires": [
  4321. 446
  4322. ],
  4323. "uses": [
  4324. 21
  4325. ],
  4326. "idx": 454
  4327. },
  4328. {
  4329. "path": "../classic/classic/src/dashboard/Column.js",
  4330. "requires": [
  4331. 404,
  4332. 453,
  4333. 454
  4334. ],
  4335. "uses": [],
  4336. "idx": 455
  4337. },
  4338. {
  4339. "path": "../classic/classic/src/layout/container/Column.js",
  4340. "requires": [
  4341. 402
  4342. ],
  4343. "uses": [],
  4344. "idx": 456
  4345. },
  4346. {
  4347. "path": "../classic/classic/src/dd/DragTracker.js",
  4348. "requires": [
  4349. 51
  4350. ],
  4351. "uses": [
  4352. 34,
  4353. 114,
  4354. 352
  4355. ],
  4356. "idx": 457
  4357. },
  4358. {
  4359. "path": "../classic/classic/src/resizer/SplitterTracker.js",
  4360. "requires": [
  4361. 34,
  4362. 457
  4363. ],
  4364. "uses": [
  4365. 49,
  4366. 103
  4367. ],
  4368. "idx": 458
  4369. },
  4370. {
  4371. "path": "../classic/classic/src/layout/container/ColumnSplitterTracker.js",
  4372. "requires": [
  4373. 458
  4374. ],
  4375. "uses": [],
  4376. "idx": 459
  4377. },
  4378. {
  4379. "path": "../classic/classic/src/layout/container/ColumnSplitter.js",
  4380. "requires": [
  4381. 431,
  4382. 459
  4383. ],
  4384. "uses": [],
  4385. "idx": 460
  4386. },
  4387. {
  4388. "path": "../classic/classic/src/layout/container/Dashboard.js",
  4389. "requires": [
  4390. 456,
  4391. 460
  4392. ],
  4393. "uses": [
  4394. 413
  4395. ],
  4396. "idx": 461
  4397. },
  4398. {
  4399. "path": "../classic/classic/src/dd/DDTarget.js",
  4400. "requires": [
  4401. 436
  4402. ],
  4403. "uses": [],
  4404. "idx": 462
  4405. },
  4406. {
  4407. "path": "../classic/classic/src/dd/ScrollManager.js",
  4408. "requires": [
  4409. 430
  4410. ],
  4411. "uses": [],
  4412. "idx": 463
  4413. },
  4414. {
  4415. "path": "../classic/classic/src/dd/DropTarget.js",
  4416. "requires": [
  4417. 462,
  4418. 463
  4419. ],
  4420. "uses": [],
  4421. "idx": 464
  4422. },
  4423. {
  4424. "path": "../classic/classic/src/dashboard/DropZone.js",
  4425. "requires": [
  4426. 464
  4427. ],
  4428. "uses": [],
  4429. "idx": 465
  4430. },
  4431. {
  4432. "path": "../classic/classic/src/dashboard/Part.js",
  4433. "requires": [
  4434. 3,
  4435. 12,
  4436. 130
  4437. ],
  4438. "uses": [],
  4439. "idx": 466
  4440. },
  4441. {
  4442. "path": "../classic/classic/src/dashboard/Dashboard.js",
  4443. "requires": [
  4444. 446,
  4445. 455,
  4446. 461,
  4447. 465,
  4448. 466
  4449. ],
  4450. "uses": [
  4451. 12,
  4452. 112,
  4453. 128
  4454. ],
  4455. "idx": 467
  4456. },
  4457. {
  4458. "path": "../classic/classic/src/dd/DragZone.js",
  4459. "requires": [
  4460. 440
  4461. ],
  4462. "uses": [
  4463. 463,
  4464. 469
  4465. ],
  4466. "idx": 468
  4467. },
  4468. {
  4469. "path": "../classic/classic/src/dd/Registry.js",
  4470. "requires": [],
  4471. "uses": [],
  4472. "idx": 469
  4473. },
  4474. {
  4475. "path": "../classic/classic/src/dd/DropZone.js",
  4476. "requires": [
  4477. 464,
  4478. 469
  4479. ],
  4480. "uses": [
  4481. 430
  4482. ],
  4483. "idx": 470
  4484. },
  4485. {
  4486. "path": "../classic/classic/src/dom/Layer.js",
  4487. "requires": [
  4488. 49
  4489. ],
  4490. "uses": [
  4491. 240
  4492. ],
  4493. "idx": 471
  4494. },
  4495. {
  4496. "path": "../classic/classic/src/enums.js",
  4497. "requires": [],
  4498. "uses": [],
  4499. "idx": 472
  4500. },
  4501. {
  4502. "path": "../classic/classic/src/event/publisher/MouseEnterLeave.js",
  4503. "requires": [
  4504. 37
  4505. ],
  4506. "uses": [],
  4507. "idx": 473
  4508. },
  4509. {
  4510. "path": "../classic/classic/src/flash/Component.js",
  4511. "requires": [
  4512. 114
  4513. ],
  4514. "uses": [],
  4515. "idx": 474
  4516. },
  4517. {
  4518. "path": "../classic/classic/src/form/action/Action.js",
  4519. "requires": [],
  4520. "uses": [],
  4521. "idx": 475
  4522. },
  4523. {
  4524. "path": "../classic/classic/src/form/action/Load.js",
  4525. "requires": [
  4526. 17,
  4527. 475
  4528. ],
  4529. "uses": [
  4530. 18
  4531. ],
  4532. "idx": 476
  4533. },
  4534. {
  4535. "path": "../classic/classic/src/form/action/Submit.js",
  4536. "requires": [
  4537. 475
  4538. ],
  4539. "uses": [
  4540. 18,
  4541. 240
  4542. ],
  4543. "idx": 477
  4544. },
  4545. {
  4546. "path": "../classic/classic/src/form/action/StandardSubmit.js",
  4547. "requires": [
  4548. 477
  4549. ],
  4550. "uses": [],
  4551. "idx": 478
  4552. },
  4553. {
  4554. "path": "../classic/classic/src/util/ComponentDragger.js",
  4555. "requires": [
  4556. 457
  4557. ],
  4558. "uses": [
  4559. 34,
  4560. 49
  4561. ],
  4562. "idx": 479
  4563. },
  4564. {
  4565. "path": "../classic/classic/src/window/Window.js",
  4566. "requires": [
  4567. 34,
  4568. 446,
  4569. 479
  4570. ],
  4571. "uses": [],
  4572. "idx": 480
  4573. },
  4574. {
  4575. "path": "../classic/classic/src/form/Labelable.js",
  4576. "requires": [
  4577. 0,
  4578. 95
  4579. ],
  4580. "uses": [
  4581. 49,
  4582. 533
  4583. ],
  4584. "idx": 481
  4585. },
  4586. {
  4587. "path": "../classic/classic/src/form/field/Field.js",
  4588. "requires": [],
  4589. "uses": [],
  4590. "idx": 482
  4591. },
  4592. {
  4593. "path": "../classic/classic/src/form/field/Base.js",
  4594. "requires": [
  4595. 1,
  4596. 95,
  4597. 114,
  4598. 481,
  4599. 482
  4600. ],
  4601. "uses": [
  4602. 92,
  4603. 240
  4604. ],
  4605. "idx": 483
  4606. },
  4607. {
  4608. "path": "../classic/classic/src/layout/component/field/Text.js",
  4609. "requires": [
  4610. 413
  4611. ],
  4612. "uses": [],
  4613. "idx": 484
  4614. },
  4615. {
  4616. "path": "../classic/classic/src/form/field/VTypes.js",
  4617. "requires": [],
  4618. "uses": [],
  4619. "idx": 485
  4620. },
  4621. {
  4622. "path": "../classic/classic/src/form/trigger/Trigger.js",
  4623. "requires": [
  4624. 12,
  4625. 383
  4626. ],
  4627. "uses": [
  4628. 49,
  4629. 95
  4630. ],
  4631. "idx": 486
  4632. },
  4633. {
  4634. "path": "../classic/classic/src/form/field/Text.js",
  4635. "requires": [
  4636. 390,
  4637. 399,
  4638. 483,
  4639. 484,
  4640. 485,
  4641. 486
  4642. ],
  4643. "uses": [
  4644. 91,
  4645. 92,
  4646. 99
  4647. ],
  4648. "idx": 487
  4649. },
  4650. {
  4651. "path": "../classic/classic/src/form/field/TextArea.js",
  4652. "requires": [
  4653. 1,
  4654. 95,
  4655. 487
  4656. ],
  4657. "uses": [
  4658. 91,
  4659. 390
  4660. ],
  4661. "idx": 488
  4662. },
  4663. {
  4664. "path": "../classic/classic/src/window/MessageBox.js",
  4665. "requires": [
  4666. 415,
  4667. 419,
  4668. 433,
  4669. 435,
  4670. 453,
  4671. 480,
  4672. 487,
  4673. 488
  4674. ],
  4675. "uses": [
  4676. 114,
  4677. 404,
  4678. 413,
  4679. 414
  4680. ],
  4681. "idx": 489
  4682. },
  4683. {
  4684. "path": "../classic/classic/src/form/Basic.js",
  4685. "requires": [
  4686. 1,
  4687. 51,
  4688. 55,
  4689. 141,
  4690. 476,
  4691. 477,
  4692. 478,
  4693. 489
  4694. ],
  4695. "uses": [
  4696. 449
  4697. ],
  4698. "idx": 490
  4699. },
  4700. {
  4701. "path": "../classic/classic/src/form/FieldAncestor.js",
  4702. "requires": [
  4703. 0,
  4704. 449
  4705. ],
  4706. "uses": [],
  4707. "idx": 491
  4708. },
  4709. {
  4710. "path": "../classic/classic/src/layout/component/field/FieldContainer.js",
  4711. "requires": [
  4712. 413
  4713. ],
  4714. "uses": [],
  4715. "idx": 492
  4716. },
  4717. {
  4718. "path": "../classic/classic/src/form/FieldContainer.js",
  4719. "requires": [
  4720. 404,
  4721. 481,
  4722. 491,
  4723. 492
  4724. ],
  4725. "uses": [],
  4726. "idx": 493
  4727. },
  4728. {
  4729. "path": "../classic/classic/src/layout/container/CheckboxGroup.js",
  4730. "requires": [
  4731. 401
  4732. ],
  4733. "uses": [
  4734. 240
  4735. ],
  4736. "idx": 494
  4737. },
  4738. {
  4739. "path": "../classic/classic/src/form/CheckboxManager.js",
  4740. "requires": [
  4741. 55
  4742. ],
  4743. "uses": [],
  4744. "idx": 495
  4745. },
  4746. {
  4747. "path": "../classic/classic/src/form/field/Checkbox.js",
  4748. "requires": [
  4749. 95,
  4750. 483,
  4751. 495
  4752. ],
  4753. "uses": [],
  4754. "idx": 496
  4755. },
  4756. {
  4757. "path": "../classic/classic/src/form/CheckboxGroup.js",
  4758. "requires": [
  4759. 482,
  4760. 483,
  4761. 493,
  4762. 494,
  4763. 496
  4764. ],
  4765. "uses": [],
  4766. "idx": 497
  4767. },
  4768. {
  4769. "path": "../classic/classic/src/form/FieldSet.js",
  4770. "requires": [
  4771. 404,
  4772. 491
  4773. ],
  4774. "uses": [
  4775. 49,
  4776. 98,
  4777. 114,
  4778. 240,
  4779. 413,
  4780. 426,
  4781. 453,
  4782. 496,
  4783. 629
  4784. ],
  4785. "idx": 498
  4786. },
  4787. {
  4788. "path": "../classic/classic/src/form/Label.js",
  4789. "requires": [
  4790. 91,
  4791. 114
  4792. ],
  4793. "uses": [],
  4794. "idx": 499
  4795. },
  4796. {
  4797. "path": "../classic/classic/src/form/Panel.js",
  4798. "requires": [
  4799. 56,
  4800. 446,
  4801. 490,
  4802. 491
  4803. ],
  4804. "uses": [
  4805. 389
  4806. ],
  4807. "idx": 500
  4808. },
  4809. {
  4810. "path": "../classic/classic/src/form/RadioManager.js",
  4811. "requires": [
  4812. 55
  4813. ],
  4814. "uses": [],
  4815. "idx": 501
  4816. },
  4817. {
  4818. "path": "../classic/classic/src/form/field/Radio.js",
  4819. "requires": [
  4820. 496,
  4821. 501
  4822. ],
  4823. "uses": [],
  4824. "idx": 502
  4825. },
  4826. {
  4827. "path": "../classic/classic/src/form/RadioGroup.js",
  4828. "requires": [
  4829. 497,
  4830. 502
  4831. ],
  4832. "uses": [
  4833. 501
  4834. ],
  4835. "idx": 503
  4836. },
  4837. {
  4838. "path": "../classic/classic/src/form/action/DirectAction.js",
  4839. "requires": [
  4840. 0
  4841. ],
  4842. "uses": [
  4843. 220
  4844. ],
  4845. "idx": 504
  4846. },
  4847. {
  4848. "path": "../classic/classic/src/form/action/DirectLoad.js",
  4849. "requires": [
  4850. 220,
  4851. 476,
  4852. 504
  4853. ],
  4854. "uses": [],
  4855. "idx": 505
  4856. },
  4857. {
  4858. "path": "../classic/classic/src/form/action/DirectSubmit.js",
  4859. "requires": [
  4860. 220,
  4861. 477,
  4862. 504
  4863. ],
  4864. "uses": [],
  4865. "idx": 506
  4866. },
  4867. {
  4868. "path": "../classic/classic/src/form/field/Picker.js",
  4869. "requires": [
  4870. 352,
  4871. 487
  4872. ],
  4873. "uses": [],
  4874. "idx": 507
  4875. },
  4876. {
  4877. "path": "../classic/classic/src/selection/Model.js",
  4878. "requires": [
  4879. 4,
  4880. 12,
  4881. 185,
  4882. 410
  4883. ],
  4884. "uses": [],
  4885. "idx": 508
  4886. },
  4887. {
  4888. "path": "../classic/classic/src/selection/DataViewModel.js",
  4889. "requires": [
  4890. 352,
  4891. 508
  4892. ],
  4893. "uses": [],
  4894. "idx": 509
  4895. },
  4896. {
  4897. "path": "../classic/classic/src/view/NavigationModel.js",
  4898. "requires": [
  4899. 12,
  4900. 51,
  4901. 410
  4902. ],
  4903. "uses": [
  4904. 352
  4905. ],
  4906. "idx": 510
  4907. },
  4908. {
  4909. "path": "../classic/classic/src/view/AbstractView.js",
  4910. "requires": [
  4911. 74,
  4912. 75,
  4913. 101,
  4914. 114,
  4915. 410,
  4916. 411,
  4917. 509,
  4918. 510
  4919. ],
  4920. "uses": [
  4921. 1,
  4922. 12,
  4923. 49,
  4924. 92,
  4925. 95,
  4926. 178,
  4927. 240
  4928. ],
  4929. "idx": 511
  4930. },
  4931. {
  4932. "path": "../classic/classic/src/view/View.js",
  4933. "requires": [
  4934. 511
  4935. ],
  4936. "uses": [],
  4937. "idx": 512
  4938. },
  4939. {
  4940. "path": "../classic/classic/src/view/BoundListKeyNav.js",
  4941. "requires": [
  4942. 510
  4943. ],
  4944. "uses": [
  4945. 36,
  4946. 352
  4947. ],
  4948. "idx": 513
  4949. },
  4950. {
  4951. "path": "../classic/classic/src/layout/component/BoundList.js",
  4952. "requires": [
  4953. 413
  4954. ],
  4955. "uses": [],
  4956. "idx": 514
  4957. },
  4958. {
  4959. "path": "../classic/classic/src/toolbar/Item.js",
  4960. "requires": [
  4961. 114,
  4962. 435
  4963. ],
  4964. "uses": [],
  4965. "idx": 515
  4966. },
  4967. {
  4968. "path": "../classic/classic/src/toolbar/TextItem.js",
  4969. "requires": [
  4970. 95,
  4971. 435,
  4972. 515
  4973. ],
  4974. "uses": [],
  4975. "idx": 516
  4976. },
  4977. {
  4978. "path": "../classic/classic/src/form/trigger/Spinner.js",
  4979. "requires": [
  4980. 486
  4981. ],
  4982. "uses": [],
  4983. "idx": 517
  4984. },
  4985. {
  4986. "path": "../classic/classic/src/form/field/Spinner.js",
  4987. "requires": [
  4988. 352,
  4989. 487,
  4990. 517
  4991. ],
  4992. "uses": [],
  4993. "idx": 518
  4994. },
  4995. {
  4996. "path": "../classic/classic/src/form/field/Number.js",
  4997. "requires": [
  4998. 518
  4999. ],
  5000. "uses": [
  5001. 91,
  5002. 92
  5003. ],
  5004. "idx": 519
  5005. },
  5006. {
  5007. "path": "../classic/classic/src/toolbar/Paging.js",
  5008. "requires": [
  5009. 410,
  5010. 435,
  5011. 516,
  5012. 519
  5013. ],
  5014. "uses": [
  5015. 92,
  5016. 413,
  5017. 484,
  5018. 517
  5019. ],
  5020. "idx": 520
  5021. },
  5022. {
  5023. "path": "../classic/classic/src/view/BoundList.js",
  5024. "requires": [
  5025. 49,
  5026. 233,
  5027. 512,
  5028. 513,
  5029. 514,
  5030. 520
  5031. ],
  5032. "uses": [
  5033. 95,
  5034. 413
  5035. ],
  5036. "idx": 521
  5037. },
  5038. {
  5039. "path": "../classic/classic/src/form/field/ComboBox.js",
  5040. "requires": [
  5041. 1,
  5042. 178,
  5043. 410,
  5044. 507,
  5045. 521
  5046. ],
  5047. "uses": [
  5048. 49,
  5049. 50,
  5050. 95,
  5051. 128,
  5052. 157,
  5053. 173,
  5054. 240,
  5055. 352,
  5056. 509,
  5057. 513,
  5058. 514
  5059. ],
  5060. "idx": 522
  5061. },
  5062. {
  5063. "path": "../classic/classic/src/picker/Month.js",
  5064. "requires": [
  5065. 95,
  5066. 114,
  5067. 383,
  5068. 419
  5069. ],
  5070. "uses": [
  5071. 413
  5072. ],
  5073. "idx": 523
  5074. },
  5075. {
  5076. "path": "../classic/classic/src/picker/Date.js",
  5077. "requires": [
  5078. 66,
  5079. 95,
  5080. 114,
  5081. 352,
  5082. 383,
  5083. 419,
  5084. 420,
  5085. 523
  5086. ],
  5087. "uses": [
  5088. 92,
  5089. 240,
  5090. 413
  5091. ],
  5092. "idx": 524
  5093. },
  5094. {
  5095. "path": "../classic/classic/src/form/field/Date.js",
  5096. "requires": [
  5097. 507,
  5098. 524
  5099. ],
  5100. "uses": [
  5101. 92,
  5102. 413
  5103. ],
  5104. "idx": 525
  5105. },
  5106. {
  5107. "path": "../classic/classic/src/form/field/Display.js",
  5108. "requires": [
  5109. 91,
  5110. 95,
  5111. 483
  5112. ],
  5113. "uses": [],
  5114. "idx": 526
  5115. },
  5116. {
  5117. "path": "../classic/classic/src/form/field/FileButton.js",
  5118. "requires": [
  5119. 419
  5120. ],
  5121. "uses": [],
  5122. "idx": 527
  5123. },
  5124. {
  5125. "path": "../classic/classic/src/form/trigger/Component.js",
  5126. "requires": [
  5127. 486
  5128. ],
  5129. "uses": [],
  5130. "idx": 528
  5131. },
  5132. {
  5133. "path": "../classic/classic/src/form/field/File.js",
  5134. "requires": [
  5135. 487,
  5136. 527,
  5137. 528
  5138. ],
  5139. "uses": [
  5140. 413
  5141. ],
  5142. "idx": 529
  5143. },
  5144. {
  5145. "path": "../classic/classic/src/form/field/Hidden.js",
  5146. "requires": [
  5147. 483
  5148. ],
  5149. "uses": [],
  5150. "idx": 530
  5151. },
  5152. {
  5153. "path": "../classic/classic/src/tip/Tip.js",
  5154. "requires": [
  5155. 446
  5156. ],
  5157. "uses": [
  5158. 35,
  5159. 114
  5160. ],
  5161. "idx": 531
  5162. },
  5163. {
  5164. "path": "../classic/classic/src/tip/ToolTip.js",
  5165. "requires": [
  5166. 33,
  5167. 531
  5168. ],
  5169. "uses": [
  5170. 35,
  5171. 74
  5172. ],
  5173. "idx": 532
  5174. },
  5175. {
  5176. "path": "../classic/classic/src/tip/QuickTip.js",
  5177. "requires": [
  5178. 532
  5179. ],
  5180. "uses": [],
  5181. "idx": 533
  5182. },
  5183. {
  5184. "path": "../classic/classic/src/tip/QuickTipManager.js",
  5185. "requires": [
  5186. 533
  5187. ],
  5188. "uses": [],
  5189. "idx": 534
  5190. },
  5191. {
  5192. "path": "../classic/classic/src/picker/Color.js",
  5193. "requires": [
  5194. 95,
  5195. 114
  5196. ],
  5197. "uses": [],
  5198. "idx": 535
  5199. },
  5200. {
  5201. "path": "../classic/classic/src/layout/component/field/HtmlEditor.js",
  5202. "requires": [
  5203. 492
  5204. ],
  5205. "uses": [],
  5206. "idx": 536
  5207. },
  5208. {
  5209. "path": "../classic/classic/src/toolbar/Separator.js",
  5210. "requires": [
  5211. 435,
  5212. 515
  5213. ],
  5214. "uses": [],
  5215. "idx": 537
  5216. },
  5217. {
  5218. "path": "../classic/classic/src/layout/container/boxOverflow/Menu.js",
  5219. "requires": [
  5220. 419,
  5221. 428,
  5222. 537
  5223. ],
  5224. "uses": [
  5225. 413,
  5226. 429,
  5227. 434,
  5228. 443,
  5229. 496,
  5230. 588,
  5231. 590,
  5232. 661
  5233. ],
  5234. "idx": 538
  5235. },
  5236. {
  5237. "path": "../classic/classic/src/form/field/HtmlEditor.js",
  5238. "requires": [
  5239. 91,
  5240. 389,
  5241. 434,
  5242. 435,
  5243. 482,
  5244. 493,
  5245. 515,
  5246. 534,
  5247. 535,
  5248. 536,
  5249. 538
  5250. ],
  5251. "uses": [
  5252. 1,
  5253. 92,
  5254. 114,
  5255. 240,
  5256. 413,
  5257. 429,
  5258. 443,
  5259. 590
  5260. ],
  5261. "idx": 539
  5262. },
  5263. {
  5264. "path": "../classic/classic/src/view/TagKeyNav.js",
  5265. "requires": [
  5266. 513
  5267. ],
  5268. "uses": [],
  5269. "idx": 540
  5270. },
  5271. {
  5272. "path": "../classic/classic/src/form/field/Tag.js",
  5273. "requires": [
  5274. 175,
  5275. 217,
  5276. 508,
  5277. 522,
  5278. 540
  5279. ],
  5280. "uses": [
  5281. 50,
  5282. 92,
  5283. 95,
  5284. 163,
  5285. 170,
  5286. 171
  5287. ],
  5288. "idx": 541
  5289. },
  5290. {
  5291. "path": "../classic/classic/src/picker/Time.js",
  5292. "requires": [
  5293. 175,
  5294. 521
  5295. ],
  5296. "uses": [
  5297. 50
  5298. ],
  5299. "idx": 542
  5300. },
  5301. {
  5302. "path": "../classic/classic/src/form/field/Time.js",
  5303. "requires": [
  5304. 513,
  5305. 522,
  5306. 525,
  5307. 542
  5308. ],
  5309. "uses": [
  5310. 92,
  5311. 95,
  5312. 509,
  5313. 514
  5314. ],
  5315. "idx": 543
  5316. },
  5317. {
  5318. "path": "../classic/classic/src/form/field/Trigger.js",
  5319. "requires": [
  5320. 240,
  5321. 383,
  5322. 487
  5323. ],
  5324. "uses": [],
  5325. "idx": 544
  5326. },
  5327. {
  5328. "path": "../classic/classic/src/grid/CellContext.js",
  5329. "requires": [],
  5330. "uses": [],
  5331. "idx": 545
  5332. },
  5333. {
  5334. "path": "../classic/classic/src/grid/CellEditor.js",
  5335. "requires": [
  5336. 406
  5337. ],
  5338. "uses": [
  5339. 49,
  5340. 404
  5341. ],
  5342. "idx": 546
  5343. },
  5344. {
  5345. "path": "../classic/classic/src/grid/ColumnComponentLayout.js",
  5346. "requires": [
  5347. 413
  5348. ],
  5349. "uses": [],
  5350. "idx": 547
  5351. },
  5352. {
  5353. "path": "../classic/classic/src/layout/container/Fit.js",
  5354. "requires": [
  5355. 401
  5356. ],
  5357. "uses": [],
  5358. "idx": 548
  5359. },
  5360. {
  5361. "path": "../classic/classic/src/panel/Table.js",
  5362. "requires": [
  5363. 446,
  5364. 548
  5365. ],
  5366. "uses": [
  5367. 1,
  5368. 76,
  5369. 112,
  5370. 178,
  5371. 218,
  5372. 240,
  5373. 545,
  5374. 552,
  5375. 559,
  5376. 569,
  5377. 603,
  5378. 604,
  5379. 646,
  5380. 647,
  5381. 648
  5382. ],
  5383. "idx": 549
  5384. },
  5385. {
  5386. "path": "../classic/classic/src/grid/ColumnLayout.js",
  5387. "requires": [
  5388. 433,
  5389. 549
  5390. ],
  5391. "uses": [],
  5392. "idx": 550
  5393. },
  5394. {
  5395. "path": "../classic/classic/src/grid/ColumnManager.js",
  5396. "requires": [],
  5397. "uses": [],
  5398. "idx": 551
  5399. },
  5400. {
  5401. "path": "../classic/classic/src/grid/NavigationModel.js",
  5402. "requires": [
  5403. 510
  5404. ],
  5405. "uses": [
  5406. 21,
  5407. 36,
  5408. 49,
  5409. 74,
  5410. 114,
  5411. 352,
  5412. 545
  5413. ],
  5414. "idx": 552
  5415. },
  5416. {
  5417. "path": "../classic/classic/src/view/TableLayout.js",
  5418. "requires": [
  5419. 413
  5420. ],
  5421. "uses": [],
  5422. "idx": 553
  5423. },
  5424. {
  5425. "path": "../classic/classic/src/grid/locking/RowSynchronizer.js",
  5426. "requires": [],
  5427. "uses": [],
  5428. "idx": 554
  5429. },
  5430. {
  5431. "path": "../classic/classic/src/view/NodeCache.js",
  5432. "requires": [
  5433. 75
  5434. ],
  5435. "uses": [
  5436. 49,
  5437. 74
  5438. ],
  5439. "idx": 555
  5440. },
  5441. {
  5442. "path": "../classic/classic/src/scroll/TableScroller.js",
  5443. "requires": [
  5444. 107
  5445. ],
  5446. "uses": [
  5447. 10
  5448. ],
  5449. "idx": 556
  5450. },
  5451. {
  5452. "path": "../classic/classic/src/view/Table.js",
  5453. "requires": [
  5454. 1,
  5455. 55,
  5456. 74,
  5457. 233,
  5458. 512,
  5459. 545,
  5460. 553,
  5461. 554,
  5462. 555,
  5463. 556
  5464. ],
  5465. "uses": [
  5466. 12,
  5467. 49,
  5468. 95,
  5469. 114,
  5470. 157,
  5471. 569
  5472. ],
  5473. "idx": 557
  5474. },
  5475. {
  5476. "path": "../classic/classic/src/grid/Panel.js",
  5477. "requires": [
  5478. 549,
  5479. 557
  5480. ],
  5481. "uses": [],
  5482. "idx": 558
  5483. },
  5484. {
  5485. "path": "../classic/classic/src/grid/RowContext.js",
  5486. "requires": [],
  5487. "uses": [
  5488. 12
  5489. ],
  5490. "idx": 559
  5491. },
  5492. {
  5493. "path": "../classic/classic/src/grid/RowEditorButtons.js",
  5494. "requires": [
  5495. 404
  5496. ],
  5497. "uses": [
  5498. 413,
  5499. 419,
  5500. 446
  5501. ],
  5502. "idx": 560
  5503. },
  5504. {
  5505. "path": "../classic/classic/src/grid/RowEditor.js",
  5506. "requires": [
  5507. 352,
  5508. 500,
  5509. 532,
  5510. 560
  5511. ],
  5512. "uses": [
  5513. 49,
  5514. 66,
  5515. 76,
  5516. 402,
  5517. 404,
  5518. 413,
  5519. 443,
  5520. 526,
  5521. 545
  5522. ],
  5523. "idx": 561
  5524. },
  5525. {
  5526. "path": "../classic/classic/src/grid/Scroller.js",
  5527. "requires": [],
  5528. "uses": [],
  5529. "idx": 562
  5530. },
  5531. {
  5532. "path": "../classic/classic/src/view/DropZone.js",
  5533. "requires": [
  5534. 470
  5535. ],
  5536. "uses": [
  5537. 114,
  5538. 413
  5539. ],
  5540. "idx": 563
  5541. },
  5542. {
  5543. "path": "../classic/classic/src/grid/ViewDropZone.js",
  5544. "requires": [
  5545. 563
  5546. ],
  5547. "uses": [],
  5548. "idx": 564
  5549. },
  5550. {
  5551. "path": "../classic/classic/src/grid/plugin/HeaderResizer.js",
  5552. "requires": [
  5553. 34,
  5554. 83,
  5555. 457
  5556. ],
  5557. "uses": [
  5558. 570
  5559. ],
  5560. "idx": 565
  5561. },
  5562. {
  5563. "path": "../classic/classic/src/grid/header/DragZone.js",
  5564. "requires": [
  5565. 468
  5566. ],
  5567. "uses": [],
  5568. "idx": 566
  5569. },
  5570. {
  5571. "path": "../classic/classic/src/grid/header/DropZone.js",
  5572. "requires": [
  5573. 470
  5574. ],
  5575. "uses": [
  5576. 430
  5577. ],
  5578. "idx": 567
  5579. },
  5580. {
  5581. "path": "../classic/classic/src/grid/plugin/HeaderReorderer.js",
  5582. "requires": [
  5583. 83,
  5584. 566,
  5585. 567
  5586. ],
  5587. "uses": [],
  5588. "idx": 568
  5589. },
  5590. {
  5591. "path": "../classic/classic/src/grid/header/Container.js",
  5592. "requires": [
  5593. 352,
  5594. 404,
  5595. 550,
  5596. 565,
  5597. 568
  5598. ],
  5599. "uses": [
  5600. 1,
  5601. 114,
  5602. 413,
  5603. 429,
  5604. 434,
  5605. 443,
  5606. 551,
  5607. 570,
  5608. 588,
  5609. 589,
  5610. 590
  5611. ],
  5612. "idx": 569
  5613. },
  5614. {
  5615. "path": "../classic/classic/src/grid/column/Column.js",
  5616. "requires": [
  5617. 214,
  5618. 547,
  5619. 550,
  5620. 569
  5621. ],
  5622. "uses": [
  5623. 53,
  5624. 91,
  5625. 565
  5626. ],
  5627. "idx": 570
  5628. },
  5629. {
  5630. "path": "../classic/classic/src/grid/column/ActionProxy.js",
  5631. "requires": [],
  5632. "uses": [],
  5633. "idx": 571
  5634. },
  5635. {
  5636. "path": "../classic/classic/src/grid/column/Action.js",
  5637. "requires": [
  5638. 77,
  5639. 91,
  5640. 570,
  5641. 571
  5642. ],
  5643. "uses": [
  5644. 49
  5645. ],
  5646. "idx": 572
  5647. },
  5648. {
  5649. "path": "../classic/classic/src/grid/column/Boolean.js",
  5650. "requires": [
  5651. 570
  5652. ],
  5653. "uses": [],
  5654. "idx": 573
  5655. },
  5656. {
  5657. "path": "../classic/classic/src/grid/column/Check.js",
  5658. "requires": [
  5659. 570
  5660. ],
  5661. "uses": [
  5662. 545
  5663. ],
  5664. "idx": 574
  5665. },
  5666. {
  5667. "path": "../classic/classic/src/grid/column/Date.js",
  5668. "requires": [
  5669. 570
  5670. ],
  5671. "uses": [
  5672. 91
  5673. ],
  5674. "idx": 575
  5675. },
  5676. {
  5677. "path": "../classic/classic/src/grid/column/Number.js",
  5678. "requires": [
  5679. 91,
  5680. 570
  5681. ],
  5682. "uses": [],
  5683. "idx": 576
  5684. },
  5685. {
  5686. "path": "../classic/classic/src/grid/column/RowNumberer.js",
  5687. "requires": [
  5688. 570
  5689. ],
  5690. "uses": [
  5691. 545
  5692. ],
  5693. "idx": 577
  5694. },
  5695. {
  5696. "path": "../classic/classic/src/grid/column/Template.js",
  5697. "requires": [
  5698. 95,
  5699. 570
  5700. ],
  5701. "uses": [
  5702. 574
  5703. ],
  5704. "idx": 578
  5705. },
  5706. {
  5707. "path": "../classic/classic/src/grid/column/Widget.js",
  5708. "requires": [
  5709. 359,
  5710. 570
  5711. ],
  5712. "uses": [],
  5713. "idx": 579
  5714. },
  5715. {
  5716. "path": "../classic/classic/src/grid/feature/Feature.js",
  5717. "requires": [
  5718. 51
  5719. ],
  5720. "uses": [],
  5721. "idx": 580
  5722. },
  5723. {
  5724. "path": "../classic/classic/src/grid/feature/AbstractSummary.js",
  5725. "requires": [
  5726. 580
  5727. ],
  5728. "uses": [],
  5729. "idx": 581
  5730. },
  5731. {
  5732. "path": "../classic/classic/src/grid/feature/GroupStore.js",
  5733. "requires": [
  5734. 51
  5735. ],
  5736. "uses": [
  5737. 128
  5738. ],
  5739. "idx": 582
  5740. },
  5741. {
  5742. "path": "../classic/classic/src/grid/feature/Grouping.js",
  5743. "requires": [
  5744. 580,
  5745. 581,
  5746. 582
  5747. ],
  5748. "uses": [
  5749. 95,
  5750. 157
  5751. ],
  5752. "idx": 583
  5753. },
  5754. {
  5755. "path": "../classic/classic/src/grid/feature/GroupingSummary.js",
  5756. "requires": [
  5757. 583
  5758. ],
  5759. "uses": [],
  5760. "idx": 584
  5761. },
  5762. {
  5763. "path": "../classic/classic/src/grid/feature/RowBody.js",
  5764. "requires": [
  5765. 580
  5766. ],
  5767. "uses": [
  5768. 95
  5769. ],
  5770. "idx": 585
  5771. },
  5772. {
  5773. "path": "../classic/classic/src/grid/feature/Summary.js",
  5774. "requires": [
  5775. 581
  5776. ],
  5777. "uses": [
  5778. 114,
  5779. 157,
  5780. 413
  5781. ],
  5782. "idx": 586
  5783. },
  5784. {
  5785. "path": "../classic/classic/src/menu/Item.js",
  5786. "requires": [
  5787. 77,
  5788. 114,
  5789. 233
  5790. ],
  5791. "uses": [
  5792. 418,
  5793. 534
  5794. ],
  5795. "idx": 587
  5796. },
  5797. {
  5798. "path": "../classic/classic/src/menu/CheckItem.js",
  5799. "requires": [
  5800. 587
  5801. ],
  5802. "uses": [
  5803. 418
  5804. ],
  5805. "idx": 588
  5806. },
  5807. {
  5808. "path": "../classic/classic/src/menu/Separator.js",
  5809. "requires": [
  5810. 587
  5811. ],
  5812. "uses": [],
  5813. "idx": 589
  5814. },
  5815. {
  5816. "path": "../classic/classic/src/menu/Menu.js",
  5817. "requires": [
  5818. 418,
  5819. 434,
  5820. 446,
  5821. 587,
  5822. 588,
  5823. 589
  5824. ],
  5825. "uses": [
  5826. 1,
  5827. 21,
  5828. 36,
  5829. 49,
  5830. 352,
  5831. 413
  5832. ],
  5833. "idx": 590
  5834. },
  5835. {
  5836. "path": "../classic/classic/src/grid/filters/filter/Base.js",
  5837. "requires": [
  5838. 12,
  5839. 429,
  5840. 434,
  5841. 443,
  5842. 590
  5843. ],
  5844. "uses": [
  5845. 1,
  5846. 50
  5847. ],
  5848. "idx": 591
  5849. },
  5850. {
  5851. "path": "../classic/classic/src/grid/filters/filter/SingleFilter.js",
  5852. "requires": [
  5853. 591
  5854. ],
  5855. "uses": [],
  5856. "idx": 592
  5857. },
  5858. {
  5859. "path": "../classic/classic/src/grid/filters/filter/Boolean.js",
  5860. "requires": [
  5861. 592
  5862. ],
  5863. "uses": [],
  5864. "idx": 593
  5865. },
  5866. {
  5867. "path": "../classic/classic/src/grid/filters/filter/TriFilter.js",
  5868. "requires": [
  5869. 591
  5870. ],
  5871. "uses": [],
  5872. "idx": 594
  5873. },
  5874. {
  5875. "path": "../classic/classic/src/grid/filters/filter/Date.js",
  5876. "requires": [
  5877. 413,
  5878. 588,
  5879. 594
  5880. ],
  5881. "uses": [
  5882. 429,
  5883. 434,
  5884. 443,
  5885. 524,
  5886. 639
  5887. ],
  5888. "idx": 595
  5889. },
  5890. {
  5891. "path": "../classic/classic/src/grid/filters/filter/List.js",
  5892. "requires": [
  5893. 592
  5894. ],
  5895. "uses": [
  5896. 175,
  5897. 178
  5898. ],
  5899. "idx": 596
  5900. },
  5901. {
  5902. "path": "../classic/classic/src/grid/filters/filter/Number.js",
  5903. "requires": [
  5904. 484,
  5905. 517,
  5906. 594
  5907. ],
  5908. "uses": [
  5909. 519
  5910. ],
  5911. "idx": 597
  5912. },
  5913. {
  5914. "path": "../classic/classic/src/grid/filters/filter/String.js",
  5915. "requires": [
  5916. 484,
  5917. 487,
  5918. 592
  5919. ],
  5920. "uses": [
  5921. 50
  5922. ],
  5923. "idx": 598
  5924. },
  5925. {
  5926. "path": "../classic/classic/src/grid/filters/Filters.js",
  5927. "requires": [
  5928. 83,
  5929. 410,
  5930. 591,
  5931. 592,
  5932. 593,
  5933. 594,
  5934. 595,
  5935. 596,
  5936. 597,
  5937. 598
  5938. ],
  5939. "uses": [
  5940. 12
  5941. ],
  5942. "idx": 599
  5943. },
  5944. {
  5945. "path": "../classic/classic/src/grid/locking/HeaderContainer.js",
  5946. "requires": [
  5947. 551,
  5948. 569
  5949. ],
  5950. "uses": [],
  5951. "idx": 600
  5952. },
  5953. {
  5954. "path": "../classic/classic/src/grid/locking/View.js",
  5955. "requires": [
  5956. 51,
  5957. 86,
  5958. 114,
  5959. 410,
  5960. 511,
  5961. 557
  5962. ],
  5963. "uses": [
  5964. 107,
  5965. 411,
  5966. 545
  5967. ],
  5968. "idx": 601
  5969. },
  5970. {
  5971. "path": "../classic/classic/src/scroll/LockingScroller.js",
  5972. "requires": [
  5973. 107
  5974. ],
  5975. "uses": [
  5976. 10
  5977. ],
  5978. "idx": 602
  5979. },
  5980. {
  5981. "path": "../classic/classic/src/grid/locking/Lockable.js",
  5982. "requires": [
  5983. 114,
  5984. 557,
  5985. 569,
  5986. 600,
  5987. 601,
  5988. 602
  5989. ],
  5990. "uses": [
  5991. 1,
  5992. 34,
  5993. 107,
  5994. 178,
  5995. 402,
  5996. 413,
  5997. 431,
  5998. 432,
  5999. 446,
  6000. 549
  6001. ],
  6002. "idx": 603
  6003. },
  6004. {
  6005. "path": "../classic/classic/src/grid/plugin/BufferedRenderer.js",
  6006. "requires": [
  6007. 83,
  6008. 554
  6009. ],
  6010. "uses": [
  6011. 1,
  6012. 49,
  6013. 114
  6014. ],
  6015. "idx": 604
  6016. },
  6017. {
  6018. "path": "../classic/classic/src/grid/plugin/Editing.js",
  6019. "requires": [
  6020. 4,
  6021. 83,
  6022. 352,
  6023. 483,
  6024. 557,
  6025. 570
  6026. ],
  6027. "uses": [
  6028. 21,
  6029. 114,
  6030. 413,
  6031. 545
  6032. ],
  6033. "idx": 605
  6034. },
  6035. {
  6036. "path": "../classic/classic/src/grid/plugin/CellEditing.js",
  6037. "requires": [
  6038. 1,
  6039. 546,
  6040. 605
  6041. ],
  6042. "uses": [
  6043. 55,
  6044. 405,
  6045. 413,
  6046. 545
  6047. ],
  6048. "idx": 606
  6049. },
  6050. {
  6051. "path": "../classic/classic/src/grid/plugin/Clipboard.js",
  6052. "requires": [
  6053. 91,
  6054. 363,
  6055. 388
  6056. ],
  6057. "uses": [
  6058. 545
  6059. ],
  6060. "idx": 607
  6061. },
  6062. {
  6063. "path": "../classic/classic/src/grid/plugin/DragDrop.js",
  6064. "requires": [
  6065. 83
  6066. ],
  6067. "uses": [
  6068. 564,
  6069. 667
  6070. ],
  6071. "idx": 608
  6072. },
  6073. {
  6074. "path": "../classic/classic/src/grid/plugin/RowEditing.js",
  6075. "requires": [
  6076. 561,
  6077. 605
  6078. ],
  6079. "uses": [],
  6080. "idx": 609
  6081. },
  6082. {
  6083. "path": "../classic/classic/src/grid/plugin/RowExpander.js",
  6084. "requires": [
  6085. 83,
  6086. 585
  6087. ],
  6088. "uses": [
  6089. 95,
  6090. 570
  6091. ],
  6092. "idx": 610
  6093. },
  6094. {
  6095. "path": "../classic/classic/src/grid/plugin/RowWidget.js",
  6096. "requires": [
  6097. 3,
  6098. 359,
  6099. 610
  6100. ],
  6101. "uses": [
  6102. 83,
  6103. 585
  6104. ],
  6105. "idx": 611
  6106. },
  6107. {
  6108. "path": "../classic/classic/src/grid/property/Grid.js",
  6109. "requires": [
  6110. 558
  6111. ],
  6112. "uses": [
  6113. 21,
  6114. 95,
  6115. 157,
  6116. 405,
  6117. 413,
  6118. 483,
  6119. 484,
  6120. 487,
  6121. 517,
  6122. 519,
  6123. 522,
  6124. 525,
  6125. 545,
  6126. 546,
  6127. 557,
  6128. 606,
  6129. 613,
  6130. 616
  6131. ],
  6132. "idx": 612
  6133. },
  6134. {
  6135. "path": "../classic/classic/src/grid/property/HeaderContainer.js",
  6136. "requires": [
  6137. 91,
  6138. 569
  6139. ],
  6140. "uses": [],
  6141. "idx": 613
  6142. },
  6143. {
  6144. "path": "../classic/classic/src/grid/property/Property.js",
  6145. "requires": [
  6146. 157
  6147. ],
  6148. "uses": [],
  6149. "idx": 614
  6150. },
  6151. {
  6152. "path": "../classic/classic/src/grid/property/Reader.js",
  6153. "requires": [
  6154. 159
  6155. ],
  6156. "uses": [
  6157. 158
  6158. ],
  6159. "idx": 615
  6160. },
  6161. {
  6162. "path": "../classic/classic/src/grid/property/Store.js",
  6163. "requires": [
  6164. 163,
  6165. 175,
  6166. 614,
  6167. 615
  6168. ],
  6169. "uses": [
  6170. 171
  6171. ],
  6172. "idx": 616
  6173. },
  6174. {
  6175. "path": "../classic/classic/src/grid/selection/Selection.js",
  6176. "requires": [],
  6177. "uses": [],
  6178. "idx": 617
  6179. },
  6180. {
  6181. "path": "../classic/classic/src/grid/selection/Cells.js",
  6182. "requires": [
  6183. 617
  6184. ],
  6185. "uses": [
  6186. 545
  6187. ],
  6188. "idx": 618
  6189. },
  6190. {
  6191. "path": "../classic/classic/src/grid/selection/Columns.js",
  6192. "requires": [
  6193. 617
  6194. ],
  6195. "uses": [
  6196. 545
  6197. ],
  6198. "idx": 619
  6199. },
  6200. {
  6201. "path": "../classic/classic/src/grid/selection/Replicator.js",
  6202. "requires": [
  6203. 83
  6204. ],
  6205. "uses": [],
  6206. "idx": 620
  6207. },
  6208. {
  6209. "path": "../classic/classic/src/grid/selection/Rows.js",
  6210. "requires": [
  6211. 128,
  6212. 617
  6213. ],
  6214. "uses": [
  6215. 545
  6216. ],
  6217. "idx": 621
  6218. },
  6219. {
  6220. "path": "../classic/classic/src/grid/selection/SelectionExtender.js",
  6221. "requires": [
  6222. 457
  6223. ],
  6224. "uses": [
  6225. 49,
  6226. 389
  6227. ],
  6228. "idx": 622
  6229. },
  6230. {
  6231. "path": "../classic/classic/src/grid/selection/SpreadsheetModel.js",
  6232. "requires": [
  6233. 508,
  6234. 577,
  6235. 617,
  6236. 618,
  6237. 619,
  6238. 621,
  6239. 622
  6240. ],
  6241. "uses": [
  6242. 389,
  6243. 402,
  6244. 463,
  6245. 545,
  6246. 547,
  6247. 574
  6248. ],
  6249. "idx": 623
  6250. },
  6251. {
  6252. "path": "../classic/classic/src/util/Queue.js",
  6253. "requires": [],
  6254. "uses": [],
  6255. "idx": 624
  6256. },
  6257. {
  6258. "path": "../classic/classic/src/layout/ContextItem.js",
  6259. "requires": [],
  6260. "uses": [
  6261. 55,
  6262. 66,
  6263. 72,
  6264. 399
  6265. ],
  6266. "idx": 625
  6267. },
  6268. {
  6269. "path": "../classic/classic/src/layout/Context.js",
  6270. "requires": [
  6271. 66,
  6272. 72,
  6273. 362,
  6274. 400,
  6275. 624,
  6276. 625
  6277. ],
  6278. "uses": [],
  6279. "idx": 626
  6280. },
  6281. {
  6282. "path": "../classic/classic/src/layout/SizePolicy.js",
  6283. "requires": [],
  6284. "uses": [],
  6285. "idx": 627
  6286. },
  6287. {
  6288. "path": "../classic/classic/src/layout/component/Body.js",
  6289. "requires": [
  6290. 413
  6291. ],
  6292. "uses": [],
  6293. "idx": 628
  6294. },
  6295. {
  6296. "path": "../classic/classic/src/layout/component/FieldSet.js",
  6297. "requires": [
  6298. 628
  6299. ],
  6300. "uses": [],
  6301. "idx": 629
  6302. },
  6303. {
  6304. "path": "../classic/classic/src/layout/container/Absolute.js",
  6305. "requires": [
  6306. 453
  6307. ],
  6308. "uses": [],
  6309. "idx": 630
  6310. },
  6311. {
  6312. "path": "../classic/classic/src/layout/container/Accordion.js",
  6313. "requires": [
  6314. 434
  6315. ],
  6316. "uses": [],
  6317. "idx": 631
  6318. },
  6319. {
  6320. "path": "../classic/classic/src/resizer/BorderSplitter.js",
  6321. "requires": [
  6322. 431
  6323. ],
  6324. "uses": [
  6325. 642
  6326. ],
  6327. "idx": 632
  6328. },
  6329. {
  6330. "path": "../classic/classic/src/layout/container/Border.js",
  6331. "requires": [
  6332. 72,
  6333. 115,
  6334. 401,
  6335. 632
  6336. ],
  6337. "uses": [
  6338. 91,
  6339. 413
  6340. ],
  6341. "idx": 633
  6342. },
  6343. {
  6344. "path": "../classic/classic/src/layout/container/Card.js",
  6345. "requires": [
  6346. 548
  6347. ],
  6348. "uses": [
  6349. 49
  6350. ],
  6351. "idx": 634
  6352. },
  6353. {
  6354. "path": "../classic/classic/src/layout/container/Center.js",
  6355. "requires": [
  6356. 548
  6357. ],
  6358. "uses": [],
  6359. "idx": 635
  6360. },
  6361. {
  6362. "path": "../classic/classic/src/layout/container/Form.js",
  6363. "requires": [
  6364. 402
  6365. ],
  6366. "uses": [],
  6367. "idx": 636
  6368. },
  6369. {
  6370. "path": "../classic/classic/src/menu/Bar.js",
  6371. "requires": [
  6372. 590
  6373. ],
  6374. "uses": [],
  6375. "idx": 637
  6376. },
  6377. {
  6378. "path": "../classic/classic/src/menu/ColorPicker.js",
  6379. "requires": [
  6380. 535,
  6381. 590
  6382. ],
  6383. "uses": [
  6384. 413,
  6385. 418
  6386. ],
  6387. "idx": 638
  6388. },
  6389. {
  6390. "path": "../classic/classic/src/menu/DatePicker.js",
  6391. "requires": [
  6392. 524,
  6393. 590
  6394. ],
  6395. "uses": [
  6396. 413,
  6397. 418
  6398. ],
  6399. "idx": 639
  6400. },
  6401. {
  6402. "path": "../classic/classic/src/panel/Pinnable.js",
  6403. "requires": [
  6404. 0
  6405. ],
  6406. "uses": [
  6407. 413,
  6408. 426
  6409. ],
  6410. "idx": 640
  6411. },
  6412. {
  6413. "path": "../classic/classic/src/plugin/LazyItems.js",
  6414. "requires": [
  6415. 83
  6416. ],
  6417. "uses": [],
  6418. "idx": 641
  6419. },
  6420. {
  6421. "path": "../classic/classic/src/resizer/BorderSplitterTracker.js",
  6422. "requires": [
  6423. 34,
  6424. 458
  6425. ],
  6426. "uses": [],
  6427. "idx": 642
  6428. },
  6429. {
  6430. "path": "../classic/classic/src/resizer/Handle.js",
  6431. "requires": [
  6432. 114
  6433. ],
  6434. "uses": [],
  6435. "idx": 643
  6436. },
  6437. {
  6438. "path": "../classic/classic/src/resizer/ResizeTracker.js",
  6439. "requires": [
  6440. 457
  6441. ],
  6442. "uses": [
  6443. 49
  6444. ],
  6445. "idx": 644
  6446. },
  6447. {
  6448. "path": "../classic/classic/src/resizer/Resizer.js",
  6449. "requires": [
  6450. 51
  6451. ],
  6452. "uses": [
  6453. 49,
  6454. 92,
  6455. 114,
  6456. 644
  6457. ],
  6458. "idx": 645
  6459. },
  6460. {
  6461. "path": "../classic/classic/src/selection/CellModel.js",
  6462. "requires": [
  6463. 509,
  6464. 545
  6465. ],
  6466. "uses": [],
  6467. "idx": 646
  6468. },
  6469. {
  6470. "path": "../classic/classic/src/selection/RowModel.js",
  6471. "requires": [
  6472. 509,
  6473. 545
  6474. ],
  6475. "uses": [],
  6476. "idx": 647
  6477. },
  6478. {
  6479. "path": "../classic/classic/src/selection/CheckboxModel.js",
  6480. "requires": [
  6481. 574,
  6482. 647
  6483. ],
  6484. "uses": [
  6485. 402,
  6486. 545,
  6487. 547
  6488. ],
  6489. "idx": 648
  6490. },
  6491. {
  6492. "path": "../classic/classic/src/selection/TreeModel.js",
  6493. "requires": [
  6494. 647
  6495. ],
  6496. "uses": [],
  6497. "idx": 649
  6498. },
  6499. {
  6500. "path": "../classic/classic/src/slider/Thumb.js",
  6501. "requires": [
  6502. 91,
  6503. 457
  6504. ],
  6505. "uses": [
  6506. 72
  6507. ],
  6508. "idx": 650
  6509. },
  6510. {
  6511. "path": "../classic/classic/src/slider/Tip.js",
  6512. "requires": [
  6513. 531
  6514. ],
  6515. "uses": [],
  6516. "idx": 651
  6517. },
  6518. {
  6519. "path": "../classic/classic/src/slider/Multi.js",
  6520. "requires": [
  6521. 91,
  6522. 92,
  6523. 483,
  6524. 650,
  6525. 651
  6526. ],
  6527. "uses": [
  6528. 240
  6529. ],
  6530. "idx": 652
  6531. },
  6532. {
  6533. "path": "../classic/classic/src/slider/Single.js",
  6534. "requires": [
  6535. 652
  6536. ],
  6537. "uses": [],
  6538. "idx": 653
  6539. },
  6540. {
  6541. "path": "../classic/classic/src/slider/Widget.js",
  6542. "requires": [
  6543. 88,
  6544. 652
  6545. ],
  6546. "uses": [
  6547. 72,
  6548. 91
  6549. ],
  6550. "idx": 654
  6551. },
  6552. {
  6553. "path": "../classic/classic/src/state/CookieProvider.js",
  6554. "requires": [
  6555. 111
  6556. ],
  6557. "uses": [],
  6558. "idx": 655
  6559. },
  6560. {
  6561. "path": "../classic/classic/src/state/LocalStorageProvider.js",
  6562. "requires": [
  6563. 111,
  6564. 386
  6565. ],
  6566. "uses": [],
  6567. "idx": 656
  6568. },
  6569. {
  6570. "path": "../classic/classic/src/tab/Tab.js",
  6571. "requires": [
  6572. 419
  6573. ],
  6574. "uses": [],
  6575. "idx": 657
  6576. },
  6577. {
  6578. "path": "../classic/classic/src/tab/Bar.js",
  6579. "requires": [
  6580. 35,
  6581. 424,
  6582. 628,
  6583. 657
  6584. ],
  6585. "uses": [
  6586. 34
  6587. ],
  6588. "idx": 658
  6589. },
  6590. {
  6591. "path": "../classic/classic/src/tab/Panel.js",
  6592. "requires": [
  6593. 446,
  6594. 634,
  6595. 658
  6596. ],
  6597. "uses": [
  6598. 413,
  6599. 657
  6600. ],
  6601. "idx": 659
  6602. },
  6603. {
  6604. "path": "../classic/classic/src/toolbar/Breadcrumb.js",
  6605. "requires": [
  6606. 237,
  6607. 404,
  6608. 420
  6609. ],
  6610. "uses": [
  6611. 24,
  6612. 178
  6613. ],
  6614. "idx": 660
  6615. },
  6616. {
  6617. "path": "../classic/classic/src/toolbar/Fill.js",
  6618. "requires": [
  6619. 114,
  6620. 435
  6621. ],
  6622. "uses": [],
  6623. "idx": 661
  6624. },
  6625. {
  6626. "path": "../classic/classic/src/toolbar/Spacer.js",
  6627. "requires": [
  6628. 114,
  6629. 435
  6630. ],
  6631. "uses": [],
  6632. "idx": 662
  6633. },
  6634. {
  6635. "path": "../classic/classic/src/tree/Column.js",
  6636. "requires": [
  6637. 570
  6638. ],
  6639. "uses": [
  6640. 77
  6641. ],
  6642. "idx": 663
  6643. },
  6644. {
  6645. "path": "../classic/classic/src/tree/NavigationModel.js",
  6646. "requires": [
  6647. 552
  6648. ],
  6649. "uses": [
  6650. 36
  6651. ],
  6652. "idx": 664
  6653. },
  6654. {
  6655. "path": "../classic/classic/src/tree/View.js",
  6656. "requires": [
  6657. 557
  6658. ],
  6659. "uses": [
  6660. 49
  6661. ],
  6662. "idx": 665
  6663. },
  6664. {
  6665. "path": "../classic/classic/src/tree/Panel.js",
  6666. "requires": [
  6667. 237,
  6668. 549,
  6669. 649,
  6670. 663,
  6671. 664,
  6672. 665
  6673. ],
  6674. "uses": [
  6675. 178,
  6676. 402,
  6677. 547
  6678. ],
  6679. "idx": 666
  6680. },
  6681. {
  6682. "path": "../classic/classic/src/view/DragZone.js",
  6683. "requires": [
  6684. 468
  6685. ],
  6686. "uses": [
  6687. 49,
  6688. 92
  6689. ],
  6690. "idx": 667
  6691. },
  6692. {
  6693. "path": "../classic/classic/src/tree/ViewDragZone.js",
  6694. "requires": [
  6695. 667
  6696. ],
  6697. "uses": [
  6698. 92
  6699. ],
  6700. "idx": 668
  6701. },
  6702. {
  6703. "path": "../classic/classic/src/tree/ViewDropZone.js",
  6704. "requires": [
  6705. 563
  6706. ],
  6707. "uses": [],
  6708. "idx": 669
  6709. },
  6710. {
  6711. "path": "../classic/classic/src/tree/plugin/TreeViewDragDrop.js",
  6712. "requires": [
  6713. 83
  6714. ],
  6715. "uses": [
  6716. 668,
  6717. 669
  6718. ],
  6719. "idx": 670
  6720. },
  6721. {
  6722. "path": "../classic/classic/src/view/MultiSelectorSearch.js",
  6723. "requires": [
  6724. 446
  6725. ],
  6726. "uses": [
  6727. 50,
  6728. 178,
  6729. 443,
  6730. 484,
  6731. 487,
  6732. 548,
  6733. 558
  6734. ],
  6735. "idx": 671
  6736. },
  6737. {
  6738. "path": "../classic/classic/src/view/MultiSelector.js",
  6739. "requires": [
  6740. 443,
  6741. 548,
  6742. 558,
  6743. 671
  6744. ],
  6745. "uses": [],
  6746. "idx": 672
  6747. },
  6748. {
  6749. "path": "../classic/classic/src/window/Toast.js",
  6750. "requires": [
  6751. 480
  6752. ],
  6753. "uses": [
  6754. 1
  6755. ],
  6756. "idx": 673
  6757. }
  6758. ],
  6759. "classes": {
  6760. "Ext.AbstractManager": {
  6761. "idx": 6,
  6762. "alias": [],
  6763. "alternates": []
  6764. },
  6765. "Ext.Action": {
  6766. "idx": 396,
  6767. "alias": [],
  6768. "alternates": []
  6769. },
  6770. "Ext.Ajax": {
  6771. "idx": 18,
  6772. "alias": [],
  6773. "alternates": []
  6774. },
  6775. "Ext.AnimationQueue": {
  6776. "idx": 19,
  6777. "alias": [],
  6778. "alternates": []
  6779. },
  6780. "Ext.Component": {
  6781. "idx": 114,
  6782. "alias": [
  6783. "widget.box",
  6784. "widget.component"
  6785. ],
  6786. "alternates": [
  6787. "Ext.AbstractComponent"
  6788. ]
  6789. },
  6790. "Ext.ComponentLoader": {
  6791. "idx": 398,
  6792. "alias": [],
  6793. "alternates": []
  6794. },
  6795. "Ext.ComponentManager": {
  6796. "idx": 21,
  6797. "alias": [],
  6798. "alternates": [
  6799. "Ext.ComponentMgr"
  6800. ]
  6801. },
  6802. "Ext.ComponentQuery": {
  6803. "idx": 24,
  6804. "alias": [],
  6805. "alternates": []
  6806. },
  6807. "Ext.Deferred": {
  6808. "idx": 11,
  6809. "alias": [],
  6810. "alternates": []
  6811. },
  6812. "Ext.Editor": {
  6813. "idx": 406,
  6814. "alias": [
  6815. "widget.editor"
  6816. ],
  6817. "alternates": []
  6818. },
  6819. "Ext.ElementLoader": {
  6820. "idx": 397,
  6821. "alias": [],
  6822. "alternates": []
  6823. },
  6824. "Ext.EventManager": {
  6825. "idx": 407,
  6826. "alias": [],
  6827. "alternates": []
  6828. },
  6829. "Ext.Evented": {
  6830. "idx": 25,
  6831. "alias": [],
  6832. "alternates": [
  6833. "Ext.EventedBase"
  6834. ]
  6835. },
  6836. "Ext.GlobalEvents": {
  6837. "idx": 76,
  6838. "alias": [],
  6839. "alternates": [
  6840. "Ext.globalEvents"
  6841. ]
  6842. },
  6843. "Ext.Glyph": {
  6844. "idx": 77,
  6845. "alias": [],
  6846. "alternates": []
  6847. },
  6848. "Ext.Img": {
  6849. "idx": 409,
  6850. "alias": [
  6851. "widget.image",
  6852. "widget.imagecomponent"
  6853. ],
  6854. "alternates": []
  6855. },
  6856. "Ext.LoadMask": {
  6857. "idx": 411,
  6858. "alias": [
  6859. "widget.loadmask"
  6860. ],
  6861. "alternates": []
  6862. },
  6863. "Ext.Mixin": {
  6864. "idx": 0,
  6865. "alias": [],
  6866. "alternates": []
  6867. },
  6868. "Ext.Progress": {
  6869. "idx": 90,
  6870. "alias": [
  6871. "widget.progress",
  6872. "widget.progressbarwidget"
  6873. ],
  6874. "alternates": [
  6875. "Ext.ProgressBarWidget"
  6876. ]
  6877. },
  6878. "Ext.ProgressBar": {
  6879. "idx": 415,
  6880. "alias": [
  6881. "widget.progressbar"
  6882. ],
  6883. "alternates": []
  6884. },
  6885. "Ext.ProgressBase": {
  6886. "idx": 89,
  6887. "alias": [],
  6888. "alternates": []
  6889. },
  6890. "Ext.Promise": {
  6891. "idx": 10,
  6892. "alias": [],
  6893. "alternates": []
  6894. },
  6895. "Ext.TaskQueue": {
  6896. "idx": 40,
  6897. "alias": [],
  6898. "alternates": []
  6899. },
  6900. "Ext.Template": {
  6901. "idx": 92,
  6902. "alias": [],
  6903. "alternates": []
  6904. },
  6905. "Ext.Widget": {
  6906. "idx": 88,
  6907. "alias": [
  6908. "widget.widget"
  6909. ],
  6910. "alternates": [
  6911. "Ext.Gadget"
  6912. ]
  6913. },
  6914. "Ext.XTemplate": {
  6915. "idx": 95,
  6916. "alias": [],
  6917. "alternates": []
  6918. },
  6919. "Ext.ZIndexManager": {
  6920. "idx": 403,
  6921. "alias": [],
  6922. "alternates": [
  6923. "Ext.WindowGroup"
  6924. ]
  6925. },
  6926. "Ext.app.Application": {
  6927. "idx": 181,
  6928. "alias": [],
  6929. "alternates": []
  6930. },
  6931. "Ext.app.BaseController": {
  6932. "idx": 124,
  6933. "alias": [],
  6934. "alternates": []
  6935. },
  6936. "Ext.app.Controller": {
  6937. "idx": 180,
  6938. "alias": [],
  6939. "alternates": []
  6940. },
  6941. "Ext.app.EventBus": {
  6942. "idx": 116,
  6943. "alias": [],
  6944. "alternates": []
  6945. },
  6946. "Ext.app.EventDomain": {
  6947. "idx": 96,
  6948. "alias": [],
  6949. "alternates": []
  6950. },
  6951. "Ext.app.Profile": {
  6952. "idx": 182,
  6953. "alias": [],
  6954. "alternates": []
  6955. },
  6956. "Ext.app.Util": {
  6957. "idx": 125,
  6958. "alias": [],
  6959. "alternates": []
  6960. },
  6961. "Ext.app.ViewController": {
  6962. "idx": 184,
  6963. "alias": [
  6964. "controller.controller"
  6965. ],
  6966. "alternates": []
  6967. },
  6968. "Ext.app.ViewModel": {
  6969. "idx": 218,
  6970. "alias": [
  6971. "viewmodel.default"
  6972. ],
  6973. "alternates": []
  6974. },
  6975. "Ext.app.bind.AbstractStub": {
  6976. "idx": 199,
  6977. "alias": [],
  6978. "alternates": []
  6979. },
  6980. "Ext.app.bind.BaseBinding": {
  6981. "idx": 197,
  6982. "alias": [],
  6983. "alternates": []
  6984. },
  6985. "Ext.app.bind.Binding": {
  6986. "idx": 198,
  6987. "alias": [],
  6988. "alternates": []
  6989. },
  6990. "Ext.app.bind.Formula": {
  6991. "idx": 204,
  6992. "alias": [],
  6993. "alternates": []
  6994. },
  6995. "Ext.app.bind.LinkStub": {
  6996. "idx": 201,
  6997. "alias": [],
  6998. "alternates": []
  6999. },
  7000. "Ext.app.bind.Multi": {
  7001. "idx": 203,
  7002. "alias": [],
  7003. "alternates": []
  7004. },
  7005. "Ext.app.bind.Parser": {
  7006. "idx": 214,
  7007. "alias": [],
  7008. "alternates": []
  7009. },
  7010. "Ext.app.bind.RootStub": {
  7011. "idx": 202,
  7012. "alias": [],
  7013. "alternates": []
  7014. },
  7015. "Ext.app.bind.Stub": {
  7016. "idx": 200,
  7017. "alias": [],
  7018. "alternates": []
  7019. },
  7020. "Ext.app.bind.Template": {
  7021. "idx": 215,
  7022. "alias": [],
  7023. "alternates": []
  7024. },
  7025. "Ext.app.bind.TemplateBinding": {
  7026. "idx": 216,
  7027. "alias": [],
  7028. "alternates": []
  7029. },
  7030. "Ext.app.domain.Component": {
  7031. "idx": 97,
  7032. "alias": [],
  7033. "alternates": []
  7034. },
  7035. "Ext.app.domain.Controller": {
  7036. "idx": 219,
  7037. "alias": [],
  7038. "alternates": []
  7039. },
  7040. "Ext.app.domain.Direct": {
  7041. "idx": 222,
  7042. "alias": [],
  7043. "alternates": []
  7044. },
  7045. "Ext.app.domain.Global": {
  7046. "idx": 117,
  7047. "alias": [],
  7048. "alternates": []
  7049. },
  7050. "Ext.app.domain.Store": {
  7051. "idx": 179,
  7052. "alias": [],
  7053. "alternates": []
  7054. },
  7055. "Ext.app.domain.View": {
  7056. "idx": 183,
  7057. "alias": [],
  7058. "alternates": []
  7059. },
  7060. "Ext.button.Button": {
  7061. "idx": 419,
  7062. "alias": [
  7063. "widget.button"
  7064. ],
  7065. "alternates": [
  7066. "Ext.Button"
  7067. ]
  7068. },
  7069. "Ext.button.Cycle": {
  7070. "idx": 421,
  7071. "alias": [
  7072. "widget.cycle"
  7073. ],
  7074. "alternates": [
  7075. "Ext.CycleButton"
  7076. ]
  7077. },
  7078. "Ext.button.Manager": {
  7079. "idx": 417,
  7080. "alias": [],
  7081. "alternates": [
  7082. "Ext.ButtonToggleManager"
  7083. ]
  7084. },
  7085. "Ext.button.Segmented": {
  7086. "idx": 423,
  7087. "alias": [
  7088. "widget.segmentedbutton"
  7089. ],
  7090. "alternates": []
  7091. },
  7092. "Ext.button.Split": {
  7093. "idx": 420,
  7094. "alias": [
  7095. "widget.splitbutton"
  7096. ],
  7097. "alternates": [
  7098. "Ext.SplitButton"
  7099. ]
  7100. },
  7101. "Ext.container.ButtonGroup": {
  7102. "idx": 448,
  7103. "alias": [
  7104. "widget.buttongroup"
  7105. ],
  7106. "alternates": [
  7107. "Ext.ButtonGroup"
  7108. ]
  7109. },
  7110. "Ext.container.Container": {
  7111. "idx": 404,
  7112. "alias": [
  7113. "widget.container"
  7114. ],
  7115. "alternates": [
  7116. "Ext.Container",
  7117. "Ext.AbstractContainer"
  7118. ]
  7119. },
  7120. "Ext.container.DockingContainer": {
  7121. "idx": 445,
  7122. "alias": [],
  7123. "alternates": []
  7124. },
  7125. "Ext.container.Monitor": {
  7126. "idx": 449,
  7127. "alias": [],
  7128. "alternates": []
  7129. },
  7130. "Ext.container.Viewport": {
  7131. "idx": 452,
  7132. "alias": [
  7133. "widget.viewport"
  7134. ],
  7135. "alternates": [
  7136. "Ext.Viewport"
  7137. ]
  7138. },
  7139. "Ext.dashboard.Column": {
  7140. "idx": 455,
  7141. "alias": [
  7142. "widget.dashboard-column"
  7143. ],
  7144. "alternates": []
  7145. },
  7146. "Ext.dashboard.Dashboard": {
  7147. "idx": 467,
  7148. "alias": [
  7149. "widget.dashboard"
  7150. ],
  7151. "alternates": []
  7152. },
  7153. "Ext.dashboard.DropZone": {
  7154. "idx": 465,
  7155. "alias": [],
  7156. "alternates": []
  7157. },
  7158. "Ext.dashboard.Panel": {
  7159. "idx": 454,
  7160. "alias": [
  7161. "widget.dashboard-panel"
  7162. ],
  7163. "alternates": []
  7164. },
  7165. "Ext.dashboard.Part": {
  7166. "idx": 466,
  7167. "alias": [
  7168. "part.part"
  7169. ],
  7170. "alternates": []
  7171. },
  7172. "Ext.data.AbstractStore": {
  7173. "idx": 139,
  7174. "alias": [],
  7175. "alternates": []
  7176. },
  7177. "Ext.data.ArrayStore": {
  7178. "idx": 177,
  7179. "alias": [
  7180. "store.array"
  7181. ],
  7182. "alternates": [
  7183. "Ext.data.SimpleStore"
  7184. ]
  7185. },
  7186. "Ext.data.Batch": {
  7187. "idx": 187,
  7188. "alias": [],
  7189. "alternates": []
  7190. },
  7191. "Ext.data.BufferedStore": {
  7192. "idx": 224,
  7193. "alias": [
  7194. "store.buffered"
  7195. ],
  7196. "alternates": []
  7197. },
  7198. "Ext.data.ChainedStore": {
  7199. "idx": 217,
  7200. "alias": [
  7201. "store.chained"
  7202. ],
  7203. "alternates": []
  7204. },
  7205. "Ext.data.Connection": {
  7206. "idx": 17,
  7207. "alias": [],
  7208. "alternates": []
  7209. },
  7210. "Ext.data.DirectStore": {
  7211. "idx": 226,
  7212. "alias": [
  7213. "store.direct"
  7214. ],
  7215. "alternates": []
  7216. },
  7217. "Ext.data.Error": {
  7218. "idx": 140,
  7219. "alias": [],
  7220. "alternates": []
  7221. },
  7222. "Ext.data.ErrorCollection": {
  7223. "idx": 141,
  7224. "alias": [],
  7225. "alternates": [
  7226. "Ext.data.Errors"
  7227. ]
  7228. },
  7229. "Ext.data.Group": {
  7230. "idx": 166,
  7231. "alias": [],
  7232. "alternates": []
  7233. },
  7234. "Ext.data.JsonP": {
  7235. "idx": 227,
  7236. "alias": [],
  7237. "alternates": []
  7238. },
  7239. "Ext.data.JsonPStore": {
  7240. "idx": 229,
  7241. "alias": [
  7242. "store.jsonp"
  7243. ],
  7244. "alternates": []
  7245. },
  7246. "Ext.data.JsonStore": {
  7247. "idx": 230,
  7248. "alias": [
  7249. "store.json"
  7250. ],
  7251. "alternates": []
  7252. },
  7253. "Ext.data.LocalStore": {
  7254. "idx": 167,
  7255. "alias": [],
  7256. "alternates": []
  7257. },
  7258. "Ext.data.Model": {
  7259. "idx": 157,
  7260. "alias": [],
  7261. "alternates": [
  7262. "Ext.data.Record"
  7263. ]
  7264. },
  7265. "Ext.data.ModelManager": {
  7266. "idx": 231,
  7267. "alias": [],
  7268. "alternates": [
  7269. "Ext.ModelMgr"
  7270. ]
  7271. },
  7272. "Ext.data.NodeInterface": {
  7273. "idx": 232,
  7274. "alias": [],
  7275. "alternates": []
  7276. },
  7277. "Ext.data.NodeStore": {
  7278. "idx": 235,
  7279. "alias": [
  7280. "store.node"
  7281. ],
  7282. "alternates": []
  7283. },
  7284. "Ext.data.PageMap": {
  7285. "idx": 223,
  7286. "alias": [],
  7287. "alternates": []
  7288. },
  7289. "Ext.data.ProxyStore": {
  7290. "idx": 164,
  7291. "alias": [],
  7292. "alternates": []
  7293. },
  7294. "Ext.data.Range": {
  7295. "idx": 129,
  7296. "alias": [],
  7297. "alternates": []
  7298. },
  7299. "Ext.data.Request": {
  7300. "idx": 236,
  7301. "alias": [],
  7302. "alternates": []
  7303. },
  7304. "Ext.data.ResultSet": {
  7305. "idx": 158,
  7306. "alias": [],
  7307. "alternates": []
  7308. },
  7309. "Ext.data.Session": {
  7310. "idx": 195,
  7311. "alias": [],
  7312. "alternates": []
  7313. },
  7314. "Ext.data.SortTypes": {
  7315. "idx": 147,
  7316. "alias": [],
  7317. "alternates": []
  7318. },
  7319. "Ext.data.Store": {
  7320. "idx": 175,
  7321. "alias": [
  7322. "store.store"
  7323. ],
  7324. "alternates": []
  7325. },
  7326. "Ext.data.StoreManager": {
  7327. "idx": 178,
  7328. "alias": [],
  7329. "alternates": [
  7330. "Ext.StoreMgr",
  7331. "Ext.data.StoreMgr",
  7332. "Ext.StoreManager"
  7333. ]
  7334. },
  7335. "Ext.data.TreeModel": {
  7336. "idx": 234,
  7337. "alias": [],
  7338. "alternates": []
  7339. },
  7340. "Ext.data.TreeStore": {
  7341. "idx": 237,
  7342. "alias": [
  7343. "store.tree"
  7344. ],
  7345. "alternates": []
  7346. },
  7347. "Ext.data.Types": {
  7348. "idx": 238,
  7349. "alias": [],
  7350. "alternates": []
  7351. },
  7352. "Ext.data.Validation": {
  7353. "idx": 239,
  7354. "alias": [],
  7355. "alternates": []
  7356. },
  7357. "Ext.data.XmlStore": {
  7358. "idx": 244,
  7359. "alias": [
  7360. "store.xml"
  7361. ],
  7362. "alternates": []
  7363. },
  7364. "Ext.data.field.Boolean": {
  7365. "idx": 150,
  7366. "alias": [
  7367. "data.field.bool",
  7368. "data.field.boolean"
  7369. ],
  7370. "alternates": []
  7371. },
  7372. "Ext.data.field.Date": {
  7373. "idx": 151,
  7374. "alias": [
  7375. "data.field.date"
  7376. ],
  7377. "alternates": []
  7378. },
  7379. "Ext.data.field.Field": {
  7380. "idx": 149,
  7381. "alias": [
  7382. "data.field.auto"
  7383. ],
  7384. "alternates": [
  7385. "Ext.data.Field"
  7386. ]
  7387. },
  7388. "Ext.data.field.Integer": {
  7389. "idx": 152,
  7390. "alias": [
  7391. "data.field.int",
  7392. "data.field.integer"
  7393. ],
  7394. "alternates": []
  7395. },
  7396. "Ext.data.field.Number": {
  7397. "idx": 153,
  7398. "alias": [
  7399. "data.field.float",
  7400. "data.field.number"
  7401. ],
  7402. "alternates": []
  7403. },
  7404. "Ext.data.field.String": {
  7405. "idx": 154,
  7406. "alias": [
  7407. "data.field.string"
  7408. ],
  7409. "alternates": []
  7410. },
  7411. "Ext.data.flash.BinaryXhr": {
  7412. "idx": 14,
  7413. "alias": [],
  7414. "alternates": []
  7415. },
  7416. "Ext.data.identifier.Generator": {
  7417. "idx": 155,
  7418. "alias": [
  7419. "data.identifier.default"
  7420. ],
  7421. "alternates": []
  7422. },
  7423. "Ext.data.identifier.Negative": {
  7424. "idx": 245,
  7425. "alias": [
  7426. "data.identifier.negative"
  7427. ],
  7428. "alternates": []
  7429. },
  7430. "Ext.data.identifier.Sequential": {
  7431. "idx": 156,
  7432. "alias": [
  7433. "data.identifier.sequential"
  7434. ],
  7435. "alternates": []
  7436. },
  7437. "Ext.data.identifier.Uuid": {
  7438. "idx": 246,
  7439. "alias": [
  7440. "data.identifier.uuid"
  7441. ],
  7442. "alternates": []
  7443. },
  7444. "Ext.data.matrix.Matrix": {
  7445. "idx": 190,
  7446. "alias": [],
  7447. "alternates": []
  7448. },
  7449. "Ext.data.matrix.Side": {
  7450. "idx": 189,
  7451. "alias": [],
  7452. "alternates": []
  7453. },
  7454. "Ext.data.matrix.Slice": {
  7455. "idx": 188,
  7456. "alias": [],
  7457. "alternates": []
  7458. },
  7459. "Ext.data.operation.Create": {
  7460. "idx": 143,
  7461. "alias": [
  7462. "data.operation.create"
  7463. ],
  7464. "alternates": []
  7465. },
  7466. "Ext.data.operation.Destroy": {
  7467. "idx": 144,
  7468. "alias": [
  7469. "data.operation.destroy"
  7470. ],
  7471. "alternates": []
  7472. },
  7473. "Ext.data.operation.Operation": {
  7474. "idx": 142,
  7475. "alias": [],
  7476. "alternates": [
  7477. "Ext.data.Operation"
  7478. ]
  7479. },
  7480. "Ext.data.operation.Read": {
  7481. "idx": 145,
  7482. "alias": [
  7483. "data.operation.read"
  7484. ],
  7485. "alternates": []
  7486. },
  7487. "Ext.data.operation.Update": {
  7488. "idx": 146,
  7489. "alias": [
  7490. "data.operation.update"
  7491. ],
  7492. "alternates": []
  7493. },
  7494. "Ext.data.proxy.Ajax": {
  7495. "idx": 169,
  7496. "alias": [
  7497. "proxy.ajax"
  7498. ],
  7499. "alternates": [
  7500. "Ext.data.HttpProxy",
  7501. "Ext.data.AjaxProxy"
  7502. ]
  7503. },
  7504. "Ext.data.proxy.Client": {
  7505. "idx": 162,
  7506. "alias": [],
  7507. "alternates": [
  7508. "Ext.data.ClientProxy"
  7509. ]
  7510. },
  7511. "Ext.data.proxy.Direct": {
  7512. "idx": 225,
  7513. "alias": [
  7514. "proxy.direct"
  7515. ],
  7516. "alternates": [
  7517. "Ext.data.DirectProxy"
  7518. ]
  7519. },
  7520. "Ext.data.proxy.JsonP": {
  7521. "idx": 228,
  7522. "alias": [
  7523. "proxy.jsonp",
  7524. "proxy.scripttag"
  7525. ],
  7526. "alternates": [
  7527. "Ext.data.ScriptTagProxy"
  7528. ]
  7529. },
  7530. "Ext.data.proxy.LocalStorage": {
  7531. "idx": 248,
  7532. "alias": [
  7533. "proxy.localstorage"
  7534. ],
  7535. "alternates": [
  7536. "Ext.data.LocalStorageProxy"
  7537. ]
  7538. },
  7539. "Ext.data.proxy.Memory": {
  7540. "idx": 163,
  7541. "alias": [
  7542. "proxy.memory"
  7543. ],
  7544. "alternates": [
  7545. "Ext.data.MemoryProxy"
  7546. ]
  7547. },
  7548. "Ext.data.proxy.Proxy": {
  7549. "idx": 161,
  7550. "alias": [
  7551. "proxy.proxy"
  7552. ],
  7553. "alternates": [
  7554. "Ext.data.DataProxy",
  7555. "Ext.data.Proxy"
  7556. ]
  7557. },
  7558. "Ext.data.proxy.Rest": {
  7559. "idx": 249,
  7560. "alias": [
  7561. "proxy.rest"
  7562. ],
  7563. "alternates": [
  7564. "Ext.data.RestProxy"
  7565. ]
  7566. },
  7567. "Ext.data.proxy.Server": {
  7568. "idx": 168,
  7569. "alias": [
  7570. "proxy.server"
  7571. ],
  7572. "alternates": [
  7573. "Ext.data.ServerProxy"
  7574. ]
  7575. },
  7576. "Ext.data.proxy.SessionStorage": {
  7577. "idx": 250,
  7578. "alias": [
  7579. "proxy.sessionstorage"
  7580. ],
  7581. "alternates": [
  7582. "Ext.data.SessionStorageProxy"
  7583. ]
  7584. },
  7585. "Ext.data.proxy.WebStorage": {
  7586. "idx": 247,
  7587. "alias": [],
  7588. "alternates": [
  7589. "Ext.data.WebStorageProxy"
  7590. ]
  7591. },
  7592. "Ext.data.reader.Array": {
  7593. "idx": 176,
  7594. "alias": [
  7595. "reader.array"
  7596. ],
  7597. "alternates": [
  7598. "Ext.data.ArrayReader"
  7599. ]
  7600. },
  7601. "Ext.data.reader.Json": {
  7602. "idx": 170,
  7603. "alias": [
  7604. "reader.json"
  7605. ],
  7606. "alternates": [
  7607. "Ext.data.JsonReader"
  7608. ]
  7609. },
  7610. "Ext.data.reader.Reader": {
  7611. "idx": 159,
  7612. "alias": [
  7613. "reader.base"
  7614. ],
  7615. "alternates": [
  7616. "Ext.data.Reader",
  7617. "Ext.data.DataReader"
  7618. ]
  7619. },
  7620. "Ext.data.reader.Xml": {
  7621. "idx": 242,
  7622. "alias": [
  7623. "reader.xml"
  7624. ],
  7625. "alternates": [
  7626. "Ext.data.XmlReader"
  7627. ]
  7628. },
  7629. "Ext.data.request.Ajax": {
  7630. "idx": 15,
  7631. "alias": [
  7632. "request.ajax"
  7633. ],
  7634. "alternates": []
  7635. },
  7636. "Ext.data.request.Base": {
  7637. "idx": 13,
  7638. "alias": [],
  7639. "alternates": []
  7640. },
  7641. "Ext.data.request.Form": {
  7642. "idx": 16,
  7643. "alias": [
  7644. "request.form"
  7645. ],
  7646. "alternates": []
  7647. },
  7648. "Ext.data.schema.Association": {
  7649. "idx": 132,
  7650. "alias": [],
  7651. "alternates": []
  7652. },
  7653. "Ext.data.schema.ManyToMany": {
  7654. "idx": 135,
  7655. "alias": [],
  7656. "alternates": []
  7657. },
  7658. "Ext.data.schema.ManyToOne": {
  7659. "idx": 134,
  7660. "alias": [],
  7661. "alternates": []
  7662. },
  7663. "Ext.data.schema.Namer": {
  7664. "idx": 137,
  7665. "alias": [
  7666. "namer.default"
  7667. ],
  7668. "alternates": []
  7669. },
  7670. "Ext.data.schema.OneToOne": {
  7671. "idx": 133,
  7672. "alias": [],
  7673. "alternates": []
  7674. },
  7675. "Ext.data.schema.Role": {
  7676. "idx": 131,
  7677. "alias": [],
  7678. "alternates": []
  7679. },
  7680. "Ext.data.schema.Schema": {
  7681. "idx": 138,
  7682. "alias": [
  7683. "schema.default"
  7684. ],
  7685. "alternates": []
  7686. },
  7687. "Ext.data.session.BatchVisitor": {
  7688. "idx": 193,
  7689. "alias": [],
  7690. "alternates": []
  7691. },
  7692. "Ext.data.session.ChangesVisitor": {
  7693. "idx": 191,
  7694. "alias": [],
  7695. "alternates": []
  7696. },
  7697. "Ext.data.session.ChildChangesVisitor": {
  7698. "idx": 192,
  7699. "alias": [],
  7700. "alternates": []
  7701. },
  7702. "Ext.data.summary.Average": {
  7703. "idx": 257,
  7704. "alias": [
  7705. "data.summary.average"
  7706. ],
  7707. "alternates": []
  7708. },
  7709. "Ext.data.summary.Base": {
  7710. "idx": 255,
  7711. "alias": [
  7712. "data.summary.base"
  7713. ],
  7714. "alternates": []
  7715. },
  7716. "Ext.data.summary.Count": {
  7717. "idx": 258,
  7718. "alias": [
  7719. "data.summary.count"
  7720. ],
  7721. "alternates": []
  7722. },
  7723. "Ext.data.summary.Max": {
  7724. "idx": 259,
  7725. "alias": [
  7726. "data.summary.max"
  7727. ],
  7728. "alternates": []
  7729. },
  7730. "Ext.data.summary.Min": {
  7731. "idx": 260,
  7732. "alias": [
  7733. "data.summary.min"
  7734. ],
  7735. "alternates": []
  7736. },
  7737. "Ext.data.summary.Sum": {
  7738. "idx": 256,
  7739. "alias": [
  7740. "data.summary.sum"
  7741. ],
  7742. "alternates": []
  7743. },
  7744. "Ext.data.validator.AbstractDate": {
  7745. "idx": 261,
  7746. "alias": [],
  7747. "alternates": []
  7748. },
  7749. "Ext.data.validator.Bound": {
  7750. "idx": 262,
  7751. "alias": [
  7752. "data.validator.bound"
  7753. ],
  7754. "alternates": []
  7755. },
  7756. "Ext.data.validator.CIDRv4": {
  7757. "idx": 264,
  7758. "alias": [
  7759. "data.validator.cidrv4"
  7760. ],
  7761. "alternates": []
  7762. },
  7763. "Ext.data.validator.CIDRv6": {
  7764. "idx": 265,
  7765. "alias": [
  7766. "data.validator.cidrv6"
  7767. ],
  7768. "alternates": []
  7769. },
  7770. "Ext.data.validator.Currency": {
  7771. "idx": 267,
  7772. "alias": [
  7773. "data.validator.currency"
  7774. ],
  7775. "alternates": []
  7776. },
  7777. "Ext.data.validator.CurrencyUS": {
  7778. "idx": 268,
  7779. "alias": [
  7780. "data.validator.currency-us"
  7781. ],
  7782. "alternates": []
  7783. },
  7784. "Ext.data.validator.Date": {
  7785. "idx": 269,
  7786. "alias": [
  7787. "data.validator.date"
  7788. ],
  7789. "alternates": []
  7790. },
  7791. "Ext.data.validator.DateTime": {
  7792. "idx": 270,
  7793. "alias": [
  7794. "data.validator.datetime"
  7795. ],
  7796. "alternates": []
  7797. },
  7798. "Ext.data.validator.Email": {
  7799. "idx": 271,
  7800. "alias": [
  7801. "data.validator.email"
  7802. ],
  7803. "alternates": []
  7804. },
  7805. "Ext.data.validator.Exclusion": {
  7806. "idx": 273,
  7807. "alias": [
  7808. "data.validator.exclusion"
  7809. ],
  7810. "alternates": []
  7811. },
  7812. "Ext.data.validator.Format": {
  7813. "idx": 263,
  7814. "alias": [
  7815. "data.validator.format"
  7816. ],
  7817. "alternates": []
  7818. },
  7819. "Ext.data.validator.IPAddress": {
  7820. "idx": 274,
  7821. "alias": [
  7822. "data.validator.ipaddress"
  7823. ],
  7824. "alternates": []
  7825. },
  7826. "Ext.data.validator.Inclusion": {
  7827. "idx": 275,
  7828. "alias": [
  7829. "data.validator.inclusion"
  7830. ],
  7831. "alternates": []
  7832. },
  7833. "Ext.data.validator.Length": {
  7834. "idx": 276,
  7835. "alias": [
  7836. "data.validator.length"
  7837. ],
  7838. "alternates": []
  7839. },
  7840. "Ext.data.validator.List": {
  7841. "idx": 272,
  7842. "alias": [
  7843. "data.validator.list"
  7844. ],
  7845. "alternates": []
  7846. },
  7847. "Ext.data.validator.NotNull": {
  7848. "idx": 278,
  7849. "alias": [
  7850. "data.validator.notnull"
  7851. ],
  7852. "alternates": []
  7853. },
  7854. "Ext.data.validator.Number": {
  7855. "idx": 266,
  7856. "alias": [
  7857. "data.validator.number"
  7858. ],
  7859. "alternates": []
  7860. },
  7861. "Ext.data.validator.Phone": {
  7862. "idx": 279,
  7863. "alias": [
  7864. "data.validator.phone"
  7865. ],
  7866. "alternates": []
  7867. },
  7868. "Ext.data.validator.Presence": {
  7869. "idx": 277,
  7870. "alias": [
  7871. "data.validator.presence"
  7872. ],
  7873. "alternates": []
  7874. },
  7875. "Ext.data.validator.Range": {
  7876. "idx": 280,
  7877. "alias": [
  7878. "data.validator.range"
  7879. ],
  7880. "alternates": []
  7881. },
  7882. "Ext.data.validator.Time": {
  7883. "idx": 281,
  7884. "alias": [
  7885. "data.validator.time"
  7886. ],
  7887. "alternates": []
  7888. },
  7889. "Ext.data.validator.Url": {
  7890. "idx": 282,
  7891. "alias": [
  7892. "data.validator.url"
  7893. ],
  7894. "alternates": []
  7895. },
  7896. "Ext.data.validator.Validator": {
  7897. "idx": 148,
  7898. "alias": [
  7899. "data.validator.base"
  7900. ],
  7901. "alternates": []
  7902. },
  7903. "Ext.data.virtual.Group": {
  7904. "idx": 283,
  7905. "alias": [],
  7906. "alternates": []
  7907. },
  7908. "Ext.data.virtual.Page": {
  7909. "idx": 284,
  7910. "alias": [],
  7911. "alternates": []
  7912. },
  7913. "Ext.data.virtual.PageMap": {
  7914. "idx": 285,
  7915. "alias": [],
  7916. "alternates": []
  7917. },
  7918. "Ext.data.virtual.Range": {
  7919. "idx": 286,
  7920. "alias": [],
  7921. "alternates": []
  7922. },
  7923. "Ext.data.virtual.Store": {
  7924. "idx": 287,
  7925. "alias": [
  7926. "store.virtual"
  7927. ],
  7928. "alternates": []
  7929. },
  7930. "Ext.data.writer.Json": {
  7931. "idx": 171,
  7932. "alias": [
  7933. "writer.json"
  7934. ],
  7935. "alternates": [
  7936. "Ext.data.JsonWriter"
  7937. ]
  7938. },
  7939. "Ext.data.writer.Writer": {
  7940. "idx": 160,
  7941. "alias": [
  7942. "writer.base"
  7943. ],
  7944. "alternates": [
  7945. "Ext.data.DataWriter",
  7946. "Ext.data.Writer"
  7947. ]
  7948. },
  7949. "Ext.data.writer.Xml": {
  7950. "idx": 243,
  7951. "alias": [
  7952. "writer.xml"
  7953. ],
  7954. "alternates": [
  7955. "Ext.data.XmlWriter"
  7956. ]
  7957. },
  7958. "Ext.dd.DD": {
  7959. "idx": 437,
  7960. "alias": [],
  7961. "alternates": []
  7962. },
  7963. "Ext.dd.DDProxy": {
  7964. "idx": 438,
  7965. "alias": [],
  7966. "alternates": []
  7967. },
  7968. "Ext.dd.DDTarget": {
  7969. "idx": 462,
  7970. "alias": [],
  7971. "alternates": []
  7972. },
  7973. "Ext.dd.DragDrop": {
  7974. "idx": 436,
  7975. "alias": [],
  7976. "alternates": []
  7977. },
  7978. "Ext.dd.DragDropManager": {
  7979. "idx": 430,
  7980. "alias": [],
  7981. "alternates": [
  7982. "Ext.dd.DragDropMgr",
  7983. "Ext.dd.DDM"
  7984. ]
  7985. },
  7986. "Ext.dd.DragSource": {
  7987. "idx": 440,
  7988. "alias": [],
  7989. "alternates": []
  7990. },
  7991. "Ext.dd.DragTracker": {
  7992. "idx": 457,
  7993. "alias": [],
  7994. "alternates": []
  7995. },
  7996. "Ext.dd.DragZone": {
  7997. "idx": 468,
  7998. "alias": [],
  7999. "alternates": []
  8000. },
  8001. "Ext.dd.DropTarget": {
  8002. "idx": 464,
  8003. "alias": [],
  8004. "alternates": []
  8005. },
  8006. "Ext.dd.DropZone": {
  8007. "idx": 470,
  8008. "alias": [],
  8009. "alternates": []
  8010. },
  8011. "Ext.dd.Registry": {
  8012. "idx": 469,
  8013. "alias": [],
  8014. "alternates": []
  8015. },
  8016. "Ext.dd.ScrollManager": {
  8017. "idx": 463,
  8018. "alias": [],
  8019. "alternates": []
  8020. },
  8021. "Ext.dd.StatusProxy": {
  8022. "idx": 439,
  8023. "alias": [],
  8024. "alternates": []
  8025. },
  8026. "Ext.direct.Event": {
  8027. "idx": 288,
  8028. "alias": [
  8029. "direct.event"
  8030. ],
  8031. "alternates": []
  8032. },
  8033. "Ext.direct.ExceptionEvent": {
  8034. "idx": 290,
  8035. "alias": [
  8036. "direct.exception"
  8037. ],
  8038. "alternates": []
  8039. },
  8040. "Ext.direct.JsonProvider": {
  8041. "idx": 291,
  8042. "alias": [
  8043. "direct.jsonprovider"
  8044. ],
  8045. "alternates": []
  8046. },
  8047. "Ext.direct.Manager": {
  8048. "idx": 220,
  8049. "alias": [],
  8050. "alternates": []
  8051. },
  8052. "Ext.direct.PollingProvider": {
  8053. "idx": 292,
  8054. "alias": [
  8055. "direct.pollingprovider"
  8056. ],
  8057. "alternates": []
  8058. },
  8059. "Ext.direct.Provider": {
  8060. "idx": 221,
  8061. "alias": [
  8062. "direct.provider"
  8063. ],
  8064. "alternates": []
  8065. },
  8066. "Ext.direct.RemotingEvent": {
  8067. "idx": 289,
  8068. "alias": [
  8069. "direct.rpc"
  8070. ],
  8071. "alternates": []
  8072. },
  8073. "Ext.direct.RemotingMethod": {
  8074. "idx": 293,
  8075. "alias": [],
  8076. "alternates": []
  8077. },
  8078. "Ext.direct.RemotingProvider": {
  8079. "idx": 295,
  8080. "alias": [
  8081. "direct.remotingprovider"
  8082. ],
  8083. "alternates": []
  8084. },
  8085. "Ext.direct.Transaction": {
  8086. "idx": 294,
  8087. "alias": [
  8088. "direct.transaction"
  8089. ],
  8090. "alternates": []
  8091. },
  8092. "Ext.dom.ButtonElement": {
  8093. "idx": 416,
  8094. "alias": [],
  8095. "alternates": []
  8096. },
  8097. "Ext.dom.CompositeElement": {
  8098. "idx": 99,
  8099. "alias": [],
  8100. "alternates": [
  8101. "Ext.CompositeElement"
  8102. ]
  8103. },
  8104. "Ext.dom.CompositeElementLite": {
  8105. "idx": 75,
  8106. "alias": [],
  8107. "alternates": [
  8108. "Ext.CompositeElementLite"
  8109. ]
  8110. },
  8111. "Ext.dom.Element": {
  8112. "idx": 49,
  8113. "alias": [],
  8114. "alternates": [
  8115. "Ext.Element"
  8116. ]
  8117. },
  8118. "Ext.dom.ElementEvent": {
  8119. "idx": 31,
  8120. "alias": [],
  8121. "alternates": []
  8122. },
  8123. "Ext.dom.Fly": {
  8124. "idx": 74,
  8125. "alias": [],
  8126. "alternates": [
  8127. "Ext.dom.Element.Fly"
  8128. ]
  8129. },
  8130. "Ext.dom.GarbageCollector": {
  8131. "idx": 296,
  8132. "alias": [],
  8133. "alternates": []
  8134. },
  8135. "Ext.dom.Helper": {
  8136. "idx": 240,
  8137. "alias": [],
  8138. "alternates": [
  8139. "Ext.DomHelper",
  8140. "Ext.core.DomHelper"
  8141. ]
  8142. },
  8143. "Ext.dom.Layer": {
  8144. "idx": 471,
  8145. "alias": [],
  8146. "alternates": [
  8147. "Ext.Layer"
  8148. ]
  8149. },
  8150. "Ext.dom.Query": {
  8151. "idx": 241,
  8152. "alias": [],
  8153. "alternates": [
  8154. "Ext.core.DomQuery",
  8155. "Ext.DomQuery"
  8156. ]
  8157. },
  8158. "Ext.dom.Shadow": {
  8159. "idx": 29,
  8160. "alias": [],
  8161. "alternates": [
  8162. "Ext.Shadow"
  8163. ]
  8164. },
  8165. "Ext.dom.Shim": {
  8166. "idx": 30,
  8167. "alias": [],
  8168. "alternates": []
  8169. },
  8170. "Ext.dom.TouchAction": {
  8171. "idx": 297,
  8172. "alias": [],
  8173. "alternates": []
  8174. },
  8175. "Ext.dom.Underlay": {
  8176. "idx": 28,
  8177. "alias": [],
  8178. "alternates": []
  8179. },
  8180. "Ext.dom.UnderlayPool": {
  8181. "idx": 27,
  8182. "alias": [],
  8183. "alternates": []
  8184. },
  8185. "Ext.drag.Constraint": {
  8186. "idx": 298,
  8187. "alias": [
  8188. "drag.constraint.base"
  8189. ],
  8190. "alternates": []
  8191. },
  8192. "Ext.drag.Info": {
  8193. "idx": 299,
  8194. "alias": [],
  8195. "alternates": []
  8196. },
  8197. "Ext.drag.Item": {
  8198. "idx": 300,
  8199. "alias": [],
  8200. "alternates": []
  8201. },
  8202. "Ext.drag.Manager": {
  8203. "idx": 301,
  8204. "alias": [],
  8205. "alternates": []
  8206. },
  8207. "Ext.drag.Source": {
  8208. "idx": 302,
  8209. "alias": [],
  8210. "alternates": []
  8211. },
  8212. "Ext.drag.Target": {
  8213. "idx": 303,
  8214. "alias": [],
  8215. "alternates": []
  8216. },
  8217. "Ext.drag.proxy.None": {
  8218. "idx": 304,
  8219. "alias": [
  8220. "drag.proxy.none"
  8221. ],
  8222. "alternates": []
  8223. },
  8224. "Ext.drag.proxy.Original": {
  8225. "idx": 305,
  8226. "alias": [
  8227. "drag.proxy.original"
  8228. ],
  8229. "alternates": []
  8230. },
  8231. "Ext.drag.proxy.Placeholder": {
  8232. "idx": 306,
  8233. "alias": [
  8234. "drag.proxy.placeholder"
  8235. ],
  8236. "alternates": []
  8237. },
  8238. "Ext.event.Event": {
  8239. "idx": 36,
  8240. "alias": [],
  8241. "alternates": [
  8242. "Ext.EventObjectImpl"
  8243. ]
  8244. },
  8245. "Ext.event.gesture.DoubleTap": {
  8246. "idx": 309,
  8247. "alias": [],
  8248. "alternates": []
  8249. },
  8250. "Ext.event.gesture.Drag": {
  8251. "idx": 310,
  8252. "alias": [],
  8253. "alternates": []
  8254. },
  8255. "Ext.event.gesture.EdgeSwipe": {
  8256. "idx": 312,
  8257. "alias": [],
  8258. "alternates": []
  8259. },
  8260. "Ext.event.gesture.LongPress": {
  8261. "idx": 313,
  8262. "alias": [],
  8263. "alternates": []
  8264. },
  8265. "Ext.event.gesture.MultiTouch": {
  8266. "idx": 314,
  8267. "alias": [],
  8268. "alternates": []
  8269. },
  8270. "Ext.event.gesture.Pinch": {
  8271. "idx": 315,
  8272. "alias": [],
  8273. "alternates": []
  8274. },
  8275. "Ext.event.gesture.Recognizer": {
  8276. "idx": 307,
  8277. "alias": [],
  8278. "alternates": []
  8279. },
  8280. "Ext.event.gesture.Rotate": {
  8281. "idx": 316,
  8282. "alias": [],
  8283. "alternates": []
  8284. },
  8285. "Ext.event.gesture.SingleTouch": {
  8286. "idx": 308,
  8287. "alias": [],
  8288. "alternates": []
  8289. },
  8290. "Ext.event.gesture.Swipe": {
  8291. "idx": 311,
  8292. "alias": [],
  8293. "alternates": []
  8294. },
  8295. "Ext.event.gesture.Tap": {
  8296. "idx": 317,
  8297. "alias": [],
  8298. "alternates": []
  8299. },
  8300. "Ext.event.publisher.Dom": {
  8301. "idx": 37,
  8302. "alias": [],
  8303. "alternates": []
  8304. },
  8305. "Ext.event.publisher.ElementPaint": {
  8306. "idx": 48,
  8307. "alias": [],
  8308. "alternates": []
  8309. },
  8310. "Ext.event.publisher.ElementSize": {
  8311. "idx": 44,
  8312. "alias": [],
  8313. "alternates": []
  8314. },
  8315. "Ext.event.publisher.Focus": {
  8316. "idx": 318,
  8317. "alias": [],
  8318. "alternates": []
  8319. },
  8320. "Ext.event.publisher.Gesture": {
  8321. "idx": 38,
  8322. "alias": [],
  8323. "alternates": []
  8324. },
  8325. "Ext.event.publisher.MouseEnterLeave": {
  8326. "idx": 473,
  8327. "alias": [],
  8328. "alternates": []
  8329. },
  8330. "Ext.event.publisher.Publisher": {
  8331. "idx": 32,
  8332. "alias": [],
  8333. "alternates": []
  8334. },
  8335. "Ext.field.InputMask": {
  8336. "idx": 319,
  8337. "alias": [],
  8338. "alternates": []
  8339. },
  8340. "Ext.flash.Component": {
  8341. "idx": 474,
  8342. "alias": [
  8343. "widget.flash"
  8344. ],
  8345. "alternates": [
  8346. "Ext.FlashComponent"
  8347. ]
  8348. },
  8349. "Ext.form.Basic": {
  8350. "idx": 490,
  8351. "alias": [],
  8352. "alternates": [
  8353. "Ext.form.BasicForm"
  8354. ]
  8355. },
  8356. "Ext.form.CheckboxGroup": {
  8357. "idx": 497,
  8358. "alias": [
  8359. "widget.checkboxgroup"
  8360. ],
  8361. "alternates": []
  8362. },
  8363. "Ext.form.CheckboxManager": {
  8364. "idx": 495,
  8365. "alias": [],
  8366. "alternates": []
  8367. },
  8368. "Ext.form.FieldAncestor": {
  8369. "idx": 491,
  8370. "alias": [],
  8371. "alternates": []
  8372. },
  8373. "Ext.form.FieldContainer": {
  8374. "idx": 493,
  8375. "alias": [
  8376. "widget.fieldcontainer"
  8377. ],
  8378. "alternates": []
  8379. },
  8380. "Ext.form.FieldSet": {
  8381. "idx": 498,
  8382. "alias": [
  8383. "widget.fieldset"
  8384. ],
  8385. "alternates": []
  8386. },
  8387. "Ext.form.Label": {
  8388. "idx": 499,
  8389. "alias": [
  8390. "widget.label"
  8391. ],
  8392. "alternates": []
  8393. },
  8394. "Ext.form.Labelable": {
  8395. "idx": 481,
  8396. "alias": [],
  8397. "alternates": []
  8398. },
  8399. "Ext.form.Panel": {
  8400. "idx": 500,
  8401. "alias": [
  8402. "widget.form"
  8403. ],
  8404. "alternates": [
  8405. "Ext.FormPanel",
  8406. "Ext.form.FormPanel"
  8407. ]
  8408. },
  8409. "Ext.form.RadioGroup": {
  8410. "idx": 503,
  8411. "alias": [
  8412. "widget.radiogroup"
  8413. ],
  8414. "alternates": []
  8415. },
  8416. "Ext.form.RadioManager": {
  8417. "idx": 501,
  8418. "alias": [],
  8419. "alternates": []
  8420. },
  8421. "Ext.form.action.Action": {
  8422. "idx": 475,
  8423. "alias": [],
  8424. "alternates": [
  8425. "Ext.form.Action"
  8426. ]
  8427. },
  8428. "Ext.form.action.DirectAction": {
  8429. "idx": 504,
  8430. "alias": [],
  8431. "alternates": []
  8432. },
  8433. "Ext.form.action.DirectLoad": {
  8434. "idx": 505,
  8435. "alias": [
  8436. "formaction.directload"
  8437. ],
  8438. "alternates": [
  8439. "Ext.form.Action.DirectLoad"
  8440. ]
  8441. },
  8442. "Ext.form.action.DirectSubmit": {
  8443. "idx": 506,
  8444. "alias": [
  8445. "formaction.directsubmit"
  8446. ],
  8447. "alternates": [
  8448. "Ext.form.Action.DirectSubmit"
  8449. ]
  8450. },
  8451. "Ext.form.action.Load": {
  8452. "idx": 476,
  8453. "alias": [
  8454. "formaction.load"
  8455. ],
  8456. "alternates": [
  8457. "Ext.form.Action.Load"
  8458. ]
  8459. },
  8460. "Ext.form.action.StandardSubmit": {
  8461. "idx": 478,
  8462. "alias": [
  8463. "formaction.standardsubmit"
  8464. ],
  8465. "alternates": []
  8466. },
  8467. "Ext.form.action.Submit": {
  8468. "idx": 477,
  8469. "alias": [
  8470. "formaction.submit"
  8471. ],
  8472. "alternates": [
  8473. "Ext.form.Action.Submit"
  8474. ]
  8475. },
  8476. "Ext.form.field.Base": {
  8477. "idx": 483,
  8478. "alias": [
  8479. "widget.field"
  8480. ],
  8481. "alternates": [
  8482. "Ext.form.Field",
  8483. "Ext.form.BaseField"
  8484. ]
  8485. },
  8486. "Ext.form.field.Checkbox": {
  8487. "idx": 496,
  8488. "alias": [
  8489. "widget.checkbox",
  8490. "widget.checkboxfield"
  8491. ],
  8492. "alternates": [
  8493. "Ext.form.Checkbox"
  8494. ]
  8495. },
  8496. "Ext.form.field.ComboBox": {
  8497. "idx": 522,
  8498. "alias": [
  8499. "widget.combo",
  8500. "widget.combobox"
  8501. ],
  8502. "alternates": [
  8503. "Ext.form.ComboBox"
  8504. ]
  8505. },
  8506. "Ext.form.field.Date": {
  8507. "idx": 525,
  8508. "alias": [
  8509. "widget.datefield"
  8510. ],
  8511. "alternates": [
  8512. "Ext.form.DateField",
  8513. "Ext.form.Date"
  8514. ]
  8515. },
  8516. "Ext.form.field.Display": {
  8517. "idx": 526,
  8518. "alias": [
  8519. "widget.displayfield"
  8520. ],
  8521. "alternates": [
  8522. "Ext.form.DisplayField",
  8523. "Ext.form.Display"
  8524. ]
  8525. },
  8526. "Ext.form.field.Field": {
  8527. "idx": 482,
  8528. "alias": [],
  8529. "alternates": []
  8530. },
  8531. "Ext.form.field.File": {
  8532. "idx": 529,
  8533. "alias": [
  8534. "widget.filefield",
  8535. "widget.fileuploadfield"
  8536. ],
  8537. "alternates": [
  8538. "Ext.form.FileUploadField",
  8539. "Ext.ux.form.FileUploadField",
  8540. "Ext.form.File"
  8541. ]
  8542. },
  8543. "Ext.form.field.FileButton": {
  8544. "idx": 527,
  8545. "alias": [
  8546. "widget.filebutton"
  8547. ],
  8548. "alternates": []
  8549. },
  8550. "Ext.form.field.Hidden": {
  8551. "idx": 530,
  8552. "alias": [
  8553. "widget.hidden",
  8554. "widget.hiddenfield"
  8555. ],
  8556. "alternates": [
  8557. "Ext.form.Hidden"
  8558. ]
  8559. },
  8560. "Ext.form.field.HtmlEditor": {
  8561. "idx": 539,
  8562. "alias": [
  8563. "widget.htmleditor"
  8564. ],
  8565. "alternates": [
  8566. "Ext.form.HtmlEditor"
  8567. ]
  8568. },
  8569. "Ext.form.field.Number": {
  8570. "idx": 519,
  8571. "alias": [
  8572. "widget.numberfield"
  8573. ],
  8574. "alternates": [
  8575. "Ext.form.NumberField",
  8576. "Ext.form.Number"
  8577. ]
  8578. },
  8579. "Ext.form.field.Picker": {
  8580. "idx": 507,
  8581. "alias": [
  8582. "widget.pickerfield"
  8583. ],
  8584. "alternates": [
  8585. "Ext.form.Picker"
  8586. ]
  8587. },
  8588. "Ext.form.field.Radio": {
  8589. "idx": 502,
  8590. "alias": [
  8591. "widget.radio",
  8592. "widget.radiofield"
  8593. ],
  8594. "alternates": [
  8595. "Ext.form.Radio"
  8596. ]
  8597. },
  8598. "Ext.form.field.Spinner": {
  8599. "idx": 518,
  8600. "alias": [
  8601. "widget.spinnerfield"
  8602. ],
  8603. "alternates": [
  8604. "Ext.form.Spinner"
  8605. ]
  8606. },
  8607. "Ext.form.field.Tag": {
  8608. "idx": 541,
  8609. "alias": [
  8610. "widget.tagfield"
  8611. ],
  8612. "alternates": []
  8613. },
  8614. "Ext.form.field.Text": {
  8615. "idx": 487,
  8616. "alias": [
  8617. "widget.textfield"
  8618. ],
  8619. "alternates": [
  8620. "Ext.form.TextField",
  8621. "Ext.form.Text"
  8622. ]
  8623. },
  8624. "Ext.form.field.TextArea": {
  8625. "idx": 488,
  8626. "alias": [
  8627. "widget.textarea",
  8628. "widget.textareafield"
  8629. ],
  8630. "alternates": [
  8631. "Ext.form.TextArea"
  8632. ]
  8633. },
  8634. "Ext.form.field.Time": {
  8635. "idx": 543,
  8636. "alias": [
  8637. "widget.timefield"
  8638. ],
  8639. "alternates": [
  8640. "Ext.form.TimeField",
  8641. "Ext.form.Time"
  8642. ]
  8643. },
  8644. "Ext.form.field.Trigger": {
  8645. "idx": 544,
  8646. "alias": [
  8647. "widget.trigger",
  8648. "widget.triggerfield"
  8649. ],
  8650. "alternates": [
  8651. "Ext.form.TriggerField",
  8652. "Ext.form.TwinTriggerField",
  8653. "Ext.form.Trigger"
  8654. ]
  8655. },
  8656. "Ext.form.field.VTypes": {
  8657. "idx": 485,
  8658. "alias": [],
  8659. "alternates": [
  8660. "Ext.form.VTypes"
  8661. ]
  8662. },
  8663. "Ext.form.trigger.Component": {
  8664. "idx": 528,
  8665. "alias": [
  8666. "trigger.component"
  8667. ],
  8668. "alternates": []
  8669. },
  8670. "Ext.form.trigger.Spinner": {
  8671. "idx": 517,
  8672. "alias": [
  8673. "trigger.spinner"
  8674. ],
  8675. "alternates": []
  8676. },
  8677. "Ext.form.trigger.Trigger": {
  8678. "idx": 486,
  8679. "alias": [
  8680. "trigger.trigger"
  8681. ],
  8682. "alternates": []
  8683. },
  8684. "Ext.fx.Anim": {
  8685. "idx": 72,
  8686. "alias": [],
  8687. "alternates": []
  8688. },
  8689. "Ext.fx.Animation": {
  8690. "idx": 329,
  8691. "alias": [],
  8692. "alternates": []
  8693. },
  8694. "Ext.fx.Animator": {
  8695. "idx": 67,
  8696. "alias": [],
  8697. "alternates": []
  8698. },
  8699. "Ext.fx.CubicBezier": {
  8700. "idx": 68,
  8701. "alias": [],
  8702. "alternates": []
  8703. },
  8704. "Ext.fx.DrawPath": {
  8705. "idx": 70,
  8706. "alias": [],
  8707. "alternates": []
  8708. },
  8709. "Ext.fx.Easing": {
  8710. "idx": 69,
  8711. "alias": [],
  8712. "alternates": []
  8713. },
  8714. "Ext.fx.Manager": {
  8715. "idx": 66,
  8716. "alias": [],
  8717. "alternates": []
  8718. },
  8719. "Ext.fx.PropertyHandler": {
  8720. "idx": 71,
  8721. "alias": [],
  8722. "alternates": []
  8723. },
  8724. "Ext.fx.Queue": {
  8725. "idx": 65,
  8726. "alias": [],
  8727. "alternates": []
  8728. },
  8729. "Ext.fx.Runner": {
  8730. "idx": 332,
  8731. "alias": [],
  8732. "alternates": []
  8733. },
  8734. "Ext.fx.State": {
  8735. "idx": 320,
  8736. "alias": [],
  8737. "alternates": []
  8738. },
  8739. "Ext.fx.animation.Abstract": {
  8740. "idx": 321,
  8741. "alias": [],
  8742. "alternates": []
  8743. },
  8744. "Ext.fx.animation.Cube": {
  8745. "idx": 333,
  8746. "alias": [
  8747. "animation.cube"
  8748. ],
  8749. "alternates": []
  8750. },
  8751. "Ext.fx.animation.Fade": {
  8752. "idx": 324,
  8753. "alias": [
  8754. "animation.fade",
  8755. "animation.fadeIn"
  8756. ],
  8757. "alternates": [
  8758. "Ext.fx.animation.FadeIn"
  8759. ]
  8760. },
  8761. "Ext.fx.animation.FadeOut": {
  8762. "idx": 325,
  8763. "alias": [
  8764. "animation.fadeOut"
  8765. ],
  8766. "alternates": []
  8767. },
  8768. "Ext.fx.animation.Flip": {
  8769. "idx": 326,
  8770. "alias": [
  8771. "animation.flip"
  8772. ],
  8773. "alternates": []
  8774. },
  8775. "Ext.fx.animation.Pop": {
  8776. "idx": 327,
  8777. "alias": [
  8778. "animation.pop",
  8779. "animation.popIn"
  8780. ],
  8781. "alternates": [
  8782. "Ext.fx.animation.PopIn"
  8783. ]
  8784. },
  8785. "Ext.fx.animation.PopOut": {
  8786. "idx": 328,
  8787. "alias": [
  8788. "animation.popOut"
  8789. ],
  8790. "alternates": []
  8791. },
  8792. "Ext.fx.animation.Slide": {
  8793. "idx": 322,
  8794. "alias": [
  8795. "animation.slide",
  8796. "animation.slideIn"
  8797. ],
  8798. "alternates": [
  8799. "Ext.fx.animation.SlideIn"
  8800. ]
  8801. },
  8802. "Ext.fx.animation.SlideOut": {
  8803. "idx": 323,
  8804. "alias": [
  8805. "animation.slideOut"
  8806. ],
  8807. "alternates": []
  8808. },
  8809. "Ext.fx.animation.Wipe": {
  8810. "idx": 334,
  8811. "alias": [],
  8812. "alternates": [
  8813. "Ext.fx.animation.WipeIn"
  8814. ]
  8815. },
  8816. "Ext.fx.animation.WipeOut": {
  8817. "idx": 335,
  8818. "alias": [],
  8819. "alternates": []
  8820. },
  8821. "Ext.fx.easing.Abstract": {
  8822. "idx": 102,
  8823. "alias": [],
  8824. "alternates": []
  8825. },
  8826. "Ext.fx.easing.Bounce": {
  8827. "idx": 336,
  8828. "alias": [],
  8829. "alternates": []
  8830. },
  8831. "Ext.fx.easing.BoundMomentum": {
  8832. "idx": 338,
  8833. "alias": [],
  8834. "alternates": []
  8835. },
  8836. "Ext.fx.easing.EaseIn": {
  8837. "idx": 339,
  8838. "alias": [
  8839. "easing.ease-in"
  8840. ],
  8841. "alternates": []
  8842. },
  8843. "Ext.fx.easing.EaseOut": {
  8844. "idx": 340,
  8845. "alias": [
  8846. "easing.ease-out"
  8847. ],
  8848. "alternates": []
  8849. },
  8850. "Ext.fx.easing.Easing": {
  8851. "idx": 341,
  8852. "alias": [],
  8853. "alternates": []
  8854. },
  8855. "Ext.fx.easing.Linear": {
  8856. "idx": 103,
  8857. "alias": [
  8858. "easing.linear"
  8859. ],
  8860. "alternates": []
  8861. },
  8862. "Ext.fx.easing.Momentum": {
  8863. "idx": 337,
  8864. "alias": [],
  8865. "alternates": []
  8866. },
  8867. "Ext.fx.runner.Css": {
  8868. "idx": 330,
  8869. "alias": [],
  8870. "alternates": []
  8871. },
  8872. "Ext.fx.runner.CssAnimation": {
  8873. "idx": 342,
  8874. "alias": [],
  8875. "alternates": []
  8876. },
  8877. "Ext.fx.runner.CssTransition": {
  8878. "idx": 331,
  8879. "alias": [],
  8880. "alternates": [
  8881. "Ext.Animator"
  8882. ]
  8883. },
  8884. "Ext.fx.target.Component": {
  8885. "idx": 64,
  8886. "alias": [],
  8887. "alternates": []
  8888. },
  8889. "Ext.fx.target.CompositeElement": {
  8890. "idx": 60,
  8891. "alias": [],
  8892. "alternates": []
  8893. },
  8894. "Ext.fx.target.CompositeElementCSS": {
  8895. "idx": 61,
  8896. "alias": [],
  8897. "alternates": []
  8898. },
  8899. "Ext.fx.target.CompositeSprite": {
  8900. "idx": 63,
  8901. "alias": [],
  8902. "alternates": []
  8903. },
  8904. "Ext.fx.target.Element": {
  8905. "idx": 58,
  8906. "alias": [],
  8907. "alternates": []
  8908. },
  8909. "Ext.fx.target.ElementCSS": {
  8910. "idx": 59,
  8911. "alias": [],
  8912. "alternates": []
  8913. },
  8914. "Ext.fx.target.Sprite": {
  8915. "idx": 62,
  8916. "alias": [],
  8917. "alternates": []
  8918. },
  8919. "Ext.fx.target.Target": {
  8920. "idx": 57,
  8921. "alias": [],
  8922. "alternates": []
  8923. },
  8924. "Ext.grid.CellContext": {
  8925. "idx": 545,
  8926. "alias": [],
  8927. "alternates": []
  8928. },
  8929. "Ext.grid.CellEditor": {
  8930. "idx": 546,
  8931. "alias": [
  8932. "widget.celleditor"
  8933. ],
  8934. "alternates": []
  8935. },
  8936. "Ext.grid.ColumnComponentLayout": {
  8937. "idx": 547,
  8938. "alias": [
  8939. "layout.columncomponent"
  8940. ],
  8941. "alternates": []
  8942. },
  8943. "Ext.grid.ColumnLayout": {
  8944. "idx": 550,
  8945. "alias": [
  8946. "layout.gridcolumn"
  8947. ],
  8948. "alternates": []
  8949. },
  8950. "Ext.grid.ColumnManager": {
  8951. "idx": 551,
  8952. "alias": [],
  8953. "alternates": [
  8954. "Ext.grid.ColumnModel"
  8955. ]
  8956. },
  8957. "Ext.grid.NavigationModel": {
  8958. "idx": 552,
  8959. "alias": [
  8960. "view.navigation.grid"
  8961. ],
  8962. "alternates": []
  8963. },
  8964. "Ext.grid.Panel": {
  8965. "idx": 558,
  8966. "alias": [
  8967. "widget.grid",
  8968. "widget.gridpanel"
  8969. ],
  8970. "alternates": [
  8971. "Ext.list.ListView",
  8972. "Ext.ListView",
  8973. "Ext.grid.GridPanel"
  8974. ]
  8975. },
  8976. "Ext.grid.RowContext": {
  8977. "idx": 559,
  8978. "alias": [],
  8979. "alternates": []
  8980. },
  8981. "Ext.grid.RowEditor": {
  8982. "idx": 561,
  8983. "alias": [
  8984. "widget.roweditor"
  8985. ],
  8986. "alternates": []
  8987. },
  8988. "Ext.grid.RowEditorButtons": {
  8989. "idx": 560,
  8990. "alias": [
  8991. "widget.roweditorbuttons"
  8992. ],
  8993. "alternates": []
  8994. },
  8995. "Ext.grid.Scroller": {
  8996. "idx": 562,
  8997. "alias": [],
  8998. "alternates": []
  8999. },
  9000. "Ext.grid.ViewDropZone": {
  9001. "idx": 564,
  9002. "alias": [],
  9003. "alternates": []
  9004. },
  9005. "Ext.grid.column.Action": {
  9006. "idx": 572,
  9007. "alias": [
  9008. "widget.actioncolumn"
  9009. ],
  9010. "alternates": [
  9011. "Ext.grid.ActionColumn"
  9012. ]
  9013. },
  9014. "Ext.grid.column.ActionProxy": {
  9015. "idx": 571,
  9016. "alias": [],
  9017. "alternates": []
  9018. },
  9019. "Ext.grid.column.Boolean": {
  9020. "idx": 573,
  9021. "alias": [
  9022. "widget.booleancolumn"
  9023. ],
  9024. "alternates": [
  9025. "Ext.grid.BooleanColumn"
  9026. ]
  9027. },
  9028. "Ext.grid.column.Check": {
  9029. "idx": 574,
  9030. "alias": [
  9031. "widget.checkcolumn"
  9032. ],
  9033. "alternates": [
  9034. "Ext.ux.CheckColumn",
  9035. "Ext.grid.column.CheckColumn"
  9036. ]
  9037. },
  9038. "Ext.grid.column.Column": {
  9039. "idx": 570,
  9040. "alias": [
  9041. "widget.gridcolumn"
  9042. ],
  9043. "alternates": [
  9044. "Ext.grid.Column"
  9045. ]
  9046. },
  9047. "Ext.grid.column.Date": {
  9048. "idx": 575,
  9049. "alias": [
  9050. "widget.datecolumn"
  9051. ],
  9052. "alternates": [
  9053. "Ext.grid.DateColumn"
  9054. ]
  9055. },
  9056. "Ext.grid.column.Number": {
  9057. "idx": 576,
  9058. "alias": [
  9059. "widget.numbercolumn"
  9060. ],
  9061. "alternates": [
  9062. "Ext.grid.NumberColumn"
  9063. ]
  9064. },
  9065. "Ext.grid.column.RowNumberer": {
  9066. "idx": 577,
  9067. "alias": [
  9068. "widget.rownumberer"
  9069. ],
  9070. "alternates": [
  9071. "Ext.grid.RowNumberer"
  9072. ]
  9073. },
  9074. "Ext.grid.column.Template": {
  9075. "idx": 578,
  9076. "alias": [
  9077. "widget.templatecolumn"
  9078. ],
  9079. "alternates": [
  9080. "Ext.grid.TemplateColumn"
  9081. ]
  9082. },
  9083. "Ext.grid.column.Widget": {
  9084. "idx": 579,
  9085. "alias": [
  9086. "widget.widgetcolumn"
  9087. ],
  9088. "alternates": []
  9089. },
  9090. "Ext.grid.feature.AbstractSummary": {
  9091. "idx": 581,
  9092. "alias": [
  9093. "feature.abstractsummary"
  9094. ],
  9095. "alternates": []
  9096. },
  9097. "Ext.grid.feature.Feature": {
  9098. "idx": 580,
  9099. "alias": [
  9100. "feature.feature"
  9101. ],
  9102. "alternates": []
  9103. },
  9104. "Ext.grid.feature.GroupStore": {
  9105. "idx": 582,
  9106. "alias": [],
  9107. "alternates": []
  9108. },
  9109. "Ext.grid.feature.Grouping": {
  9110. "idx": 583,
  9111. "alias": [
  9112. "feature.grouping"
  9113. ],
  9114. "alternates": []
  9115. },
  9116. "Ext.grid.feature.GroupingSummary": {
  9117. "idx": 584,
  9118. "alias": [
  9119. "feature.groupingsummary"
  9120. ],
  9121. "alternates": []
  9122. },
  9123. "Ext.grid.feature.RowBody": {
  9124. "idx": 585,
  9125. "alias": [
  9126. "feature.rowbody"
  9127. ],
  9128. "alternates": []
  9129. },
  9130. "Ext.grid.feature.Summary": {
  9131. "idx": 586,
  9132. "alias": [
  9133. "feature.summary"
  9134. ],
  9135. "alternates": []
  9136. },
  9137. "Ext.grid.filters.Filters": {
  9138. "idx": 599,
  9139. "alias": [
  9140. "plugin.gridfilters"
  9141. ],
  9142. "alternates": []
  9143. },
  9144. "Ext.grid.filters.filter.Base": {
  9145. "idx": 591,
  9146. "alias": [],
  9147. "alternates": []
  9148. },
  9149. "Ext.grid.filters.filter.Boolean": {
  9150. "idx": 593,
  9151. "alias": [
  9152. "grid.filter.boolean"
  9153. ],
  9154. "alternates": []
  9155. },
  9156. "Ext.grid.filters.filter.Date": {
  9157. "idx": 595,
  9158. "alias": [
  9159. "grid.filter.date"
  9160. ],
  9161. "alternates": []
  9162. },
  9163. "Ext.grid.filters.filter.List": {
  9164. "idx": 596,
  9165. "alias": [
  9166. "grid.filter.list"
  9167. ],
  9168. "alternates": []
  9169. },
  9170. "Ext.grid.filters.filter.Number": {
  9171. "idx": 597,
  9172. "alias": [
  9173. "grid.filter.number",
  9174. "grid.filter.numeric"
  9175. ],
  9176. "alternates": []
  9177. },
  9178. "Ext.grid.filters.filter.SingleFilter": {
  9179. "idx": 592,
  9180. "alias": [],
  9181. "alternates": []
  9182. },
  9183. "Ext.grid.filters.filter.String": {
  9184. "idx": 598,
  9185. "alias": [
  9186. "grid.filter.string"
  9187. ],
  9188. "alternates": []
  9189. },
  9190. "Ext.grid.filters.filter.TriFilter": {
  9191. "idx": 594,
  9192. "alias": [],
  9193. "alternates": []
  9194. },
  9195. "Ext.grid.header.Container": {
  9196. "idx": 569,
  9197. "alias": [
  9198. "widget.headercontainer"
  9199. ],
  9200. "alternates": []
  9201. },
  9202. "Ext.grid.header.DragZone": {
  9203. "idx": 566,
  9204. "alias": [],
  9205. "alternates": []
  9206. },
  9207. "Ext.grid.header.DropZone": {
  9208. "idx": 567,
  9209. "alias": [],
  9210. "alternates": []
  9211. },
  9212. "Ext.grid.locking.HeaderContainer": {
  9213. "idx": 600,
  9214. "alias": [],
  9215. "alternates": []
  9216. },
  9217. "Ext.grid.locking.Lockable": {
  9218. "idx": 603,
  9219. "alias": [],
  9220. "alternates": [
  9221. "Ext.grid.Lockable"
  9222. ]
  9223. },
  9224. "Ext.grid.locking.RowSynchronizer": {
  9225. "idx": 554,
  9226. "alias": [],
  9227. "alternates": []
  9228. },
  9229. "Ext.grid.locking.View": {
  9230. "idx": 601,
  9231. "alias": [],
  9232. "alternates": [
  9233. "Ext.grid.LockingView"
  9234. ]
  9235. },
  9236. "Ext.grid.plugin.BufferedRenderer": {
  9237. "idx": 604,
  9238. "alias": [
  9239. "plugin.bufferedrenderer"
  9240. ],
  9241. "alternates": []
  9242. },
  9243. "Ext.grid.plugin.CellEditing": {
  9244. "idx": 606,
  9245. "alias": [
  9246. "plugin.cellediting"
  9247. ],
  9248. "alternates": []
  9249. },
  9250. "Ext.grid.plugin.Clipboard": {
  9251. "idx": 607,
  9252. "alias": [
  9253. "plugin.clipboard"
  9254. ],
  9255. "alternates": []
  9256. },
  9257. "Ext.grid.plugin.DragDrop": {
  9258. "idx": 608,
  9259. "alias": [
  9260. "plugin.gridviewdragdrop"
  9261. ],
  9262. "alternates": []
  9263. },
  9264. "Ext.grid.plugin.Editing": {
  9265. "idx": 605,
  9266. "alias": [
  9267. "editing.editing"
  9268. ],
  9269. "alternates": []
  9270. },
  9271. "Ext.grid.plugin.HeaderReorderer": {
  9272. "idx": 568,
  9273. "alias": [
  9274. "plugin.gridheaderreorderer"
  9275. ],
  9276. "alternates": []
  9277. },
  9278. "Ext.grid.plugin.HeaderResizer": {
  9279. "idx": 565,
  9280. "alias": [
  9281. "plugin.gridheaderresizer"
  9282. ],
  9283. "alternates": []
  9284. },
  9285. "Ext.grid.plugin.RowEditing": {
  9286. "idx": 609,
  9287. "alias": [
  9288. "plugin.rowediting"
  9289. ],
  9290. "alternates": []
  9291. },
  9292. "Ext.grid.plugin.RowExpander": {
  9293. "idx": 610,
  9294. "alias": [
  9295. "plugin.rowexpander"
  9296. ],
  9297. "alternates": []
  9298. },
  9299. "Ext.grid.plugin.RowWidget": {
  9300. "idx": 611,
  9301. "alias": [
  9302. "plugin.rowwidget"
  9303. ],
  9304. "alternates": []
  9305. },
  9306. "Ext.grid.property.Grid": {
  9307. "idx": 612,
  9308. "alias": [
  9309. "widget.propertygrid"
  9310. ],
  9311. "alternates": [
  9312. "Ext.grid.PropertyGrid"
  9313. ]
  9314. },
  9315. "Ext.grid.property.HeaderContainer": {
  9316. "idx": 613,
  9317. "alias": [],
  9318. "alternates": [
  9319. "Ext.grid.PropertyColumnModel"
  9320. ]
  9321. },
  9322. "Ext.grid.property.Property": {
  9323. "idx": 614,
  9324. "alias": [],
  9325. "alternates": [
  9326. "Ext.PropGridProperty"
  9327. ]
  9328. },
  9329. "Ext.grid.property.Reader": {
  9330. "idx": 615,
  9331. "alias": [],
  9332. "alternates": []
  9333. },
  9334. "Ext.grid.property.Store": {
  9335. "idx": 616,
  9336. "alias": [],
  9337. "alternates": [
  9338. "Ext.grid.PropertyStore"
  9339. ]
  9340. },
  9341. "Ext.grid.selection.Cells": {
  9342. "idx": 618,
  9343. "alias": [],
  9344. "alternates": []
  9345. },
  9346. "Ext.grid.selection.Columns": {
  9347. "idx": 619,
  9348. "alias": [],
  9349. "alternates": []
  9350. },
  9351. "Ext.grid.selection.Replicator": {
  9352. "idx": 620,
  9353. "alias": [
  9354. "plugin.selectionreplicator"
  9355. ],
  9356. "alternates": []
  9357. },
  9358. "Ext.grid.selection.Rows": {
  9359. "idx": 621,
  9360. "alias": [],
  9361. "alternates": []
  9362. },
  9363. "Ext.grid.selection.Selection": {
  9364. "idx": 617,
  9365. "alias": [],
  9366. "alternates": []
  9367. },
  9368. "Ext.grid.selection.SelectionExtender": {
  9369. "idx": 622,
  9370. "alias": [],
  9371. "alternates": []
  9372. },
  9373. "Ext.grid.selection.SpreadsheetModel": {
  9374. "idx": 623,
  9375. "alias": [
  9376. "selection.spreadsheet"
  9377. ],
  9378. "alternates": []
  9379. },
  9380. "Ext.layout.Context": {
  9381. "idx": 626,
  9382. "alias": [],
  9383. "alternates": []
  9384. },
  9385. "Ext.layout.ContextItem": {
  9386. "idx": 625,
  9387. "alias": [],
  9388. "alternates": []
  9389. },
  9390. "Ext.layout.Layout": {
  9391. "idx": 400,
  9392. "alias": [],
  9393. "alternates": []
  9394. },
  9395. "Ext.layout.SizeModel": {
  9396. "idx": 399,
  9397. "alias": [],
  9398. "alternates": []
  9399. },
  9400. "Ext.layout.component.Auto": {
  9401. "idx": 413,
  9402. "alias": [
  9403. "layout.autocomponent"
  9404. ],
  9405. "alternates": []
  9406. },
  9407. "Ext.layout.component.Body": {
  9408. "idx": 628,
  9409. "alias": [
  9410. "layout.body"
  9411. ],
  9412. "alternates": []
  9413. },
  9414. "Ext.layout.component.BoundList": {
  9415. "idx": 514,
  9416. "alias": [
  9417. "layout.boundlist"
  9418. ],
  9419. "alternates": []
  9420. },
  9421. "Ext.layout.component.Component": {
  9422. "idx": 412,
  9423. "alias": [],
  9424. "alternates": []
  9425. },
  9426. "Ext.layout.component.Dock": {
  9427. "idx": 443,
  9428. "alias": [
  9429. "layout.dock"
  9430. ],
  9431. "alternates": [
  9432. "Ext.layout.component.AbstractDock"
  9433. ]
  9434. },
  9435. "Ext.layout.component.FieldSet": {
  9436. "idx": 629,
  9437. "alias": [
  9438. "layout.fieldset"
  9439. ],
  9440. "alternates": []
  9441. },
  9442. "Ext.layout.component.ProgressBar": {
  9443. "idx": 414,
  9444. "alias": [
  9445. "layout.progressbar"
  9446. ],
  9447. "alternates": []
  9448. },
  9449. "Ext.layout.component.field.FieldContainer": {
  9450. "idx": 492,
  9451. "alias": [
  9452. "layout.fieldcontainer"
  9453. ],
  9454. "alternates": []
  9455. },
  9456. "Ext.layout.component.field.HtmlEditor": {
  9457. "idx": 536,
  9458. "alias": [
  9459. "layout.htmleditor"
  9460. ],
  9461. "alternates": []
  9462. },
  9463. "Ext.layout.component.field.Text": {
  9464. "idx": 484,
  9465. "alias": [
  9466. "layout.textfield"
  9467. ],
  9468. "alternates": []
  9469. },
  9470. "Ext.layout.container.Absolute": {
  9471. "idx": 630,
  9472. "alias": [
  9473. "layout.absolute"
  9474. ],
  9475. "alternates": [
  9476. "Ext.layout.AbsoluteLayout"
  9477. ]
  9478. },
  9479. "Ext.layout.container.Accordion": {
  9480. "idx": 631,
  9481. "alias": [
  9482. "layout.accordion"
  9483. ],
  9484. "alternates": [
  9485. "Ext.layout.AccordionLayout"
  9486. ]
  9487. },
  9488. "Ext.layout.container.Anchor": {
  9489. "idx": 453,
  9490. "alias": [
  9491. "layout.anchor"
  9492. ],
  9493. "alternates": [
  9494. "Ext.layout.AnchorLayout"
  9495. ]
  9496. },
  9497. "Ext.layout.container.Auto": {
  9498. "idx": 402,
  9499. "alias": [
  9500. "layout.auto",
  9501. "layout.autocontainer"
  9502. ],
  9503. "alternates": []
  9504. },
  9505. "Ext.layout.container.Border": {
  9506. "idx": 633,
  9507. "alias": [
  9508. "layout.border"
  9509. ],
  9510. "alternates": [
  9511. "Ext.layout.BorderLayout"
  9512. ]
  9513. },
  9514. "Ext.layout.container.Box": {
  9515. "idx": 432,
  9516. "alias": [
  9517. "layout.box"
  9518. ],
  9519. "alternates": [
  9520. "Ext.layout.BoxLayout"
  9521. ]
  9522. },
  9523. "Ext.layout.container.Card": {
  9524. "idx": 634,
  9525. "alias": [
  9526. "layout.card"
  9527. ],
  9528. "alternates": [
  9529. "Ext.layout.CardLayout"
  9530. ]
  9531. },
  9532. "Ext.layout.container.Center": {
  9533. "idx": 635,
  9534. "alias": [
  9535. "layout.center",
  9536. "layout.ux.center"
  9537. ],
  9538. "alternates": [
  9539. "Ext.ux.layout.Center"
  9540. ]
  9541. },
  9542. "Ext.layout.container.CheckboxGroup": {
  9543. "idx": 494,
  9544. "alias": [
  9545. "layout.checkboxgroup"
  9546. ],
  9547. "alternates": []
  9548. },
  9549. "Ext.layout.container.Column": {
  9550. "idx": 456,
  9551. "alias": [
  9552. "layout.column"
  9553. ],
  9554. "alternates": [
  9555. "Ext.layout.ColumnLayout"
  9556. ]
  9557. },
  9558. "Ext.layout.container.ColumnSplitter": {
  9559. "idx": 460,
  9560. "alias": [
  9561. "widget.columnsplitter"
  9562. ],
  9563. "alternates": []
  9564. },
  9565. "Ext.layout.container.ColumnSplitterTracker": {
  9566. "idx": 459,
  9567. "alias": [],
  9568. "alternates": []
  9569. },
  9570. "Ext.layout.container.Container": {
  9571. "idx": 401,
  9572. "alias": [
  9573. "layout.container"
  9574. ],
  9575. "alternates": [
  9576. "Ext.layout.ContainerLayout"
  9577. ]
  9578. },
  9579. "Ext.layout.container.Dashboard": {
  9580. "idx": 461,
  9581. "alias": [
  9582. "layout.dashboard"
  9583. ],
  9584. "alternates": []
  9585. },
  9586. "Ext.layout.container.Editor": {
  9587. "idx": 405,
  9588. "alias": [
  9589. "layout.editor"
  9590. ],
  9591. "alternates": []
  9592. },
  9593. "Ext.layout.container.Fit": {
  9594. "idx": 548,
  9595. "alias": [
  9596. "layout.fit"
  9597. ],
  9598. "alternates": [
  9599. "Ext.layout.FitLayout",
  9600. "Ext.layout.Fit"
  9601. ]
  9602. },
  9603. "Ext.layout.container.Form": {
  9604. "idx": 636,
  9605. "alias": [
  9606. "layout.form"
  9607. ],
  9608. "alternates": [
  9609. "Ext.layout.FormLayout"
  9610. ]
  9611. },
  9612. "Ext.layout.container.HBox": {
  9613. "idx": 433,
  9614. "alias": [
  9615. "layout.hbox"
  9616. ],
  9617. "alternates": [
  9618. "Ext.layout.HBoxLayout"
  9619. ]
  9620. },
  9621. "Ext.layout.container.SegmentedButton": {
  9622. "idx": 422,
  9623. "alias": [
  9624. "layout.segmentedbutton"
  9625. ],
  9626. "alternates": []
  9627. },
  9628. "Ext.layout.container.Table": {
  9629. "idx": 447,
  9630. "alias": [
  9631. "layout.table"
  9632. ],
  9633. "alternates": [
  9634. "Ext.layout.TableLayout"
  9635. ]
  9636. },
  9637. "Ext.layout.container.VBox": {
  9638. "idx": 434,
  9639. "alias": [
  9640. "layout.vbox"
  9641. ],
  9642. "alternates": [
  9643. "Ext.layout.VBoxLayout"
  9644. ]
  9645. },
  9646. "Ext.layout.container.border.Region": {
  9647. "idx": 115,
  9648. "alias": [],
  9649. "alternates": []
  9650. },
  9651. "Ext.layout.container.boxOverflow.Menu": {
  9652. "idx": 538,
  9653. "alias": [
  9654. "box.overflow.Menu",
  9655. "box.overflow.menu"
  9656. ],
  9657. "alternates": [
  9658. "Ext.layout.boxOverflow.Menu"
  9659. ]
  9660. },
  9661. "Ext.layout.container.boxOverflow.None": {
  9662. "idx": 428,
  9663. "alias": [
  9664. "box.overflow.None",
  9665. "box.overflow.none"
  9666. ],
  9667. "alternates": [
  9668. "Ext.layout.boxOverflow.None"
  9669. ]
  9670. },
  9671. "Ext.layout.container.boxOverflow.Scroller": {
  9672. "idx": 429,
  9673. "alias": [
  9674. "box.overflow.Scroller",
  9675. "box.overflow.scroller"
  9676. ],
  9677. "alternates": [
  9678. "Ext.layout.boxOverflow.Scroller"
  9679. ]
  9680. },
  9681. "Ext.list.AbstractTreeItem": {
  9682. "idx": 343,
  9683. "alias": [],
  9684. "alternates": []
  9685. },
  9686. "Ext.list.RootTreeItem": {
  9687. "idx": 344,
  9688. "alias": [],
  9689. "alternates": []
  9690. },
  9691. "Ext.list.Tree": {
  9692. "idx": 347,
  9693. "alias": [
  9694. "widget.treelist"
  9695. ],
  9696. "alternates": []
  9697. },
  9698. "Ext.list.TreeItem": {
  9699. "idx": 346,
  9700. "alias": [
  9701. "widget.treelistitem"
  9702. ],
  9703. "alternates": []
  9704. },
  9705. "Ext.menu.Bar": {
  9706. "idx": 637,
  9707. "alias": [
  9708. "widget.menubar"
  9709. ],
  9710. "alternates": []
  9711. },
  9712. "Ext.menu.CheckItem": {
  9713. "idx": 588,
  9714. "alias": [
  9715. "widget.menucheckitem"
  9716. ],
  9717. "alternates": []
  9718. },
  9719. "Ext.menu.ColorPicker": {
  9720. "idx": 638,
  9721. "alias": [
  9722. "widget.colormenu"
  9723. ],
  9724. "alternates": []
  9725. },
  9726. "Ext.menu.DatePicker": {
  9727. "idx": 639,
  9728. "alias": [
  9729. "widget.datemenu"
  9730. ],
  9731. "alternates": []
  9732. },
  9733. "Ext.menu.Item": {
  9734. "idx": 587,
  9735. "alias": [
  9736. "widget.menuitem"
  9737. ],
  9738. "alternates": [
  9739. "Ext.menu.TextItem"
  9740. ]
  9741. },
  9742. "Ext.menu.Manager": {
  9743. "idx": 418,
  9744. "alias": [],
  9745. "alternates": [
  9746. "Ext.menu.MenuMgr"
  9747. ]
  9748. },
  9749. "Ext.menu.Menu": {
  9750. "idx": 590,
  9751. "alias": [
  9752. "widget.menu"
  9753. ],
  9754. "alternates": []
  9755. },
  9756. "Ext.menu.Separator": {
  9757. "idx": 589,
  9758. "alias": [
  9759. "widget.menuseparator"
  9760. ],
  9761. "alternates": []
  9762. },
  9763. "Ext.mixin.Accessible": {
  9764. "idx": 87,
  9765. "alias": [],
  9766. "alternates": []
  9767. },
  9768. "Ext.mixin.Bindable": {
  9769. "idx": 81,
  9770. "alias": [],
  9771. "alternates": []
  9772. },
  9773. "Ext.mixin.Bufferable": {
  9774. "idx": 20,
  9775. "alias": [],
  9776. "alternates": []
  9777. },
  9778. "Ext.mixin.ComponentDelegation": {
  9779. "idx": 82,
  9780. "alias": [],
  9781. "alternates": []
  9782. },
  9783. "Ext.mixin.ConfigProxy": {
  9784. "idx": 348,
  9785. "alias": [],
  9786. "alternates": []
  9787. },
  9788. "Ext.mixin.ConfigState": {
  9789. "idx": 349,
  9790. "alias": [],
  9791. "alternates": []
  9792. },
  9793. "Ext.mixin.Container": {
  9794. "idx": 350,
  9795. "alias": [],
  9796. "alternates": []
  9797. },
  9798. "Ext.mixin.Dirty": {
  9799. "idx": 194,
  9800. "alias": [],
  9801. "alternates": []
  9802. },
  9803. "Ext.mixin.Factoryable": {
  9804. "idx": 12,
  9805. "alias": [],
  9806. "alternates": []
  9807. },
  9808. "Ext.mixin.Focusable": {
  9809. "idx": 86,
  9810. "alias": [],
  9811. "alternates": []
  9812. },
  9813. "Ext.mixin.FocusableContainer": {
  9814. "idx": 353,
  9815. "alias": [],
  9816. "alternates": []
  9817. },
  9818. "Ext.mixin.Hookable": {
  9819. "idx": 354,
  9820. "alias": [],
  9821. "alternates": []
  9822. },
  9823. "Ext.mixin.Identifiable": {
  9824. "idx": 3,
  9825. "alias": [],
  9826. "alternates": []
  9827. },
  9828. "Ext.mixin.Inheritable": {
  9829. "idx": 80,
  9830. "alias": [],
  9831. "alternates": []
  9832. },
  9833. "Ext.mixin.ItemRippler": {
  9834. "idx": 345,
  9835. "alias": [],
  9836. "alternates": []
  9837. },
  9838. "Ext.mixin.Keyboard": {
  9839. "idx": 85,
  9840. "alias": [],
  9841. "alternates": []
  9842. },
  9843. "Ext.mixin.Mashup": {
  9844. "idx": 355,
  9845. "alias": [],
  9846. "alternates": []
  9847. },
  9848. "Ext.mixin.Observable": {
  9849. "idx": 4,
  9850. "alias": [],
  9851. "alternates": []
  9852. },
  9853. "Ext.mixin.Pluggable": {
  9854. "idx": 84,
  9855. "alias": [],
  9856. "alternates": []
  9857. },
  9858. "Ext.mixin.Queryable": {
  9859. "idx": 233,
  9860. "alias": [],
  9861. "alternates": []
  9862. },
  9863. "Ext.mixin.Responsive": {
  9864. "idx": 356,
  9865. "alias": [],
  9866. "alternates": []
  9867. },
  9868. "Ext.mixin.Selectable": {
  9869. "idx": 357,
  9870. "alias": [],
  9871. "alternates": []
  9872. },
  9873. "Ext.mixin.StoreWatcher": {
  9874. "idx": 358,
  9875. "alias": [],
  9876. "alternates": []
  9877. },
  9878. "Ext.mixin.StyleCacher": {
  9879. "idx": 359,
  9880. "alias": [],
  9881. "alternates": []
  9882. },
  9883. "Ext.mixin.Templatable": {
  9884. "idx": 39,
  9885. "alias": [],
  9886. "alternates": []
  9887. },
  9888. "Ext.mixin.Traversable": {
  9889. "idx": 360,
  9890. "alias": [],
  9891. "alternates": []
  9892. },
  9893. "Ext.panel.Bar": {
  9894. "idx": 424,
  9895. "alias": [],
  9896. "alternates": []
  9897. },
  9898. "Ext.panel.DD": {
  9899. "idx": 442,
  9900. "alias": [],
  9901. "alternates": []
  9902. },
  9903. "Ext.panel.Header": {
  9904. "idx": 427,
  9905. "alias": [
  9906. "widget.header"
  9907. ],
  9908. "alternates": []
  9909. },
  9910. "Ext.panel.Panel": {
  9911. "idx": 446,
  9912. "alias": [
  9913. "widget.panel"
  9914. ],
  9915. "alternates": [
  9916. "Ext.Panel"
  9917. ]
  9918. },
  9919. "Ext.panel.Pinnable": {
  9920. "idx": 640,
  9921. "alias": [],
  9922. "alternates": []
  9923. },
  9924. "Ext.panel.Proxy": {
  9925. "idx": 441,
  9926. "alias": [],
  9927. "alternates": [
  9928. "Ext.dd.PanelProxy"
  9929. ]
  9930. },
  9931. "Ext.panel.Table": {
  9932. "idx": 549,
  9933. "alias": [
  9934. "widget.tablepanel"
  9935. ],
  9936. "alternates": []
  9937. },
  9938. "Ext.panel.Title": {
  9939. "idx": 425,
  9940. "alias": [
  9941. "widget.title"
  9942. ],
  9943. "alternates": []
  9944. },
  9945. "Ext.panel.Tool": {
  9946. "idx": 426,
  9947. "alias": [
  9948. "widget.tool"
  9949. ],
  9950. "alternates": []
  9951. },
  9952. "Ext.parse.Parser": {
  9953. "idx": 213,
  9954. "alias": [],
  9955. "alternates": []
  9956. },
  9957. "Ext.parse.Symbol": {
  9958. "idx": 207,
  9959. "alias": [],
  9960. "alternates": []
  9961. },
  9962. "Ext.parse.Tokenizer": {
  9963. "idx": 206,
  9964. "alias": [],
  9965. "alternates": []
  9966. },
  9967. "Ext.parse.symbol.Constant": {
  9968. "idx": 208,
  9969. "alias": [],
  9970. "alternates": []
  9971. },
  9972. "Ext.parse.symbol.Infix": {
  9973. "idx": 209,
  9974. "alias": [],
  9975. "alternates": []
  9976. },
  9977. "Ext.parse.symbol.InfixRight": {
  9978. "idx": 210,
  9979. "alias": [],
  9980. "alternates": []
  9981. },
  9982. "Ext.parse.symbol.Paren": {
  9983. "idx": 211,
  9984. "alias": [],
  9985. "alternates": []
  9986. },
  9987. "Ext.parse.symbol.Prefix": {
  9988. "idx": 212,
  9989. "alias": [],
  9990. "alternates": []
  9991. },
  9992. "Ext.perf.Accumulator": {
  9993. "idx": 361,
  9994. "alias": [],
  9995. "alternates": []
  9996. },
  9997. "Ext.perf.Monitor": {
  9998. "idx": 362,
  9999. "alias": [],
  10000. "alternates": [
  10001. "Ext.Perf"
  10002. ]
  10003. },
  10004. "Ext.picker.Color": {
  10005. "idx": 535,
  10006. "alias": [
  10007. "widget.colorpicker"
  10008. ],
  10009. "alternates": [
  10010. "Ext.ColorPalette"
  10011. ]
  10012. },
  10013. "Ext.picker.Date": {
  10014. "idx": 524,
  10015. "alias": [
  10016. "widget.datepicker"
  10017. ],
  10018. "alternates": [
  10019. "Ext.DatePicker"
  10020. ]
  10021. },
  10022. "Ext.picker.Month": {
  10023. "idx": 523,
  10024. "alias": [
  10025. "widget.monthpicker"
  10026. ],
  10027. "alternates": [
  10028. "Ext.MonthPicker"
  10029. ]
  10030. },
  10031. "Ext.picker.Time": {
  10032. "idx": 542,
  10033. "alias": [
  10034. "widget.timepicker"
  10035. ],
  10036. "alternates": []
  10037. },
  10038. "Ext.plugin.Abstract": {
  10039. "idx": 83,
  10040. "alias": [],
  10041. "alternates": [
  10042. "Ext.AbstractPlugin"
  10043. ]
  10044. },
  10045. "Ext.plugin.AbstractClipboard": {
  10046. "idx": 363,
  10047. "alias": [],
  10048. "alternates": []
  10049. },
  10050. "Ext.plugin.LazyItems": {
  10051. "idx": 641,
  10052. "alias": [
  10053. "plugin.lazyitems"
  10054. ],
  10055. "alternates": []
  10056. },
  10057. "Ext.plugin.Manager": {
  10058. "idx": 100,
  10059. "alias": [],
  10060. "alternates": [
  10061. "Ext.PluginManager",
  10062. "Ext.PluginMgr"
  10063. ]
  10064. },
  10065. "Ext.plugin.MouseEnter": {
  10066. "idx": 364,
  10067. "alias": [
  10068. "plugin.mouseenter"
  10069. ],
  10070. "alternates": []
  10071. },
  10072. "Ext.plugin.Responsive": {
  10073. "idx": 450,
  10074. "alias": [
  10075. "plugin.responsive"
  10076. ],
  10077. "alternates": []
  10078. },
  10079. "Ext.plugin.Viewport": {
  10080. "idx": 451,
  10081. "alias": [
  10082. "plugin.viewport"
  10083. ],
  10084. "alternates": []
  10085. },
  10086. "Ext.promise.Consequence": {
  10087. "idx": 7,
  10088. "alias": [],
  10089. "alternates": []
  10090. },
  10091. "Ext.promise.Deferred": {
  10092. "idx": 8,
  10093. "alias": [],
  10094. "alternates": []
  10095. },
  10096. "Ext.promise.Promise": {
  10097. "idx": 9,
  10098. "alias": [],
  10099. "alternates": []
  10100. },
  10101. "Ext.resizer.BorderSplitter": {
  10102. "idx": 632,
  10103. "alias": [
  10104. "widget.bordersplitter"
  10105. ],
  10106. "alternates": []
  10107. },
  10108. "Ext.resizer.BorderSplitterTracker": {
  10109. "idx": 642,
  10110. "alias": [],
  10111. "alternates": []
  10112. },
  10113. "Ext.resizer.Handle": {
  10114. "idx": 643,
  10115. "alias": [],
  10116. "alternates": []
  10117. },
  10118. "Ext.resizer.ResizeTracker": {
  10119. "idx": 644,
  10120. "alias": [],
  10121. "alternates": []
  10122. },
  10123. "Ext.resizer.Resizer": {
  10124. "idx": 645,
  10125. "alias": [],
  10126. "alternates": [
  10127. "Ext.Resizable"
  10128. ]
  10129. },
  10130. "Ext.resizer.Splitter": {
  10131. "idx": 431,
  10132. "alias": [
  10133. "widget.splitter"
  10134. ],
  10135. "alternates": []
  10136. },
  10137. "Ext.resizer.SplitterTracker": {
  10138. "idx": 458,
  10139. "alias": [],
  10140. "alternates": []
  10141. },
  10142. "Ext.route.Action": {
  10143. "idx": 119,
  10144. "alias": [],
  10145. "alternates": []
  10146. },
  10147. "Ext.route.Handler": {
  10148. "idx": 118,
  10149. "alias": [],
  10150. "alternates": []
  10151. },
  10152. "Ext.route.Mixin": {
  10153. "idx": 123,
  10154. "alias": [],
  10155. "alternates": []
  10156. },
  10157. "Ext.route.Route": {
  10158. "idx": 120,
  10159. "alias": [],
  10160. "alternates": []
  10161. },
  10162. "Ext.route.Router": {
  10163. "idx": 122,
  10164. "alias": [],
  10165. "alternates": []
  10166. },
  10167. "Ext.scroll.LockingScroller": {
  10168. "idx": 602,
  10169. "alias": [
  10170. "scroller.locking"
  10171. ],
  10172. "alternates": []
  10173. },
  10174. "Ext.scroll.Scroller": {
  10175. "idx": 107,
  10176. "alias": [
  10177. "scroller.scroller"
  10178. ],
  10179. "alternates": []
  10180. },
  10181. "Ext.scroll.TableScroller": {
  10182. "idx": 556,
  10183. "alias": [
  10184. "scroller.table"
  10185. ],
  10186. "alternates": []
  10187. },
  10188. "Ext.selection.CellModel": {
  10189. "idx": 646,
  10190. "alias": [
  10191. "selection.cellmodel"
  10192. ],
  10193. "alternates": []
  10194. },
  10195. "Ext.selection.CheckboxModel": {
  10196. "idx": 648,
  10197. "alias": [
  10198. "selection.checkboxmodel"
  10199. ],
  10200. "alternates": []
  10201. },
  10202. "Ext.selection.DataViewModel": {
  10203. "idx": 509,
  10204. "alias": [
  10205. "selection.dataviewmodel"
  10206. ],
  10207. "alternates": []
  10208. },
  10209. "Ext.selection.Model": {
  10210. "idx": 508,
  10211. "alias": [
  10212. "selection.abstract"
  10213. ],
  10214. "alternates": [
  10215. "Ext.AbstractSelectionModel"
  10216. ]
  10217. },
  10218. "Ext.selection.RowModel": {
  10219. "idx": 647,
  10220. "alias": [
  10221. "selection.rowmodel"
  10222. ],
  10223. "alternates": []
  10224. },
  10225. "Ext.selection.TreeModel": {
  10226. "idx": 649,
  10227. "alias": [
  10228. "selection.treemodel"
  10229. ],
  10230. "alternates": []
  10231. },
  10232. "Ext.slider.Multi": {
  10233. "idx": 652,
  10234. "alias": [
  10235. "widget.multislider"
  10236. ],
  10237. "alternates": [
  10238. "Ext.slider.MultiSlider"
  10239. ]
  10240. },
  10241. "Ext.slider.Single": {
  10242. "idx": 653,
  10243. "alias": [
  10244. "widget.slider",
  10245. "widget.sliderfield"
  10246. ],
  10247. "alternates": [
  10248. "Ext.Slider",
  10249. "Ext.form.SliderField",
  10250. "Ext.slider.SingleSlider",
  10251. "Ext.slider.Slider"
  10252. ]
  10253. },
  10254. "Ext.slider.Thumb": {
  10255. "idx": 650,
  10256. "alias": [],
  10257. "alternates": []
  10258. },
  10259. "Ext.slider.Tip": {
  10260. "idx": 651,
  10261. "alias": [
  10262. "widget.slidertip"
  10263. ],
  10264. "alternates": []
  10265. },
  10266. "Ext.slider.Widget": {
  10267. "idx": 654,
  10268. "alias": [
  10269. "widget.sliderwidget"
  10270. ],
  10271. "alternates": []
  10272. },
  10273. "Ext.sparkline.Bar": {
  10274. "idx": 373,
  10275. "alias": [
  10276. "widget.sparklinebar"
  10277. ],
  10278. "alternates": []
  10279. },
  10280. "Ext.sparkline.BarBase": {
  10281. "idx": 371,
  10282. "alias": [],
  10283. "alternates": []
  10284. },
  10285. "Ext.sparkline.Base": {
  10286. "idx": 370,
  10287. "alias": [
  10288. "widget.sparkline"
  10289. ],
  10290. "alternates": []
  10291. },
  10292. "Ext.sparkline.Box": {
  10293. "idx": 374,
  10294. "alias": [
  10295. "widget.sparklinebox"
  10296. ],
  10297. "alternates": []
  10298. },
  10299. "Ext.sparkline.Bullet": {
  10300. "idx": 375,
  10301. "alias": [
  10302. "widget.sparklinebullet"
  10303. ],
  10304. "alternates": []
  10305. },
  10306. "Ext.sparkline.CanvasBase": {
  10307. "idx": 366,
  10308. "alias": [],
  10309. "alternates": []
  10310. },
  10311. "Ext.sparkline.CanvasCanvas": {
  10312. "idx": 367,
  10313. "alias": [],
  10314. "alternates": []
  10315. },
  10316. "Ext.sparkline.Discrete": {
  10317. "idx": 376,
  10318. "alias": [
  10319. "widget.sparklinediscrete"
  10320. ],
  10321. "alternates": []
  10322. },
  10323. "Ext.sparkline.Line": {
  10324. "idx": 377,
  10325. "alias": [
  10326. "widget.sparklineline"
  10327. ],
  10328. "alternates": []
  10329. },
  10330. "Ext.sparkline.Pie": {
  10331. "idx": 378,
  10332. "alias": [
  10333. "widget.sparklinepie"
  10334. ],
  10335. "alternates": []
  10336. },
  10337. "Ext.sparkline.RangeMap": {
  10338. "idx": 372,
  10339. "alias": [],
  10340. "alternates": []
  10341. },
  10342. "Ext.sparkline.Shape": {
  10343. "idx": 365,
  10344. "alias": [],
  10345. "alternates": []
  10346. },
  10347. "Ext.sparkline.TriState": {
  10348. "idx": 379,
  10349. "alias": [
  10350. "widget.sparklinetristate"
  10351. ],
  10352. "alternates": []
  10353. },
  10354. "Ext.sparkline.VmlCanvas": {
  10355. "idx": 368,
  10356. "alias": [],
  10357. "alternates": []
  10358. },
  10359. "Ext.state.CookieProvider": {
  10360. "idx": 655,
  10361. "alias": [],
  10362. "alternates": []
  10363. },
  10364. "Ext.state.LocalStorageProvider": {
  10365. "idx": 656,
  10366. "alias": [
  10367. "state.localstorage"
  10368. ],
  10369. "alternates": []
  10370. },
  10371. "Ext.state.Manager": {
  10372. "idx": 112,
  10373. "alias": [],
  10374. "alternates": []
  10375. },
  10376. "Ext.state.Provider": {
  10377. "idx": 111,
  10378. "alias": [],
  10379. "alternates": []
  10380. },
  10381. "Ext.state.Stateful": {
  10382. "idx": 113,
  10383. "alias": [],
  10384. "alternates": []
  10385. },
  10386. "Ext.tab.Bar": {
  10387. "idx": 658,
  10388. "alias": [
  10389. "widget.tabbar"
  10390. ],
  10391. "alternates": []
  10392. },
  10393. "Ext.tab.Panel": {
  10394. "idx": 659,
  10395. "alias": [
  10396. "widget.tabpanel"
  10397. ],
  10398. "alternates": [
  10399. "Ext.TabPanel"
  10400. ]
  10401. },
  10402. "Ext.tab.Tab": {
  10403. "idx": 657,
  10404. "alias": [
  10405. "widget.tab"
  10406. ],
  10407. "alternates": []
  10408. },
  10409. "Ext.tip.QuickTip": {
  10410. "idx": 533,
  10411. "alias": [
  10412. "widget.quicktip"
  10413. ],
  10414. "alternates": [
  10415. "Ext.QuickTip"
  10416. ]
  10417. },
  10418. "Ext.tip.QuickTipManager": {
  10419. "idx": 534,
  10420. "alias": [],
  10421. "alternates": [
  10422. "Ext.QuickTips"
  10423. ]
  10424. },
  10425. "Ext.tip.Tip": {
  10426. "idx": 531,
  10427. "alias": [
  10428. "widget.tip"
  10429. ],
  10430. "alternates": [
  10431. "Ext.Tip"
  10432. ]
  10433. },
  10434. "Ext.tip.ToolTip": {
  10435. "idx": 532,
  10436. "alias": [
  10437. "widget.tooltip"
  10438. ],
  10439. "alternates": [
  10440. "Ext.ToolTip"
  10441. ]
  10442. },
  10443. "Ext.toolbar.Breadcrumb": {
  10444. "idx": 660,
  10445. "alias": [
  10446. "widget.breadcrumb"
  10447. ],
  10448. "alternates": []
  10449. },
  10450. "Ext.toolbar.Fill": {
  10451. "idx": 661,
  10452. "alias": [
  10453. "widget.tbfill"
  10454. ],
  10455. "alternates": [
  10456. "Ext.Toolbar.Fill"
  10457. ]
  10458. },
  10459. "Ext.toolbar.Item": {
  10460. "idx": 515,
  10461. "alias": [
  10462. "widget.tbitem"
  10463. ],
  10464. "alternates": [
  10465. "Ext.Toolbar.Item"
  10466. ]
  10467. },
  10468. "Ext.toolbar.Paging": {
  10469. "idx": 520,
  10470. "alias": [
  10471. "widget.pagingtoolbar"
  10472. ],
  10473. "alternates": [
  10474. "Ext.PagingToolbar"
  10475. ]
  10476. },
  10477. "Ext.toolbar.Separator": {
  10478. "idx": 537,
  10479. "alias": [
  10480. "widget.tbseparator"
  10481. ],
  10482. "alternates": [
  10483. "Ext.Toolbar.Separator"
  10484. ]
  10485. },
  10486. "Ext.toolbar.Spacer": {
  10487. "idx": 662,
  10488. "alias": [
  10489. "widget.tbspacer"
  10490. ],
  10491. "alternates": [
  10492. "Ext.Toolbar.Spacer"
  10493. ]
  10494. },
  10495. "Ext.toolbar.TextItem": {
  10496. "idx": 516,
  10497. "alias": [
  10498. "widget.tbtext"
  10499. ],
  10500. "alternates": [
  10501. "Ext.Toolbar.TextItem"
  10502. ]
  10503. },
  10504. "Ext.toolbar.Toolbar": {
  10505. "idx": 435,
  10506. "alias": [
  10507. "widget.toolbar"
  10508. ],
  10509. "alternates": [
  10510. "Ext.Toolbar"
  10511. ]
  10512. },
  10513. "Ext.tree.Column": {
  10514. "idx": 663,
  10515. "alias": [
  10516. "widget.treecolumn"
  10517. ],
  10518. "alternates": []
  10519. },
  10520. "Ext.tree.NavigationModel": {
  10521. "idx": 664,
  10522. "alias": [
  10523. "view.navigation.tree"
  10524. ],
  10525. "alternates": []
  10526. },
  10527. "Ext.tree.Panel": {
  10528. "idx": 666,
  10529. "alias": [
  10530. "widget.treepanel"
  10531. ],
  10532. "alternates": [
  10533. "Ext.tree.TreePanel",
  10534. "Ext.TreePanel"
  10535. ]
  10536. },
  10537. "Ext.tree.View": {
  10538. "idx": 665,
  10539. "alias": [
  10540. "widget.treeview"
  10541. ],
  10542. "alternates": []
  10543. },
  10544. "Ext.tree.ViewDragZone": {
  10545. "idx": 668,
  10546. "alias": [],
  10547. "alternates": []
  10548. },
  10549. "Ext.tree.ViewDropZone": {
  10550. "idx": 669,
  10551. "alias": [],
  10552. "alternates": []
  10553. },
  10554. "Ext.tree.plugin.TreeViewDragDrop": {
  10555. "idx": 670,
  10556. "alias": [
  10557. "plugin.treeviewdragdrop"
  10558. ],
  10559. "alternates": []
  10560. },
  10561. "Ext.util.AbstractMixedCollection": {
  10562. "idx": 52,
  10563. "alias": [],
  10564. "alternates": []
  10565. },
  10566. "Ext.util.Animate": {
  10567. "idx": 73,
  10568. "alias": [],
  10569. "alternates": []
  10570. },
  10571. "Ext.util.Bag": {
  10572. "idx": 185,
  10573. "alias": [],
  10574. "alternates": []
  10575. },
  10576. "Ext.util.Base64": {
  10577. "idx": 380,
  10578. "alias": [],
  10579. "alternates": []
  10580. },
  10581. "Ext.util.CSS": {
  10582. "idx": 101,
  10583. "alias": [],
  10584. "alternates": []
  10585. },
  10586. "Ext.util.CSV": {
  10587. "idx": 382,
  10588. "alias": [],
  10589. "alternates": []
  10590. },
  10591. "Ext.util.ClickRepeater": {
  10592. "idx": 383,
  10593. "alias": [],
  10594. "alternates": [
  10595. "Ext.util.TapRepeater"
  10596. ]
  10597. },
  10598. "Ext.util.Collection": {
  10599. "idx": 128,
  10600. "alias": [],
  10601. "alternates": []
  10602. },
  10603. "Ext.util.CollectionKey": {
  10604. "idx": 126,
  10605. "alias": [],
  10606. "alternates": []
  10607. },
  10608. "Ext.util.Color": {
  10609. "idx": 369,
  10610. "alias": [],
  10611. "alternates": [
  10612. "Ext.draw.Color"
  10613. ]
  10614. },
  10615. "Ext.util.ComponentDragger": {
  10616. "idx": 479,
  10617. "alias": [],
  10618. "alternates": []
  10619. },
  10620. "Ext.util.Cookies": {
  10621. "idx": 384,
  10622. "alias": [],
  10623. "alternates": []
  10624. },
  10625. "Ext.util.DelimitedValue": {
  10626. "idx": 381,
  10627. "alias": [],
  10628. "alternates": []
  10629. },
  10630. "Ext.util.ElementContainer": {
  10631. "idx": 109,
  10632. "alias": [],
  10633. "alternates": []
  10634. },
  10635. "Ext.util.Event": {
  10636. "idx": 2,
  10637. "alias": [],
  10638. "alternates": []
  10639. },
  10640. "Ext.util.Filter": {
  10641. "idx": 50,
  10642. "alias": [],
  10643. "alternates": []
  10644. },
  10645. "Ext.util.FilterCollection": {
  10646. "idx": 173,
  10647. "alias": [],
  10648. "alternates": []
  10649. },
  10650. "Ext.util.Floating": {
  10651. "idx": 108,
  10652. "alias": [],
  10653. "alternates": []
  10654. },
  10655. "Ext.util.Fly": {
  10656. "idx": 205,
  10657. "alias": [],
  10658. "alternates": []
  10659. },
  10660. "Ext.util.Format": {
  10661. "idx": 91,
  10662. "alias": [],
  10663. "alternates": []
  10664. },
  10665. "Ext.util.Group": {
  10666. "idx": 165,
  10667. "alias": [],
  10668. "alternates": []
  10669. },
  10670. "Ext.util.GroupCollection": {
  10671. "idx": 174,
  10672. "alias": [],
  10673. "alternates": []
  10674. },
  10675. "Ext.util.Grouper": {
  10676. "idx": 127,
  10677. "alias": [],
  10678. "alternates": []
  10679. },
  10680. "Ext.util.HashMap": {
  10681. "idx": 5,
  10682. "alias": [],
  10683. "alternates": []
  10684. },
  10685. "Ext.util.History": {
  10686. "idx": 121,
  10687. "alias": [],
  10688. "alternates": [
  10689. "Ext.History"
  10690. ]
  10691. },
  10692. "Ext.util.Inflector": {
  10693. "idx": 136,
  10694. "alias": [],
  10695. "alternates": []
  10696. },
  10697. "Ext.util.ItemCollection": {
  10698. "idx": 385,
  10699. "alias": [],
  10700. "alternates": [
  10701. "Ext.ItemCollection"
  10702. ]
  10703. },
  10704. "Ext.util.KeyMap": {
  10705. "idx": 351,
  10706. "alias": [],
  10707. "alternates": [
  10708. "Ext.KeyMap"
  10709. ]
  10710. },
  10711. "Ext.util.KeyNav": {
  10712. "idx": 352,
  10713. "alias": [],
  10714. "alternates": [
  10715. "Ext.KeyNav"
  10716. ]
  10717. },
  10718. "Ext.util.LocalStorage": {
  10719. "idx": 386,
  10720. "alias": [],
  10721. "alternates": []
  10722. },
  10723. "Ext.util.LruCache": {
  10724. "idx": 23,
  10725. "alias": [],
  10726. "alternates": []
  10727. },
  10728. "Ext.util.Memento": {
  10729. "idx": 444,
  10730. "alias": [],
  10731. "alternates": []
  10732. },
  10733. "Ext.util.MixedCollection": {
  10734. "idx": 55,
  10735. "alias": [],
  10736. "alternates": []
  10737. },
  10738. "Ext.util.ObjectTemplate": {
  10739. "idx": 130,
  10740. "alias": [],
  10741. "alternates": []
  10742. },
  10743. "Ext.util.Observable": {
  10744. "idx": 51,
  10745. "alias": [],
  10746. "alternates": []
  10747. },
  10748. "Ext.util.Offset": {
  10749. "idx": 33,
  10750. "alias": [],
  10751. "alternates": []
  10752. },
  10753. "Ext.util.PaintMonitor": {
  10754. "idx": 47,
  10755. "alias": [],
  10756. "alternates": []
  10757. },
  10758. "Ext.util.Point": {
  10759. "idx": 35,
  10760. "alias": [],
  10761. "alternates": []
  10762. },
  10763. "Ext.util.Positionable": {
  10764. "idx": 26,
  10765. "alias": [],
  10766. "alternates": []
  10767. },
  10768. "Ext.util.ProtoElement": {
  10769. "idx": 98,
  10770. "alias": [],
  10771. "alternates": []
  10772. },
  10773. "Ext.util.Queue": {
  10774. "idx": 624,
  10775. "alias": [],
  10776. "alternates": []
  10777. },
  10778. "Ext.util.Region": {
  10779. "idx": 34,
  10780. "alias": [],
  10781. "alternates": []
  10782. },
  10783. "Ext.util.Renderable": {
  10784. "idx": 110,
  10785. "alias": [],
  10786. "alternates": []
  10787. },
  10788. "Ext.util.Schedulable": {
  10789. "idx": 196,
  10790. "alias": [],
  10791. "alternates": []
  10792. },
  10793. "Ext.util.Scheduler": {
  10794. "idx": 186,
  10795. "alias": [],
  10796. "alternates": []
  10797. },
  10798. "Ext.util.SizeMonitor": {
  10799. "idx": 43,
  10800. "alias": [],
  10801. "alternates": []
  10802. },
  10803. "Ext.util.Sortable": {
  10804. "idx": 54,
  10805. "alias": [],
  10806. "alternates": []
  10807. },
  10808. "Ext.util.Sorter": {
  10809. "idx": 53,
  10810. "alias": [],
  10811. "alternates": []
  10812. },
  10813. "Ext.util.SorterCollection": {
  10814. "idx": 172,
  10815. "alias": [],
  10816. "alternates": []
  10817. },
  10818. "Ext.util.Spans": {
  10819. "idx": 387,
  10820. "alias": [],
  10821. "alternates": []
  10822. },
  10823. "Ext.util.StoreHolder": {
  10824. "idx": 410,
  10825. "alias": [],
  10826. "alternates": []
  10827. },
  10828. "Ext.util.TaskManager": {
  10829. "idx": 389,
  10830. "alias": [],
  10831. "alternates": [
  10832. "Ext.TaskManager"
  10833. ]
  10834. },
  10835. "Ext.util.TaskRunner": {
  10836. "idx": 56,
  10837. "alias": [],
  10838. "alternates": []
  10839. },
  10840. "Ext.util.TextMetrics": {
  10841. "idx": 390,
  10842. "alias": [],
  10843. "alternates": []
  10844. },
  10845. "Ext.util.TsvDecoder": {
  10846. "idx": 388,
  10847. "alias": [],
  10848. "alternates": [
  10849. "Ext.util.TSV"
  10850. ]
  10851. },
  10852. "Ext.util.XTemplateCompiler": {
  10853. "idx": 94,
  10854. "alias": [],
  10855. "alternates": []
  10856. },
  10857. "Ext.util.XTemplateParser": {
  10858. "idx": 93,
  10859. "alias": [],
  10860. "alternates": []
  10861. },
  10862. "Ext.util.paintmonitor.Abstract": {
  10863. "idx": 45,
  10864. "alias": [],
  10865. "alternates": []
  10866. },
  10867. "Ext.util.paintmonitor.CssAnimation": {
  10868. "idx": 46,
  10869. "alias": [],
  10870. "alternates": []
  10871. },
  10872. "Ext.util.paintmonitor.OverflowChange": {
  10873. "idx": 391,
  10874. "alias": [],
  10875. "alternates": []
  10876. },
  10877. "Ext.util.sizemonitor.Abstract": {
  10878. "idx": 41,
  10879. "alias": [],
  10880. "alternates": []
  10881. },
  10882. "Ext.util.sizemonitor.OverflowChange": {
  10883. "idx": 392,
  10884. "alias": [],
  10885. "alternates": []
  10886. },
  10887. "Ext.util.sizemonitor.Scroll": {
  10888. "idx": 42,
  10889. "alias": [],
  10890. "alternates": []
  10891. },
  10892. "Ext.util.translatable.Abstract": {
  10893. "idx": 104,
  10894. "alias": [],
  10895. "alternates": []
  10896. },
  10897. "Ext.util.translatable.CssPosition": {
  10898. "idx": 393,
  10899. "alias": [
  10900. "translatable.cssposition"
  10901. ],
  10902. "alternates": []
  10903. },
  10904. "Ext.util.translatable.CssTransform": {
  10905. "idx": 394,
  10906. "alias": [
  10907. "translatable.csstransform"
  10908. ],
  10909. "alternates": []
  10910. },
  10911. "Ext.util.translatable.Dom": {
  10912. "idx": 105,
  10913. "alias": [
  10914. "translatable.dom"
  10915. ],
  10916. "alternates": []
  10917. },
  10918. "Ext.util.translatable.ScrollParent": {
  10919. "idx": 395,
  10920. "alias": [
  10921. "translatable.scrollparent"
  10922. ],
  10923. "alternates": []
  10924. },
  10925. "Ext.util.translatable.ScrollPosition": {
  10926. "idx": 106,
  10927. "alias": [
  10928. "translatable.scrollposition"
  10929. ],
  10930. "alternates": []
  10931. },
  10932. "Ext.view.AbstractView": {
  10933. "idx": 511,
  10934. "alias": [],
  10935. "alternates": []
  10936. },
  10937. "Ext.view.BoundList": {
  10938. "idx": 521,
  10939. "alias": [
  10940. "widget.boundlist"
  10941. ],
  10942. "alternates": [
  10943. "Ext.BoundList"
  10944. ]
  10945. },
  10946. "Ext.view.BoundListKeyNav": {
  10947. "idx": 513,
  10948. "alias": [
  10949. "view.navigation.boundlist"
  10950. ],
  10951. "alternates": []
  10952. },
  10953. "Ext.view.DragZone": {
  10954. "idx": 667,
  10955. "alias": [],
  10956. "alternates": []
  10957. },
  10958. "Ext.view.DropZone": {
  10959. "idx": 563,
  10960. "alias": [],
  10961. "alternates": []
  10962. },
  10963. "Ext.view.MultiSelector": {
  10964. "idx": 672,
  10965. "alias": [
  10966. "widget.multiselector"
  10967. ],
  10968. "alternates": []
  10969. },
  10970. "Ext.view.MultiSelectorSearch": {
  10971. "idx": 671,
  10972. "alias": [
  10973. "widget.multiselector-search"
  10974. ],
  10975. "alternates": []
  10976. },
  10977. "Ext.view.NavigationModel": {
  10978. "idx": 510,
  10979. "alias": [
  10980. "view.navigation.default"
  10981. ],
  10982. "alternates": []
  10983. },
  10984. "Ext.view.NodeCache": {
  10985. "idx": 555,
  10986. "alias": [],
  10987. "alternates": []
  10988. },
  10989. "Ext.view.Table": {
  10990. "idx": 557,
  10991. "alias": [
  10992. "widget.gridview",
  10993. "widget.tableview"
  10994. ],
  10995. "alternates": [
  10996. "Ext.grid.View"
  10997. ]
  10998. },
  10999. "Ext.view.TableLayout": {
  11000. "idx": 553,
  11001. "alias": [
  11002. "layout.tableview"
  11003. ],
  11004. "alternates": []
  11005. },
  11006. "Ext.view.TagKeyNav": {
  11007. "idx": 540,
  11008. "alias": [
  11009. "view.navigation.tagfield"
  11010. ],
  11011. "alternates": []
  11012. },
  11013. "Ext.view.View": {
  11014. "idx": 512,
  11015. "alias": [
  11016. "widget.dataview"
  11017. ],
  11018. "alternates": [
  11019. "Ext.DataView"
  11020. ]
  11021. },
  11022. "Ext.window.MessageBox": {
  11023. "idx": 489,
  11024. "alias": [
  11025. "widget.messagebox"
  11026. ],
  11027. "alternates": []
  11028. },
  11029. "Ext.window.Toast": {
  11030. "idx": 673,
  11031. "alias": [
  11032. "widget.toast"
  11033. ],
  11034. "alternates": []
  11035. },
  11036. "Ext.window.Window": {
  11037. "idx": 480,
  11038. "alias": [
  11039. "widget.window"
  11040. ],
  11041. "alternates": [
  11042. "Ext.Window"
  11043. ]
  11044. }
  11045. },
  11046. "packages": {
  11047. "classic": {
  11048. "css": true,
  11049. "included": true,
  11050. "language": {
  11051. "js": {
  11052. "input": {
  11053. "version": "ES5"
  11054. }
  11055. }
  11056. },
  11057. "namespace": "Ext",
  11058. "properties": {
  11059. "skip.sass": 1,
  11060. "skip.pkg": 1,
  11061. "skip.slice": 1
  11062. },
  11063. "required": true,
  11064. "requires": [
  11065. "ext",
  11066. "core",
  11067. "classic"
  11068. ],
  11069. "version": "6.6.0.258"
  11070. },
  11071. "cmd": {
  11072. "version": "6.6.0.13"
  11073. },
  11074. "core": {
  11075. "css": true,
  11076. "included": true,
  11077. "properties": {
  11078. "skip.slice": 1,
  11079. "skip.style": 1,
  11080. "skip.pkg": 1,
  11081. "package.tags.classdefs": "class"
  11082. },
  11083. "required": true,
  11084. "requires": [
  11085. "ext"
  11086. ],
  11087. "version": "6.6.0.258"
  11088. },
  11089. "ext": {
  11090. "css": true,
  11091. "included": true,
  11092. "language": {
  11093. "js": {
  11094. "input": {
  11095. "version": "ES5"
  11096. }
  11097. }
  11098. },
  11099. "license": "trial",
  11100. "namespace": "Ext",
  11101. "properties": {
  11102. "skip.sass": 1,
  11103. "skip.slice": 1
  11104. },
  11105. "required": true,
  11106. "requires": [],
  11107. "version": "6.6.0.258"
  11108. }
  11109. },
  11110. "bootRelative": true
  11111. });
  11112. // @tag core
  11113. // @define Ext.Boot
  11114. var Ext = Ext || {};
  11115. //<editor-fold desc="Boot">
  11116. /**
  11117. * @class Ext.Boot
  11118. * @singleton
  11119. * @private
  11120. */
  11121. Ext.Boot = Ext.Boot || (function(emptyFn) {
  11122. var doc = document,
  11123. _emptyArray = [],
  11124. _config = {
  11125. /**
  11126. * @cfg {Boolean} [disableCaching=true]
  11127. * If `true` current timestamp is added to script URL's to prevent caching.
  11128. * In debug builds, adding a "cache" or "disableCacheBuster" query parameter
  11129. * to the page's URL will set this to `false`.
  11130. */
  11131. disableCaching: (/[?&](?:cache|disableCacheBuster)\b/i.test(location.search) || !(/http[s]?\:/i.test(location.href)) || /(^|[ ;])ext-cache=1/.test(doc.cookie)) ? false : true,
  11132. /**
  11133. * @cfg {String} [disableCachingParam="_dc"]
  11134. * The query parameter name for the cache buster's timestamp.
  11135. */
  11136. disableCachingParam: '_dc',
  11137. /**
  11138. * @cfg {Boolean} loadDelay
  11139. * Millisecond delay between asynchronous script injection (prevents stack
  11140. * overflow on some user agents) 'false' disables delay but potentially
  11141. * increases stack load.
  11142. */
  11143. loadDelay: false,
  11144. /**
  11145. * @cfg {Boolean} preserveScripts
  11146. * `false` to remove asynchronously loaded scripts, `true` to retain script
  11147. * element for browser debugger compatibility and improved load performance.
  11148. */
  11149. preserveScripts: true,
  11150. /**
  11151. * @cfg {String} [charset=UTF-8]
  11152. * Optional charset to specify encoding of dynamic content.
  11153. */
  11154. charset: 'UTF-8'
  11155. },
  11156. _assetConfig = {},
  11157. cssRe = /\.css(?:\?|$)/i,
  11158. resolverEl = doc.createElement('a'),
  11159. isBrowser = typeof window !== 'undefined',
  11160. _environment = {
  11161. browser: isBrowser,
  11162. node: !isBrowser && (typeof require === 'function'),
  11163. phantom: (window && (window._phantom || window.callPhantom)) || /PhantomJS/.test(window.navigator.userAgent)
  11164. },
  11165. _tags = (Ext.platformTags = {}),
  11166. // All calls to _debug are commented out to speed up old browsers a bit;
  11167. // yes that makes a difference because the cost of concatenating strings
  11168. // and passing them into _debug() adds up pretty quickly.
  11169. _debug = function(message) {},
  11170. //console.log(message);
  11171. _apply = function(object, config, defaults) {
  11172. if (defaults) {
  11173. _apply(object, defaults);
  11174. }
  11175. if (object && config && typeof config === 'object') {
  11176. for (var i in config) {
  11177. object[i] = config[i];
  11178. }
  11179. }
  11180. return object;
  11181. },
  11182. _merge = function() {
  11183. var lowerCase = false,
  11184. obj = Array.prototype.shift.call(arguments),
  11185. index, i, len, value;
  11186. if (typeof arguments[arguments.length - 1] === 'boolean') {
  11187. lowerCase = Array.prototype.pop.call(arguments);
  11188. }
  11189. len = arguments.length;
  11190. for (index = 0; index < len; index++) {
  11191. value = arguments[index];
  11192. if (typeof value === 'object') {
  11193. for (i in value) {
  11194. obj[lowerCase ? i.toLowerCase() : i] = value[i];
  11195. }
  11196. }
  11197. }
  11198. return obj;
  11199. },
  11200. _getKeys = (typeof Object.keys == 'function') ? function(object) {
  11201. if (!object) {
  11202. return [];
  11203. }
  11204. return Object.keys(object);
  11205. } : function(object) {
  11206. var keys = [],
  11207. property;
  11208. for (property in object) {
  11209. if (object.hasOwnProperty(property)) {
  11210. keys.push(property);
  11211. }
  11212. }
  11213. return keys;
  11214. },
  11215. /*
  11216. * The Boot loader class manages Request objects that contain one or
  11217. * more individual urls that need to be loaded. Requests can be performed
  11218. * synchronously or asynchronously, but will always evaluate urls in the
  11219. * order specified on the request object.
  11220. */
  11221. Boot = {
  11222. loading: 0,
  11223. loaded: 0,
  11224. apply: _apply,
  11225. env: _environment,
  11226. config: _config,
  11227. /**
  11228. * @cfg {Object} assetConfig
  11229. * A map (url->assetConfig) that contains information about assets loaded by the Microlaoder.
  11230. */
  11231. assetConfig: _assetConfig,
  11232. // Keyed by absolute URL this object holds "true" if that URL is already loaded
  11233. // or an array of callbacks to call once it loads.
  11234. scripts: {},
  11235. /*
  11236. Entry objects
  11237. 'http://foo.com/bar/baz/Thing.js': {
  11238. done: true,
  11239. el: scriptEl || linkEl,
  11240. preserve: true,
  11241. requests: [ request1, ... ]
  11242. }
  11243. */
  11244. /**
  11245. * contains the current script name being loaded
  11246. * (loadSync or sequential load only)
  11247. */
  11248. currentFile: null,
  11249. suspendedQueue: [],
  11250. currentRequest: null,
  11251. // when loadSync is called, need to cause subsequent load requests to also be loadSync,
  11252. // eg, when Ext.require(...) is called
  11253. syncMode: false,
  11254. /*
  11255. * simple helper method for debugging
  11256. */
  11257. debug: _debug,
  11258. /**
  11259. * enables / disables loading scripts via script / link elements rather
  11260. * than using ajax / eval
  11261. */
  11262. useElements: true,
  11263. listeners: [],
  11264. Request: Request,
  11265. Entry: Entry,
  11266. allowMultipleBrowsers: false,
  11267. browserNames: {
  11268. ie: 'IE',
  11269. firefox: 'Firefox',
  11270. safari: 'Safari',
  11271. chrome: 'Chrome',
  11272. opera: 'Opera',
  11273. dolfin: 'Dolfin',
  11274. edge: 'Edge',
  11275. webosbrowser: 'webOSBrowser',
  11276. chromeMobile: 'ChromeMobile',
  11277. chromeiOS: 'ChromeiOS',
  11278. silk: 'Silk',
  11279. other: 'Other'
  11280. },
  11281. osNames: {
  11282. ios: 'iOS',
  11283. android: 'Android',
  11284. windowsPhone: 'WindowsPhone',
  11285. webos: 'webOS',
  11286. blackberry: 'BlackBerry',
  11287. rimTablet: 'RIMTablet',
  11288. mac: 'MacOS',
  11289. win: 'Windows',
  11290. tizen: 'Tizen',
  11291. linux: 'Linux',
  11292. bada: 'Bada',
  11293. chromeOS: 'ChromeOS',
  11294. other: 'Other'
  11295. },
  11296. browserPrefixes: {
  11297. ie: 'MSIE ',
  11298. edge: 'Edge/',
  11299. firefox: 'Firefox/',
  11300. chrome: 'Chrome/',
  11301. safari: 'Version/',
  11302. opera: 'OPR/',
  11303. dolfin: 'Dolfin/',
  11304. webosbrowser: 'wOSBrowser/',
  11305. chromeMobile: 'CrMo/',
  11306. chromeiOS: 'CriOS/',
  11307. silk: 'Silk/'
  11308. },
  11309. // When a UA reports multiple browsers this list is used to prioritize the 'real' browser
  11310. // lower index number will win
  11311. browserPriority: [
  11312. 'edge',
  11313. 'opera',
  11314. 'dolfin',
  11315. 'webosbrowser',
  11316. 'silk',
  11317. 'chromeiOS',
  11318. 'chromeMobile',
  11319. 'ie',
  11320. 'firefox',
  11321. 'safari',
  11322. 'chrome'
  11323. ],
  11324. osPrefixes: {
  11325. tizen: '(Tizen )',
  11326. ios: 'i(?:Pad|Phone|Pod)(?:.*)CPU(?: iPhone)? OS ',
  11327. android: '(Android |HTC_|Silk/)',
  11328. // Some HTC devices ship with an OSX userAgent by default,
  11329. // so we need to add a direct check for HTC_
  11330. windowsPhone: 'Windows Phone ',
  11331. blackberry: '(?:BlackBerry|BB)(?:.*)Version/',
  11332. rimTablet: 'RIM Tablet OS ',
  11333. webos: '(?:webOS|hpwOS)/',
  11334. bada: 'Bada/',
  11335. chromeOS: 'CrOS '
  11336. },
  11337. fallbackOSPrefixes: {
  11338. windows: 'win',
  11339. mac: 'mac',
  11340. linux: 'linux'
  11341. },
  11342. devicePrefixes: {
  11343. iPhone: 'iPhone',
  11344. iPod: 'iPod',
  11345. iPad: 'iPad'
  11346. },
  11347. maxIEVersion: 12,
  11348. /**
  11349. * The default function that detects various platforms and sets tags
  11350. * in the platform map accordingly. Examples are iOS, android, tablet, etc.
  11351. * @param tags the set of tags to populate
  11352. */
  11353. detectPlatformTags: function() {
  11354. var me = this,
  11355. ua = navigator.userAgent,
  11356. isMobile = /Mobile(\/|\s)/.test(ua),
  11357. element = document.createElement('div'),
  11358. isEventSupported = function(name, tag) {
  11359. if (tag === undefined) {
  11360. tag = window;
  11361. }
  11362. var eventName = 'on' + name.toLowerCase(),
  11363. isSupported = (eventName in element);
  11364. if (!isSupported) {
  11365. if (element.setAttribute && element.removeAttribute) {
  11366. element.setAttribute(eventName, '');
  11367. isSupported = typeof element[eventName] === 'function';
  11368. if (typeof element[eventName] !== 'undefined') {
  11369. element[eventName] = undefined;
  11370. }
  11371. element.removeAttribute(eventName);
  11372. }
  11373. }
  11374. return isSupported;
  11375. },
  11376. // Browser Detection
  11377. getBrowsers = function() {
  11378. var browsers = {},
  11379. maxIEVersion, prefix, value, key, index, len, match, version, matched;
  11380. // MS Edge browser (and possibly others) can report multiple browsers in the UserAgent
  11381. // "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
  11382. // we use this to prioritize the actual browser in this situation
  11383. len = me.browserPriority.length;
  11384. for (index = 0; index < len; index++) {
  11385. key = me.browserPriority[index];
  11386. if (!matched) {
  11387. value = me.browserPrefixes[key];
  11388. match = ua.match(new RegExp('(' + value + ')([\\w\\._]+)'));
  11389. version = match && match.length > 1 ? parseInt(match[2]) : 0;
  11390. if (version) {
  11391. matched = true;
  11392. }
  11393. } else {
  11394. version = 0;
  11395. }
  11396. browsers[key] = version;
  11397. }
  11398. //Deal with IE document mode
  11399. if (browsers.ie) {
  11400. var mode = document.documentMode;
  11401. if (mode >= 8) {
  11402. browsers.ie = mode;
  11403. }
  11404. }
  11405. // Fancy IE greater than and less then quick tags
  11406. version = browsers.ie || false;
  11407. maxIEVersion = Math.max(version, me.maxIEVersion);
  11408. for (index = 8; index <= maxIEVersion; ++index) {
  11409. prefix = 'ie' + index;
  11410. browsers[prefix + 'm'] = version ? version <= index : 0;
  11411. browsers[prefix] = version ? version === index : 0;
  11412. browsers[prefix + 'p'] = version ? version >= index : 0;
  11413. }
  11414. return browsers;
  11415. },
  11416. //OS Detection
  11417. getOperatingSystems = function() {
  11418. var systems = {},
  11419. value, key, keys, index, len, match, matched, version, activeCount;
  11420. keys = _getKeys(me.osPrefixes);
  11421. len = keys.length;
  11422. for (index = 0 , activeCount = 0; index < len; index++) {
  11423. key = keys[index];
  11424. value = me.osPrefixes[key];
  11425. match = ua.match(new RegExp('(' + value + ')([^\\s;]+)'));
  11426. matched = match ? match[1] : null;
  11427. // This is here because some HTC android devices show an OSX Snow Leopard userAgent by default.
  11428. // And the Kindle Fire doesn't have any indicator of Android as the OS in its User Agent
  11429. if (matched && (matched === 'HTC_' || matched === 'Silk/')) {
  11430. version = 2.3;
  11431. } else {
  11432. version = match && match.length > 1 ? parseFloat(match[match.length - 1]) : 0;
  11433. }
  11434. if (version) {
  11435. activeCount++;
  11436. }
  11437. systems[key] = version;
  11438. }
  11439. keys = _getKeys(me.fallbackOSPrefixes);
  11440. // If no OS could be found we resort to the fallbacks, otherwise we just
  11441. // falsify the fallbacks
  11442. len = keys.length;
  11443. for (index = 0; index < len; index++) {
  11444. key = keys[index];
  11445. // No OS was detected from osPrefixes
  11446. if (activeCount === 0) {
  11447. value = me.fallbackOSPrefixes[key];
  11448. match = ua.toLowerCase().match(new RegExp(value));
  11449. systems[key] = match ? true : 0;
  11450. } else {
  11451. systems[key] = 0;
  11452. }
  11453. }
  11454. return systems;
  11455. },
  11456. // Device Detection
  11457. getDevices = function() {
  11458. var devices = {},
  11459. value, key, keys, index, len, match;
  11460. keys = _getKeys(me.devicePrefixes);
  11461. len = keys.length;
  11462. for (index = 0; index < len; index++) {
  11463. key = keys[index];
  11464. value = me.devicePrefixes[key];
  11465. match = ua.match(new RegExp(value));
  11466. devices[key] = match ? true : 0;
  11467. }
  11468. return devices;
  11469. },
  11470. browsers = getBrowsers(),
  11471. systems = getOperatingSystems(),
  11472. devices = getDevices(),
  11473. platformParams = Boot.loadPlatformsParam();
  11474. // We apply platformParams from the query here first to allow for forced user valued
  11475. // to be used in calculation of generated tags
  11476. _merge(_tags, browsers, systems, devices, platformParams, true);
  11477. _tags.phone = !!((_tags.iphone || _tags.ipod) || (!_tags.silk && (_tags.android && (_tags.android < 3 || isMobile))) || (_tags.blackberry && isMobile) || (_tags.windowsphone));
  11478. _tags.tablet = !!(!_tags.phone && (_tags.ipad || _tags.android || _tags.silk || _tags.rimtablet || (_tags.ie10 && /; Touch/.test(ua))));
  11479. _tags.touch = // if the browser has touch events we can be reasonably sure the device has
  11480. // a touch screen
  11481. isEventSupported('touchend') || // browsers that use pointer event have maxTouchPoints > 0 if the
  11482. // device supports touch input
  11483. // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
  11484. navigator.maxTouchPoints || // IE10 uses a vendor-prefixed maxTouchPoints property
  11485. navigator.msMaxTouchPoints;
  11486. _tags.desktop = !_tags.phone && !_tags.tablet;
  11487. _tags.cordova = _tags.phonegap = !!(window.PhoneGap || window.Cordova || window.cordova);
  11488. _tags.webview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(ua);
  11489. _tags.androidstock = (_tags.android <= 4.3) && (_tags.safari || _tags.silk);
  11490. // Re-apply any query params here to allow for user override of generated tags (desktop, touch, tablet, etc)
  11491. _merge(_tags, platformParams, true);
  11492. },
  11493. /**
  11494. * Extracts user supplied platform tags from the "platformTags" query parameter
  11495. * of the form:
  11496. *
  11497. * ?platformTags=name:state,name:state,...
  11498. *
  11499. * (each tag defaults to true when state is unspecified)
  11500. *
  11501. * Example:
  11502. *
  11503. * ?platformTags=isTablet,isPhone:false,isDesktop:0,iOS:1,Safari:true, ...
  11504. *
  11505. * @returns {Object} the platform tags supplied by the query string
  11506. */
  11507. loadPlatformsParam: function() {
  11508. // Check if the ?platform parameter is set in the URL
  11509. var paramsString = window.location.search.substr(1),
  11510. paramsArray = paramsString.split("&"),
  11511. params = {},
  11512. i,
  11513. platforms = {},
  11514. tmpArray, tmplen, platform, name, enabled;
  11515. for (i = 0; i < paramsArray.length; i++) {
  11516. tmpArray = paramsArray[i].split("=");
  11517. params[tmpArray[0]] = tmpArray[1];
  11518. }
  11519. if (params.platformTags) {
  11520. tmpArray = params.platformTags.split(",");
  11521. for (tmplen = tmpArray.length , i = 0; i < tmplen; i++) {
  11522. platform = tmpArray[i].split(":");
  11523. name = platform[0];
  11524. enabled = true;
  11525. if (platform.length > 1) {
  11526. enabled = platform[1];
  11527. if (enabled === 'false' || enabled === '0') {
  11528. enabled = false;
  11529. }
  11530. }
  11531. platforms[name] = enabled;
  11532. }
  11533. }
  11534. return platforms;
  11535. },
  11536. filterPlatform: function(platform, excludes) {
  11537. platform = _emptyArray.concat(platform || _emptyArray);
  11538. excludes = _emptyArray.concat(excludes || _emptyArray);
  11539. var plen = platform.length,
  11540. elen = excludes.length,
  11541. include = (!plen && elen),
  11542. // default true if only excludes specified
  11543. i, tag;
  11544. for (i = 0; i < plen && !include; i++) {
  11545. tag = platform[i];
  11546. include = !!_tags[tag];
  11547. }
  11548. for (i = 0; i < elen && include; i++) {
  11549. tag = excludes[i];
  11550. include = !_tags[tag];
  11551. }
  11552. return include;
  11553. },
  11554. init: function() {
  11555. var scriptEls = doc.getElementsByTagName('script'),
  11556. script = scriptEls[0],
  11557. len = scriptEls.length,
  11558. re = /\/ext(\-[a-z\-]+)?\.js$/,
  11559. entry, src, state, baseUrl, key, n, origin;
  11560. // No check for script definedness because there always should be at least one
  11561. Boot.hasReadyState = ("readyState" in script);
  11562. Boot.hasAsync = ("async" in script);
  11563. Boot.hasDefer = ("defer" in script);
  11564. Boot.hasOnLoad = ("onload" in script);
  11565. // Feature detecting IE
  11566. Boot.isIE8 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && !Boot.hasOnLoad;
  11567. Boot.isIE9 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
  11568. Boot.isIE10p = Boot.hasReadyState && Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
  11569. if (Boot.isIE8) {
  11570. Boot.isIE10 = false;
  11571. Boot.isIE10m = true;
  11572. } else {
  11573. Boot.isIE10 = (new Function('/*@cc_on return @_jscript_version @*/')()) === 10;
  11574. Boot.isIE10m = Boot.isIE10 || Boot.isIE9 || Boot.isIE8;
  11575. }
  11576. // IE11 does not support conditional compilation so we detect it by exclusion
  11577. Boot.isIE11 = Boot.isIE10p && !Boot.isIE10;
  11578. // Since we are loading after other scripts, and we needed to gather them
  11579. // anyway, we track them in _scripts so we don't have to ask for them all
  11580. // repeatedly.
  11581. for (n = 0; n < len; n++) {
  11582. src = (script = scriptEls[n]).src;
  11583. if (!src) {
  11584. continue;
  11585. }
  11586. state = script.readyState || null;
  11587. // If we find a script file called "ext-*.js", then the base path is that file's base path.
  11588. if (!baseUrl && re.test(src)) {
  11589. baseUrl = src;
  11590. }
  11591. if (!Boot.scripts[key = Boot.canonicalUrl(src)]) {
  11592. // _debug("creating entry " + key + " in Boot.init");
  11593. entry = new Entry({
  11594. key: key,
  11595. url: src,
  11596. done: state === null || // non-IE
  11597. state === 'loaded' || state === 'complete',
  11598. // IE only
  11599. el: script,
  11600. prop: 'src'
  11601. });
  11602. }
  11603. }
  11604. if (!baseUrl) {
  11605. script = scriptEls[scriptEls.length - 1];
  11606. baseUrl = script.src;
  11607. }
  11608. Boot.baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1);
  11609. origin = window.location.origin || window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
  11610. Boot.origin = origin;
  11611. Boot.detectPlatformTags();
  11612. Ext.filterPlatform = Boot.filterPlatform;
  11613. },
  11614. /**
  11615. * This method returns a canonical URL for the given URL.
  11616. *
  11617. * For example, the following all produce the same canonical URL (which is the
  11618. * last one):
  11619. *
  11620. * http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js?_dc=12345
  11621. * http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js
  11622. * http://foo.com/bar/baz/zoo/derp/../jazz/../../goo/Thing.js
  11623. * http://foo.com/bar/baz/zoo/../goo/Thing.js
  11624. * http://foo.com/bar/baz/goo/Thing.js
  11625. *
  11626. * @private
  11627. */
  11628. canonicalUrl: function(url) {
  11629. // *WARNING WARNING WARNING*
  11630. // This method yields the most correct result we can get but it is EXPENSIVE!
  11631. // In ALL browsers! When called multiple times in a sequence, as if when
  11632. // we resolve dependencies for entries, it will cause garbage collection events
  11633. // and overall painful slowness. This is why we try to avoid it as much as we can.
  11634. //
  11635. // @TODO - see if we need this fallback logic
  11636. // http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue
  11637. resolverEl.href = url;
  11638. var ret = resolverEl.href,
  11639. dc = _config.disableCachingParam,
  11640. pos = dc ? ret.indexOf(dc + '=') : -1,
  11641. c, end;
  11642. // If we have a _dc query parameter we need to remove it from the canonical
  11643. // URL.
  11644. if (pos > 0 && ((c = ret.charAt(pos - 1)) === '?' || c === '&')) {
  11645. end = ret.indexOf('&', pos);
  11646. end = (end < 0) ? '' : ret.substring(end);
  11647. if (end && c === '?') {
  11648. ++pos;
  11649. // keep the '?'
  11650. end = end.substring(1);
  11651. }
  11652. // remove the '&'
  11653. ret = ret.substring(0, pos - 1) + end;
  11654. }
  11655. return ret;
  11656. },
  11657. /**
  11658. * Get the config value corresponding to the specified name. If no name is given, will return the config object
  11659. * @param {String} name The config property name
  11660. * @return {Object}
  11661. */
  11662. getConfig: function(name) {
  11663. return name ? Boot.config[name] : Boot.config;
  11664. },
  11665. /**
  11666. * Set the configuration.
  11667. * @param {Object} config The config object to override the default values.
  11668. * @return {Ext.Boot} this
  11669. */
  11670. setConfig: function(name, value) {
  11671. if (typeof name === 'string') {
  11672. Boot.config[name] = value;
  11673. } else {
  11674. for (var s in name) {
  11675. Boot.setConfig(s, name[s]);
  11676. }
  11677. }
  11678. return Boot;
  11679. },
  11680. getHead: function() {
  11681. return Boot.docHead || (Boot.docHead = doc.head || doc.getElementsByTagName('head')[0]);
  11682. },
  11683. create: function(url, key, cfg) {
  11684. var config = cfg || {};
  11685. config.url = url;
  11686. config.key = key;
  11687. return Boot.scripts[key] = new Entry(config);
  11688. },
  11689. getEntry: function(url, cfg, canonicalPath) {
  11690. var key, entry;
  11691. // Canonicalizing URLs via anchor element href yields the most correct result
  11692. // but is *extremely* resource heavy so we need to avoid it whenever possible
  11693. key = canonicalPath ? url : Boot.canonicalUrl(url);
  11694. entry = Boot.scripts[key];
  11695. if (!entry) {
  11696. entry = Boot.create(url, key, cfg);
  11697. if (canonicalPath) {
  11698. entry.canonicalPath = true;
  11699. }
  11700. }
  11701. return entry;
  11702. },
  11703. registerContent: function(url, type, content) {
  11704. var cfg = {
  11705. content: content,
  11706. loaded: true,
  11707. css: type === 'css'
  11708. };
  11709. return Boot.getEntry(url, cfg);
  11710. },
  11711. processRequest: function(request, sync) {
  11712. request.loadEntries(sync);
  11713. },
  11714. load: function(request) {
  11715. // _debug("Boot.load called");
  11716. var request = new Request(request);
  11717. if (request.sync || Boot.syncMode) {
  11718. return Boot.loadSync(request);
  11719. }
  11720. // If there is a request in progress, we must
  11721. // queue this new request to be fired when the current request completes.
  11722. if (Boot.currentRequest) {
  11723. // _debug("current active request, suspending this request");
  11724. // trigger assignment of entries now to ensure that overlapping
  11725. // entries with currently running requests will synchronize state
  11726. // with this pending one as they complete
  11727. request.getEntries();
  11728. Boot.suspendedQueue.push(request);
  11729. } else {
  11730. Boot.currentRequest = request;
  11731. Boot.processRequest(request, false);
  11732. }
  11733. return Boot;
  11734. },
  11735. loadSync: function(request) {
  11736. // _debug("Boot.loadSync called");
  11737. var request = new Request(request);
  11738. Boot.syncMode++;
  11739. Boot.processRequest(request, true);
  11740. Boot.syncMode--;
  11741. return Boot;
  11742. },
  11743. loadBasePrefix: function(request) {
  11744. request = new Request(request);
  11745. request.prependBaseUrl = true;
  11746. return Boot.load(request);
  11747. },
  11748. loadSyncBasePrefix: function(request) {
  11749. request = new Request(request);
  11750. request.prependBaseUrl = true;
  11751. return Boot.loadSync(request);
  11752. },
  11753. requestComplete: function(request) {
  11754. var next;
  11755. if (Boot.currentRequest === request) {
  11756. Boot.currentRequest = null;
  11757. while (Boot.suspendedQueue.length > 0) {
  11758. next = Boot.suspendedQueue.shift();
  11759. if (!next.done) {
  11760. // _debug("resuming suspended request");
  11761. Boot.load(next);
  11762. break;
  11763. }
  11764. }
  11765. }
  11766. if (!Boot.currentRequest && Boot.suspendedQueue.length == 0) {
  11767. Boot.fireListeners();
  11768. }
  11769. },
  11770. isLoading: function() {
  11771. return !Boot.currentRequest && Boot.suspendedQueue.length == 0;
  11772. },
  11773. fireListeners: function() {
  11774. var listener;
  11775. while (Boot.isLoading() && (listener = Boot.listeners.shift())) {
  11776. listener();
  11777. }
  11778. },
  11779. onBootReady: function(listener) {
  11780. if (!Boot.isLoading()) {
  11781. listener();
  11782. } else {
  11783. Boot.listeners.push(listener);
  11784. }
  11785. },
  11786. /**
  11787. * this is a helper function used by Ext.Loader to flush out
  11788. * 'uses' arrays for classes in some Ext versions
  11789. */
  11790. getPathsFromIndexes: function(indexMap, loadOrder) {
  11791. // In older versions indexMap was an object instead of a sparse array
  11792. if (!('length' in indexMap)) {
  11793. var indexArray = [],
  11794. index;
  11795. for (index in indexMap) {
  11796. if (!isNaN(+index)) {
  11797. indexArray[+index] = indexMap[index];
  11798. }
  11799. }
  11800. indexMap = indexArray;
  11801. }
  11802. return Request.prototype.getPathsFromIndexes(indexMap, loadOrder);
  11803. },
  11804. createLoadOrderMap: function(loadOrder) {
  11805. return Request.prototype.createLoadOrderMap(loadOrder);
  11806. },
  11807. fetch: function(url, complete, scope, async) {
  11808. async = (async === undefined) ? !!complete : async;
  11809. var xhr = new XMLHttpRequest(),
  11810. result, status, content,
  11811. exception = false,
  11812. readyStateChange = function() {
  11813. if (xhr && xhr.readyState == 4) {
  11814. status = (xhr.status === 1223) ? 204 : (xhr.status === 0 && ((self.location || {}).protocol === 'file:' || (self.location || {}).protocol === 'ionp:')) ? 200 : xhr.status;
  11815. content = xhr.responseText;
  11816. result = {
  11817. content: content,
  11818. status: status,
  11819. exception: exception
  11820. };
  11821. if (complete) {
  11822. complete.call(scope, result);
  11823. }
  11824. xhr.onreadystatechange = emptyFn;
  11825. xhr = null;
  11826. }
  11827. };
  11828. if (async) {
  11829. xhr.onreadystatechange = readyStateChange;
  11830. }
  11831. try {
  11832. // _debug("fetching " + url + " " + (async ? "async" : "sync"));
  11833. xhr.open('GET', url, async);
  11834. xhr.send(null);
  11835. } catch (err) {
  11836. exception = err;
  11837. readyStateChange();
  11838. return result;
  11839. }
  11840. if (!async) {
  11841. readyStateChange();
  11842. }
  11843. return result;
  11844. },
  11845. notifyAll: function(entry) {
  11846. entry.notifyRequests();
  11847. }
  11848. };
  11849. function Request(cfg) {
  11850. //The request class encapsulates a series of Entry objects
  11851. //and provides notification around the completion of all Entries
  11852. //in this request.
  11853. if (cfg.$isRequest) {
  11854. return cfg;
  11855. }
  11856. var cfg = cfg.url ? cfg : {
  11857. url: cfg
  11858. },
  11859. url = cfg.url,
  11860. urls = url.charAt ? [
  11861. url
  11862. ] : url,
  11863. charset = cfg.charset || Boot.config.charset;
  11864. _apply(this, cfg);
  11865. delete this.url;
  11866. this.urls = urls;
  11867. this.charset = charset;
  11868. }
  11869. Request.prototype = {
  11870. $isRequest: true,
  11871. createLoadOrderMap: function(loadOrder) {
  11872. var len = loadOrder.length,
  11873. loadOrderMap = {},
  11874. i, element;
  11875. for (i = 0; i < len; i++) {
  11876. element = loadOrder[i];
  11877. loadOrderMap[element.path] = element;
  11878. }
  11879. return loadOrderMap;
  11880. },
  11881. getLoadIndexes: function(item, indexMap, loadOrder, includeUses, skipLoaded) {
  11882. var resolved = [],
  11883. queue = [
  11884. item
  11885. ],
  11886. itemIndex = item.idx,
  11887. queue, entry, dependencies, depIndex, i, len;
  11888. if (indexMap[itemIndex]) {
  11889. // prevent cycles
  11890. return resolved;
  11891. }
  11892. // Both indexMap and resolved are sparse arrays keyed by indexes.
  11893. // This gives us a naturally sorted sequence of indexes later on
  11894. // when we need to convert them to paths.
  11895. // indexMap is the map of all indexes we have visited at least once
  11896. // per the current expandUrls() invocation, and resolved is the map
  11897. // of all dependencies for the current item that are not included
  11898. // in indexMap.
  11899. indexMap[itemIndex] = resolved[itemIndex] = true;
  11900. while (item = queue.shift()) {
  11901. // Canonicalizing URLs is expensive, we try to avoid it
  11902. if (item.canonicalPath) {
  11903. entry = Boot.getEntry(item.path, null, true);
  11904. } else {
  11905. entry = Boot.getEntry(this.prepareUrl(item.path));
  11906. }
  11907. if (!(skipLoaded && entry.done)) {
  11908. if (includeUses && item.uses && item.uses.length) {
  11909. dependencies = item.requires.concat(item.uses);
  11910. } else {
  11911. dependencies = item.requires;
  11912. }
  11913. for (i = 0 , len = dependencies.length; i < len; i++) {
  11914. depIndex = dependencies[i];
  11915. if (!indexMap[depIndex]) {
  11916. indexMap[depIndex] = resolved[depIndex] = true;
  11917. queue.push(loadOrder[depIndex]);
  11918. }
  11919. }
  11920. }
  11921. }
  11922. return resolved;
  11923. },
  11924. getPathsFromIndexes: function(indexes, loadOrder) {
  11925. var paths = [],
  11926. index, len;
  11927. // indexes is a sparse array with values being true for defined indexes
  11928. for (index = 0 , len = indexes.length; index < len; index++) {
  11929. if (indexes[index]) {
  11930. paths.push(loadOrder[index].path);
  11931. }
  11932. }
  11933. return paths;
  11934. },
  11935. expandUrl: function(url, loadOrder, loadOrderMap, indexMap, includeUses, skipLoaded) {
  11936. var item, resolved;
  11937. if (loadOrder) {
  11938. item = loadOrderMap[url];
  11939. if (item) {
  11940. resolved = this.getLoadIndexes(item, indexMap, loadOrder, includeUses, skipLoaded);
  11941. if (resolved.length) {
  11942. return this.getPathsFromIndexes(resolved, loadOrder);
  11943. }
  11944. }
  11945. }
  11946. return [
  11947. url
  11948. ];
  11949. },
  11950. expandUrls: function(urls, includeUses) {
  11951. var me = this,
  11952. loadOrder = me.loadOrder,
  11953. expanded = [],
  11954. expandMap = {},
  11955. indexMap = [],
  11956. loadOrderMap, tmpExpanded, i, len, t, tlen, tUrl;
  11957. if (typeof urls === "string") {
  11958. urls = [
  11959. urls
  11960. ];
  11961. }
  11962. if (loadOrder) {
  11963. loadOrderMap = me.loadOrderMap;
  11964. if (!loadOrderMap) {
  11965. loadOrderMap = me.loadOrderMap = me.createLoadOrderMap(loadOrder);
  11966. }
  11967. }
  11968. for (i = 0 , len = urls.length; i < len; i++) {
  11969. // We don't want to skip loaded entries (last argument === false).
  11970. // There are some overrides that get loaded before their respective classes,
  11971. // and when the class dependencies are processed we don't want to skip over
  11972. // the overrides' dependencies just because they were loaded first.
  11973. tmpExpanded = this.expandUrl(urls[i], loadOrder, loadOrderMap, indexMap, includeUses, false);
  11974. for (t = 0 , tlen = tmpExpanded.length; t < tlen; t++) {
  11975. tUrl = tmpExpanded[t];
  11976. if (!expandMap[tUrl]) {
  11977. expandMap[tUrl] = true;
  11978. expanded.push(tUrl);
  11979. }
  11980. }
  11981. }
  11982. if (expanded.length === 0) {
  11983. expanded = urls;
  11984. }
  11985. return expanded;
  11986. },
  11987. expandLoadOrder: function() {
  11988. var me = this,
  11989. urls = me.urls,
  11990. expanded;
  11991. if (!me.expanded) {
  11992. expanded = this.expandUrls(urls, true);
  11993. me.expanded = true;
  11994. } else {
  11995. expanded = urls;
  11996. }
  11997. me.urls = expanded;
  11998. // if we added some urls to the request to honor the indicated
  11999. // load order, the request needs to be sequential
  12000. if (urls.length != expanded.length) {
  12001. me.sequential = true;
  12002. }
  12003. return me;
  12004. },
  12005. getUrls: function() {
  12006. this.expandLoadOrder();
  12007. return this.urls;
  12008. },
  12009. prepareUrl: function(url) {
  12010. if (this.prependBaseUrl) {
  12011. return Boot.baseUrl + url;
  12012. }
  12013. return url;
  12014. },
  12015. getEntries: function() {
  12016. var me = this,
  12017. entries = me.entries,
  12018. loadOrderMap, item, i, entry, urls, url;
  12019. if (!entries) {
  12020. entries = [];
  12021. urls = me.getUrls();
  12022. // If we have loadOrder array then the map will be expanded by now
  12023. if (me.loadOrder) {
  12024. loadOrderMap = me.loadOrderMap;
  12025. }
  12026. for (i = 0; i < urls.length; i++) {
  12027. url = me.prepareUrl(urls[i]);
  12028. if (loadOrderMap) {
  12029. item = loadOrderMap[url];
  12030. }
  12031. entry = Boot.getEntry(url, {
  12032. buster: me.buster,
  12033. charset: me.charset
  12034. }, item && item.canonicalPath);
  12035. entry.requests.push(me);
  12036. entries.push(entry);
  12037. }
  12038. me.entries = entries;
  12039. }
  12040. return entries;
  12041. },
  12042. loadEntries: function(sync) {
  12043. var me = this,
  12044. entries = me.getEntries(),
  12045. len = entries.length,
  12046. start = me.loadStart || 0,
  12047. continueLoad, entries, entry, i;
  12048. if (sync !== undefined) {
  12049. me.sync = sync;
  12050. }
  12051. me.loaded = me.loaded || 0;
  12052. me.loading = me.loading || len;
  12053. for (i = start; i < len; i++) {
  12054. entry = entries[i];
  12055. if (!entry.loaded) {
  12056. continueLoad = entries[i].load(me.sync);
  12057. } else {
  12058. continueLoad = true;
  12059. }
  12060. if (!continueLoad) {
  12061. me.loadStart = i;
  12062. entry.onDone(function() {
  12063. me.loadEntries(sync);
  12064. });
  12065. break;
  12066. }
  12067. }
  12068. me.processLoadedEntries();
  12069. },
  12070. processLoadedEntries: function() {
  12071. var me = this,
  12072. entries = me.getEntries(),
  12073. len = entries.length,
  12074. start = me.startIndex || 0,
  12075. i, entry;
  12076. if (!me.done) {
  12077. for (i = start; i < len; i++) {
  12078. entry = entries[i];
  12079. if (!entry.loaded) {
  12080. me.startIndex = i;
  12081. return;
  12082. }
  12083. if (!entry.evaluated) {
  12084. entry.evaluate();
  12085. }
  12086. if (entry.error) {
  12087. me.error = true;
  12088. }
  12089. }
  12090. me.notify();
  12091. }
  12092. },
  12093. notify: function() {
  12094. var me = this;
  12095. if (!me.done) {
  12096. var error = me.error,
  12097. fn = me[error ? 'failure' : 'success'],
  12098. delay = ('delay' in me) ? me.delay : (error ? 1 : Boot.config.chainDelay),
  12099. scope = me.scope || me;
  12100. me.done = true;
  12101. if (fn) {
  12102. if (delay === 0 || delay > 0) {
  12103. // Free the stack (and defer the next script)
  12104. setTimeout(function() {
  12105. fn.call(scope, me);
  12106. }, delay);
  12107. } else {
  12108. fn.call(scope, me);
  12109. }
  12110. }
  12111. me.fireListeners();
  12112. Boot.requestComplete(me);
  12113. }
  12114. },
  12115. onDone: function(listener) {
  12116. var me = this,
  12117. listeners = me.listeners || (me.listeners = []);
  12118. if (me.done) {
  12119. listener(me);
  12120. } else {
  12121. listeners.push(listener);
  12122. }
  12123. },
  12124. fireListeners: function() {
  12125. var listeners = this.listeners,
  12126. listener;
  12127. if (listeners) {
  12128. // _debug("firing request listeners");
  12129. while ((listener = listeners.shift())) {
  12130. listener(this);
  12131. }
  12132. }
  12133. }
  12134. };
  12135. function Entry(cfg) {
  12136. //The Entry class is a token to manage the load and evaluation
  12137. //state of a particular url. It is used to notify all Requests
  12138. //interested in this url that the content is available.
  12139. if (cfg.$isEntry) {
  12140. return cfg;
  12141. }
  12142. // _debug("creating entry for " + cfg.url);
  12143. var charset = cfg.charset || Boot.config.charset,
  12144. manifest = Ext.manifest,
  12145. loader = manifest && manifest.loader,
  12146. cache = (cfg.cache !== undefined) ? cfg.cache : (loader && loader.cache),
  12147. buster, busterParam;
  12148. if (Boot.config.disableCaching) {
  12149. if (cache === undefined) {
  12150. cache = !Boot.config.disableCaching;
  12151. }
  12152. if (cache === false) {
  12153. buster = +new Date();
  12154. } else if (cache !== true) {
  12155. buster = cache;
  12156. }
  12157. if (buster) {
  12158. busterParam = (loader && loader.cacheParam) || Boot.config.disableCachingParam;
  12159. buster = busterParam + "=" + buster;
  12160. }
  12161. }
  12162. _apply(this, cfg);
  12163. this.charset = charset;
  12164. this.buster = buster;
  12165. this.requests = [];
  12166. }
  12167. Entry.prototype = {
  12168. $isEntry: true,
  12169. done: false,
  12170. evaluated: false,
  12171. loaded: false,
  12172. isCrossDomain: function() {
  12173. var me = this;
  12174. if (me.crossDomain === undefined) {
  12175. // _debug("checking " + me.getLoadUrl() + " for prefix " + Boot.origin);
  12176. me.crossDomain = (me.getLoadUrl().indexOf(Boot.origin) !== 0);
  12177. }
  12178. return me.crossDomain;
  12179. },
  12180. isCss: function() {
  12181. var me = this;
  12182. if (me.css === undefined) {
  12183. if (me.url) {
  12184. var assetConfig = Boot.assetConfig[me.url];
  12185. me.css = assetConfig ? assetConfig.type === "css" : cssRe.test(me.url);
  12186. } else {
  12187. me.css = false;
  12188. }
  12189. }
  12190. return this.css;
  12191. },
  12192. getElement: function(tag) {
  12193. var me = this,
  12194. el = me.el;
  12195. if (!el) {
  12196. // _debug("creating element for " + me.url);
  12197. if (me.isCss()) {
  12198. tag = tag || "link";
  12199. el = doc.createElement(tag);
  12200. if (tag == "link") {
  12201. el.rel = 'stylesheet';
  12202. me.prop = 'href';
  12203. } else {
  12204. me.prop = "textContent";
  12205. }
  12206. el.type = "text/css";
  12207. } else {
  12208. tag = tag || "script";
  12209. el = doc.createElement(tag);
  12210. el.type = 'text/javascript';
  12211. me.prop = 'src';
  12212. if (me.charset) {
  12213. el.charset = me.charset;
  12214. }
  12215. if (Boot.hasAsync) {
  12216. el.async = false;
  12217. }
  12218. }
  12219. me.el = el;
  12220. }
  12221. return el;
  12222. },
  12223. getLoadUrl: function() {
  12224. var me = this,
  12225. url;
  12226. url = me.canonicalPath ? me.url : Boot.canonicalUrl(me.url);
  12227. if (!me.loadUrl) {
  12228. me.loadUrl = !!me.buster ? (url + (url.indexOf('?') === -1 ? '?' : '&') + me.buster) : url;
  12229. }
  12230. return me.loadUrl;
  12231. },
  12232. fetch: function(req) {
  12233. var url = this.getLoadUrl(),
  12234. async = !!req.async,
  12235. complete = req.complete;
  12236. Boot.fetch(url, complete, this, async);
  12237. },
  12238. onContentLoaded: function(response) {
  12239. var me = this,
  12240. status = response.status,
  12241. content = response.content,
  12242. exception = response.exception,
  12243. url = this.getLoadUrl();
  12244. me.loaded = true;
  12245. if ((exception || status === 0) && !_environment.phantom) {
  12246. me.error = ("Failed loading synchronously via XHR: '" + url + "'. It's likely that the file is either being loaded from a " + "different domain or from the local file system where cross " + "origin requests are not allowed for security reasons. Try " + "asynchronous loading instead.") || true;
  12247. me.evaluated = true;
  12248. } else if ((status >= 200 && status < 300) || status === 304 || _environment.phantom || (status === 0 && content.length > 0)) {
  12249. me.content = content;
  12250. } else {
  12251. me.error = ("Failed loading synchronously via XHR: '" + url + "'. Please verify that the file exists. XHR status code: " + status) || true;
  12252. me.evaluated = true;
  12253. }
  12254. },
  12255. createLoadElement: function(callback) {
  12256. var me = this,
  12257. el = me.getElement();
  12258. me.preserve = true;
  12259. el.onerror = function() {
  12260. me.error = true;
  12261. if (callback) {
  12262. callback();
  12263. callback = null;
  12264. }
  12265. };
  12266. if (Boot.isIE10m) {
  12267. el.onreadystatechange = function() {
  12268. if (this.readyState === 'loaded' || this.readyState === 'complete') {
  12269. if (callback) {
  12270. callback();
  12271. callback = this.onreadystatechange = this.onerror = null;
  12272. }
  12273. }
  12274. };
  12275. } else {
  12276. el.onload = function() {
  12277. callback();
  12278. callback = this.onload = this.onerror = null;
  12279. };
  12280. }
  12281. // IE starts loading here
  12282. el[me.prop] = me.getLoadUrl();
  12283. },
  12284. onLoadElementReady: function() {
  12285. Boot.getHead().appendChild(this.getElement());
  12286. this.evaluated = true;
  12287. },
  12288. inject: function(content, asset) {
  12289. // _debug("injecting content for " + this.url);
  12290. var me = this,
  12291. head = Boot.getHead(),
  12292. url = me.url,
  12293. key = me.key,
  12294. base, el, ieMode, basePath;
  12295. if (me.isCss()) {
  12296. me.preserve = true;
  12297. basePath = key.substring(0, key.lastIndexOf("/") + 1);
  12298. base = doc.createElement('base');
  12299. base.href = basePath;
  12300. if (head.firstChild) {
  12301. head.insertBefore(base, head.firstChild);
  12302. } else {
  12303. head.appendChild(base);
  12304. }
  12305. // reset the href attribute to cuase IE to pick up the change
  12306. base.href = base.href;
  12307. if (url) {
  12308. content += "\n/*# sourceURL=" + key + " */";
  12309. }
  12310. // create element after setting base
  12311. el = me.getElement("style");
  12312. ieMode = ('styleSheet' in el);
  12313. head.appendChild(base);
  12314. if (ieMode) {
  12315. head.appendChild(el);
  12316. el.styleSheet.cssText = content;
  12317. } else {
  12318. el.textContent = content;
  12319. head.appendChild(el);
  12320. }
  12321. head.removeChild(base);
  12322. } else {
  12323. // Debugger friendly, file names are still shown even though they're
  12324. // eval'ed code. Breakpoints work on both Firebug and Chrome's Web
  12325. // Inspector.
  12326. if (url) {
  12327. content += "\n//# sourceURL=" + key;
  12328. }
  12329. Ext.globalEval(content);
  12330. }
  12331. return me;
  12332. },
  12333. loadCrossDomain: function() {
  12334. var me = this,
  12335. complete = function() {
  12336. me.el.onerror = me.el.onload = emptyFn;
  12337. me.el = null;
  12338. me.loaded = me.evaluated = me.done = true;
  12339. me.notifyRequests();
  12340. };
  12341. me.createLoadElement(function() {
  12342. complete();
  12343. });
  12344. me.evaluateLoadElement();
  12345. // at this point, we need sequential evaluation,
  12346. // which means we can't advance the load until
  12347. // this entry has fully completed
  12348. return false;
  12349. },
  12350. loadElement: function() {
  12351. var me = this,
  12352. complete = function() {
  12353. me.el.onerror = me.el.onload = emptyFn;
  12354. me.el = null;
  12355. me.loaded = me.evaluated = me.done = true;
  12356. me.notifyRequests();
  12357. };
  12358. me.createLoadElement(function() {
  12359. complete();
  12360. });
  12361. me.evaluateLoadElement();
  12362. return true;
  12363. },
  12364. loadSync: function() {
  12365. var me = this;
  12366. me.fetch({
  12367. async: false,
  12368. complete: function(response) {
  12369. me.onContentLoaded(response);
  12370. }
  12371. });
  12372. me.evaluate();
  12373. me.notifyRequests();
  12374. },
  12375. load: function(sync) {
  12376. var me = this;
  12377. if (!me.loaded) {
  12378. if (me.loading) {
  12379. // if we're calling back through load and we're loading but haven't
  12380. // yet loaded, then we should be in a sequential, cross domain
  12381. // load scenario which means we can't continue the load on the
  12382. // request until this entry has fully evaluated, which will mean
  12383. // loaded = evaluated = done = true in one step. For css files, this
  12384. // will happen immediately upon <link> element creation / insertion,
  12385. // but <script> elements will set this upon load notification
  12386. return false;
  12387. }
  12388. me.loading = true;
  12389. // for async modes, we have some options
  12390. if (!sync) {
  12391. // if cross domain, just inject the script tag and let the onload
  12392. // events drive the progression.
  12393. // IE10 also needs sequential loading because of a bug that makes it
  12394. // fire readystate event prematurely:
  12395. // https://connect.microsoft.com/IE/feedback/details/729164/ie10-dynamic-script-element-fires-loaded-readystate-prematurely
  12396. if (Boot.isIE10 || me.isCrossDomain()) {
  12397. return me.loadCrossDomain();
  12398. }
  12399. // for IE, use the readyStateChange allows us to load scripts in parallel
  12400. // but serialize the evaluation by appending the script node to the
  12401. // document
  12402. else if (!me.isCss() && Boot.hasReadyState) {
  12403. me.createLoadElement(function() {
  12404. me.loaded = true;
  12405. me.notifyRequests();
  12406. });
  12407. } else if (Boot.useElements && // older webkit, phantomjs included, won't fire load for link elements
  12408. !(me.isCss() && _environment.phantom)) {
  12409. return me.loadElement();
  12410. } else // for other browsers, just ajax the content down in parallel, and use
  12411. // globalEval to serialize evaluation
  12412. {
  12413. me.fetch({
  12414. async: !sync,
  12415. complete: function(response) {
  12416. me.onContentLoaded(response);
  12417. me.notifyRequests();
  12418. }
  12419. });
  12420. }
  12421. } else // for sync mode in js, global eval FTW. IE won't honor the comment
  12422. // paths in the debugger, so eventually we need a sync mode for IE that
  12423. // uses the readyStateChange mechanism
  12424. {
  12425. me.loadSync();
  12426. }
  12427. }
  12428. // signal that the load process can continue
  12429. return true;
  12430. },
  12431. evaluateContent: function() {
  12432. this.inject(this.content);
  12433. this.content = null;
  12434. },
  12435. evaluateLoadElement: function() {
  12436. Boot.getHead().appendChild(this.getElement());
  12437. },
  12438. evaluate: function() {
  12439. var me = this;
  12440. if (!me.evaluated) {
  12441. if (me.evaluating) {
  12442. return;
  12443. }
  12444. me.evaluating = true;
  12445. if (me.content !== undefined) {
  12446. me.evaluateContent();
  12447. } else if (!me.error) {
  12448. me.evaluateLoadElement();
  12449. }
  12450. me.evaluated = me.done = true;
  12451. me.cleanup();
  12452. }
  12453. },
  12454. cleanup: function() {
  12455. var me = this,
  12456. el = me.el,
  12457. prop;
  12458. if (!el) {
  12459. return;
  12460. }
  12461. if (!me.preserve) {
  12462. me.el = null;
  12463. el.parentNode.removeChild(el);
  12464. // Remove, since its useless now
  12465. for (prop in el) {
  12466. try {
  12467. if (prop !== me.prop) {
  12468. // If we set the src property to null IE
  12469. // will try and request a script at './null'
  12470. el[prop] = null;
  12471. }
  12472. delete el[prop];
  12473. } // and prepare for GC
  12474. catch (cleanEx) {}
  12475. }
  12476. }
  12477. //ignore
  12478. // Setting to null can cause exceptions if IE ever needs to call these
  12479. // again (like onreadystatechange). This emptyFn has nothing locked in
  12480. // closure scope so it is about as safe as null for memory leaks.
  12481. el.onload = el.onerror = el.onreadystatechange = emptyFn;
  12482. },
  12483. notifyRequests: function() {
  12484. var requests = this.requests,
  12485. len = requests.length,
  12486. i, request;
  12487. for (i = 0; i < len; i++) {
  12488. request = requests[i];
  12489. request.processLoadedEntries();
  12490. }
  12491. if (this.done) {
  12492. this.fireListeners();
  12493. }
  12494. },
  12495. onDone: function(listener) {
  12496. var me = this,
  12497. listeners = me.listeners || (me.listeners = []);
  12498. if (me.done) {
  12499. listener(me);
  12500. } else {
  12501. listeners.push(listener);
  12502. }
  12503. },
  12504. fireListeners: function() {
  12505. var listeners = this.listeners,
  12506. listener;
  12507. if (listeners && listeners.length > 0) {
  12508. // _debug("firing event listeners for url " + this.url);
  12509. while ((listener = listeners.shift())) {
  12510. listener(this);
  12511. }
  12512. }
  12513. }
  12514. };
  12515. /**
  12516. * Turns on or off the "cache buster" applied to dynamically loaded scripts. Normally
  12517. * dynamically loaded scripts have an extra query parameter appended to avoid stale
  12518. * cached scripts. This method can be used to disable this mechanism, and is primarily
  12519. * useful for testing. This is done using a cookie.
  12520. * @param {Boolean} disable True to disable the cache buster.
  12521. * @param {String} [path="/"] An optional path to scope the cookie.
  12522. */
  12523. Ext.disableCacheBuster = function(disable, path) {
  12524. var date = new Date();
  12525. date.setTime(date.getTime() + (disable ? 10 * 365 : -1) * 24 * 60 * 60 * 1000);
  12526. date = date.toGMTString();
  12527. doc.cookie = 'ext-cache=1; expires=' + date + '; path=' + (path || '/');
  12528. };
  12529. Boot.init();
  12530. return Boot;
  12531. }(// NOTE: We run the eval at global scope to protect the body of the function and allow
  12532. // compressors to still process it.
  12533. function() {}));
  12534. //(eval("/*@cc_on!@*/!1"));
  12535. /**
  12536. * This method evaluates the given code free of any local variable. This
  12537. * will be at global scope, in others it will be in a function.
  12538. * @param {String} code The code to evaluate.
  12539. * @private
  12540. * @method
  12541. * @member Ext
  12542. */
  12543. Ext.globalEval = Ext.globalEval || (this.execScript ? function(code) {
  12544. execScript(code);
  12545. } : function($$code) {
  12546. eval.call(window, $$code);
  12547. });
  12548. /*
  12549. * Only IE8 & IE/Quirks lack Function.prototype.bind so we polyfill that here.
  12550. */
  12551. if (!Function.prototype.bind) {
  12552. (function() {
  12553. var slice = Array.prototype.slice,
  12554. // To reduce overhead on call of the bound fn we have two flavors based on
  12555. // whether we have args to prepend or not:
  12556. bind = function(me) {
  12557. var args = slice.call(arguments, 1),
  12558. method = this;
  12559. if (args.length) {
  12560. return function() {
  12561. var t = arguments;
  12562. // avoid the slice/concat if the caller does not supply args
  12563. return method.apply(me, t.length ? args.concat(slice.call(t)) : args);
  12564. };
  12565. }
  12566. // this is the majority use case - just fn.bind(this) and no args
  12567. args = null;
  12568. return function() {
  12569. return method.apply(me, arguments);
  12570. };
  12571. };
  12572. Function.prototype.bind = bind;
  12573. bind.$extjs = true;
  12574. }());
  12575. }
  12576. // to detect this polyfill if one want to improve it
  12577. //</editor-fold>
  12578. Ext.setResourcePath = function(poolName, path) {
  12579. var manifest = Ext.manifest || (Ext.manifest = {}),
  12580. paths = manifest.resources || (manifest.resources = {});
  12581. if (manifest) {
  12582. if (typeof poolName !== 'string') {
  12583. Ext.apply(paths, poolName);
  12584. } else {
  12585. paths[poolName] = path;
  12586. }
  12587. manifest.resources = paths;
  12588. }
  12589. };
  12590. Ext.getResourcePath = function(path, poolName, packageName) {
  12591. if (typeof path !== 'string') {
  12592. poolName = path.pool;
  12593. packageName = path.packageName;
  12594. path = path.path;
  12595. }
  12596. var manifest = Ext.manifest,
  12597. paths = manifest && manifest.resources,
  12598. poolPath = paths[poolName],
  12599. output = [];
  12600. if (poolPath == null) {
  12601. poolPath = paths.path;
  12602. if (poolPath == null) {
  12603. poolPath = 'resources';
  12604. }
  12605. }
  12606. if (poolPath) {
  12607. output.push(poolPath);
  12608. }
  12609. if (packageName) {
  12610. output.push(packageName);
  12611. }
  12612. output.push(path);
  12613. return output.join('/');
  12614. };
  12615. // @tag core
  12616. /**
  12617. * @class Ext
  12618. *
  12619. * The Ext namespace (global object) encapsulates all classes, singletons, and
  12620. * utility methods provided by Sencha's libraries.
  12621. *
  12622. * Most user interface Components are at a lower level of nesting in the namespace,
  12623. * but many common utility functions are provided as direct properties of the Ext namespace.
  12624. *
  12625. * Also many frequently used methods from other classes are provided as shortcuts
  12626. * within the Ext namespace. For example {@link Ext#getCmp Ext.getCmp} aliases
  12627. * {@link Ext.ComponentManager#get Ext.ComponentManager.get}.
  12628. *
  12629. * Many applications are initiated with {@link Ext#application Ext.application} which is
  12630. * called once the DOM is ready. This ensures all scripts have been loaded, preventing
  12631. * dependency issues. For example:
  12632. *
  12633. * Ext.application({
  12634. * name: 'MyApp',
  12635. *
  12636. * launch: function () {
  12637. * Ext.Msg.alert(this.name, 'Ready to go!');
  12638. * }
  12639. * });
  12640. *
  12641. * <b><a href="http://www.sencha.com/products/sencha-cmd/">Sencha Cmd</a></b> is a free tool
  12642. * for helping you generate and build Ext JS (and Sencha Touch) applications. See
  12643. * `{@link Ext.app.Application Application}` for more information about creating an app.
  12644. *
  12645. * A lower-level technique that does not use the `Ext.app.Application` architecture is
  12646. * {@link Ext#onReady Ext.onReady}.
  12647. *
  12648. * You can also discuss concepts and issues with others on the
  12649. * <a href="http://www.sencha.com/forum/">Sencha Forums</a>.
  12650. *
  12651. * @singleton
  12652. */
  12653. var Ext = Ext || {};
  12654. // jshint ignore:line
  12655. // @define Ext
  12656. (function() {
  12657. var global = this,
  12658. objectPrototype = Object.prototype,
  12659. toString = objectPrototype.toString,
  12660. enumerables = [
  12661. //'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',
  12662. 'valueOf',
  12663. 'toLocaleString',
  12664. 'toString',
  12665. 'constructor'
  12666. ],
  12667. emptyFn = Ext.fireIdle = function() {},
  12668. // see GlobalEvents for true fireIdle
  12669. privateFn = function() {},
  12670. identityFn = function(o) {
  12671. return o;
  12672. },
  12673. // This is the "$previous" method of a hook function on an instance. When called, it
  12674. // calls through the class prototype by the name of the called method.
  12675. callOverrideParent = function() {
  12676. var method = callOverrideParent.caller.caller;
  12677. // skip callParent (our caller)
  12678. return method.$owner.prototype[method.$name].apply(this, arguments);
  12679. },
  12680. manifest = Ext.manifest || {},
  12681. i,
  12682. iterableRe = /\[object\s*(?:Array|Arguments|\w*Collection|\w*List|HTML\s+document\.all\s+class)\]/,
  12683. MSDateRe = /^\\?\/Date\(([-+])?(\d+)(?:[+-]\d{4})?\)\\?\/$/,
  12684. elevateArgs, elevateFn, elevateRet, elevateScope;
  12685. Ext.global = global;
  12686. Ext.$nextIid = 0;
  12687. /**
  12688. * Returns the current timestamp.
  12689. * @return {Number} Milliseconds since UNIX epoch.
  12690. * @method now
  12691. * @member Ext
  12692. */
  12693. Ext.now = Date.now || (Date.now = function() {
  12694. return +new Date();
  12695. });
  12696. /**
  12697. * Returns the current high-resolution timestamp.
  12698. * @return {Number} Milliseconds ellapsed since arbitrary epoch.
  12699. * @method ticks
  12700. * @member Ext
  12701. * @since 6.0.1
  12702. */
  12703. Ext.ticks = (global.performance && global.performance.now) ? function() {
  12704. return performance.now();
  12705. } : // jshint ignore:line
  12706. Ext.now;
  12707. Ext._startTime = Ext.ticks();
  12708. // Mark these special fn's for easy identification:
  12709. emptyFn.$nullFn = identityFn.$nullFn = emptyFn.$emptyFn = identityFn.$identityFn = privateFn.$nullFn = true;
  12710. privateFn.$privacy = 'framework';
  12711. // We also want to prevent these functions from being cleaned up on destroy
  12712. emptyFn.$noClearOnDestroy = identityFn.$noClearOnDestroy = true;
  12713. privateFn.$noClearOnDestroy = true;
  12714. // These are emptyFn's in core and are redefined only in Ext JS (we use this syntax
  12715. // so Cmd does not detect them):
  12716. Ext['suspendLayouts'] = Ext['resumeLayouts'] = emptyFn;
  12717. // jshint ignore:line
  12718. for (i in {
  12719. toString: 1
  12720. }) {
  12721. enumerables = null;
  12722. }
  12723. /**
  12724. * An array containing extra enumerables for old browsers
  12725. * @property {String[]}
  12726. */
  12727. Ext.enumerables = enumerables;
  12728. /**
  12729. * Copies all the properties of `config` to the specified `object`. There are two levels
  12730. * of defaulting supported:
  12731. *
  12732. * Ext.apply(obj, { a: 1 }, { a: 2 });
  12733. * //obj.a === 1
  12734. *
  12735. * Ext.apply(obj, { }, { a: 2 });
  12736. * //obj.a === 2
  12737. *
  12738. * Note that if recursive merging and cloning without referencing the original objects
  12739. * or arrays is needed, use {@link Ext.Object#merge} instead.
  12740. *
  12741. * @param {Object} object The receiver of the properties.
  12742. * @param {Object} config The primary source of the properties.
  12743. * @param {Object} [defaults] An object that will also be applied for default values.
  12744. * @return {Object} returns `object`.
  12745. */
  12746. Ext.apply = function(object, config, defaults) {
  12747. if (object) {
  12748. if (defaults) {
  12749. Ext.apply(object, defaults);
  12750. }
  12751. if (config && typeof config === 'object') {
  12752. var i, j, k;
  12753. for (i in config) {
  12754. object[i] = config[i];
  12755. }
  12756. if (enumerables) {
  12757. for (j = enumerables.length; j--; ) {
  12758. k = enumerables[j];
  12759. if (config.hasOwnProperty(k)) {
  12760. object[k] = config[k];
  12761. }
  12762. }
  12763. }
  12764. }
  12765. }
  12766. return object;
  12767. };
  12768. // Used by Ext.override
  12769. function addInstanceOverrides(target, owner, overrides) {
  12770. var name, value;
  12771. for (name in overrides) {
  12772. if (overrides.hasOwnProperty(name)) {
  12773. value = overrides[name];
  12774. if (typeof value === 'function') {
  12775. if (owner.$className) {
  12776. value.name = owner.$className + '#' + name;
  12777. }
  12778. value.$name = name;
  12779. value.$owner = owner;
  12780. value.$previous = target.hasOwnProperty(name) ? target[name] : // already hooked, so call previous hook
  12781. callOverrideParent;
  12782. }
  12783. // calls by name on prototype
  12784. target[name] = value;
  12785. }
  12786. }
  12787. }
  12788. Ext.buildSettings = Ext.apply({
  12789. baseCSSPrefix: 'x-'
  12790. }, Ext.buildSettings || {});
  12791. Ext.apply(Ext, {
  12792. /**
  12793. * @private
  12794. */
  12795. idSeed: 0,
  12796. /**
  12797. * @private
  12798. */
  12799. idPrefix: 'ext-',
  12800. /**
  12801. * @private
  12802. */
  12803. isRobot: false,
  12804. /**
  12805. * @property {Boolean} isSecure
  12806. * True if the page is running over SSL
  12807. * @readonly
  12808. */
  12809. isSecure: /^https/i.test(window.location.protocol),
  12810. /**
  12811. * `true` to automatically uncache orphaned Ext.Elements periodically. If set to
  12812. * `false`, the application will be required to clean up orphaned Ext.Elements and
  12813. * it's listeners as to not cause memory leakage.
  12814. */
  12815. enableGarbageCollector: false,
  12816. /**
  12817. * True to automatically purge event listeners during garbageCollection.
  12818. */
  12819. enableListenerCollection: true,
  12820. /**
  12821. * @property {String} [name='Ext']
  12822. * <p>The name of the property in the global namespace (The <code>window</code> in browser environments) which refers to the current instance of Ext.</p>
  12823. * <p>This is usually <code>"Ext"</code>, but if a sandboxed build of ExtJS is being used, this will be an alternative name.</p>
  12824. * <p>If code is being generated for use by <code>eval</code> or to create a <code>new Function</code>, and the global instance
  12825. * of Ext must be referenced, this is the name that should be built into the code.</p>
  12826. */
  12827. name: Ext.sandboxName || 'Ext',
  12828. /**
  12829. * @property {Function}
  12830. * A reusable empty function for use as `privates` members.
  12831. *
  12832. * Ext.define('MyClass', {
  12833. * nothing: Ext.emptyFn,
  12834. *
  12835. * privates: {
  12836. * privateNothing: Ext.privateFn
  12837. * }
  12838. * });
  12839. *
  12840. */
  12841. privateFn: privateFn,
  12842. /**
  12843. * @property {Function}
  12844. * A reusable empty function.
  12845. */
  12846. emptyFn: emptyFn,
  12847. /**
  12848. * @property {Function}
  12849. * A reusable identity function that simply returns its first argument.
  12850. */
  12851. identityFn: identityFn,
  12852. /**
  12853. * This indicate the start timestamp of current cycle.
  12854. * It is only reliable during dom-event-initiated cycles and
  12855. * {@link Ext.draw.Animator} initiated cycles.
  12856. */
  12857. frameStartTime: Ext.now(),
  12858. /**
  12859. * This object is initialized prior to loading the framework
  12860. * and contains settings and other information describing the application.
  12861. *
  12862. * For applications built using Sencha Cmd, this is produced from the `"app.json"`
  12863. * file with information extracted from all of the required packages' `"package.json"`
  12864. * files. This can be set to a string when your application is using the
  12865. * (microloader)[#/guide/microloader]. In this case, the string of "foo" will be
  12866. * requested as `"foo.json"` and the object in that JSON file will parsed and set
  12867. * as this object.
  12868. *
  12869. * @cfg {String/Ext.Manifest} manifest
  12870. * @since 5.0.0
  12871. */
  12872. manifest: manifest,
  12873. /**
  12874. * @cfg {Object} [debugConfig]
  12875. * This object is used to enable or disable debugging for classes or namespaces. The
  12876. * default instance looks like this:
  12877. *
  12878. * Ext.debugConfig = {
  12879. * hooks: {
  12880. * '*': true
  12881. * }
  12882. * };
  12883. *
  12884. * Typically applications will set this in their `"app.json"` like so:
  12885. *
  12886. * {
  12887. * "debug": {
  12888. * "hooks": {
  12889. * // Default for all namespaces:
  12890. * '*': true,
  12891. *
  12892. * // Except for Ext namespace which is disabled
  12893. * 'Ext': false,
  12894. *
  12895. * // Except for Ext.layout namespace which is enabled
  12896. * 'Ext.layout': true
  12897. * }
  12898. * }
  12899. * }
  12900. *
  12901. * Alternatively, because this property is consumed very early in the load process of
  12902. * the framework, this can be set in a `script` tag that is defined prior to loading
  12903. * the framework itself.
  12904. *
  12905. * For example, to enable debugging for the `Ext.layout` namespace only:
  12906. *
  12907. * var Ext = Ext || {};
  12908. * Ext.debugConfig = {
  12909. * hooks: {
  12910. * //...
  12911. * }
  12912. * };
  12913. *
  12914. * For any class declared, the longest matching namespace specified determines if its
  12915. * `debugHooks` will be enabled. The default setting is specified by the '*' property.
  12916. *
  12917. * **NOTE:** This option only applies to debug builds. All debugging is disabled in
  12918. * production builds.
  12919. */
  12920. debugConfig: Ext.debugConfig || manifest.debug || {
  12921. hooks: {
  12922. '*': true
  12923. }
  12924. },
  12925. /**
  12926. * @property {Boolean} [enableAria=true] This property is provided for backward
  12927. * compatibility with previous versions of Ext JS. Accessibility is always enabled
  12928. * in Ext JS 6.0+.
  12929. *
  12930. * This property is deprecated. To disable WAI-ARIA compatibility warnings,
  12931. * override `Ext.ariaWarn` function in your application startup code:
  12932. *
  12933. * Ext.application({
  12934. * launch: function() {
  12935. * Ext.ariaWarn = Ext.emptyFn;
  12936. * }
  12937. * });
  12938. *
  12939. * For stricter compatibility with WAI-ARIA requirements, replace `Ext.ariaWarn`
  12940. * with a function that will raise an error instead:
  12941. *
  12942. * Ext.application({
  12943. * launch: function() {
  12944. * Ext.ariaWarn = function(target, msg) {
  12945. * Ext.raise({
  12946. * msg: msg,
  12947. * component: target
  12948. * });
  12949. * };
  12950. * }
  12951. * });
  12952. *
  12953. * @since 6.0.0
  12954. * @deprecated 6.0.2 This property is no longer necessary, so no replacement is required.
  12955. */
  12956. enableAria: true,
  12957. startsWithHashRe: /^#/,
  12958. /**
  12959. * @property {RegExp}
  12960. * @private
  12961. * Regular expression used for validating identifiers.
  12962. */
  12963. validIdRe: /^[a-z_][a-z0-9\-_]*$/i,
  12964. /**
  12965. * @property {String} BLANK_IMAGE_URL
  12966. * URL to a 1x1 transparent gif image used by Ext to create inline icons with
  12967. * CSS background images.
  12968. */
  12969. BLANK_IMAGE_URL: 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
  12970. /**
  12971. * Converts an id (`'foo'`) into an id selector (`'#foo'`). This method is used
  12972. * internally by the framework whenever an id needs to be converted into a selector
  12973. * and is provided as a hook for those that need to escape IDs selectors since,
  12974. * as of Ext 5.0, the framework no longer escapes IDs by default.
  12975. * @private
  12976. * @param {String} id
  12977. * @return {String}
  12978. */
  12979. makeIdSelector: function(id) {
  12980. if (!Ext.validIdRe.test(id)) {
  12981. Ext.raise('Invalid id selector: "' + id + '"');
  12982. }
  12983. return '#' + id;
  12984. },
  12985. /**
  12986. * Generates unique ids. If the object/element is passes and it already has an `id`, it is unchanged.
  12987. * @param {Object} [o] The object to generate an id for.
  12988. * @param {String} [prefix=ext-gen] (optional) The `id` prefix.
  12989. * @return {String} The generated `id`.
  12990. */
  12991. id: function(o, prefix) {
  12992. if (o && o.id) {
  12993. return o.id;
  12994. }
  12995. var id = (prefix || Ext.idPrefix) + (++Ext.idSeed);
  12996. if (o) {
  12997. o.id = id;
  12998. }
  12999. return id;
  13000. },
  13001. /**
  13002. * A reusable function which returns the value of `getId()` called upon a single passed parameter.
  13003. * Useful when creating a {@link Ext.util.MixedCollection} of objects keyed by an identifier returned from a `getId` method.
  13004. */
  13005. returnId: function(o) {
  13006. return o.getId();
  13007. },
  13008. /**
  13009. * A reusable function which returns `true`.
  13010. */
  13011. returnTrue: function() {
  13012. return true;
  13013. },
  13014. /**
  13015. * A zero length string which will pass a truth test. Useful for passing to methods
  13016. * which use a truth test to reject <i>falsy</i> values where a string value must be cleared.
  13017. */
  13018. emptyString: new String(),
  13019. // jshint ignore:line
  13020. /**
  13021. * An immutable empty array if Object.freeze is supported by the browser
  13022. * @since 6.5.0
  13023. * @private
  13024. */
  13025. emptyArray: Object.freeze ? Object.freeze([]) : [],
  13026. /**
  13027. * @property {String} [baseCSSPrefix='x-']
  13028. * The base prefix to use for all `Ext` components. To configure this property, you should use the
  13029. * Ext.buildSettings object before the framework is loaded:
  13030. *
  13031. * Ext.buildSettings = {
  13032. * baseCSSPrefix : 'abc-'
  13033. * };
  13034. *
  13035. * or you can change it before any components are rendered:
  13036. *
  13037. * Ext.baseCSSPrefix = Ext.buildSettings.baseCSSPrefix = 'abc-';
  13038. *
  13039. * This will change what CSS classes components will use and you should
  13040. * then recompile the SASS changing the `$prefix` SASS variable to match.
  13041. */
  13042. baseCSSPrefix: Ext.buildSettings.baseCSSPrefix,
  13043. /**
  13044. * @property {Object} $eventNameMap
  13045. * A map of event names which contained the lower-cased versions of any mixed
  13046. * case event names.
  13047. * @private
  13048. */
  13049. $eventNameMap: {},
  13050. // Vendor-specific events do not work if lower-cased. This regex specifies event
  13051. // prefixes for names that should NOT be lower-cased by Ext.canonicalEventName()
  13052. $vendorEventRe: /^(DOMMouse|Moz.+|MS.+|webkit.+)/,
  13053. // TODO: inlinable function - SDKTOOLS-686
  13054. /**
  13055. * @private
  13056. */
  13057. canonicalEventName: function(name) {
  13058. return Ext.$eventNameMap[name] || (Ext.$eventNameMap[name] = (Ext.$vendorEventRe.test(name) ? name : name.toLowerCase()));
  13059. },
  13060. /**
  13061. * Copies all the properties of config to object if they don't already exist.
  13062. * @param {Object} object The receiver of the properties
  13063. * @param {Object} config The source of the properties
  13064. * @return {Object} returns obj
  13065. */
  13066. applyIf: function(object, config) {
  13067. if (object && config && typeof config === 'object') {
  13068. for (var property in config) {
  13069. if (object[property] === undefined) {
  13070. object[property] = config[property];
  13071. }
  13072. }
  13073. }
  13074. return object;
  13075. },
  13076. /**
  13077. * Destroys all of the given objects. If arrays are passed, the elements of these
  13078. * are destroyed recursively.
  13079. *
  13080. * What it means to "destroy" an object depends on the type of object.
  13081. *
  13082. * * `Array`: Each element of the array is destroyed recursively.
  13083. * * `Object`: Any object with a `destroy` method will have that method called.
  13084. *
  13085. * @param {Mixed...} args Any number of objects or arrays.
  13086. */
  13087. destroy: function() {
  13088. var ln = arguments.length,
  13089. i, arg;
  13090. for (i = 0; i < ln; i++) {
  13091. arg = arguments[i];
  13092. if (arg) {
  13093. if (Ext.isArray(arg)) {
  13094. this.destroy.apply(this, arg);
  13095. } else if (Ext.isFunction(arg.destroy) && !arg.destroyed) {
  13096. arg.destroy();
  13097. }
  13098. }
  13099. }
  13100. return null;
  13101. },
  13102. /**
  13103. * Destroys the specified named members of the given object using `Ext.destroy`. These
  13104. * properties will be set to `null`.
  13105. * @param {Object} object The object who's properties you wish to destroy.
  13106. * @param {String...} args One or more names of the properties to destroy and remove from the object.
  13107. */
  13108. destroyMembers: function(object) {
  13109. for (var ref, name,
  13110. i = 1,
  13111. a = arguments,
  13112. len = a.length; i < len; i++) {
  13113. ref = object[name = a[i]];
  13114. // Avoid adding the property if it does not already exist
  13115. if (ref != null) {
  13116. object[name] = Ext.destroy(ref);
  13117. }
  13118. }
  13119. },
  13120. /**
  13121. * Overrides members of the specified `target` with the given values.
  13122. *
  13123. * If the `target` is a class declared using {@link Ext#define Ext.define}, the
  13124. * `override` method of that class is called (see {@link Ext.Base#override}) given
  13125. * the `overrides`.
  13126. *
  13127. * If the `target` is a function, it is assumed to be a constructor and the contents
  13128. * of `overrides` are applied to its `prototype` using {@link Ext#apply Ext.apply}.
  13129. *
  13130. * If the `target` is an instance of a class declared using {@link Ext#define Ext.define},
  13131. * the `overrides` are applied to only that instance. In this case, methods are
  13132. * specially processed to allow them to use {@link Ext.Base#method!callParent}.
  13133. *
  13134. * var panel = new Ext.Panel({ ... });
  13135. *
  13136. * Ext.override(panel, {
  13137. * initComponent: function () {
  13138. * // extra processing...
  13139. *
  13140. * this.callParent();
  13141. * }
  13142. * });
  13143. *
  13144. * If the `target` is none of these, the `overrides` are applied to the `target`
  13145. * using {@link Ext#apply Ext.apply}.
  13146. *
  13147. * Please refer to {@link Ext#define Ext.define} and {@link Ext.Base#override} for
  13148. * further details.
  13149. *
  13150. * @param {Object} target The target to override.
  13151. * @param {Object} overrides The properties to add or replace on `target`.
  13152. * @method override
  13153. */
  13154. override: function(target, overrides) {
  13155. if (target.$isClass) {
  13156. target.override(overrides);
  13157. } else if (typeof target === 'function') {
  13158. Ext.apply(target.prototype, overrides);
  13159. } else {
  13160. var owner = target.self,
  13161. privates;
  13162. if (owner && owner.$isClass) {
  13163. // if (instance of Ext.define'd class)
  13164. privates = overrides.privates;
  13165. if (privates) {
  13166. overrides = Ext.apply({}, overrides);
  13167. delete overrides.privates;
  13168. addInstanceOverrides(target, owner, privates);
  13169. }
  13170. addInstanceOverrides(target, owner, overrides);
  13171. } else {
  13172. Ext.apply(target, overrides);
  13173. }
  13174. }
  13175. return target;
  13176. },
  13177. /**
  13178. * Returns the given value itself if it's not empty, as described in {@link Ext#isEmpty}; returns the default
  13179. * value (second argument) otherwise.
  13180. *
  13181. * @param {Object} value The value to test.
  13182. * @param {Object} defaultValue The value to return if the original value is empty.
  13183. * @param {Boolean} [allowBlank=false] `true` to allow zero length strings to qualify as non-empty.
  13184. * @return {Object} value, if non-empty, else defaultValue.
  13185. */
  13186. valueFrom: function(value, defaultValue, allowBlank) {
  13187. return Ext.isEmpty(value, allowBlank) ? defaultValue : value;
  13188. },
  13189. /**
  13190. * Returns true if the passed value is empty, false otherwise. The value is deemed to be empty if it is either:
  13191. *
  13192. * - `null`
  13193. * - `undefined`
  13194. * - a zero-length array
  13195. * - a zero-length string (Unless the `allowEmptyString` parameter is set to `true`)
  13196. *
  13197. * @param {Object} value The value to test.
  13198. * @param {Boolean} [allowEmptyString=false] `true` to allow empty strings.
  13199. * @return {Boolean}
  13200. */
  13201. isEmpty: function(value, allowEmptyString) {
  13202. return (value == null) || (!allowEmptyString ? value === '' : false) || (Ext.isArray(value) && value.length === 0);
  13203. },
  13204. /**
  13205. * Returns `true` if the passed value is a JavaScript Array, `false` otherwise.
  13206. *
  13207. * @param {Object} target The target to test.
  13208. * @return {Boolean}
  13209. * @method
  13210. */
  13211. isArray: ('isArray' in Array) ? Array.isArray : function(value) {
  13212. return toString.call(value) === '[object Array]';
  13213. },
  13214. /**
  13215. * Returns `true` if the passed value is a JavaScript Date object, `false` otherwise.
  13216. * @param {Object} obj The object to test.
  13217. * @return {Boolean}
  13218. */
  13219. isDate: function(obj) {
  13220. return toString.call(obj) === '[object Date]';
  13221. },
  13222. /**
  13223. * Returns 'true' if the passed value is a String that matches the MS Date JSON
  13224. * encoding format.
  13225. * @param {String} value The string to test.
  13226. * @return {Boolean}
  13227. */
  13228. isMSDate: function(value) {
  13229. if (!Ext.isString(value)) {
  13230. return false;
  13231. }
  13232. return MSDateRe.test(value);
  13233. },
  13234. /**
  13235. * Returns `true` if the passed value is a JavaScript Object, `false` otherwise.
  13236. * @param {Object} value The value to test.
  13237. * @return {Boolean}
  13238. * @method
  13239. */
  13240. isObject: (toString.call(null) === '[object Object]') ? function(value) {
  13241. // check ownerDocument here as well to exclude DOM nodes
  13242. return value != null && toString.call(value) === '[object Object]' && value.ownerDocument === undefined;
  13243. } : function(value) {
  13244. return toString.call(value) === '[object Object]';
  13245. },
  13246. /**
  13247. * @private
  13248. */
  13249. isSimpleObject: function(value) {
  13250. return value instanceof Object && value.constructor === Object;
  13251. },
  13252. /**
  13253. * Returns `true` if the passed value is a JavaScript 'primitive', a string, number
  13254. * or boolean.
  13255. * @param {Object} value The value to test.
  13256. * @return {Boolean}
  13257. */
  13258. isPrimitive: function(value) {
  13259. var type = typeof value;
  13260. return type === 'string' || type === 'number' || type === 'boolean';
  13261. },
  13262. /**
  13263. * Returns `true` if the passed value is a JavaScript Function, `false` otherwise.
  13264. * @param {Object} value The value to test.
  13265. * @return {Boolean}
  13266. * @method
  13267. */
  13268. isFunction: // Safari 3.x and 4.x returns 'function' for typeof <NodeList>, hence we need to fall back to using
  13269. // Object.prototype.toString (slower)
  13270. (typeof document !== 'undefined' && typeof document.getElementsByTagName('body') === 'function') ? function(value) {
  13271. return !!value && toString.call(value) === '[object Function]';
  13272. } : function(value) {
  13273. return !!value && typeof value === 'function';
  13274. },
  13275. /**
  13276. * Returns `true` if the passed value is a number. Returns `false` for non-finite numbers.
  13277. * @param {Object} value The value to test.
  13278. * @return {Boolean}
  13279. */
  13280. isNumber: function(value) {
  13281. return typeof value === 'number' && isFinite(value);
  13282. },
  13283. /**
  13284. * Validates that a value is numeric.
  13285. * @param {Object} value Examples: 1, '1', '2.34'
  13286. * @return {Boolean} True if numeric, false otherwise
  13287. */
  13288. isNumeric: function(value) {
  13289. return !isNaN(parseFloat(value)) && isFinite(value);
  13290. },
  13291. /**
  13292. * Returns `true `if the passed value is a string.
  13293. * @param {Object} value The value to test.
  13294. * @return {Boolean}
  13295. */
  13296. isString: function(value) {
  13297. return typeof value === 'string';
  13298. },
  13299. /**
  13300. * Returns `true` if the passed value is a boolean.
  13301. *
  13302. * @param {Object} value The value to test.
  13303. * @return {Boolean}
  13304. */
  13305. isBoolean: function(value) {
  13306. return typeof value === 'boolean';
  13307. },
  13308. /**
  13309. * Returns `true` if the passed value is an HTMLElement
  13310. * @param {Object} value The value to test.
  13311. * @return {Boolean}
  13312. */
  13313. isElement: function(value) {
  13314. return value ? value.nodeType === 1 : false;
  13315. },
  13316. /**
  13317. * Returns `true` if the passed value is a TextNode
  13318. * @param {Object} value The value to test.
  13319. * @return {Boolean}
  13320. */
  13321. isTextNode: function(value) {
  13322. return value ? value.nodeName === "#text" : false;
  13323. },
  13324. /**
  13325. * Returns `true` if the passed value is defined.
  13326. * @param {Object} value The value to test.
  13327. * @return {Boolean}
  13328. */
  13329. isDefined: function(value) {
  13330. return typeof value !== 'undefined';
  13331. },
  13332. /**
  13333. * Returns `true` if the passed value is iterable, that is, if elements of it are addressable using array
  13334. * notation with numeric indices, `false` otherwise.
  13335. *
  13336. * Arrays and function `arguments` objects are iterable. Also HTML collections such as `NodeList` and `HTMLCollection'
  13337. * are iterable.
  13338. *
  13339. * @param {Object} value The value to test
  13340. * @return {Boolean}
  13341. */
  13342. isIterable: function(value) {
  13343. // To be iterable, the object must have a numeric length property and must not be a string or function.
  13344. if (!value || typeof value.length !== 'number' || typeof value === 'string' || Ext.isFunction(value)) {
  13345. return false;
  13346. }
  13347. // Certain "standard" collections in IE (such as document.images) do not offer the correct
  13348. // Javascript Object interface; specifically, they lack the propertyIsEnumerable method.
  13349. // And the item property while it does exist is not typeof "function"
  13350. if (!value.propertyIsEnumerable) {
  13351. return !!value.item;
  13352. }
  13353. // If it is a regular, interrogatable JS object (not an IE ActiveX object), then...
  13354. // If it has its own property called "length", but not enumerable, it's iterable
  13355. if (value.hasOwnProperty('length') && !value.propertyIsEnumerable('length')) {
  13356. return true;
  13357. }
  13358. // Test against whitelist which includes known iterable collection types
  13359. return iterableRe.test(toString.call(value));
  13360. },
  13361. /**
  13362. * This method returns `true` if debug is enabled for the specified class. This is
  13363. * done by checking the `Ext.debugConfig.hooks` config for the closest match to the
  13364. * given `className`.
  13365. * @param {String} className The name of the class.
  13366. * @return {Boolean} `true` if debug is enabled for the specified class.
  13367. * @method
  13368. */
  13369. isDebugEnabled: function(className, defaultEnabled) {
  13370. var debugConfig = Ext.debugConfig.hooks;
  13371. if (debugConfig.hasOwnProperty(className)) {
  13372. return debugConfig[className];
  13373. }
  13374. var enabled = debugConfig['*'],
  13375. prefixLength = 0;
  13376. if (defaultEnabled !== undefined) {
  13377. enabled = defaultEnabled;
  13378. }
  13379. if (!className) {
  13380. return enabled;
  13381. }
  13382. for (var prefix in debugConfig) {
  13383. var value = debugConfig[prefix];
  13384. // if prefix=='Ext' match 'Ext.foo.Bar' but not 'Ext4.foo.Bar'
  13385. if (className.charAt(prefix.length) === '.') {
  13386. if (className.substring(0, prefix.length) === prefix) {
  13387. if (prefixLength < prefix.length) {
  13388. prefixLength = prefix.length;
  13389. enabled = value;
  13390. }
  13391. }
  13392. }
  13393. }
  13394. return enabled;
  13395. } || emptyFn,
  13396. /**
  13397. * Clone simple variables including array, {}-like objects, DOM nodes and Date without keeping the old reference.
  13398. * A reference for the object itself is returned if it's not a direct descendant of Object. For model cloning,
  13399. * see {@link Ext.data.Model#copy Model.copy}.
  13400. *
  13401. * @param {Object} item The variable to clone
  13402. * @param {Boolean} [cloneDom=true] `true` to clone DOM nodes.
  13403. * @return {Object} clone
  13404. */
  13405. clone: function(item, cloneDom) {
  13406. if (item == null) {
  13407. return item;
  13408. }
  13409. // DOM nodes
  13410. // TODO proxy this to Ext.Element.clone to handle automatic id attribute changing
  13411. // recursively
  13412. if (cloneDom !== false && item.nodeType && item.cloneNode) {
  13413. return item.cloneNode(true);
  13414. }
  13415. var type = toString.call(item),
  13416. i, j, k, clone, key;
  13417. // Date
  13418. if (type === '[object Date]') {
  13419. return new Date(item.getTime());
  13420. }
  13421. // Array
  13422. if (type === '[object Array]') {
  13423. i = item.length;
  13424. clone = [];
  13425. while (i--) {
  13426. clone[i] = Ext.clone(item[i], cloneDom);
  13427. }
  13428. }
  13429. // Object
  13430. else if (type === '[object Object]' && item.constructor === Object) {
  13431. clone = {};
  13432. for (key in item) {
  13433. clone[key] = Ext.clone(item[key], cloneDom);
  13434. }
  13435. if (enumerables) {
  13436. for (j = enumerables.length; j--; ) {
  13437. k = enumerables[j];
  13438. if (item.hasOwnProperty(k)) {
  13439. clone[k] = item[k];
  13440. }
  13441. }
  13442. }
  13443. }
  13444. return clone || item;
  13445. },
  13446. /**
  13447. * @private
  13448. * Generate a unique reference of Ext in the global scope, useful for sandboxing
  13449. */
  13450. getUniqueGlobalNamespace: function() {
  13451. var uniqueGlobalNamespace = this.uniqueGlobalNamespace,
  13452. i;
  13453. if (uniqueGlobalNamespace === undefined) {
  13454. i = 0;
  13455. do {
  13456. uniqueGlobalNamespace = 'ExtBox' + (++i);
  13457. } while (global[uniqueGlobalNamespace] !== undefined);
  13458. global[uniqueGlobalNamespace] = Ext;
  13459. this.uniqueGlobalNamespace = uniqueGlobalNamespace;
  13460. }
  13461. return uniqueGlobalNamespace;
  13462. },
  13463. /**
  13464. * @private
  13465. */
  13466. functionFactoryCache: {},
  13467. cacheableFunctionFactory: function() {
  13468. var me = this,
  13469. args = Array.prototype.slice.call(arguments),
  13470. cache = me.functionFactoryCache,
  13471. idx, fn, ln;
  13472. if (Ext.isSandboxed) {
  13473. ln = args.length;
  13474. if (ln > 0) {
  13475. ln--;
  13476. args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
  13477. }
  13478. }
  13479. idx = args.join('');
  13480. fn = cache[idx];
  13481. if (!fn) {
  13482. fn = Function.prototype.constructor.apply(Function.prototype, args);
  13483. cache[idx] = fn;
  13484. }
  13485. return fn;
  13486. },
  13487. functionFactory: function() {
  13488. var args = Array.prototype.slice.call(arguments),
  13489. ln;
  13490. if (Ext.isSandboxed) {
  13491. ln = args.length;
  13492. if (ln > 0) {
  13493. ln--;
  13494. args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
  13495. }
  13496. }
  13497. return Function.prototype.constructor.apply(Function.prototype, args);
  13498. },
  13499. /**
  13500. * @private
  13501. */
  13502. Logger: {
  13503. log: function(message, priority) {
  13504. if (message && global.console) {
  13505. if (!priority || !(priority in global.console)) {
  13506. priority = 'log';
  13507. }
  13508. message = '[' + priority.toUpperCase() + '] ' + message;
  13509. global.console[priority](message);
  13510. }
  13511. },
  13512. verbose: function(message) {
  13513. this.log(message, 'verbose');
  13514. },
  13515. info: function(message) {
  13516. this.log(message, 'info');
  13517. },
  13518. warn: function(message) {
  13519. this.log(message, 'warn');
  13520. },
  13521. error: function(message) {
  13522. throw new Error(message);
  13523. },
  13524. deprecate: function(message) {
  13525. this.log(message, 'warn');
  13526. }
  13527. } || {
  13528. verbose: emptyFn,
  13529. log: emptyFn,
  13530. info: emptyFn,
  13531. warn: emptyFn,
  13532. error: function(message) {
  13533. throw new Error(message);
  13534. },
  13535. deprecate: emptyFn
  13536. },
  13537. ariaWarn: function(target, msg) {
  13538. // The checks still can be disabled by setting Ext.enableAria to false;
  13539. // this is for backwards compatibility. Also make sure we're not running
  13540. // under the slicer, warnings are pointless in that case.
  13541. if (Ext.enableAria && !Ext.slicer) {
  13542. if (!Ext.ariaWarn.first) {
  13543. Ext.ariaWarn.first = true;
  13544. Ext.log.warn("WAI-ARIA compatibility warnings can be suppressed " + "by adding the following to application startup code:");
  13545. Ext.log.warn(" Ext.ariaWarn = Ext.emptyFn;");
  13546. }
  13547. Ext.log.warn({
  13548. msg: msg,
  13549. dump: target
  13550. });
  13551. }
  13552. },
  13553. /**
  13554. * @private
  13555. */
  13556. getElementById: function(id) {
  13557. return document.getElementById(id);
  13558. },
  13559. /**
  13560. * @member Ext
  13561. * @private
  13562. */
  13563. splitAndUnescape: (function() {
  13564. var cache = {};
  13565. return function(origin, delimiter) {
  13566. if (!origin) {
  13567. return [];
  13568. } else if (!delimiter) {
  13569. return [
  13570. origin
  13571. ];
  13572. }
  13573. var replaceRe = cache[delimiter] || (cache[delimiter] = new RegExp('\\\\' + delimiter, 'g')),
  13574. result = [],
  13575. parts, part;
  13576. parts = origin.split(delimiter);
  13577. while ((part = parts.shift()) !== undefined) {
  13578. // If any of the parts ends with the delimiter that means
  13579. // the delimiter was escaped and the split was invalid. Roll back.
  13580. while (part.charAt(part.length - 1) === '\\' && parts.length > 0) {
  13581. part = part + delimiter + parts.shift();
  13582. }
  13583. // Now that we have split the parts, unescape the delimiter char
  13584. part = part.replace(replaceRe, delimiter);
  13585. result.push(part);
  13586. }
  13587. return result;
  13588. };
  13589. })(),
  13590. /**
  13591. * This is the target of the user-supplied `Ext.elevateFunction`. It wraps the
  13592. * call to a function and concludes by calling {@link Ext#fireIdle}.
  13593. * @since 6.5.1
  13594. * @private
  13595. */
  13596. doElevate: function() {
  13597. var fn = elevateFn,
  13598. args = elevateArgs,
  13599. scope = elevateScope;
  13600. // We really should never re-enter here, but we'll latch these vars just
  13601. // in case.
  13602. elevateFn = elevateArgs = elevateScope = null;
  13603. elevateRet = args ? fn.apply(scope, args) : fn.call(scope);
  13604. // Be sure to fire the idle event while elevated or its handlers will
  13605. // be running in an unprivileged context.
  13606. Ext.fireIdle();
  13607. },
  13608. /**
  13609. * Runs the given `fn` directly or using the user-provided `Ext.elevateFunction`
  13610. * (if present). After calling the `fn` the global `idle` event is fired using
  13611. * the {@link Ext#fireIdle} method.
  13612. *
  13613. * @param {Function} fn
  13614. * @param {Object} [scope]
  13615. * @param {Array} [args]
  13616. * @param {Object} [timer]
  13617. * @return {Mixed}
  13618. * @since 6.5.1
  13619. * @private
  13620. */
  13621. elevate: function(fn, scope, args, timer) {
  13622. var ret;
  13623. if (args && !args.length) {
  13624. args = null;
  13625. }
  13626. Ext._suppressIdle = false;
  13627. if (timer) {
  13628. timer.tick();
  13629. }
  13630. if (Ext.elevateFunction) {
  13631. elevateFn = fn;
  13632. elevateScope = scope;
  13633. elevateArgs = args;
  13634. // We reuse the same fn here to avoid GC pressure.
  13635. Ext.elevateFunction(Ext.doElevate);
  13636. ret = elevateRet;
  13637. elevateRet = null;
  13638. } else {
  13639. ret = args ? fn.apply(scope, args) : fn.call(scope);
  13640. Ext.fireIdle();
  13641. }
  13642. if (timer) {
  13643. timer.tock();
  13644. }
  13645. return ret;
  13646. },
  13647. Timer: {
  13648. all: {},
  13649. track: false,
  13650. captureStack: true,
  13651. created: function(kind, id, info) {
  13652. if (!Ext.Timer.track) {
  13653. return null;
  13654. }
  13655. var timer = Ext.apply({
  13656. kind: kind,
  13657. id: id,
  13658. done: false,
  13659. firing: false,
  13660. creator: Ext.Timer.captureStack ? new Error().stack : null,
  13661. tick: Ext.Timer.tick,
  13662. tock: Ext.Timer.tock
  13663. }, info);
  13664. var timers = Ext.Timer.all[kind] || (Ext.Timer.all[kind] = {});
  13665. timers[timer.id] = timer;
  13666. if (Ext.Timer.hook) {
  13667. Ext.Timer.hook(timer);
  13668. }
  13669. return timer;
  13670. },
  13671. get: function(id, kind) {
  13672. kind = kind || 'timeout';
  13673. var timers = Ext.Timer.all[kind];
  13674. return timers && timers[id] || null;
  13675. },
  13676. cancel: function(kind, id) {
  13677. var timers = Ext.Timer.all[kind];
  13678. var timer = timers && timers[id];
  13679. if (timer) {
  13680. timer.cancelled = true;
  13681. delete timers[id];
  13682. }
  13683. },
  13684. tick: function() {
  13685. if (Ext.Timer.firing) {
  13686. // One reason for Ext.Timer.firing to get stuck is exception thrown
  13687. // in timer handler. In that case the timer is never tock()ed
  13688. // and will be left hanging. Just clean it up.
  13689. Ext.log.error('Previous timer state not cleaned up properly: ' + Ext.Timer.firing.creator);
  13690. }
  13691. if (this.kind !== 'interval') {
  13692. this.done = true;
  13693. delete Ext.Timer.all[this.kind][this.id];
  13694. }
  13695. this.firing = true;
  13696. Ext.Timer.firing = this;
  13697. },
  13698. tock: function() {
  13699. this.firing = false;
  13700. if (Ext.Timer.firing === this) {
  13701. Ext.Timer.firing = null;
  13702. }
  13703. }
  13704. },
  13705. /**
  13706. * @private
  13707. */
  13708. getExpando: function(target, id) {
  13709. var expandos = target.$expandos;
  13710. return expandos && expandos[id] || null;
  13711. },
  13712. /**
  13713. * @private
  13714. */
  13715. setExpando: function(target, id, value) {
  13716. var expandos = target.$expandos;
  13717. if (value !== undefined) {
  13718. (expandos || (target.$expandos = {}))[id] = value;
  13719. } else if (expandos) {
  13720. delete expandos[id];
  13721. }
  13722. }
  13723. });
  13724. // Ext.apply(Ext
  13725. Ext.returnTrue.$nullFn = Ext.returnId.$nullFn = true;
  13726. }());
  13727. // @override Ext
  13728. // This file is order extremely early (typically right after Ext.js) due to the
  13729. // above Cmd directive. This ensures that the "modern" and "classic" platform tags
  13730. // are properly set up as soon as possible.
  13731. Ext.platformTags.modern = !(Ext.platformTags.classic = Ext.isClassic = true);
  13732. /**
  13733. * A helper class for the native JavaScript Error object that adds a few useful capabilities for handling
  13734. * errors in an application. When you use Ext.Error to {@link #raise} an error from within any class that
  13735. * uses the Class System, the Error class can automatically add the source class and method from which
  13736. * the error was raised. It also includes logic to automatically log the error to the console, if available,
  13737. * with additional metadata about the error. In all cases, the error will always be thrown at the end so that
  13738. * execution will halt.
  13739. *
  13740. * Ext.Error also offers a global error {@link #handle handling} method that can be overridden in order to
  13741. * handle application-wide errors in a single spot. You can optionally {@link #ignore} errors altogether,
  13742. * although in a real application it's usually a better idea to override the handling function and perform
  13743. * logging or some other method of reporting the errors in a way that is meaningful to the application.
  13744. *
  13745. * At its simplest you can simply raise an error as a simple string from within any code:
  13746. *
  13747. * Example usage:
  13748. *
  13749. * Ext.raise('Something bad happened!');
  13750. *
  13751. * If raised from plain JavaScript code, the error will be logged to the console (if available) and the message
  13752. * displayed. In most cases however you'll be raising errors from within a class, and it may often be useful to add
  13753. * additional metadata about the error being raised. The {@link #raise} method can also take a config object.
  13754. * In this form the `msg` attribute becomes the error description, and any other data added to the config gets
  13755. * added to the error object and, if the console is available, logged to the console for inspection.
  13756. *
  13757. * Example usage:
  13758. *
  13759. * Ext.define('Ext.Foo', {
  13760. * doSomething: function(option){
  13761. * if (someCondition === false) {
  13762. * Ext.raise({
  13763. * msg: 'You cannot do that!',
  13764. * option: option, // whatever was passed into the method
  13765. * 'error code': 100 // other arbitrary info
  13766. * });
  13767. * }
  13768. * }
  13769. * });
  13770. *
  13771. * If a console is available (that supports the `console.dir` function) you'll see console output like:
  13772. *
  13773. * An error was raised with the following data:
  13774. * option: Object { foo: "bar"}
  13775. * foo: "bar"
  13776. * error code: 100
  13777. * msg: "You cannot do that!"
  13778. * sourceClass: "Ext.Foo"
  13779. * sourceMethod: "doSomething"
  13780. *
  13781. * uncaught exception: You cannot do that!
  13782. *
  13783. * As you can see, the error will report exactly where it was raised and will include as much information as the
  13784. * raising code can usefully provide.
  13785. *
  13786. * If you want to handle all application errors globally you can simply override the static {@link #handle} method
  13787. * and provide whatever handling logic you need. If the method returns true then the error is considered handled
  13788. * and will not be thrown to the browser. If anything but true is returned then the error will be thrown normally.
  13789. *
  13790. * Example usage:
  13791. *
  13792. * Ext.Error.handle = function(err) {
  13793. * if (err.someProperty == 'NotReallyAnError') {
  13794. * // maybe log something to the application here if applicable
  13795. * return true;
  13796. * }
  13797. * // any non-true return value (including none) will cause the error to be thrown
  13798. * }
  13799. *
  13800. * @class Ext.Error
  13801. */
  13802. (function() {
  13803. // @define Ext.lang.Error
  13804. // @define Ext.Error
  13805. // @require Ext
  13806. function toString() {
  13807. var me = this,
  13808. cls = me.sourceClass,
  13809. method = me.sourceMethod,
  13810. msg = me.msg;
  13811. if (method) {
  13812. if (msg) {
  13813. method += '(): ';
  13814. method += msg;
  13815. } else {
  13816. method += '()';
  13817. }
  13818. }
  13819. if (cls) {
  13820. method = method ? (cls + '.' + method) : cls;
  13821. }
  13822. return method || msg || '';
  13823. }
  13824. Ext.Error = function(config) {
  13825. if (Ext.isString(config)) {
  13826. config = {
  13827. msg: config
  13828. };
  13829. }
  13830. var error = new Error();
  13831. Ext.apply(error, config);
  13832. error.message = error.message || error.msg;
  13833. // 'message' is standard ('msg' is non-standard)
  13834. // note: the above does not work in old WebKit (me.message is readonly) (Safari 4)
  13835. error.toString = toString;
  13836. return error;
  13837. };
  13838. Ext.apply(Ext.Error, {
  13839. /**
  13840. * @property {Boolean} ignore
  13841. * Static flag that can be used to globally disable error reporting to the browser if set to true
  13842. * (defaults to false). Note that if you ignore Ext errors it's likely that some other code may fail
  13843. * and throw a native JavaScript error thereafter, so use with caution. In most cases it will probably
  13844. * be preferable to supply a custom error {@link #handle handling} function instead.
  13845. *
  13846. * Example usage:
  13847. *
  13848. * Ext.Error.ignore = true;
  13849. *
  13850. * @static
  13851. */
  13852. ignore: false,
  13853. /**
  13854. * This method is called internally by {@link Ext#raise}. Application code should
  13855. * call {@link Ext#raise} instead of calling this method directly.
  13856. *
  13857. * @static
  13858. * @deprecated 6.0.0 Use {@link Ext#raise} instead.
  13859. */
  13860. raise: function(err) {
  13861. err = err || {};
  13862. if (Ext.isString(err)) {
  13863. err = {
  13864. msg: err
  13865. };
  13866. }
  13867. var me = this,
  13868. method = me.raise.caller,
  13869. msg, name;
  13870. if (method === Ext.raise) {
  13871. method = method.caller;
  13872. }
  13873. if (method) {
  13874. if (!err.sourceMethod && (name = method.$name)) {
  13875. err.sourceMethod = name;
  13876. }
  13877. if (!err.sourceClass && (name = method.$owner) && (name = name.$className)) {
  13878. err.sourceClass = name;
  13879. }
  13880. }
  13881. if (me.handle(err) !== true) {
  13882. msg = toString.call(err);
  13883. Ext.log({
  13884. msg: msg,
  13885. level: 'error',
  13886. dump: err,
  13887. stack: true
  13888. });
  13889. throw new Ext.Error(err);
  13890. }
  13891. },
  13892. /**
  13893. * Globally handle any Ext errors that may be raised, optionally providing custom logic to
  13894. * handle different errors individually. Return true from the function to bypass throwing the
  13895. * error to the browser, otherwise the error will be thrown and execution will halt.
  13896. *
  13897. * Example usage:
  13898. *
  13899. * Ext.Error.handle = function(err) {
  13900. * if (err.someProperty == 'NotReallyAnError') {
  13901. * // maybe log something to the application here if applicable
  13902. * return true;
  13903. * }
  13904. * // any non-true return value (including none) will cause the error to be thrown
  13905. * }
  13906. *
  13907. * @param {Object} err The error being raised. It will contain any attributes that were originally
  13908. * raised with it, plus properties about the method and class from which the error originated
  13909. * (if raised from a class that uses the Class System).
  13910. * @static
  13911. */
  13912. handle: function() {
  13913. return this.ignore;
  13914. }
  13915. });
  13916. })();
  13917. /**
  13918. * Create a function that will throw an error if called (in debug mode) with a message that
  13919. * indicates the method has been removed.
  13920. * @param {String} suggestion Optional text to include in the message (a workaround perhaps).
  13921. * @return {Function} The generated function.
  13922. * @private
  13923. */
  13924. Ext.deprecated = function(suggestion) {
  13925. if (!suggestion) {
  13926. suggestion = '';
  13927. }
  13928. function fail() {
  13929. Ext.raise('The method "' + fail.$owner.$className + '.' + fail.$name + '" has been removed. ' + suggestion);
  13930. }
  13931. return fail;
  13932. return Ext.emptyFn;
  13933. };
  13934. /**
  13935. * Raise an error that can include additional data and supports automatic console logging
  13936. * if available. You can pass a string error message or an object with the `msg` attribute
  13937. * which will be used as the error message. The object can contain any other name-value
  13938. * attributes (or objects) to be logged along with the error.
  13939. *
  13940. * Note that after displaying the error message a JavaScript error will ultimately be
  13941. * thrown so that execution will halt.
  13942. *
  13943. * Example usage:
  13944. *
  13945. * Ext.raise('A simple string error message');
  13946. *
  13947. * // or...
  13948. *
  13949. * Ext.define('Ext.Foo', {
  13950. * doSomething: function(option){
  13951. * if (someCondition === false) {
  13952. * Ext.raise({
  13953. * msg: 'You cannot do that!',
  13954. * option: option, // whatever was passed into the method
  13955. * code: 100 // other arbitrary info
  13956. * });
  13957. * }
  13958. * }
  13959. * });
  13960. *
  13961. * @param {String/Object} err The error message string, or an object containing the
  13962. * attribute "msg" that will be used as the error message. Any other data included in the
  13963. * object will also be logged to the browser console, if available.
  13964. * @method raise
  13965. * @member Ext
  13966. */
  13967. Ext.raise = function() {
  13968. Ext.Error.raise.apply(Ext.Error, arguments);
  13969. };
  13970. /*
  13971. * This mechanism is used to notify the user of the first error encountered on the page. In
  13972. * most cases errors go unobserved especially on IE. This mechanism pushes this information
  13973. * to the status bar so that users don't miss it.
  13974. */
  13975. (function(skipNotify) {
  13976. if (skipNotify || typeof window === 'undefined') {
  13977. return;
  13978. }
  13979. // build system or some such environment...
  13980. var last = 0,
  13981. // This method is called to notify the user of the current error status.
  13982. notify = function() {
  13983. var cnt = Ext.log && Ext.log.counters,
  13984. n = cnt && (cnt.error + cnt.warn + cnt.info + cnt.log),
  13985. msg;
  13986. // Put log counters to the status bar (for most browsers):
  13987. if (n && last !== n) {
  13988. msg = [];
  13989. if (cnt.error) {
  13990. msg.push('Errors: ' + cnt.error);
  13991. }
  13992. if (cnt.warn) {
  13993. msg.push('Warnings: ' + cnt.warn);
  13994. }
  13995. if (cnt.info) {
  13996. msg.push('Info: ' + cnt.info);
  13997. }
  13998. if (cnt.log) {
  13999. msg.push('Log: ' + cnt.log);
  14000. }
  14001. window.status = '*** ' + msg.join(' -- ');
  14002. last = n;
  14003. }
  14004. };
  14005. // Allow unit tests to skip this when checking for dangling timers
  14006. notify.$skipTimerCheck = true;
  14007. // window.onerror sounds ideal but it prevents the built-in error dialog from doing
  14008. // its (better) thing. We deliberately use setInterval() here instead of going with
  14009. // Ext.interval() to keep it basic and simple.
  14010. setInterval(notify, 1000);
  14011. }(!!window.__UNIT_TESTING__));
  14012. /**
  14013. * @class Ext.Array
  14014. * @singleton
  14015. *
  14016. * A set of useful static methods to deal with arrays; provide missing methods for
  14017. * older browsers.
  14018. */
  14019. Ext.Array = (function() {
  14020. // @define Ext.lang.Array
  14021. // @define Ext.Array
  14022. // @require Ext
  14023. // @require Ext.lang.Error
  14024. var arrayPrototype = Array.prototype,
  14025. slice = arrayPrototype.slice,
  14026. supportsSplice = (function() {
  14027. var array = [],
  14028. lengthBefore,
  14029. j = 20;
  14030. if (!array.splice) {
  14031. return false;
  14032. }
  14033. // This detects a bug in IE8 splice method:
  14034. // see http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/6e946d03-e09f-4b22-a4dd-cd5e276bf05a/
  14035. while (j--) {
  14036. array.push("A");
  14037. }
  14038. array.splice(15, 0, "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F");
  14039. lengthBefore = array.length;
  14040. //41
  14041. array.splice(13, 0, "XXX");
  14042. // add one element
  14043. if (lengthBefore + 1 !== array.length) {
  14044. return false;
  14045. }
  14046. // end IE8 bug
  14047. return true;
  14048. }()),
  14049. supportsIndexOf = 'indexOf' in arrayPrototype,
  14050. supportsSliceOnNodeList = true;
  14051. // Sort an array using the comparator, but if the comparator returns zero, use the objects' original indices to tiebreak
  14052. // This results in a stable sort.
  14053. function stableSort(array, userComparator) {
  14054. var len = array.length,
  14055. indices = new Array(len),
  14056. i;
  14057. // generate 0-n index map from original array
  14058. for (i = 0; i < len; i++) {
  14059. indices[i] = i;
  14060. }
  14061. // Sort indices array using a comparator which compares the original values at the two indices, and uses those indices as a tiebreaker
  14062. indices.sort(function(index1, index2) {
  14063. return userComparator(array[index1], array[index2]) || (index1 - index2);
  14064. });
  14065. // Reconsitute a sorted array using the array that the indices have been sorted into
  14066. for (i = 0; i < len; i++) {
  14067. indices[i] = array[indices[i]];
  14068. }
  14069. // Rebuild the original array
  14070. for (i = 0; i < len; i++) {
  14071. array[i] = indices[i];
  14072. }
  14073. return array;
  14074. }
  14075. try {
  14076. // IE 6 - 8 will throw an error when using Array.prototype.slice on NodeList
  14077. if (typeof document !== 'undefined') {
  14078. slice.call(document.getElementsByTagName('body'));
  14079. }
  14080. } catch (e) {
  14081. supportsSliceOnNodeList = false;
  14082. }
  14083. var fixArrayIndex = function(array, index) {
  14084. return (index < 0) ? Math.max(0, array.length + index) : Math.min(array.length, index);
  14085. },
  14086. /*
  14087. Does the same work as splice, but with a slightly more convenient signature. The splice
  14088. method has bugs in IE8, so this is the implementation we use on that platform.
  14089. The rippling of items in the array can be tricky. Consider two use cases:
  14090. index=2
  14091. removeCount=2
  14092. /=====\
  14093. +---+---+---+---+---+---+---+---+
  14094. | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
  14095. +---+---+---+---+---+---+---+---+
  14096. / \/ \/ \/ \
  14097. / /\ /\ /\ \
  14098. / / \/ \/ \ +--------------------------+
  14099. / / /\ /\ +--------------------------+ \
  14100. / / / \/ +--------------------------+ \ \
  14101. / / / /+--------------------------+ \ \ \
  14102. / / / / \ \ \ \
  14103. v v v v v v v v
  14104. +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
  14105. | 0 | 1 | 4 | 5 | 6 | 7 | | 0 | 1 | a | b | c | 4 | 5 | 6 | 7 |
  14106. +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
  14107. A B \=========/
  14108. insert=[a,b,c]
  14109. In case A, it is obvious that copying of [4,5,6,7] must be left-to-right so
  14110. that we don't end up with [0,1,6,7,6,7]. In case B, we have the opposite; we
  14111. must go right-to-left or else we would end up with [0,1,a,b,c,4,4,4,4].
  14112. */
  14113. replaceSim = function(array, index, removeCount, insert) {
  14114. var add = insert ? insert.length : 0,
  14115. length = array.length,
  14116. pos = fixArrayIndex(array, index);
  14117. // we try to use Array.push when we can for efficiency...
  14118. if (pos === length) {
  14119. if (add) {
  14120. array.push.apply(array, insert);
  14121. }
  14122. } else {
  14123. var remove = Math.min(removeCount, length - pos),
  14124. tailOldPos = pos + remove,
  14125. tailNewPos = tailOldPos + add - remove,
  14126. tailCount = length - tailOldPos,
  14127. lengthAfterRemove = length - remove,
  14128. i;
  14129. if (tailNewPos < tailOldPos) {
  14130. // case A
  14131. for (i = 0; i < tailCount; ++i) {
  14132. array[tailNewPos + i] = array[tailOldPos + i];
  14133. }
  14134. } else if (tailNewPos > tailOldPos) {
  14135. // case B
  14136. for (i = tailCount; i--; ) {
  14137. array[tailNewPos + i] = array[tailOldPos + i];
  14138. }
  14139. }
  14140. // else, add == remove (nothing to do)
  14141. if (add && pos === lengthAfterRemove) {
  14142. array.length = lengthAfterRemove;
  14143. // truncate array
  14144. array.push.apply(array, insert);
  14145. } else {
  14146. array.length = lengthAfterRemove + add;
  14147. // reserves space
  14148. for (i = 0; i < add; ++i) {
  14149. array[pos + i] = insert[i];
  14150. }
  14151. }
  14152. }
  14153. return array;
  14154. },
  14155. replaceNative = function(array, index, removeCount, insert) {
  14156. if (insert && insert.length) {
  14157. // Inserting at index zero with no removing: use unshift
  14158. if (index === 0 && !removeCount) {
  14159. array.unshift.apply(array, insert);
  14160. }
  14161. // Inserting/replacing in middle of array
  14162. else if (index < array.length) {
  14163. array.splice.apply(array, [
  14164. index,
  14165. removeCount
  14166. ].concat(insert));
  14167. } else // Appending to array
  14168. {
  14169. array.push.apply(array, insert);
  14170. }
  14171. } else {
  14172. array.splice(index, removeCount);
  14173. }
  14174. return array;
  14175. },
  14176. eraseSim = function(array, index, removeCount) {
  14177. return replaceSim(array, index, removeCount);
  14178. },
  14179. eraseNative = function(array, index, removeCount) {
  14180. array.splice(index, removeCount);
  14181. return array;
  14182. },
  14183. spliceSim = function(array, index, removeCount) {
  14184. var len = arguments.length,
  14185. pos = fixArrayIndex(array, index),
  14186. removed;
  14187. if (len < 3) {
  14188. removeCount = array.length - pos;
  14189. }
  14190. removed = array.slice(index, fixArrayIndex(array, pos + removeCount));
  14191. if (len < 4) {
  14192. replaceSim(array, pos, removeCount);
  14193. } else {
  14194. replaceSim(array, pos, removeCount, slice.call(arguments, 3));
  14195. }
  14196. return removed;
  14197. },
  14198. spliceNative = function(array) {
  14199. return array.splice.apply(array, slice.call(arguments, 1));
  14200. },
  14201. erase = supportsSplice ? eraseNative : eraseSim,
  14202. replace = supportsSplice ? replaceNative : replaceSim,
  14203. splice = supportsSplice ? spliceNative : spliceSim,
  14204. // NOTE: from here on, use erase, replace or splice (not native methods)...
  14205. ExtArray = {
  14206. /**
  14207. * This method returns the index that a given item would be inserted into the
  14208. * given (sorted) `array`. Note that the given `item` may or may not be in the
  14209. * array. This method will return the index of where the item *should* be.
  14210. *
  14211. * For example:
  14212. *
  14213. * var array = [ 'A', 'D', 'G', 'K', 'O', 'R', 'X' ];
  14214. * var index = Ext.Array.binarySearch(array, 'E');
  14215. *
  14216. * console.log('index: ' + index);
  14217. * // logs "index: 2"
  14218. *
  14219. * array.splice(index, 0, 'E');
  14220. *
  14221. * console.log('array : ' + array.join(''));
  14222. * // logs "array: ADEGKORX"
  14223. *
  14224. * @param {Object[]} array The array to search.
  14225. * @param {Object} item The item that you want to insert into the `array`.
  14226. * @param {Number} [begin=0] The first index in the `array` to consider.
  14227. * @param {Number} [end=array.length] The index that marks the end of the range
  14228. * to consider. The item at this index is *not* considered.
  14229. * @param {Function} [compareFn] The comparison function that matches the sort
  14230. * order of the `array`. The default `compareFn` compares items using less-than
  14231. * and greater-than operators.
  14232. * @return {Number} The index for the given item in the given array based on
  14233. * the current sorters.
  14234. */
  14235. binarySearch: function(array, item, begin, end, compareFn) {
  14236. var length = array.length,
  14237. middle, comparison;
  14238. if (begin instanceof Function) {
  14239. compareFn = begin;
  14240. begin = 0;
  14241. end = length;
  14242. } else if (end instanceof Function) {
  14243. compareFn = end;
  14244. end = length;
  14245. } else {
  14246. if (begin === undefined) {
  14247. begin = 0;
  14248. }
  14249. if (end === undefined) {
  14250. end = length;
  14251. }
  14252. compareFn = compareFn || ExtArray.lexicalCompare;
  14253. }
  14254. --end;
  14255. while (begin <= end) {
  14256. middle = (begin + end) >> 1;
  14257. comparison = compareFn(item, array[middle]);
  14258. if (comparison >= 0) {
  14259. begin = middle + 1;
  14260. } else if (comparison < 0) {
  14261. end = middle - 1;
  14262. }
  14263. }
  14264. return begin;
  14265. },
  14266. defaultCompare: function(lhs, rhs) {
  14267. return (lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0);
  14268. },
  14269. // Default comparator to use when no comparator is specified for the sort method.
  14270. // Javascript sort does LEXICAL comparison.
  14271. lexicalCompare: function(lhs, rhs) {
  14272. lhs = String(lhs);
  14273. rhs = String(rhs);
  14274. return (lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0);
  14275. },
  14276. /**
  14277. * Iterates an array or an iterable value and invoke the given callback function for each item.
  14278. *
  14279. * var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'];
  14280. *
  14281. * Ext.Array.each(countries, function(name, index, countriesItSelf) {
  14282. * console.log(name);
  14283. * });
  14284. *
  14285. * var sum = function() {
  14286. * var sum = 0;
  14287. *
  14288. * Ext.Array.each(arguments, function(value) {
  14289. * sum += value;
  14290. * });
  14291. *
  14292. * return sum;
  14293. * };
  14294. *
  14295. * sum(1, 2, 3); // returns 6
  14296. *
  14297. * The iteration can be stopped by returning `false` from the callback function.
  14298. * Returning `undefined` (i.e `return;`) will only exit the callback function and
  14299. * proceed with the next iteration of the loop.
  14300. *
  14301. * Ext.Array.each(countries, function(name, index, countriesItSelf) {
  14302. * if (name === 'Singapore') {
  14303. * return false; // break here
  14304. * }
  14305. * });
  14306. *
  14307. * {@link Ext#each Ext.each} is alias for {@link Ext.Array#each Ext.Array.each}
  14308. *
  14309. * @param {Array/NodeList/Object} array The value to be iterated. If this
  14310. * argument is not iterable, the callback function is called once.
  14311. * @param {Function} fn The callback function. If it returns `false`, the iteration
  14312. * stops and this method returns the current `index`. Returning `undefined` (i.e
  14313. * `return;`) will only exit the callback function and proceed with the next iteration
  14314. * in the loop.
  14315. * @param {Object} fn.item The item at the current `index` in the passed `array`
  14316. * @param {Number} fn.index The current `index` within the `array`
  14317. * @param {Array} fn.allItems The `array` itself which was passed as the first argument
  14318. * @param {Boolean} fn.return Return `false` to stop iteration.
  14319. * @param {Object} [scope] The scope (`this` reference) in which the specified function is executed.
  14320. * @param {Boolean} [reverse=false] Reverse the iteration order (loop from the end to the beginning).
  14321. * @return {Boolean/Number} If all array entries were iterated, this will be `true. If
  14322. * iteration was halted early because the passed fuction returned `false`, this will
  14323. * be the index at which iteration was halted.
  14324. */
  14325. each: function(array, fn, scope, reverse) {
  14326. array = ExtArray.from(array);
  14327. var i,
  14328. ln = array.length;
  14329. if (reverse !== true) {
  14330. for (i = 0; i < ln; i++) {
  14331. if (fn.call(scope || array[i], array[i], i, array) === false) {
  14332. return i;
  14333. }
  14334. }
  14335. } else {
  14336. for (i = ln - 1; i > -1; i--) {
  14337. if (fn.call(scope || array[i], array[i], i, array) === false) {
  14338. return i;
  14339. }
  14340. }
  14341. }
  14342. return true;
  14343. },
  14344. /*
  14345. * Calculates the the insertion index of a passed object into the passed Array according
  14346. * to the passed comparator function. Note that the passed Array *MUST* already be ordered.
  14347. * @param {Object} item The item to calculate the insertion index for.
  14348. * @param {Array} The array into which the item is to be inserted.
  14349. * @param {Function} comparatorFn The comparison function. Must return -1 or 0 or 1.
  14350. * @param {Object} comparatorFn.lhs The left object to compare.
  14351. * @param {Object} comparatorFn.rhs The right object to compare.
  14352. * @param {Number} index The possible correct index to try first before a binary
  14353. * search is instigated.
  14354. */
  14355. findInsertionIndex: function(item, items, comparatorFn, index) {
  14356. var len = items.length,
  14357. beforeCheck, afterCheck;
  14358. comparatorFn = comparatorFn || ExtArray.lexicalCompare;
  14359. if (index < len) {
  14360. beforeCheck = index > 0 ? comparatorFn(items[index - 1], item) : 0;
  14361. afterCheck = index < len - 1 ? comparatorFn(item, items[index]) : 0;
  14362. if (beforeCheck < 1 && afterCheck < 1) {
  14363. return index;
  14364. }
  14365. }
  14366. return ExtArray.binarySearch(items, item, comparatorFn);
  14367. },
  14368. /**
  14369. * @method
  14370. * Iterates an array and invoke the given callback function for each item. Note that this will simply
  14371. * delegate to the native `Array.prototype.forEach` method if supported. It doesn't support stopping the
  14372. * iteration by returning `false` in the callback function like {@link Ext.Array#each}. However, performance
  14373. * could be much better in modern browsers comparing with {@link Ext.Array#each}
  14374. *
  14375. * @param {Array} array The array to iterate.
  14376. * @param {Function} fn The callback function.
  14377. * @param {Object} fn.item The item at the current `index` in the passed `array`.
  14378. * @param {Number} fn.index The current `index` within the `array`.
  14379. * @param {Array} fn.allItems The `array` itself which was passed as the first argument.
  14380. * @param {Object} scope (Optional) The execution scope (`this`) in which the
  14381. * specified function is executed.
  14382. */
  14383. forEach: ('forEach' in arrayPrototype) ? function(array, fn, scope) {
  14384. array.forEach(fn, scope);
  14385. } : function(array, fn, scope) {
  14386. for (var i = 0,
  14387. ln = array.length; i < ln; i++) {
  14388. fn.call(scope, array[i], i, array);
  14389. }
  14390. },
  14391. /**
  14392. * @method
  14393. * Get the index of the provided `item` in the given `array`, a supplement for the
  14394. * missing arrayPrototype.indexOf in Internet Explorer.
  14395. *
  14396. * @param {Array} array The array to check.
  14397. * @param {Object} item The item to find.
  14398. * @param {Number} from (Optional) The index at which to begin the search.
  14399. * @return {Number} The index of item in the array (or -1 if it is not found).
  14400. */
  14401. indexOf: supportsIndexOf ? function(array, item, from) {
  14402. // May be called with no array which causes an error.
  14403. return array ? arrayPrototype.indexOf.call(array, item, from) : -1;
  14404. } : function(array, item, from) {
  14405. var i,
  14406. length = array ? array.length : 0;
  14407. for (i = (from < 0) ? Math.max(0, length + from) : from || 0; i < length; i++) {
  14408. if (array[i] === item) {
  14409. return i;
  14410. }
  14411. }
  14412. return -1;
  14413. },
  14414. /**
  14415. * @method
  14416. * Checks whether or not the given `array` contains the specified `item`.
  14417. *
  14418. * @param {Array} array The array to check.
  14419. * @param {Object} item The item to find.
  14420. * @return {Boolean} `true` if the array contains the item, `false` otherwise.
  14421. */
  14422. contains: supportsIndexOf ? function(array, item) {
  14423. return arrayPrototype.indexOf.call(array, item) !== -1;
  14424. } : function(array, item) {
  14425. var i, ln;
  14426. for (i = 0 , ln = array.length; i < ln; i++) {
  14427. if (array[i] === item) {
  14428. return true;
  14429. }
  14430. }
  14431. return false;
  14432. },
  14433. /**
  14434. * Converts any iterable (numeric indices and a length property) into a true array.
  14435. *
  14436. * function test() {
  14437. * var args = Ext.Array.toArray(arguments),
  14438. * fromSecondToLastArgs = Ext.Array.toArray(arguments, 1);
  14439. *
  14440. * alert(args.join(' '));
  14441. * alert(fromSecondToLastArgs.join(' '));
  14442. * }
  14443. *
  14444. * test('just', 'testing', 'here'); // alerts 'just testing here';
  14445. * // alerts 'testing here';
  14446. *
  14447. * Ext.Array.toArray(document.getElementsByTagName('div')); // will convert the NodeList into an array
  14448. * Ext.Array.toArray('splitted'); // returns ['s', 'p', 'l', 'i', 't', 't', 'e', 'd']
  14449. * Ext.Array.toArray('splitted', 0, 3); // returns ['s', 'p', 'l']
  14450. *
  14451. * {@link Ext#toArray Ext.toArray} is alias for {@link Ext.Array#toArray Ext.Array.toArray}
  14452. *
  14453. * @param {Object} iterable the iterable object to be turned into a true Array.
  14454. * @param {Number} [start=0] a zero-based index that specifies the start of extraction.
  14455. * @param {Number} [end=-1] a 1-based index that specifies the end of extraction.
  14456. * @return {Array}
  14457. */
  14458. toArray: function(iterable, start, end) {
  14459. if (!iterable || !iterable.length) {
  14460. return [];
  14461. }
  14462. if (typeof iterable === 'string') {
  14463. iterable = iterable.split('');
  14464. }
  14465. if (supportsSliceOnNodeList) {
  14466. return slice.call(iterable, start || 0, end || iterable.length);
  14467. }
  14468. var array = [],
  14469. i;
  14470. start = start || 0;
  14471. end = end ? ((end < 0) ? iterable.length + end : end) : iterable.length;
  14472. for (i = start; i < end; i++) {
  14473. array.push(iterable[i]);
  14474. }
  14475. return array;
  14476. },
  14477. /**
  14478. * Plucks the value of a property from each item in the Array. Example:
  14479. *
  14480. * Ext.Array.pluck(Ext.query("p"), "className"); // [el1.className, el2.className, ..., elN.className]
  14481. *
  14482. * @param {Array/NodeList} array The Array of items to pluck the value from.
  14483. * @param {String} propertyName The property name to pluck from each element.
  14484. * @return {Array} The value from each item in the Array.
  14485. */
  14486. pluck: function(array, propertyName) {
  14487. var ret = [],
  14488. i, ln, item;
  14489. for (i = 0 , ln = array.length; i < ln; i++) {
  14490. item = array[i];
  14491. ret.push(item[propertyName]);
  14492. }
  14493. return ret;
  14494. },
  14495. /**
  14496. * @method
  14497. * Creates a new array with the results of calling a provided function on every element in this array.
  14498. *
  14499. * @param {Array} array
  14500. * @param {Function} fn Callback function for each item.
  14501. * @param {Mixed} fn.item Current item.
  14502. * @param {Number} fn.index Index of the item.
  14503. * @param {Array} fn.array The whole array that's being iterated.
  14504. * @param {Object} [scope] Callback function scope
  14505. * @return {Array} results
  14506. */
  14507. map: ('map' in arrayPrototype) ? function(array, fn, scope) {
  14508. Ext.Assert.isFunction(fn, 'Ext.Array.map must have a callback function passed as second argument.');
  14509. return array.map(fn, scope);
  14510. } : function(array, fn, scope) {
  14511. Ext.Assert.isFunction(fn, 'Ext.Array.map must have a callback function passed as second argument.');
  14512. var len = array.length,
  14513. results = new Array(len),
  14514. i;
  14515. for (i = 0; i < len; i++) {
  14516. results[i] = fn.call(scope, array[i], i, array);
  14517. }
  14518. return results;
  14519. },
  14520. /**
  14521. * @method
  14522. * Executes the specified function for each array element until the function returns a falsy value.
  14523. * If such an item is found, the function will return `false` immediately.
  14524. * Otherwise, it will return `true`.
  14525. *
  14526. * @param {Array} array
  14527. * @param {Function} fn Callback function for each item.
  14528. * @param {Mixed} fn.item Current item.
  14529. * @param {Number} fn.index Index of the item.
  14530. * @param {Array} fn.array The whole array that's being iterated.
  14531. * @param {Object} scope Callback function scope.
  14532. * @return {Boolean} `true` if no false value is returned by the callback function.
  14533. */
  14534. every: ('every' in arrayPrototype) ? function(array, fn, scope) {
  14535. Ext.Assert.isFunction(fn, 'Ext.Array.every must have a callback function passed as second argument.');
  14536. return array.every(fn, scope);
  14537. } : function(array, fn, scope) {
  14538. Ext.Assert.isFunction(fn, 'Ext.Array.every must have a callback function passed as second argument.');
  14539. var i = 0,
  14540. ln = array.length;
  14541. for (; i < ln; ++i) {
  14542. if (!fn.call(scope, array[i], i, array)) {
  14543. return false;
  14544. }
  14545. }
  14546. return true;
  14547. },
  14548. /**
  14549. * @method
  14550. * Executes the specified function for each array element until the function returns a truthy value.
  14551. * If such an item is found, the function will return `true` immediately. Otherwise, it will return `false`.
  14552. *
  14553. * @param {Array} array
  14554. * @param {Function} fn Callback function for each item.
  14555. * @param {Mixed} fn.item Current item.
  14556. * @param {Number} fn.index Index of the item.
  14557. * @param {Array} fn.array The whole array that's being iterated.
  14558. * @param {Object} scope Callback function scope.
  14559. * @return {Boolean} `true` if the callback function returns a truthy value.
  14560. */
  14561. some: ('some' in arrayPrototype) ? function(array, fn, scope) {
  14562. Ext.Assert.isFunction(fn, 'Ext.Array.some must have a callback function passed as second argument.');
  14563. return array.some(fn, scope);
  14564. } : function(array, fn, scope) {
  14565. Ext.Assert.isFunction(fn, 'Ext.Array.some must have a callback function passed as second argument.');
  14566. var i = 0,
  14567. ln = array.length;
  14568. for (; i < ln; ++i) {
  14569. if (fn.call(scope, array[i], i, array)) {
  14570. return true;
  14571. }
  14572. }
  14573. return false;
  14574. },
  14575. /**
  14576. * Shallow compares the contents of 2 arrays using strict equality.
  14577. * @param {Array} array1
  14578. * @param {Array} array2
  14579. * @return {Boolean} `true` if the arrays are equal.
  14580. */
  14581. equals: function(array1, array2) {
  14582. var len1 = array1.length,
  14583. len2 = array2.length,
  14584. i;
  14585. // Short circuit if the same array is passed twice
  14586. if (array1 === array2) {
  14587. return true;
  14588. }
  14589. if (len1 !== len2) {
  14590. return false;
  14591. }
  14592. for (i = 0; i < len1; ++i) {
  14593. if (array1[i] !== array2[i]) {
  14594. return false;
  14595. }
  14596. }
  14597. return true;
  14598. },
  14599. /**
  14600. * Filter through an array and remove empty item as defined in {@link Ext#isEmpty Ext.isEmpty}.
  14601. *
  14602. * See {@link Ext.Array#filter}
  14603. *
  14604. * @param {Array} array
  14605. * @return {Array} results
  14606. */
  14607. clean: function(array) {
  14608. var results = [],
  14609. i = 0,
  14610. ln = array.length,
  14611. item;
  14612. for (; i < ln; i++) {
  14613. item = array[i];
  14614. if (!Ext.isEmpty(item)) {
  14615. results.push(item);
  14616. }
  14617. }
  14618. return results;
  14619. },
  14620. /**
  14621. * Returns a new array with unique items.
  14622. *
  14623. * @param {Array} array
  14624. * @return {Array} results
  14625. */
  14626. unique: function(array) {
  14627. var clone = [],
  14628. i = 0,
  14629. ln = array.length,
  14630. item;
  14631. for (; i < ln; i++) {
  14632. item = array[i];
  14633. if (ExtArray.indexOf(clone, item) === -1) {
  14634. clone.push(item);
  14635. }
  14636. }
  14637. return clone;
  14638. },
  14639. /**
  14640. * @method
  14641. * Creates a new array with all of the elements of this array for which
  14642. * the provided filtering function returns a truthy value.
  14643. *
  14644. * @param {Array} array
  14645. * @param {Function} fn Callback function for each item.
  14646. * @param {Mixed} fn.item Current item.
  14647. * @param {Number} fn.index Index of the item.
  14648. * @param {Array} fn.array The whole array that's being iterated.
  14649. * @param {Object} scope Callback function scope.
  14650. * @return {Array} results
  14651. */
  14652. filter: ('filter' in arrayPrototype) ? function(array, fn, scope) {
  14653. Ext.Assert.isFunction(fn, 'Ext.Array.filter must have a filter function passed as second argument.');
  14654. return array.filter(fn, scope);
  14655. } : function(array, fn, scope) {
  14656. Ext.Assert.isFunction(fn, 'Ext.Array.filter must have a filter function passed as second argument.');
  14657. var results = [],
  14658. i = 0,
  14659. ln = array.length;
  14660. for (; i < ln; i++) {
  14661. if (fn.call(scope, array[i], i, array)) {
  14662. results.push(array[i]);
  14663. }
  14664. }
  14665. return results;
  14666. },
  14667. /**
  14668. * Returns the first item in the array which elicits a truthy return value from the
  14669. * passed selection function.
  14670. * @param {Array} array The array to search
  14671. * @param {Function} fn The selection function to execute for each item.
  14672. * @param {Mixed} fn.item The array item.
  14673. * @param {Number} fn.index The index of the array item.
  14674. * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the
  14675. * function is executed. Defaults to the array
  14676. * @return {Object} The first item in the array which returned true from the selection
  14677. * function, or null if none was found.
  14678. */
  14679. findBy: function(array, fn, scope) {
  14680. var i = 0,
  14681. len = array.length;
  14682. for (; i < len; i++) {
  14683. if (fn.call(scope || array, array[i], i)) {
  14684. return array[i];
  14685. }
  14686. }
  14687. return null;
  14688. },
  14689. /**
  14690. * Converts a value to an array if it's not already an array; returns:
  14691. *
  14692. * - An empty array if given value is `undefined` or `null`
  14693. * - Itself if given value is already an array
  14694. * - An array copy if given value is {@link Ext#isIterable iterable} (arguments, NodeList and alike)
  14695. * - An array with one item which is the given value, otherwise
  14696. *
  14697. * @param {Object} value The value to convert to an array if it's not already is an array.
  14698. * @param {Boolean} [newReference] `true` to clone the given array and return a new reference if necessary.
  14699. * @return {Array} array
  14700. */
  14701. from: function(value, newReference) {
  14702. if (value === undefined || value === null) {
  14703. return [];
  14704. }
  14705. if (Ext.isArray(value)) {
  14706. return (newReference) ? slice.call(value) : value;
  14707. }
  14708. var type = typeof value;
  14709. // Both strings and functions will have a length property. In phantomJS, NodeList
  14710. // instances report typeof=='function' but don't have an apply method...
  14711. if (value && value.length !== undefined && type !== 'string' && (type !== 'function' || !value.apply)) {
  14712. return ExtArray.toArray(value);
  14713. }
  14714. return [
  14715. value
  14716. ];
  14717. },
  14718. /**
  14719. * Removes the specified item from the array if it exists.
  14720. *
  14721. * @param {Array} array The array.
  14722. * @param {Object} item The item to remove.
  14723. * @return {Array} The passed array.
  14724. */
  14725. remove: function(array, item) {
  14726. var index = ExtArray.indexOf(array, item);
  14727. if (index !== -1) {
  14728. erase(array, index, 1);
  14729. }
  14730. return array;
  14731. },
  14732. /**
  14733. * Removes item/s at the specified index.
  14734. *
  14735. * @param {Array} array The array.
  14736. * @param {Number} index The index of the item to be removed.
  14737. * @param {Number} [count=1] The number of items to be removed.
  14738. * @return {Array} The passed array.
  14739. */
  14740. removeAt: function(array, index, count) {
  14741. var len = array.length;
  14742. if (index >= 0 && index < len) {
  14743. count = count || 1;
  14744. count = Math.min(count, len - index);
  14745. erase(array, index, count);
  14746. }
  14747. return array;
  14748. },
  14749. /**
  14750. * Push an item into the array only if the array doesn't contain it yet.
  14751. *
  14752. * @param {Array} array The array.
  14753. * @param {Object} item The item to include.
  14754. */
  14755. include: function(array, item) {
  14756. if (!ExtArray.contains(array, item)) {
  14757. array.push(item);
  14758. }
  14759. },
  14760. /**
  14761. * Clone a flat array without referencing the previous one. Note that this is different
  14762. * from `Ext.clone` since it doesn't handle recursive cloning. It's simply a convenient, easy-to-remember method
  14763. * for `Array.prototype.slice.call(array)`.
  14764. *
  14765. * @param {Array} array The array.
  14766. * @return {Array} The clone array.
  14767. */
  14768. clone: function(array) {
  14769. return slice.call(array);
  14770. },
  14771. /**
  14772. * Merge multiple arrays into one with unique items.
  14773. *
  14774. * {@link Ext.Array#union} is alias for {@link Ext.Array#merge}
  14775. *
  14776. * @param {Array} array1
  14777. * @param {Array} array2
  14778. * @param {Array} etc
  14779. * @return {Array} merged
  14780. */
  14781. merge: function() {
  14782. var args = slice.call(arguments),
  14783. array = [],
  14784. i, ln;
  14785. for (i = 0 , ln = args.length; i < ln; i++) {
  14786. array = array.concat(args[i]);
  14787. }
  14788. return ExtArray.unique(array);
  14789. },
  14790. /**
  14791. * Merge multiple arrays into one with unique items that exist in all of the arrays.
  14792. *
  14793. * @param {Array} array1
  14794. * @param {Array} array2
  14795. * @param {Array} etc
  14796. * @return {Array} intersect
  14797. */
  14798. intersect: function() {
  14799. var intersection = [],
  14800. arrays = slice.call(arguments),
  14801. arraysLength, array, arrayLength, minArray, minArrayIndex, minArrayCandidate, minArrayLength, element, elementCandidate, elementCount, i, j, k;
  14802. if (!arrays.length) {
  14803. return intersection;
  14804. }
  14805. // Find the smallest array
  14806. arraysLength = arrays.length;
  14807. for (i = minArrayIndex = 0; i < arraysLength; i++) {
  14808. minArrayCandidate = arrays[i];
  14809. if (!minArray || minArrayCandidate.length < minArray.length) {
  14810. minArray = minArrayCandidate;
  14811. minArrayIndex = i;
  14812. }
  14813. }
  14814. minArray = ExtArray.unique(minArray);
  14815. erase(arrays, minArrayIndex, 1);
  14816. // Use the smallest unique'd array as the anchor loop. If the other array(s) do contain
  14817. // an item in the small array, we're likely to find it before reaching the end
  14818. // of the inner loop and can terminate the search early.
  14819. minArrayLength = minArray.length;
  14820. arraysLength = arrays.length;
  14821. for (i = 0; i < minArrayLength; i++) {
  14822. element = minArray[i];
  14823. elementCount = 0;
  14824. for (j = 0; j < arraysLength; j++) {
  14825. array = arrays[j];
  14826. arrayLength = array.length;
  14827. for (k = 0; k < arrayLength; k++) {
  14828. elementCandidate = array[k];
  14829. if (element === elementCandidate) {
  14830. elementCount++;
  14831. break;
  14832. }
  14833. }
  14834. }
  14835. if (elementCount === arraysLength) {
  14836. intersection.push(element);
  14837. }
  14838. }
  14839. return intersection;
  14840. },
  14841. /**
  14842. * Perform a set difference A-B by subtracting all items in array B from array A.
  14843. *
  14844. * @param {Array} arrayA
  14845. * @param {Array} arrayB
  14846. * @return {Array} difference
  14847. */
  14848. difference: function(arrayA, arrayB) {
  14849. var clone = slice.call(arrayA),
  14850. ln = clone.length,
  14851. i, j, lnB;
  14852. for (i = 0 , lnB = arrayB.length; i < lnB; i++) {
  14853. for (j = 0; j < ln; j++) {
  14854. if (clone[j] === arrayB[i]) {
  14855. erase(clone, j, 1);
  14856. j--;
  14857. ln--;
  14858. }
  14859. }
  14860. }
  14861. return clone;
  14862. },
  14863. /**
  14864. * This method applies the `reduceFn` function against an accumulator and each
  14865. * value of the `array` (from left-to-right) to reduce it to a single value.
  14866. *
  14867. * If no `initialValue` is specified, the first element of the array is used as
  14868. * the initial value. For example:
  14869. *
  14870. * function reducer (previous, value, index) {
  14871. * console.log('[' + index + ']: (' + previous + ',' + value + '}');
  14872. * return previous * 10 + value;
  14873. * }
  14874. *
  14875. * v = Ext.Array.reduce([2, 3, 4], reducer);
  14876. * console.log('v = ' + v);
  14877. *
  14878. * > [1]: (2, 3)
  14879. * > [2]: (23, 4)
  14880. * > v = 234
  14881. *
  14882. * v = Ext.Array.reduce([2, 3, 4], reducer, 1);
  14883. * console.log('v = ' + v);
  14884. *
  14885. * > [0]: (1, 2)
  14886. * > [1]: (12, 3)
  14887. * > [2]: (123, 4)
  14888. * > v = 1234
  14889. *
  14890. * @param {Array} array The array to process.
  14891. * @param {Function} reduceFn The reducing callback function.
  14892. * @param {Mixed} reduceFn.previous The previous value.
  14893. * @param {Mixed} reduceFn.value The current value.
  14894. * @param {Number} reduceFn.index The index in the array of the current `value`.
  14895. * @param {Array} reduceFn.array The array to being processed.
  14896. * @param {Mixed} [initialValue] The starting value.
  14897. * @return {Mixed} The reduced value.
  14898. * @method reduce
  14899. * @since 6.0.0
  14900. */
  14901. reduce: Array.prototype.reduce ? function(array, reduceFn, initialValue) {
  14902. if (arguments.length === 3) {
  14903. return Array.prototype.reduce.call(array, reduceFn, initialValue);
  14904. }
  14905. return Array.prototype.reduce.call(array, reduceFn);
  14906. } : function(array, reduceFn, initialValue) {
  14907. array = Object(array);
  14908. if (!Ext.isFunction(reduceFn)) {
  14909. Ext.raise('Invalid parameter: expected a function.');
  14910. }
  14911. var index = 0,
  14912. length = array.length >>> 0,
  14913. reduced = initialValue;
  14914. if (arguments.length < 3) {
  14915. while (true) {
  14916. if (index in array) {
  14917. reduced = array[index++];
  14918. break;
  14919. }
  14920. if (++index >= length) {
  14921. throw new TypeError('Reduce of empty array with no initial value');
  14922. }
  14923. }
  14924. }
  14925. for (; index < length; ++index) {
  14926. if (index in array) {
  14927. reduced = reduceFn(reduced, array[index], index, array);
  14928. }
  14929. }
  14930. return reduced;
  14931. },
  14932. /**
  14933. * Returns a shallow copy of a part of an array. This is equivalent to the native
  14934. * call `Array.prototype.slice.call(array, begin, end)`. This is often used when "array"
  14935. * is "arguments" since the arguments object does not supply a slice method but can
  14936. * be the context object to `Array.prototype.slice`.
  14937. *
  14938. * @param {Array} array The array (or arguments object).
  14939. * @param {Number} begin The index at which to begin. Negative values are offsets from
  14940. * the end of the array.
  14941. * @param {Number} end The index at which to end. The copied items do not include
  14942. * end. Negative values are offsets from the end of the array. If end is omitted,
  14943. * all items up to the end of the array are copied.
  14944. * @return {Array} The copied piece of the array.
  14945. * @method slice
  14946. */
  14947. // Note: IE8 will return [] on slice.call(x, undefined).
  14948. slice: ([
  14949. 1,
  14950. 2
  14951. ].slice(1, undefined).length ? function(array, begin, end) {
  14952. return slice.call(array, begin, end);
  14953. } : function(array, begin, end) {
  14954. // see http://jsperf.com/slice-fix
  14955. if (typeof begin === 'undefined') {
  14956. return slice.call(array);
  14957. }
  14958. if (typeof end === 'undefined') {
  14959. return slice.call(array, begin);
  14960. }
  14961. return slice.call(array, begin, end);
  14962. }),
  14963. /**
  14964. * Sorts the elements of an Array in a stable manner (equivalently keyed values do not move relative to each other).
  14965. * By default, this method sorts the elements alphabetically and ascending.
  14966. * **Note:** This method modifies the passed array, in the same manner as the
  14967. * native javascript Array.sort.
  14968. *
  14969. * @param {Array} array The array to sort.
  14970. * @param {Function} [sortFn] The comparison function.
  14971. * @param {Mixed} sortFn.a The first item to compare.
  14972. * @param {Mixed} sortFn.b The second item to compare.
  14973. * @param {Number} sortFn.return `-1` if a < b, `1` if a > b, otherwise `0`.
  14974. * @return {Array} The sorted array.
  14975. */
  14976. sort: function(array, sortFn) {
  14977. return stableSort(array, sortFn || ExtArray.lexicalCompare);
  14978. },
  14979. /**
  14980. * Recursively flattens into 1-d Array. Injects Arrays inline.
  14981. *
  14982. * @param {Array} array The array to flatten
  14983. * @return {Array} The 1-d array.
  14984. */
  14985. flatten: function(array) {
  14986. var worker = [];
  14987. function rFlatten(a) {
  14988. var i, ln, v;
  14989. for (i = 0 , ln = a.length; i < ln; i++) {
  14990. v = a[i];
  14991. if (Ext.isArray(v)) {
  14992. rFlatten(v);
  14993. } else {
  14994. worker.push(v);
  14995. }
  14996. }
  14997. return worker;
  14998. }
  14999. return rFlatten(array);
  15000. },
  15001. /**
  15002. * Returns the minimum value in the Array.
  15003. *
  15004. * @param {Array/NodeList} array The Array from which to select the minimum value.
  15005. * @param {Function} comparisonFn (optional) a function to perform the comparison which determines minimization.
  15006. * If omitted the "<" operator will be used.
  15007. * __Note:__ gt = 1; eq = 0; lt = -1
  15008. * @param {Mixed} comparisonFn.min Current minimum value.
  15009. * @param {Mixed} comparisonFn.item The value to compare with the current minimum.
  15010. * @return {Object} minValue The minimum value.
  15011. */
  15012. min: function(array, comparisonFn) {
  15013. var min = array[0],
  15014. i, ln, item;
  15015. for (i = 0 , ln = array.length; i < ln; i++) {
  15016. item = array[i];
  15017. if (comparisonFn) {
  15018. if (comparisonFn(min, item) === 1) {
  15019. min = item;
  15020. }
  15021. } else {
  15022. if (item < min) {
  15023. min = item;
  15024. }
  15025. }
  15026. }
  15027. return min;
  15028. },
  15029. /**
  15030. * Returns the maximum value in the Array.
  15031. *
  15032. * @param {Array/NodeList} array The Array from which to select the maximum value.
  15033. * @param {Function} comparisonFn (optional) a function to perform the comparison which determines maximization.
  15034. * If omitted the ">" operator will be used.
  15035. * __Note:__ gt = 1; eq = 0; lt = -1
  15036. * @param {Mixed} comparisonFn.max Current maximum value.
  15037. * @param {Mixed} comparisonFn.item The value to compare with the current maximum.
  15038. * @return {Object} maxValue The maximum value.
  15039. */
  15040. max: function(array, comparisonFn) {
  15041. var max = array[0],
  15042. i, ln, item;
  15043. for (i = 0 , ln = array.length; i < ln; i++) {
  15044. item = array[i];
  15045. if (comparisonFn) {
  15046. if (comparisonFn(max, item) === -1) {
  15047. max = item;
  15048. }
  15049. } else {
  15050. if (item > max) {
  15051. max = item;
  15052. }
  15053. }
  15054. }
  15055. return max;
  15056. },
  15057. /**
  15058. * Calculates the mean of all items in the array.
  15059. *
  15060. * @param {Array} array The Array to calculate the mean value of.
  15061. * @return {Number} The mean.
  15062. */
  15063. mean: function(array) {
  15064. return array.length > 0 ? ExtArray.sum(array) / array.length : undefined;
  15065. },
  15066. /**
  15067. * Calculates the sum of all items in the given array.
  15068. *
  15069. * @param {Array} array The Array to calculate the sum value of.
  15070. * @return {Number} The sum.
  15071. */
  15072. sum: function(array) {
  15073. var sum = 0,
  15074. i, ln, item;
  15075. for (i = 0 , ln = array.length; i < ln; i++) {
  15076. item = array[i];
  15077. sum += item;
  15078. }
  15079. return sum;
  15080. },
  15081. /**
  15082. * Creates a map (object) keyed by the elements of the given array. The values in
  15083. * the map are the index+1 of the array element. For example:
  15084. *
  15085. * var map = Ext.Array.toMap(['a','b','c']);
  15086. *
  15087. * // map = { a: 1, b: 2, c: 3 };
  15088. *
  15089. * Or a key property can be specified:
  15090. *
  15091. * var map = Ext.Array.toMap([
  15092. * { name: 'a' },
  15093. * { name: 'b' },
  15094. * { name: 'c' }
  15095. * ], 'name');
  15096. *
  15097. * // map = { a: 1, b: 2, c: 3 };
  15098. *
  15099. * Lastly, a key extractor can be provided:
  15100. *
  15101. * var map = Ext.Array.toMap([
  15102. * { name: 'a' },
  15103. * { name: 'b' },
  15104. * { name: 'c' }
  15105. * ], function (obj) { return obj.name.toUpperCase(); });
  15106. *
  15107. * // map = { A: 1, B: 2, C: 3 };
  15108. *
  15109. * @param {String/String[]} strings The strings from which to create the map.
  15110. * @param {String/Function} [getKey] Name of the object property to use
  15111. * as a key or a function to extract the key.
  15112. * @param {Object} [scope] Value of `this` inside callback specified for `getKey`.
  15113. * @return {Object} The resulting map.
  15114. */
  15115. toMap: function(strings, getKey, scope) {
  15116. if (!strings) {
  15117. return null;
  15118. }
  15119. var map = {},
  15120. i = strings.length;
  15121. if (typeof strings === 'string') {
  15122. map[strings] = 1;
  15123. } else if (!getKey) {
  15124. while (i--) {
  15125. map[strings[i]] = i + 1;
  15126. }
  15127. } else if (typeof getKey === 'string') {
  15128. while (i--) {
  15129. map[strings[i][getKey]] = i + 1;
  15130. }
  15131. } else {
  15132. while (i--) {
  15133. map[getKey.call(scope, strings[i])] = i + 1;
  15134. }
  15135. }
  15136. return map;
  15137. },
  15138. /**
  15139. * Creates a map (object) keyed by a property of elements of the given array. The values in
  15140. * the map are the array element. For example:
  15141. *
  15142. * var map = Ext.Array.toValueMap(['a','b','c']);
  15143. *
  15144. * // map = { a: 'a', b: 'b', c: 'c' };
  15145. *
  15146. * Or a key property can be specified:
  15147. *
  15148. * var map = Ext.Array.toValueMap([
  15149. * { name: 'a' },
  15150. * { name: 'b' },
  15151. * { name: 'c' }
  15152. * ], 'name');
  15153. *
  15154. * // map = { a: {name: 'a'}, b: {name: 'b'}, c: {name: 'c'} };
  15155. *
  15156. * Lastly, a key extractor can be provided:
  15157. *
  15158. * var map = Ext.Array.toValueMap([
  15159. * { name: 'a' },
  15160. * { name: 'b' },
  15161. * { name: 'c' }
  15162. * ], function (obj) { return obj.name.toUpperCase(); });
  15163. *
  15164. * // map = { A: {name: 'a'}, B: {name: 'b'}, C: {name: 'c'} };
  15165. *
  15166. * @param {Array} array The Array to create the map from.
  15167. * @param {String/Function} [getKey] Name of the object property to use
  15168. * as a key or a function to extract the key.
  15169. * @param {Object} [scope] Value of this inside callback. This parameter is only
  15170. * passed when `getKey` is a function. If `getKey` is not a function, the 3rd
  15171. * argument is `arrayify`.
  15172. * @param {Number} [arrayify] Pass `1` to create arrays for all map entries
  15173. * or `2` to create arrays for map entries that have 2 or more items with the
  15174. * same key. This only applies when `getKey` is specified. By default the map will
  15175. * hold the last entry with a given key.
  15176. * @return {Object} The resulting map.
  15177. */
  15178. toValueMap: function(array, getKey, scope, arrayify) {
  15179. var map = {},
  15180. i = array.length,
  15181. autoArray, alwaysArray, entry, fn, key, value;
  15182. if (!getKey) {
  15183. while (i--) {
  15184. value = array[i];
  15185. map[value] = value;
  15186. }
  15187. } else {
  15188. if (!(fn = (typeof getKey !== 'string'))) {
  15189. arrayify = scope;
  15190. }
  15191. alwaysArray = arrayify === 1;
  15192. autoArray = arrayify === 2;
  15193. while (i--) {
  15194. value = array[i];
  15195. key = fn ? getKey.call(scope, value) : value[getKey];
  15196. if (alwaysArray) {
  15197. if (key in map) {
  15198. map[key].push(value);
  15199. } else {
  15200. map[key] = [
  15201. value
  15202. ];
  15203. }
  15204. } else if (autoArray && (key in map)) {
  15205. if ((entry = map[key]) instanceof Array) {
  15206. entry.push(value);
  15207. } else {
  15208. map[key] = [
  15209. entry,
  15210. value
  15211. ];
  15212. }
  15213. } else {
  15214. map[key] = value;
  15215. }
  15216. }
  15217. }
  15218. return map;
  15219. },
  15220. _replaceSim: replaceSim,
  15221. // for unit testing
  15222. _spliceSim: spliceSim,
  15223. /**
  15224. * Removes items from an array. This is functionally equivalent to the splice method
  15225. * of Array, but works around bugs in IE8's splice method and does not copy the
  15226. * removed elements in order to return them (because very often they are ignored).
  15227. *
  15228. * @param {Array} array The Array on which to replace.
  15229. * @param {Number} index The index in the array at which to operate.
  15230. * @param {Number} removeCount The number of items to remove at index.
  15231. * @return {Array} The array passed.
  15232. * @method
  15233. */
  15234. erase: erase,
  15235. /**
  15236. * Inserts items in to an array.
  15237. *
  15238. * @param {Array} array The Array in which to insert.
  15239. * @param {Number} index The index in the array at which to operate.
  15240. * @param {Array} items The array of items to insert at index.
  15241. * @return {Array} The array passed.
  15242. */
  15243. insert: function(array, index, items) {
  15244. return replace(array, index, 0, items);
  15245. },
  15246. move: function(array, fromIdx, toIdx) {
  15247. if (toIdx === fromIdx) {
  15248. return;
  15249. }
  15250. var item = array[fromIdx],
  15251. incr = toIdx > fromIdx ? 1 : -1,
  15252. i;
  15253. for (i = fromIdx; i != toIdx; i += incr) {
  15254. array[i] = array[i + incr];
  15255. }
  15256. array[toIdx] = item;
  15257. },
  15258. /**
  15259. * Replaces items in an array. This is functionally equivalent to the splice method
  15260. * of Array, but works around bugs in IE8's splice method and is often more convenient
  15261. * to call because it accepts an array of items to insert rather than use a variadic
  15262. * argument list.
  15263. *
  15264. * @param {Array} array The Array on which to replace.
  15265. * @param {Number} index The index in the array at which to operate.
  15266. * @param {Number} removeCount The number of items to remove at index (can be 0).
  15267. * @param {Array} insert (optional) An array of items to insert at index.
  15268. * @return {Array} The array passed.
  15269. * @method
  15270. */
  15271. replace: replace,
  15272. /**
  15273. * Replaces items in an array. This is equivalent to the splice method of Array, but
  15274. * works around bugs in IE8's splice method. The signature is exactly the same as the
  15275. * splice method except that the array is the first argument. All arguments following
  15276. * removeCount are inserted in the array at index.
  15277. *
  15278. * @param {Array} array The Array on which to replace.
  15279. * @param {Number} index The index in the array at which to operate.
  15280. * @param {Number} removeCount The number of items to remove at index (can be 0).
  15281. * @param {Object...} elements The elements to add to the array. If you don't specify
  15282. * any elements, splice simply removes elements from the array.
  15283. * @return {Array} An array containing the removed items.
  15284. * @method
  15285. */
  15286. splice: splice,
  15287. /**
  15288. * Pushes new items onto the end of an Array.
  15289. *
  15290. * Passed parameters may be single items, or arrays of items. If an Array is found in the argument list, all its
  15291. * elements are pushed into the end of the target Array.
  15292. *
  15293. * @param {Array} target The Array onto which to push new items
  15294. * @param {Object...} elements The elements to add to the array. Each parameter may
  15295. * be an Array, in which case all the elements of that Array will be pushed into the end of the
  15296. * destination Array.
  15297. * @return {Array} An array containing all the new items push onto the end.
  15298. */
  15299. push: function(target) {
  15300. var args = arguments,
  15301. len = args.length,
  15302. i, newItem;
  15303. if (target === undefined) {
  15304. target = [];
  15305. } else if (!Ext.isArray(target)) {
  15306. target = [
  15307. target
  15308. ];
  15309. }
  15310. for (i = 1; i < len; i++) {
  15311. newItem = args[i];
  15312. Array.prototype.push[Ext.isIterable(newItem) ? 'apply' : 'call'](target, newItem);
  15313. }
  15314. return target;
  15315. },
  15316. /**
  15317. * A function used to sort an array by numeric value. By default, javascript array values
  15318. * are coerced to strings when sorting, which can be problematic when using numeric values. To
  15319. * ensure that the values are sorted numerically, this method can be passed to the sort method:
  15320. *
  15321. * Ext.Array.sort(myArray, Ext.Array.numericSortFn);
  15322. */
  15323. numericSortFn: function(a, b) {
  15324. return a - b;
  15325. }
  15326. };
  15327. /**
  15328. * @method each
  15329. * @member Ext
  15330. * @inheritdoc Ext.Array#each
  15331. */
  15332. Ext.each = ExtArray.each;
  15333. /**
  15334. * @method union
  15335. * @member Ext.Array
  15336. * @inheritdoc Ext.Array#merge
  15337. */
  15338. ExtArray.union = ExtArray.merge;
  15339. /**
  15340. * Old alias to {@link Ext.Array#min}
  15341. * @deprecated 4.0.0 Use {@link Ext.Array#min} instead
  15342. * @method min
  15343. * @member Ext
  15344. * @inheritdoc Ext.Array#min
  15345. */
  15346. Ext.min = ExtArray.min;
  15347. /**
  15348. * Old alias to {@link Ext.Array#max}
  15349. * @deprecated 4.0.0 Use {@link Ext.Array#max} instead
  15350. * @method max
  15351. * @member Ext
  15352. * @inheritdoc Ext.Array#max
  15353. */
  15354. Ext.max = ExtArray.max;
  15355. /**
  15356. * Old alias to {@link Ext.Array#sum}
  15357. * @deprecated 4.0.0 Use {@link Ext.Array#sum} instead
  15358. * @method sum
  15359. * @member Ext
  15360. * @inheritdoc Ext.Array#sum
  15361. */
  15362. Ext.sum = ExtArray.sum;
  15363. /**
  15364. * Old alias to {@link Ext.Array#mean}
  15365. * @deprecated 4.0.0 Use {@link Ext.Array#mean} instead
  15366. * @method mean
  15367. * @member Ext
  15368. * @inheritdoc Ext.Array#mean
  15369. */
  15370. Ext.mean = ExtArray.mean;
  15371. /**
  15372. * Old alias to {@link Ext.Array#flatten}
  15373. * @deprecated 4.0.0 Use {@link Ext.Array#flatten} instead
  15374. * @method flatten
  15375. * @member Ext
  15376. * @inheritdoc Ext.Array#flatten
  15377. */
  15378. Ext.flatten = ExtArray.flatten;
  15379. /**
  15380. * Old alias to {@link Ext.Array#clean}
  15381. * @deprecated 4.0.0 Use {@link Ext.Array#clean} instead
  15382. * @method clean
  15383. * @member Ext
  15384. * @inheritdoc Ext.Array#clean
  15385. */
  15386. Ext.clean = ExtArray.clean;
  15387. /**
  15388. * Old alias to {@link Ext.Array#unique}
  15389. * @deprecated 4.0.0 Use {@link Ext.Array#unique} instead
  15390. * @method unique
  15391. * @member Ext
  15392. * @inheritdoc Ext.Array#unique
  15393. */
  15394. Ext.unique = ExtArray.unique;
  15395. /**
  15396. * Old alias to {@link Ext.Array#pluck Ext.Array.pluck}
  15397. * @deprecated 4.0.0 Use {@link Ext.Array#pluck Ext.Array.pluck} instead
  15398. * @method pluck
  15399. * @member Ext
  15400. * @inheritdoc Ext.Array#pluck
  15401. */
  15402. Ext.pluck = ExtArray.pluck;
  15403. /**
  15404. * @method toArray
  15405. * @member Ext
  15406. * @inheritdoc Ext.Array#toArray
  15407. */
  15408. Ext.toArray = function() {
  15409. return ExtArray.toArray.apply(ExtArray, arguments);
  15410. };
  15411. return ExtArray;
  15412. }());
  15413. // @define Ext.lang.Assert
  15414. // @define Ext.Assert
  15415. // @require Ext.lang.Error
  15416. /**
  15417. * @class Ext.Assert
  15418. * This class provides help value testing methods useful for diagnostics. These are often
  15419. * used in `debugHooks`:
  15420. *
  15421. * Ext.define('Foo.bar.Class', {
  15422. *
  15423. * debugHooks: {
  15424. * method: function (a) {
  15425. * Ext.Assert.truthy(a, 'Expected "a" to be truthy');
  15426. * },
  15427. *
  15428. * foo: function (object) {
  15429. * Ext.Assert.isFunctionProp(object, 'doSomething');
  15430. * }
  15431. * }
  15432. * });
  15433. *
  15434. * **NOTE:** This class is entirely removed in production builds so all uses of it should
  15435. * be either in `debug` conditional comments or `debugHooks`.
  15436. *
  15437. * The following type detection methods from the `Ext` object are wrapped as assertions
  15438. * by this class:
  15439. *
  15440. * * `isEmpty`
  15441. * * `isArray`
  15442. * * `isDate`
  15443. * * `isObject`
  15444. * * `isSimpleObject`
  15445. * * `isPrimitive`
  15446. * * `isFunction`
  15447. * * `isNumber`
  15448. * * `isNumeric`
  15449. * * `isString`
  15450. * * `isBoolean`
  15451. * * `isElement`
  15452. * * `isTextNode`
  15453. * * `isDefined`
  15454. * * `isIterable`
  15455. *
  15456. * These appear both their exact name and with a "Prop" suffix for checking a property on
  15457. * an object. For example, these are almost identical:
  15458. *
  15459. * Ext.Assert.isFunction(object.foo);
  15460. *
  15461. * Ext.Assert.isFunctionProp(object, 'foo');
  15462. *
  15463. * The difference is the default error message generated is better in the second use case
  15464. * than the first.
  15465. *
  15466. * The above list are also expanded for "Not" flavors (and "Not...Prop"):
  15467. *
  15468. * * `isNotEmpty`
  15469. * * `isNotArray`
  15470. * * `isNotDate`
  15471. * * `isNotObject`
  15472. * * `isNotSimpleObject`
  15473. * * `isNotPrimitive`
  15474. * * `isNotFunction`
  15475. * * `isNotNumber`
  15476. * * `isNotNumeric`
  15477. * * `isNotString`
  15478. * * `isNotBoolean`
  15479. * * `isNotElement`
  15480. * * `isNotTextNode`
  15481. * * `isNotDefined`
  15482. * * `isNotIterable`
  15483. */
  15484. Ext.Assert = {
  15485. /**
  15486. * Checks that the first argument is falsey and throws an `Error` if it is not.
  15487. */
  15488. falsey: function(b, msg) {
  15489. if (b) {
  15490. Ext.raise(msg || ('Expected a falsey value but was ' + b));
  15491. }
  15492. },
  15493. /**
  15494. * Checks that the first argument is falsey and throws an `Error` if it is not.
  15495. */
  15496. falseyProp: function(object, property) {
  15497. Ext.Assert.truthy(object);
  15498. var b = object[property];
  15499. if (b) {
  15500. if (object.$className) {
  15501. property = object.$className + '#' + property;
  15502. }
  15503. Ext.raise('Expected a falsey value for ' + property + ' but was ' + b);
  15504. }
  15505. },
  15506. /**
  15507. * Checks that the first argument is truthy and throws an `Error` if it is not.
  15508. */
  15509. truthy: function(b, msg) {
  15510. if (!b) {
  15511. Ext.raise(msg || ('Expected a truthy value but was ' + typeof b));
  15512. }
  15513. },
  15514. /**
  15515. * Checks that the first argument is truthy and throws an `Error` if it is not.
  15516. */
  15517. truthyProp: function(object, property) {
  15518. Ext.Assert.truthy(object);
  15519. var b = object[property];
  15520. if (!b) {
  15521. if (object.$className) {
  15522. property = object.$className + '#' + property;
  15523. }
  15524. Ext.raise('Expected a truthy value for ' + property + ' but was ' + typeof b);
  15525. }
  15526. }
  15527. };
  15528. (function() {
  15529. function makeAssert(name, kind) {
  15530. var testFn = Ext[name],
  15531. def;
  15532. return function(value, msg) {
  15533. if (!testFn(value)) {
  15534. Ext.raise(msg || def || (def = 'Expected value to be ' + kind));
  15535. }
  15536. };
  15537. }
  15538. function makeAssertProp(name, kind) {
  15539. var testFn = Ext[name],
  15540. def;
  15541. return function(object, prop) {
  15542. Ext.Assert.truthy(object);
  15543. if (!testFn(object[prop])) {
  15544. Ext.raise(def || (def = 'Expected ' + (object.$className ? object.$className + '#' : '') + prop + ' to be ' + kind));
  15545. }
  15546. };
  15547. }
  15548. function makeNotAssert(name, kind) {
  15549. var testFn = Ext[name],
  15550. def;
  15551. return function(value, msg) {
  15552. if (testFn(value)) {
  15553. Ext.raise(msg || def || (def = 'Expected value to NOT be ' + kind));
  15554. }
  15555. };
  15556. }
  15557. function makeNotAssertProp(name, kind) {
  15558. var testFn = Ext[name],
  15559. def;
  15560. return function(object, prop) {
  15561. Ext.Assert.truthy(object);
  15562. if (testFn(object[prop])) {
  15563. Ext.raise(def || (def = 'Expected ' + (object.$className ? object.$className + '#' : '') + prop + ' to NOT be ' + kind));
  15564. }
  15565. };
  15566. }
  15567. for (var name in Ext) {
  15568. if (name.substring(0, 2) == "is" && Ext.isFunction(Ext[name])) {
  15569. var kind = name.substring(2);
  15570. Ext.Assert[name] = makeAssert(name, kind);
  15571. Ext.Assert[name + 'Prop'] = makeAssertProp(name, kind);
  15572. Ext.Assert['isNot' + kind] = makeNotAssert(name, kind);
  15573. Ext.Assert['isNot' + kind + 'Prop'] = makeNotAssertProp(name, kind);
  15574. }
  15575. }
  15576. }());
  15577. /**
  15578. * @class Ext.String
  15579. *
  15580. * A collection of useful static methods to deal with strings.
  15581. * @singleton
  15582. */
  15583. Ext.String = (function() {
  15584. // @define Ext.lang.String
  15585. // @define Ext.String
  15586. // @require Ext
  15587. // @require Ext.lang.Array
  15588. var trimRegex = /^[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+|[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+$/g,
  15589. escapeRe = /('|\\)/g,
  15590. escapeRegexRe = /([-.*+?\^${}()|\[\]\/\\])/g,
  15591. basicTrimRe = /^\s+|\s+$/g,
  15592. whitespaceRe = /\s+/,
  15593. varReplace = /(^[^a-z]*|[^\w])/gi,
  15594. charToEntity, entityToChar, charToEntityRegex, entityToCharRegex,
  15595. htmlEncodeReplaceFn = function(match, capture) {
  15596. return charToEntity[capture];
  15597. },
  15598. htmlDecodeReplaceFn = function(match, capture) {
  15599. return (capture in entityToChar) ? entityToChar[capture] : String.fromCharCode(parseInt(capture.substr(2), 10));
  15600. },
  15601. boundsCheck = function(s, other) {
  15602. if (s === null || s === undefined || other === null || other === undefined) {
  15603. return false;
  15604. }
  15605. return other.length <= s.length;
  15606. },
  15607. fromCharCode = String.fromCharCode,
  15608. ExtString;
  15609. return ExtString = {
  15610. /**
  15611. * @method
  15612. * Creates a string created by using the specified sequence of code points.
  15613. * @param {Number...} codePoint Codepoints from which to build the string.
  15614. * @return {String} A string built from the sequence of code points passed.
  15615. */
  15616. fromCodePoint: String.fromCodePoint || function() {
  15617. var codePoint,
  15618. result = '',
  15619. codeUnits = [],
  15620. index = -1,
  15621. length = arguments.length;
  15622. while (++index < length) {
  15623. codePoint = Number(arguments[index]);
  15624. if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
  15625. codePoint < 0 || // not a valid Unicode code point
  15626. codePoint > 1114111 || // not a valid Unicode code point
  15627. Math.floor(codePoint) !== codePoint) // not an integer
  15628. {
  15629. Ext.raise('Invalid code point: ' + codePoint);
  15630. }
  15631. if (codePoint <= 65535) {
  15632. // BMP code point
  15633. codeUnits.push(codePoint);
  15634. } else {
  15635. // Astral code point; split in surrogate halves
  15636. // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  15637. codePoint -= 65536;
  15638. codeUnits.push((codePoint >> 10) + 55296, (codePoint % 1024) + 56320);
  15639. }
  15640. if (index + 1 === length) {
  15641. result += fromCharCode(codeUnits);
  15642. codeUnits.length = 0;
  15643. }
  15644. }
  15645. return result;
  15646. },
  15647. /**
  15648. * Inserts a substring into a string.
  15649. * @param {String} s The original string.
  15650. * @param {String} value The substring to insert.
  15651. * @param {Number} index The index to insert the substring. Negative indexes will insert from the end of
  15652. * the string. Example:
  15653. *
  15654. * Ext.String.insert("abcdefg", "h", -1); // abcdefhg
  15655. *
  15656. * @return {String} The value with the inserted substring
  15657. */
  15658. insert: function(s, value, index) {
  15659. if (!s) {
  15660. return value;
  15661. }
  15662. if (!value) {
  15663. return s;
  15664. }
  15665. var len = s.length;
  15666. if (!index && index !== 0) {
  15667. index = len;
  15668. }
  15669. if (index < 0) {
  15670. index *= -1;
  15671. if (index >= len) {
  15672. // negative overflow, insert at start
  15673. index = 0;
  15674. } else {
  15675. index = len - index;
  15676. }
  15677. }
  15678. if (index === 0) {
  15679. s = value + s;
  15680. } else if (index >= s.length) {
  15681. s += value;
  15682. } else {
  15683. s = s.substr(0, index) + value + s.substr(index);
  15684. }
  15685. return s;
  15686. },
  15687. /**
  15688. * Checks if a string starts with a substring
  15689. * @param {String} s The original string
  15690. * @param {String} start The substring to check
  15691. * @param {Boolean} [ignoreCase=false] True to ignore the case in the comparison
  15692. */
  15693. startsWith: function(s, start, ignoreCase) {
  15694. var result = boundsCheck(s, start);
  15695. if (result) {
  15696. if (ignoreCase) {
  15697. s = s.toLowerCase();
  15698. start = start.toLowerCase();
  15699. }
  15700. result = s.lastIndexOf(start, 0) === 0;
  15701. }
  15702. return result;
  15703. },
  15704. /**
  15705. * Checks if a string ends with a substring
  15706. * @param {String} s The original string
  15707. * @param {String} end The substring to check
  15708. * @param {Boolean} [ignoreCase=false] True to ignore the case in the comparison
  15709. */
  15710. endsWith: function(s, end, ignoreCase) {
  15711. var result = boundsCheck(s, end);
  15712. if (result) {
  15713. if (ignoreCase) {
  15714. s = s.toLowerCase();
  15715. end = end.toLowerCase();
  15716. }
  15717. result = s.indexOf(end, s.length - end.length) !== -1;
  15718. }
  15719. return result;
  15720. },
  15721. /**
  15722. * Converts a string of characters into a legal, parse-able JavaScript `var` name as long as the passed
  15723. * string contains at least one alphabetic character. Non alphanumeric characters, and *leading* non alphabetic
  15724. * characters will be removed.
  15725. * @param {String} s A string to be converted into a `var` name.
  15726. * @return {String} A legal JavaScript `var` name.
  15727. */
  15728. createVarName: function(s) {
  15729. return s.replace(varReplace, '');
  15730. },
  15731. /**
  15732. * Convert certain characters (&, <, >, ', and ") to their HTML character equivalents for literal display in web pages.
  15733. * @param {String} value The string to encode.
  15734. * @return {String} The encoded text.
  15735. * @method
  15736. */
  15737. htmlEncode: function(value) {
  15738. return (!value) ? value : String(value).replace(charToEntityRegex, htmlEncodeReplaceFn);
  15739. },
  15740. /**
  15741. * Convert certain characters (&, <, >, ', and ") from their HTML character equivalents.
  15742. * @param {String} value The string to decode.
  15743. * @return {String} The decoded text.
  15744. * @method
  15745. */
  15746. htmlDecode: function(value) {
  15747. return (!value) ? value : String(value).replace(entityToCharRegex, htmlDecodeReplaceFn);
  15748. },
  15749. /**
  15750. * Checks if a string has values needing to be html encoded.
  15751. * @private
  15752. * @param {String} s The string to test
  15753. * @return {Boolean} `true` if the string contains HTML characters
  15754. */
  15755. hasHtmlCharacters: function(s) {
  15756. return charToEntityRegex.test(s);
  15757. },
  15758. /**
  15759. * Adds a set of character entity definitions to the set used by
  15760. * {@link Ext.String#htmlEncode} and {@link Ext.String#htmlDecode}.
  15761. *
  15762. * This object should be keyed by the entity name sequence,
  15763. * with the value being the textual representation of the entity.
  15764. *
  15765. * Ext.String.addCharacterEntities({
  15766. * '&amp;Uuml;':'Ü',
  15767. * '&amp;ccedil;':'ç',
  15768. * '&amp;ntilde;':'ñ',
  15769. * '&amp;egrave;':'è'
  15770. * });
  15771. * var s = Ext.String.htmlEncode("A string with entities: èÜçñ");
  15772. *
  15773. * __Note:__ the values of the character entities defined on this object are expected
  15774. * to be single character values. As such, the actual values represented by the
  15775. * characters are sensitive to the character encoding of the JavaScript source
  15776. * file when defined in string literal form. Script tags referencing server
  15777. * resources with character entities must ensure that the 'charset' attribute
  15778. * of the script node is consistent with the actual character encoding of the
  15779. * server resource.
  15780. *
  15781. * The set of character entities may be reset back to the default state by using
  15782. * the {@link Ext.String#resetCharacterEntities} method
  15783. *
  15784. * @param {Object} newEntities The set of character entities to add to the current
  15785. * definitions.
  15786. */
  15787. addCharacterEntities: function(newEntities) {
  15788. var charKeys = [],
  15789. entityKeys = [],
  15790. key, echar;
  15791. for (key in newEntities) {
  15792. echar = newEntities[key];
  15793. entityToChar[key] = echar;
  15794. charToEntity[echar] = key;
  15795. charKeys.push(echar);
  15796. entityKeys.push(key);
  15797. }
  15798. charToEntityRegex = new RegExp('(' + charKeys.join('|') + ')', 'g');
  15799. entityToCharRegex = new RegExp('(' + entityKeys.join('|') + '|&#[0-9]{1,5};' + ')', 'g');
  15800. },
  15801. /**
  15802. * Resets the set of character entity definitions used by
  15803. * {@link Ext.String#htmlEncode} and {@link Ext.String#htmlDecode} back to the
  15804. * default state.
  15805. */
  15806. resetCharacterEntities: function() {
  15807. charToEntity = {};
  15808. entityToChar = {};
  15809. // add the default set
  15810. this.addCharacterEntities({
  15811. '&amp;': '&',
  15812. '&gt;': '>',
  15813. '&lt;': '<',
  15814. '&quot;': '"',
  15815. '&#39;': "'"
  15816. });
  15817. },
  15818. /**
  15819. * Appends content to the query string of a URL, handling logic for whether to place
  15820. * a question mark or ampersand.
  15821. * @param {String} url The URL to append to.
  15822. * @param {String} string The content to append to the URL.
  15823. * @return {String} The resulting URL
  15824. */
  15825. urlAppend: function(url, string) {
  15826. if (!Ext.isEmpty(string)) {
  15827. return url + (url.indexOf('?') === -1 ? '?' : '&') + string;
  15828. }
  15829. return url;
  15830. },
  15831. /**
  15832. * Trims whitespace from either end of a string, leaving spaces within the string intact. Example:
  15833. *
  15834. * var s = ' foo bar ';
  15835. * alert('-' + s + '-'); //alerts "- foo bar -"
  15836. * alert('-' + Ext.String.trim(s) + '-'); //alerts "-foo bar-"
  15837. *
  15838. * @param {String} string The string to trim.
  15839. * @return {String} The trimmed string.
  15840. */
  15841. trim: function(string) {
  15842. if (string) {
  15843. string = string.replace(trimRegex, "");
  15844. }
  15845. return string || '';
  15846. },
  15847. /**
  15848. * Capitalize the first letter of the given string.
  15849. * @param {String} string
  15850. * @return {String}
  15851. */
  15852. capitalize: function(string) {
  15853. if (string) {
  15854. string = string.charAt(0).toUpperCase() + string.substr(1);
  15855. }
  15856. return string || '';
  15857. },
  15858. /**
  15859. * Uncapitalize the first letter of a given string.
  15860. * @param {String} string
  15861. * @return {String}
  15862. */
  15863. uncapitalize: function(string) {
  15864. if (string) {
  15865. string = string.charAt(0).toLowerCase() + string.substr(1);
  15866. }
  15867. return string || '';
  15868. },
  15869. /**
  15870. * Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length.
  15871. * @param {String} value The string to truncate.
  15872. * @param {Number} length The maximum length to allow before truncating.
  15873. * @param {Boolean} [word=false] `true` to try to find a common word break.
  15874. * @return {String} The converted text.
  15875. */
  15876. ellipsis: function(value, length, word) {
  15877. if (value && value.length > length) {
  15878. if (word) {
  15879. var vs = value.substr(0, length - 2),
  15880. index = Math.max(vs.lastIndexOf(' '), vs.lastIndexOf('.'), vs.lastIndexOf('!'), vs.lastIndexOf('?'));
  15881. if (index !== -1 && index >= (length - 15)) {
  15882. return vs.substr(0, index) + "...";
  15883. }
  15884. }
  15885. return value.substr(0, length - 3) + "...";
  15886. }
  15887. return value;
  15888. },
  15889. /**
  15890. * Escapes the passed string for use in a regular expression.
  15891. * @param {String} string The string to escape.
  15892. * @return {String} The escaped string.
  15893. */
  15894. escapeRegex: function(string) {
  15895. return string.replace(escapeRegexRe, "\\$1");
  15896. },
  15897. /**
  15898. * Creates a `RegExp` given a string `value` and optional flags. For example, the
  15899. * following two regular expressions are equivalent.
  15900. *
  15901. * var regex1 = Ext.String.createRegex('hello');
  15902. *
  15903. * var regex2 = /^hello$/i;
  15904. *
  15905. * The following two regular expressions are also equivalent:
  15906. *
  15907. * var regex1 = Ext.String.createRegex('world', false, false, false);
  15908. *
  15909. * var regex2 = /world/;
  15910. *
  15911. * @param {String/RegExp} value The String to convert to a `RegExp`.
  15912. * @param {Boolean} [startsWith=true] Pass `false` to allow a match to start
  15913. * anywhere in the string. By default the `value` will match only at the start
  15914. * of the string.
  15915. * @param {Boolean} [endsWith=true] Pass `false` to allow the match to end before
  15916. * the end of the string. By default the `value` will match only at the end of the
  15917. * string.
  15918. * @param {Boolean} [ignoreCase=true] Pass `false` to make the `RegExp` case
  15919. * sensitive (removes the 'i' flag).
  15920. * @since 5.0.0
  15921. * @return {RegExp}
  15922. */
  15923. createRegex: function(value, startsWith, endsWith, ignoreCase) {
  15924. var ret = value;
  15925. if (value != null && !value.exec) {
  15926. // not a regex
  15927. ret = ExtString.escapeRegex(String(value));
  15928. if (startsWith !== false) {
  15929. ret = '^' + ret;
  15930. }
  15931. if (endsWith !== false) {
  15932. ret += '$';
  15933. }
  15934. ret = new RegExp(ret, (ignoreCase !== false) ? 'i' : '');
  15935. }
  15936. return ret;
  15937. },
  15938. /**
  15939. * Escapes the passed string for ' and \.
  15940. * @param {String} string The string to escape.
  15941. * @return {String} The escaped string.
  15942. */
  15943. escape: function(string) {
  15944. return string.replace(escapeRe, "\\$1");
  15945. },
  15946. /**
  15947. * Utility function that allows you to easily switch a string between two alternating values. The passed value
  15948. * is compared to the current string, and if they are equal, the other value that was passed in is returned. If
  15949. * they are already different, the first value passed in is returned. Note that this method returns the new value
  15950. * but does not change the current string.
  15951. *
  15952. * // alternate sort directions
  15953. * sort = Ext.String.toggle(sort, 'ASC', 'DESC');
  15954. *
  15955. * // instead of conditional logic:
  15956. * sort = (sort === 'ASC' ? 'DESC' : 'ASC');
  15957. *
  15958. * @param {String} string The current string.
  15959. * @param {String} value The value to compare to the current string.
  15960. * @param {String} other The new value to use if the string already equals the first value passed in.
  15961. * @return {String} The new value.
  15962. */
  15963. toggle: function(string, value, other) {
  15964. return string === value ? other : value;
  15965. },
  15966. /**
  15967. * Pads the left side of a string with a specified character. This is especially useful
  15968. * for normalizing number and date strings. Example usage:
  15969. *
  15970. * var s = Ext.String.leftPad('123', 5, '0');
  15971. * // s now contains the string: '00123'
  15972. *
  15973. * @param {String} string The original string.
  15974. * @param {Number} size The total length of the output string.
  15975. * @param {String} [character=' '] (optional) The character with which to pad the original string.
  15976. * @return {String} The padded string.
  15977. */
  15978. leftPad: function(string, size, character) {
  15979. var result = String(string);
  15980. character = character || " ";
  15981. while (result.length < size) {
  15982. result = character + result;
  15983. }
  15984. return result;
  15985. },
  15986. /**
  15987. * Returns a string with a specified number of repetitions a given string pattern.
  15988. * The pattern be separated by a different string.
  15989. *
  15990. * var s = Ext.String.repeat('---', 4); // = '------------'
  15991. * var t = Ext.String.repeat('--', 3, '/'); // = '--/--/--'
  15992. *
  15993. * @param {String} pattern The pattern to repeat.
  15994. * @param {Number} count The number of times to repeat the pattern (may be 0).
  15995. * @param {String} sep An option string to separate each pattern.
  15996. */
  15997. repeat: function(pattern, count, sep) {
  15998. if (count < 1) {
  15999. count = 0;
  16000. }
  16001. for (var buf = [],
  16002. i = count; i--; ) {
  16003. buf.push(pattern);
  16004. }
  16005. return buf.join(sep || '');
  16006. },
  16007. /**
  16008. * Splits a string of space separated words into an array, trimming as needed. If the
  16009. * words are already an array, it is returned.
  16010. *
  16011. * @param {String/Array} words
  16012. */
  16013. splitWords: function(words) {
  16014. if (words && typeof words == 'string') {
  16015. return words.replace(basicTrimRe, '').split(whitespaceRe);
  16016. }
  16017. return words || [];
  16018. }
  16019. };
  16020. }());
  16021. // initialize the default encode / decode entities
  16022. Ext.String.resetCharacterEntities();
  16023. /**
  16024. * @method htmlEncode
  16025. * @member Ext
  16026. * @inheritdoc Ext.String#htmlEncode
  16027. */
  16028. Ext.htmlEncode = Ext.String.htmlEncode;
  16029. /**
  16030. * @method htmlDecode
  16031. * @member Ext
  16032. * @inheritdoc Ext.String#htmlDecode
  16033. */
  16034. Ext.htmlDecode = Ext.String.htmlDecode;
  16035. /**
  16036. * @method urlAppend
  16037. * @member Ext
  16038. * @inheritdoc Ext.String#urlAppend
  16039. */
  16040. Ext.urlAppend = Ext.String.urlAppend;
  16041. /**
  16042. * @class Ext.Date
  16043. * This class defines some basic methods for handling dates.
  16044. *
  16045. * The date parsing and formatting syntax contains a subset of
  16046. * [PHP's `date()` function](http://www.php.net/date), and the formats that are
  16047. * supported will provide results equivalent to their PHP versions.
  16048. *
  16049. * The following is a list of all currently supported formats:
  16050. *
  16051. * Format Description Example returned values
  16052. * ------ ----------------------------------------------------------------------- -----------------------
  16053. * d Day of the month, 2 digits with leading zeros 01 to 31
  16054. * D A short textual representation of the day of the week Mon to Sun
  16055. * j Day of the month without leading zeros 1 to 31
  16056. * l A full textual representation of the day of the week Sunday to Saturday
  16057. * N ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday)
  16058. * S English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j
  16059. * w Numeric representation of the day of the week 0 (for Sunday) to 6 (for Saturday)
  16060. * z The day of the year (starting from 0) 0 to 364 (365 in leap years)
  16061. * W ISO-8601 week number of year, weeks starting on Monday 01 to 53
  16062. * F A full textual representation of a month, such as January or March January to December
  16063. * m Numeric representation of a month, with leading zeros 01 to 12
  16064. * M A short textual representation of a month Jan to Dec
  16065. * n Numeric representation of a month, without leading zeros 1 to 12
  16066. * t Number of days in the given month 28 to 31
  16067. * L Whether it&#39;s a leap year 1 if it is a leap year, 0 otherwise.
  16068. * o ISO-8601 year number (identical to (Y), but if the ISO week number (W) Examples: 1998 or 2004
  16069. * belongs to the previous or next year, that year is used instead)
  16070. * Y A full numeric representation of a year, 4 digits Examples: 1999 or 2003
  16071. * y A two digit representation of a year Examples: 99 or 03
  16072. * a Lowercase Ante meridiem and Post meridiem am or pm
  16073. * A Uppercase Ante meridiem and Post meridiem AM or PM
  16074. * g 12-hour format of an hour without leading zeros 1 to 12
  16075. * G 24-hour format of an hour without leading zeros 0 to 23
  16076. * h 12-hour format of an hour with leading zeros 01 to 12
  16077. * H 24-hour format of an hour with leading zeros 00 to 23
  16078. * i Minutes, with leading zeros 00 to 59
  16079. * s Seconds, with leading zeros 00 to 59
  16080. * u Decimal fraction of a second Examples:
  16081. * (minimum 1 digit, arbitrary number of digits allowed) 001 (i.e. 0.001s) or
  16082. * 100 (i.e. 0.100s) or
  16083. * 999 (i.e. 0.999s) or
  16084. * 999876543210 (i.e. 0.999876543210s)
  16085. * O Difference to Greenwich time (GMT) in hours and minutes Example: +1030
  16086. * P Difference to Greenwich time (GMT) with colon between hours and minutes Example: -08:00
  16087. * T Timezone abbreviation of the machine running the code Examples: EST, MDT, PDT ...
  16088. * Z Timezone offset in seconds (negative if west of UTC, positive if east) -43200 to 50400
  16089. * c ISO 8601 date represented as the local time with an offset to UTC appended.
  16090. * Notes: Examples:
  16091. * 1) If unspecified, the month / day defaults to the current month / day, 1991 or
  16092. * the time defaults to midnight, while the timezone defaults to the 1992-10 or
  16093. * browser's timezone. If a time is specified, it must include both hours 1993-09-20 or
  16094. * and minutes. The "T" delimiter, seconds, milliseconds and timezone 1994-08-19T16:20+01:00 or
  16095. * are optional. 1995-07-18T17:21:28-02:00 or
  16096. * 2) The decimal fraction of a second, if specified, must contain at 1996-06-17T18:22:29.98765+03:00 or
  16097. * least 1 digit (there is no limit to the maximum number 1997-05-16T19:23:30,12345-0400 or
  16098. * of digits allowed), and may be delimited by either a '.' or a ',' 1998-04-15T20:24:31.2468Z or
  16099. * Refer to the examples on the right for the various levels of 1999-03-14T20:24:32Z or
  16100. * date-time granularity which are supported, or see 2000-02-13T21:25:33
  16101. * http://www.w3.org/TR/NOTE-datetime for more info. 2001-01-12 22:26:34
  16102. * C An ISO date string as implemented by the native Date object's 1962-06-17T09:21:34.125Z
  16103. * [Date.toISOString](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
  16104. * method. This outputs the numeric part with *UTC* hour and minute
  16105. * values, and indicates this by appending the `'Z'` timezone
  16106. * identifier.
  16107. * U Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) 1193432466 or -2138434463
  16108. * MS Microsoft AJAX serialized dates \/Date(1238606590509)\/ (i.e. UTC milliseconds since epoch) or
  16109. * \/Date(1238606590509+0800)\/
  16110. * time A javascript millisecond timestamp 1350024476440
  16111. * timestamp A UNIX timestamp (same as U) 1350024866
  16112. *
  16113. * Example usage (note that you must escape format specifiers with '\\' to render them as character literals):
  16114. *
  16115. * // Sample date:
  16116. * // 'Wed Jan 10 2007 15:05:01 GMT-0600 (Central Standard Time)'
  16117. *
  16118. * var dt = new Date('1/10/2007 03:05:01 PM GMT-0600');
  16119. * console.log(Ext.Date.format(dt, 'Y-m-d')); // 2007-01-10
  16120. * console.log(Ext.Date.format(dt, 'F j, Y, g:i a')); // January 10, 2007, 3:05 pm
  16121. * console.log(Ext.Date.format(dt, 'l, \\t\\he jS \\of F Y h:i:s A')); // Wednesday, the 10th of January 2007 03:05:01 PM
  16122. *
  16123. * Here are some standard date/time patterns that you might find helpful. They
  16124. * are not part of the source of Ext.Date, but to use them you can simply copy this
  16125. * block of code into any script that is included after Ext.Date and they will also become
  16126. * globally available on the Date object. Feel free to add or remove patterns as needed in your code.
  16127. *
  16128. * Ext.Date.patterns = {
  16129. * ISO8601Long:"Y-m-d H:i:s",
  16130. * ISO8601Short:"Y-m-d",
  16131. * ShortDate: "n/j/Y",
  16132. * LongDate: "l, F d, Y",
  16133. * FullDateTime: "l, F d, Y g:i:s A",
  16134. * MonthDay: "F d",
  16135. * ShortTime: "g:i A",
  16136. * LongTime: "g:i:s A",
  16137. * SortableDateTime: "Y-m-d\\TH:i:s",
  16138. * UniversalSortableDateTime: "Y-m-d H:i:sO",
  16139. * YearMonth: "F, Y"
  16140. * };
  16141. *
  16142. * Example usage:
  16143. *
  16144. * var dt = new Date();
  16145. * console.log(Ext.Date.format(dt, Ext.Date.patterns.ShortDate));
  16146. *
  16147. * Developer-written, custom formats may be used by supplying both a formatting and a parsing function
  16148. * which perform to specialized requirements. The functions are stored in {@link #parseFunctions} and {@link #formatFunctions}.
  16149. * @singleton
  16150. */
  16151. Ext.Date = (function() {
  16152. // @define Ext.lang.Date
  16153. // @define Ext.Date
  16154. // @require Ext
  16155. // @require Ext.lang.String
  16156. var utilDate,
  16157. nativeDate = Date,
  16158. stripEscapeRe = /(\\.)/g,
  16159. hourInfoRe = /([gGhHisucUOPZ]|MS)/,
  16160. dateInfoRe = /([djzmnYycU]|MS)/,
  16161. slashRe = /\\/gi,
  16162. numberTokenRe = /\{(\d+)\}/g,
  16163. MSFormatRe = new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/'),
  16164. pad = Ext.String.leftPad,
  16165. monthInfo = {
  16166. F: true,
  16167. m: true,
  16168. M: true,
  16169. n: true
  16170. },
  16171. yearInfo = {
  16172. o: true,
  16173. Y: true,
  16174. y: true
  16175. },
  16176. // Most of the date-formatting functions below are the excellent work of Baron Schwartz.
  16177. // (see http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/)
  16178. // They generate precompiled functions from format patterns instead of parsing and
  16179. // processing each pattern every time a date is formatted.
  16180. code = [
  16181. // date calculations (note: the code below creates a dependency on Ext.Number.from())
  16182. "var me = this, dt, y, m, d, h, i, s, ms, o, O, z, zz, u, v, W, year, jan4, week1monday, daysInMonth, dayMatched,",
  16183. "def = me.defaults,",
  16184. "from = Ext.Number.from,",
  16185. "results = String(input).match(me.parseRegexes[{0}]);",
  16186. // either null, or an array of matched strings
  16187. "if(results){",
  16188. "{1}",
  16189. "if(u != null){",
  16190. // i.e. unix time is defined
  16191. "v = new Date(u * 1000);",
  16192. // give top priority to UNIX time
  16193. "}else{",
  16194. // create Date object representing midnight of the current day;
  16195. // this will provide us with our date defaults
  16196. // (note: clearTime() handles Daylight Saving Time automatically)
  16197. "dt = me.clearTime(new Date);",
  16198. "y = from(y, from(def.y, dt.getFullYear()));",
  16199. "m = from(m, from(def.m - 1, dt.getMonth()));",
  16200. "dayMatched = d !== undefined;",
  16201. "d = from(d, from(def.d, dt.getDate()));",
  16202. // Attempt to validate the day. Since it defaults to today, it may go out
  16203. // of range, for example parsing m/Y where the value is 02/2000 on the 31st of May.
  16204. // It will attempt to parse 2000/02/31, which will overflow to March and end up
  16205. // returning 03/2000. We only do this when we default the day. If an invalid day value
  16206. // was set to be parsed by the user, continue on and either let it overflow or return null
  16207. // depending on the strict value. This will be in line with the normal Date behaviour.
  16208. "if (!dayMatched) {",
  16209. "dt.setDate(1);",
  16210. "dt.setMonth(m);",
  16211. "dt.setFullYear(y);",
  16212. "daysInMonth = me.getDaysInMonth(dt);",
  16213. "if (d > daysInMonth) {",
  16214. "d = daysInMonth;",
  16215. "}",
  16216. "}",
  16217. "h = from(h, from(def.h, dt.getHours()));",
  16218. "i = from(i, from(def.i, dt.getMinutes()));",
  16219. "s = from(s, from(def.s, dt.getSeconds()));",
  16220. "ms = from(ms, from(def.ms, dt.getMilliseconds()));",
  16221. "if(z >= 0 && y >= 0){",
  16222. // both the year and zero-based day of year are defined and >= 0.
  16223. // these 2 values alone provide sufficient info to create a full date object
  16224. // create Date object representing January 1st for the given year
  16225. // handle years < 100 appropriately
  16226. "v = me.add(new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);",
  16227. // then add day of year, checking for Date "rollover" if necessary
  16228. "v = !strict? v : (strict === true && (z <= 364 || (me.isLeapYear(v) && z <= 365))? me.add(v, me.DAY, z) : null);",
  16229. "}else if(strict === true && !me.isValid(y, m + 1, d, h, i, s, ms)){",
  16230. // check for Date "rollover"
  16231. "v = null;",
  16232. // invalid date, so return null
  16233. "}else{",
  16234. "if (W) {",
  16235. // support ISO-8601
  16236. // http://en.wikipedia.org/wiki/ISO_week_date
  16237. //
  16238. // Mutually equivalent definitions for week 01 are:
  16239. // a. the week starting with the Monday which is nearest in time to 1 January
  16240. // b. the week with 4 January in it
  16241. // ... there are many others ...
  16242. //
  16243. // We'll use letter b above to determine the first week of the year.
  16244. //
  16245. // So, first get a Date object for January 4th of whatever calendar year is desired.
  16246. //
  16247. // Then, the first Monday of the year can easily be determined by (operating on this Date):
  16248. // 1. Getting the day of the week.
  16249. // 2. Subtracting that by one.
  16250. // 3. Multiplying that by 86400000 (one day in ms).
  16251. // 4. Subtracting this number of days (in ms) from the January 4 date (represented in ms).
  16252. //
  16253. // Example #1 ...
  16254. //
  16255. // January 2012
  16256. // Su Mo Tu We Th Fr Sa
  16257. // 1 2 3 4 5 6 7
  16258. // 8 9 10 11 12 13 14
  16259. // 15 16 17 18 19 20 21
  16260. // 22 23 24 25 26 27 28
  16261. // 29 30 31
  16262. //
  16263. // 1. January 4th is a Wednesday.
  16264. // 2. Its day number is 3.
  16265. // 3. Simply substract 2 days from Wednesday.
  16266. // 4. The first week of the year begins on Monday, January 2. Simple!
  16267. //
  16268. // Example #2 ...
  16269. // January 1992
  16270. // Su Mo Tu We Th Fr Sa
  16271. // 1 2 3 4
  16272. // 5 6 7 8 9 10 11
  16273. // 12 13 14 15 16 17 18
  16274. // 19 20 21 22 23 24 25
  16275. // 26 27 28 29 30 31
  16276. //
  16277. // 1. January 4th is a Saturday.
  16278. // 2. Its day number is 6.
  16279. // 3. Simply subtract 5 days from Saturday.
  16280. // 4. The first week of the year begins on Monday, December 30. Simple!
  16281. //
  16282. // v = Ext.Date.clearTime(new Date(week1monday.getTime() + ((W - 1) * 604800000 + 43200000)));
  16283. // (This is essentially doing the same thing as above but for the week rather than the day)
  16284. "year = y || (new Date()).getFullYear();",
  16285. "jan4 = new Date(year, 0, 4, 0, 0, 0);",
  16286. "d = jan4.getDay();",
  16287. // If the 1st is a Thursday, then the 4th will be a Sunday, so we need the appropriate
  16288. // day number here, which is why we use the day === checks.
  16289. "week1monday = new Date(jan4.getTime() - ((d === 0 ? 6 : d - 1) * 86400000));",
  16290. // The reason for adding 43200000 (12 hours) is to avoid any complication with daylight saving
  16291. // switch overs. For example, if the clock is rolled back, an hour will repeat, so adding 7 days
  16292. // will leave us 1 hour short (Sun <date> 23:00:00). By setting is to 12:00, subtraction
  16293. // or addition of an hour won't make any difference.
  16294. "v = Ext.Date.clearTime(new Date(week1monday.getTime() + ((W - 1) * 604800000 + 43200000)));",
  16295. "} else {",
  16296. // plain old Date object
  16297. // handle years < 100 properly
  16298. "v = me.add(new Date(y < 100 ? 100 : y, m, d, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);",
  16299. "}",
  16300. "}",
  16301. "}",
  16302. "}",
  16303. "if(v){",
  16304. // favor UTC offset over GMT offset
  16305. "if(zz != null){",
  16306. // reset to UTC, then add offset
  16307. "v = me.add(v, me.SECOND, -v.getTimezoneOffset() * 60 - zz);",
  16308. "}else if(o){",
  16309. // reset to GMT, then add offset
  16310. "v = me.add(v, me.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));",
  16311. "}",
  16312. "}",
  16313. "return (v != null) ? v : null;"
  16314. ].join('\n');
  16315. // Polyfill Date's toISOString instance method where not implemented.
  16316. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
  16317. // TODO: Remove this when IE8 retires.
  16318. if (!Date.prototype.toISOString) {
  16319. Date.prototype.toISOString = function() {
  16320. var me = this;
  16321. return pad(me.getUTCFullYear(), 4, '0') + '-' + pad(me.getUTCMonth() + 1, 2, '0') + '-' + pad(me.getUTCDate(), 2, '0') + 'T' + pad(me.getUTCHours(), 2, '0') + ':' + pad(me.getUTCMinutes(), 2, '0') + ':' + pad(me.getUTCSeconds(), 2, '0') + '.' + pad(me.getUTCMilliseconds(), 3, '0') + 'Z';
  16322. };
  16323. }
  16324. /**
  16325. * @method xf
  16326. * @private
  16327. * @param format
  16328. * Create private copy of Ext JS's `Ext.util.Format.format()` method
  16329. * + to remove unnecessary dependency
  16330. * + to resolve namespace conflict with MS-Ajax's implementation
  16331. */
  16332. function xf(format) {
  16333. var args = Array.prototype.slice.call(arguments, 1);
  16334. return format.replace(numberTokenRe, function(m, i) {
  16335. return args[i];
  16336. });
  16337. }
  16338. utilDate = {
  16339. /** @ignore */
  16340. now: nativeDate.now,
  16341. // always available due to polyfill in Ext.js
  16342. /**
  16343. * @private
  16344. */
  16345. toString: function(date) {
  16346. if (!date) {
  16347. date = new nativeDate();
  16348. }
  16349. return date.getFullYear() + "-" + pad(date.getMonth() + 1, 2, '0') + "-" + pad(date.getDate(), 2, '0') + "T" + pad(date.getHours(), 2, '0') + ":" + pad(date.getMinutes(), 2, '0') + ":" + pad(date.getSeconds(), 2, '0');
  16350. },
  16351. /**
  16352. * Returns the number of milliseconds between two dates.
  16353. * @param {Date} dateA The first date.
  16354. * @param {Date} [dateB=new Date()] (optional) The second date.
  16355. * @return {Number} The difference in milliseconds
  16356. */
  16357. getElapsed: function(dateA, dateB) {
  16358. return Math.abs(dateA - (dateB || utilDate.now()));
  16359. },
  16360. /**
  16361. * Global flag which determines if strict date parsing should be used.
  16362. * Strict date parsing will not roll-over invalid dates, which is the
  16363. * default behavior of JavaScript Date objects.
  16364. * (see {@link #parse} for more information)
  16365. * @type Boolean
  16366. */
  16367. useStrict: false,
  16368. /**
  16369. * @private
  16370. */
  16371. formatCodeToRegex: function(character, currentGroup) {
  16372. // Note: currentGroup - position in regex result array (see notes for Ext.Date.parseCodes below)
  16373. var p = utilDate.parseCodes[character];
  16374. if (p) {
  16375. p = typeof p === 'function' ? p() : p;
  16376. utilDate.parseCodes[character] = p;
  16377. }
  16378. // reassign function result to prevent repeated execution
  16379. return p ? Ext.applyIf({
  16380. c: p.c ? xf(p.c, currentGroup || "{0}") : p.c
  16381. }, p) : {
  16382. g: 0,
  16383. c: null,
  16384. s: Ext.String.escapeRegex(character)
  16385. };
  16386. },
  16387. // treat unrecognized characters as literals
  16388. /**
  16389. * An object hash in which each property is a date parsing function. The property name is the
  16390. * format string which that function parses.
  16391. *
  16392. * This object is automatically populated with date parsing functions as
  16393. * date formats are requested for Ext standard formatting strings.
  16394. *
  16395. * Custom parsing functions may be inserted into this object, keyed by a name which from then on
  16396. * may be used as a format string to {@link #parse}.
  16397. *
  16398. * Example:
  16399. *
  16400. * Ext.Date.parseFunctions['x-date-format'] = myDateParser;
  16401. *
  16402. * A parsing function should return a Date object, and is passed the following parameters:
  16403. *
  16404. * - `date`: {@link String} - The date string to parse.
  16405. * - `strict`: {@link Boolean} - `true` to validate date strings while parsing
  16406. * (i.e. prevent JavaScript Date "rollover"). __The default must be `false`.__
  16407. * Invalid date strings should return `null` when parsed.
  16408. *
  16409. * To enable Dates to also be _formatted_ according to that format, a corresponding
  16410. * formatting function must be placed into the {@link #formatFunctions} property.
  16411. * @property parseFunctions
  16412. * @type Object
  16413. */
  16414. parseFunctions: {
  16415. "MS": function(input, strict) {
  16416. // note: the timezone offset is ignored since the MS Ajax server sends
  16417. // a UTC milliseconds-since-Unix-epoch value (negative values are allowed)
  16418. var r = (input || '').match(MSFormatRe);
  16419. return r ? new nativeDate(((r[1] || '') + r[2]) * 1) : null;
  16420. },
  16421. "time": function(input, strict) {
  16422. var num = parseInt(input, 10);
  16423. if (num || num === 0) {
  16424. return new nativeDate(num);
  16425. }
  16426. return null;
  16427. },
  16428. "timestamp": function(input, strict) {
  16429. var num = parseInt(input, 10);
  16430. if (num || num === 0) {
  16431. return new nativeDate(num * 1000);
  16432. }
  16433. return null;
  16434. }
  16435. },
  16436. parseRegexes: [],
  16437. /**
  16438. * An object hash in which each property is a date formatting function. The property name is the
  16439. * format string which corresponds to the produced formatted date string.
  16440. *
  16441. * This object is automatically populated with date formatting functions as
  16442. * date formats are requested for Ext standard formatting strings.
  16443. *
  16444. * Custom formatting functions may be inserted into this object, keyed by a name which from then on
  16445. * may be used as a format string to {@link #format}.
  16446. *
  16447. * Example:
  16448. *
  16449. * Ext.Date.formatFunctions['x-date-format'] = myDateFormatter;
  16450. *
  16451. * A formatting function should return a string representation of the Date object which
  16452. * is the scope (this) of the function.
  16453. *
  16454. * To enable date strings to also be _parsed_ according to that format, a corresponding
  16455. * parsing function must be placed into the {@link #parseFunctions} property.
  16456. * @property formatFunctions
  16457. * @type Object
  16458. */
  16459. formatFunctions: {
  16460. "MS": function() {
  16461. // UTC milliseconds since Unix epoch (MS-AJAX serialized date format (MRSF))
  16462. return '\\/Date(' + this.getTime() + ')\\/';
  16463. },
  16464. "time": function() {
  16465. return this.getTime().toString();
  16466. },
  16467. "timestamp": function() {
  16468. return utilDate.format(this, 'U');
  16469. }
  16470. },
  16471. y2kYear: 50,
  16472. /**
  16473. * Date interval constant.
  16474. * @type String
  16475. */
  16476. MILLI: "ms",
  16477. /**
  16478. * Date interval constant.
  16479. * @type String
  16480. */
  16481. SECOND: "s",
  16482. /**
  16483. * Date interval constant.
  16484. * @type String
  16485. */
  16486. MINUTE: "mi",
  16487. /** Date interval constant.
  16488. * @type String
  16489. */
  16490. HOUR: "h",
  16491. /**
  16492. * Date interval constant.
  16493. * @type String
  16494. */
  16495. DAY: "d",
  16496. /**
  16497. * Date interval constant.
  16498. * @type String
  16499. */
  16500. MONTH: "mo",
  16501. /**
  16502. * Date interval constant.
  16503. * @type String
  16504. */
  16505. YEAR: "y",
  16506. /**
  16507. * The number of days in a week.
  16508. * @type Number
  16509. */
  16510. DAYS_IN_WEEK: 7,
  16511. /**
  16512. * The number of months in a year.
  16513. * @type Number
  16514. */
  16515. MONTHS_IN_YEAR: 12,
  16516. /**
  16517. * The maximum number of days in a month.
  16518. * @type {Number}
  16519. */
  16520. MAX_DAYS_IN_MONTH: 31,
  16521. SUNDAY: 0,
  16522. MONDAY: 1,
  16523. TUESDAY: 2,
  16524. WEDNESDAY: 3,
  16525. THURSDAY: 4,
  16526. FRIDAY: 5,
  16527. SATURDAY: 6,
  16528. /**
  16529. * An object hash containing default date values used during date parsing.
  16530. *
  16531. * The following properties are available:
  16532. *
  16533. * - `y`: {@link Number} - The default year value. Defaults to `undefined`.
  16534. * - `m`: {@link Number} - The default 1-based month value. Defaults to `undefined`.
  16535. * - `d`: {@link Number} - The default day value. Defaults to `undefined`.
  16536. * - `h`: {@link Number} - The default hour value. Defaults to `undefined`.
  16537. * - `i`: {@link Number} - The default minute value. Defaults to `undefined`.
  16538. * - `s`: {@link Number} - The default second value. Defaults to `undefined`.
  16539. * - `ms`: {@link Number} - The default millisecond value. Defaults to `undefined`.
  16540. *
  16541. * Override these properties to customize the default date values used by the {@link #parse} method.
  16542. *
  16543. * __Note:__ In countries which experience Daylight Saving Time (i.e. DST), the `h`, `i`, `s`
  16544. * and `ms` properties may coincide with the exact time in which DST takes effect.
  16545. * It is the responsibility of the developer to account for this.
  16546. *
  16547. * Example Usage:
  16548. *
  16549. * // set default day value to the first day of the month
  16550. * Ext.Date.defaults.d = 1;
  16551. *
  16552. * // parse a February date string containing only year and month values.
  16553. * // setting the default day value to 1 prevents weird date rollover issues
  16554. * // when attempting to parse the following date string on, for example, March 31st 2009.
  16555. * Ext.Date.parse('2009-02', 'Y-m'); // returns a Date object representing February 1st 2009.
  16556. *
  16557. * @property defaults
  16558. * @type Object
  16559. */
  16560. defaults: {},
  16561. /**
  16562. * @property {String[]} dayNames
  16563. * An array of textual day names.
  16564. * Override these values for international dates.
  16565. *
  16566. * Example:
  16567. *
  16568. * Ext.Date.dayNames = [
  16569. * 'SundayInYourLang',
  16570. * 'MondayInYourLang'
  16571. * // ...
  16572. * ];
  16573. * @locale
  16574. */
  16575. dayNames: [
  16576. "Sunday",
  16577. "Monday",
  16578. "Tuesday",
  16579. "Wednesday",
  16580. "Thursday",
  16581. "Friday",
  16582. "Saturday"
  16583. ],
  16584. /**
  16585. * @property {String[]} monthNames
  16586. * An array of textual month names.
  16587. * Override these values for international dates.
  16588. *
  16589. * Example:
  16590. *
  16591. * Ext.Date.monthNames = [
  16592. * 'JanInYourLang',
  16593. * 'FebInYourLang'
  16594. * // ...
  16595. * ];
  16596. * @locale
  16597. */
  16598. monthNames: [
  16599. "January",
  16600. "February",
  16601. "March",
  16602. "April",
  16603. "May",
  16604. "June",
  16605. "July",
  16606. "August",
  16607. "September",
  16608. "October",
  16609. "November",
  16610. "December"
  16611. ],
  16612. /**
  16613. * @property {Object} monthNumbers
  16614. * An object hash of zero-based JavaScript month numbers (with short month names as keys).
  16615. *
  16616. * __Note:__ keys are case-sensitive.
  16617. *
  16618. * Override these values for international dates.
  16619. *
  16620. * Example:
  16621. *
  16622. * Ext.Date.monthNumbers = {
  16623. * 'LongJanNameInYourLang': 0,
  16624. * 'ShortJanNameInYourLang':0,
  16625. * 'LongFebNameInYourLang':1,
  16626. * 'ShortFebNameInYourLang':1
  16627. * // ...
  16628. * };
  16629. * @locale
  16630. */
  16631. monthNumbers: {
  16632. January: 0,
  16633. Jan: 0,
  16634. February: 1,
  16635. Feb: 1,
  16636. March: 2,
  16637. Mar: 2,
  16638. April: 3,
  16639. Apr: 3,
  16640. May: 4,
  16641. June: 5,
  16642. Jun: 5,
  16643. July: 6,
  16644. Jul: 6,
  16645. August: 7,
  16646. Aug: 7,
  16647. September: 8,
  16648. Sep: 8,
  16649. October: 9,
  16650. Oct: 9,
  16651. November: 10,
  16652. Nov: 10,
  16653. December: 11,
  16654. Dec: 11
  16655. },
  16656. /**
  16657. * @property {String} defaultFormat
  16658. * The date format string that the {@link Ext.util.Format#dateRenderer}
  16659. * and {@link Ext.util.Format#date} functions use. See {@link Ext.Date} for details.
  16660. *
  16661. * This may be overridden in a locale file.
  16662. * @locale
  16663. */
  16664. defaultFormat: 'm/d/Y',
  16665. /**
  16666. * @property {String} defaultTimeFormat
  16667. * The default time format.
  16668. *
  16669. * This may be overridden in a locale file.
  16670. * @locale
  16671. */
  16672. defaultTimeFormat: 'h:i A',
  16673. /**
  16674. * @property {Number} firstDayOfWeek
  16675. * The day on which the week starts. `0` being Sunday, through `6` being Saturday.
  16676. *
  16677. * This may be overridden in a locale file.
  16678. * @locale
  16679. */
  16680. firstDayOfWeek: 0,
  16681. /**
  16682. * @property {Number[]} weekendDays
  16683. * The days on which weekend falls. `0` being Sunday, through `6` being Saturday.
  16684. *
  16685. * This may be overridden in a locale file.
  16686. * @locale
  16687. */
  16688. weekendDays: [
  16689. 0,
  16690. 6
  16691. ],
  16692. /**
  16693. * Get the short month name for the given month number.
  16694. * Override this function for international dates.
  16695. * @param {Number} month A zero-based JavaScript month number.
  16696. * @return {String} The short month name.
  16697. * @locale
  16698. */
  16699. getShortMonthName: function(month) {
  16700. return utilDate.monthNames[month].substring(0, 3);
  16701. },
  16702. /**
  16703. * Get the short day name for the given day number.
  16704. * Override this function for international dates.
  16705. * @param {Number} day A zero-based JavaScript day number.
  16706. * @return {String} The short day name.
  16707. * @locale
  16708. */
  16709. getShortDayName: function(day) {
  16710. return utilDate.dayNames[day].substring(0, 3);
  16711. },
  16712. /**
  16713. * Get the zero-based JavaScript month number for the given short/full month name.
  16714. * Override this function for international dates.
  16715. * @param {String} name The short/full month name.
  16716. * @return {Number} The zero-based JavaScript month number.
  16717. * @locale
  16718. */
  16719. getMonthNumber: function(name) {
  16720. // handle camel casing for English month names (since the keys for the Ext.Date.monthNumbers hash are case sensitive)
  16721. return utilDate.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
  16722. },
  16723. /**
  16724. * Checks if the specified format contains hour information
  16725. * @param {String} format The format to check
  16726. * @return {Boolean} True if the format contains hour information
  16727. * @method
  16728. */
  16729. formatContainsHourInfo: function(format) {
  16730. return hourInfoRe.test(format.replace(stripEscapeRe, ''));
  16731. },
  16732. /**
  16733. * Checks if the specified format contains information about
  16734. * anything other than the time.
  16735. * @param {String} format The format to check
  16736. * @return {Boolean} True if the format contains information about
  16737. * date/day information.
  16738. * @method
  16739. */
  16740. formatContainsDateInfo: function(format) {
  16741. return dateInfoRe.test(format.replace(stripEscapeRe, ''));
  16742. },
  16743. /**
  16744. * @private
  16745. * Checks if the specified format contains only month information.
  16746. *
  16747. * @param {String} format Format to check
  16748. *
  16749. * @return {Boolean}
  16750. */
  16751. isMonthFormat: function(format) {
  16752. return !!monthInfo[format];
  16753. },
  16754. /**
  16755. * @private
  16756. * Checks if the specified format contains only year information.
  16757. *
  16758. * @param {String} format Format to check.
  16759. *
  16760. * @return {Boolean}
  16761. */
  16762. isYearFormat: function(format) {
  16763. return !!yearInfo[format];
  16764. },
  16765. /**
  16766. * Removes all escaping for a date format string. In date formats,
  16767. * using a '\' can be used to escape special characters.
  16768. * @param {String} format The format to unescape
  16769. * @return {String} The unescaped format
  16770. * @method
  16771. */
  16772. unescapeFormat: function(format) {
  16773. // Escape the format, since \ can be used to escape special
  16774. // characters in a date format. For example, in a Spanish
  16775. // locale the format may be: 'd \\de F \\de Y'
  16776. return format.replace(slashRe, '');
  16777. },
  16778. /**
  16779. * The base format-code to formatting-function hashmap used by the {@link #format} method.
  16780. * Formatting functions are strings (or functions which return strings) which
  16781. * will return the appropriate value when evaluated in the context of the Date object
  16782. * from which the {@link #format} method is called.
  16783. * Add to / override these mappings for custom date formatting.
  16784. *
  16785. * __Note:__ `Ext.Date.format()` treats characters as literals if an appropriate mapping cannot be found.
  16786. *
  16787. * Example:
  16788. *
  16789. * Ext.Date.formatCodes.x = "Ext.util.Format.leftPad(this.getDate(), 2, '0')";
  16790. * console.log(Ext.Date.format(new Date(), 'X'); // returns the current day of the month
  16791. * @type Object
  16792. */
  16793. formatCodes: {
  16794. d: "Ext.String.leftPad(m.getDate(), 2, '0')",
  16795. D: "Ext.Date.getShortDayName(m.getDay())",
  16796. // get localized short day name
  16797. j: "m.getDate()",
  16798. l: "Ext.Date.dayNames[m.getDay()]",
  16799. N: "(m.getDay() ? m.getDay() : 7)",
  16800. S: "Ext.Date.getSuffix(m)",
  16801. w: "m.getDay()",
  16802. z: "Ext.Date.getDayOfYear(m)",
  16803. W: "Ext.String.leftPad(Ext.Date.getWeekOfYear(m), 2, '0')",
  16804. F: "Ext.Date.monthNames[m.getMonth()]",
  16805. m: "Ext.String.leftPad(m.getMonth() + 1, 2, '0')",
  16806. M: "Ext.Date.getShortMonthName(m.getMonth())",
  16807. // get localized short month name
  16808. n: "(m.getMonth() + 1)",
  16809. t: "Ext.Date.getDaysInMonth(m)",
  16810. L: "(Ext.Date.isLeapYear(m) ? 1 : 0)",
  16811. o: "(m.getFullYear() + (Ext.Date.getWeekOfYear(m) == 1 && m.getMonth() > 0 ? +1 : (Ext.Date.getWeekOfYear(m) >= 52 && m.getMonth() < 11 ? -1 : 0)))",
  16812. Y: "Ext.String.leftPad(m.getFullYear(), 4, '0')",
  16813. y: "('' + m.getFullYear()).substring(2, 4)",
  16814. a: "(m.getHours() < 12 ? 'am' : 'pm')",
  16815. A: "(m.getHours() < 12 ? 'AM' : 'PM')",
  16816. g: "((m.getHours() % 12) ? m.getHours() % 12 : 12)",
  16817. G: "m.getHours()",
  16818. h: "Ext.String.leftPad((m.getHours() % 12) ? m.getHours() % 12 : 12, 2, '0')",
  16819. H: "Ext.String.leftPad(m.getHours(), 2, '0')",
  16820. i: "Ext.String.leftPad(m.getMinutes(), 2, '0')",
  16821. s: "Ext.String.leftPad(m.getSeconds(), 2, '0')",
  16822. u: "Ext.String.leftPad(m.getMilliseconds(), 3, '0')",
  16823. O: "Ext.Date.getGMTOffset(m)",
  16824. P: "Ext.Date.getGMTOffset(m, true)",
  16825. T: "Ext.Date.getTimezone(m)",
  16826. Z: "(m.getTimezoneOffset() * -60)",
  16827. c: function() {
  16828. // ISO-8601 -- GMT format
  16829. var c = "Y-m-dTH:i:sP",
  16830. code = [],
  16831. i,
  16832. l = c.length,
  16833. e;
  16834. for (i = 0; i < l; ++i) {
  16835. e = c.charAt(i);
  16836. code.push(e === "T" ? "'T'" : utilDate.getFormatCode(e));
  16837. }
  16838. // treat T as a character literal
  16839. return code.join(" + ");
  16840. },
  16841. C: function() {
  16842. // ISO-1601 -- browser format. UTC numerics with the 'Z' TZ id.
  16843. return 'm.toISOString()';
  16844. },
  16845. U: "Math.round(m.getTime() / 1000)"
  16846. },
  16847. /**
  16848. * Checks if the passed Date parameters will cause a JavaScript Date "rollover".
  16849. * @param {Number} year 4-digit year.
  16850. * @param {Number} month 1-based month-of-year.
  16851. * @param {Number} day Day of month.
  16852. * @param {Number} hour (optional) Hour.
  16853. * @param {Number} minute (optional) Minute.
  16854. * @param {Number} second (optional) Second.
  16855. * @param {Number} millisecond (optional) Millisecond.
  16856. * @return {Boolean} `true` if the passed parameters do not cause a Date "rollover", `false` otherwise.
  16857. */
  16858. isValid: function(year, month, day, hour, minute, second, millisecond) {
  16859. // setup defaults
  16860. hour = hour || 0;
  16861. minute = minute || 0;
  16862. second = second || 0;
  16863. millisecond = millisecond || 0;
  16864. // Special handling for year < 100
  16865. var dt = utilDate.add(new nativeDate(year < 100 ? 100 : year, month - 1, day, hour, minute, second, millisecond), utilDate.YEAR, year < 100 ? year - 100 : 0);
  16866. return year === dt.getFullYear() && month === dt.getMonth() + 1 && day === dt.getDate() && hour === dt.getHours() && minute === dt.getMinutes() && second === dt.getSeconds() && millisecond === dt.getMilliseconds();
  16867. },
  16868. /**
  16869. * Parses the passed string using the specified date format.
  16870. * Note that this function expects normal calendar dates, meaning that months are 1-based (i.e. 1 = January).
  16871. * The {@link #defaults} hash will be used for any date value (i.e. year, month, day, hour, minute, second or millisecond)
  16872. * which cannot be found in the passed string. If a corresponding default date value has not been specified in the {@link #defaults} hash,
  16873. * the current date's year, month, day or DST-adjusted zero-hour time value will be used instead.
  16874. * Keep in mind that the input date string must precisely match the specified format string
  16875. * in order for the parse operation to be successful (failed parse operations return a
  16876. * `null` value).
  16877. *
  16878. * Example:
  16879. *
  16880. * //dt = Fri May 25 2007 (current date)
  16881. * var dt = new Date();
  16882. *
  16883. * //dt = Thu May 25 2006 (today&#39;s month/day in 2006)
  16884. * dt = Ext.Date.parse("2006", "Y");
  16885. *
  16886. * //dt = Sun Jan 15 2006 (all date parts specified)
  16887. * dt = Ext.Date.parse("2006-01-15", "Y-m-d");
  16888. *
  16889. * //dt = Sun Jan 15 2006 15:20:01
  16890. * dt = Ext.Date.parse("2006-01-15 3:20:01 PM", "Y-m-d g:i:s A");
  16891. *
  16892. * // attempt to parse Sun Feb 29 2006 03:20:01 in strict mode
  16893. * dt = Ext.Date.parse("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null
  16894. *
  16895. * @param {String} input The raw date string.
  16896. * @param {String} format The expected date string format.
  16897. * @param {Boolean} [strict=false] (optional) `true` to validate date strings while parsing (i.e. prevents JavaScript Date "rollover").
  16898. * Invalid date strings will return `null` when parsed.
  16899. * @return {Date/null} The parsed Date, or `null` if an invalid date string.
  16900. */
  16901. parse: function(input, format, strict) {
  16902. var p = utilDate.parseFunctions;
  16903. if (p[format] == null) {
  16904. utilDate.createParser(format);
  16905. }
  16906. return p[format].call(utilDate, input, Ext.isDefined(strict) ? strict : utilDate.useStrict);
  16907. },
  16908. // Backwards compat
  16909. parseDate: function(input, format, strict) {
  16910. return utilDate.parse(input, format, strict);
  16911. },
  16912. /**
  16913. * @private
  16914. */
  16915. getFormatCode: function(character) {
  16916. var f = utilDate.formatCodes[character];
  16917. if (f) {
  16918. f = typeof f === 'function' ? f() : f;
  16919. utilDate.formatCodes[character] = f;
  16920. }
  16921. // reassign function result to prevent repeated execution
  16922. // note: unknown characters are treated as literals
  16923. return f || ("'" + Ext.String.escape(character) + "'");
  16924. },
  16925. /**
  16926. * @private
  16927. */
  16928. createFormat: function(format) {
  16929. var code = [],
  16930. special = false,
  16931. ch = '',
  16932. i;
  16933. for (i = 0; i < format.length; ++i) {
  16934. ch = format.charAt(i);
  16935. if (!special && ch === "\\") {
  16936. special = true;
  16937. } else if (special) {
  16938. special = false;
  16939. code.push("'" + Ext.String.escape(ch) + "'");
  16940. } else {
  16941. if (ch === '\n') {
  16942. code.push("'\\n'");
  16943. } else {
  16944. code.push(utilDate.getFormatCode(ch));
  16945. }
  16946. }
  16947. }
  16948. utilDate.formatFunctions[format] = Ext.functionFactory("var m=this;return " + code.join('+'));
  16949. },
  16950. /**
  16951. * @private
  16952. */
  16953. createParser: function(format) {
  16954. var regexNum = utilDate.parseRegexes.length,
  16955. currentGroup = 1,
  16956. calc = [],
  16957. regex = [],
  16958. special = false,
  16959. ch = "",
  16960. i = 0,
  16961. len = format.length,
  16962. atEnd = [],
  16963. obj;
  16964. for (; i < len; ++i) {
  16965. ch = format.charAt(i);
  16966. if (!special && ch === "\\") {
  16967. special = true;
  16968. } else if (special) {
  16969. special = false;
  16970. regex.push(Ext.String.escape(ch));
  16971. } else {
  16972. obj = utilDate.formatCodeToRegex(ch, currentGroup);
  16973. currentGroup += obj.g;
  16974. regex.push(obj.s);
  16975. if (obj.g && obj.c) {
  16976. if (obj.calcAtEnd) {
  16977. atEnd.push(obj.c);
  16978. } else {
  16979. calc.push(obj.c);
  16980. }
  16981. }
  16982. }
  16983. }
  16984. calc = calc.concat(atEnd);
  16985. utilDate.parseRegexes[regexNum] = new RegExp("^" + regex.join('') + "$", 'i');
  16986. utilDate.parseFunctions[format] = Ext.functionFactory("input", "strict", xf(code, regexNum, calc.join('')));
  16987. },
  16988. /**
  16989. * @private
  16990. */
  16991. parseCodes: {
  16992. // Notes:
  16993. // g = {Number} calculation group (0 or 1. only group 1 contributes to
  16994. // date calculations.)
  16995. // c = {String} calculation method (required for group 1. null for group 0.
  16996. // {0} = currentGroup - position in regex result array)
  16997. // s = {String} regex pattern. all matches are stored in results[], and are
  16998. // accessible by the calculation mapped to 'c'
  16999. d: {
  17000. g: 1,
  17001. c: "d = parseInt(results[{0}], 10);\n",
  17002. s: "(3[0-1]|[1-2][0-9]|0[1-9])"
  17003. },
  17004. // day of month with leading zeroes (01 - 31)
  17005. j: {
  17006. g: 1,
  17007. c: "d = parseInt(results[{0}], 10);\n",
  17008. s: "(3[0-1]|[1-2][0-9]|[1-9])"
  17009. },
  17010. // day of month without leading zeroes (1 - 31)
  17011. D: function() {
  17012. for (var a = [],
  17013. i = 0; i < 7; a.push(utilDate.getShortDayName(i)) , ++i){}
  17014. // get localised short day names
  17015. return {
  17016. g: 0,
  17017. c: null,
  17018. s: "(?:" + a.join("|") + ")"
  17019. };
  17020. },
  17021. l: function() {
  17022. return {
  17023. g: 0,
  17024. c: null,
  17025. s: "(?:" + utilDate.dayNames.join("|") + ")"
  17026. };
  17027. },
  17028. N: {
  17029. g: 0,
  17030. c: null,
  17031. s: "[1-7]"
  17032. },
  17033. // ISO-8601 day number (1 (monday) - 7 (sunday))
  17034. //<locale type="object" property="parseCodes">
  17035. S: {
  17036. g: 0,
  17037. c: null,
  17038. s: "(?:st|nd|rd|th)"
  17039. },
  17040. //</locale>
  17041. w: {
  17042. g: 0,
  17043. c: null,
  17044. s: "[0-6]"
  17045. },
  17046. // JavaScript day number (0 (sunday) - 6 (saturday))
  17047. z: {
  17048. g: 1,
  17049. c: "z = parseInt(results[{0}], 10);\n",
  17050. s: "(\\d{1,3})"
  17051. },
  17052. // day of the year (0 - 364 (365 in leap years))
  17053. W: {
  17054. g: 1,
  17055. c: "W = parseInt(results[{0}], 10);\n",
  17056. s: "(\\d{2})"
  17057. },
  17058. // ISO-8601 week number (with leading zero)
  17059. F: function() {
  17060. return {
  17061. g: 1,
  17062. c: "m = parseInt(me.getMonthNumber(results[{0}]), 10);\n",
  17063. // get localised month number
  17064. s: "(" + utilDate.monthNames.join("|") + ")"
  17065. };
  17066. },
  17067. M: function() {
  17068. for (var a = [],
  17069. i = 0; i < 12; a.push(utilDate.getShortMonthName(i)) , ++i){}
  17070. // get localised short month names
  17071. return Ext.applyIf({
  17072. s: "(" + a.join("|") + ")"
  17073. }, utilDate.formatCodeToRegex("F"));
  17074. },
  17075. m: {
  17076. g: 1,
  17077. c: "m = parseInt(results[{0}], 10) - 1;\n",
  17078. s: "(1[0-2]|0[1-9])"
  17079. },
  17080. // month number with leading zeros (01 - 12)
  17081. n: {
  17082. g: 1,
  17083. c: "m = parseInt(results[{0}], 10) - 1;\n",
  17084. s: "(1[0-2]|[1-9])"
  17085. },
  17086. // month number without leading zeros (1 - 12)
  17087. t: {
  17088. g: 0,
  17089. c: null,
  17090. s: "(?:\\d{2})"
  17091. },
  17092. // no. of days in the month (28 - 31)
  17093. L: {
  17094. g: 0,
  17095. c: null,
  17096. s: "(?:1|0)"
  17097. },
  17098. o: {
  17099. g: 1,
  17100. c: "y = parseInt(results[{0}], 10);\n",
  17101. s: "(\\d{4})"
  17102. },
  17103. // ISO-8601 year number (with leading zero)
  17104. Y: {
  17105. g: 1,
  17106. c: "y = parseInt(results[{0}], 10);\n",
  17107. s: "(\\d{4})"
  17108. },
  17109. // 4-digit year
  17110. y: {
  17111. g: 1,
  17112. c: "var ty = parseInt(results[{0}], 10);\n" + "y = ty > me.y2kYear ? 1900 + ty : 2000 + ty;\n",
  17113. // 2-digit year
  17114. s: "(\\d{2})"
  17115. },
  17116. // In the am/pm parsing routines, we allow both upper and lower case
  17117. // even though it doesn't exactly match the spec. It gives much more flexibility
  17118. // in being able to specify case insensitive regexes.
  17119. //<locale type="object" property="parseCodes">
  17120. a: {
  17121. g: 1,
  17122. c: "if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n" + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
  17123. s: "(am|pm|AM|PM)",
  17124. calcAtEnd: true
  17125. },
  17126. //</locale>
  17127. //<locale type="object" property="parseCodes">
  17128. A: {
  17129. g: 1,
  17130. c: "if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n" + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
  17131. s: "(AM|PM|am|pm)",
  17132. calcAtEnd: true
  17133. },
  17134. //</locale>
  17135. g: {
  17136. g: 1,
  17137. c: "h = parseInt(results[{0}], 10);\n",
  17138. s: "(1[0-2]|[1-9])"
  17139. },
  17140. // 12-hr format of an hour without leading zeroes (1 - 12)
  17141. G: {
  17142. g: 1,
  17143. c: "h = parseInt(results[{0}], 10);\n",
  17144. s: "(2[0-3]|1[0-9]|[0-9])"
  17145. },
  17146. // 24-hr format of an hour without leading zeroes (0 - 23)
  17147. h: {
  17148. g: 1,
  17149. c: "h = parseInt(results[{0}], 10);\n",
  17150. s: "(1[0-2]|0[1-9])"
  17151. },
  17152. // 12-hr format of an hour with leading zeroes (01 - 12)
  17153. H: {
  17154. g: 1,
  17155. c: "h = parseInt(results[{0}], 10);\n",
  17156. s: "(2[0-3]|[0-1][0-9])"
  17157. },
  17158. // 24-hr format of an hour with leading zeroes (00 - 23)
  17159. i: {
  17160. g: 1,
  17161. c: "i = parseInt(results[{0}], 10);\n",
  17162. s: "([0-5][0-9])"
  17163. },
  17164. // minutes with leading zeros (00 - 59)
  17165. s: {
  17166. g: 1,
  17167. c: "s = parseInt(results[{0}], 10);\n",
  17168. s: "([0-5][0-9])"
  17169. },
  17170. // seconds with leading zeros (00 - 59)
  17171. u: {
  17172. g: 1,
  17173. c: "ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",
  17174. s: "(\\d+)"
  17175. },
  17176. // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
  17177. O: {
  17178. g: 1,
  17179. c: [
  17180. "o = results[{0}];",
  17181. "var sn = o.substring(0,1),",
  17182. // get + / - sign
  17183. "hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),",
  17184. // get hours (performs minutes-to-hour conversion also, just in case)
  17185. "mn = o.substring(3,5) % 60;",
  17186. // get minutes
  17187. "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + Ext.String.leftPad(hr, 2, '0') + Ext.String.leftPad(mn, 2, '0')) : null;\n"
  17188. ].// -12hrs <= GMT offset <= 14hrs
  17189. join("\n"),
  17190. s: "([+-]\\d{4})"
  17191. },
  17192. // GMT offset in hrs and mins
  17193. P: {
  17194. g: 1,
  17195. c: [
  17196. "o = results[{0}];",
  17197. "var sn = o.substring(0,1),",
  17198. // get + / - sign
  17199. "hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),",
  17200. // get hours (performs minutes-to-hour conversion also, just in case)
  17201. "mn = o.substring(4,6) % 60;",
  17202. // get minutes
  17203. "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + Ext.String.leftPad(hr, 2, '0') + Ext.String.leftPad(mn, 2, '0')) : null;\n"
  17204. ].// -12hrs <= GMT offset <= 14hrs
  17205. join("\n"),
  17206. s: "([+-]\\d{2}:\\d{2})"
  17207. },
  17208. // GMT offset in hrs and mins (with colon separator)
  17209. T: {
  17210. g: 0,
  17211. c: null,
  17212. s: "[A-Z]{1,5}"
  17213. },
  17214. // timezone abbrev. may be between 1 - 5 chars
  17215. Z: {
  17216. g: 1,
  17217. c: "zz = results[{0}] * 1;\n" + // -43200 <= UTC offset <= 50400
  17218. "zz = (-43200 <= zz && zz <= 50400)? zz : null;\n",
  17219. s: "([+-]?\\d{1,5})"
  17220. },
  17221. // leading '+' sign is optional for UTC offset
  17222. c: function() {
  17223. var calc = [],
  17224. arr = [
  17225. utilDate.formatCodeToRegex("Y", 1),
  17226. // year
  17227. utilDate.formatCodeToRegex("m", 2),
  17228. // month
  17229. utilDate.formatCodeToRegex("d", 3),
  17230. // day
  17231. utilDate.formatCodeToRegex("H", 4),
  17232. // hour
  17233. utilDate.formatCodeToRegex("i", 5),
  17234. // minute
  17235. utilDate.formatCodeToRegex("s", 6),
  17236. // second
  17237. {
  17238. c: "ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"
  17239. },
  17240. // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
  17241. {
  17242. c: [
  17243. // allow either "Z" (i.e. UTC) or "-0530" or "+08:00" (i.e. UTC offset) timezone delimiters. assumes local timezone if no timezone is specified
  17244. "if(results[8]) {",
  17245. // timezone specified
  17246. "if(results[8] == 'Z'){",
  17247. "zz = 0;",
  17248. // UTC
  17249. "}else if (results[8].indexOf(':') > -1){",
  17250. utilDate.formatCodeToRegex("P", 8).c,
  17251. // timezone offset with colon separator
  17252. "}else{",
  17253. utilDate.formatCodeToRegex("O", 8).c,
  17254. // timezone offset without colon separator
  17255. "}",
  17256. "}"
  17257. ].join('\n')
  17258. }
  17259. ],
  17260. i, l;
  17261. for (i = 0 , l = arr.length; i < l; ++i) {
  17262. calc.push(arr[i].c);
  17263. }
  17264. return {
  17265. g: 1,
  17266. c: calc.join(""),
  17267. s: [
  17268. arr[0].s,
  17269. // year (required)
  17270. "(?:",
  17271. "-",
  17272. arr[1].s,
  17273. // month (optional)
  17274. "(?:",
  17275. "-",
  17276. arr[2].s,
  17277. // day (optional)
  17278. "(?:",
  17279. "(?:T| )?",
  17280. // time delimiter -- either a "T" or a single blank space
  17281. arr[3].s,
  17282. ":",
  17283. arr[4].s,
  17284. // hour AND minute, delimited by a single colon (optional). MUST be preceded by either a "T" or a single blank space
  17285. "(?::",
  17286. arr[5].s,
  17287. ")?",
  17288. // seconds (optional)
  17289. "(?:(?:\\.|,)(\\d+))?",
  17290. // decimal fraction of a second (e.g. ",12345" or ".98765") (optional)
  17291. "(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",
  17292. // "Z" (UTC) or "-0530" (UTC offset without colon delimiter) or "+08:00" (UTC offset with colon delimiter) (optional)
  17293. ")?",
  17294. ")?",
  17295. ")?"
  17296. ].join("")
  17297. };
  17298. },
  17299. U: {
  17300. g: 1,
  17301. c: "u = parseInt(results[{0}], 10);\n",
  17302. s: "(-?\\d+)"
  17303. }
  17304. },
  17305. // leading minus sign indicates seconds before UNIX epoch
  17306. //Old Ext.Date prototype methods.
  17307. /**
  17308. * @private
  17309. */
  17310. dateFormat: function(date, format) {
  17311. return utilDate.format(date, format);
  17312. },
  17313. /**
  17314. * Compares if two dates are equal by comparing their values.
  17315. * @param {Date} date1
  17316. * @param {Date} date2
  17317. * @return {Boolean} `true` if the date values are equal
  17318. */
  17319. isEqual: function(date1, date2) {
  17320. // check we have 2 date objects
  17321. if (date1 && date2) {
  17322. return (date1.getTime() === date2.getTime());
  17323. }
  17324. // one or both isn't a date, only equal if both are falsey
  17325. return !(date1 || date2);
  17326. },
  17327. /**
  17328. * Formats a date given the supplied format string.
  17329. * @param {Date} date The date to format
  17330. * @param {String} format The format string
  17331. * @return {String} The formatted date or an empty string if date parameter is not a JavaScript Date object
  17332. */
  17333. format: function(date, format) {
  17334. var formatFunctions = utilDate.formatFunctions;
  17335. if (!Ext.isDate(date)) {
  17336. return '';
  17337. }
  17338. if (formatFunctions[format] == null) {
  17339. utilDate.createFormat(format);
  17340. }
  17341. return formatFunctions[format].call(date) + '';
  17342. },
  17343. /**
  17344. * Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
  17345. *
  17346. * __Note:__ The date string returned by the JavaScript Date object's `toString()` method varies
  17347. * between browsers (e.g. FF vs IE) and system region settings (e.g. IE in Asia vs IE in America).
  17348. * For a given date string e.g. "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)",
  17349. * `getTimezone()` first tries to get the timezone abbreviation from between a pair of parentheses
  17350. * (which may or may not be present), failing which it proceeds to get the timezone abbreviation
  17351. * from the GMT offset portion of the date string.
  17352. *
  17353. * var dt = new Date('9/17/2011');
  17354. * console.log(Ext.Date.getTimezone(dt));
  17355. *
  17356. * @param {Date} date The date
  17357. * @return {String} The abbreviated timezone name (e.g. 'CST', 'PDT', 'EDT', 'MPST' ...).
  17358. */
  17359. getTimezone: function(date) {
  17360. // the following list shows the differences between date strings from different browsers on a WinXP SP2 machine from an Asian locale:
  17361. //
  17362. // Opera : "Thu, 25 Oct 2007 22:53:45 GMT+0800" -- shortest (weirdest) date string of the lot
  17363. // Safari : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone (same as FF)
  17364. // FF : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone
  17365. // IE : "Thu Oct 25 22:54:35 UTC+0800 2007" -- (Asian system setting) look for 3-4 letter timezone abbrev
  17366. // IE : "Thu Oct 25 17:06:37 PDT 2007" -- (American system setting) look for 3-4 letter timezone abbrev
  17367. //
  17368. // this crazy regex attempts to guess the correct timezone abbreviation despite these differences.
  17369. // step 1: (?:\((.*)\) -- find timezone in parentheses
  17370. // step 2: ([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?) -- if nothing was found in step 1, find timezone from timezone offset portion of date string
  17371. // step 3: remove all non uppercase characters found in step 1 and 2
  17372. return date.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,5})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/, "$1$2").replace(/[^A-Z]/g, "");
  17373. },
  17374. /**
  17375. * Get the offset from GMT of the current date (equivalent to the format specifier 'O').
  17376. *
  17377. * var dt = new Date('9/17/2011');
  17378. * console.log(Ext.Date.getGMTOffset(dt));
  17379. *
  17380. * @param {Date} date The date
  17381. * @param {Boolean} [colon=false] `true` to separate the hours and minutes with a colon.
  17382. * @return {String} The 4-character offset string prefixed with + or - (e.g. '-0600').
  17383. */
  17384. getGMTOffset: function(date, colon) {
  17385. var offset = date.getTimezoneOffset();
  17386. return (offset > 0 ? "-" : "+") + Ext.String.leftPad(Math.floor(Math.abs(offset) / 60), 2, "0") + (colon ? ":" : "") + Ext.String.leftPad(Math.abs(offset % 60), 2, "0");
  17387. },
  17388. /**
  17389. * Get the numeric day number of the year, adjusted for leap year.
  17390. *
  17391. * var dt = new Date('9/17/2011');
  17392. * console.log(Ext.Date.getDayOfYear(dt)); // 259
  17393. *
  17394. * @param {Date} date The date
  17395. * @return {Number} 0 to 364 (365 in leap years).
  17396. */
  17397. getDayOfYear: function(date) {
  17398. var num = 0,
  17399. d = utilDate.clone(date),
  17400. m = date.getMonth(),
  17401. i;
  17402. for (i = 0 , d.setDate(1) , d.setMonth(0); i < m; d.setMonth(++i)) {
  17403. num += utilDate.getDaysInMonth(d);
  17404. }
  17405. return num + date.getDate() - 1;
  17406. },
  17407. /**
  17408. * Get the numeric ISO-8601 week number of the year.
  17409. * (equivalent to the format specifier 'W', but without a leading zero).
  17410. *
  17411. * var dt = new Date('9/17/2011');
  17412. * console.log(Ext.Date.getWeekOfYear(dt)); // 37
  17413. *
  17414. * @param {Date} date The date.
  17415. * @return {Number} 1 to 53.
  17416. * @method
  17417. */
  17418. getWeekOfYear: (function() {
  17419. // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm
  17420. var ms1d = 86400000,
  17421. // milliseconds in a day
  17422. ms7d = 7 * ms1d;
  17423. // milliseconds in a week
  17424. return function(date) {
  17425. // return a closure so constants get calculated only once
  17426. var DC3 = nativeDate.UTC(date.getFullYear(), date.getMonth(), date.getDate() + 3) / ms1d,
  17427. // an Absolute Day Number
  17428. AWN = Math.floor(DC3 / 7),
  17429. // an Absolute Week Number
  17430. Wyr = new nativeDate(AWN * ms7d).getUTCFullYear();
  17431. return AWN - Math.floor(nativeDate.UTC(Wyr, 0, 7) / ms7d) + 1;
  17432. };
  17433. }()),
  17434. /**
  17435. * Checks if the current date falls within a leap year.
  17436. *
  17437. * var dt = new Date('1/10/2011');
  17438. * console.log(Ext.Date.isLeapYear(dt)); // false
  17439. *
  17440. * @param {Date} date The date
  17441. * @return {Boolean} `true` if the current date falls within a leap year, `false` otherwise.
  17442. */
  17443. isLeapYear: function(date) {
  17444. var year = date.getFullYear();
  17445. return !!((year & 3) === 0 && (year % 100 || (year % 400 === 0 && year)));
  17446. },
  17447. /**
  17448. * Get the first day of the current month, adjusted for leap year. The returned value
  17449. * is the numeric day index within the week (0-6) which can be used in conjunction with
  17450. * the {@link #monthNames} array to retrieve the textual day name.
  17451. *
  17452. * var dt = new Date('1/10/2007'),
  17453. * firstDay = Ext.Date.getFirstDayOfMonth(dt);
  17454. *
  17455. * console.log(Ext.Date.dayNames[firstDay]); // output: 'Monday'
  17456. *
  17457. * @param {Date} date The date
  17458. * @return {Number} The day number (0-6).
  17459. */
  17460. getFirstDayOfMonth: function(date) {
  17461. var day = (date.getDay() - (date.getDate() - 1)) % 7;
  17462. return (day < 0) ? (day + 7) : day;
  17463. },
  17464. /**
  17465. * Get the last day of the current month, adjusted for leap year. The returned value
  17466. * is the numeric day index within the week (0-6) which can be used in conjunction with
  17467. * the {@link #monthNames} array to retrieve the textual day name.
  17468. *
  17469. * var dt = new Date('1/10/2007'),
  17470. * lastDay = Ext.Date.getLastDayOfMonth(dt);
  17471. *
  17472. * console.log(Ext.Date.dayNames[lastDay]); // output: 'Wednesday'
  17473. *
  17474. * @param {Date} date The date
  17475. * @return {Number} The day number (0-6).
  17476. */
  17477. getLastDayOfMonth: function(date) {
  17478. return utilDate.getLastDateOfMonth(date).getDay();
  17479. },
  17480. /**
  17481. * Get the date of the first day of the month in which this date resides.
  17482. * @param {Date} date The date
  17483. * @return {Date}
  17484. */
  17485. getFirstDateOfMonth: function(date) {
  17486. return new nativeDate(date.getFullYear(), date.getMonth(), 1);
  17487. },
  17488. /**
  17489. * Get the date of the last day of the month in which this date resides.
  17490. * @param {Date} date The date
  17491. * @return {Date}
  17492. */
  17493. getLastDateOfMonth: function(date) {
  17494. return new nativeDate(date.getFullYear(), date.getMonth(), utilDate.getDaysInMonth(date));
  17495. },
  17496. /**
  17497. * Get the number of days in the current month, adjusted for leap year.
  17498. * @param {Date} date The date
  17499. * @return {Number} The number of days in the month.
  17500. * @method
  17501. */
  17502. getDaysInMonth: (function() {
  17503. var daysInMonth = [
  17504. 31,
  17505. 28,
  17506. 31,
  17507. 30,
  17508. 31,
  17509. 30,
  17510. 31,
  17511. 31,
  17512. 30,
  17513. 31,
  17514. 30,
  17515. 31
  17516. ];
  17517. return function(date) {
  17518. // return a closure for efficiency
  17519. var m = date.getMonth();
  17520. return m === 1 && utilDate.isLeapYear(date) ? 29 : daysInMonth[m];
  17521. };
  17522. }()),
  17523. /**
  17524. * Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').
  17525. * @param {Date} date The date
  17526. * @return {String} 'st, 'nd', 'rd' or 'th'.
  17527. * @locale
  17528. */
  17529. getSuffix: function(date) {
  17530. switch (date.getDate()) {
  17531. case 1:
  17532. case 21:
  17533. case 31:
  17534. return "st";
  17535. case 2:
  17536. case 22:
  17537. return "nd";
  17538. case 3:
  17539. case 23:
  17540. return "rd";
  17541. default:
  17542. return "th";
  17543. }
  17544. },
  17545. /**
  17546. * Creates and returns a new Date instance with the exact same date value as the called instance.
  17547. * Dates are copied and passed by reference, so if a copied date variable is modified later, the original
  17548. * variable will also be changed. When the intention is to create a new variable that will not
  17549. * modify the original instance, you should create a clone.
  17550. *
  17551. * Example of correctly cloning a date:
  17552. *
  17553. * //wrong way:
  17554. * var orig = new Date('10/1/2006');
  17555. * var copy = orig;
  17556. * copy.setDate(5);
  17557. * console.log(orig); // returns 'Thu Oct 05 2006'!
  17558. *
  17559. * //correct way:
  17560. * var orig = new Date('10/1/2006'),
  17561. * copy = Ext.Date.clone(orig);
  17562. * copy.setDate(5);
  17563. * console.log(orig); // returns 'Thu Oct 01 2006'
  17564. *
  17565. * @param {Date} date The date.
  17566. * @return {Date} The new Date instance.
  17567. */
  17568. clone: function(date) {
  17569. return new nativeDate(date.getTime());
  17570. },
  17571. /**
  17572. * Checks if the current date is affected by Daylight Saving Time (DST).
  17573. * @param {Date} date The date
  17574. * @return {Boolean} `true` if the current date is affected by DST.
  17575. */
  17576. isDST: function(date) {
  17577. // adapted from http://sencha.com/forum/showthread.php?p=247172#post247172
  17578. // courtesy of @geoffrey.mcgill
  17579. return new nativeDate(date.getFullYear(), 0, 1).getTimezoneOffset() !== date.getTimezoneOffset();
  17580. },
  17581. /**
  17582. * Attempts to clear all time information from this Date by setting the time to midnight of the same day,
  17583. * automatically adjusting for Daylight Saving Time (DST) where applicable.
  17584. *
  17585. * __Note:__ DST timezone information for the browser's host operating system is assumed to be up-to-date.
  17586. * @param {Date} date The date
  17587. * @param {Boolean} [clone=false] `true` to create a clone of this date, clear the time and return it.
  17588. * @return {Date} this or the clone.
  17589. */
  17590. clearTime: function(date, clone) {
  17591. // handles invalid dates preventing the browser from crashing.
  17592. if (isNaN(date.getTime())) {
  17593. return date;
  17594. }
  17595. if (clone) {
  17596. return utilDate.clearTime(utilDate.clone(date));
  17597. }
  17598. // get current date before clearing time
  17599. var d = date.getDate(),
  17600. hr, c;
  17601. // clear time
  17602. date.setHours(0);
  17603. date.setMinutes(0);
  17604. date.setSeconds(0);
  17605. date.setMilliseconds(0);
  17606. if (date.getDate() !== d) {
  17607. // account for DST (i.e. day of month changed when setting hour = 0)
  17608. // note: DST adjustments are assumed to occur in multiples of 1 hour (this is almost always the case)
  17609. // refer to http://www.timeanddate.com/time/aboutdst.html for the (rare) exceptions to this rule
  17610. // increment hour until cloned date == current date
  17611. for (hr = 1 , c = utilDate.add(date, utilDate.HOUR, hr); c.getDate() !== d; hr++ , c = utilDate.add(date, utilDate.HOUR, hr)){}
  17612. date.setDate(d);
  17613. date.setHours(c.getHours());
  17614. }
  17615. return date;
  17616. },
  17617. /**
  17618. * Provides a convenient method for performing basic date arithmetic. This method
  17619. * does not modify the Date instance being called - it creates and returns
  17620. * a new Date instance containing the resulting date value.
  17621. *
  17622. * Examples:
  17623. *
  17624. * // Basic usage:
  17625. * var dt = Ext.Date.add(new Date('10/29/2006'), Ext.Date.DAY, 5);
  17626. * console.log(dt); // returns 'Fri Nov 03 2006 00:00:00'
  17627. *
  17628. * // Negative values will be subtracted:
  17629. * var dt2 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, -5);
  17630. * console.log(dt2); // returns 'Tue Sep 26 2006 00:00:00'
  17631. *
  17632. * // Decimal values can be used:
  17633. * var dt3 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, 1.25);
  17634. * console.log(dt3); // returns 'Mon Oct 02 2006 06:00:00'
  17635. *
  17636. * @param {Date} date The date to modify
  17637. * @param {String} interval A valid date interval enum value.
  17638. * @param {Number} value The amount to add to the current date.
  17639. * @param {Boolean} [preventDstAdjust=false] `true` to prevent adjustments when crossing
  17640. * daylight savings boundaries.
  17641. * @return {Date} The new Date instance.
  17642. */
  17643. add: function(date, interval, value, preventDstAdjust) {
  17644. var d = utilDate.clone(date),
  17645. base = 0,
  17646. day, decimalValue;
  17647. if (!interval || value === 0) {
  17648. return d;
  17649. }
  17650. decimalValue = value - parseInt(value, 10);
  17651. value = parseInt(value, 10);
  17652. if (value) {
  17653. switch (interval.toLowerCase()) {
  17654. // See EXTJSIV-7418. We use setTime() here to deal with issues related to
  17655. // the switchover that occurs when changing to daylight savings and vice
  17656. // versa. setTime() handles this correctly where setHour/Minute/Second/Millisecond
  17657. // do not. Let's assume the DST change occurs at 2am and we're incrementing using add
  17658. // for 15 minutes at time. When entering DST, we should see:
  17659. // 01:30am
  17660. // 01:45am
  17661. // 03:00am // skip 2am because the hour does not exist
  17662. // ...
  17663. // Similarly, leaving DST, we should see:
  17664. // 01:30am
  17665. // 01:45am
  17666. // 01:00am // repeat 1am because that's the change over
  17667. // 01:30am
  17668. // 01:45am
  17669. // 02:00am
  17670. // ....
  17671. //
  17672. case utilDate.MILLI:
  17673. if (preventDstAdjust) {
  17674. d.setMilliseconds(d.getMilliseconds() + value);
  17675. } else {
  17676. d.setTime(d.getTime() + value);
  17677. };
  17678. break;
  17679. case utilDate.SECOND:
  17680. if (preventDstAdjust) {
  17681. d.setSeconds(d.getSeconds() + value);
  17682. } else {
  17683. d.setTime(d.getTime() + value * 1000);
  17684. };
  17685. break;
  17686. case utilDate.MINUTE:
  17687. if (preventDstAdjust) {
  17688. d.setMinutes(d.getMinutes() + value);
  17689. } else {
  17690. d.setTime(d.getTime() + value * 60 * 1000);
  17691. };
  17692. break;
  17693. case utilDate.HOUR:
  17694. if (preventDstAdjust) {
  17695. d.setHours(d.getHours() + value);
  17696. } else {
  17697. d.setTime(d.getTime() + value * 60 * 60 * 1000);
  17698. };
  17699. break;
  17700. case utilDate.DAY:
  17701. if (preventDstAdjust) {
  17702. d.setDate(d.getDate() + value);
  17703. } else {
  17704. d.setTime(d.getTime() + value * 24 * 60 * 60 * 1000);
  17705. };
  17706. break;
  17707. case utilDate.MONTH:
  17708. day = date.getDate();
  17709. if (day > 28) {
  17710. day = Math.min(day, utilDate.getLastDateOfMonth(utilDate.add(utilDate.getFirstDateOfMonth(date), utilDate.MONTH, value)).getDate());
  17711. };
  17712. d.setDate(day);
  17713. d.setMonth(date.getMonth() + value);
  17714. break;
  17715. case utilDate.YEAR:
  17716. day = date.getDate();
  17717. if (day > 28) {
  17718. day = Math.min(day, utilDate.getLastDateOfMonth(utilDate.add(utilDate.getFirstDateOfMonth(date), utilDate.YEAR, value)).getDate());
  17719. };
  17720. d.setDate(day);
  17721. d.setFullYear(date.getFullYear() + value);
  17722. break;
  17723. }
  17724. }
  17725. if (decimalValue) {
  17726. switch (interval.toLowerCase()) {
  17727. case utilDate.MILLI:
  17728. base = 1;
  17729. break;
  17730. case utilDate.SECOND:
  17731. base = 1000;
  17732. break;
  17733. case utilDate.MINUTE:
  17734. base = 1000 * 60;
  17735. break;
  17736. case utilDate.HOUR:
  17737. base = 1000 * 60 * 60;
  17738. break;
  17739. case utilDate.DAY:
  17740. base = 1000 * 60 * 60 * 24;
  17741. break;
  17742. case utilDate.MONTH:
  17743. day = utilDate.getDaysInMonth(d);
  17744. base = 1000 * 60 * 60 * 24 * day;
  17745. break;
  17746. case utilDate.YEAR:
  17747. day = (utilDate.isLeapYear(d) ? 366 : 365);
  17748. base = 1000 * 60 * 60 * 24 * day;
  17749. break;
  17750. }
  17751. if (base) {
  17752. d.setTime(d.getTime() + base * decimalValue);
  17753. }
  17754. }
  17755. return d;
  17756. },
  17757. /**
  17758. * Provides a convenient method for performing basic date arithmetic. This method
  17759. * does not modify the Date instance being called - it creates and returns
  17760. * a new Date instance containing the resulting date value.
  17761. *
  17762. * Examples:
  17763. *
  17764. * // Basic usage:
  17765. * var dt = Ext.Date.subtract(new Date('10/29/2006'), Ext.Date.DAY, 5);
  17766. * console.log(dt); // returns 'Tue Oct 24 2006 00:00:00'
  17767. *
  17768. * // Negative values will be added:
  17769. * var dt2 = Ext.Date.subtract(new Date('10/1/2006'), Ext.Date.DAY, -5);
  17770. * console.log(dt2); // returns 'Fri Oct 6 2006 00:00:00'
  17771. *
  17772. * // Decimal values can be used:
  17773. * var dt3 = Ext.Date.subtract(new Date('10/1/2006'), Ext.Date.DAY, 1.25);
  17774. * console.log(dt3); // returns 'Fri Sep 29 2006 06:00:00'
  17775. *
  17776. * @param {Date} date The date to modify
  17777. * @param {String} interval A valid date interval enum value.
  17778. * @param {Number} value The amount to subtract from the current date.
  17779. * @param {Boolean} [preventDstAdjust=false] `true` to prevent adjustments when crossing
  17780. * daylight savings boundaries.
  17781. * @return {Date} The new Date instance.
  17782. */
  17783. subtract: function(date, interval, value, preventDstAdjust) {
  17784. return utilDate.add(date, interval, -value, preventDstAdjust);
  17785. },
  17786. /**
  17787. * Checks if a date falls on or between the given start and end dates.
  17788. * @param {Date} date The date to check
  17789. * @param {Date} start Start date
  17790. * @param {Date} end End date
  17791. * @return {Boolean} `true` if this date falls on or between the given start and end dates.
  17792. */
  17793. between: function(date, start, end) {
  17794. var t = date.getTime();
  17795. return start.getTime() <= t && t <= end.getTime();
  17796. },
  17797. /**
  17798. * Checks if the date is a weekend day. Uses {@link #weekendDays}.
  17799. * @param {Date} date The date.
  17800. * @return {Boolean} `true` if the day falls on a weekend.
  17801. *
  17802. * @since 6.2.0
  17803. */
  17804. isWeekend: function(date) {
  17805. return Ext.Array.indexOf(this.weekendDays, date.getDay()) > -1;
  17806. },
  17807. /**
  17808. * Converts the passed UTC date into a local date.
  17809. * For example, if the passed date is:
  17810. * `Wed Jun 01 2016 00:10:00 GMT+1000 (AUS Eastern Standard Time)`, then
  17811. * the returned date will be `Wed Jun 01 2016 00:00:00 GMT+1000 (AUS Eastern Standard Time)`.
  17812. * @param {Date} d The date to convert.
  17813. * @return {Date} The date as a local. Does not modify the passed date.
  17814. *
  17815. * @since 6.2.0
  17816. */
  17817. utcToLocal: function(d) {
  17818. return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
  17819. },
  17820. /**
  17821. * Converts the passed local date into a UTC date.
  17822. * For example, if the passed date is:
  17823. * `Wed Jun 01 2016 00:00:00 GMT+1000 (AUS Eastern Standard Time)`, then
  17824. * the returned date will be `Wed Jun 01 2016 10:00:00 GMT+1000 (AUS Eastern Standard Time)`.
  17825. * @param {Date} d The date to convert.
  17826. * @return {Date} The date as UTC. Does not modify the passed date.
  17827. *
  17828. * @since 6.2.0
  17829. */
  17830. localToUtc: function(d) {
  17831. return utilDate.utc(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
  17832. },
  17833. /**
  17834. * Create a UTC date.
  17835. * @param {Number} year The year.
  17836. * @param {Number} month The month.
  17837. * @param {Number} day The day.
  17838. * @param {Number} [hour=0] The hour.
  17839. * @param {Number} [min=0] The minutes.
  17840. * @param {Number} [s=0] The seconds.
  17841. * @param {Number} [ms=0] The milliseconds.
  17842. * @return {Date} The UTC date.
  17843. *
  17844. * @since 6.2.0
  17845. */
  17846. utc: function(year, month, day, hour, min, s, ms) {
  17847. return new Date(Date.UTC(year, month, day, hour || 0, min || 0, s || 0, ms || 0));
  17848. },
  17849. //Maintains compatibility with old static and prototype window.Date methods.
  17850. compat: function() {
  17851. var p,
  17852. statics = [
  17853. 'useStrict',
  17854. 'formatCodeToRegex',
  17855. 'parseFunctions',
  17856. 'parseRegexes',
  17857. 'formatFunctions',
  17858. 'y2kYear',
  17859. 'MILLI',
  17860. 'SECOND',
  17861. 'MINUTE',
  17862. 'HOUR',
  17863. 'DAY',
  17864. 'MONTH',
  17865. 'YEAR',
  17866. 'defaults',
  17867. 'dayNames',
  17868. 'monthNames',
  17869. 'monthNumbers',
  17870. 'getShortMonthName',
  17871. 'getShortDayName',
  17872. 'getMonthNumber',
  17873. 'formatCodes',
  17874. 'isValid',
  17875. 'parseDate',
  17876. 'getFormatCode',
  17877. 'createFormat',
  17878. 'createParser',
  17879. 'parseCodes'
  17880. ],
  17881. proto = [
  17882. 'dateFormat',
  17883. 'format',
  17884. 'getTimezone',
  17885. 'getGMTOffset',
  17886. 'getDayOfYear',
  17887. 'getWeekOfYear',
  17888. 'isLeapYear',
  17889. 'getFirstDayOfMonth',
  17890. 'getLastDayOfMonth',
  17891. 'getDaysInMonth',
  17892. 'getSuffix',
  17893. 'clone',
  17894. 'isDST',
  17895. 'clearTime',
  17896. 'add',
  17897. 'between'
  17898. ],
  17899. sLen = statics.length,
  17900. pLen = proto.length,
  17901. stat, prot, s;
  17902. //Append statics
  17903. for (s = 0; s < sLen; s++) {
  17904. stat = statics[s];
  17905. nativeDate[stat] = utilDate[stat];
  17906. }
  17907. //Append to prototype
  17908. for (p = 0; p < pLen; p++) {
  17909. prot = proto[p];
  17910. nativeDate.prototype[prot] = function() {
  17911. var args = Array.prototype.slice.call(arguments);
  17912. args.unshift(this);
  17913. return utilDate[prot].apply(utilDate, args);
  17914. };
  17915. }
  17916. },
  17917. /**
  17918. * Calculate how many units are there between two time.
  17919. * @param {Date} min The first time.
  17920. * @param {Date} max The second time.
  17921. * @param {String} unit The unit. This unit is compatible with the date interval constants.
  17922. * @return {Number} The maximum number n of units that min + n * unit <= max.
  17923. */
  17924. diff: function(min, max, unit) {
  17925. var est,
  17926. diff = +max - min;
  17927. switch (unit) {
  17928. case utilDate.MILLI:
  17929. return diff;
  17930. case utilDate.SECOND:
  17931. return Math.floor(diff / 1000);
  17932. case utilDate.MINUTE:
  17933. return Math.floor(diff / 60000);
  17934. case utilDate.HOUR:
  17935. return Math.floor(diff / 3600000);
  17936. case utilDate.DAY:
  17937. return Math.floor(diff / 86400000);
  17938. case 'w':
  17939. return Math.floor(diff / 604800000);
  17940. case utilDate.MONTH:
  17941. est = (max.getFullYear() * 12 + max.getMonth()) - (min.getFullYear() * 12 + min.getMonth());
  17942. if (utilDate.add(min, unit, est) > max) {
  17943. return est - 1;
  17944. };
  17945. return est;
  17946. case utilDate.YEAR:
  17947. est = max.getFullYear() - min.getFullYear();
  17948. if (utilDate.add(min, unit, est) > max) {
  17949. return est - 1;
  17950. } else {
  17951. return est;
  17952. };
  17953. }
  17954. },
  17955. /**
  17956. * Align the date to `unit`.
  17957. * @param {Date} date The date to be aligned.
  17958. * @param {String} unit The unit. This unit is compatible with the date interval constants.
  17959. * @param {Number} step
  17960. * @return {Date} The aligned date.
  17961. */
  17962. align: function(date, unit, step) {
  17963. var num = new nativeDate(+date);
  17964. switch (unit.toLowerCase()) {
  17965. case utilDate.MILLI:
  17966. return num;
  17967. case utilDate.SECOND:
  17968. num.setUTCSeconds(num.getUTCSeconds() - num.getUTCSeconds() % step);
  17969. num.setUTCMilliseconds(0);
  17970. return num;
  17971. case utilDate.MINUTE:
  17972. num.setUTCMinutes(num.getUTCMinutes() - num.getUTCMinutes() % step);
  17973. num.setUTCSeconds(0);
  17974. num.setUTCMilliseconds(0);
  17975. return num;
  17976. case utilDate.HOUR:
  17977. num.setUTCHours(num.getUTCHours() - num.getUTCHours() % step);
  17978. num.setUTCMinutes(0);
  17979. num.setUTCSeconds(0);
  17980. num.setUTCMilliseconds(0);
  17981. return num;
  17982. case utilDate.DAY:
  17983. if (step === 7 || step === 14) {
  17984. num.setUTCDate(num.getUTCDate() - num.getUTCDay() + 1);
  17985. };
  17986. num.setUTCHours(0);
  17987. num.setUTCMinutes(0);
  17988. num.setUTCSeconds(0);
  17989. num.setUTCMilliseconds(0);
  17990. return num;
  17991. case utilDate.MONTH:
  17992. num.setUTCMonth(num.getUTCMonth() - (num.getUTCMonth() - 1) % step, 1);
  17993. num.setUTCHours(0);
  17994. num.setUTCMinutes(0);
  17995. num.setUTCSeconds(0);
  17996. num.setUTCMilliseconds(0);
  17997. return num;
  17998. case utilDate.YEAR:
  17999. num.setUTCFullYear(num.getUTCFullYear() - num.getUTCFullYear() % step, 1, 1);
  18000. num.setUTCHours(0);
  18001. num.setUTCMinutes(0);
  18002. num.setUTCSeconds(0);
  18003. num.setUTCMilliseconds(0);
  18004. return date;
  18005. }
  18006. }
  18007. };
  18008. utilDate.parseCodes.C = utilDate.parseCodes.c;
  18009. return utilDate;
  18010. }());
  18011. /**
  18012. * @class Ext.Function
  18013. *
  18014. * A collection of useful static methods to deal with function callbacks.
  18015. * @singleton
  18016. */
  18017. Ext.Function = (function() {
  18018. // @define Ext.lang.Function
  18019. // @define Ext.Function
  18020. // @require Ext
  18021. // @require Ext.lang.Array
  18022. var lastTime = 0,
  18023. animFrameId,
  18024. animFrameHandlers = [],
  18025. animFrameNoArgs = [],
  18026. idSource = 0,
  18027. animFrameMap = {},
  18028. slice = Array.prototype.slice,
  18029. win = window,
  18030. global = Ext.global,
  18031. // We disable setImmediate in unit tests because it derails internal Jasmine queue
  18032. hasImmediate = !Ext.disableImmediate && !!(global.setImmediate && global.clearImmediate),
  18033. requestAnimFrame = win.requestAnimationFrame || win.webkitRequestAnimationFrame || win.mozRequestAnimationFrame || win.oRequestAnimationFrame || function(callback) {
  18034. var currTime = Ext.now(),
  18035. timeToCall = Math.max(0, 16 - (currTime - lastTime)),
  18036. timerFn = function() {
  18037. callback(currTime + timeToCall);
  18038. },
  18039. id;
  18040. timerFn.$origFn = callback.$origFn || callback;
  18041. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18042. id = win.setTimeout(timerFn, timeToCall);
  18043. lastTime = currTime + timeToCall;
  18044. return id;
  18045. },
  18046. fireHandlers = function() {
  18047. var len = animFrameHandlers.length,
  18048. id, i, handler;
  18049. animFrameId = null;
  18050. var timer;
  18051. // Fire all animation frame handlers in one go
  18052. for (i = 0; i < len; i++) {
  18053. handler = animFrameHandlers[i];
  18054. id = handler[3];
  18055. // Check if this timer has been canceled; its map entry is going to be removed
  18056. if (animFrameMap[id]) {
  18057. delete animFrameMap[id];
  18058. timer = Ext.Timer.get(id, 'raf');
  18059. if (timer) {
  18060. timer.tick();
  18061. }
  18062. handler[0].apply(handler[1] || global, handler[2] || animFrameNoArgs);
  18063. if (timer) {
  18064. timer.tock();
  18065. }
  18066. }
  18067. }
  18068. // Clear all fired animation frame handlers, don't forget that new handlers
  18069. // could have been created in user handler functions called in the loop above
  18070. animFrameHandlers = animFrameHandlers.slice(len);
  18071. },
  18072. fireElevatedHandlers = function() {
  18073. Ext.elevate(fireHandlers);
  18074. },
  18075. ExtFunction = {
  18076. /**
  18077. * A very commonly used method throughout the framework. It acts as a wrapper around another method
  18078. * which originally accepts 2 arguments for `name` and `value`.
  18079. * The wrapped function then allows "flexible" value setting of either:
  18080. *
  18081. * - `name` and `value` as 2 arguments
  18082. * - one single object argument with multiple key - value pairs
  18083. *
  18084. * For example:
  18085. *
  18086. * var setValue = Ext.Function.flexSetter(function(name, value) {
  18087. * this[name] = value;
  18088. * });
  18089. *
  18090. * // Afterwards
  18091. * // Setting a single name - value
  18092. * setValue('name1', 'value1');
  18093. *
  18094. * // Settings multiple name - value pairs
  18095. * setValue({
  18096. * name1: 'value1',
  18097. * name2: 'value2',
  18098. * name3: 'value3'
  18099. * });
  18100. *
  18101. * @param {Function} setter The single value setter method.
  18102. * @param {String} setter.name The name of the value being set.
  18103. * @param {Object} setter.value The value being set.
  18104. * @return {Function}
  18105. */
  18106. flexSetter: function(setter) {
  18107. return function(name, value) {
  18108. var k, i;
  18109. if (name !== null) {
  18110. if (typeof name !== 'string') {
  18111. for (k in name) {
  18112. if (name.hasOwnProperty(k)) {
  18113. setter.call(this, k, name[k]);
  18114. }
  18115. }
  18116. if (Ext.enumerables) {
  18117. for (i = Ext.enumerables.length; i--; ) {
  18118. k = Ext.enumerables[i];
  18119. if (name.hasOwnProperty(k)) {
  18120. setter.call(this, k, name[k]);
  18121. }
  18122. }
  18123. }
  18124. } else {
  18125. setter.call(this, name, value);
  18126. }
  18127. }
  18128. return this;
  18129. };
  18130. },
  18131. /**
  18132. * Create a new function from the provided `fn`, change `this` to the provided scope,
  18133. * optionally overrides arguments for the call. Defaults to the arguments passed by
  18134. * the caller.
  18135. *
  18136. * {@link Ext#bind Ext.bind} is alias for {@link Ext.Function#bind Ext.Function.bind}
  18137. *
  18138. * **NOTE:** This method is similar to the native `bind()` method. The major difference
  18139. * is in the way the parameters are passed. This method expects an array of parameters,
  18140. * and if supplied, it does not automatically pass forward parameters from the bound
  18141. * function:
  18142. *
  18143. * function foo (a, b, c) {
  18144. * console.log(a, b, c);
  18145. * }
  18146. *
  18147. * var nativeFn = foo.bind(this, 1, 2);
  18148. * var extFn = Ext.Function.bind(foo, this, [1, 2]);
  18149. *
  18150. * nativeFn(3); // 1, 2, 3
  18151. * extFn(3); // 1, 2, undefined
  18152. *
  18153. * This method is unavailable natively on IE8 and IE/Quirks but Ext JS provides a
  18154. * "polyfill" to emulate the important features of the standard `bind` method. In
  18155. * particular, the polyfill only provides binding of "this" and optional arguments.
  18156. *
  18157. * @param {Function} fn The function to delegate.
  18158. * @param {Object} [scope] The scope (`this` reference) in which the function
  18159. * is executed.
  18160. * **If omitted, defaults to the global environment object (usually the browser `window`).**
  18161. * @param {Array} [args] Overrides arguments for the call. (Defaults to
  18162. * the arguments passed by the caller).
  18163. * @param {Boolean/Number} [appendArgs] if `true` the `args` are appended to the
  18164. * arguments passed to the returned wrapper (by default these arguments are ignored).
  18165. * If a number then the `args` are inserted at the specified position.
  18166. * @return {Function} The bound wrapper function.
  18167. */
  18168. bind: function(fn, scope, args, appendArgs) {
  18169. // Function.prototype.bind is polyfilled in IE8, otherwise native
  18170. if (arguments.length <= 2) {
  18171. return fn.bind(scope);
  18172. }
  18173. var method = fn;
  18174. return function() {
  18175. var callArgs = args || arguments;
  18176. if (appendArgs === true) {
  18177. callArgs = slice.call(arguments, 0);
  18178. callArgs = callArgs.concat(args);
  18179. } else if (typeof appendArgs === 'number') {
  18180. callArgs = slice.call(arguments, 0);
  18181. // copy arguments first
  18182. Ext.Array.insert(callArgs, appendArgs, args);
  18183. }
  18184. return method.apply(scope || global, callArgs);
  18185. };
  18186. },
  18187. /**
  18188. * Captures the given parameters for a later call to `Ext.callback`. This binding is
  18189. * most useful for resolving scopes for example to an `Ext.app.ViewController`.
  18190. *
  18191. * The arguments match that of `Ext.callback` except for the `args` which, if provided
  18192. * to this method, are prepended to any arguments supplied by the eventual caller of
  18193. * the returned function.
  18194. *
  18195. * @return {Function} A function that, when called, uses `Ext.callback` to call the
  18196. * captured `callback`.
  18197. * @since 5.0.0
  18198. */
  18199. bindCallback: function(callback, scope, args, delay, caller) {
  18200. return function() {
  18201. var a = slice.call(arguments);
  18202. return Ext.callback(callback, scope, args ? args.concat(a) : a, delay, caller);
  18203. };
  18204. },
  18205. /**
  18206. * Create a new function from the provided `fn`, the arguments of which are pre-set to `args`.
  18207. * New arguments passed to the newly created callback when it's invoked are appended after the pre-set ones.
  18208. * This is especially useful when creating callbacks.
  18209. *
  18210. * For example:
  18211. *
  18212. * var originalFunction = function(){
  18213. * alert(Ext.Array.from(arguments).join(' '));
  18214. * };
  18215. *
  18216. * var callback = Ext.Function.pass(originalFunction, ['Hello', 'World']);
  18217. *
  18218. * callback(); // alerts 'Hello World'
  18219. * callback('by Me'); // alerts 'Hello World by Me'
  18220. *
  18221. * {@link Ext#pass Ext.pass} is alias for {@link Ext.Function#pass Ext.Function.pass}
  18222. *
  18223. * @param {Function} fn The original function.
  18224. * @param {Array} args The arguments to pass to new callback.
  18225. * @param {Object} scope (optional) The scope (`this` reference) in which the function is executed.
  18226. * @return {Function} The new callback function.
  18227. */
  18228. pass: function(fn, args, scope) {
  18229. if (!Ext.isArray(args)) {
  18230. if (Ext.isIterable(args)) {
  18231. args = Ext.Array.clone(args);
  18232. } else {
  18233. args = args !== undefined ? [
  18234. args
  18235. ] : [];
  18236. }
  18237. }
  18238. return function() {
  18239. var fnArgs = args.slice();
  18240. fnArgs.push.apply(fnArgs, arguments);
  18241. return fn.apply(scope || this, fnArgs);
  18242. };
  18243. },
  18244. /**
  18245. * Create an alias to the provided method property with name `methodName` of `object`.
  18246. * Note that the execution scope will still be bound to the provided `object` itself.
  18247. *
  18248. * @param {Object/Function} object
  18249. * @param {String} methodName
  18250. * @return {Function} aliasFn
  18251. */
  18252. alias: function(object, methodName) {
  18253. return function() {
  18254. return object[methodName].apply(object, arguments);
  18255. };
  18256. },
  18257. /**
  18258. * Create a "clone" of the provided method. The returned method will call the given
  18259. * method passing along all arguments and the "this" pointer and return its result.
  18260. *
  18261. * @param {Function} method
  18262. * @return {Function} cloneFn
  18263. */
  18264. clone: function(method) {
  18265. var newMethod, prop;
  18266. newMethod = function() {
  18267. return method.apply(this, arguments);
  18268. };
  18269. for (prop in method) {
  18270. if (method.hasOwnProperty(prop)) {
  18271. newMethod[prop] = method[prop];
  18272. }
  18273. }
  18274. return newMethod;
  18275. },
  18276. /**
  18277. * Creates an interceptor function. The passed function is called before the original one. If it returns false,
  18278. * the original one is not called. The resulting function returns the results of the original function.
  18279. * The passed function is called with the parameters of the original function. Example usage:
  18280. *
  18281. * var sayHi = function(name){
  18282. * alert('Hi, ' + name);
  18283. * };
  18284. *
  18285. * sayHi('Fred'); // alerts "Hi, Fred"
  18286. *
  18287. * // create a new function that validates input without
  18288. * // directly modifying the original function:
  18289. * var sayHiToFriend = Ext.Function.createInterceptor(sayHi, function(name){
  18290. * return name === 'Brian';
  18291. * });
  18292. *
  18293. * sayHiToFriend('Fred'); // no alert
  18294. * sayHiToFriend('Brian'); // alerts "Hi, Brian"
  18295. *
  18296. * @param {Function} origFn The original function.
  18297. * @param {Function} newFn The function to call before the original.
  18298. * @param {Object} [scope] The scope (`this` reference) in which the passed function is executed.
  18299. * **If omitted, defaults to the scope in which the original function is called or the browser window.**
  18300. * @param {Object} [returnValue=null] The value to return if the passed function return `false`.
  18301. * @return {Function} The new function.
  18302. */
  18303. createInterceptor: function(origFn, newFn, scope, returnValue) {
  18304. if (!Ext.isFunction(newFn)) {
  18305. return origFn;
  18306. } else {
  18307. returnValue = Ext.isDefined(returnValue) ? returnValue : null;
  18308. return function() {
  18309. var me = this,
  18310. args = arguments;
  18311. return (newFn.apply(scope || me || global, args) !== false) ? origFn.apply(me || global, args) : returnValue;
  18312. };
  18313. }
  18314. },
  18315. /**
  18316. * Creates a delegate (callback) which, when called, executes after a specific delay.
  18317. *
  18318. * @param {Function} fn The function which will be called on a delay when the returned function is called.
  18319. * Optionally, a replacement (or additional) argument list may be specified.
  18320. * @param {Number} delay The number of milliseconds to defer execution by whenever called.
  18321. * @param {Object} scope (optional) The scope (`this` reference) used by the function at execution time.
  18322. * @param {Array} args (optional) Override arguments for the call. (Defaults to the arguments passed by the caller)
  18323. * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding,
  18324. * if a number the args are inserted at the specified position.
  18325. * @return {Function} A function which, when called, executes the original function after the specified delay.
  18326. */
  18327. createDelayed: function(fn, delay, scope, args, appendArgs) {
  18328. var boundFn = fn;
  18329. if (scope || args) {
  18330. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  18331. }
  18332. return function() {
  18333. var me = this,
  18334. args = slice.call(arguments),
  18335. timerFn, timerId;
  18336. var timer;
  18337. timerFn = function() {
  18338. Ext.elevate(boundFn, me, args, timer);
  18339. };
  18340. timerId = setTimeout(timerFn, delay);
  18341. timerFn.$origFn = fn.$origFn || fn;
  18342. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18343. timer = Ext.Timer.created('timeout', timerId, {
  18344. type: 'createDelayed',
  18345. fn: fn,
  18346. timerFn: timerFn
  18347. });
  18348. };
  18349. },
  18350. /**
  18351. * Calls function `fn` after the number of milliseconds specified, optionally with
  18352. * a specific `scope` (`this` pointer).
  18353. *
  18354. * Example usage:
  18355. *
  18356. * var sayHi = function (name) {
  18357. * alert('Hi, ' + name);
  18358. * }
  18359. *
  18360. * // executes immediately:
  18361. * sayHi('Fred');
  18362. *
  18363. * // executes after 2 seconds:
  18364. * Ext.defer(sayHi, 2000, this, ['Fred']);
  18365. *
  18366. * The following syntax is useful for scheduling anonymous functions:
  18367. *
  18368. * Ext.defer(function () {
  18369. * alert('Anonymous');
  18370. * }, 100);
  18371. *
  18372. * NOTE: The `Ext.Function.defer()` method is an alias for `Ext.defer()`.
  18373. *
  18374. * @param {Function} fn The function to defer.
  18375. * @param {Number} millis The number of milliseconds for the `setTimeout` call
  18376. * (if less than or equal to 0 the function is executed immediately).
  18377. * @param {Object} scope (optional) The scope (`this` reference) in which the function is executed.
  18378. * **If omitted, defaults to the browser window.**
  18379. * @param {Array} [args] Overrides arguments for the call. Defaults to the arguments passed by the caller.
  18380. * @param {Boolean/Number} [appendArgs=false] If `true` args are appended to call args instead of overriding,
  18381. * or, if a number, then the args are inserted at the specified position.
  18382. * @return {Number} The timeout id that can be used with `Ext.undefer`.
  18383. */
  18384. defer: function(fn, millis, scope, args, appendArgs) {
  18385. var timerId = 0,
  18386. timerFn, boundFn;
  18387. var timer;
  18388. if (!scope && !args && !appendArgs) {
  18389. boundFn = fn;
  18390. } else {
  18391. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  18392. }
  18393. if (millis > 0) {
  18394. timerFn = function() {
  18395. Ext.elevate(boundFn, null, null, timer);
  18396. };
  18397. timerId = setTimeout(timerFn, millis);
  18398. timerFn.$origFn = fn.$origFn || fn;
  18399. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18400. timer = Ext.Timer.created('timeout', timerId, {
  18401. type: 'defer',
  18402. fn: fn,
  18403. timerFn: timerFn
  18404. });
  18405. } else {
  18406. boundFn();
  18407. }
  18408. return timerId;
  18409. },
  18410. /**
  18411. * Calls the function `fn` repeatedly at a given interval, optionally with a
  18412. * specific `scope` (`this` pointer).
  18413. *
  18414. * var sayHi = function (name) {
  18415. * console.log('Hi, ' + name);
  18416. * }
  18417. *
  18418. * // executes every 2 seconds:
  18419. * var timerId = Ext.interval(sayHi, 2000, this, ['Fred']);
  18420. *
  18421. * The timer is stopped by:
  18422. *
  18423. * Ext.uninterval(timerId);
  18424. *
  18425. * NOTE: The `Ext.Function.interval()` method is an alias for `Ext.interval()`.
  18426. *
  18427. * @param {Function} fn The function to defer.
  18428. * @param {Number} millis The number of milliseconds for the `setInterval` call
  18429. * @param {Object} scope (optional) The scope (`this` reference) in which the function is executed.
  18430. * **If omitted, defaults to the browser window.**
  18431. * @param {Array} [args] Overrides arguments for the call. Defaults to the arguments passed by the caller.
  18432. * @param {Boolean/Number} [appendArgs=false] If `true` args are appended to call args instead of overriding,
  18433. * or, if a number, then the args are inserted at the specified position.
  18434. * @return {Number} The interval id that can be used with `Ext.uninterval`.
  18435. */
  18436. interval: function(fn, millis, scope, args, appendArgs) {
  18437. var timerFn, timerId, boundFn;
  18438. var timer;
  18439. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  18440. timerFn = function() {
  18441. Ext.elevate(boundFn, null, null, timer);
  18442. };
  18443. timerId = setInterval(timerFn, millis);
  18444. timerFn.$origFn = boundFn.$origFn || fn;
  18445. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18446. timer = Ext.Timer.created('interval', timerId, {
  18447. type: 'interval',
  18448. fn: fn,
  18449. timerFn: timerFn
  18450. });
  18451. return timerId;
  18452. },
  18453. /**
  18454. * Create a combined function call sequence of the original function + the passed function.
  18455. * The resulting function returns the results of the original function.
  18456. * The passed function is called with the parameters of the original function. Example usage:
  18457. *
  18458. * var sayHi = function(name){
  18459. * alert('Hi, ' + name);
  18460. * };
  18461. *
  18462. * sayHi('Fred'); // alerts "Hi, Fred"
  18463. *
  18464. * var sayGoodbye = Ext.Function.createSequence(sayHi, function(name){
  18465. * alert('Bye, ' + name);
  18466. * });
  18467. *
  18468. * sayGoodbye('Fred'); // both alerts show
  18469. *
  18470. * @param {Function} originalFn The original function.
  18471. * @param {Function} newFn The function to sequence.
  18472. * @param {Object} [scope] The scope (`this` reference) in which the passed function is executed.
  18473. * If omitted, defaults to the scope in which the original function is called or the
  18474. * default global environment object (usually the browser window).
  18475. * @return {Function} The new function.
  18476. */
  18477. createSequence: function(originalFn, newFn, scope) {
  18478. if (!newFn) {
  18479. return originalFn;
  18480. } else {
  18481. return function() {
  18482. var result = originalFn.apply(this, arguments);
  18483. newFn.apply(scope || this, arguments);
  18484. return result;
  18485. };
  18486. }
  18487. },
  18488. /**
  18489. * Creates a delegate function, optionally with a bound scope which, when called, buffers
  18490. * the execution of the passed function for the configured number of milliseconds.
  18491. * If called again within that period, the impending invocation will be canceled, and the
  18492. * timeout period will begin again.
  18493. *
  18494. * @param {Function} fn The function to invoke on a buffered timer.
  18495. * @param {Number} buffer The number of milliseconds by which to buffer the invocation of the
  18496. * function.
  18497. * @param {Object} [scope] The scope (`this` reference) in which.
  18498. * the passed function is executed. If omitted, defaults to the scope specified by the caller.
  18499. * @param {Array} [args] Override arguments for the call. Defaults to the arguments
  18500. * passed by the caller.
  18501. * @return {Function} A function which invokes the passed function after buffering for the specified time.
  18502. */
  18503. createBuffered: function(fn, buffer, scope, args) {
  18504. var timerId,
  18505. result = function() {
  18506. var callArgs = args || slice.call(arguments, 0),
  18507. me = scope || this,
  18508. timerFn;
  18509. var timer;
  18510. if (timerId) {
  18511. Ext.undefer(timerId);
  18512. }
  18513. timerFn = function() {
  18514. Ext.elevate(fn, me, callArgs, timer);
  18515. };
  18516. result.timer = timerId = setTimeout(timerFn, buffer);
  18517. timerFn.$origFn = fn.$origFn || fn;
  18518. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18519. timer = Ext.Timer.created('timeout', timerId, {
  18520. type: 'createBuffered',
  18521. fn: fn,
  18522. timerFn: timerFn
  18523. });
  18524. };
  18525. return result;
  18526. },
  18527. /**
  18528. * Creates a wrapped function that, when invoked, defers execution until the next
  18529. * animation frame
  18530. * @private
  18531. * @param {Function} fn The function to call.
  18532. * @param {Object} [scope] The scope (`this` reference) in which the function is executed. Defaults to the window object.
  18533. * @param {Array} [args] The argument list to pass to the function.
  18534. * @param {Number} [queueStrategy=3] A bit flag that indicates how multiple calls to
  18535. * the returned function within the same animation frame should be handled.
  18536. *
  18537. * - 1: All calls will be queued - FIFO order
  18538. * - 2: Only the first call will be queued
  18539. * - 3: The last call will replace all previous calls
  18540. *
  18541. * @return {Function}
  18542. */
  18543. createAnimationFrame: function(fn, scope, args, queueStrategy) {
  18544. var boundFn, timerId;
  18545. queueStrategy = queueStrategy || 3;
  18546. boundFn = function() {
  18547. var timerFn,
  18548. callArgs = args || slice.call(arguments, 0);
  18549. scope = scope || this;
  18550. if (queueStrategy === 3 && timerId) {
  18551. ExtFunction.cancelAnimationFrame(timerId);
  18552. }
  18553. if ((queueStrategy & 1) || !timerId) {
  18554. timerFn = function() {
  18555. timerId = boundFn.timerId = null;
  18556. fn.apply(scope, callArgs);
  18557. };
  18558. timerFn.$origFn = fn.$origFn || fn;
  18559. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18560. timerId = boundFn.timerId = ExtFunction.requestAnimationFrame(timerFn);
  18561. }
  18562. };
  18563. return boundFn;
  18564. },
  18565. /**
  18566. * @private
  18567. * Schedules the passed function to be called on the next animation frame.
  18568. * @param {Function} fn The function to call.
  18569. * @param {Object} [scope] The scope (`this` reference) in which the function is executed. Defaults to the window object.
  18570. * @param {Mixed[]} [args] The argument list to pass to the function.
  18571. *
  18572. * @return {Number} Timer id for the new animation frame to use when canceling it.
  18573. */
  18574. requestAnimationFrame: function(fn, scope, args) {
  18575. var id = ++idSource,
  18576. // Ids start at 1
  18577. handler = slice.call(arguments, 0);
  18578. handler[3] = id;
  18579. animFrameMap[id] = 1;
  18580. // A flag to indicate that the timer exists
  18581. Ext.Timer.created('raf', id, {
  18582. type: 'raf',
  18583. fn: fn
  18584. });
  18585. // We might be in fireHandlers at this moment but this new entry will not
  18586. // be executed until the next frame
  18587. animFrameHandlers.push(handler);
  18588. if (!animFrameId) {
  18589. animFrameId = requestAnimFrame(fireElevatedHandlers);
  18590. }
  18591. return id;
  18592. },
  18593. cancelAnimationFrame: function(id) {
  18594. // Don't remove any handlers from animFrameHandlers array, because
  18595. // the might be in use at the moment (when cancelAnimationFrame is called).
  18596. // Just remove the handler id from the map so it will not be executed
  18597. delete animFrameMap[id];
  18598. Ext.Timer.cancel('raf', id);
  18599. },
  18600. /**
  18601. * Creates a throttled version of the passed function which, when called repeatedly and
  18602. * rapidly, invokes the passed function only after a certain interval has elapsed since the
  18603. * previous invocation.
  18604. *
  18605. * This is useful for wrapping functions which may be called repeatedly, such as
  18606. * a handler of a mouse move event when the processing is expensive.
  18607. *
  18608. * @param {Function} fn The function to execute at a regular time interval.
  18609. * @param {Number} interval The interval in milliseconds on which the passed function is executed.
  18610. * @param {Object} [scope] The scope (`this` reference) in which
  18611. * the passed function is executed. If omitted, defaults to the scope specified by the caller.
  18612. * @return {Function} A function which invokes the passed function at the specified interval.
  18613. */
  18614. createThrottled: function(fn, interval, scope) {
  18615. var lastCallTime = 0,
  18616. elapsed, lastArgs, timerId,
  18617. execute = function() {
  18618. fn.apply(scope, lastArgs);
  18619. lastCallTime = Ext.now();
  18620. lastArgs = timerId = null;
  18621. };
  18622. execute.$origFn = fn.$origFn || fn;
  18623. execute.$skipTimerCheck = execute.$origFn.$skipTimerCheck;
  18624. return function() {
  18625. // Use scope of last call unless the creator specified a scope
  18626. if (!scope) {
  18627. scope = this;
  18628. }
  18629. elapsed = Ext.now() - lastCallTime;
  18630. lastArgs = Ext.Array.slice(arguments);
  18631. // If this is the first invocation, or the throttle interval has been reached, clear any
  18632. // pending invocation, and call the target function now.
  18633. if (elapsed >= interval) {
  18634. Ext.undefer(timerId);
  18635. execute();
  18636. }
  18637. // Throttle interval has not yet been reached. Only set the timer to fire if not already set.
  18638. else if (!timerId) {
  18639. timerId = Ext.defer(execute, interval - elapsed);
  18640. }
  18641. };
  18642. },
  18643. /**
  18644. * Wraps the passed function in a barrier function which will call the passed function after the passed number of invocations.
  18645. * @param {Number} count The number of invocations which will result in the calling of the passed function.
  18646. * @param {Function} fn The function to call after the required number of invocations.
  18647. * @param {Object} scope The scope (`this` reference) in which the function will be called.
  18648. */
  18649. createBarrier: function(count, fn, scope) {
  18650. var barrierFn = function() {
  18651. if (!--count) {
  18652. fn.apply(scope, arguments);
  18653. }
  18654. };
  18655. barrierFn.$origFn = fn.$origFn || fn;
  18656. barrierFn.$skipTimerCheck = barrierFn.$origFn.$skipTimerCheck;
  18657. return barrierFn;
  18658. },
  18659. /**
  18660. * Adds behavior to an existing method that is executed before the
  18661. * original behavior of the function. For example:
  18662. *
  18663. * var soup = {
  18664. * contents: [],
  18665. * add: function(ingredient) {
  18666. * this.contents.push(ingredient);
  18667. * }
  18668. * };
  18669. * Ext.Function.interceptBefore(soup, "add", function(ingredient){
  18670. * if (!this.contents.length && ingredient !== "water") {
  18671. * // Always add water to start with
  18672. * this.contents.push("water");
  18673. * }
  18674. * });
  18675. * soup.add("onions");
  18676. * soup.add("salt");
  18677. * soup.contents; // will contain: water, onions, salt
  18678. *
  18679. * @param {Object} object The target object
  18680. * @param {String} methodName Name of the method to override
  18681. * @param {Function} fn Function with the new behavior. It will
  18682. * be called with the same arguments as the original method. The
  18683. * return value of this function will be the return value of the
  18684. * new method.
  18685. * @param {Object} [scope] The scope to execute the interceptor function. Defaults to the object.
  18686. * @return {Function} The new function just created.
  18687. */
  18688. interceptBefore: function(object, methodName, fn, scope) {
  18689. var method = object[methodName] || Ext.emptyFn;
  18690. return (object[methodName] = function() {
  18691. var ret = fn.apply(scope || this, arguments);
  18692. method.apply(this, arguments);
  18693. return ret;
  18694. });
  18695. },
  18696. /**
  18697. * Adds behavior to an existing method that is executed after the
  18698. * original behavior of the function. For example:
  18699. *
  18700. * var soup = {
  18701. * contents: [],
  18702. * add: function(ingredient) {
  18703. * this.contents.push(ingredient);
  18704. * }
  18705. * };
  18706. * Ext.Function.interceptAfter(soup, "add", function(ingredient){
  18707. * // Always add a bit of extra salt
  18708. * this.contents.push("salt");
  18709. * });
  18710. * soup.add("water");
  18711. * soup.add("onions");
  18712. * soup.contents; // will contain: water, salt, onions, salt
  18713. *
  18714. * @param {Object} object The target object
  18715. * @param {String} methodName Name of the method to override
  18716. * @param {Function} fn Function with the new behavior. It will
  18717. * be called with the same arguments as the original method. The
  18718. * return value of this function will be the return value of the
  18719. * new method.
  18720. * @param {Object} [scope] The scope to execute the interceptor function. Defaults to the object.
  18721. * @return {Function} The new function just created.
  18722. */
  18723. interceptAfter: function(object, methodName, fn, scope) {
  18724. var method = object[methodName] || Ext.emptyFn;
  18725. return (object[methodName] = function() {
  18726. method.apply(this, arguments);
  18727. return fn.apply(scope || this, arguments);
  18728. });
  18729. },
  18730. interceptAfterOnce: function(object, methodName, fn, scope) {
  18731. var origMethod = object[methodName],
  18732. newMethod;
  18733. newMethod = function() {
  18734. var ret;
  18735. if (origMethod) {
  18736. origMethod.apply(this, arguments);
  18737. }
  18738. ret = fn.apply(scope || this, arguments);
  18739. object[methodName] = origMethod;
  18740. object = methodName = fn = scope = origMethod = newMethod = null;
  18741. return ret;
  18742. };
  18743. object[methodName] = newMethod;
  18744. return newMethod;
  18745. },
  18746. makeCallback: function(callback, scope) {
  18747. if (!scope[callback]) {
  18748. if (scope.$className) {
  18749. Ext.raise('No method "' + callback + '" on ' + scope.$className);
  18750. }
  18751. Ext.raise('No method "' + callback + '"');
  18752. }
  18753. return function() {
  18754. return scope[callback].apply(scope, arguments);
  18755. };
  18756. },
  18757. /**
  18758. * Returns a wrapper function that caches the return value for previously
  18759. * processed function argument(s).
  18760. *
  18761. * For example:
  18762. *
  18763. * function factorial (value) {
  18764. * var ret = value;
  18765. *
  18766. * while (--value > 1) {
  18767. * ret *= value;
  18768. * }
  18769. *
  18770. * return ret;
  18771. * }
  18772. *
  18773. * Each call to `factorial` will loop and multiply to produce the answer. Using
  18774. * this function we can wrap the above and cache its answers:
  18775. *
  18776. * factorial = Ext.Function.memoize(factorial);
  18777. *
  18778. * The returned function operates in the same manner as before, but results are
  18779. * stored in a cache to avoid calling the wrapped function when given the same
  18780. * arguments.
  18781. *
  18782. * var x = factorial(20); // first time; call real factorial()
  18783. * var y = factorial(20); // second time; return value from first call
  18784. *
  18785. * To support multi-argument methods, you will need to provide a `hashFn`.
  18786. *
  18787. * function permutation (n, k) {
  18788. * return factorial(n) / factorial(n - k);
  18789. * }
  18790. *
  18791. * permutation = Ext.Function.memoize(permutation, null, function (n, k) {
  18792. * n + '-' + k;
  18793. * });
  18794. *
  18795. * In this case, the `memoize` of `factorial` is sufficient optimization, but the
  18796. * example is simply to illustrate how to generate a unique key for an expensive,
  18797. * multi-argument method.
  18798. *
  18799. * **IMPORTANT**: This cache is unbounded so be cautious of memory leaks if the
  18800. * `memoize`d function is kept indefinitely or is given an unbounded set of
  18801. * possible arguments.
  18802. *
  18803. * @param {Function} fn Function to wrap.
  18804. * @param {Object} scope Optional scope in which to execute the wrapped function.
  18805. * @param {Function} hashFn Optional function used to compute a hash key for
  18806. * storing the result, based on the arguments to the original function.
  18807. * @return {Function} The caching wrapper function.
  18808. * @since 6.0.0
  18809. */
  18810. memoize: function(fn, scope, hashFn) {
  18811. var memo = {},
  18812. isFunc = hashFn && Ext.isFunction(hashFn);
  18813. return function(value) {
  18814. var key = isFunc ? hashFn.apply(scope, arguments) : value;
  18815. if (!(key in memo)) {
  18816. memo[key] = fn.apply(scope, arguments);
  18817. }
  18818. return memo[key];
  18819. };
  18820. },
  18821. _stripCommentRe: /(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(\/\/.*)/g,
  18822. toCode: function(fn) {
  18823. var s = fn ? fn.toString() : '';
  18824. s = s.replace(ExtFunction._stripCommentRe, '');
  18825. return s;
  18826. },
  18827. // This is useful for unit testing so we can force handlers which have been deferred
  18828. // to the next animation frame to run immediately
  18829. fireElevatedHandlers: function() {
  18830. fireElevatedHandlers();
  18831. }
  18832. };
  18833. // ExtFunction
  18834. /**
  18835. * @member Ext
  18836. * @method asap
  18837. * Schedules the specified callback function to be executed on the next turn of the
  18838. * event loop. Where available, this method uses the browser's `setImmediate` API. If
  18839. * not available, this method substitutes `setTimeout(0)`. Though not a perfect
  18840. * replacement for `setImmediate` it is sufficient for many use cases.
  18841. *
  18842. * For more details see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate).
  18843. *
  18844. * @param {Function} fn Callback function.
  18845. * @param {Object} [scope] The scope for the callback (`this` pointer).
  18846. * @param {Mixed[]} [parameters] Additional parameters to pass to `fn`.
  18847. * @return {Number} A cancellation id for `{@link Ext#unasap}`.
  18848. */
  18849. Ext.asap = hasImmediate ? function(fn, scope, parameters) {
  18850. var boundFn = fn,
  18851. timerFn, timerId;
  18852. var timer;
  18853. if (scope != null || parameters != null) {
  18854. boundFn = ExtFunction.bind(fn, scope, parameters);
  18855. }
  18856. timerFn = function() {
  18857. Ext.elevate(boundFn, null, null, timer);
  18858. };
  18859. timerId = setImmediate(timerFn);
  18860. timerFn.$origFn = fn.$origFn || fn;
  18861. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18862. timer = Ext.Timer.created('asap', timerId, {
  18863. type: 'asap',
  18864. fn: fn,
  18865. timerFn: timerFn
  18866. });
  18867. return timerId;
  18868. } : function(fn, scope, parameters) {
  18869. var boundFn = fn,
  18870. timerFn, timerId;
  18871. var timer;
  18872. if (scope != null || parameters != null) {
  18873. boundFn = ExtFunction.bind(fn, scope, parameters);
  18874. }
  18875. timerFn = function() {
  18876. Ext.elevate(boundFn, null, null, timer);
  18877. };
  18878. timerId = setTimeout(timerFn, 0, true);
  18879. timerFn.$origFn = fn.$origFn || fn;
  18880. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18881. timer = Ext.Timer.created('timeout', timerId, {
  18882. type: 'asap',
  18883. fn: fn,
  18884. timerFn: timerFn
  18885. });
  18886. return timerId;
  18887. };
  18888. /**
  18889. * @member Ext
  18890. * @method unasap
  18891. * Cancels a previously scheduled call to `{@link Ext#asap}`.
  18892. *
  18893. * var timerId = Ext.asap(me.method, me);
  18894. * ...
  18895. *
  18896. * if (nevermind) {
  18897. * Ext.unasap(timerId);
  18898. * }
  18899. *
  18900. * This method always returns `null` to enable simple cleanup:
  18901. *
  18902. * timerId = Ext.unasap(timerId); // safe even if !timerId
  18903. *
  18904. * @param {Number} id The id returned by `{@link Ext#asap}`.
  18905. * @return {Object} Always returns `null`.
  18906. */
  18907. Ext.unasap = hasImmediate ? function(id) {
  18908. if (id) {
  18909. clearImmediate(id);
  18910. Ext.Timer.cancel('asap', id);
  18911. }
  18912. return null;
  18913. } : function(id) {
  18914. return Ext.undefer(id);
  18915. };
  18916. /**
  18917. * @member Ext
  18918. * @method asapCancel
  18919. * Cancels a previously scheduled call to `{@link Ext#asap}`.
  18920. * @param {Number} id The id returned by `{@link Ext#asap}`.
  18921. * @deprecated 6.5.1 Use `Ext.unasap` instead.
  18922. */
  18923. Ext.asapCancel = function(id) {
  18924. return Ext.unasap(id);
  18925. };
  18926. /**
  18927. * @method defer
  18928. * @member Ext
  18929. * @inheritdoc Ext.Function#defer
  18930. */
  18931. Ext.defer = ExtFunction.defer;
  18932. /**
  18933. * @member Ext
  18934. * @method undefer
  18935. * Cancels a previously scheduled call to `{@link Ext#defer}`.
  18936. *
  18937. * var timerId = Ext.defer(me.method, me);
  18938. * ...
  18939. *
  18940. * if (nevermind) {
  18941. * Ext.undefer(timerId);
  18942. * }
  18943. *
  18944. * This method always returns `null` to enable simple cleanup:
  18945. *
  18946. * timerId = Ext.undefer(timerId); // safe even if !timerId
  18947. *
  18948. * @param {Number} id The id returned by `{@link Ext#defer}`.
  18949. */
  18950. Ext.undefer = function(id) {
  18951. if (id) {
  18952. clearTimeout(id);
  18953. Ext.Timer.cancel('timeout', id);
  18954. }
  18955. return null;
  18956. };
  18957. /**
  18958. * @method interval
  18959. * @member Ext
  18960. * @inheritdoc Ext.Function#interval
  18961. */
  18962. Ext.interval = ExtFunction.interval;
  18963. /**
  18964. * @member Ext
  18965. * @method uninterval
  18966. * Cancels a previously scheduled call to `{@link Ext#interval}`.
  18967. *
  18968. * var timerId = Ext.interval(me.method, me);
  18969. * ...
  18970. *
  18971. * if (nevermind) {
  18972. * Ext.uninterval(timerId);
  18973. * }
  18974. *
  18975. * This method always returns `null` to enable simple cleanup:
  18976. *
  18977. * timerId = Ext.uninterval(timerId); // safe even if !timerId
  18978. *
  18979. * @param {Number} id The id returned by `{@link Ext#interval}`.
  18980. */
  18981. Ext.uninterval = function(id) {
  18982. if (id) {
  18983. clearInterval(id);
  18984. Ext.Timer.cancel('interval', id);
  18985. }
  18986. return null;
  18987. };
  18988. /**
  18989. * @method pass
  18990. * @member Ext
  18991. * @inheritdoc Ext.Function#pass
  18992. */
  18993. Ext.pass = ExtFunction.pass;
  18994. /**
  18995. * @method bind
  18996. * @member Ext
  18997. * @inheritdoc Ext.Function#bind
  18998. */
  18999. Ext.bind = ExtFunction.bind;
  19000. Ext.raf = function() {
  19001. return ExtFunction.requestAnimationFrame.apply(ExtFunction, arguments);
  19002. };
  19003. Ext.unraf = function(id) {
  19004. ExtFunction.cancelAnimationFrame(id);
  19005. };
  19006. return ExtFunction;
  19007. })();
  19008. /**
  19009. * @class Ext.Number
  19010. *
  19011. * A collection of useful static methods to deal with numbers
  19012. * @singleton
  19013. */
  19014. Ext.Number = (new function() {
  19015. // jshint ignore:line
  19016. // @define Ext.lang.Number
  19017. // @define Ext.Number
  19018. // @require Ext
  19019. var ExtNumber = this,
  19020. isToFixedBroken = (0.9).toFixed() !== '1',
  19021. math = Math,
  19022. ClipDefault = {
  19023. count: false,
  19024. inclusive: false,
  19025. wrap: true
  19026. };
  19027. // polyfill
  19028. Number.MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -(math.pow(2, 53) - 1);
  19029. Number.MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || math.pow(2, 53) - 1;
  19030. Ext.apply(ExtNumber, {
  19031. MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,
  19032. MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,
  19033. // No good way to allow "9." w/o allowing "." alone but we use isNaN to reject that
  19034. floatRe: /^[-+]?(?:\d+|\d*\.\d*)(?:[Ee][+-]?\d+)?$/,
  19035. intRe: /^[-+]?\d+(?:[Ee]\+?\d+)?$/,
  19036. Clip: {
  19037. DEFAULT: ClipDefault,
  19038. COUNT: Ext.applyIf({
  19039. count: true
  19040. }, ClipDefault),
  19041. INCLUSIVE: Ext.applyIf({
  19042. inclusive: true
  19043. }, ClipDefault),
  19044. NOWRAP: Ext.applyIf({
  19045. wrap: false
  19046. }, ClipDefault)
  19047. },
  19048. /**
  19049. * Strictly parses the given value and returns the value as a number or `null` if
  19050. * the value is not a number or contains non-numeric pieces.
  19051. * @param {String} value
  19052. * @return {Number}
  19053. * @since 6.5.1
  19054. */
  19055. parseFloat: function(value) {
  19056. if (value === undefined) {
  19057. value = null;
  19058. }
  19059. if (value !== null && typeof value !== 'number') {
  19060. value = String(value);
  19061. value = ExtNumber.floatRe.test(value) ? +value : null;
  19062. if (isNaN(value)) {
  19063. value = null;
  19064. }
  19065. }
  19066. return value;
  19067. },
  19068. /**
  19069. * Strictly parses the given value and returns the value as a number or `null` if
  19070. * the value is not an integer number or contains non-integer pieces.
  19071. * @param {String} value
  19072. * @return {Number}
  19073. * @since 6.5.1
  19074. */
  19075. parseInt: function(value) {
  19076. if (value === undefined) {
  19077. value = null;
  19078. }
  19079. if (typeof value === 'number') {
  19080. value = Math.floor(value);
  19081. } else if (value !== null) {
  19082. value = String(value);
  19083. value = ExtNumber.intRe.test(value) ? +value : null;
  19084. }
  19085. return value;
  19086. },
  19087. binarySearch: function(array, value, begin, end) {
  19088. if (begin === undefined) {
  19089. begin = 0;
  19090. }
  19091. if (end === undefined) {
  19092. end = array.length;
  19093. }
  19094. --end;
  19095. var middle, midVal;
  19096. while (begin <= end) {
  19097. middle = (begin + end) >>> 1;
  19098. // unsigned right shift = Math.floor(x/2)
  19099. midVal = array[middle];
  19100. if (value === midVal) {
  19101. return middle;
  19102. }
  19103. if (midVal < value) {
  19104. begin = middle + 1;
  19105. } else {
  19106. end = middle - 1;
  19107. }
  19108. }
  19109. return begin;
  19110. },
  19111. bisectTuples: function(array, value, index, begin, end) {
  19112. if (begin === undefined) {
  19113. begin = 0;
  19114. }
  19115. if (end === undefined) {
  19116. end = array.length;
  19117. }
  19118. --end;
  19119. var middle, midVal;
  19120. while (begin <= end) {
  19121. middle = (begin + end) >>> 1;
  19122. // unsigned right shift = Math.floor(x/2)
  19123. midVal = array[middle][index];
  19124. if (value === midVal) {
  19125. return middle;
  19126. }
  19127. if (midVal < value) {
  19128. begin = middle + 1;
  19129. } else {
  19130. end = middle - 1;
  19131. }
  19132. }
  19133. return begin;
  19134. },
  19135. /**
  19136. * Coerces a given index into a valid index given a `length`.
  19137. *
  19138. * Negative indexes are interpreted starting at the end of the collection. That is,
  19139. * a value of -1 indicates the last item, or equivalent to `length - 1`.
  19140. *
  19141. * When handling methods that take "begin" and "end" arguments like most array or
  19142. * string methods, this method can be used like so:
  19143. *
  19144. * function foo (array, begin, end) {
  19145. * var range = Ext.Number.clipIndices(array.length, [begin, end]);
  19146. *
  19147. * begin = range[0];
  19148. * end = range[1];
  19149. *
  19150. * // 0 <= begin <= end <= array.length
  19151. *
  19152. * var length = end - begin;
  19153. * }
  19154. *
  19155. * For example:
  19156. *
  19157. * +---+---+---+---+---+---+---+---+
  19158. * | | | | | | | | | length = 8
  19159. * +---+---+---+---+---+---+---+---+
  19160. * 0 1 2 3 4 5 6 7
  19161. * -8 -7 -6 -5 -4 -3 -2 -1
  19162. *
  19163. * console.log(Ext.Number.clipIndices(8, [3, 10]); // logs "[3, 8]"
  19164. * console.log(Ext.Number.clipIndices(8, [-5]); // logs "[3, 8]"
  19165. * console.log(Ext.Number.clipIndices(8, []);
  19166. * console.log(Ext.Number.clipIndices(8, []);
  19167. *
  19168. * @param {Number} length
  19169. * @param {Number[]} indices
  19170. * @param {Object} [options] An object with different option flags.
  19171. * @param {Boolean} [options.count=false] The second number in `indices` is the
  19172. * count not and an index.
  19173. * @param {Boolean} [options.inclusive=false] The second number in `indices` is
  19174. * "inclusive" meaning that the item should be considered in the range. Normally,
  19175. * the second number is considered the first item outside the range or as an
  19176. * "exclusive" bound.
  19177. * @param {Boolean} [options.wrap=true] Wraps negative numbers backwards from the
  19178. * end of the array. Passing `false` simply clips negative index values at 0.
  19179. * @return {Number[]} The normalized `[begin, end]` array where `end` is now
  19180. * exclusive such that `length = end - begin`. Both values are between 0 and the
  19181. * given `length` and `end` will not be less-than `begin`.
  19182. */
  19183. clipIndices: function(length, indices, options) {
  19184. options = options || ClipDefault;
  19185. var defaultValue = 0,
  19186. // default value for "begin"
  19187. wrap = options.wrap,
  19188. begin, end, i;
  19189. indices = indices || [];
  19190. for (i = 0; i < 2; ++i) {
  19191. // names are off on first pass but used this way so things make sense
  19192. // following the loop..
  19193. begin = end;
  19194. // pick up and keep the result from the first loop
  19195. end = indices[i];
  19196. if (end == null) {
  19197. end = defaultValue;
  19198. } else if (i && options.count) {
  19199. end += begin;
  19200. // this is the length not "end" so convert to "end"
  19201. end = (end > length) ? length : end;
  19202. } else {
  19203. if (wrap) {
  19204. end = (end < 0) ? (length + end) : end;
  19205. }
  19206. if (i && options.inclusive) {
  19207. ++end;
  19208. }
  19209. end = (end < 0) ? 0 : ((end > length) ? length : end);
  19210. }
  19211. defaultValue = length;
  19212. }
  19213. // default value for "end"
  19214. // after loop:
  19215. // 0 <= begin <= length (calculated from indices[0])
  19216. // 0 <= end <= length (calculated from indices[1])
  19217. indices[0] = begin;
  19218. indices[1] = (end < begin) ? begin : end;
  19219. return indices;
  19220. },
  19221. /**
  19222. * Checks whether or not the passed number is within a desired range. If the number is already within the
  19223. * range it is returned, otherwise the min or max value is returned depending on which side of the range is
  19224. * exceeded. Note that this method returns the constrained value but does not change the current number.
  19225. * @param {Number} number The number to check
  19226. * @param {Number} min The minimum number in the range
  19227. * @param {Number} max The maximum number in the range
  19228. * @return {Number} The constrained value if outside the range, otherwise the current value
  19229. */
  19230. constrain: function(number, min, max) {
  19231. var x = parseFloat(number);
  19232. // (x < Nan) || (x < undefined) == false
  19233. // same for (x > NaN) || (x > undefined)
  19234. // sadly this is not true of null - (1 > null)
  19235. if (min === null) {
  19236. min = number;
  19237. }
  19238. if (max === null) {
  19239. max = number;
  19240. }
  19241. // Watch out for NaN in Chrome 18
  19242. // V8bug: http://code.google.com/p/v8/issues/detail?id=2056
  19243. // Operators are faster than Math.min/max. See http://jsperf.com/number-constrain
  19244. return (x < min) ? min : ((x > max) ? max : x);
  19245. },
  19246. /**
  19247. * Snaps the passed number between stopping points based upon a passed increment value.
  19248. *
  19249. * The difference between this and {@link #snapInRange} is that {@link #snapInRange} uses the minValue
  19250. * when calculating snap points:
  19251. *
  19252. * r = Ext.Number.snap(56, 2, 55, 65); // Returns 56 - snap points are zero based
  19253. *
  19254. * r = Ext.Number.snapInRange(56, 2, 55, 65); // Returns 57 - snap points are based from minValue
  19255. *
  19256. * @param {Number} value The unsnapped value.
  19257. * @param {Number} increment The increment by which the value must move.
  19258. * @param {Number} minValue The minimum value to which the returned value must be constrained. Overrides the increment.
  19259. * @param {Number} maxValue The maximum value to which the returned value must be constrained. Overrides the increment.
  19260. * @return {Number} The value of the nearest snap target.
  19261. */
  19262. snap: function(value, increment, minValue, maxValue) {
  19263. var m;
  19264. // If no value passed, or minValue was passed and value is less than minValue (anything < undefined is false)
  19265. // Then use the minValue (or zero if the value was undefined)
  19266. if (value === undefined || value < minValue) {
  19267. return minValue || 0;
  19268. }
  19269. if (increment) {
  19270. m = value % increment;
  19271. if (m !== 0) {
  19272. value -= m;
  19273. if (m * 2 >= increment) {
  19274. value += increment;
  19275. } else if (m * 2 < -increment) {
  19276. value -= increment;
  19277. }
  19278. }
  19279. }
  19280. return ExtNumber.constrain(value, minValue, maxValue);
  19281. },
  19282. /**
  19283. * Snaps the passed number between stopping points based upon a passed increment value.
  19284. *
  19285. * The difference between this and {@link #snap} is that {@link #snap} does not use the minValue
  19286. * when calculating snap points:
  19287. *
  19288. * r = Ext.Number.snap(56, 2, 55, 65); // Returns 56 - snap points are zero based
  19289. *
  19290. * r = Ext.Number.snapInRange(56, 2, 55, 65); // Returns 57 - snap points are based from minValue
  19291. *
  19292. * @param {Number} value The unsnapped value.
  19293. * @param {Number} increment The increment by which the value must move.
  19294. * @param {Number} [minValue=0] The minimum value to which the returned value must be constrained.
  19295. * @param {Number} [maxValue=Infinity] The maximum value to which the returned value must be constrained.
  19296. * @return {Number} The value of the nearest snap target.
  19297. */
  19298. snapInRange: function(value, increment, minValue, maxValue) {
  19299. var tween;
  19300. // default minValue to zero
  19301. minValue = (minValue || 0);
  19302. // If value is undefined, or less than minValue, use minValue
  19303. if (value === undefined || value < minValue) {
  19304. return minValue;
  19305. }
  19306. // Calculate how many snap points from the minValue the passed value is.
  19307. if (increment && (tween = ((value - minValue) % increment))) {
  19308. value -= tween;
  19309. tween *= 2;
  19310. if (tween >= increment) {
  19311. value += increment;
  19312. }
  19313. }
  19314. // If constraining within a maximum, ensure the maximum is on a snap point
  19315. if (maxValue !== undefined) {
  19316. if (value > (maxValue = ExtNumber.snapInRange(maxValue, increment, minValue))) {
  19317. value = maxValue;
  19318. }
  19319. }
  19320. return value;
  19321. },
  19322. /**
  19323. * Round a number to the nearest interval.
  19324. * @param {Number} value The value to round.
  19325. * @param {Number} interval The interval to round to.
  19326. * @return {Number} The rounded value.
  19327. *
  19328. * @since 6.2.0
  19329. */
  19330. roundToNearest: function(value, interval) {
  19331. interval = interval || 1;
  19332. return interval * math.round(value / interval);
  19333. },
  19334. /**
  19335. * Rounds a number to the specified precision.
  19336. * @param value
  19337. * @param precision
  19338. * @return {number}
  19339. */
  19340. roundToPrecision: function(value, precision) {
  19341. var factor = math.pow(10, precision || 1);
  19342. return math.round(value * factor) / factor;
  19343. },
  19344. /**
  19345. * Truncates a number to the specified precision,
  19346. * without rounding.
  19347. * @param value
  19348. * @param precision
  19349. * @return {number}
  19350. * @since 6.5.1
  19351. */
  19352. truncateToPrecision: function(value, precision) {
  19353. var factor = math.pow(10, precision || 1);
  19354. return parseInt(value * factor, 10) / factor;
  19355. },
  19356. /**
  19357. * Returns the sign of the given number. See also MDN for Math.sign documentation
  19358. * for the standard method this method emulates.
  19359. * @param {Number} x The number.
  19360. * @return {Number} The sign of the number `x`, indicating whether the number is
  19361. * positive (1), negative (-1) or zero (0).
  19362. * @method sign
  19363. */
  19364. sign: math.sign || function(x) {
  19365. x = +x;
  19366. // force to a Number
  19367. if (x === 0 || isNaN(x)) {
  19368. return x;
  19369. }
  19370. return (x > 0) ? 1 : -1;
  19371. },
  19372. /**
  19373. * Returns the base 10 logarithm of a number.
  19374. * This will use Math.log10, if available (ES6).
  19375. * @param {Number} x The number.
  19376. * @return {Number} Base 10 logarithm of the number 'x'.
  19377. * @method log10
  19378. */
  19379. log10: math.log10 || function(x) {
  19380. return math.log(x) * math.LOG10E;
  19381. },
  19382. /**
  19383. * Determines if two numbers `n1` and `n2` are equal within a given
  19384. * margin of precision `epsilon`.
  19385. * @param {Number} n1 First number.
  19386. * @param {Number} n2 Second number.
  19387. * @param {Number} epsilon Margin of precision.
  19388. * @return {Boolean} `true`, if numbers are equal. `false` otherwise.
  19389. */
  19390. isEqual: function(n1, n2, epsilon) {
  19391. if (!(typeof n1 === 'number' && typeof n2 === 'number' && typeof epsilon === 'number')) {
  19392. Ext.raise("All parameters should be valid numbers.");
  19393. }
  19394. return math.abs(n1 - n2) < epsilon;
  19395. },
  19396. /**
  19397. * Determines if the value passed is a number and also finite.
  19398. * This a Polyfill version of Number.isFinite(),differently than
  19399. * the isFinite() function, this method doesn't convert the parameter to a number.
  19400. * @param {Number} value Number to be tested.
  19401. * @return {Boolean} `true`, if the parameter is a number and finite, `false` otherwise.
  19402. * @since 6.2
  19403. */
  19404. isFinite: Number.isFinite || function(value) {
  19405. return typeof value === 'number' && isFinite(value);
  19406. },
  19407. isInteger: Number.isInteger || function(value) {
  19408. // Add zero get a valid result in a special case where the value is a number string.
  19409. // E.g. '10' + 0 is '100'.
  19410. return ~~(value + 0) === value;
  19411. },
  19412. /**
  19413. * @method
  19414. * Formats a number using fixed-point notation
  19415. * @param {Number} value The number to format
  19416. * @param {Number} precision The number of digits to show after the decimal point
  19417. */
  19418. toFixed: isToFixedBroken ? function(value, precision) {
  19419. precision = precision || 0;
  19420. var pow = math.pow(10, precision);
  19421. return (math.round(value * pow) / pow).toFixed(precision);
  19422. } : function(value, precision) {
  19423. return value.toFixed(precision);
  19424. },
  19425. /**
  19426. * Validate that a value is numeric and convert it to a number if necessary. Returns the specified default value if
  19427. * it is not.
  19428. Ext.Number.from('1.23', 1); // returns 1.23
  19429. Ext.Number.from('abc', 1); // returns 1
  19430. * @param {Object} value
  19431. * @param {Number} defaultValue The value to return if the original value is non-numeric
  19432. * @return {Number} value, if numeric, defaultValue otherwise
  19433. */
  19434. from: function(value, defaultValue) {
  19435. if (isFinite(value)) {
  19436. value = parseFloat(value);
  19437. }
  19438. return !isNaN(value) ? value : defaultValue;
  19439. },
  19440. /**
  19441. * Returns a random integer between the specified range (inclusive)
  19442. * @param {Number} from Lowest value to return.
  19443. * @param {Number} to Highest value to return.
  19444. * @return {Number} A random integer within the specified range.
  19445. */
  19446. randomInt: function(from, to) {
  19447. return math.floor(math.random() * (to - from + 1) + from);
  19448. },
  19449. /**
  19450. * Corrects floating point numbers that overflow to a non-precise
  19451. * value because of their floating nature, for example `0.1 + 0.2`
  19452. * @param {Number} n The number
  19453. * @return {Number} The correctly rounded number
  19454. */
  19455. correctFloat: function(n) {
  19456. // This is to correct the type of errors where 2 floats end with
  19457. // a long string of decimals, eg 0.1 + 0.2. When they overflow in this
  19458. // manner, they usually go to 15-16 decimals, so we cut it off at 14.
  19459. return parseFloat(n.toPrecision(14));
  19460. }
  19461. });
  19462. /**
  19463. * @deprecated 4.0.0 Please use {@link Ext.Number#from} instead.
  19464. * @member Ext
  19465. * @method num
  19466. * @inheritdoc Ext.Number#from
  19467. */
  19468. Ext.num = function() {
  19469. return ExtNumber.from.apply(this, arguments);
  19470. };
  19471. }());
  19472. /**
  19473. * @class Ext.Object
  19474. *
  19475. * A collection of useful static methods to deal with objects.
  19476. *
  19477. * @singleton
  19478. */
  19479. (function() {
  19480. // The "constructor" for chain:
  19481. var TemplateClass = function() {},
  19482. queryRe = /^\?/,
  19483. keyRe = /(\[):?([^\]]*)\]/g,
  19484. nameRe = /^([^\[]+)/,
  19485. plusRe = /\+/g,
  19486. ExtObject = Ext.Object = {
  19487. // @define Ext.lang.Object
  19488. // @define Ext.Object
  19489. // @require Ext
  19490. // @require Ext.lang.Date
  19491. /**
  19492. * @method
  19493. * Returns a new object with the given object as the prototype chain. This method is
  19494. * designed to mimic the ECMA standard `Object.create` method and is assigned to that
  19495. * function when it is available.
  19496. *
  19497. * **NOTE** This method does not support the property definitions capability of the
  19498. * `Object.create` method. Only the first argument is supported.
  19499. *
  19500. * @param {Object} object The prototype chain for the new object.
  19501. */
  19502. chain: Object.create || function(object) {
  19503. TemplateClass.prototype = object;
  19504. var result = new TemplateClass();
  19505. TemplateClass.prototype = null;
  19506. return result;
  19507. },
  19508. /**
  19509. * This method removes all keys from the given object.
  19510. * @param {Object} object The object from which to remove all keys.
  19511. * @return {Object} The given object.
  19512. */
  19513. clear: function(object) {
  19514. // Safe to delete during iteration
  19515. for (var key in object) {
  19516. delete object[key];
  19517. }
  19518. return object;
  19519. },
  19520. /**
  19521. * Freezes the given object making it immutable. This operation is by default shallow
  19522. * and does not effect objects referenced by the given object.
  19523. *
  19524. * @method
  19525. * @param {Object} obj The object to freeze.
  19526. * @param {Boolean} [deep=false] Pass `true` to freeze sub-objects recursively.
  19527. * @return {Object} The given object `obj`.
  19528. */
  19529. freeze: Object.freeze ? function(obj, deep) {
  19530. if (obj && typeof obj === 'object' && !Object.isFrozen(obj)) {
  19531. Object.freeze(obj);
  19532. if (deep) {
  19533. for (var name in obj) {
  19534. ExtObject.freeze(obj[name], deep);
  19535. }
  19536. }
  19537. }
  19538. return obj;
  19539. } : Ext.identityFn,
  19540. /**
  19541. * Converts a `name` - `value` pair to an array of objects with support for nested structures. Useful to construct
  19542. * query strings. For example:
  19543. *
  19544. * var objects = Ext.Object.toQueryObjects('hobbies', ['reading', 'cooking', 'swimming']);
  19545. *
  19546. * // objects then equals:
  19547. * [
  19548. * { name: 'hobbies', value: 'reading' },
  19549. * { name: 'hobbies', value: 'cooking' },
  19550. * { name: 'hobbies', value: 'swimming' },
  19551. * ];
  19552. *
  19553. * var objects = Ext.Object.toQueryObjects('dateOfBirth', {
  19554. * day: 3,
  19555. * month: 8,
  19556. * year: 1987,
  19557. * extra: {
  19558. * hour: 4
  19559. * minute: 30
  19560. * }
  19561. * }, true); // Recursive
  19562. *
  19563. * // objects then equals:
  19564. * [
  19565. * { name: 'dateOfBirth[day]', value: 3 },
  19566. * { name: 'dateOfBirth[month]', value: 8 },
  19567. * { name: 'dateOfBirth[year]', value: 1987 },
  19568. * { name: 'dateOfBirth[extra][hour]', value: 4 },
  19569. * { name: 'dateOfBirth[extra][minute]', value: 30 },
  19570. * ];
  19571. *
  19572. * @param {String} name
  19573. * @param {Object/Array} value
  19574. * @param {Boolean} [recursive=false] True to traverse object recursively
  19575. * @return {Object[]}
  19576. */
  19577. toQueryObjects: function(name, value, recursive) {
  19578. var self = ExtObject.toQueryObjects,
  19579. objects = [],
  19580. i, ln;
  19581. if (Ext.isArray(value)) {
  19582. for (i = 0 , ln = value.length; i < ln; i++) {
  19583. if (recursive) {
  19584. objects = objects.concat(self(name + '[' + i + ']', value[i], true));
  19585. } else {
  19586. objects.push({
  19587. name: name,
  19588. value: value[i]
  19589. });
  19590. }
  19591. }
  19592. } else if (Ext.isObject(value)) {
  19593. for (i in value) {
  19594. if (value.hasOwnProperty(i)) {
  19595. if (recursive) {
  19596. objects = objects.concat(self(name + '[' + i + ']', value[i], true));
  19597. } else {
  19598. objects.push({
  19599. name: name,
  19600. value: value[i]
  19601. });
  19602. }
  19603. }
  19604. }
  19605. } else {
  19606. objects.push({
  19607. name: name,
  19608. value: value
  19609. });
  19610. }
  19611. return objects;
  19612. },
  19613. /**
  19614. * Takes an object and converts it to an encoded query string.
  19615. *
  19616. * Non-recursive:
  19617. *
  19618. * Ext.Object.toQueryString({foo: 1, bar: 2}); // returns "foo=1&bar=2"
  19619. * Ext.Object.toQueryString({foo: null, bar: 2}); // returns "foo=&bar=2"
  19620. * Ext.Object.toQueryString({'some price': '$300'}); // returns "some%20price=%24300"
  19621. * Ext.Object.toQueryString({date: new Date(2011, 0, 1)}); // returns "date=%222011-01-01T00%3A00%3A00%22"
  19622. * Ext.Object.toQueryString({colors: ['red', 'green', 'blue']}); // returns "colors=red&colors=green&colors=blue"
  19623. *
  19624. * Recursive:
  19625. *
  19626. * Ext.Object.toQueryString({
  19627. * username: 'Jacky',
  19628. * dateOfBirth: {
  19629. * day: 1,
  19630. * month: 2,
  19631. * year: 1911
  19632. * },
  19633. * hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
  19634. * }, true); // returns the following string (broken down and url-decoded for ease of reading purpose):
  19635. * // username=Jacky
  19636. * // &dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911
  19637. * // &hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&hobbies[3][0]=nested&hobbies[3][1]=stuff
  19638. *
  19639. * @param {Object} object The object to encode
  19640. * @param {Boolean} [recursive=false] Whether or not to interpret the object in recursive format.
  19641. * (PHP / Ruby on Rails servers and similar).
  19642. * @return {String} queryString
  19643. */
  19644. toQueryString: function(object, recursive) {
  19645. var paramObjects = [],
  19646. params = [],
  19647. i, j, ln, paramObject, value;
  19648. for (i in object) {
  19649. if (object.hasOwnProperty(i)) {
  19650. paramObjects = paramObjects.concat(ExtObject.toQueryObjects(i, object[i], recursive));
  19651. }
  19652. }
  19653. for (j = 0 , ln = paramObjects.length; j < ln; j++) {
  19654. paramObject = paramObjects[j];
  19655. value = paramObject.value;
  19656. if (Ext.isEmpty(value)) {
  19657. value = '';
  19658. } else if (Ext.isDate(value)) {
  19659. value = Ext.Date.toString(value);
  19660. }
  19661. params.push(encodeURIComponent(paramObject.name) + '=' + encodeURIComponent(String(value)));
  19662. }
  19663. return params.join('&');
  19664. },
  19665. /**
  19666. * Converts a query string back into an object.
  19667. *
  19668. * Non-recursive:
  19669. *
  19670. * Ext.Object.fromQueryString("foo=1&bar=2"); // returns {foo: '1', bar: '2'}
  19671. * Ext.Object.fromQueryString("foo=&bar=2"); // returns {foo: '', bar: '2'}
  19672. * Ext.Object.fromQueryString("some%20price=%24300"); // returns {'some price': '$300'}
  19673. * Ext.Object.fromQueryString("colors=red&colors=green&colors=blue"); // returns {colors: ['red', 'green', 'blue']}
  19674. *
  19675. * Recursive:
  19676. *
  19677. * Ext.Object.fromQueryString(
  19678. * "username=Jacky&"+
  19679. * "dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911&"+
  19680. * "hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&"+
  19681. * "hobbies[3][0]=nested&hobbies[3][1]=stuff", true);
  19682. *
  19683. * // returns
  19684. * {
  19685. * username: 'Jacky',
  19686. * dateOfBirth: {
  19687. * day: '1',
  19688. * month: '2',
  19689. * year: '1911'
  19690. * },
  19691. * hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
  19692. * }
  19693. *
  19694. * @param {String} queryString The query string to decode
  19695. * @param {Boolean} [recursive=false] Whether or not to recursively decode the string. This format is supported by
  19696. * PHP / Ruby on Rails servers and similar.
  19697. * @return {Object}
  19698. */
  19699. fromQueryString: function(queryString, recursive) {
  19700. var parts = queryString.replace(queryRe, '').split('&'),
  19701. object = {},
  19702. temp, components, name, value, i, ln, part, j, subLn, matchedKeys, matchedName, keys, key, nextKey;
  19703. for (i = 0 , ln = parts.length; i < ln; i++) {
  19704. part = parts[i];
  19705. if (part.length > 0) {
  19706. components = part.split('=');
  19707. name = components[0];
  19708. name = name.replace(plusRe, '%20');
  19709. name = decodeURIComponent(name);
  19710. value = components[1];
  19711. if (value !== undefined) {
  19712. value = value.replace(plusRe, '%20');
  19713. value = decodeURIComponent(value);
  19714. } else {
  19715. value = '';
  19716. }
  19717. if (!recursive) {
  19718. if (object.hasOwnProperty(name)) {
  19719. if (!Ext.isArray(object[name])) {
  19720. object[name] = [
  19721. object[name]
  19722. ];
  19723. }
  19724. object[name].push(value);
  19725. } else {
  19726. object[name] = value;
  19727. }
  19728. } else {
  19729. matchedKeys = name.match(keyRe);
  19730. matchedName = name.match(nameRe);
  19731. if (!matchedName) {
  19732. throw new Error('[Ext.Object.fromQueryString] Malformed query string given, failed parsing name from "' + part + '"');
  19733. }
  19734. name = matchedName[0];
  19735. keys = [];
  19736. if (matchedKeys === null) {
  19737. object[name] = value;
  19738. continue;
  19739. }
  19740. for (j = 0 , subLn = matchedKeys.length; j < subLn; j++) {
  19741. key = matchedKeys[j];
  19742. key = (key.length === 2) ? '' : key.substring(1, key.length - 1);
  19743. keys.push(key);
  19744. }
  19745. keys.unshift(name);
  19746. temp = object;
  19747. for (j = 0 , subLn = keys.length; j < subLn; j++) {
  19748. key = keys[j];
  19749. if (j === subLn - 1) {
  19750. if (Ext.isArray(temp) && key === '') {
  19751. temp.push(value);
  19752. } else {
  19753. temp[key] = value;
  19754. }
  19755. } else {
  19756. if (temp[key] === undefined || typeof temp[key] === 'string') {
  19757. nextKey = keys[j + 1];
  19758. temp[key] = (Ext.isNumeric(nextKey) || nextKey === '') ? [] : {};
  19759. }
  19760. temp = temp[key];
  19761. }
  19762. }
  19763. }
  19764. }
  19765. }
  19766. return object;
  19767. },
  19768. /**
  19769. * Iterates through an object and invokes the given callback function for each iteration.
  19770. * The iteration can be stopped by returning `false` in the callback function. For example:
  19771. *
  19772. * var person = {
  19773. * name: 'Jacky'
  19774. * hairColor: 'black'
  19775. * loves: ['food', 'sleeping', 'wife']
  19776. * };
  19777. *
  19778. * Ext.Object.each(person, function(key, value, myself) {
  19779. * console.log(key + ":" + value);
  19780. *
  19781. * if (key === 'hairColor') {
  19782. * return false; // stop the iteration
  19783. * }
  19784. * });
  19785. *
  19786. * @param {Object} object The object to iterate
  19787. * @param {Function} fn The callback function.
  19788. * @param {String} fn.key
  19789. * @param {Object} fn.value
  19790. * @param {Object} fn.object The object itself
  19791. * @param {Object} [scope] The execution scope (`this`) of the callback function
  19792. */
  19793. each: function(object, fn, scope) {
  19794. var enumerables = Ext.enumerables,
  19795. i, property;
  19796. if (object) {
  19797. scope = scope || object;
  19798. for (property in object) {
  19799. if (object.hasOwnProperty(property)) {
  19800. if (fn.call(scope, property, object[property], object) === false) {
  19801. return;
  19802. }
  19803. }
  19804. }
  19805. if (enumerables) {
  19806. for (i = enumerables.length; i--; ) {
  19807. if (object.hasOwnProperty(property = enumerables[i])) {
  19808. if (fn.call(scope, property, object[property], object) === false) {
  19809. return;
  19810. }
  19811. }
  19812. }
  19813. }
  19814. }
  19815. },
  19816. /**
  19817. * Iterates through an object and invokes the given callback function for each iteration.
  19818. * The iteration can be stopped by returning `false` in the callback function. For example:
  19819. *
  19820. * var items = {
  19821. * 1: 'Hello',
  19822. * 2: 'World'
  19823. * };
  19824. *
  19825. * Ext.Object.eachValue(items, function (value) {
  19826. * console.log("Value: " + value);
  19827. * });
  19828. *
  19829. * This will log 'Hello' and 'World' in no particular order. This method is useful
  19830. * in cases where the keys are not important to the processing, just the values.
  19831. *
  19832. * @param {Object} object The object to iterate
  19833. * @param {Function} fn The callback function.
  19834. * @param {Object} fn.value The value of
  19835. * @param {Object} [scope] The execution scope (`this`) of the callback function
  19836. */
  19837. eachValue: function(object, fn, scope) {
  19838. var enumerables = Ext.enumerables,
  19839. i, property;
  19840. scope = scope || object;
  19841. for (property in object) {
  19842. if (object.hasOwnProperty(property)) {
  19843. if (fn.call(scope, object[property]) === false) {
  19844. return;
  19845. }
  19846. }
  19847. }
  19848. if (enumerables) {
  19849. for (i = enumerables.length; i--; ) {
  19850. if (object.hasOwnProperty(property = enumerables[i])) {
  19851. if (fn.call(scope, object[property]) === false) {
  19852. return;
  19853. }
  19854. }
  19855. }
  19856. }
  19857. },
  19858. /**
  19859. * Merges any number of objects recursively without referencing them or their children.
  19860. * Note: It will reference arrays if they are only present in one of the objects being merged.
  19861. *
  19862. * var extjs = {
  19863. * companyName: 'Ext JS',
  19864. * products: ['Ext JS', 'Ext GWT', 'Ext Designer'],
  19865. * isSuperCool: true,
  19866. * office: {
  19867. * size: 2000,
  19868. * location: 'Palo Alto',
  19869. * isFun: true
  19870. * }
  19871. * };
  19872. *
  19873. * var newStuff = {
  19874. * companyName: 'Sencha Inc.',
  19875. * products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
  19876. * office: {
  19877. * size: 40000,
  19878. * location: 'Redwood City'
  19879. * }
  19880. * };
  19881. *
  19882. * var sencha = Ext.Object.merge(extjs, newStuff);
  19883. *
  19884. * // extjs and sencha then equals to
  19885. * {
  19886. * companyName: 'Sencha Inc.',
  19887. * products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
  19888. * isSuperCool: true,
  19889. * office: {
  19890. * size: 40000,
  19891. * location: 'Redwood City',
  19892. * isFun: true
  19893. * }
  19894. * }
  19895. *
  19896. * @param {Object} destination The object into which all subsequent objects are merged.
  19897. * @param {Object...} object Any number of objects to merge into the destination.
  19898. * @return {Object} merged The destination object with all passed objects merged in.
  19899. */
  19900. merge: function(destination) {
  19901. var i = 1,
  19902. args = arguments,
  19903. ln = args.length,
  19904. mergeFn = ExtObject.merge,
  19905. cloneFn = Ext.clone,
  19906. object, key, value, sourceKey;
  19907. for (; i < ln; i++) {
  19908. object = args[i];
  19909. for (key in object) {
  19910. value = object[key];
  19911. if (value && value.constructor === Object) {
  19912. sourceKey = destination[key];
  19913. if (sourceKey && sourceKey.constructor === Object) {
  19914. mergeFn(sourceKey, value);
  19915. } else {
  19916. destination[key] = cloneFn(value);
  19917. }
  19918. } else {
  19919. destination[key] = value;
  19920. }
  19921. }
  19922. }
  19923. return destination;
  19924. },
  19925. /**
  19926. * @private
  19927. * @param destination
  19928. */
  19929. mergeIf: function(destination) {
  19930. var i = 1,
  19931. ln = arguments.length,
  19932. cloneFn = Ext.clone,
  19933. object, key, value;
  19934. for (; i < ln; i++) {
  19935. object = arguments[i];
  19936. for (key in object) {
  19937. if (!(key in destination)) {
  19938. value = object[key];
  19939. if (value && value.constructor === Object) {
  19940. destination[key] = cloneFn(value);
  19941. } else {
  19942. destination[key] = value;
  19943. }
  19944. }
  19945. }
  19946. }
  19947. return destination;
  19948. },
  19949. /**
  19950. * Returns all keys of the given object as an array.
  19951. *
  19952. * @param {Object} object
  19953. * @return {String[]} An array of keys from the object or any of its prototypes.
  19954. * @method
  19955. */
  19956. getAllKeys: function(object) {
  19957. var keys = [],
  19958. property;
  19959. for (property in object) {
  19960. keys.push(property);
  19961. }
  19962. return keys;
  19963. },
  19964. /**
  19965. * Returns the first matching key corresponding to the given value.
  19966. * If no matching value is found, null is returned.
  19967. *
  19968. * var person = {
  19969. * name: 'Jacky',
  19970. * loves: 'food'
  19971. * };
  19972. *
  19973. * alert(Ext.Object.getKey(person, 'food')); // alerts 'loves'
  19974. *
  19975. * @param {Object} object
  19976. * @param {Object} value The value to find
  19977. */
  19978. getKey: function(object, value) {
  19979. for (var property in object) {
  19980. if (object.hasOwnProperty(property) && object[property] === value) {
  19981. return property;
  19982. }
  19983. }
  19984. return null;
  19985. },
  19986. /**
  19987. * Gets all values of the given object as an array.
  19988. *
  19989. * var values = Ext.Object.getValues({
  19990. * name: 'Jacky',
  19991. * loves: 'food'
  19992. * }); // ['Jacky', 'food']
  19993. *
  19994. * @param {Object} object
  19995. * @return {Array} An array of values from the object
  19996. */
  19997. getValues: function(object) {
  19998. var values = [],
  19999. property;
  20000. for (property in object) {
  20001. if (object.hasOwnProperty(property)) {
  20002. values.push(object[property]);
  20003. }
  20004. }
  20005. return values;
  20006. },
  20007. /**
  20008. * Returns the `hasOwnProperty` keys of the given object as an array.
  20009. *
  20010. * var values = Ext.Object.getKeys({
  20011. * name: 'Jacky',
  20012. * loves: 'food'
  20013. * }); // ['name', 'loves']
  20014. *
  20015. * @param {Object} object
  20016. * @return {String[]} An array of keys from the object
  20017. * @method
  20018. */
  20019. getKeys: (typeof Object.keys == 'function') ? function(object) {
  20020. if (!object) {
  20021. return [];
  20022. }
  20023. return Object.keys(object);
  20024. } : function(object) {
  20025. var keys = [],
  20026. property;
  20027. for (property in object) {
  20028. if (object.hasOwnProperty(property)) {
  20029. keys.push(property);
  20030. }
  20031. }
  20032. return keys;
  20033. },
  20034. /**
  20035. * Gets the total number of this object's own properties
  20036. *
  20037. * var size = Ext.Object.getSize({
  20038. * name: 'Jacky',
  20039. * loves: 'food'
  20040. * }); // size equals 2
  20041. *
  20042. * @param {Object} object
  20043. * @return {Number} size
  20044. */
  20045. getSize: function(object) {
  20046. var size = 0,
  20047. property;
  20048. for (property in object) {
  20049. if (object.hasOwnProperty(property)) {
  20050. size++;
  20051. }
  20052. }
  20053. return size;
  20054. },
  20055. /**
  20056. * Checks if there are any properties on this object.
  20057. * @param {Object} object
  20058. * @return {Boolean} `true` if there no properties on the object.
  20059. */
  20060. isEmpty: function(object) {
  20061. for (var key in object) {
  20062. if (object.hasOwnProperty(key)) {
  20063. return false;
  20064. }
  20065. }
  20066. return true;
  20067. },
  20068. /**
  20069. * @method
  20070. * Shallow compares the contents of 2 objects using strict equality. Objects are
  20071. * considered equal if they both have the same set of properties and the
  20072. * value for those properties equals the other in the corresponding object.
  20073. *
  20074. * // Returns true
  20075. * Ext.Object.equals({
  20076. * foo: 1,
  20077. * bar: 2
  20078. * }, {
  20079. * foo: 1,
  20080. * bar: 2
  20081. * });
  20082. *
  20083. * @param {Object} object1
  20084. * @param {Object} object2
  20085. * @return {Boolean} `true` if the objects are equal.
  20086. */
  20087. equals: (function() {
  20088. var check = function(o1, o2) {
  20089. var key;
  20090. for (key in o1) {
  20091. if (o1.hasOwnProperty(key)) {
  20092. if (o1[key] !== o2[key]) {
  20093. return false;
  20094. }
  20095. }
  20096. }
  20097. return true;
  20098. };
  20099. return function(object1, object2) {
  20100. // Short circuit if the same object is passed twice
  20101. if (object1 === object2) {
  20102. return true;
  20103. }
  20104. if (object1 && object2) {
  20105. // Do the second check because we could have extra keys in
  20106. // object2 that don't exist in object1.
  20107. return check(object1, object2) && check(object2, object1);
  20108. } else if (!object1 && !object2) {
  20109. return object1 === object2;
  20110. } else {
  20111. return false;
  20112. }
  20113. };
  20114. })(),
  20115. /**
  20116. * @private
  20117. */
  20118. fork: function(obj) {
  20119. var ret, key, value;
  20120. if (obj && obj.constructor === Object) {
  20121. ret = ExtObject.chain(obj);
  20122. for (key in obj) {
  20123. value = obj[key];
  20124. if (value) {
  20125. if (value.constructor === Object) {
  20126. ret[key] = ExtObject.fork(value);
  20127. } else if (value instanceof Array) {
  20128. ret[key] = Ext.Array.clone(value);
  20129. }
  20130. }
  20131. }
  20132. } else {
  20133. ret = obj;
  20134. }
  20135. return ret;
  20136. },
  20137. defineProperty: ('defineProperty' in Object) ? Object.defineProperty : function(object, name, descriptor) {
  20138. if (!Object.prototype.__defineGetter__) {
  20139. return;
  20140. }
  20141. if (descriptor.get) {
  20142. object.__defineGetter__(name, descriptor.get);
  20143. }
  20144. if (descriptor.set) {
  20145. object.__defineSetter__(name, descriptor.set);
  20146. }
  20147. },
  20148. /**
  20149. * @private
  20150. */
  20151. classify: function(object) {
  20152. var prototype = object,
  20153. objectProperties = [],
  20154. propertyClassesMap = {},
  20155. objectClass = function() {
  20156. var i = 0,
  20157. ln = objectProperties.length,
  20158. property;
  20159. for (; i < ln; i++) {
  20160. property = objectProperties[i];
  20161. this[property] = new propertyClassesMap[property]();
  20162. }
  20163. },
  20164. key, value;
  20165. for (key in object) {
  20166. if (object.hasOwnProperty(key)) {
  20167. value = object[key];
  20168. if (value && value.constructor === Object) {
  20169. objectProperties.push(key);
  20170. propertyClassesMap[key] = ExtObject.classify(value);
  20171. }
  20172. }
  20173. }
  20174. objectClass.prototype = prototype;
  20175. return objectClass;
  20176. }
  20177. };
  20178. /**
  20179. * A convenient alias method for {@link Ext.Object#merge}.
  20180. *
  20181. * @member Ext
  20182. * @method merge
  20183. * @inheritdoc Ext.Object#merge
  20184. */
  20185. Ext.merge = Ext.Object.merge;
  20186. /**
  20187. * @private
  20188. * @member Ext
  20189. */
  20190. Ext.mergeIf = Ext.Object.mergeIf;
  20191. }());
  20192. /*
  20193. * This file contains miscellaneous utility methods that depends on various helper classes
  20194. * like `Ext.Array` and `Ext.Date`. Historically these methods were defined in Ext.js or
  20195. * Ext-more.js but that creates circular dependencies so they were consolidated here.
  20196. */
  20197. Ext.apply(Ext, {
  20198. // @define Ext.Util
  20199. // @require Ext
  20200. // @require Ext.lang.*
  20201. // shortcut for the special named scopes for listener scope resolution
  20202. _namedScopes: {
  20203. 'this': {
  20204. isThis: 1
  20205. },
  20206. controller: {
  20207. isController: 1
  20208. },
  20209. owner: {
  20210. isOwner: 1
  20211. },
  20212. // these two are private, used to indicate that listeners were declared on the
  20213. // class body with either an unspecified scope, or scope:'controller'
  20214. self: {
  20215. isSelf: 1
  20216. },
  20217. 'self.controller': {
  20218. isSelf: 1,
  20219. isController: 1
  20220. }
  20221. },
  20222. escapeId: (function() {
  20223. var validIdRe = /^[a-zA-Z_][a-zA-Z0-9_\-]*$/i,
  20224. escapeRx = /([\W]{1})/g,
  20225. leadingNumRx = /^(\d)/g,
  20226. escapeFn = function(match, capture) {
  20227. return "\\" + capture;
  20228. },
  20229. numEscapeFn = function(match, capture) {
  20230. return '\\00' + capture.charCodeAt(0).toString(16) + ' ';
  20231. };
  20232. return function(id) {
  20233. return validIdRe.test(id) ? id : // replace the number portion last to keep the trailing ' '
  20234. // from being escaped
  20235. id.replace(escapeRx, escapeFn).replace(leadingNumRx, numEscapeFn);
  20236. };
  20237. }()),
  20238. /**
  20239. * @method callback
  20240. * @member Ext
  20241. * Execute a callback function in a particular scope. If `callback` argument is a
  20242. * function reference, that is called. If it is a string, the string is assumed to
  20243. * be the name of a method on the given `scope`. If no function is passed the call
  20244. * is ignored.
  20245. *
  20246. * For example, these calls are equivalent:
  20247. *
  20248. * var myFunc = this.myFunc;
  20249. *
  20250. * Ext.callback('myFunc', this, [arg1, arg2]);
  20251. * Ext.callback(myFunc, this, [arg1, arg2]);
  20252. *
  20253. * Ext.isFunction(myFunc) && this.myFunc(arg1, arg2);
  20254. *
  20255. * @param {Function/String} callback The callback function to execute or the name of
  20256. * the callback method on the provided `scope`.
  20257. * @param {Object} [scope] The scope in which `callback` should be invoked. If `callback`
  20258. * is a string this object provides the method by that name. If this is `null` then
  20259. * the `caller` is used to resolve the scope to a `ViewController` or the proper
  20260. * `defaultListenerScope`.
  20261. * @param {Array} [args] The arguments to pass to the function.
  20262. * @param {Number} [delay] Pass a number to delay the call by a number of milliseconds.
  20263. * @param {Object} [caller] The object calling the callback. This is used to resolve
  20264. * named methods when no explicit `scope` is provided.
  20265. * @param {Object} [defaultScope=caller] The default scope to return if none is found.
  20266. * @return The value returned by the callback or `undefined` (if there is a `delay`
  20267. * or if the `callback` is not a function).
  20268. */
  20269. callback: function(callback, scope, args, delay, caller, defaultScope) {
  20270. if (!callback) {
  20271. return;
  20272. }
  20273. var namedScope = (scope in Ext._namedScopes);
  20274. if (callback.charAt) {
  20275. // if (isString(fn))
  20276. // Custom components cannot often use declarative method resolution when
  20277. // they need to allow the user to supply declarative method names that can
  20278. // reach the user's controller. The "up" callback syntax can help with that:
  20279. //
  20280. // xtype: 'button',
  20281. // handler: 'up.onFoo',
  20282. //
  20283. // When Ext.callback('up.onFoo',..., button) is called, we can perform a
  20284. // "button.up('[onFoo]')" search for the handler. Thus we have a declarative
  20285. // way to dispatch such handlers that will work even if the user can supply
  20286. // such handlers.
  20287. //
  20288. if (callback[2] === '.') {
  20289. // callback = 'up.foo'
  20290. if (callback.substr(0, 2) !== 'up') {
  20291. Ext.raise('Invalid callback method name "' + callback + '"');
  20292. }
  20293. if (scope) {
  20294. Ext.raise('Callback "up" syntax is incompatible with scopes');
  20295. }
  20296. if (!caller || !Ext.isFunction(caller.up)) {
  20297. Ext.raise('Callback "up" syntax requires a caller with "up" method');
  20298. }
  20299. callback = callback.substr(3);
  20300. // A good bit cheaper then caller.up('[' + callback + ']')
  20301. for (scope = caller.up(); scope && !scope[callback]; scope = scope.up()) {}
  20302. // empty
  20303. if (!scope || !Ext.isFunction(scope[callback])) {
  20304. Ext.raise('No such method "' + callback + '" found up() from ' + scope.getId ? scope.getId() : scope.id);
  20305. }
  20306. } else if ((!scope || namedScope) && caller) {
  20307. scope = caller.resolveListenerScope(namedScope ? scope : defaultScope);
  20308. }
  20309. if (!scope || !Ext.isObject(scope)) {
  20310. Ext.raise('Named method "' + callback + '" requires a scope object');
  20311. }
  20312. if (!Ext.isFunction(scope[callback])) {
  20313. Ext.raise('No method named "' + callback + '" on ' + (scope.$className || 'scope object'));
  20314. }
  20315. callback = scope[callback];
  20316. } else if (namedScope) {
  20317. scope = defaultScope || caller;
  20318. } else if (!scope) {
  20319. scope = caller;
  20320. }
  20321. var ret;
  20322. if (callback && Ext.isFunction(callback)) {
  20323. scope = scope || Ext.global;
  20324. if (delay) {
  20325. Ext.defer(callback, delay, scope, args);
  20326. } else {
  20327. ret = args ? callback.apply(scope, args) : callback.call(scope);
  20328. }
  20329. }
  20330. return ret;
  20331. },
  20332. /**
  20333. * @method coerce
  20334. * @member Ext
  20335. * Coerces the first value if possible so that it is comparable to the second value.
  20336. *
  20337. * Coercion only works between the basic atomic data types String, Boolean, Number, Date, null and undefined.
  20338. *
  20339. * Numbers and numeric strings are coerced to Dates using the value as the millisecond era value.
  20340. *
  20341. * Strings are coerced to Dates by parsing using the {@link Ext.Date#defaultFormat defaultFormat}.
  20342. *
  20343. * For example
  20344. *
  20345. * Ext.coerce('false', true);
  20346. *
  20347. * returns the boolean value `false` because the second parameter is of type `Boolean`.
  20348. *
  20349. * @param {Mixed} from The value to coerce
  20350. * @param {Mixed} to The value it must be compared against
  20351. * @return The coerced value.
  20352. */
  20353. coerce: function(from, to) {
  20354. var fromType = Ext.typeOf(from),
  20355. toType = Ext.typeOf(to),
  20356. isString = typeof from === 'string';
  20357. if (fromType !== toType) {
  20358. switch (toType) {
  20359. case 'string':
  20360. return String(from);
  20361. case 'number':
  20362. return Number(from);
  20363. case 'boolean':
  20364. // See http://ecma262-5.com/ELS5_HTML.htm#Section_11.9.3 as to why '0'.
  20365. // TL;DR => ('0' == 0), so if given string '0', we must return boolean false.
  20366. return isString && (!from || from === 'false' || from === '0') ? false : Boolean(from);
  20367. case 'null':
  20368. return isString && (!from || from === 'null') ? null : false;
  20369. case 'undefined':
  20370. return isString && (!from || from === 'undefined') ? undefined : false;
  20371. case 'date':
  20372. return isString && isNaN(from) ? Ext.Date.parse(from, Ext.Date.defaultFormat) : Date(Number(from));
  20373. }
  20374. }
  20375. return from;
  20376. },
  20377. /**
  20378. * @method copyTo
  20379. * @member Ext
  20380. * Copies a set of named properties fom the source object to the destination object.
  20381. *
  20382. * Example:
  20383. *
  20384. * var foo = { a: 1, b: 2, c: 3 };
  20385. *
  20386. * var bar = Ext.copyTo({}, foo, 'a,c');
  20387. * // bar = { a: 1, c: 3 };
  20388. *
  20389. * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
  20390. *
  20391. * @param {Object} dest The destination object.
  20392. * @param {Object} source The source object.
  20393. * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
  20394. * of property names to copy.
  20395. * @param {Boolean} [usePrototypeKeys=false] Pass `true` to copy keys off of the
  20396. * prototype as well as the instance.
  20397. * @return {Object} The `dest` object.
  20398. * @deprecated 6.0.1 Use {@link Ext#copy Ext.copy} instead. This old method
  20399. * would copy the named preoperties even if they did not exist in the source which
  20400. * could produce `undefined` values in the destination.
  20401. */
  20402. copyTo: function(dest, source, names, usePrototypeKeys) {
  20403. if (typeof names === 'string') {
  20404. names = names.split(Ext.propertyNameSplitRe);
  20405. }
  20406. for (var name,
  20407. i = 0,
  20408. n = names ? names.length : 0; i < n; i++) {
  20409. name = names[i];
  20410. if (usePrototypeKeys || source.hasOwnProperty(name)) {
  20411. dest[name] = source[name];
  20412. }
  20413. }
  20414. return dest;
  20415. },
  20416. /**
  20417. * @method copy
  20418. * @member Ext
  20419. * Copies a set of named properties fom the source object to the destination object.
  20420. *
  20421. * Example:
  20422. *
  20423. * var foo = { a: 1, b: 2, c: 3 };
  20424. *
  20425. * var bar = Ext.copy({}, foo, 'a,c');
  20426. * // bar = { a: 1, c: 3 };
  20427. *
  20428. * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
  20429. *
  20430. * @param {Object} dest The destination object.
  20431. * @param {Object} source The source object.
  20432. * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
  20433. * of property names to copy.
  20434. * @param {Boolean} [usePrototypeKeys=false] Pass `true` to copy keys off of the
  20435. * prototype as well as the instance.
  20436. * @return {Object} The `dest` object.
  20437. */
  20438. copy: function(dest, source, names, usePrototypeKeys) {
  20439. if (typeof names === 'string') {
  20440. names = names.split(Ext.propertyNameSplitRe);
  20441. }
  20442. for (var name,
  20443. i = 0,
  20444. n = names ? names.length : 0; i < n; i++) {
  20445. name = names[i];
  20446. // Only copy a property if the source actually *has* that property.
  20447. // If we are including prototype properties, then ensure that a property of
  20448. // that name can be found *somewhere* in the prototype chain (otherwise we'd be copying undefined in which may break things)
  20449. if (source.hasOwnProperty(name) || (usePrototypeKeys && name in source)) {
  20450. dest[name] = source[name];
  20451. }
  20452. }
  20453. return dest;
  20454. },
  20455. propertyNameSplitRe: /[,;\s]+/,
  20456. /**
  20457. * @method copyToIf
  20458. * @member Ext
  20459. * Copies a set of named properties fom the source object to the destination object
  20460. * if the destination object does not already have them.
  20461. *
  20462. * Example:
  20463. *
  20464. * var foo = { a: 1, b: 2, c: 3 };
  20465. *
  20466. * var bar = Ext.copyToIf({ a:42 }, foo, 'a,c');
  20467. * // bar = { a: 42, c: 3 };
  20468. *
  20469. * @param {Object} destination The destination object.
  20470. * @param {Object} source The source object.
  20471. * @param {String/String[]} names Either an Array of property names, or a single string
  20472. * with a list of property names separated by ",", ";" or spaces.
  20473. * @return {Object} The `dest` object.
  20474. * @deprecated 6.0.1 Use {@link Ext#copyIf Ext.copyIf} instead. This old method
  20475. * would copy the named preoperties even if they did not exist in the source which
  20476. * could produce `undefined` values in the destination.
  20477. */
  20478. copyToIf: function(destination, source, names) {
  20479. if (typeof names === 'string') {
  20480. names = names.split(Ext.propertyNameSplitRe);
  20481. }
  20482. for (var name,
  20483. i = 0,
  20484. n = names ? names.length : 0; i < n; i++) {
  20485. name = names[i];
  20486. if (destination[name] === undefined) {
  20487. destination[name] = source[name];
  20488. }
  20489. }
  20490. return destination;
  20491. },
  20492. /**
  20493. * @method copyIf
  20494. * @member Ext
  20495. * Copies a set of named properties fom the source object to the destination object
  20496. * if the destination object does not already have them.
  20497. *
  20498. * Example:
  20499. *
  20500. * var foo = { a: 1, b: 2, c: 3 };
  20501. *
  20502. * var bar = Ext.copyIf({ a:42 }, foo, 'a,c');
  20503. * // bar = { a: 42, c: 3 };
  20504. *
  20505. * @param {Object} destination The destination object.
  20506. * @param {Object} source The source object.
  20507. * @param {String/String[]} names Either an Array of property names, or a single string
  20508. * with a list of property names separated by ",", ";" or spaces.
  20509. * @return {Object} The `dest` object.
  20510. */
  20511. copyIf: function(destination, source, names) {
  20512. if (typeof names === 'string') {
  20513. names = names.split(Ext.propertyNameSplitRe);
  20514. }
  20515. for (var name,
  20516. i = 0,
  20517. n = names ? names.length : 0; i < n; i++) {
  20518. name = names[i];
  20519. // Only copy a property if the destination has no property by that name
  20520. if (!(name in destination) && (name in source)) {
  20521. destination[name] = source[name];
  20522. }
  20523. }
  20524. return destination;
  20525. },
  20526. /**
  20527. * @method extend
  20528. * @member Ext
  20529. * This method deprecated. Use {@link Ext#define Ext.define} instead.
  20530. * @param {Function} superclass
  20531. * @param {Object} overrides
  20532. * @return {Function} The subclass constructor from the <tt>overrides</tt> parameter, or a generated one if not provided.
  20533. * @deprecated 4.0.0 Use {@link Ext#define Ext.define} instead
  20534. */
  20535. extend: (function() {
  20536. // inline overrides
  20537. var objectConstructor = Object.prototype.constructor,
  20538. inlineOverrides = function(o) {
  20539. var m;
  20540. for (m in o) {
  20541. if (!o.hasOwnProperty(m)) {
  20542. continue;
  20543. }
  20544. this[m] = o[m];
  20545. }
  20546. };
  20547. return function(subclass, superclass, overrides) {
  20548. // First we check if the user passed in just the superClass with overrides
  20549. if (Ext.isObject(superclass)) {
  20550. overrides = superclass;
  20551. superclass = subclass;
  20552. subclass = overrides.constructor !== objectConstructor ? overrides.constructor : function() {
  20553. superclass.apply(this, arguments);
  20554. };
  20555. }
  20556. if (!superclass) {
  20557. Ext.raise({
  20558. sourceClass: 'Ext',
  20559. sourceMethod: 'extend',
  20560. msg: 'Attempting to extend from a class which has not been loaded on the page.'
  20561. });
  20562. }
  20563. // We create a new temporary class
  20564. var F = function() {},
  20565. subclassProto,
  20566. superclassProto = superclass.prototype;
  20567. F.prototype = superclassProto;
  20568. subclassProto = subclass.prototype = new F();
  20569. subclassProto.constructor = subclass;
  20570. subclass.superclass = superclassProto;
  20571. if (superclassProto.constructor === objectConstructor) {
  20572. superclassProto.constructor = superclass;
  20573. }
  20574. subclass.override = function(overrides) {
  20575. Ext.override(subclass, overrides);
  20576. };
  20577. subclassProto.override = inlineOverrides;
  20578. subclassProto.proto = subclassProto;
  20579. subclass.override(overrides);
  20580. subclass.extend = function(o) {
  20581. return Ext.extend(subclass, o);
  20582. };
  20583. return subclass;
  20584. };
  20585. }()),
  20586. /**
  20587. * Indicates if the page is currently running in online or offline mode, according
  20588. * to the `navigator.onLine` property.
  20589. * @return {Boolean} `true` if the page is currently running in an online mode.
  20590. *
  20591. * @since 6.2.1
  20592. */
  20593. isOnline: function() {
  20594. return Ext.global.navigator.onLine;
  20595. },
  20596. /**
  20597. * @method iterate
  20598. * @member Ext
  20599. * Iterates either an array or an object. This method delegates to
  20600. * {@link Ext.Array#each Ext.Array.each} if the given value is iterable, and {@link Ext.Object#each Ext.Object.each} otherwise.
  20601. *
  20602. * @param {Object/Array} object The object or array to be iterated.
  20603. * @param {Function} fn The function to be called for each iteration. See and {@link Ext.Array#each Ext.Array.each} and
  20604. * {@link Ext.Object#each Ext.Object.each} for detailed lists of arguments passed to this function depending on the given object
  20605. * type that is being iterated.
  20606. * @param {Object} [scope] The scope (`this` reference) in which the specified function is executed.
  20607. * Defaults to the object being iterated itself.
  20608. */
  20609. iterate: function(object, fn, scope) {
  20610. if (Ext.isEmpty(object)) {
  20611. return;
  20612. }
  20613. if (scope === undefined) {
  20614. scope = object;
  20615. }
  20616. if (Ext.isIterable(object)) {
  20617. Ext.Array.each.call(Ext.Array, object, fn, scope);
  20618. } else {
  20619. Ext.Object.each.call(Ext.Object, object, fn, scope);
  20620. }
  20621. },
  20622. _resourcePoolRe: /^[<]([^<>@:]*)(?:[@]([^<>@:]+))?[>](.+)$/,
  20623. /**
  20624. * Resolves a resource URL that may contain a resource pool identifier token at the
  20625. * front. The tokens are formatted as HTML tags "&lt;poolName@packageName&gt;" followed
  20626. * by a normal relative path. This token is only processed if present at the first
  20627. * character of the given string.
  20628. *
  20629. * These tokens are parsed and the pieces are then passed to the
  20630. * {@link Ext#getResourcePath} method.
  20631. *
  20632. * For example:
  20633. *
  20634. * [{
  20635. * xtype: 'image',
  20636. * src: '<shared>images/foo.png'
  20637. * },{
  20638. * xtype: 'image',
  20639. * src: '<@package>images/foo.png'
  20640. * },{
  20641. * xtype: 'image',
  20642. * src: '<shared@package>images/foo.png'
  20643. * }]
  20644. *
  20645. * In the above example, "shared" is the name of a Sencha Cmd resource pool and
  20646. * "package" is the name of a Sencha Cmd package.
  20647. * @member Ext
  20648. * @param {String} url The URL that may contain a resource pool token at the front.
  20649. * @return {String}
  20650. * @since 6.0.1
  20651. */
  20652. resolveResource: function(url) {
  20653. var ret = url,
  20654. m;
  20655. if (url && url.charAt(0) === '<') {
  20656. m = Ext._resourcePoolRe.exec(url);
  20657. if (m) {
  20658. ret = Ext.getResourcePath(m[3], m[1], m[2]);
  20659. }
  20660. }
  20661. return ret;
  20662. },
  20663. /**
  20664. *
  20665. * @member Ext
  20666. * @method urlEncode
  20667. * @inheritdoc Ext.Object#toQueryString
  20668. * @deprecated 4.0.0 Use {@link Ext.Object#toQueryString} instead
  20669. */
  20670. urlEncode: function() {
  20671. var args = Ext.Array.from(arguments),
  20672. prefix = '';
  20673. // Support for the old `pre` argument
  20674. if (Ext.isString(args[1])) {
  20675. prefix = args[1] + '&';
  20676. args[1] = false;
  20677. }
  20678. return prefix + Ext.Object.toQueryString.apply(Ext.Object, args);
  20679. },
  20680. /**
  20681. * Alias for {@link Ext.Object#fromQueryString}.
  20682. *
  20683. * @member Ext
  20684. * @method urlDecode
  20685. * @inheritdoc Ext.Object#fromQueryString
  20686. * @deprecated 4.0.0 Use {@link Ext.Object#fromQueryString} instead
  20687. */
  20688. urlDecode: function() {
  20689. return Ext.Object.fromQueryString.apply(Ext.Object, arguments);
  20690. },
  20691. /**
  20692. * @method getScrollbarSize
  20693. * @member Ext
  20694. * Returns the size of the browser scrollbars. This can differ depending on
  20695. * operating system settings, such as the theme or font size.
  20696. * @param {Boolean} [force] true to force a recalculation of the value.
  20697. * @return {Object} An object containing scrollbar sizes.
  20698. * @return {Number} return.width The width of the vertical scrollbar.
  20699. * @return {Number} return.height The height of the horizontal scrollbar.
  20700. */
  20701. getScrollbarSize: function(force) {
  20702. if (!Ext.isDomReady) {
  20703. Ext.raise("getScrollbarSize called before DomReady");
  20704. }
  20705. var scrollbarSize = Ext._scrollbarSize;
  20706. if (force || !scrollbarSize) {
  20707. var db = document.body,
  20708. div = document.createElement('div'),
  20709. h, w;
  20710. div.style.width = div.style.height = '100px';
  20711. div.style.overflow = 'scroll';
  20712. div.style.position = 'absolute';
  20713. db.appendChild(div);
  20714. // now we can measure the div...
  20715. // at least in iE9 the div is not 100px - the scrollbar size is removed!
  20716. Ext._scrollbarSize = scrollbarSize = {
  20717. width: w = div.offsetWidth - div.clientWidth,
  20718. height: h = div.offsetHeight - div.clientHeight
  20719. };
  20720. scrollbarSize.reservedWidth = w ? 'calc(100% - ' + w + 'px)' : '';
  20721. scrollbarSize.reservedHeight = h ? 'calc(100% - ' + h + 'px)' : '';
  20722. db.removeChild(div);
  20723. }
  20724. return scrollbarSize;
  20725. },
  20726. /**
  20727. * @method typeOf
  20728. * @member Ext
  20729. * Returns the type of the given variable in string format. List of possible values are:
  20730. *
  20731. * - `undefined`: If the given value is `undefined`
  20732. * - `null`: If the given value is `null`
  20733. * - `string`: If the given value is a string
  20734. * - `number`: If the given value is a number
  20735. * - `boolean`: If the given value is a boolean value
  20736. * - `date`: If the given value is a `Date` object
  20737. * - `function`: If the given value is a function reference
  20738. * - `object`: If the given value is an object
  20739. * - `array`: If the given value is an array
  20740. * - `regexp`: If the given value is a regular expression
  20741. * - `element`: If the given value is a DOM Element
  20742. * - `textnode`: If the given value is a DOM text node and contains something other than whitespace
  20743. * - `whitespace`: If the given value is a DOM text node and contains only whitespace
  20744. *
  20745. * @param {Object} value
  20746. * @return {String}
  20747. */
  20748. typeOf: (function() {
  20749. var nonWhitespaceRe = /\S/,
  20750. toString = Object.prototype.toString,
  20751. typeofTypes = {
  20752. number: 1,
  20753. string: 1,
  20754. 'boolean': 1,
  20755. 'undefined': 1
  20756. },
  20757. toStringTypes = {
  20758. '[object Array]': 'array',
  20759. '[object Date]': 'date',
  20760. '[object Boolean]': 'boolean',
  20761. '[object Number]': 'number',
  20762. '[object RegExp]': 'regexp'
  20763. };
  20764. return function(value) {
  20765. if (value === null) {
  20766. return 'null';
  20767. }
  20768. var type = typeof value,
  20769. ret, typeToString;
  20770. if (typeofTypes[type]) {
  20771. return type;
  20772. }
  20773. ret = toStringTypes[typeToString = toString.call(value)];
  20774. if (ret) {
  20775. return ret;
  20776. }
  20777. if (type === 'function') {
  20778. return 'function';
  20779. }
  20780. if (type === 'object') {
  20781. if (value.nodeType !== undefined) {
  20782. if (value.nodeType === 3) {
  20783. return nonWhitespaceRe.test(value.nodeValue) ? 'textnode' : 'whitespace';
  20784. } else {
  20785. return 'element';
  20786. }
  20787. }
  20788. return 'object';
  20789. }
  20790. Ext.raise({
  20791. sourceClass: 'Ext',
  20792. sourceMethod: 'typeOf',
  20793. msg: 'Failed to determine the type of "' + value + '".'
  20794. });
  20795. return typeToString;
  20796. };
  20797. }()),
  20798. /**
  20799. * A global factory method to instantiate a class from a config object. For example,
  20800. * these two calls are equivalent:
  20801. *
  20802. * Ext.factory({ text: 'My Button' }, 'Ext.Button');
  20803. * Ext.create('Ext.Button', { text: 'My Button' });
  20804. *
  20805. * If an existing instance is also specified, it will be updated with the supplied config object. This is useful
  20806. * if you need to either create or update an object, depending on if an instance already exists. For example:
  20807. *
  20808. * var button;
  20809. * button = Ext.factory({ text: 'New Button' }, 'Ext.Button', button); // Button created
  20810. * button = Ext.factory({ text: 'Updated Button' }, 'Ext.Button', button); // Button updated
  20811. *
  20812. * @param {Object} config The config object to instantiate or update an instance with.
  20813. * @param {String} [classReference] The class to instantiate from (if there is a default).
  20814. * @param {Object} [instance] The instance to update.
  20815. * @param [aliasNamespace]
  20816. * @member Ext
  20817. * @deprecated 6.5.0 Use the {@link Ext.Factory#method!update update} method of the
  20818. * associated factory instead.
  20819. */
  20820. factory: function(config, classReference, instance, aliasNamespace) {
  20821. var manager = Ext.ClassManager,
  20822. newInstance;
  20823. // If config is falsy or a valid instance, destroy the current instance
  20824. // (if it exists) and replace with the new one
  20825. if (!config || config.isInstance) {
  20826. if (instance && instance !== config) {
  20827. instance.destroy();
  20828. }
  20829. return config;
  20830. }
  20831. if (aliasNamespace) {
  20832. // If config is a string value, treat it as an alias
  20833. if (typeof config === 'string') {
  20834. return manager.instantiateByAlias(aliasNamespace + '.' + config);
  20835. }
  20836. // Same if 'type' is given in config
  20837. else if (Ext.isObject(config) && 'type' in config) {
  20838. return manager.instantiateByAlias(aliasNamespace + '.' + config.type, config);
  20839. }
  20840. }
  20841. if (config === true) {
  20842. if (!instance && !classReference) {
  20843. Ext.raise('[Ext.factory] Cannot determine type of class to create');
  20844. }
  20845. return instance || Ext.create(classReference);
  20846. }
  20847. if (!Ext.isObject(config)) {
  20848. Ext.raise("Invalid config, must be a valid config object");
  20849. }
  20850. if ('xtype' in config) {
  20851. newInstance = manager.instantiateByAlias('widget.' + config.xtype, config);
  20852. } else if ('xclass' in config) {
  20853. newInstance = Ext.create(config.xclass, config);
  20854. }
  20855. if (newInstance) {
  20856. if (instance) {
  20857. instance.destroy();
  20858. }
  20859. return newInstance;
  20860. }
  20861. if (instance) {
  20862. return instance.setConfig(config);
  20863. }
  20864. return Ext.create(classReference, config);
  20865. },
  20866. /**
  20867. * This method converts an object containing config objects keyed by `itemId` into
  20868. * an array of config objects.
  20869. *
  20870. * @param {Object} items An object containing config objects keyed by `itemId`.
  20871. * @param {String} [defaultProperty="xtype"] The property to set for string items.
  20872. * @param functionProperty
  20873. * @return {Object[]}
  20874. * @member Ext
  20875. * @since 6.5.0
  20876. * @private
  20877. */
  20878. convertKeyedItems: function(items, defaultProperty, functionProperty) {
  20879. if (items && !items.isInstance && Ext.isObject(items)) {
  20880. var obj = items,
  20881. item, itemId, value;
  20882. items = [];
  20883. // See if obj looks like a single thing
  20884. if (obj.xtype || obj.xclass || obj.itemId || obj.id) {
  20885. items.push(obj);
  20886. } else {
  20887. for (itemId in obj) {
  20888. item = obj[itemId];
  20889. if (item) {
  20890. if (item === true) {
  20891. item = {};
  20892. } else if (typeof item === 'function') {
  20893. if (!functionProperty) {
  20894. Ext.raise('Function not expected here');
  20895. }
  20896. value = item;
  20897. item = {};
  20898. item[functionProperty] = value;
  20899. } else if (typeof item === 'string') {
  20900. value = item;
  20901. item = {};
  20902. item[defaultProperty || 'xtype'] = value;
  20903. } else {
  20904. item = Ext.apply({}, item);
  20905. }
  20906. item.itemId = itemId;
  20907. items.push(item);
  20908. }
  20909. }
  20910. }
  20911. }
  20912. return items;
  20913. },
  20914. /**
  20915. * Comparison function for sorting an array of objects in ascending order of `weight`.
  20916. * @param {Object} lhs
  20917. * @param {Object} rhs
  20918. * @return {Number}
  20919. * @member Ext
  20920. * @private
  20921. * @since 6.5.0
  20922. */
  20923. weightSortFn: function(lhs, rhs) {
  20924. return (lhs.weight || 0) - (rhs.weight || 0);
  20925. },
  20926. /**
  20927. * Concatenate 2 arrays. If either argument is `null` or `undefined` then it's not
  20928. * concatenated.
  20929. *
  20930. * @param {Object/Object[]} a
  20931. * @param {Object/Object[]} b
  20932. * @return {Object[]}
  20933. * @member Ext
  20934. * @private
  20935. * @since 6.5.1
  20936. */
  20937. concat: function(a, b) {
  20938. var noB = b == null,
  20939. E = Ext.emptyArray;
  20940. return (a == null) ? (noB ? a : E.concat(b)) : (noB ? E.concat(a) : E.concat(a, b));
  20941. },
  20942. /**
  20943. * @method log
  20944. * @member Ext
  20945. * Logs a message. If a console is present it will be used. On Opera, the method
  20946. * "opera.postError" is called. In other cases, the message is logged to an array
  20947. * "Ext.log.out". An attached debugger can watch this array and view the log. The
  20948. * log buffer is limited to a maximum of "Ext.log.max" entries (defaults to 250).
  20949. *
  20950. * If additional parameters are passed, they are joined and appended to the message.
  20951. * A technique for tracing entry and exit of a function is this:
  20952. *
  20953. * function foo () {
  20954. * Ext.log({ indent: 1 }, '>> foo');
  20955. *
  20956. * // log statements in here or methods called from here will be indented
  20957. * // by one step
  20958. *
  20959. * Ext.log({ outdent: 1 }, '<< foo');
  20960. * }
  20961. *
  20962. * This method does nothing in a release build.
  20963. *
  20964. * @param {String/Object} [options] The message to log or an options object with any
  20965. * of the following properties:
  20966. *
  20967. * - `msg`: The message to log (required).
  20968. * - `level`: One of: "error", "warn", "info" or "log" (the default is "log").
  20969. * - `dump`: An object to dump to the log as part of the message.
  20970. * - `stack`: True to include a stack trace in the log.
  20971. * - `indent`: Cause subsequent log statements to be indented one step.
  20972. * - `outdent`: Cause this and following statements to be one step less indented.
  20973. *
  20974. * @param {String...} [message] The message to log (required unless specified in
  20975. * options object).
  20976. */
  20977. log: (function() {
  20978. /*
  20979. * Iterate through an object to dump its content into a string.
  20980. * For example:
  20981. * {
  20982. * style: {
  20983. * lineWidth: 1
  20984. * },
  20985. * label: {},
  20986. * marker: {
  20987. * strokeStyle: "#555",
  20988. * radius: 3,
  20989. * size: 3
  20990. * },
  20991. * subStyle: {
  20992. * fillStyle: [
  20993. * 0: "#133987",
  20994. * 1: "#1c55ca",
  20995. * 2: "#4d7fe6"
  20996. * ]
  20997. * },
  20998. * markerSubStyle: {}
  20999. * }
  21000. *
  21001. * @param {Object} object The object to iterate
  21002. * @param {Number} [level] Current level of identation (and recursion). Default is 0.
  21003. * @param {Number} [maxLevel] Maximum level of recursion. Default is 3.
  21004. * @param {Boolean} [withFunctions] Include functions in the output.
  21005. * @return {String} The string with the contents of the object
  21006. */
  21007. var primitiveRe = /string|number|boolean/;
  21008. function dumpObject(object, level, maxLevel, withFunctions) {
  21009. var member, type, value, name, prefix, suffix,
  21010. members = [];
  21011. if (Ext.isArray(object)) {
  21012. prefix = '[';
  21013. suffix = ']';
  21014. } else if (Ext.isObject(object)) {
  21015. prefix = '{';
  21016. suffix = '}';
  21017. }
  21018. if (!maxLevel) {
  21019. maxLevel = 3;
  21020. }
  21021. if (level > maxLevel) {
  21022. return prefix + '...' + suffix;
  21023. }
  21024. level = level || 1;
  21025. var spacer = (new Array(level)).join(' ');
  21026. // Cannot use Ext.encode since it can recurse endlessly
  21027. for (name in object) {
  21028. if (object.hasOwnProperty(name)) {
  21029. value = object[name];
  21030. type = typeof value;
  21031. if (type === 'function') {
  21032. if (!withFunctions) {
  21033. continue;
  21034. }
  21035. member = type;
  21036. } else if (type === 'undefined') {
  21037. member = type;
  21038. } else if (value === null || primitiveRe.test(type) || Ext.isDate(value)) {
  21039. member = Ext.encode(value);
  21040. } else if (Ext.isArray(value)) {
  21041. member = dumpObject(value, level + 1, maxLevel, withFunctions);
  21042. } else if (Ext.isObject(value)) {
  21043. member = dumpObject(value, level + 1, maxLevel, withFunctions);
  21044. } else {
  21045. member = type;
  21046. }
  21047. members.push(spacer + name + ': ' + member);
  21048. }
  21049. }
  21050. // or Ext.encode(name)
  21051. if (members.length) {
  21052. return prefix + '\n ' + members.join(',\n ') + '\n' + spacer + suffix;
  21053. }
  21054. return prefix + suffix;
  21055. }
  21056. function log(message) {
  21057. var options, dump,
  21058. con = Ext.global.console,
  21059. level = 'log',
  21060. indent = log.indent || 0,
  21061. prefix, stack, fn, out, max;
  21062. log.indent = indent;
  21063. if (typeof message !== 'string') {
  21064. options = message;
  21065. message = options.msg || '';
  21066. level = options.level || level;
  21067. dump = options.dump;
  21068. stack = options.stack;
  21069. prefix = options.prefix;
  21070. fn = options.fn;
  21071. if (options.indent) {
  21072. ++log.indent;
  21073. } else if (options.outdent) {
  21074. log.indent = indent = Math.max(indent - 1, 0);
  21075. }
  21076. if (dump && !(con && con.dir)) {
  21077. message += dumpObject(dump);
  21078. dump = null;
  21079. }
  21080. }
  21081. if (arguments.length > 1) {
  21082. message += Array.prototype.slice.call(arguments, 1).join('');
  21083. }
  21084. if (prefix) {
  21085. message = prefix + ' - ' + message;
  21086. }
  21087. message = indent ? Ext.String.repeat(' ', log.indentSize * indent) + message : message;
  21088. // w/o console, all messages are equal, so munge the level into the message:
  21089. if (level !== 'log') {
  21090. message = '[' + level.charAt(0).toUpperCase() + '] ' + message;
  21091. }
  21092. if (fn) {
  21093. message += '\nCaller: ' + fn.toString();
  21094. }
  21095. // Not obvious, but 'console' comes and goes when Firebug is turned on/off, so
  21096. // an early test may fail either direction if Firebug is toggled.
  21097. //
  21098. if (con) {
  21099. // if (Firebug-like console)
  21100. if (con[level]) {
  21101. con[level](message);
  21102. } else {
  21103. con.log(message);
  21104. }
  21105. if (dump) {
  21106. con.dir(dump);
  21107. }
  21108. if (stack && con.trace) {
  21109. // Firebug's console.error() includes a trace already...
  21110. if (!con.firebug || level !== 'error') {
  21111. con.trace();
  21112. }
  21113. }
  21114. } else if (Ext.isOpera) {
  21115. opera.postError(message);
  21116. } else // jshint ignore:line
  21117. {
  21118. out = log.out;
  21119. max = log.max;
  21120. if (out.length >= max) {
  21121. // this formula allows out.max to change (via debugger), where the
  21122. // more obvious "max/4" would not quite be the same
  21123. Ext.Array.erase(out, 0, out.length - 3 * Math.floor(max / 4));
  21124. }
  21125. // keep newest 75%
  21126. out.push(message);
  21127. }
  21128. // Mostly informational, but the Ext.Error notifier uses them:
  21129. ++log.count;
  21130. ++log.counters[level];
  21131. }
  21132. function logx(level, args) {
  21133. if (typeof args[0] === 'string') {
  21134. args.unshift({});
  21135. }
  21136. args[0].level = level;
  21137. log.apply(this, args);
  21138. }
  21139. log.error = function() {
  21140. logx('error', Array.prototype.slice.call(arguments));
  21141. };
  21142. log.info = function() {
  21143. logx('info', Array.prototype.slice.call(arguments));
  21144. };
  21145. log.warn = function() {
  21146. logx('warn', Array.prototype.slice.call(arguments));
  21147. };
  21148. log.count = 0;
  21149. log.counters = {
  21150. error: 0,
  21151. warn: 0,
  21152. info: 0,
  21153. log: 0
  21154. };
  21155. log.indentSize = 2;
  21156. log.out = [];
  21157. log.max = 750;
  21158. return log;
  21159. }()) || (function() {
  21160. var nullLog = function() {};
  21161. nullLog.info = nullLog.warn = nullLog.error = Ext.emptyFn;
  21162. return nullLog;
  21163. }())
  21164. });
  21165. /**
  21166. * @class Ext.Version
  21167. *
  21168. * A utility class that wraps around a version number string and provides convenient methods
  21169. * to perform comparisons. A version number is expressed in the following general format:
  21170. *
  21171. * major[.minor[.patch[.build[release]]]]
  21172. *
  21173. * The `Version` instance holds various readonly properties that contain the digested form
  21174. * of the version string. The numeric componnets of `major`, `minor`, `patch` and `build`
  21175. * as well as the textual suffix called `release`.
  21176. *
  21177. * Not depicted in the above syntax are three possible prefixes used to control partial
  21178. * matching. These are '^' (the default), '>' and '~'. These are discussed below.
  21179. *
  21180. * Examples:
  21181. *
  21182. * var version = new Ext.Version('1.0.2beta'); // or maybe "1.0" or "1.2.3.4RC"
  21183. * console.log("Version is " + version); // Version is 1.0.2beta
  21184. *
  21185. * console.log(version.getMajor()); // 1
  21186. * console.log(version.getMinor()); // 0
  21187. * console.log(version.getPatch()); // 2
  21188. * console.log(version.getBuild()); // 0
  21189. * console.log(version.getRelease()); // beta
  21190. *
  21191. * The understood values of `release` are assigned numberic equivalents for the sake of
  21192. * comparsion. The order of these from smallest to largest is as follows:
  21193. *
  21194. * * `"dev"`
  21195. * * `"alpha"` or `"a"`
  21196. * * `"beta"` or `"b"`
  21197. * * `"RC"` or `"rc"`
  21198. * * `"#"`
  21199. * * `"pl"` or `"p"`
  21200. *
  21201. * Any other (unrecognized) suffix is consider greater than any of these.
  21202. *
  21203. * ## Comparisons
  21204. * There are two forms of comparison that are commonly needed: full and partial. Full
  21205. * comparison is simpler and is also the default.
  21206. *
  21207. * Example:
  21208. *
  21209. * var version = new Ext.Version('1.0.2beta');
  21210. *
  21211. * console.log(version.isGreaterThan('1.0.1')); // True
  21212. * console.log(version.isGreaterThan('1.0.2alpha')); // True
  21213. * console.log(version.isGreaterThan('1.0.2RC')); // False
  21214. * console.log(version.isGreaterThan('1.0.2')); // False
  21215. * console.log(version.isLessThan('1.0.2')); // True
  21216. *
  21217. * console.log(version.match(1.0)); // True (using a Number)
  21218. * console.log(version.match('1.0.2')); // True (using a String)
  21219. *
  21220. * These comparisons are ultimately implemented by {@link Ext.Version#compareTo compareTo}
  21221. * which returns -1, 0 or 1 depending on whether the `Version' instance is less than, equal
  21222. * to, or greater than the given "other" version.
  21223. *
  21224. * For example:
  21225. *
  21226. * var n = version.compareTo('1.0.1'); // == 1 (because 1.0.2beta > 1.0.1)
  21227. *
  21228. * n = version.compareTo('1.1'); // == -1
  21229. * n = version.compareTo(version); // == 0
  21230. *
  21231. * ### Partial Comparisons
  21232. * By default, unspecified version number fields are filled with 0. In other words, the
  21233. * version number fields are 0-padded on the right or a "lower bound". This produces the
  21234. * most commonly used forms of comparsion:
  21235. *
  21236. * var ver = new Version('4.2');
  21237. *
  21238. * n = ver.compareTo('4.2.1'); // == -1 (4.2 promotes to 4.2.0 and is less than 4.2.1)
  21239. *
  21240. * There are two other ways to interpret comparisons of versions of different length. The
  21241. * first of these is to change the padding on the right to be a large number (scuh as
  21242. * Infinity) instead of 0. This has the effect of making the version an upper bound. For
  21243. * example:
  21244. *
  21245. * var ver = new Version('^4.2'); // NOTE: the '^' prefix used
  21246. *
  21247. * n = ver.compareTo('4.3'); // == -1 (less than 4.3)
  21248. *
  21249. * n = ver.compareTo('4.2'); // == 1 (greater than all 4.2's)
  21250. * n = ver.compareTo('4.2.1'); // == 1
  21251. * n = ver.compareTo('4.2.9'); // == 1
  21252. *
  21253. * The second way to interpret this comparison is to ignore the extra digits, making the
  21254. * match a prefix match. For example:
  21255. *
  21256. * var ver = new Version('~4.2'); // NOTE: the '~' prefix used
  21257. *
  21258. * n = ver.compareTo('4.3'); // == -1
  21259. *
  21260. * n = ver.compareTo('4.2'); // == 0
  21261. * n = ver.compareTo('4.2.1'); // == 0
  21262. *
  21263. * This final form can be useful when version numbers contain more components than are
  21264. * important for certain comparisons. For example, the full version of Ext JS 4.2.1 is
  21265. * "4.2.1.883" where 883 is the `build` number.
  21266. *
  21267. * This is how to create a "partial" `Version` and compare versions to it:
  21268. *
  21269. * var version421ish = new Version('~4.2.1');
  21270. *
  21271. * n = version421ish.compareTo('4.2.1.883'); // == 0
  21272. * n = version421ish.compareTo('4.2.1.2'); // == 0
  21273. * n = version421ish.compareTo('4.2.1'); // == 0
  21274. *
  21275. * n = version421ish.compareTo('4.2'); // == 1
  21276. *
  21277. * In the above example, '4.2.1.2' compares as equal to '4.2.1' because digits beyond the
  21278. * given "4.2.1" are ignored. However, '4.2' is less than the '4.2.1' prefix; its missing
  21279. * digit is filled with 0.
  21280. */
  21281. (function() {
  21282. // @define Ext.Version
  21283. // @require Ext.String
  21284. var // used by checkVersion to avoid temp arrays:
  21285. checkVerTemp = [
  21286. ''
  21287. ],
  21288. endOfVersionRe = /([^\d\.])/,
  21289. notDigitsRe = /[^\d]/g,
  21290. plusMinusRe = /[\-+]/g,
  21291. stripRe = /\s/g,
  21292. underscoreRe = /_/g,
  21293. toolkitNames = {
  21294. classic: 1,
  21295. modern: 1
  21296. },
  21297. Version;
  21298. Ext.Version = Version = function(version, defaultMode) {
  21299. var me = this,
  21300. padModes = me.padModes,
  21301. ch, i, pad, parts, release, releaseStartIndex, ver;
  21302. if (version.isVersion) {
  21303. version = version.version;
  21304. }
  21305. me.version = ver = String(version).toLowerCase().replace(underscoreRe, '.').replace(plusMinusRe, '');
  21306. ch = ver.charAt(0);
  21307. if (ch in padModes) {
  21308. ver = ver.substring(1);
  21309. pad = padModes[ch];
  21310. } else {
  21311. pad = defaultMode ? padModes[defaultMode] : 0;
  21312. }
  21313. // careful - NaN is falsey!
  21314. me.pad = pad;
  21315. releaseStartIndex = ver.search(endOfVersionRe);
  21316. me.shortVersion = ver;
  21317. if (releaseStartIndex !== -1) {
  21318. me.release = release = ver.substr(releaseStartIndex, version.length);
  21319. me.shortVersion = ver.substr(0, releaseStartIndex);
  21320. release = Version.releaseValueMap[release] || release;
  21321. }
  21322. me.releaseValue = release || pad;
  21323. me.shortVersion = me.shortVersion.replace(notDigitsRe, '');
  21324. /**
  21325. * @property {Number[]} parts
  21326. * The split array of version number components found in the version string.
  21327. * For example, for "1.2.3", this would be `[1, 2, 3]`.
  21328. * @readonly
  21329. * @private
  21330. */
  21331. me.parts = parts = ver.split('.');
  21332. for (i = parts.length; i--; ) {
  21333. parts[i] = parseInt(parts[i], 10);
  21334. }
  21335. if (pad === Infinity) {
  21336. // have to add this to the end to create an upper bound:
  21337. parts.push(pad);
  21338. }
  21339. /**
  21340. * @property {Number} major
  21341. * The first numeric part of the version number string.
  21342. * @readonly
  21343. */
  21344. me.major = parts[0] || pad;
  21345. /**
  21346. * @property {Number} [minor]
  21347. * The second numeric part of the version number string.
  21348. * @readonly
  21349. */
  21350. me.minor = parts[1] || pad;
  21351. /**
  21352. * @property {Number} [patch]
  21353. * The third numeric part of the version number string.
  21354. * @readonly
  21355. */
  21356. me.patch = parts[2] || pad;
  21357. /**
  21358. * @property {Number} [build]
  21359. * The fourth numeric part of the version number string.
  21360. * @readonly
  21361. */
  21362. me.build = parts[3] || pad;
  21363. return me;
  21364. };
  21365. Version.prototype = {
  21366. isVersion: true,
  21367. padModes: {
  21368. '~': NaN,
  21369. '^': Infinity
  21370. },
  21371. /**
  21372. * @property {String} [release=""]
  21373. * The release level. The following values are understood:
  21374. *
  21375. * * `"dev"`
  21376. * * `"alpha"` or `"a"`
  21377. * * `"beta"` or `"b"`
  21378. * * `"RC"` or `"rc"`
  21379. * * `"#"`
  21380. * * `"pl"` or `"p"`
  21381. * @readonly
  21382. */
  21383. release: '',
  21384. /**
  21385. * Compares this version instance to the specified `other` version.
  21386. *
  21387. * @param {String/Number/Ext.Version} other The other version to which to compare.
  21388. * @return {Number} -1 if this version is less than the target version, 1 if this
  21389. * version is greater, and 0 if they are equal.
  21390. */
  21391. compareTo: function(other) {
  21392. // "lhs" == "left-hand-side"
  21393. // "rhs" == "right-hand-side"
  21394. var me = this,
  21395. lhsPad = me.pad,
  21396. lhsParts = me.parts,
  21397. lhsLength = lhsParts.length,
  21398. rhsVersion = other.isVersion ? other : new Version(other),
  21399. rhsPad = rhsVersion.pad,
  21400. rhsParts = rhsVersion.parts,
  21401. rhsLength = rhsParts.length,
  21402. length = Math.max(lhsLength, rhsLength),
  21403. i, lhs, rhs;
  21404. for (i = 0; i < length; i++) {
  21405. lhs = (i < lhsLength) ? lhsParts[i] : lhsPad;
  21406. rhs = (i < rhsLength) ? rhsParts[i] : rhsPad;
  21407. // When one or both of the values are NaN these tests produce false
  21408. // and we end up treating NaN as equal to anything.
  21409. if (lhs < rhs) {
  21410. return -1;
  21411. }
  21412. if (lhs > rhs) {
  21413. return 1;
  21414. }
  21415. }
  21416. // same comments about NaN apply here...
  21417. lhs = me.releaseValue;
  21418. rhs = rhsVersion.releaseValue;
  21419. if (lhs < rhs) {
  21420. return -1;
  21421. }
  21422. if (lhs > rhs) {
  21423. return 1;
  21424. }
  21425. return 0;
  21426. },
  21427. /**
  21428. * Override the native `toString` method
  21429. * @private
  21430. * @return {String} version
  21431. */
  21432. toString: function() {
  21433. return this.version;
  21434. },
  21435. /**
  21436. * Override the native `valueOf` method
  21437. * @private
  21438. * @return {String} version
  21439. */
  21440. valueOf: function() {
  21441. return this.version;
  21442. },
  21443. /**
  21444. * Returns the major component value.
  21445. * @return {Number}
  21446. */
  21447. getMajor: function() {
  21448. return this.major;
  21449. },
  21450. /**
  21451. * Returns the minor component value.
  21452. * @return {Number}
  21453. */
  21454. getMinor: function() {
  21455. return this.minor;
  21456. },
  21457. /**
  21458. * Returns the patch component value.
  21459. * @return {Number}
  21460. */
  21461. getPatch: function() {
  21462. return this.patch;
  21463. },
  21464. /**
  21465. * Returns the build component value.
  21466. * @return {Number}
  21467. */
  21468. getBuild: function() {
  21469. return this.build;
  21470. },
  21471. /**
  21472. * Returns the release component text (e.g., "beta").
  21473. * @return {String}
  21474. */
  21475. getRelease: function() {
  21476. return this.release;
  21477. },
  21478. /**
  21479. * Returns the release component value for comparison purposes.
  21480. * @return {Number/String}
  21481. */
  21482. getReleaseValue: function() {
  21483. return this.releaseValue;
  21484. },
  21485. /**
  21486. * Returns whether this version if greater than the supplied argument
  21487. * @param {String/Number} target The version to compare with
  21488. * @return {Boolean} `true` if this version if greater than the target, `false` otherwise
  21489. */
  21490. isGreaterThan: function(target) {
  21491. return this.compareTo(target) > 0;
  21492. },
  21493. /**
  21494. * Returns whether this version if greater than or equal to the supplied argument
  21495. * @param {String/Number} target The version to compare with
  21496. * @return {Boolean} `true` if this version if greater than or equal to the target, `false` otherwise
  21497. */
  21498. isGreaterThanOrEqual: function(target) {
  21499. return this.compareTo(target) >= 0;
  21500. },
  21501. /**
  21502. * Returns whether this version if smaller than the supplied argument
  21503. * @param {String/Number} target The version to compare with
  21504. * @return {Boolean} `true` if this version if smaller than the target, `false` otherwise
  21505. */
  21506. isLessThan: function(target) {
  21507. return this.compareTo(target) < 0;
  21508. },
  21509. /**
  21510. * Returns whether this version if less than or equal to the supplied argument
  21511. * @param {String/Number} target The version to compare with
  21512. * @return {Boolean} `true` if this version if less than or equal to the target, `false` otherwise
  21513. */
  21514. isLessThanOrEqual: function(target) {
  21515. return this.compareTo(target) <= 0;
  21516. },
  21517. /**
  21518. * Returns whether this version equals to the supplied argument
  21519. * @param {String/Number} target The version to compare with
  21520. * @return {Boolean} `true` if this version equals to the target, `false` otherwise
  21521. */
  21522. equals: function(target) {
  21523. return this.compareTo(target) === 0;
  21524. },
  21525. /**
  21526. * Returns whether this version matches the supplied argument. Example:
  21527. *
  21528. * var version = new Ext.Version('1.0.2beta');
  21529. * console.log(version.match(1)); // true
  21530. * console.log(version.match(1.0)); // true
  21531. * console.log(version.match('1.0.2')); // true
  21532. * console.log(version.match('1.0.2RC')); // false
  21533. *
  21534. * @param {String/Number} target The version to compare with
  21535. * @return {Boolean} `true` if this version matches the target, `false` otherwise
  21536. */
  21537. match: function(target) {
  21538. target = String(target);
  21539. return this.version.substr(0, target.length) === target;
  21540. },
  21541. /**
  21542. * Returns this format: [major, minor, patch, build, release]. Useful for comparison.
  21543. * @return {Number[]}
  21544. */
  21545. toArray: function() {
  21546. var me = this;
  21547. return [
  21548. me.getMajor(),
  21549. me.getMinor(),
  21550. me.getPatch(),
  21551. me.getBuild(),
  21552. me.getRelease()
  21553. ];
  21554. },
  21555. /**
  21556. * Returns shortVersion version without dots and release
  21557. * @return {String}
  21558. */
  21559. getShortVersion: function() {
  21560. return this.shortVersion;
  21561. },
  21562. /**
  21563. * Convenient alias to {@link Ext.Version#isGreaterThan isGreaterThan}
  21564. * @param {String/Number/Ext.Version} target
  21565. * @return {Boolean}
  21566. */
  21567. gt: function(target) {
  21568. return this.compareTo(target) > 0;
  21569. },
  21570. /**
  21571. * Convenient alias to {@link Ext.Version#isLessThan isLessThan}
  21572. * @param {String/Number/Ext.Version} target
  21573. * @return {Boolean}
  21574. */
  21575. lt: function(target) {
  21576. return this.compareTo(target) < 0;
  21577. },
  21578. /**
  21579. * Convenient alias to {@link Ext.Version#isGreaterThanOrEqual isGreaterThanOrEqual}
  21580. * @param {String/Number/Ext.Version} target
  21581. * @return {Boolean}
  21582. */
  21583. gtEq: function(target) {
  21584. return this.compareTo(target) >= 0;
  21585. },
  21586. /**
  21587. * Convenient alias to {@link Ext.Version#isLessThanOrEqual isLessThanOrEqual}
  21588. * @param {String/Number/Ext.Version} target
  21589. * @return {Boolean}
  21590. */
  21591. ltEq: function(target) {
  21592. return this.compareTo(target) <= 0;
  21593. }
  21594. };
  21595. Ext.apply(Version, {
  21596. aliases: {
  21597. from: {
  21598. extjs: 'ext',
  21599. core: 'core',
  21600. touch: 'modern'
  21601. },
  21602. to: {
  21603. ext: [
  21604. 'extjs'
  21605. ],
  21606. 'core': [
  21607. 'core'
  21608. ],
  21609. modern: [
  21610. 'touch'
  21611. ]
  21612. }
  21613. },
  21614. /**
  21615. * @private
  21616. */
  21617. releaseValueMap: {
  21618. dev: -6,
  21619. alpha: -5,
  21620. a: -5,
  21621. beta: -4,
  21622. b: -4,
  21623. rc: -3,
  21624. '#': -2,
  21625. p: -1,
  21626. pl: -1
  21627. },
  21628. /**
  21629. * Converts a version component to a comparable value
  21630. *
  21631. * @static
  21632. * @param {Object} value The value to convert
  21633. * @return {Object}
  21634. */
  21635. getComponentValue: function(value) {
  21636. return !value ? 0 : (isNaN(value) ? this.releaseValueMap[value] || value : parseInt(value, 10));
  21637. },
  21638. /**
  21639. * Compare 2 specified versions by ensuring the first parameter is a `Version`
  21640. * instance and then calling the `compareTo` method.
  21641. *
  21642. * @static
  21643. * @param {String} current The current version to compare to
  21644. * @param {String} target The target version to compare to
  21645. * @return {Number} Returns -1 if the current version is smaller than the target version, 1 if greater, and 0 if they're equivalent
  21646. */
  21647. compare: function(current, target) {
  21648. var ver = current.isVersion ? current : new Version(current);
  21649. return ver.compareTo(target);
  21650. },
  21651. set: function(collection, packageName, version) {
  21652. var aliases = Version.aliases.to[packageName],
  21653. ver = version.isVersion ? version : new Version(version),
  21654. i;
  21655. collection[packageName] = ver;
  21656. if (aliases) {
  21657. for (i = aliases.length; i-- > 0; ) {
  21658. collection[aliases[i]] = ver;
  21659. }
  21660. }
  21661. return ver;
  21662. }
  21663. });
  21664. /**
  21665. * @class Ext
  21666. */
  21667. Ext.apply(Ext, {
  21668. /**
  21669. * @private
  21670. */
  21671. compatVersions: {},
  21672. /**
  21673. * @private
  21674. *
  21675. * Object containing version information for all packages utilized by your
  21676. * application.
  21677. *
  21678. * For a public getter, please see `Ext.getVersion()`.
  21679. */
  21680. versions: {},
  21681. /**
  21682. * @private
  21683. */
  21684. lastRegisteredVersion: null,
  21685. /**
  21686. * Get the compatibility level (a version number) for the given package name. If
  21687. * none has been registered with `Ext.setCompatVersion` then `Ext.getVersion` is
  21688. * used to get the current version.
  21689. *
  21690. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  21691. * @since 5.0.0
  21692. * @private
  21693. */
  21694. getCompatVersion: function(packageName) {
  21695. var versions = Ext.compatVersions,
  21696. compat;
  21697. if (!packageName) {
  21698. compat = versions.ext || versions.touch || versions.core;
  21699. } else {
  21700. compat = versions[Version.aliases.from[packageName] || packageName];
  21701. }
  21702. return compat || Ext.getVersion(packageName);
  21703. },
  21704. /**
  21705. * Set the compatibility level (a version number) for the given package name.
  21706. *
  21707. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  21708. * @param {String/Ext.Version} version The version, e.g. '4.2'.
  21709. * @since 5.0.0
  21710. * @private
  21711. */
  21712. setCompatVersion: function(packageName, version) {
  21713. Version.set(Ext.compatVersions, packageName, version);
  21714. },
  21715. /**
  21716. * Set version number for the given package name.
  21717. *
  21718. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  21719. * @param {String/Ext.Version} version The version, e.g. '1.2.3alpha', '2.4.0-dev'.
  21720. * @return {Ext}
  21721. */
  21722. setVersion: function(packageName, version) {
  21723. if (packageName in toolkitNames) {
  21724. Ext.toolkit = packageName;
  21725. }
  21726. Ext.lastRegisteredVersion = Version.set(Ext.versions, packageName, version);
  21727. return this;
  21728. },
  21729. /**
  21730. * Get the version number of the supplied package name; will return the version of
  21731. * the framework.
  21732. *
  21733. * @param {String} [packageName] The package name, e.g., 'core', 'touch', 'ext'.
  21734. * @return {Ext.Version} The version.
  21735. */
  21736. getVersion: function(packageName) {
  21737. var versions = Ext.versions;
  21738. if (!packageName) {
  21739. return versions.ext || versions.touch || versions.core;
  21740. }
  21741. return versions[Version.aliases.from[packageName] || packageName];
  21742. },
  21743. /**
  21744. * This method checks the registered package versions against the provided version
  21745. * `specs`. A `spec` is either a string or an object indicating a boolean operator.
  21746. * This method accepts either form or an array of these as the first argument. The
  21747. * second argument applies only when the first is an array and indicates whether
  21748. * all `specs` must match or just one.
  21749. *
  21750. * ## Package Version Specifications
  21751. * The string form of a `spec` is used to indicate a version or range of versions
  21752. * for a particular package. This form of `spec` consists of three (3) parts:
  21753. *
  21754. * * Package name followed by "@". If not provided, the framework is assumed.
  21755. * * Minimum version.
  21756. * * Maximum version.
  21757. *
  21758. * At least one version number must be provided. If both minimum and maximum are
  21759. * provided, these must be separated by a "-".
  21760. *
  21761. * Some examples of package version specifications:
  21762. *
  21763. * 4.2.2 (exactly version 4.2.2 of the framework)
  21764. * 4.2.2+ (version 4.2.2 or higher of the framework)
  21765. * 4.2.2- (version 4.2.2 or higher of the framework)
  21766. * 4.2.1 - 4.2.3 (versions from 4.2.1 up to 4.2.3 of the framework)
  21767. * - 4.2.2 (any version up to version 4.2.1 of the framework)
  21768. *
  21769. * foo@1.0 (exactly version 1.0 of package "foo")
  21770. * foo@1.0-1.3 (versions 1.0 up to 1.3 of package "foo")
  21771. *
  21772. * **NOTE:** This syntax is the same as that used in Sencha Cmd's package
  21773. * requirements declarations.
  21774. *
  21775. * ## Boolean Operator Specifications
  21776. * Instead of a string, an object can be used to describe a boolean operation to
  21777. * perform on one or more `specs`. The operator is either **`and`** or **`or`**
  21778. * and can contain an optional **`not`**.
  21779. *
  21780. * For example:
  21781. *
  21782. * {
  21783. * not: true, // negates boolean result
  21784. * and: [
  21785. * '4.2.2',
  21786. * 'foo@1.0.1 - 2.0.1'
  21787. * ]
  21788. * }
  21789. *
  21790. * Each element of the array can in turn be a string or object spec. In other
  21791. * words, the value is passed to this method (recursively) as the first argument
  21792. * so these two calls are equivalent:
  21793. *
  21794. * Ext.checkVersion({
  21795. * not: true, // negates boolean result
  21796. * and: [
  21797. * '4.2.2',
  21798. * 'foo@1.0.1 - 2.0.1'
  21799. * ]
  21800. * });
  21801. *
  21802. * !Ext.checkVersion([
  21803. * '4.2.2',
  21804. * 'foo@1.0.1 - 2.0.1'
  21805. * ], true);
  21806. *
  21807. * ## Examples
  21808. *
  21809. * // A specific framework version
  21810. * Ext.checkVersion('4.2.2');
  21811. *
  21812. * // A range of framework versions:
  21813. * Ext.checkVersion('4.2.1-4.2.3');
  21814. *
  21815. * // A specific version of a package:
  21816. * Ext.checkVersion('foo@1.0.1');
  21817. *
  21818. * // A single spec that requires both a framework version and package
  21819. * // version range to match:
  21820. * Ext.checkVersion({
  21821. * and: [
  21822. * '4.2.2',
  21823. * 'foo@1.0.1-1.0.2'
  21824. * ]
  21825. * });
  21826. *
  21827. * // These checks can be nested:
  21828. * Ext.checkVersion({
  21829. * and: [
  21830. * '4.2.2', // exactly version 4.2.2 of the framework *AND*
  21831. * {
  21832. * // either (or both) of these package specs:
  21833. * or: [
  21834. * 'foo@1.0.1-1.0.2',
  21835. * 'bar@3.0+'
  21836. * ]
  21837. * }
  21838. * ]
  21839. * });
  21840. *
  21841. * ## Version Comparisons
  21842. * Version comparsions are assumed to be "prefix" based. That is to say, `"foo@1.2"`
  21843. * matches any version of "foo" that has a major version 1 and a minor version of 2.
  21844. *
  21845. * This also applies to ranges. For example `"foo@1.2-2.2"` matches all versions
  21846. * of "foo" from 1.2 up to 2.2 regardless of the specific patch and build.
  21847. *
  21848. * ## Use in Overrides
  21849. * This methods primary use is in support of conditional overrides on an
  21850. * `Ext.define` declaration.
  21851. *
  21852. * @param {String/Array/Object} specs A version specification string, an object
  21853. * containing `or` or `and` with a value that is equivalent to `specs` or an array
  21854. * of either of these.
  21855. * @param {Boolean} [matchAll=false] Pass `true` to require all specs to match.
  21856. * @return {Boolean} True if `specs` matches the registered package versions.
  21857. */
  21858. checkVersion: function(specs, matchAll) {
  21859. var isArray = Ext.isArray(specs),
  21860. aliases = Version.aliases.from,
  21861. compat = isArray ? specs : checkVerTemp,
  21862. length = compat.length,
  21863. versions = Ext.versions,
  21864. frameworkVer = versions.ext || versions.touch,
  21865. i, index, matches, minVer, maxVer, packageName, spec, range, ver;
  21866. if (!isArray) {
  21867. checkVerTemp[0] = specs;
  21868. }
  21869. for (i = 0; i < length; ++i) {
  21870. if (!Ext.isString(spec = compat[i])) {
  21871. matches = Ext.checkVersion(spec.and || spec.or, !spec.or);
  21872. if (spec.not) {
  21873. matches = !matches;
  21874. }
  21875. } else {
  21876. if (spec.indexOf(' ') >= 0) {
  21877. spec = spec.replace(stripRe, '');
  21878. }
  21879. // For "name@..." syntax, we need to find the package by the given name
  21880. // as a registered package.
  21881. index = spec.indexOf('@');
  21882. if (index < 0) {
  21883. range = spec;
  21884. ver = frameworkVer;
  21885. } else {
  21886. packageName = spec.substring(0, index);
  21887. if (!(ver = versions[aliases[packageName] || packageName])) {
  21888. // The package is not registered, so if we must matchAll then
  21889. // we are done - FAIL:
  21890. if (matchAll) {
  21891. return false;
  21892. }
  21893. // Otherwise this spec is not a match so we can move on to the
  21894. // next...
  21895. continue;
  21896. }
  21897. range = spec.substring(index + 1);
  21898. }
  21899. // Now look for a version, version range or partial range:
  21900. index = range.indexOf('-');
  21901. if (index < 0) {
  21902. // just a version or "1.0+"
  21903. if (range.charAt(index = range.length - 1) === '+') {
  21904. minVer = range.substring(0, index);
  21905. maxVer = null;
  21906. } else {
  21907. minVer = maxVer = range;
  21908. }
  21909. } else if (index > 0) {
  21910. // a range like "1.0-1.5" or "1.0-"
  21911. minVer = range.substring(0, index);
  21912. maxVer = range.substring(index + 1);
  21913. } else // may be empty
  21914. {
  21915. // an upper limit like "-1.5"
  21916. minVer = null;
  21917. maxVer = range.substring(index + 1);
  21918. }
  21919. matches = true;
  21920. if (minVer) {
  21921. minVer = new Version(minVer, '~');
  21922. // prefix matching
  21923. matches = minVer.ltEq(ver);
  21924. }
  21925. if (matches && maxVer) {
  21926. maxVer = new Version(maxVer, '~');
  21927. // prefix matching
  21928. matches = maxVer.gtEq(ver);
  21929. }
  21930. }
  21931. // string spec
  21932. if (matches) {
  21933. // spec matched and we are looking for any match, so we are GO!
  21934. if (!matchAll) {
  21935. return true;
  21936. }
  21937. } else if (matchAll) {
  21938. // spec does not match the registered package version
  21939. return false;
  21940. }
  21941. }
  21942. // In the loop above, for matchAll we return FALSE on mismatch, so getting
  21943. // here with matchAll means we had no mismatches. On the other hand, if we
  21944. // are !matchAll, we return TRUE on match and so we get here only if we found
  21945. // no matches.
  21946. return !!matchAll;
  21947. },
  21948. /**
  21949. * Create a closure for deprecated code.
  21950. *
  21951. * // This means Ext.oldMethod is only supported in 4.0.0beta and older.
  21952. * // If Ext.getVersion('extjs') returns a version that is later than '4.0.0beta', for example '4.0.0RC',
  21953. * // the closure will not be invoked
  21954. * Ext.deprecate('extjs', '4.0.0beta', function() {
  21955. * Ext.oldMethod = Ext.newMethod;
  21956. *
  21957. * ...
  21958. * });
  21959. *
  21960. * @param {String} packageName The package name
  21961. * @param {String} since The last version before it's deprecated
  21962. * @param {Function} closure The callback function to be executed with the specified version is less than the current version
  21963. * @param {Object} scope The execution scope (`this`) if the closure
  21964. * @private
  21965. */
  21966. deprecate: function(packageName, since, closure, scope) {
  21967. if (Version.compare(Ext.getVersion(packageName), since) < 1) {
  21968. closure.call(scope);
  21969. }
  21970. }
  21971. });
  21972. }());
  21973. // End Versioning
  21974. // load the cmd-5 style app manifest metadata now, if available...
  21975. (function(manifest) {
  21976. var packages = (manifest && manifest.packages) || {},
  21977. compat = manifest && manifest.compatibility,
  21978. name, pkg;
  21979. for (name in packages) {
  21980. pkg = packages[name];
  21981. if (pkg && pkg.version) {
  21982. Ext.setVersion(name, pkg.version);
  21983. }
  21984. }
  21985. if (compat) {
  21986. if (Ext.isString(compat)) {
  21987. Ext.setCompatVersion('core', compat);
  21988. } else {
  21989. for (name in compat) {
  21990. Ext.setCompatVersion(name, compat[name]);
  21991. }
  21992. }
  21993. }
  21994. if (!packages.ext && !packages.touch) {
  21995. Ext.setVersion('ext', '6.6.0.258');
  21996. Ext.setVersion('core', '6.6.0.258');
  21997. }
  21998. })(Ext.manifest);
  21999. /**
  22000. * @class Ext.Config
  22001. * This class manages a config property. Instances of this type are created and cached as
  22002. * classes declare their config properties. One instance of this class is created per
  22003. * config property name.
  22004. *
  22005. * Ext.define('MyClass', {
  22006. * config: {
  22007. * foo: 42
  22008. * }
  22009. * });
  22010. *
  22011. * This uses the cached `Ext.Config` instance for the "foo" property.
  22012. *
  22013. * When config properties apply options to config properties a prototype chained object is
  22014. * created from the cached instance. For example:
  22015. *
  22016. * Ext.define('MyClass', {
  22017. * config: {
  22018. * foo: {
  22019. * $value: 42,
  22020. * lazy: true
  22021. * }
  22022. * }
  22023. * });
  22024. *
  22025. * This creates a prototype chain to the cached "foo" instance of `Ext.Config` and applies
  22026. * the `lazy` option to that new instance. This chained instance is then kept by the
  22027. * `Ext.Configurator` for that class.
  22028. * @private
  22029. */
  22030. Ext.Config = function(name) {
  22031. // @define Ext.class.Config
  22032. // @define Ext.Config
  22033. var me = this,
  22034. capitalizedName = name.charAt(0).toUpperCase() + name.substr(1);
  22035. /**
  22036. * @property {String} name
  22037. * The name of this config property.
  22038. * @readonly
  22039. * @private
  22040. * @since 5.0.0
  22041. */
  22042. me.name = name;
  22043. /**
  22044. * @property {Object} names
  22045. * This object holds the cached names used to lookup properties or methods for this
  22046. * config property. The properties of this object are explained in the context of an
  22047. * example property named "foo".
  22048. *
  22049. * @property {String} names.internal The default backing property ("_foo").
  22050. *
  22051. * @property {String} names.initializing The property that is `true` when the config
  22052. * is being initialized ("isFooInitializing").
  22053. *
  22054. * @property {String} names.apply The name of the applier method ("applyFoo").
  22055. *
  22056. * @property {String} names.update The name of the updater method ("updateFoo").
  22057. *
  22058. * @property {String} names.get The name of the getter method ("getFoo").
  22059. *
  22060. * @property {String} names.set The name of the setter method ("setFoo").
  22061. *
  22062. * @property {String} names.initGet The name of the initializing getter ("initGetFoo").
  22063. *
  22064. * @property {String} names.changeEvent The name of the change event ("foochange").
  22065. *
  22066. * @readonly
  22067. * @private
  22068. * @since 5.0.0
  22069. */
  22070. me.names = {
  22071. internal: '_' + name,
  22072. initializing: 'is' + capitalizedName + 'Initializing',
  22073. apply: 'apply' + capitalizedName,
  22074. update: 'update' + capitalizedName,
  22075. get: 'get' + capitalizedName,
  22076. set: 'set' + capitalizedName,
  22077. initGet: 'initGet' + capitalizedName,
  22078. changeEvent: name.toLowerCase() + 'change'
  22079. };
  22080. // This allows folks to prototype chain on top of these objects and yet still cache
  22081. // generated methods at the bottom of the chain.
  22082. me.root = me;
  22083. };
  22084. Ext.Config.map = {};
  22085. Ext.Config.get = function(name) {
  22086. var map = Ext.Config.map,
  22087. ret = map[name] || (map[name] = new Ext.Config(name));
  22088. return ret;
  22089. };
  22090. Ext.Config.prototype = {
  22091. self: Ext.Config,
  22092. isConfig: true,
  22093. /**
  22094. * @cfg {Boolean} [cached=false]
  22095. * When set as `true` the config property will be stored on the class prototype once
  22096. * the first instance has had a chance to process the default value.
  22097. * @private
  22098. * @since 5.0.0
  22099. */
  22100. /**
  22101. * @cfg {Boolean} [lazy=false]
  22102. * When set as `true` the config property will not be immediately initialized during
  22103. * the `initConfig` call.
  22104. * @private
  22105. * @since 5.0.0
  22106. */
  22107. /**
  22108. * @cfg {Boolean} [evented=false]
  22109. * When set as `true` the config property will be treated as a {@link Ext.Evented Evented Config}.
  22110. * @private
  22111. * @since 6.0.0
  22112. */
  22113. /**
  22114. * @cfg {Function} [merge]
  22115. * This function if supplied will be called as classes or instances provide values
  22116. * that need to be combined with inherited values. The function should return the
  22117. * value that will be the config value. Further calls may receive such returned
  22118. * values as `oldValue`.
  22119. *
  22120. * @cfg {Mixed} merge.newValue The new value to merge with the old.
  22121. *
  22122. * @cfg {Mixed} merge.oldValue The current value prior to `newValue` being merged.
  22123. *
  22124. * @cfg {Mixed} merge.target The class or instance to which the merged config value
  22125. * will be applied.
  22126. *
  22127. * @cfg {Ext.Class} merge.mixinClass The mixin providing the `newValue` or `null` if
  22128. * the `newValue` is not being provided by a mixin.
  22129. */
  22130. getGetter: function() {
  22131. return this.getter || (this.root.getter = this.makeGetter());
  22132. },
  22133. getInitGetter: function() {
  22134. return this.initGetter || (this.root.initGetter = this.makeInitGetter());
  22135. },
  22136. getSetter: function() {
  22137. return this.setter || (this.root.setter = this.makeSetter());
  22138. },
  22139. getEventedSetter: function() {
  22140. return this.eventedSetter || (this.root.eventedSetter = this.makeEventedSetter());
  22141. },
  22142. /**
  22143. * Returns the name of the property that stores this config on the given instance or
  22144. * class prototype.
  22145. * @param {Object} target
  22146. * @return {String}
  22147. */
  22148. getInternalName: function(target) {
  22149. return target.$configPrefixed ? this.names.internal : this.name;
  22150. },
  22151. mergeNew: function(newValue, oldValue, target, mixinClass) {
  22152. var ret, key;
  22153. if (!oldValue) {
  22154. ret = newValue;
  22155. } else if (!newValue) {
  22156. ret = oldValue;
  22157. } else {
  22158. ret = Ext.Object.chain(oldValue);
  22159. for (key in newValue) {
  22160. if (!mixinClass || !(key in ret)) {
  22161. ret[key] = newValue[key];
  22162. }
  22163. }
  22164. }
  22165. return ret;
  22166. },
  22167. /**
  22168. * Merges the `newValue` and the `oldValue` assuming that these are basically objects
  22169. * the represent sets. For example something like:
  22170. *
  22171. * {
  22172. * foo: true,
  22173. * bar: true
  22174. * }
  22175. *
  22176. * The merge process converts arrays like the following into the above:
  22177. *
  22178. * [ 'foo', 'bar' ]
  22179. *
  22180. * @param {String/String[]/Object} newValue
  22181. * @param {Object} oldValue
  22182. * @param {Boolean} [preserveExisting=false]
  22183. * @return {Object}
  22184. * @private
  22185. * @since 5.0.0
  22186. */
  22187. mergeSets: function(newValue, oldValue, preserveExisting) {
  22188. var ret = oldValue ? Ext.Object.chain(oldValue) : {},
  22189. i, val;
  22190. if (newValue instanceof Array) {
  22191. for (i = newValue.length; i--; ) {
  22192. val = newValue[i];
  22193. if (!preserveExisting || !(val in ret)) {
  22194. ret[val] = true;
  22195. }
  22196. }
  22197. } else if (newValue) {
  22198. if (newValue.constructor === Object) {
  22199. for (i in newValue) {
  22200. val = newValue[i];
  22201. if (!preserveExisting || !(i in ret)) {
  22202. ret[i] = val;
  22203. }
  22204. }
  22205. } else if (!preserveExisting || !(newValue in ret)) {
  22206. ret[newValue] = true;
  22207. }
  22208. }
  22209. return ret;
  22210. },
  22211. //--------------------------------------------------
  22212. // Factories
  22213. makeGetter: function() {
  22214. var name = this.name,
  22215. prefixedName = this.names.internal;
  22216. return function() {
  22217. var internalName = this.$configPrefixed ? prefixedName : name;
  22218. return this[internalName];
  22219. };
  22220. },
  22221. makeInitGetter: function() {
  22222. var name = this.name,
  22223. names = this.names,
  22224. setName = names.set,
  22225. getName = names.get,
  22226. initializingName = names.initializing;
  22227. return function() {
  22228. var me = this;
  22229. me[initializingName] = true;
  22230. // Remove the initGetter from the instance now that the value has been set.
  22231. delete me[getName];
  22232. me[setName](me.config[name]);
  22233. delete me[initializingName];
  22234. return me[getName].apply(me, arguments);
  22235. };
  22236. },
  22237. makeSetter: function() {
  22238. var name = this.name,
  22239. names = this.names,
  22240. prefixedName = names.internal,
  22241. getName = names.get,
  22242. applyName = names.apply,
  22243. updateName = names.update,
  22244. setter;
  22245. // http://jsperf.com/method-call-apply-or-direct
  22246. // http://jsperf.com/method-detect-invoke
  22247. setter = function(value) {
  22248. var me = this,
  22249. internalName = me.$configPrefixed ? prefixedName : name,
  22250. oldValue = me[internalName];
  22251. // Remove the initGetter from the instance now that the value has been set.
  22252. delete me[getName];
  22253. if (!me[applyName] || (value = me[applyName](value, oldValue)) !== undefined) {
  22254. // The old value might have been changed at this point
  22255. // (after the apply call chain) so it should be read again
  22256. if (value !== (oldValue = me[internalName])) {
  22257. me[internalName] = value;
  22258. if (me[updateName]) {
  22259. me[updateName](value, oldValue);
  22260. }
  22261. }
  22262. }
  22263. return me;
  22264. };
  22265. setter.$isDefault = true;
  22266. return setter;
  22267. },
  22268. makeEventedSetter: function() {
  22269. var name = this.name,
  22270. names = this.names,
  22271. prefixedName = names.internal,
  22272. getName = names.get,
  22273. applyName = names.apply,
  22274. updateName = names.update,
  22275. changeEventName = names.changeEvent,
  22276. updateFn = function(me, value, oldValue, internalName) {
  22277. me[internalName] = value;
  22278. if (me[updateName]) {
  22279. me[updateName](value, oldValue);
  22280. }
  22281. },
  22282. setter;
  22283. // http://jsperf.com/method-call-apply-or-direct
  22284. // http://jsperf.com/method-detect-invoke
  22285. setter = function(value) {
  22286. var me = this,
  22287. internalName = me.$configPrefixed ? prefixedName : name,
  22288. oldValue = me[internalName];
  22289. // Remove the initGetter from the instance now that the value has been set.
  22290. delete me[getName];
  22291. if (!me[applyName] || (value = me[applyName](value, oldValue)) !== undefined) {
  22292. // The old value might have been changed at this point
  22293. // (after the apply call chain) so it should be read again
  22294. if (value !== (oldValue = me[internalName])) {
  22295. if (me.isConfiguring) {
  22296. me[internalName] = value;
  22297. if (me[updateName]) {
  22298. me[updateName](value, oldValue);
  22299. }
  22300. } else {
  22301. me.fireEventedAction(changeEventName, [
  22302. me,
  22303. value,
  22304. oldValue
  22305. ], updateFn, me, [
  22306. me,
  22307. value,
  22308. oldValue,
  22309. internalName
  22310. ]);
  22311. }
  22312. }
  22313. }
  22314. return me;
  22315. };
  22316. setter.$isDefault = true;
  22317. return setter;
  22318. }
  22319. };
  22320. /**
  22321. * @class Ext.Configurator
  22322. * This class manages the config properties for a class.
  22323. * @private
  22324. */
  22325. (function() {
  22326. // see end of file (and please don't indent the whole file)
  22327. var ExtConfig = Ext.Config,
  22328. configPropMap = ExtConfig.map,
  22329. ExtObject = Ext.Object;
  22330. Ext.Configurator = function(cls) {
  22331. // @define Ext.class.Configurator
  22332. // @define Ext.Configurator
  22333. // @require Ext.Config
  22334. var me = this,
  22335. prototype = cls.prototype,
  22336. superCfg = cls.superclass ? cls.superclass.self.$config : null;
  22337. /**
  22338. * @property {Ext.Class} cls The class to which this instance is associated.
  22339. * @private
  22340. * @readonly
  22341. */
  22342. me.cls = cls;
  22343. /**
  22344. * The super class `Configurator` instance or `null` if there is no super class.
  22345. *
  22346. * @property {Ext.Configurator} superCfg
  22347. * @private
  22348. * @readonly
  22349. */
  22350. me.superCfg = superCfg;
  22351. if (superCfg) {
  22352. /**
  22353. * This object holds an `Ext.Config` value for each config property keyed by name.
  22354. * This object has as its prototype object the `configs` of its super class.
  22355. *
  22356. * This map is maintained as each property is added via the `add` method.
  22357. *
  22358. * @property {Object} configs
  22359. * @private
  22360. * @readonly
  22361. */
  22362. me.configs = ExtObject.chain(superCfg.configs);
  22363. /**
  22364. * This object holds a bool value for each cachedConfig property keyed by name.
  22365. *
  22366. * This map is maintained as each property is added via the `add` method.
  22367. *
  22368. * @property {Object} cachedConfigs
  22369. * @private
  22370. * @readonly
  22371. */
  22372. me.cachedConfigs = ExtObject.chain(superCfg.cachedConfigs);
  22373. /**
  22374. * This object holds a `Number` for each config property keyed by name. This object has
  22375. * as its prototype object the `initMap` of its super class. The value of each property
  22376. * has the following meaning:
  22377. *
  22378. * * `0` - initial value is `null` and requires no processing.
  22379. * * `1` - initial value must be set on each instance.
  22380. * * `2` - initial value can be cached on the prototype by the first instance.
  22381. *
  22382. * Any `null` values will either never be added to this map or (if added by a base
  22383. * class and set to `null` by a derived class) will cause the entry to be 0.
  22384. *
  22385. * This map is maintained as each property is added via the `add` method.
  22386. *
  22387. * @property {Object} initMap
  22388. * @private
  22389. * @readonly
  22390. */
  22391. me.initMap = ExtObject.chain(superCfg.initMap);
  22392. /**
  22393. * This object holds the default value for each config property keyed by name. This
  22394. * object has as its prototype object the `values` of its super class.
  22395. *
  22396. * This map is maintained as each property is added via the `add` method.
  22397. *
  22398. * @property {Object} values
  22399. * @private
  22400. * @readonly
  22401. */
  22402. me.values = ExtObject.chain(superCfg.values);
  22403. me.needsFork = superCfg.needsFork;
  22404. // The reason this feature is debug only is that we would have to create this
  22405. // map for all classes because deprecations could be added to bases after the
  22406. // derived class had created its Configurator.
  22407. me.deprecations = ExtObject.chain(superCfg.deprecations);
  22408. } else {
  22409. me.configs = {};
  22410. me.cachedConfigs = {};
  22411. me.initMap = {};
  22412. me.values = {};
  22413. me.deprecations = {};
  22414. }
  22415. prototype.config = prototype.defaultConfig = me.values;
  22416. cls.$config = me;
  22417. };
  22418. Ext.Configurator.prototype = {
  22419. self: Ext.Configurator,
  22420. needsFork: false,
  22421. /**
  22422. * This array holds the properties that need to be set on new instances.
  22423. *
  22424. * This array is populated when the first instance is passed to `configure` (basically
  22425. * when the first instance is created). The entries in `initMap` are iterated to find
  22426. * those configs needing per-instance processing.
  22427. *
  22428. * @property {Ext.Config[]} initList
  22429. * @private
  22430. */
  22431. initList: null,
  22432. /**
  22433. * This method adds new config properties. This is called for classes when they are
  22434. * declared, then for any mixins that class may define and finally for any overrides
  22435. * defined that target the class.
  22436. *
  22437. * @param {Object} config The config object containing the new config properties.
  22438. * @param {Ext.Class} [mixinClass] The mixin class if the configs are from a mixin.
  22439. * @private
  22440. */
  22441. add: function(config, mixinClass) {
  22442. var me = this,
  22443. Cls = me.cls,
  22444. configs = me.configs,
  22445. cachedConfigs = me.cachedConfigs,
  22446. initMap = me.initMap,
  22447. prototype = Cls.prototype,
  22448. mixinConfigs = mixinClass && mixinClass.$config.configs,
  22449. values = me.values,
  22450. isObject, meta, isCached, merge, cfg, currentValue, name, names, s, value;
  22451. for (name in config) {
  22452. value = config[name];
  22453. isObject = value && value.constructor === Object;
  22454. meta = isObject && '$value' in value ? value : null;
  22455. isCached = false;
  22456. if (meta) {
  22457. isCached = !!meta.cached;
  22458. value = meta.$value;
  22459. isObject = value && value.constructor === Object;
  22460. }
  22461. merge = meta && meta.merge;
  22462. cfg = configs[name];
  22463. if (cfg) {
  22464. // Only proceed with a mixin if we have a custom merge.
  22465. if (mixinClass) {
  22466. merge = cfg.merge;
  22467. if (!merge) {
  22468. continue;
  22469. }
  22470. // Don't want the mixin meta modifying our own
  22471. meta = null;
  22472. } else {
  22473. merge = merge || cfg.merge;
  22474. }
  22475. // This means that we've already declared this as a config in a superclass
  22476. // Let's not allow us to change it here.
  22477. if (!mixinClass && isCached && !cachedConfigs[name]) {
  22478. Ext.raise('Redefining config as cached: ' + name + ' in class: ' + Cls.$className);
  22479. }
  22480. // There is already a value for this config and we are not allowed to
  22481. // modify it. So, if it is an object and the new value is also an object,
  22482. // the result is a merge so we have to merge both on to a new object.
  22483. currentValue = values[name];
  22484. if (merge) {
  22485. value = merge.call(cfg, value, currentValue, Cls, mixinClass);
  22486. } else if (isObject) {
  22487. if (currentValue && currentValue.constructor === Object) {
  22488. // We favor moving the cost of an "extra" copy here because this
  22489. // is likely to be a rare thing two object values for the same
  22490. // property. The alternative would be to clone the initial value
  22491. // to make it safely modifiable even though it is likely to never
  22492. // need to be modified.
  22493. value = ExtObject.merge({}, currentValue, value);
  22494. }
  22495. }
  22496. } else // else "currentValue" is a primitive so "value" can just replace it
  22497. // else "value" is a primitive and it can just replace currentValue
  22498. {
  22499. // This is a new property value, so add it to the various maps "as is".
  22500. // In the majority of cases this value will not be overridden or need to
  22501. // be forked.
  22502. if (mixinConfigs) {
  22503. // Since this is a config from a mixin, we don't want to apply its
  22504. // meta-ness because it already has. Instead we want to use its cfg
  22505. // instance:
  22506. cfg = mixinConfigs[name];
  22507. meta = null;
  22508. } else {
  22509. cfg = ExtConfig.get(name);
  22510. }
  22511. configs[name] = cfg;
  22512. if (cfg.cached || isCached) {
  22513. cachedConfigs[name] = true;
  22514. }
  22515. // Ensure that the new config has a getter and setter. Because this method
  22516. // is called during class creation as the "config" (or "cachedConfig") is
  22517. // being processed, the user's methods will not be on the prototype yet.
  22518. //
  22519. // This has the following trade-offs:
  22520. //
  22521. // - Custom getters are rare so there is minimal waste generated by them.
  22522. //
  22523. // - Custom setters are more common but, by putting the default setter on
  22524. // the prototype prior to addMembers, when the user methods are added
  22525. // callParent can be used to call the generated setter. This is almost
  22526. // certainly desirable as the setter has some very important semantics
  22527. // that a custom setter would probably want to preserve by just adding
  22528. // logic before and/or after the callParent.
  22529. //
  22530. // - By not adding these to the class body we avoid all the "is function"
  22531. // tests that get applied to each class member thereby streamlining the
  22532. // downstream class creation process.
  22533. //
  22534. // We still check for getter and/or setter but primarily for reasons of
  22535. // backwards compatibility and "just in case" someone relied on inherited
  22536. // getter/setter even though the base did not have the property listed as
  22537. // a "config" (obscure case certainly).
  22538. //
  22539. names = cfg.names;
  22540. if (!prototype[s = names.get]) {
  22541. prototype[s] = cfg.getter || cfg.getGetter();
  22542. }
  22543. if (!prototype[s = names.set]) {
  22544. prototype[s] = (meta && meta.evented) ? (cfg.eventedSetter || cfg.getEventedSetter()) : (cfg.setter || cfg.getSetter());
  22545. }
  22546. }
  22547. if (meta) {
  22548. if (cfg.owner !== Cls) {
  22549. configs[name] = cfg = Ext.Object.chain(cfg);
  22550. cfg.owner = Cls;
  22551. }
  22552. Ext.apply(cfg, meta);
  22553. delete cfg.$value;
  22554. }
  22555. // Fork checks all the default values to see if they are arrays or objects
  22556. // Do this to save us from doing it on each run
  22557. if (!me.needsFork && value && (value.constructor === Object || value instanceof Array)) {
  22558. me.needsFork = true;
  22559. }
  22560. // If the value is non-null, we need to initialize it.
  22561. if (value !== null) {
  22562. initMap[name] = true;
  22563. } else {
  22564. if (prototype.$configPrefixed) {
  22565. prototype[configs[name].names.internal] = null;
  22566. } else {
  22567. prototype[configs[name].name] = null;
  22568. }
  22569. if (name in initMap) {
  22570. // Only set this to false if we already have it in the map, otherwise, just leave it out!
  22571. initMap[name] = false;
  22572. }
  22573. }
  22574. values[name] = value;
  22575. }
  22576. },
  22577. addDeprecations: function(configs) {
  22578. var me = this,
  22579. deprecations = me.deprecations,
  22580. className = (me.cls.$className || '') + '#',
  22581. message, newName, oldName;
  22582. for (oldName in configs) {
  22583. newName = configs[oldName];
  22584. // configs: {
  22585. // dead: null,
  22586. //
  22587. // renamed: 'newName',
  22588. //
  22589. // removed: {
  22590. // message: 'This config was replaced by pixie dust'
  22591. // }
  22592. // }
  22593. if (!newName) {
  22594. message = 'This config has been removed.';
  22595. } else if (!(message = newName.message)) {
  22596. message = 'This config has been renamed to "' + newName + '"';
  22597. }
  22598. deprecations[oldName] = className + oldName + ': ' + message;
  22599. }
  22600. },
  22601. /**
  22602. * This method configures the given `instance` using the specified `instanceConfig`.
  22603. * The given `instance` should have been created by this object's `cls`.
  22604. *
  22605. * @param {Object} instance The instance to configure.
  22606. * @param {Object} instanceConfig The configuration properties to apply to `instance`.
  22607. * @private
  22608. */
  22609. configure: function(instance, instanceConfig) {
  22610. var me = this,
  22611. configs = me.configs,
  22612. deprecations = me.deprecations,
  22613. initMap = me.initMap,
  22614. initListMap = me.initListMap,
  22615. initList = me.initList,
  22616. prototype = me.cls.prototype,
  22617. values = me.values,
  22618. remaining = 0,
  22619. firstInstance = !initList,
  22620. cachedInitList, cfg, getter, i, internalName, ln, names, name, value, isCached, valuesKey, field;
  22621. values = me.needsFork ? ExtObject.fork(values) : ExtObject.chain(values);
  22622. // Let apply/update methods know that the initConfig is currently running.
  22623. instance.isConfiguring = true;
  22624. if (firstInstance) {
  22625. // When called to configure the first instance of the class to which we are
  22626. // bound we take a bit to plan for instance 2+.
  22627. me.initList = initList = [];
  22628. me.initListMap = initListMap = {};
  22629. instance.isFirstInstance = true;
  22630. for (name in initMap) {
  22631. cfg = configs[name];
  22632. isCached = cfg.cached;
  22633. if (initMap[name]) {
  22634. names = cfg.names;
  22635. value = values[name];
  22636. if (!prototype[names.set].$isDefault || prototype[names.apply] || prototype[names.update] || typeof value === 'object') {
  22637. if (isCached) {
  22638. // This is a cachedConfig, so it needs to be initialized with
  22639. // the default value and placed on the prototype... but the
  22640. // instanceConfig may have a different value so the value may
  22641. // need resetting. We have to defer the call to the setter so
  22642. // that all of the initGetters are set up first.
  22643. (cachedInitList || (cachedInitList = [])).push(cfg);
  22644. } else {
  22645. // Remember this config so that all instances (including this
  22646. // one) can invoke the setter to properly initialize it.
  22647. initList.push(cfg);
  22648. initListMap[name] = true;
  22649. }
  22650. // Point all getters to the initGetters. By doing this here we
  22651. // avoid creating initGetters for configs that don't need them
  22652. // and we can easily pick up the cached fn to save the call.
  22653. instance[names.get] = cfg.initGetter || cfg.getInitGetter();
  22654. } else {
  22655. // Non-object configs w/o custom setter, applier or updater can
  22656. // be simply stored on the prototype.
  22657. prototype[cfg.getInternalName(prototype)] = value;
  22658. }
  22659. } else if (isCached) {
  22660. prototype[cfg.getInternalName(prototype)] = undefined;
  22661. }
  22662. }
  22663. }
  22664. // TODO - we need to combine the cached loop with the instanceConfig loop to
  22665. // avoid duplication of init getter setups (for correctness if a cached cfg
  22666. // calls on a non-cached cfg)
  22667. ln = cachedInitList && cachedInitList.length;
  22668. if (ln) {
  22669. // This is only ever done on the first instance we configure. Any config in
  22670. // cachedInitList has to be set to the default value to allow any side-effects
  22671. // or transformations to occur. The resulting values can then be elevated to
  22672. // the prototype and this property need not be initialized on each instance.
  22673. for (i = 0; i < ln; ++i) {
  22674. internalName = cachedInitList[i].getInternalName(prototype);
  22675. // Since these are cached configs the base class will potentially have put
  22676. // its cached values on the prototype so we need to hide these while we
  22677. // run the inits for our cached configs.
  22678. instance[internalName] = null;
  22679. }
  22680. for (i = 0; i < ln; ++i) {
  22681. names = (cfg = cachedInitList[i]).names;
  22682. getter = names.get;
  22683. if (instance.hasOwnProperty(getter)) {
  22684. instance[names.set](values[cfg.name]);
  22685. delete instance[getter];
  22686. }
  22687. }
  22688. for (i = 0; i < ln; ++i) {
  22689. internalName = cachedInitList[i].getInternalName(prototype);
  22690. prototype[internalName] = instance[internalName];
  22691. delete instance[internalName];
  22692. }
  22693. }
  22694. // The cachedConfigs have all been set to the default values including any of
  22695. // those that may have been triggered by their getter.
  22696. // If the instanceConfig has a platformConfig in it, we need to merge the active
  22697. // rules of that object to make the actual instanceConfig.
  22698. if (instanceConfig && instanceConfig.platformConfig) {
  22699. instanceConfig = me.resolvePlatformConfig(instance, instanceConfig);
  22700. }
  22701. if (firstInstance) {
  22702. // Allow the class to do things once the cachedConfig has been processed.
  22703. // We need to call this method always when the first instance is configured
  22704. // whether or not it actually has cached configs
  22705. if (instance.afterCachedConfig && !instance.afterCachedConfig.$nullFn) {
  22706. instance.afterCachedConfig(instanceConfig);
  22707. }
  22708. }
  22709. // Now that the cachedConfigs have been processed we can apply the instanceConfig
  22710. // and hide the "configs" on the prototype. This will serve as the source for any
  22711. // configs that need to initialize from their initial getter call.
  22712. // IMPORTANT: "this.hasOwnProperty('config')" is how a config applier/updater can
  22713. // tell it is processing the cached config value vs an instance config value.
  22714. instance.config = values;
  22715. // There are 2 possibilities here:
  22716. // 1) If it's the first time in this function, we may have had cachedConfigs running.
  22717. // these configs may have called the getters for any of the normal getters, which
  22718. // means the initial getters have been clobbered on the instance and won't be able
  22719. // to be called below when we iterate over the initList. As such, we need to
  22720. // reinitialize them here, even though we've done it up above.
  22721. //
  22722. // 2) If this the second time in this function, the cachedConfigs won't be processed,
  22723. // so we don't need to worry about them clobbering config values. However, since
  22724. // we've already done all our setup, we won't enter into the block that sets the
  22725. // initGetter, so we need to do it here anyway.
  22726. //
  22727. // Also note, that lazy configs will appear in the initList because we need
  22728. // to spin up the initGetter.
  22729. for (i = 0 , ln = initList.length; i < ln; ++i) {
  22730. cfg = initList[i];
  22731. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  22732. }
  22733. // Give the class a chance to transform the configs.
  22734. if (instance.transformInstanceConfig) {
  22735. instanceConfig = instance.transformInstanceConfig(instanceConfig);
  22736. }
  22737. // Important: We are looping here twice on purpose. This first loop serves 2 purposes:
  22738. //
  22739. // 1) Ensure the values collection is fully populated before we call any setters. Since
  22740. // a setter may have an updater/applier, it could potentially call another getter() to grab
  22741. // the value for some other property, so this ensures they are all set on the config object.
  22742. //
  22743. // 2) Ensure that the initGetter is set as the getter for any config that doesn't appear in
  22744. // the initList. We need to ensure that the initGetter is pushed on for everything that we will
  22745. // be setting during init time.
  22746. //
  22747. // The merging in this loop cannot be completed by Ext.merge(), since we do NOT want to merge
  22748. // non-strict values, they should always just be assigned across without modification.
  22749. if (instanceConfig) {
  22750. for (name in instanceConfig) {
  22751. value = instanceConfig[name];
  22752. cfg = configs[name];
  22753. if (deprecations[name]) {
  22754. Ext.log.warn(deprecations[name]);
  22755. if (!cfg) {
  22756. // If there is a Config for this, perhaps the class is emulating
  22757. // the old config... If there is not a Config we don't want to
  22758. // proceed and put the property on the instance. That will likely
  22759. // hide the bug during development.
  22760. continue;
  22761. }
  22762. }
  22763. if (!cfg) {
  22764. field = instance.self.prototype[name];
  22765. if (instance.$configStrict && (typeof field === 'function') && !field.$nullFn) {
  22766. // In strict mode you cannot override functions
  22767. Ext.raise('Cannot override method ' + name + ' on ' + instance.$className + ' instance.');
  22768. }
  22769. // Not all "configs" use the config system so in this case simply put
  22770. // the value on the instance:
  22771. instance[name] = value;
  22772. } else {
  22773. // However we still need to create the initial value that needs
  22774. // to be used. We also need to spin up the initGetter.
  22775. if (!cfg.lazy) {
  22776. ++remaining;
  22777. }
  22778. if (!initListMap[name]) {
  22779. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  22780. }
  22781. if (cfg.merge) {
  22782. value = cfg.merge(value, values[name], instance);
  22783. } else if (value && value.constructor === Object) {
  22784. valuesKey = values[name];
  22785. if (valuesKey && valuesKey.constructor === Object) {
  22786. value = ExtObject.merge(values[name], value);
  22787. } else {
  22788. value = Ext.clone(value, false);
  22789. }
  22790. }
  22791. }
  22792. values[name] = value;
  22793. }
  22794. }
  22795. // Give the class a chance to hook in prior to initializing the configs.
  22796. if (instance.beforeInitConfig && !instance.beforeInitConfig.$nullFn) {
  22797. if (instance.beforeInitConfig(instanceConfig) === false) {
  22798. return;
  22799. }
  22800. }
  22801. if (instanceConfig) {
  22802. for (name in instanceConfig) {
  22803. if (!remaining) {
  22804. // For classes that have few proper Config properties, this saves us
  22805. // from making the full 2 passes over the instanceConfig.
  22806. break;
  22807. }
  22808. // We can ignore deprecated configs here because we warned about them
  22809. // above. Further, since we only process proper Config's here we would
  22810. // not be skipping them anyway.
  22811. cfg = configs[name];
  22812. if (cfg && !cfg.lazy) {
  22813. --remaining;
  22814. // A proper "config" property so call the setter to set the value.
  22815. names = cfg.names;
  22816. getter = names.get;
  22817. // At this point the initGetter may have already been called and
  22818. // cleared if the getter was called from the applier or updater of a
  22819. // previously processed instance config. checking if the instance has
  22820. // its own getter ensures the setter does not get called twice.
  22821. if (instance.hasOwnProperty(getter)) {
  22822. instance[names.set](values[name]);
  22823. // The generated setter will remove the initGetter from the instance
  22824. // but the user may have provided their own setter so we have to do
  22825. // this here as well:
  22826. delete instance[names.get];
  22827. }
  22828. }
  22829. }
  22830. }
  22831. // Process configs declared on the class that need per-instance initialization.
  22832. for (i = 0 , ln = initList.length; i < ln; ++i) {
  22833. cfg = initList[i];
  22834. names = cfg.names;
  22835. getter = names.get;
  22836. if (!cfg.lazy && instance.hasOwnProperty(getter)) {
  22837. // Since the instance still hasOwn the getter, that means we've set an initGetter
  22838. // and it hasn't been cleared by calling any setter. Since we've never set the value
  22839. // because it wasn't passed in the instance, we go and set it here, taking the value
  22840. // from our definition config and passing it through finally clear off the getter.
  22841. instance[names.set](values[cfg.name]);
  22842. delete instance[getter];
  22843. }
  22844. }
  22845. // Expose the value from the prototype chain (false):
  22846. delete instance.isConfiguring;
  22847. },
  22848. getCurrentConfig: function(instance) {
  22849. var defaultConfig = instance.defaultConfig,
  22850. config = {},
  22851. name;
  22852. for (name in defaultConfig) {
  22853. config[name] = instance[configPropMap[name].names.get]();
  22854. }
  22855. return config;
  22856. },
  22857. /**
  22858. * Merges the values of a config object onto a base config.
  22859. * @param {Ext.Base} instance
  22860. * @param {Object} baseConfig
  22861. * @param {Object} config
  22862. * @return {Object} the merged config
  22863. * @private
  22864. */
  22865. merge: function(instance, baseConfig, config) {
  22866. // Although this is a "private" method. It is used by Sencha Architect and so
  22867. // its api should remain stable.
  22868. var configs = this.configs,
  22869. name, value, baseValue, cfg;
  22870. for (name in config) {
  22871. value = config[name];
  22872. cfg = configs[name];
  22873. if (cfg) {
  22874. if (cfg.merge) {
  22875. value = cfg.merge(value, baseConfig[name], instance);
  22876. } else if (value && value.constructor === Object) {
  22877. baseValue = baseConfig[name];
  22878. if (baseValue && baseValue.constructor === Object) {
  22879. value = Ext.Object.merge(baseValue, value);
  22880. } else {
  22881. value = Ext.clone(value, false);
  22882. }
  22883. }
  22884. }
  22885. baseConfig[name] = value;
  22886. }
  22887. return baseConfig;
  22888. },
  22889. /**
  22890. * @private
  22891. */
  22892. reconfigure: function(instance, instanceConfig, options) {
  22893. var currentConfig = instance.config,
  22894. configList = [],
  22895. strict = instance.$configStrict && !(options && options.strict === false),
  22896. configs = this.configs,
  22897. defaults = options && options.defaults,
  22898. cfg, getter, i, len, name, names, prop;
  22899. for (name in instanceConfig) {
  22900. cfg = configs[name];
  22901. if (defaults && instance.hasOwnProperty(cfg && instance.$configPrefixed ? cfg.names.internal : name)) {
  22902. continue;
  22903. }
  22904. currentConfig[name] = instanceConfig[name];
  22905. if (this.deprecations[name]) {
  22906. // See similar logic doc in configure() method.
  22907. Ext.log.warn(this.deprecations[name]);
  22908. if (!cfg) {
  22909. continue;
  22910. }
  22911. }
  22912. if (cfg) {
  22913. // To ensure that configs being set here get processed in the proper order
  22914. // we must give them init getters just in case they depend upon each other
  22915. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  22916. } else {
  22917. // Check for existence of the property on the prototype before proceeding.
  22918. // If present on the prototype, and if the property is a function we
  22919. // do not allow it to be overridden by a property in the config object
  22920. // in strict mode (unless the function on the prototype is a emptyFn or
  22921. // identityFn). Note that we always check the prototype, not the instance
  22922. // because calling setConfig a second time should have the same results -
  22923. // the first call may have set a function on the instance.
  22924. prop = instance.self.prototype[name];
  22925. if (strict) {
  22926. if ((typeof prop === 'function') && !prop.$nullFn) {
  22927. Ext.Error.raise("Cannot override method " + name + " on " + instance.$className + " instance.");
  22928. continue;
  22929. } else {
  22930. if (name !== 'type') {
  22931. Ext.log.warn('No such config "' + name + '" for class ' + instance.$className);
  22932. }
  22933. }
  22934. }
  22935. }
  22936. configList.push(name);
  22937. }
  22938. for (i = 0 , len = configList.length; i < len; i++) {
  22939. name = configList[i];
  22940. cfg = configs[name];
  22941. if (cfg) {
  22942. names = cfg.names;
  22943. getter = names.get;
  22944. if (instance.hasOwnProperty(getter)) {
  22945. // Since the instance still hasOwn the getter, that means we've set an initGetter
  22946. // and it hasn't been cleared by calling any setter. Since we've never set the value
  22947. // because it wasn't passed in the instance, we go and set it here, taking the value
  22948. // from our definition config and passing it through finally clear off the getter.
  22949. instance[names.set](instanceConfig[name]);
  22950. delete instance[getter];
  22951. }
  22952. } else {
  22953. cfg = configPropMap[name] || Ext.Config.get(name);
  22954. names = cfg.names;
  22955. if (instance[names.set]) {
  22956. instance[names.set](instanceConfig[name]);
  22957. } else {
  22958. // apply non-config props directly to the instance
  22959. instance[name] = instanceConfig[name];
  22960. }
  22961. }
  22962. }
  22963. },
  22964. /**
  22965. * This method accepts an instance config object containing a `platformConfig`
  22966. * property and merges the appropriate rules from that sub-object with the root object
  22967. * to create the final config object that should be used. This is method called by
  22968. * `{@link #configure}` when it receives an `instanceConfig` containing a
  22969. * `platformConfig` property.
  22970. *
  22971. * @param {Ext.Base} instance
  22972. * @param {Object} instanceConfig The instance config parameter.
  22973. * @return {Object} The new instance config object with platformConfig results applied.
  22974. * @private
  22975. * @since 5.1.0
  22976. */
  22977. resolvePlatformConfig: function(instance, instanceConfig) {
  22978. var platformConfig = instanceConfig && instanceConfig.platformConfig,
  22979. ret = instanceConfig,
  22980. i, keys, n;
  22981. if (platformConfig) {
  22982. keys = Ext.getPlatformConfigKeys(platformConfig);
  22983. n = keys.length;
  22984. if (n) {
  22985. ret = Ext.merge({}, ret);
  22986. // this deep copies sub-objects
  22987. for (i = 0 , n = keys.length; i < n; ++i) {
  22988. this.merge(instance, ret, platformConfig[keys[i]]);
  22989. }
  22990. }
  22991. }
  22992. return ret;
  22993. }
  22994. };
  22995. }());
  22996. // prototype
  22997. // closure on whole file
  22998. // @tag class
  22999. /**
  23000. * @class Ext.Base
  23001. *
  23002. * The root of all classes created with {@link Ext#define}.
  23003. *
  23004. * Ext.Base is the building block of all Ext classes. All classes in Ext inherit from Ext.Base.
  23005. * All prototype and static members of this class are inherited by all other classes.
  23006. */
  23007. Ext.Base = (function(flexSetter) {
  23008. // @define Ext.Base
  23009. // @require Ext.Util
  23010. // @require Ext.Version
  23011. // @require Ext.Configurator
  23012. // @uses Ext.ClassManager
  23013. var noArgs = [],
  23014. baseStaticMember,
  23015. baseStaticMembers = [],
  23016. makeDeprecatedMethod = function(oldName, newName, msg) {
  23017. var message = '"' + oldName + '" is deprecated.';
  23018. if (msg) {
  23019. message += ' ' + msg;
  23020. } else if (newName) {
  23021. message += ' Please use "' + newName + '" instead.';
  23022. }
  23023. return function() {
  23024. Ext.raise(message);
  23025. };
  23026. },
  23027. addDeprecatedProperty = function(object, oldName, newName, message) {
  23028. if (!message) {
  23029. message = '"' + oldName + '" is deprecated.';
  23030. }
  23031. if (newName) {
  23032. message += ' Please use "' + newName + '" instead.';
  23033. }
  23034. if (message) {
  23035. Ext.Object.defineProperty(object, oldName, {
  23036. get: function() {
  23037. Ext.raise(message);
  23038. },
  23039. set: function(value) {
  23040. Ext.raise(message);
  23041. },
  23042. configurable: true
  23043. });
  23044. }
  23045. },
  23046. makeAliasFn = function(name) {
  23047. return function() {
  23048. return this[name].apply(this, arguments);
  23049. };
  23050. },
  23051. Version = Ext.Version,
  23052. leadingDigitRe = /^\d/,
  23053. oneMember = {},
  23054. aliasOneMember = {},
  23055. Base = function() {},
  23056. BasePrototype = Base.prototype,
  23057. Reaper;
  23058. Ext.Reaper = Reaper = {
  23059. delay: 100,
  23060. queue: [],
  23061. timer: null,
  23062. add: function(obj) {
  23063. if (!Reaper.timer) {
  23064. Reaper.timer = Ext.defer(Reaper.tick, Reaper.delay);
  23065. }
  23066. Reaper.queue.push(obj);
  23067. },
  23068. flush: function() {
  23069. if (Reaper.timer) {
  23070. Ext.undefer(Reaper.timer);
  23071. Reaper.timer = null;
  23072. }
  23073. var queue = Reaper.queue,
  23074. n = queue.length,
  23075. i, obj;
  23076. Reaper.queue = [];
  23077. for (i = 0; i < n; ++i) {
  23078. obj = queue[i];
  23079. if (obj && obj.$reap) {
  23080. obj.$reap();
  23081. }
  23082. }
  23083. },
  23084. tick: function() {
  23085. Reaper.timer = null;
  23086. Reaper.flush();
  23087. }
  23088. };
  23089. // These static properties will be copied to every newly created class with {@link Ext#define}
  23090. Ext.apply(Base, {
  23091. $className: 'Ext.Base',
  23092. $isClass: true,
  23093. /**
  23094. * Create a new instance of this Class.
  23095. *
  23096. * Ext.define('My.cool.Class', {
  23097. * ...
  23098. * });
  23099. *
  23100. * My.cool.Class.create({
  23101. * someConfig: true
  23102. * });
  23103. *
  23104. * All parameters are passed to the constructor of the class.
  23105. *
  23106. * @return {Object} the created instance.
  23107. * @static
  23108. * @inheritable
  23109. */
  23110. create: function() {
  23111. return Ext.create.apply(Ext, [
  23112. this
  23113. ].concat(Array.prototype.slice.call(arguments, 0)));
  23114. },
  23115. /**
  23116. * This method applies a versioned, deprecation declaration to this class. This
  23117. * is typically called by the `deprecated` config.
  23118. * @private
  23119. */
  23120. addDeprecations: function(deprecations) {
  23121. var me = this,
  23122. all = [],
  23123. compatVersion = Ext.getCompatVersion(deprecations.name),
  23124. configurator = me.getConfigurator(),
  23125. displayName = (me.$className || '') + '#',
  23126. deprecate, versionSpec, index, message, target, enabled, existing, fn, names, oldName, newName, member, statics, version;
  23127. for (versionSpec in deprecations) {
  23128. if (leadingDigitRe.test(versionSpec)) {
  23129. version = new Ext.Version(versionSpec);
  23130. version.deprecations = deprecations[versionSpec];
  23131. all.push(version);
  23132. }
  23133. }
  23134. all.sort(Version.compare);
  23135. for (index = all.length; index--; ) {
  23136. deprecate = (version = all[index]).deprecations;
  23137. target = me.prototype;
  23138. statics = deprecate.statics;
  23139. // If user specifies, say 4.2 compatibility and we have a 5.0 deprecation
  23140. // then that block needs to be "enabled" to "revert" to behaviors prior
  23141. // to 5.0. By default, compatVersion === currentVersion, so there are no
  23142. // enabled blocks. In dev mode we still want to visit all the blocks and
  23143. // possibly add shims to detect use of deprecated methods, but in a build
  23144. // (if the deprecated block remains somehow) we just break the loop.
  23145. enabled = compatVersion && compatVersion.lt(version);
  23146. if (!enabled) {} else if (!enabled) {
  23147. // we won't get here in dev mode when !enabled
  23148. break;
  23149. }
  23150. while (deprecate) {
  23151. names = deprecate.methods;
  23152. if (names) {
  23153. for (oldName in names) {
  23154. member = names[oldName];
  23155. fn = null;
  23156. if (!member) {
  23157. /*
  23158. * Something like:
  23159. *
  23160. * '5.1': {
  23161. * methods: {
  23162. * removedMethod: null
  23163. * }
  23164. * }
  23165. *
  23166. * Since there is no recovering the method, we always put
  23167. * on a shim to catch abuse.
  23168. */
  23169. // The class should not already have a method by the oldName
  23170. Ext.Assert.isNotDefinedProp(target, oldName);
  23171. fn = makeDeprecatedMethod(displayName + oldName);
  23172. } else if (Ext.isString(member)) {
  23173. /*
  23174. * Something like:
  23175. *
  23176. * '5.1': {
  23177. * methods: {
  23178. * oldName: 'newName'
  23179. * }
  23180. * }
  23181. *
  23182. * If this block is enabled, we just put an alias in place.
  23183. * Otherwise we need to inject a
  23184. */
  23185. // The class should not already have a method by the oldName
  23186. Ext.Assert.isNotDefinedProp(target, oldName);
  23187. Ext.Assert.isDefinedProp(target, member);
  23188. if (enabled) {
  23189. // This call to the real method name must be late
  23190. // bound if it is to pick up overrides and such.
  23191. fn = makeAliasFn(member);
  23192. } else {
  23193. fn = makeDeprecatedMethod(displayName + oldName, member);
  23194. }
  23195. } else {
  23196. /*
  23197. * Something like:
  23198. *
  23199. * '5.1': {
  23200. * methods: {
  23201. * foo: function () { ... }
  23202. * }
  23203. * }
  23204. *
  23205. * Or this:
  23206. *
  23207. * '5.1': {
  23208. * methods: {
  23209. * foo: {
  23210. * fn: function () { ... },
  23211. * message: 'Please use "bar" instead.'
  23212. * }
  23213. * }
  23214. * }
  23215. *
  23216. * Or just this:
  23217. *
  23218. * '5.1': {
  23219. * methods: {
  23220. * foo: {
  23221. * message: 'Use something else instead.'
  23222. * }
  23223. * }
  23224. * }
  23225. *
  23226. * If this block is enabled, and "foo" is an existing
  23227. * method, than we apply the given method as an override.
  23228. * If "foo" is not existing, we simply add the method.
  23229. *
  23230. * If the block is not enabled and there is no existing
  23231. * method by that name, than we add a shim to prevent
  23232. * abuse.
  23233. */
  23234. message = '';
  23235. if (member.message || member.fn) {
  23236. message = member.message;
  23237. member = member.fn;
  23238. }
  23239. existing = target.hasOwnProperty(oldName) && target[oldName];
  23240. if (enabled && member) {
  23241. member.$owner = me;
  23242. member.$name = oldName;
  23243. member.name = displayName + oldName;
  23244. if (existing) {
  23245. member.$previous = existing;
  23246. }
  23247. fn = member;
  23248. } else if (!existing) {
  23249. fn = makeDeprecatedMethod(displayName + oldName, null, message);
  23250. }
  23251. }
  23252. if (fn) {
  23253. target[oldName] = fn;
  23254. }
  23255. }
  23256. }
  23257. // for oldName
  23258. //-------------------------------------
  23259. // Debug only
  23260. names = deprecate.configs;
  23261. if (names) {
  23262. //
  23263. // '6.0': {
  23264. // configs: {
  23265. // dead: null,
  23266. //
  23267. // renamed: 'newName',
  23268. //
  23269. // removed: {
  23270. // message: 'This config was replaced by pixie dust'
  23271. // }
  23272. // }
  23273. // }
  23274. //
  23275. configurator.addDeprecations(names);
  23276. }
  23277. names = deprecate.properties;
  23278. if (names && !enabled) {
  23279. // For properties about the only thing we can do is (on Good
  23280. // Browsers), add warning shims for accessing them. So if the
  23281. // block is enabled, we don't want those.
  23282. for (oldName in names) {
  23283. newName = names[oldName];
  23284. if (Ext.isString(newName)) {
  23285. addDeprecatedProperty(target, displayName + oldName, newName);
  23286. } else if (newName && newName.message) {
  23287. addDeprecatedProperty(target, displayName + oldName, null, newName.message);
  23288. } else {
  23289. addDeprecatedProperty(target, displayName + oldName);
  23290. }
  23291. }
  23292. }
  23293. //-------------------------------------
  23294. // reset to handle statics and apply them to the class
  23295. deprecate = statics;
  23296. statics = null;
  23297. target = me;
  23298. }
  23299. }
  23300. },
  23301. /**
  23302. * @private
  23303. * @static
  23304. * @inheritable
  23305. * @param parentClass
  23306. */
  23307. extend: function(parentClass) {
  23308. var me = this,
  23309. parentPrototype = parentClass.prototype,
  23310. prototype, name, statics;
  23311. prototype = me.prototype = Ext.Object.chain(parentPrototype);
  23312. prototype.self = me;
  23313. me.superclass = prototype.superclass = parentPrototype;
  23314. if (!parentClass.$isClass) {
  23315. for (name in BasePrototype) {
  23316. if (name in prototype) {
  23317. prototype[name] = BasePrototype[name];
  23318. }
  23319. }
  23320. }
  23321. // Statics inheritance
  23322. statics = parentPrototype.$inheritableStatics;
  23323. if (statics) {
  23324. for (name in statics) {
  23325. if (!me.hasOwnProperty(name)) {
  23326. me[name] = parentClass[name];
  23327. }
  23328. }
  23329. }
  23330. if (parentClass.$onExtended) {
  23331. me.$onExtended = parentClass.$onExtended.slice();
  23332. }
  23333. me.getConfigurator();
  23334. },
  23335. /**
  23336. * @private
  23337. * @static
  23338. * @inheritable
  23339. */
  23340. $onExtended: [],
  23341. /**
  23342. * @private
  23343. * @static
  23344. * @inheritable
  23345. */
  23346. triggerExtended: function() {
  23347. Ext.classSystemMonitor && Ext.classSystemMonitor(this, 'Ext.Base#triggerExtended', arguments);
  23348. var callbacks = this.$onExtended,
  23349. ln = callbacks.length,
  23350. i, callback;
  23351. if (ln > 0) {
  23352. for (i = 0; i < ln; i++) {
  23353. callback = callbacks[i];
  23354. callback.fn.apply(callback.scope || this, arguments);
  23355. }
  23356. }
  23357. },
  23358. /**
  23359. * @private
  23360. * @static
  23361. * @inheritable
  23362. */
  23363. onExtended: function(fn, scope) {
  23364. this.$onExtended.push({
  23365. fn: fn,
  23366. scope: scope
  23367. });
  23368. return this;
  23369. },
  23370. /**
  23371. * Add / override static properties of this class.
  23372. *
  23373. * Ext.define('My.cool.Class', {
  23374. * ...
  23375. * });
  23376. *
  23377. * My.cool.Class.addStatics({
  23378. * someProperty: 'someValue', // My.cool.Class.someProperty = 'someValue'
  23379. * method1: function() { ... }, // My.cool.Class.method1 = function() { ... };
  23380. * method2: function() { ... } // My.cool.Class.method2 = function() { ... };
  23381. * });
  23382. *
  23383. * @param {Object} members
  23384. * @return {Ext.Base} this
  23385. * @static
  23386. * @inheritable
  23387. */
  23388. addStatics: function(members) {
  23389. this.addMembers(members, true);
  23390. return this;
  23391. },
  23392. /**
  23393. * @private
  23394. * @static
  23395. * @inheritable
  23396. * @param {Object} members
  23397. */
  23398. addInheritableStatics: function(members) {
  23399. var me = this,
  23400. proto = me.prototype,
  23401. inheritableStatics = me.$inheritableStatics,
  23402. name, member, current;
  23403. if (!inheritableStatics) {
  23404. inheritableStatics = Ext.apply({}, proto.$inheritableStatics);
  23405. me.$inheritableStatics = proto.$inheritableStatics = inheritableStatics;
  23406. }
  23407. var className = Ext.getClassName(me) + '.';
  23408. for (name in members) {
  23409. if (members.hasOwnProperty(name)) {
  23410. member = members[name];
  23411. current = me[name];
  23412. if (typeof member == 'function') {
  23413. member.name = className + name;
  23414. }
  23415. if (typeof current === 'function' && !current.$isClass && !current.$nullFn) {
  23416. member.$previous = current;
  23417. }
  23418. me[name] = member;
  23419. inheritableStatics[name] = true;
  23420. }
  23421. }
  23422. return me;
  23423. },
  23424. /**
  23425. * Add methods / properties to the prototype of this class.
  23426. *
  23427. * Ext.define('My.awesome.Cat', {
  23428. * constructor: function() {
  23429. * ...
  23430. * }
  23431. * });
  23432. *
  23433. * My.awesome.Cat.addMembers({
  23434. * meow: function() {
  23435. * alert('Meowww...');
  23436. * }
  23437. * });
  23438. *
  23439. * var kitty = new My.awesome.Cat();
  23440. * kitty.meow();
  23441. *
  23442. * @param {Object} members The members to add to this class.
  23443. * @param {Boolean} [isStatic=false] Pass `true` if the members are static.
  23444. * @param {Boolean} [privacy=false] Pass `true` if the members are private. This
  23445. * only has meaning in debug mode and only for methods.
  23446. * @static
  23447. * @inheritable
  23448. */
  23449. addMembers: function(members, isStatic, privacy) {
  23450. var me = this,
  23451. // this class
  23452. cloneFunction = Ext.Function.clone,
  23453. target = isStatic ? me : me.prototype,
  23454. defaultConfig = !isStatic && target.defaultConfig,
  23455. enumerables = Ext.enumerables,
  23456. privates = members.privates,
  23457. configs, i, ln, member, name, subPrivacy, privateStatics;
  23458. var displayName = (me.$className || '') + '#';
  23459. if (privates) {
  23460. // This won't run for normal class private members but will pick up all
  23461. // others (statics, overrides, etc).
  23462. delete members.privates;
  23463. if (!isStatic) {
  23464. privateStatics = privates.statics;
  23465. delete privates.statics;
  23466. }
  23467. subPrivacy = privates.privacy || privacy || 'framework';
  23468. me.addMembers(privates, isStatic, subPrivacy);
  23469. if (privateStatics) {
  23470. me.addMembers(privateStatics, true, subPrivacy);
  23471. }
  23472. }
  23473. for (name in members) {
  23474. if (members.hasOwnProperty(name)) {
  23475. member = members[name];
  23476. if (privacy === true) {
  23477. privacy = 'framework';
  23478. }
  23479. if (member && member.$nullFn && privacy !== member.$privacy) {
  23480. Ext.raise('Cannot use stock function for private method ' + (me.$className ? me.$className + '#' : '') + name);
  23481. }
  23482. if (typeof member === 'function' && !member.$isClass && !member.$nullFn) {
  23483. if (member.$owner) {
  23484. member = cloneFunction(member);
  23485. }
  23486. if (target.hasOwnProperty(name)) {
  23487. member.$previous = target[name];
  23488. }
  23489. // This information is needed by callParent() and callSuper() as
  23490. // well as statics() and even Ext.fly().
  23491. member.$owner = me;
  23492. member.$name = name;
  23493. member.name = displayName + name;
  23494. var existing = target[name];
  23495. if (privacy) {
  23496. member.$privacy = privacy;
  23497. // The general idea here is that an existing, non-private
  23498. // method can be marked private. This is because the other
  23499. // way is strictly forbidden (private method going public)
  23500. // so if a method is in that gray area it can only be made
  23501. // private in doc form which allows a derived class to make
  23502. // it public.
  23503. if (existing && existing.$privacy && existing.$privacy !== privacy) {
  23504. Ext.privacyViolation(me, existing, member, isStatic);
  23505. }
  23506. } else if (existing && existing.$privacy) {
  23507. Ext.privacyViolation(me, existing, member, isStatic);
  23508. }
  23509. }
  23510. // The last part of the check here resolves a conflict if we have the same property
  23511. // declared as both a config and a member on the class so that the config wins.
  23512. else if (defaultConfig && (name in defaultConfig) && !target.config.hasOwnProperty(name)) {
  23513. // This is a config property so it must be added to the configs
  23514. // collection not just smashed on the prototype...
  23515. (configs || (configs = {}))[name] = member;
  23516. continue;
  23517. }
  23518. target[name] = member;
  23519. }
  23520. }
  23521. if (configs) {
  23522. // Add any configs found in the normal members arena:
  23523. me.addConfig(configs);
  23524. }
  23525. if (enumerables) {
  23526. for (i = 0 , ln = enumerables.length; i < ln; ++i) {
  23527. if (members.hasOwnProperty(name = enumerables[i])) {
  23528. member = members[name];
  23529. // The enumerables are all functions...
  23530. if (member && !member.$nullFn) {
  23531. if (member.$owner) {
  23532. member = cloneFunction(member);
  23533. }
  23534. member.$owner = me;
  23535. member.$name = name;
  23536. member.name = displayName + name;
  23537. if (target.hasOwnProperty(name)) {
  23538. member.$previous = target[name];
  23539. }
  23540. }
  23541. target[name] = member;
  23542. }
  23543. }
  23544. }
  23545. return this;
  23546. },
  23547. /**
  23548. * @private
  23549. * @static
  23550. * @inheritable
  23551. * @param name
  23552. * @param member
  23553. */
  23554. addMember: function(name, member) {
  23555. oneMember[name] = member;
  23556. this.addMembers(oneMember);
  23557. delete oneMember[name];
  23558. return this;
  23559. },
  23560. /**
  23561. * Borrow another class' members to the prototype of this class.
  23562. *
  23563. * Ext.define('Bank', {
  23564. * money: '$$$',
  23565. * printMoney: function() {
  23566. * alert('$$$$$$$');
  23567. * }
  23568. * });
  23569. *
  23570. * Ext.define('Thief', {
  23571. * ...
  23572. * });
  23573. *
  23574. * Thief.borrow(Bank, ['money', 'printMoney']);
  23575. *
  23576. * var steve = new Thief();
  23577. *
  23578. * alert(steve.money); // alerts '$$$'
  23579. * steve.printMoney(); // alerts '$$$$$$$'
  23580. *
  23581. * @param {Ext.Base} fromClass The class to borrow members from
  23582. * @param {Array/String} members The names of the members to borrow
  23583. * @return {Ext.Base} this
  23584. * @static
  23585. * @inheritable
  23586. * @private
  23587. */
  23588. borrow: function(fromClass, members) {
  23589. Ext.classSystemMonitor && Ext.classSystemMonitor(this, 'Ext.Base#borrow', arguments);
  23590. var prototype = fromClass.prototype,
  23591. membersObj = {},
  23592. i, ln, name;
  23593. members = Ext.Array.from(members);
  23594. for (i = 0 , ln = members.length; i < ln; i++) {
  23595. name = members[i];
  23596. membersObj[name] = prototype[name];
  23597. }
  23598. return this.addMembers(membersObj);
  23599. },
  23600. /**
  23601. * Override members of this class. Overridden methods can be invoked via
  23602. * {@link Ext.Base#method!callParent}.
  23603. *
  23604. * Ext.define('My.Cat', {
  23605. * constructor: function() {
  23606. * alert("I'm a cat!");
  23607. * }
  23608. * });
  23609. *
  23610. * My.Cat.override({
  23611. * constructor: function() {
  23612. * alert("I'm going to be a cat!");
  23613. *
  23614. * this.callParent(arguments);
  23615. *
  23616. * alert("Meeeeoooowwww");
  23617. * }
  23618. * });
  23619. *
  23620. * var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
  23621. * // alerts "I'm a cat!"
  23622. * // alerts "Meeeeoooowwww"
  23623. *
  23624. * Direct use of this method should be rare. Use {@link Ext#define Ext.define}
  23625. * instead:
  23626. *
  23627. * Ext.define('My.CatOverride', {
  23628. * override: 'My.Cat',
  23629. * constructor: function() {
  23630. * alert("I'm going to be a cat!");
  23631. *
  23632. * this.callParent(arguments);
  23633. *
  23634. * alert("Meeeeoooowwww");
  23635. * }
  23636. * });
  23637. *
  23638. * The above accomplishes the same result but can be managed by the {@link Ext.Loader}
  23639. * which can properly order the override and its target class and the build process
  23640. * can determine whether the override is needed based on the required state of the
  23641. * target class (My.Cat).
  23642. *
  23643. * @param {Object} members The properties to add to this class. This should be
  23644. * specified as an object literal containing one or more properties.
  23645. * @return {Ext.Base} this class
  23646. * @static
  23647. * @inheritable
  23648. */
  23649. override: function(members) {
  23650. var me = this,
  23651. statics = members.statics,
  23652. inheritableStatics = members.inheritableStatics,
  23653. config = members.config,
  23654. mixins = members.mixins,
  23655. cachedConfig = members.cachedConfig;
  23656. if (statics || inheritableStatics || config) {
  23657. members = Ext.apply({}, members);
  23658. }
  23659. if (statics) {
  23660. me.addMembers(statics, true);
  23661. delete members.statics;
  23662. }
  23663. if (inheritableStatics) {
  23664. me.addInheritableStatics(inheritableStatics);
  23665. delete members.inheritableStatics;
  23666. }
  23667. if (members.platformConfig) {
  23668. me.addPlatformConfig(members);
  23669. }
  23670. if (config) {
  23671. me.addConfig(config);
  23672. delete members.config;
  23673. }
  23674. if (cachedConfig) {
  23675. me.addCachedConfig(cachedConfig);
  23676. delete members.cachedConfig;
  23677. }
  23678. delete members.mixins;
  23679. me.addMembers(members);
  23680. if (mixins) {
  23681. me.mixin(mixins);
  23682. }
  23683. return me;
  23684. },
  23685. addPlatformConfig: function(data) {
  23686. var me = this,
  23687. prototype = me.prototype,
  23688. platformConfigs = data.platformConfig,
  23689. added, classConfigs, configs, configurator, keys, name, value, i, ln;
  23690. delete prototype.platformConfig;
  23691. if (platformConfigs instanceof Array) {
  23692. throw new Error('platformConfigs must be specified as an object.');
  23693. }
  23694. configurator = me.getConfigurator();
  23695. classConfigs = configurator.configs;
  23696. // Get the keys shortest to longest (ish).
  23697. keys = Ext.getPlatformConfigKeys(platformConfigs);
  23698. // To leverage the Configurator#add method, we want to generate potentially
  23699. // two objects to pass in: "added" and "hoisted". For any properties in an
  23700. // active platformConfig rule that set proper Configs in the base class, we
  23701. // need to put them in "added". If instead of the proper Config coming from
  23702. // a base class, it comes from this class's config block, we still need to
  23703. // put that config in "added" but we also need move the class-level config
  23704. // out of "config" and into "hoisted".
  23705. //
  23706. // This will ensure that the config defined at the class level is added to
  23707. // the Configurator first.
  23708. for (i = 0 , ln = keys.length; i < ln; ++i) {
  23709. configs = platformConfigs[keys[i]];
  23710. added = null;
  23711. for (name in configs) {
  23712. value = configs[name];
  23713. // We have a few possibilities for each config name:
  23714. if (name in classConfigs) {
  23715. // It is a proper Config defined by a base class.
  23716. (added || (added = {}))[name] = value;
  23717. } else {
  23718. // It is just a property to put on the prototype.
  23719. prototype[name] = value;
  23720. }
  23721. }
  23722. if (added) {
  23723. configurator.add(added);
  23724. }
  23725. }
  23726. },
  23727. /**
  23728. * @protected
  23729. * @static
  23730. * @inheritable
  23731. */
  23732. callParent: function(args) {
  23733. var method;
  23734. // This code is intentionally inlined for the least amount of debugger stepping
  23735. return (method = this.callParent.caller) && (method.$previous || ((method = method.$owner ? method : method.caller) && method.$owner.superclass.self[method.$name])).apply(this, args || noArgs);
  23736. },
  23737. /**
  23738. * @protected
  23739. * @static
  23740. * @inheritable
  23741. */
  23742. callSuper: function(args) {
  23743. var method;
  23744. // This code is intentionally inlined for the least amount of debugger stepping
  23745. return (method = this.callSuper.caller) && ((method = method.$owner ? method : method.caller) && method.$owner.superclass.self[method.$name]).apply(this, args || noArgs);
  23746. },
  23747. /**
  23748. * Used internally by the mixins pre-processor
  23749. * @private
  23750. * @static
  23751. * @inheritable
  23752. */
  23753. mixin: function(name, mixinClass) {
  23754. var me = this,
  23755. mixin, prototype, key, statics, i, ln, mixinName, mixinValue, mixins, mixinStatics, staticName;
  23756. if (typeof name !== 'string') {
  23757. mixins = name;
  23758. if (mixins instanceof Array) {
  23759. for (i = 0 , ln = mixins.length; i < ln; i++) {
  23760. mixin = mixins[i];
  23761. me.mixin(mixin.prototype.mixinId || mixin.$className, mixin);
  23762. }
  23763. } else {
  23764. // Not a string or array - process the object form:
  23765. // mixins: {
  23766. // foo: ...
  23767. // }
  23768. for (mixinName in mixins) {
  23769. me.mixin(mixinName, mixins[mixinName]);
  23770. }
  23771. }
  23772. return;
  23773. }
  23774. mixin = mixinClass.prototype;
  23775. prototype = me.prototype;
  23776. if (mixin.onClassMixedIn) {
  23777. mixin.onClassMixedIn.call(mixinClass, me);
  23778. }
  23779. if (!prototype.hasOwnProperty('mixins')) {
  23780. if ('mixins' in prototype) {
  23781. prototype.mixins = Ext.Object.chain(prototype.mixins);
  23782. } else {
  23783. prototype.mixins = {};
  23784. }
  23785. }
  23786. for (key in mixin) {
  23787. mixinValue = mixin[key];
  23788. if (key === 'mixins') {
  23789. // if 2 superclasses (e.g. a base class and a mixin) of this class both
  23790. // have a mixin with the same id, the first one wins, that is to say,
  23791. // the first mixin's methods to be applied to the prototype will not
  23792. // be overwritten by the second one. Since this is the case we also
  23793. // want to make sure we use the first mixin's prototype as the mixin
  23794. // reference, hence the "applyIf" below. A real world example of this
  23795. // is Ext.Widget which mixes in Ext.mixin.Observable. Ext.Widget can
  23796. // be mixed into subclasses of Ext.Component, which mixes in
  23797. // Ext.util.Observable. In this example, since the first "observable"
  23798. // mixin's methods win, we also want its reference to be preserved.
  23799. Ext.applyIf(prototype.mixins, mixinValue);
  23800. } else if (!(key === 'mixinId' || key === 'config' || key === '$inheritableStatics') && (prototype[key] === undefined)) {
  23801. prototype[key] = mixinValue;
  23802. }
  23803. }
  23804. // Mixin statics inheritance
  23805. statics = mixin.$inheritableStatics;
  23806. if (statics) {
  23807. mixinStatics = {};
  23808. for (staticName in statics) {
  23809. if (!me.hasOwnProperty(staticName)) {
  23810. mixinStatics[staticName] = mixinClass[staticName];
  23811. }
  23812. }
  23813. me.addInheritableStatics(mixinStatics);
  23814. }
  23815. if ('config' in mixin) {
  23816. me.addConfig(mixin.config, mixinClass);
  23817. }
  23818. prototype.mixins[name] = mixin;
  23819. if (mixin.afterClassMixedIn) {
  23820. mixin.afterClassMixedIn.call(mixinClass, me);
  23821. }
  23822. return me;
  23823. },
  23824. /**
  23825. * Adds new config properties to this class. This is called for classes when they
  23826. * are declared, then for any mixins that class may define and finally for any
  23827. * overrides defined that target the class.
  23828. *
  23829. * @param {Object} config
  23830. * @param {Ext.Class} [mixinClass] The mixin class if the configs are from a mixin.
  23831. * @private
  23832. * @static
  23833. * @inheritable
  23834. */
  23835. addConfig: function(config, mixinClass) {
  23836. var cfg = this.$config || this.getConfigurator();
  23837. cfg.add(config, mixinClass);
  23838. },
  23839. addCachedConfig: function(config, isMixin) {
  23840. var cached = {},
  23841. key;
  23842. for (key in config) {
  23843. cached[key] = {
  23844. cached: true,
  23845. $value: config[key]
  23846. };
  23847. }
  23848. this.addConfig(cached, isMixin);
  23849. },
  23850. /**
  23851. * Returns the `Ext.Configurator` for this class.
  23852. *
  23853. * @return {Ext.Configurator}
  23854. * @private
  23855. * @static
  23856. * @inheritable
  23857. */
  23858. getConfigurator: function() {
  23859. // the Ext.Configurator ctor will set $config so micro-opt out fn call:
  23860. return this.$config || new Ext.Configurator(this);
  23861. },
  23862. /**
  23863. * Get the current class' name in string format.
  23864. *
  23865. * Ext.define('My.cool.Class', {
  23866. * constructor: function() {
  23867. * alert(this.self.getName()); // alerts 'My.cool.Class'
  23868. * }
  23869. * });
  23870. *
  23871. * My.cool.Class.getName(); // 'My.cool.Class'
  23872. *
  23873. * @return {String} className
  23874. * @static
  23875. * @inheritable
  23876. */
  23877. getName: function() {
  23878. return Ext.getClassName(this);
  23879. },
  23880. /**
  23881. * Create aliases for existing prototype methods. Example:
  23882. *
  23883. * Ext.define('My.cool.Class', {
  23884. * method1: function() { ... },
  23885. * method2: function() { ... }
  23886. * });
  23887. *
  23888. * var test = new My.cool.Class();
  23889. *
  23890. * My.cool.Class.createAlias({
  23891. * method3: 'method1',
  23892. * method4: 'method2'
  23893. * });
  23894. *
  23895. * test.method3(); // test.method1()
  23896. *
  23897. * My.cool.Class.createAlias('method5', 'method3');
  23898. *
  23899. * test.method5(); // test.method3() -> test.method1()
  23900. *
  23901. * @param {String/Object} alias The new method name, or an object to set multiple aliases. See
  23902. * {@link Ext.Function#flexSetter flexSetter}
  23903. * @param {String/Object} origin The original method name
  23904. * @static
  23905. * @inheritable
  23906. * @method
  23907. */
  23908. createAlias: flexSetter(function(alias, origin) {
  23909. aliasOneMember[alias] = function() {
  23910. return this[origin].apply(this, arguments);
  23911. };
  23912. this.override(aliasOneMember);
  23913. delete aliasOneMember[alias];
  23914. })
  23915. });
  23916. // Capture the set of static members on Ext.Base that we want to copy to all
  23917. // derived classes. This array is used by Ext.Class as well as the optimizer.
  23918. for (baseStaticMember in Base) {
  23919. if (Base.hasOwnProperty(baseStaticMember)) {
  23920. baseStaticMembers.push(baseStaticMember);
  23921. }
  23922. }
  23923. Base.$staticMembers = baseStaticMembers;
  23924. Base.getConfigurator();
  23925. // lazily create now so as not capture in $staticMembers
  23926. Base.addMembers({
  23927. /** @private */
  23928. $className: 'Ext.Base',
  23929. /**
  23930. * @property {Boolean} isInstance
  23931. * This value is `true` and is used to identify plain objects from instances of
  23932. * a defined class.
  23933. * @protected
  23934. * @readonly
  23935. */
  23936. isInstance: true,
  23937. /**
  23938. * @property {Boolean} [$configPrefixed]
  23939. * The value `true` causes `config` values to be stored on instances using a
  23940. * property name prefixed with an underscore ("_") character. A value of `false`
  23941. * stores `config` values as properties using their exact name (no prefix).
  23942. * @private
  23943. * @since 5.0.0
  23944. */
  23945. $configPrefixed: true,
  23946. /**
  23947. * @property {Boolean} [$configStrict]
  23948. * The value `true` instructs the `initConfig` method to only honor values for
  23949. * properties declared in the `config` block of a class. When `false`, properties
  23950. * that are not declared in a `config` block will be placed on the instance.
  23951. * @private
  23952. * @since 5.0.0
  23953. */
  23954. $configStrict: true,
  23955. /**
  23956. * @property {Boolean} isConfiguring
  23957. * This property is set to `true` during the call to `initConfig`.
  23958. * @protected
  23959. * @readonly
  23960. * @since 5.0.0
  23961. */
  23962. isConfiguring: false,
  23963. /**
  23964. * @property {Boolean} isFirstInstance
  23965. * This property is set to `true` if this instance is the first of its class.
  23966. * @protected
  23967. * @readonly
  23968. * @since 5.0.0
  23969. */
  23970. isFirstInstance: false,
  23971. /**
  23972. * @property {Boolean} destroyed
  23973. * This property is set to `true` after the `destroy` method is called.
  23974. * @protected
  23975. */
  23976. destroyed: false,
  23977. /**
  23978. * @property {Boolean/"async"} [clearPropertiesOnDestroy=true]
  23979. * Setting this property to `false` will prevent nulling object references
  23980. * on a Class instance after destruction. Setting this to `"async"` will delay
  23981. * the clearing for approx 50ms.
  23982. * @protected
  23983. * @since 6.2.0
  23984. */
  23985. clearPropertiesOnDestroy: true,
  23986. /**
  23987. * @property {Boolean} [clearPrototypeOnDestroy=false]
  23988. * Setting this property to `true` will result in setting the object's
  23989. * prototype to `null` after the destruction sequence is fully completed.
  23990. * After that, most attempts at calling methods on the object instance
  23991. * will result in "method not defined" exception. This can be very helpful
  23992. * with tracking down otherwise hard to find bugs like runaway Ajax requests,
  23993. * timed functions not cleared on destruction, etc.
  23994. *
  23995. * Note that this option can only work in browsers that support `Object.setPrototypeOf`
  23996. * method, and is only available in debugging mode.
  23997. * @private
  23998. * @since 6.2.0
  23999. */
  24000. clearPrototypeOnDestroy: false,
  24001. /**
  24002. * Get the reference to the class from which this object was instantiated. Note that unlike {@link Ext.Base#self},
  24003. * `this.statics()` is scope-independent and it always returns the class from which it was called, regardless of what
  24004. * `this` points to during run-time
  24005. *
  24006. * Ext.define('My.Cat', {
  24007. * statics: {
  24008. * totalCreated: 0,
  24009. * speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
  24010. * },
  24011. *
  24012. * constructor: function() {
  24013. * var statics = this.statics();
  24014. *
  24015. * alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to
  24016. * // equivalent to: My.Cat.speciesName
  24017. *
  24018. * alert(this.self.speciesName); // dependent on 'this'
  24019. *
  24020. * statics.totalCreated++;
  24021. * },
  24022. *
  24023. * clone: function() {
  24024. * var cloned = new this.self(); // dependent on 'this'
  24025. *
  24026. * cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName
  24027. *
  24028. * return cloned;
  24029. * }
  24030. * });
  24031. *
  24032. *
  24033. * Ext.define('My.SnowLeopard', {
  24034. * extend: 'My.Cat',
  24035. *
  24036. * statics: {
  24037. * speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'
  24038. * },
  24039. *
  24040. * constructor: function() {
  24041. * this.callParent();
  24042. * }
  24043. * });
  24044. *
  24045. * var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat'
  24046. *
  24047. * var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'
  24048. *
  24049. * var clone = snowLeopard.clone();
  24050. * alert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'
  24051. * alert(clone.groupName); // alerts 'Cat'
  24052. *
  24053. * alert(My.Cat.totalCreated); // alerts 3
  24054. *
  24055. * @protected
  24056. * @return {Ext.Class}
  24057. */
  24058. statics: function() {
  24059. var method = this.statics.caller,
  24060. self = this.self;
  24061. if (!method) {
  24062. return self;
  24063. }
  24064. return method.$owner;
  24065. },
  24066. /**
  24067. * Call the "parent" method of the current method. That is the method previously
  24068. * overridden by derivation or by an override (see {@link Ext#define}).
  24069. *
  24070. * Ext.define('My.Base', {
  24071. * constructor: function (x) {
  24072. * this.x = x;
  24073. * },
  24074. *
  24075. * statics: {
  24076. * method: function (x) {
  24077. * return x;
  24078. * }
  24079. * }
  24080. * });
  24081. *
  24082. * Ext.define('My.Derived', {
  24083. * extend: 'My.Base',
  24084. *
  24085. * constructor: function () {
  24086. * this.callParent([21]);
  24087. * }
  24088. * });
  24089. *
  24090. * var obj = new My.Derived();
  24091. *
  24092. * alert(obj.x); // alerts 21
  24093. *
  24094. * This can be used with an override as follows:
  24095. *
  24096. * Ext.define('My.DerivedOverride', {
  24097. * override: 'My.Derived',
  24098. *
  24099. * constructor: function (x) {
  24100. * this.callParent([x*2]); // calls original My.Derived constructor
  24101. * }
  24102. * });
  24103. *
  24104. * var obj = new My.Derived();
  24105. *
  24106. * alert(obj.x); // now alerts 42
  24107. *
  24108. * This also works with static and private methods.
  24109. *
  24110. * Ext.define('My.Derived2', {
  24111. * extend: 'My.Base',
  24112. *
  24113. * // privates: {
  24114. * statics: {
  24115. * method: function (x) {
  24116. * return this.callParent([x*2]); // calls My.Base.method
  24117. * }
  24118. * }
  24119. * });
  24120. *
  24121. * alert(My.Base.method(10)); // alerts 10
  24122. * alert(My.Derived2.method(10)); // alerts 20
  24123. *
  24124. * Lastly, it also works with overridden static methods.
  24125. *
  24126. * Ext.define('My.Derived2Override', {
  24127. * override: 'My.Derived2',
  24128. *
  24129. * // privates: {
  24130. * statics: {
  24131. * method: function (x) {
  24132. * return this.callParent([x*2]); // calls My.Derived2.method
  24133. * }
  24134. * }
  24135. * });
  24136. *
  24137. * alert(My.Derived2.method(10); // now alerts 40
  24138. *
  24139. * To override a method and replace it and also call the superclass method, use
  24140. * {@link #method-callSuper}. This is often done to patch a method to fix a bug.
  24141. *
  24142. * @protected
  24143. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  24144. * from the current method, for example: `this.callParent(arguments)`
  24145. * @return {Object} Returns the result of calling the parent method
  24146. */
  24147. callParent: function(args) {
  24148. // NOTE: this code is deliberately as few expressions (and no function calls)
  24149. // as possible so that a debugger can skip over this noise with the minimum number
  24150. // of steps. Basically, just hit Step Into until you are where you really wanted
  24151. // to be.
  24152. var method,
  24153. superMethod = (method = this.callParent.caller) && (method.$previous || ((method = method.$owner ? method : method.caller) && method.$owner.superclass[method.$name]));
  24154. if (!superMethod) {
  24155. method = this.callParent.caller;
  24156. var parentClass, methodName;
  24157. if (!method.$owner) {
  24158. if (!method.caller) {
  24159. throw new Error("Attempting to call a protected method from the public scope, which is not allowed");
  24160. }
  24161. method = method.caller;
  24162. }
  24163. parentClass = method.$owner.superclass;
  24164. methodName = method.$name;
  24165. if (!(methodName in parentClass)) {
  24166. throw new Error("this.callParent() was called but there's no such method (" + methodName + ") found in the parent class (" + (Ext.getClassName(parentClass) || 'Object') + ")");
  24167. }
  24168. }
  24169. return superMethod.apply(this, args || noArgs);
  24170. },
  24171. /**
  24172. * This method is used by an **override** to call the superclass method but
  24173. * bypass any overridden method. This is often done to "patch" a method that
  24174. * contains a bug but for whatever reason cannot be fixed directly.
  24175. *
  24176. * Consider:
  24177. *
  24178. * Ext.define('Ext.some.Class', {
  24179. * method: function () {
  24180. * console.log('Good');
  24181. * }
  24182. * });
  24183. *
  24184. * Ext.define('Ext.some.DerivedClass', {
  24185. * extend: 'Ext.some.Class',
  24186. *
  24187. * method: function () {
  24188. * console.log('Bad');
  24189. *
  24190. * // ... logic but with a bug ...
  24191. *
  24192. * this.callParent();
  24193. * }
  24194. * });
  24195. *
  24196. * To patch the bug in `Ext.some.DerivedClass.method`, the typical solution is to create an
  24197. * override:
  24198. *
  24199. * Ext.define('App.patches.DerivedClass', {
  24200. * override: 'Ext.some.DerivedClass',
  24201. *
  24202. * method: function () {
  24203. * console.log('Fixed');
  24204. *
  24205. * // ... logic but with bug fixed ...
  24206. *
  24207. * this.callSuper();
  24208. * }
  24209. * });
  24210. *
  24211. * The patch method cannot use {@link #method-callParent} to call the superclass
  24212. * `method` since that would call the overridden method containing the bug. In
  24213. * other words, the above patch would only produce "Fixed" then "Good" in the
  24214. * console log, whereas, using `callParent` would produce "Fixed" then "Bad"
  24215. * then "Good".
  24216. *
  24217. * @protected
  24218. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  24219. * from the current method, for example: `this.callSuper(arguments)`
  24220. * @return {Object} Returns the result of calling the superclass method
  24221. */
  24222. callSuper: function(args) {
  24223. // NOTE: this code is deliberately as few expressions (and no function calls)
  24224. // as possible so that a debugger can skip over this noise with the minimum number
  24225. // of steps. Basically, just hit Step Into until you are where you really wanted
  24226. // to be.
  24227. var method,
  24228. superMethod = (method = this.callSuper.caller) && ((method = method.$owner ? method : method.caller) && method.$owner.superclass[method.$name]);
  24229. if (!superMethod) {
  24230. method = this.callSuper.caller;
  24231. var parentClass, methodName;
  24232. if (!method.$owner) {
  24233. if (!method.caller) {
  24234. throw new Error("Attempting to call a protected method from the public scope, which is not allowed");
  24235. }
  24236. method = method.caller;
  24237. }
  24238. parentClass = method.$owner.superclass;
  24239. methodName = method.$name;
  24240. if (!(methodName in parentClass)) {
  24241. throw new Error("this.callSuper() was called but there's no such method (" + methodName + ") found in the parent class (" + (Ext.getClassName(parentClass) || 'Object') + ")");
  24242. }
  24243. }
  24244. return superMethod.apply(this, args || noArgs);
  24245. },
  24246. /**
  24247. * @property {Ext.Class} self
  24248. *
  24249. * Get the reference to the current class from which this object was instantiated. Unlike {@link Ext.Base#statics},
  24250. * `this.self` is scope-dependent and it's meant to be used for dynamic inheritance. See {@link Ext.Base#statics}
  24251. * for a detailed comparison
  24252. *
  24253. * Ext.define('My.Cat', {
  24254. * statics: {
  24255. * speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
  24256. * },
  24257. *
  24258. * constructor: function() {
  24259. * alert(this.self.speciesName); // dependent on 'this'
  24260. * },
  24261. *
  24262. * clone: function() {
  24263. * return new this.self();
  24264. * }
  24265. * });
  24266. *
  24267. *
  24268. * Ext.define('My.SnowLeopard', {
  24269. * extend: 'My.Cat',
  24270. * statics: {
  24271. * speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'
  24272. * }
  24273. * });
  24274. *
  24275. * var cat = new My.Cat(); // alerts 'Cat'
  24276. * var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard'
  24277. *
  24278. * var clone = snowLeopard.clone();
  24279. * alert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'
  24280. *
  24281. * @protected
  24282. */
  24283. self: Base,
  24284. // Default constructor, simply returns `this`
  24285. constructor: function() {
  24286. return this;
  24287. },
  24288. /**
  24289. * Initialize configuration for this class. a typical example:
  24290. *
  24291. * Ext.define('My.awesome.Class', {
  24292. * // The default config
  24293. * config: {
  24294. * name: 'Awesome',
  24295. * isAwesome: true
  24296. * },
  24297. *
  24298. * constructor: function(config) {
  24299. * this.initConfig(config);
  24300. * }
  24301. * });
  24302. *
  24303. * var awesome = new My.awesome.Class({
  24304. * name: 'Super Awesome'
  24305. * });
  24306. *
  24307. * alert(awesome.getName()); // 'Super Awesome'
  24308. *
  24309. * @protected
  24310. * @param {Object} instanceConfig
  24311. * @return {Ext.Base} this
  24312. * @chainable
  24313. */
  24314. initConfig: function(instanceConfig) {
  24315. var me = this,
  24316. cfg = me.self.getConfigurator();
  24317. me.initConfig = Ext.emptyFn;
  24318. // ignore subsequent calls to initConfig
  24319. me.initialConfig = instanceConfig || {};
  24320. cfg.configure(me, instanceConfig);
  24321. return me;
  24322. },
  24323. beforeInitConfig: Ext.emptyFn,
  24324. /**
  24325. * Returns a specified config property value. If the name parameter is not passed,
  24326. * all current configuration options will be returned as key value pairs.
  24327. * @param {String} [name] The name of the config property to get.
  24328. * @param {Boolean} [peek=false] `true` to peek at the raw value without calling the getter.
  24329. * @param {Boolean} [ifInitialized=false] `true` to only return the initialized property value,
  24330. * not the raw config value, and *not* to trigger initialization. Returns `undefined` if the
  24331. * property has not yet been initialized.
  24332. * @return {Object} The config property value.
  24333. */
  24334. getConfig: function(name, peek, ifInitialized) {
  24335. var me = this,
  24336. ret, cfg, propName;
  24337. if (name) {
  24338. cfg = me.self.$config.configs[name];
  24339. if (cfg) {
  24340. propName = me.$configPrefixed ? cfg.names.internal : name;
  24341. // They only want the fully initialized value, not the initial config,
  24342. // but only if it's already present on this instance.
  24343. // They don't want to trigger the initGetter.
  24344. // This form is used by Bindable#updatePublishes to initially publish
  24345. // the properties it's being asked make publishable.
  24346. if (ifInitialized) {
  24347. ret = me.hasOwnProperty(propName) ? me[propName] : null;
  24348. } else if (peek) {
  24349. // Attempt to return the instantiated property on this instance first.
  24350. // Only return the config object if it has not yet been pulled through
  24351. // the applier into the instance.
  24352. ret = me.hasOwnProperty(propName) ? me[propName] : me.config[name];
  24353. } else {
  24354. ret = me[cfg.names.get]();
  24355. }
  24356. } else {
  24357. ret = me[name];
  24358. }
  24359. } else {
  24360. ret = me.getCurrentConfig();
  24361. }
  24362. return ret;
  24363. },
  24364. /**
  24365. * Destroys member properties by name.
  24366. *
  24367. * If a property name is the name of a *config*, the getter is *not* invoked, so
  24368. * if the config has not been initialized, nothing will be done.
  24369. *
  24370. * The property will be destroyed, and the corrected name (if the property is a *config*
  24371. * and config names are prefixed) will set to `null` in this object's dictionary.
  24372. *
  24373. * @param {String...} args One or more names of the properties to destroy and remove from the object.
  24374. */
  24375. destroyMembers: function() {
  24376. var me = this,
  24377. configs = me.self.$config.configs,
  24378. len = arguments.length,
  24379. cfg, name, value, i;
  24380. for (i = 0; i < len; i++) {
  24381. name = arguments[i];
  24382. cfg = configs[name];
  24383. name = cfg && me.$configPrefixed ? cfg.names.internal : name;
  24384. value = me.hasOwnProperty(name) && me[name];
  24385. if (value) {
  24386. Ext.destroy(value);
  24387. me[name] = null;
  24388. }
  24389. }
  24390. },
  24391. freezeConfig: function(name) {
  24392. var me = this,
  24393. config = Ext.Config.get(name),
  24394. names = config.names,
  24395. value = me[names.get]();
  24396. me[names.set] = function(v) {
  24397. if (v !== value) {
  24398. Ext.raise('Cannot change frozen config "' + name + '"');
  24399. }
  24400. return me;
  24401. };
  24402. if (!Ext.isIE8) {
  24403. Object.defineProperty(me, me.$configPrefixed ? names.internal : name, {
  24404. get: function() {
  24405. return value;
  24406. },
  24407. set: function(v) {
  24408. if (v !== value) {
  24409. Ext.raise('Cannot change frozen config "' + name + '"');
  24410. }
  24411. }
  24412. });
  24413. }
  24414. },
  24415. /**
  24416. * Sets a single/multiple configuration options.
  24417. * @param {String/Object} name The name of the property to set, or a set of key value pairs to set.
  24418. * @param {Object} [value] The value to set for the name parameter.
  24419. * @param {Object} [options] (private)
  24420. * @return {Ext.Base} this
  24421. */
  24422. setConfig: function(name, value, options) {
  24423. // options can have the following properties:
  24424. // - defaults `true` to only set the config(s) that have not been already set on
  24425. // this instance.
  24426. // - strict `false` to apply properties to the instance that are not configs,
  24427. // and do not have setters.
  24428. var me = this,
  24429. configurator, config, prop;
  24430. if (name) {
  24431. configurator = me.self.getConfigurator();
  24432. if (typeof name === 'string') {
  24433. config = configurator.configs[name];
  24434. if (!config) {
  24435. if (me.$configStrict) {
  24436. prop = me.self.prototype[name];
  24437. if ((typeof prop === 'function') && !prop.$nullFn) {
  24438. Ext.Error.raise("Cannot override method " + name + " on " + me.$className + " instance.");
  24439. return me;
  24440. } else {
  24441. if (name !== 'type') {
  24442. Ext.log.warn('No such config "' + name + '" for class ' + me.$className);
  24443. }
  24444. }
  24445. }
  24446. config = Ext.Config.map[name] || Ext.Config.get(name);
  24447. }
  24448. if (me[config.names.set]) {
  24449. me[config.names.set](value);
  24450. } else {
  24451. // apply non-config props directly to the instance
  24452. me[name] = value;
  24453. }
  24454. } else {
  24455. // This should not have "options ||" except that it shipped in that
  24456. // broken state, so we use it if present for compat.
  24457. configurator.reconfigure(me, name, options || value);
  24458. }
  24459. }
  24460. return me;
  24461. },
  24462. /**
  24463. * @private
  24464. */
  24465. getCurrentConfig: function() {
  24466. var cfg = this.self.getConfigurator();
  24467. return cfg.getCurrentConfig(this);
  24468. },
  24469. /**
  24470. * @param {String} name
  24471. * @private
  24472. */
  24473. hasConfig: function(name) {
  24474. return name in this.defaultConfig;
  24475. },
  24476. /**
  24477. * Returns the initial configuration passed to the constructor when
  24478. * instantiating this class.
  24479. *
  24480. * Given this example Ext.button.Button definition and instance:
  24481. *
  24482. * Ext.define('MyApp.view.Button', {
  24483. * extend: 'Ext.button.Button',
  24484. * xtype: 'mybutton',
  24485. *
  24486. * scale: 'large',
  24487. * enableToggle: true
  24488. * });
  24489. *
  24490. * var btn = Ext.create({
  24491. * xtype: 'mybutton',
  24492. * renderTo: Ext.getBody(),
  24493. * text: 'Test Button'
  24494. * });
  24495. *
  24496. * Calling `btn.getInitialConfig()` would return an object including the config
  24497. * options passed to the `create` method:
  24498. *
  24499. * xtype: 'mybutton',
  24500. * renderTo: // The document body itself
  24501. * text: 'Test Button'
  24502. *
  24503. * Calling `btn.getInitialConfig('text')`returns **'Test Button'**.
  24504. *
  24505. * @param {String} [name] Name of the config option to return.
  24506. * @return {Object/Mixed} The full config object or a single config value
  24507. * when `name` parameter specified.
  24508. */
  24509. getInitialConfig: function(name) {
  24510. var config = this.config;
  24511. if (!name) {
  24512. return config;
  24513. }
  24514. return config[name];
  24515. },
  24516. $links: null,
  24517. /**
  24518. * Adds a "destroyable" object to an internal list of objects that will be destroyed
  24519. * when this instance is destroyed (via `{@link #method!destroy}`).
  24520. * @param {String} name
  24521. * @param {Object} value
  24522. * @return {Object} The `value` passed.
  24523. * @private
  24524. */
  24525. link: function(name, value) {
  24526. var me = this,
  24527. links = me.$links || (me.$links = {});
  24528. links[name] = true;
  24529. me[name] = value;
  24530. return value;
  24531. },
  24532. /**
  24533. * Destroys a given set of `{@link #link linked}` objects. This is only needed if
  24534. * the linked object is being destroyed before this instance.
  24535. * @param {String[]} names The names of the linked objects to destroy.
  24536. * @return {Ext.Base} this
  24537. * @private
  24538. */
  24539. unlink: function(names) {
  24540. var me = this,
  24541. i, ln, link, value;
  24542. if (!Ext.isArray(names)) {
  24543. Ext.raise('Invalid argument - expected array of strings');
  24544. }
  24545. for (i = 0 , ln = names.length; i < ln; i++) {
  24546. link = names[i];
  24547. value = me[link];
  24548. if (value) {
  24549. if (value.isInstance && !value.destroyed) {
  24550. value.destroy();
  24551. } else if (value.parentNode && 'nodeType' in value) {
  24552. value.parentNode.removeChild(value);
  24553. }
  24554. }
  24555. me[link] = null;
  24556. }
  24557. return me;
  24558. },
  24559. $reap: function() {
  24560. var me = this,
  24561. protectedProps = me.$noClearOnDestroy,
  24562. props, prop, value, type, i, len;
  24563. // This only returns own keys which is *much* faster than iterating
  24564. // over the whole prototype chain and calling hasOwnProperty()
  24565. props = Ext.Object.getKeys(me);
  24566. for (i = 0 , len = props.length; i < len; i++) {
  24567. prop = props[i];
  24568. if (!protectedProps || !protectedProps[prop]) {
  24569. value = me[prop];
  24570. type = typeof value;
  24571. // Object may retain references to other objects. Functions can do too
  24572. // if they are closures, and most of the *own* function properties
  24573. // are closures indeed. We skip Ext.emptyFn and the like though,
  24574. // they're mostly harmless.
  24575. if (type === 'object' || (type === 'function' && !value.$noClearOnDestroy)) {
  24576. me[prop] = null;
  24577. }
  24578. }
  24579. }
  24580. me.$nulled = true;
  24581. // We also want to make sure no methods are called on the destroyed object,
  24582. // because that may lead to accessing nulled properties and resulting exceptions.
  24583. if (Object.setPrototypeOf) {
  24584. if (me.clearPrototypeOnDestroy && !me.$vetoClearingPrototypeOnDestroy) {
  24585. props = me.$preservePrototypeProperties;
  24586. if (props) {
  24587. for (i = 0 , len = props.length; i < len; i++) {
  24588. prop = props[i];
  24589. if (!me.hasOwnProperty(prop)) {
  24590. me[prop] = me[prop];
  24591. }
  24592. }
  24593. }
  24594. Object.setPrototypeOf(me, null);
  24595. }
  24596. }
  24597. },
  24598. /**
  24599. * This method is called to cleanup an object and its resources. After calling
  24600. * this method, the object should not be used any further in any way, including
  24601. * access to its methods and properties.
  24602. *
  24603. * To prevent potential memory leaks, all object references will be nulled
  24604. * at the end of destruction sequence, unless {@link #clearPropertiesOnDestroy}
  24605. * is set to `false`.
  24606. */
  24607. destroy: function() {
  24608. var me = this,
  24609. links = me.$links,
  24610. clearPropertiesOnDestroy = me.clearPropertiesOnDestroy;
  24611. if (links) {
  24612. me.$links = null;
  24613. me.unlink(Ext.Object.getKeys(links));
  24614. }
  24615. me.destroy = Ext.emptyFn;
  24616. // isDestroyed added for compat reasons
  24617. me.isDestroyed = me.destroyed = true;
  24618. // By this time the destruction is complete. Now we can make sure
  24619. // no objects are retained by the husk of this ex-Instance.
  24620. if (clearPropertiesOnDestroy === true) {
  24621. // Observable mixin will call destroyObservable that will reap the properties.
  24622. if (!me.isObservable) {
  24623. me.$reap();
  24624. }
  24625. } else if (clearPropertiesOnDestroy) {
  24626. if (clearPropertiesOnDestroy !== 'async') {
  24627. Ext.raise('Invalid value for clearPropertiesOnDestroy');
  24628. }
  24629. Reaper.add(me);
  24630. }
  24631. }
  24632. });
  24633. /**
  24634. * @method callOverridden
  24635. * Call the original method that was previously overridden with {@link Ext.Base#override}
  24636. *
  24637. * Ext.define('My.Cat', {
  24638. * constructor: function() {
  24639. * alert("I'm a cat!");
  24640. * }
  24641. * });
  24642. *
  24643. * My.Cat.override({
  24644. * constructor: function() {
  24645. * alert("I'm going to be a cat!");
  24646. *
  24647. * this.callOverridden();
  24648. *
  24649. * alert("Meeeeoooowwww");
  24650. * }
  24651. * });
  24652. *
  24653. * var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
  24654. * // alerts "I'm a cat!"
  24655. * // alerts "Meeeeoooowwww"
  24656. *
  24657. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  24658. * from the current method, for example: `this.callOverridden(arguments)`
  24659. * @return {Object} Returns the result of calling the overridden method
  24660. * @deprecated 4.1.0 Use {@link #method-callParent} instead.
  24661. * @protected
  24662. */
  24663. BasePrototype.callOverridden = BasePrototype.callParent;
  24664. Ext.privacyViolation = function(cls, existing, member, isStatic) {
  24665. var name = member.$name,
  24666. conflictCls = existing.$owner && existing.$owner.$className,
  24667. s = isStatic ? 'static ' : '',
  24668. msg = member.$privacy ? 'Private ' + s + member.$privacy + ' method "' + name + '"' : 'Public ' + s + 'method "' + name + '"';
  24669. if (cls.$className) {
  24670. msg = cls.$className + ': ' + msg;
  24671. }
  24672. if (!existing.$privacy) {
  24673. msg += conflictCls ? ' hides public method inherited from ' + conflictCls : ' hides inherited public method.';
  24674. } else {
  24675. msg += conflictCls ? ' conflicts with private ' + existing.$privacy + ' method declared by ' + conflictCls : ' conflicts with inherited private ' + existing.$privacy + ' method.';
  24676. }
  24677. var compat = Ext.getCompatVersion();
  24678. var ver = Ext.getVersion();
  24679. // When compatibility is enabled, log problems instead of throwing errors.
  24680. if (ver && compat && compat.lt(ver)) {
  24681. Ext.log.error(msg);
  24682. } else {
  24683. Ext.raise(msg);
  24684. }
  24685. };
  24686. Ext.Reaper.tick.$skipTimerCheck = true;
  24687. return Base;
  24688. }(Ext.Function.flexSetter));
  24689. /**
  24690. * This class manages a double-linked list. It provides an absolutely minimal container
  24691. * interface.
  24692. *
  24693. * @class Ext.util.LRU
  24694. * @private
  24695. * @since 6.5.0
  24696. */
  24697. (function(LRU, prototype) {
  24698. // @define Ext.util.LRU
  24699. // NOTE: We have to implement this class old-school because it is used by the
  24700. // platformConfig class processor (so Ext.define is not yet ready for action).
  24701. (Ext.util || (Ext.util = {})).LRU = LRU = function(config) {
  24702. var me = this,
  24703. head;
  24704. if (config) {
  24705. Ext.apply(me, config);
  24706. }
  24707. // Give all entries the same object shape.
  24708. me.head = head = {
  24709. id: (me.seed = 0),
  24710. key: null,
  24711. value: null
  24712. };
  24713. /**
  24714. * @property {Object} map
  24715. * The items in the list indexed by their `key`.
  24716. * @readonly
  24717. */
  24718. me.map = {};
  24719. head.next = head.prev = head;
  24720. };
  24721. LRU.prototype = prototype = {
  24722. /**
  24723. * @property {Number} count
  24724. * The number of items in this list.
  24725. * @readonly
  24726. */
  24727. count: 0,
  24728. /**
  24729. * Adds an item to the list with the specified `key`. Items are added at the
  24730. * front (MRU) of the list.
  24731. * @param {String} key
  24732. * @param {Object} value
  24733. */
  24734. add: function(key, value) {
  24735. var me = this,
  24736. map = me.map,
  24737. entry = map[key];
  24738. if (entry) {
  24739. me.unlink(entry);
  24740. --me.count;
  24741. }
  24742. map[key] = entry = {
  24743. id: ++me.seed,
  24744. key: key,
  24745. value: value
  24746. };
  24747. me.link(entry);
  24748. ++me.count;
  24749. return entry;
  24750. },
  24751. /**
  24752. * Removes all items from this list optionally calling a function for each
  24753. * remove item.
  24754. * @param {Function} [fn] A function to call for each removed item.
  24755. * @param {Object} fn.key The key of the removed item.
  24756. * @param {Object} fn.value The removed item.
  24757. * @param {Object} [scope] The `this` pointer for `fn`.
  24758. */
  24759. clear: function(fn, scope) {
  24760. var me = this,
  24761. head = me.head,
  24762. entry = head.next;
  24763. head.next = head.prev = head;
  24764. me.count = 0;
  24765. if (fn && !fn.$nullFn) {
  24766. for (; entry !== head; entry = entry.next) {
  24767. fn.call(scope || me, entry.key, entry.value);
  24768. }
  24769. }
  24770. },
  24771. /**
  24772. * Calls the given function `fn` for each item in the list. The items will be
  24773. * passed to `fn` from most-to-least recently added or touched.
  24774. * @param {Function} fn The function to call for each cache item.
  24775. * @param {String} fn.key The key for the item.
  24776. * @param {Object} fn.value The item.
  24777. * @param {Object} [scope] The `this` pointer to use for `fn`.
  24778. */
  24779. each: function(fn, scope) {
  24780. scope = scope || this;
  24781. for (var head = this.head,
  24782. ent = head.next; ent !== head; ent = ent.next) {
  24783. if (fn.call(scope, ent.key, ent.value)) {
  24784. break;
  24785. }
  24786. }
  24787. },
  24788. /**
  24789. * Removes the item at the end (LRU) of the list. Optionally the item can be passed
  24790. * to a callback function. If the list is empty, no callback is made and this
  24791. * method will return `undefined`.
  24792. * @param {Function} fn The function to call for the removed item.
  24793. * @param {Object} fn.key The key of the removed item.
  24794. * @param {Object} fn.value The removed item.
  24795. * @param {Object} [scope] The `this` pointer to use for `fn`.
  24796. * @return {Object} The removed item.
  24797. */
  24798. prune: function(fn, scope) {
  24799. var me = this,
  24800. entry = me.head.prev,
  24801. ret;
  24802. if (me.count) {
  24803. ret = entry.value;
  24804. me.unlink(entry);
  24805. --me.count;
  24806. if (fn) {
  24807. fn.call(scope || me, entry.key, ret);
  24808. }
  24809. }
  24810. return ret;
  24811. },
  24812. /**
  24813. * Removes an item from the list given its key.
  24814. * @param {String} key The key of the item to remove.
  24815. * @return {Object} The removed item or `undefined` if the key was not found.
  24816. */
  24817. remove: function(key) {
  24818. var me = this,
  24819. map = me.map,
  24820. entry = map[key],
  24821. value;
  24822. if (entry) {
  24823. me.unlink(entry);
  24824. value = entry.value;
  24825. delete map[key];
  24826. --me.count;
  24827. }
  24828. return value;
  24829. },
  24830. /**
  24831. * Moves the item with the given key to the front (MRU) of the list.
  24832. * @param {String} key The key of the item to move to the front.
  24833. */
  24834. touch: function(key) {
  24835. var me = this,
  24836. head = me.head,
  24837. entry = me.map[key];
  24838. if (entry && entry.prev !== head) {
  24839. // The entry is not at the front, so remove it and insert it at the front
  24840. // (to make it the MRU - Most Recently Used).
  24841. me.unlink(entry);
  24842. me.link(entry);
  24843. }
  24844. },
  24845. /**
  24846. * Reduces the length of the list to be no more than the specified `size`, removing
  24847. * items from the end of the list as necessary. Optionally each removed item can
  24848. * be passed to a callback `fn`.
  24849. * @param {Number} size The number of items in the list
  24850. * @param {Function} [fn] A function to call for each removed item.
  24851. * @param {Object} fn.key The key of the removed item.
  24852. * @param {Object} fn.value The removed item.
  24853. * @param {Object} [scope] The `this` pointer for `fn`.
  24854. */
  24855. trim: function(size, fn, scope) {
  24856. while (this.count > size) {
  24857. this.prune(fn, scope);
  24858. }
  24859. },
  24860. //-------------------------------------------------------------------------
  24861. // Internals
  24862. /**
  24863. * Inserts the given entry at the front (MRU) end of the entry list.
  24864. * @param {Object} entry The cache item entry.
  24865. * @private
  24866. */
  24867. link: function(entry) {
  24868. var head = this.head,
  24869. first = head.next;
  24870. entry.next = first;
  24871. entry.prev = head;
  24872. head.next = entry;
  24873. first.prev = entry;
  24874. },
  24875. /**
  24876. * Removes the given entry from the entry list.
  24877. * @param {Object} entry The cache item entry.
  24878. * @private
  24879. */
  24880. unlink: function(entry) {
  24881. var next = entry.next,
  24882. prev = entry.prev;
  24883. prev.next = next;
  24884. next.prev = prev;
  24885. }
  24886. };
  24887. prototype.destroy = function() {
  24888. this.clear.apply(this, arguments);
  24889. };
  24890. }());
  24891. /**
  24892. * This class is used to manage simple, LRU caches. It provides an absolutely minimal
  24893. * container interface. It is created like this:
  24894. *
  24895. * this.itemCache = new Ext.util.Cache({
  24896. * miss: function (key) {
  24897. * return new CacheItem(key);
  24898. * }
  24899. * });
  24900. *
  24901. * The `{@link #miss}` abstract method must be implemented by either a derived class or
  24902. * at the instance level as shown above.
  24903. *
  24904. * Once the cache exists and it can handle cache misses, the cache is used like so:
  24905. *
  24906. * var item = this.itemCache.get(key);
  24907. *
  24908. * The `key` is some value that uniquely identifies the cached item.
  24909. *
  24910. * In some cases, creating the cache item may require more than just the lookup key. In
  24911. * that case, any extra arguments passed to `get` will be passed to `miss`.
  24912. *
  24913. * this.otherCache = new Ext.util.Cache({
  24914. * miss: function (key, extra) {
  24915. * return new CacheItem(key, extra);
  24916. * }
  24917. * });
  24918. *
  24919. * var item = this.otherCache.get(key, extra);
  24920. *
  24921. * To process items as they are removed, you can provide an `{@link #evict}` method. The
  24922. * stock method is `Ext.emptyFn` and so does nothing.
  24923. *
  24924. * For example:
  24925. *
  24926. * this.itemCache = new Ext.util.Cache({
  24927. * miss: function (key) {
  24928. * return new CacheItem(key);
  24929. * },
  24930. *
  24931. * evict: function (key, cacheItem) {
  24932. * cacheItem.destroy();
  24933. * }
  24934. * });
  24935. *
  24936. * @class Ext.util.Cache
  24937. * @private
  24938. * @since 5.1.0
  24939. */
  24940. (function(LRU, fn, Cache) {
  24941. // @require Ext.util.LRU
  24942. // @define Ext.util.Cache
  24943. // NOTE: We have to implement this class old-school because it is used by the
  24944. // platformConfig class processor (so Ext.define is not yet ready for action).
  24945. Ext.util.Cache = Cache = function(config) {
  24946. LRU.call(this, config);
  24947. };
  24948. fn.prototype = LRU.prototype;
  24949. Cache.prototype = Ext.apply(new fn(), {
  24950. /**
  24951. * @cfg {Number} maxSize The maximum size the cache is allowed to grow to before
  24952. * further additions cause removal of the least recently used entry.
  24953. */
  24954. maxSize: 100,
  24955. /**
  24956. * This method is called by `{@link #get}` when the key is not found in the cache.
  24957. * The implementation of this method should create the (expensive) value and return
  24958. * it. Whatever arguments were passed to `{@link #get}` will be passed on to this
  24959. * method.
  24960. *
  24961. * @param {String} key The cache lookup key for the item.
  24962. * @param {Object...} args Any other arguments originally passed to `{@link #get}`.
  24963. * @method miss
  24964. * @abstract
  24965. * @protected
  24966. */
  24967. /**
  24968. * Removes all items from this cache.
  24969. */
  24970. clear: function() {
  24971. LRU.prototype.clear.call(this, this.evict);
  24972. },
  24973. /**
  24974. * Finds an item in this cache and returns its value. If the item is present, it is
  24975. * shuffled into the MRU (most-recently-used) position as necessary. If the item is
  24976. * missing, the `{@link #miss}` method is called to create the item.
  24977. *
  24978. * @param {String} key The cache key of the item.
  24979. * @param {Object...} args Arguments for the `miss` method should it be needed.
  24980. * @return {Object} The cached object.
  24981. */
  24982. get: function(key) {
  24983. var me = this,
  24984. entry = me.map[key],
  24985. value;
  24986. if (entry) {
  24987. value = entry.value;
  24988. me.touch(key);
  24989. } else {
  24990. value = me.miss.apply(me, arguments);
  24991. me.add(key, value);
  24992. me.trim(me.maxSize, me.evict);
  24993. }
  24994. return value;
  24995. },
  24996. //-------------------------------------------------------------------------
  24997. // Internals
  24998. /**
  24999. * This method is called internally from `{@link #get}` when the cache is full and
  25000. * the least-recently-used (LRU) item has been removed.
  25001. *
  25002. * @param {String} key The cache lookup key for the item being removed.
  25003. * @param {Object} value The cache value (returned by `{@link #miss}`) for the item
  25004. * being removed.
  25005. * @method evict
  25006. * @template
  25007. * @protected
  25008. */
  25009. evict: Ext.emptyFn
  25010. });
  25011. }(Ext.util.LRU, function() {}));
  25012. /**
  25013. * @class Ext.Class
  25014. *
  25015. * This is a low level factory that is used by {@link Ext#define Ext.define} and should not be used
  25016. * directly in application code.
  25017. *
  25018. * The configs of this class are intended to be used in `Ext.define` calls to describe the class you
  25019. * are declaring. For example:
  25020. *
  25021. * Ext.define('App.util.Thing', {
  25022. * extend: 'App.util.Other',
  25023. *
  25024. * alias: 'util.thing',
  25025. *
  25026. * config: {
  25027. * foo: 42
  25028. * }
  25029. * });
  25030. *
  25031. * Ext.Class is the factory and **not** the superclass of everything. For the base class that **all**
  25032. * classes inherit from, see {@link Ext.Base}.
  25033. */
  25034. (function() {
  25035. // @tag class
  25036. // @define Ext.Class
  25037. // @require Ext.Base
  25038. // @require Ext.Util
  25039. // @require Ext.util.Cache
  25040. var ExtClass,
  25041. Base = Ext.Base,
  25042. baseStaticMembers = Base.$staticMembers,
  25043. ruleKeySortFn = function(a, b) {
  25044. // longest to shortest, by text if names are equal
  25045. return (a.length - b.length) || ((a < b) ? -1 : ((a > b) ? 1 : 0));
  25046. };
  25047. // Creates a constructor that has nothing extra in its scope chain.
  25048. function makeCtor(className) {
  25049. function constructor() {
  25050. // Opera has some problems returning from a constructor when Dragonfly isn't running. The || null seems to
  25051. // be sufficient to stop it misbehaving. Known to be required against 10.53, 11.51 and 11.61.
  25052. return this.constructor.apply(this, arguments) || null;
  25053. }
  25054. if (className) {
  25055. constructor.name = className;
  25056. }
  25057. return constructor;
  25058. }
  25059. /**
  25060. * @method constructor
  25061. * Create a new anonymous class.
  25062. *
  25063. * @param Class
  25064. * @param {Object} data An object represent the properties of this class
  25065. * @param {Function} onCreated Optional, the callback function to be executed when this class is fully created.
  25066. * Note that the creation process can be asynchronous depending on the pre-processors used.
  25067. *
  25068. * @return {Ext.Base} The newly created class
  25069. */
  25070. Ext.Class = ExtClass = function(Class, data, onCreated) {
  25071. if (typeof Class != 'function') {
  25072. onCreated = data;
  25073. data = Class;
  25074. Class = null;
  25075. }
  25076. if (!data) {
  25077. data = {};
  25078. }
  25079. Class = ExtClass.create(Class, data);
  25080. ExtClass.process(Class, data, onCreated);
  25081. return Class;
  25082. };
  25083. Ext.apply(ExtClass, {
  25084. makeCtor: makeCtor,
  25085. /**
  25086. * @private
  25087. */
  25088. onBeforeCreated: function(Class, data, hooks) {
  25089. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, '>> Ext.Class#onBeforeCreated', arguments);
  25090. Class.addMembers(data);
  25091. hooks.onCreated.call(Class, Class);
  25092. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, '<< Ext.Class#onBeforeCreated', arguments);
  25093. },
  25094. /**
  25095. * @private
  25096. */
  25097. create: function(Class, data) {
  25098. var i = baseStaticMembers.length,
  25099. name;
  25100. if (!Class) {
  25101. Class = makeCtor(data.$className);
  25102. }
  25103. while (i--) {
  25104. name = baseStaticMembers[i];
  25105. Class[name] = Base[name];
  25106. }
  25107. return Class;
  25108. },
  25109. /**
  25110. * @private
  25111. */
  25112. process: function(Class, data, onCreated) {
  25113. var preprocessorStack = data.preprocessors || ExtClass.defaultPreprocessors,
  25114. registeredPreprocessors = this.preprocessors,
  25115. hooks = {
  25116. onBeforeCreated: this.onBeforeCreated
  25117. },
  25118. preprocessors = [],
  25119. preprocessor, preprocessorsProperties, i, ln, j, subLn, preprocessorProperty;
  25120. delete data.preprocessors;
  25121. Class._classHooks = hooks;
  25122. for (i = 0 , ln = preprocessorStack.length; i < ln; i++) {
  25123. preprocessor = preprocessorStack[i];
  25124. if (typeof preprocessor == 'string') {
  25125. preprocessor = registeredPreprocessors[preprocessor];
  25126. preprocessorsProperties = preprocessor.properties;
  25127. if (preprocessorsProperties === true) {
  25128. preprocessors.push(preprocessor.fn);
  25129. } else if (preprocessorsProperties) {
  25130. for (j = 0 , subLn = preprocessorsProperties.length; j < subLn; j++) {
  25131. preprocessorProperty = preprocessorsProperties[j];
  25132. if (data.hasOwnProperty(preprocessorProperty)) {
  25133. preprocessors.push(preprocessor.fn);
  25134. break;
  25135. }
  25136. }
  25137. }
  25138. } else {
  25139. preprocessors.push(preprocessor);
  25140. }
  25141. }
  25142. hooks.onCreated = onCreated ? onCreated : Ext.emptyFn;
  25143. hooks.preprocessors = preprocessors;
  25144. this.doProcess(Class, data, hooks);
  25145. },
  25146. doProcess: function(Class, data, hooks) {
  25147. var me = this,
  25148. preprocessors = hooks.preprocessors,
  25149. preprocessor = preprocessors.shift(),
  25150. doProcess = me.doProcess;
  25151. for (; preprocessor; preprocessor = preprocessors.shift()) {
  25152. // Returning false signifies an asynchronous preprocessor - it will call doProcess when we can continue
  25153. if (preprocessor.call(me, Class, data, hooks, doProcess) === false) {
  25154. return;
  25155. }
  25156. }
  25157. hooks.onBeforeCreated.apply(me, arguments);
  25158. },
  25159. /**
  25160. * @private
  25161. * */
  25162. preprocessors: {},
  25163. /**
  25164. * Register a new pre-processor to be used during the class creation process
  25165. *
  25166. * @param {String} name The pre-processor's name
  25167. * @param {Function} fn The callback function to be executed. Typical format:
  25168. *
  25169. * function(cls, data, fn) {
  25170. * // Your code here
  25171. *
  25172. * // Execute this when the processing is finished.
  25173. * // Asynchronous processing is perfectly ok
  25174. * if (fn) {
  25175. * fn.call(this, cls, data);
  25176. * }
  25177. * });
  25178. *
  25179. * @param {Function} fn.cls The created class
  25180. * @param {Object} fn.data The set of properties passed in {@link Ext.Class} constructor
  25181. * @param {Function} fn.fn The callback function that **must** to be executed when this
  25182. * pre-processor finishes, regardless of whether the processing is synchronous or asynchronous.
  25183. * @param properties
  25184. * @param position
  25185. * @param relativeTo
  25186. * @return {Ext.Class} this
  25187. * @private
  25188. * @static
  25189. */
  25190. registerPreprocessor: function(name, fn, properties, position, relativeTo) {
  25191. if (!position) {
  25192. position = 'last';
  25193. }
  25194. if (!properties) {
  25195. properties = [
  25196. name
  25197. ];
  25198. }
  25199. this.preprocessors[name] = {
  25200. name: name,
  25201. properties: properties || false,
  25202. fn: fn
  25203. };
  25204. this.setDefaultPreprocessorPosition(name, position, relativeTo);
  25205. return this;
  25206. },
  25207. /**
  25208. * Retrieve a pre-processor callback function by its name, which has been registered before
  25209. *
  25210. * @param {String} name
  25211. * @return {Function} preprocessor
  25212. * @private
  25213. * @static
  25214. */
  25215. getPreprocessor: function(name) {
  25216. return this.preprocessors[name];
  25217. },
  25218. /**
  25219. * @private
  25220. */
  25221. getPreprocessors: function() {
  25222. return this.preprocessors;
  25223. },
  25224. /**
  25225. * @private
  25226. */
  25227. defaultPreprocessors: [],
  25228. /**
  25229. * Retrieve the array stack of default pre-processors
  25230. * @return {Function[]} defaultPreprocessors
  25231. * @private
  25232. * @static
  25233. */
  25234. getDefaultPreprocessors: function() {
  25235. return this.defaultPreprocessors;
  25236. },
  25237. /**
  25238. * Set the default array stack of default pre-processors
  25239. *
  25240. * @private
  25241. * @param {Array} preprocessors
  25242. * @return {Ext.Class} this
  25243. * @static
  25244. */
  25245. setDefaultPreprocessors: function(preprocessors) {
  25246. this.defaultPreprocessors = Ext.Array.from(preprocessors);
  25247. return this;
  25248. },
  25249. /**
  25250. * Insert this pre-processor at a specific position in the stack, optionally relative to
  25251. * any existing pre-processor. For example:
  25252. *
  25253. * Ext.Class.registerPreprocessor('debug', function(cls, data, fn) {
  25254. * // Your code here
  25255. *
  25256. * if (fn) {
  25257. * fn.call(this, cls, data);
  25258. * }
  25259. * }).setDefaultPreprocessorPosition('debug', 'last');
  25260. *
  25261. * @private
  25262. * @param {String} name The pre-processor name. Note that it needs to be registered with
  25263. * {@link Ext.Class#registerPreprocessor registerPreprocessor} before this
  25264. * @param {String} offset The insertion position. Four possible values are:
  25265. * 'first', 'last', or: 'before', 'after' (relative to the name provided in the third argument)
  25266. * @param {String} relativeName
  25267. * @return {Ext.Class} this
  25268. * @static
  25269. */
  25270. setDefaultPreprocessorPosition: function(name, offset, relativeName) {
  25271. var defaultPreprocessors = this.defaultPreprocessors,
  25272. index;
  25273. if (typeof offset == 'string') {
  25274. if (offset === 'first') {
  25275. defaultPreprocessors.unshift(name);
  25276. return this;
  25277. } else if (offset === 'last') {
  25278. defaultPreprocessors.push(name);
  25279. return this;
  25280. }
  25281. offset = (offset === 'after') ? 1 : -1;
  25282. }
  25283. index = Ext.Array.indexOf(defaultPreprocessors, relativeName);
  25284. if (index !== -1) {
  25285. Ext.Array.splice(defaultPreprocessors, Math.max(0, index + offset), 0, name);
  25286. }
  25287. return this;
  25288. }
  25289. });
  25290. /**
  25291. * @cfg {String} extend
  25292. * The parent class that this class extends. For example:
  25293. *
  25294. * Ext.define('Person', {
  25295. * say: function(text) { alert(text); }
  25296. * });
  25297. *
  25298. * Ext.define('Developer', {
  25299. * extend: 'Person',
  25300. * say: function(text) { this.callParent(["print "+text]); }
  25301. * });
  25302. */
  25303. ExtClass.registerPreprocessor('extend', function(Class, data, hooks) {
  25304. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#extendPreProcessor', arguments);
  25305. var Base = Ext.Base,
  25306. basePrototype = Base.prototype,
  25307. extend = data.extend,
  25308. Parent, parentPrototype, i;
  25309. delete data.extend;
  25310. if (extend && extend !== Object) {
  25311. Parent = extend;
  25312. } else {
  25313. Parent = Base;
  25314. }
  25315. parentPrototype = Parent.prototype;
  25316. if (!Parent.$isClass) {
  25317. for (i in basePrototype) {
  25318. if (!parentPrototype[i]) {
  25319. parentPrototype[i] = basePrototype[i];
  25320. }
  25321. }
  25322. }
  25323. Class.extend(Parent);
  25324. Class.triggerExtended.apply(Class, arguments);
  25325. /**
  25326. * @cfg {Object} eventedConfig
  25327. * Config options defined within `eventedConfig` will auto-generate the setter /
  25328. * getter methods (see {@link #cfg-config config} for more information on
  25329. * auto-generated getter / setter methods). Additionally, when an
  25330. * `eventedConfig` is set it will also fire a before{cfg}change and {cfg}change
  25331. * event when the value of the eventedConfig is changed from its originally
  25332. * defined value.
  25333. *
  25334. * **Note:** When creating a custom class you'll need to extend Ext.Evented
  25335. *
  25336. * Example custom class:
  25337. *
  25338. * Ext.define('MyApp.util.Test', {
  25339. * extend: 'Ext.Evented',
  25340. *
  25341. * eventedConfig: {
  25342. * foo: null
  25343. * }
  25344. * });
  25345. *
  25346. * In this example, the `foo` config will initially be null. Changing it via
  25347. * `setFoo` will fire the `beforefoochange` event. The call to the setter can be
  25348. * halted by returning `false` from a listener on the **before** event.
  25349. *
  25350. * var test = Ext.create('MyApp.util.Test', {
  25351. * listeners: {
  25352. * beforefoochange: function (instance, newValue, oldValue) {
  25353. * return newValue !== 'bar';
  25354. * },
  25355. * foochange: function (instance, newValue, oldValue) {
  25356. * console.log('foo changed to:', newValue);
  25357. * }
  25358. * }
  25359. * });
  25360. *
  25361. * test.setFoo('bar');
  25362. *
  25363. * The `before` event handler can be used to validate changes to `foo`.
  25364. * Returning `false` will prevent the setter from changing the value of the
  25365. * config. In the previous example the `beforefoochange` handler returns false
  25366. * so `foo` will not be updated and `foochange` will not be fired.
  25367. *
  25368. * test.setFoo('baz');
  25369. *
  25370. * Setting `foo` to 'baz' will not be prevented by the `before` handler. Foo
  25371. * will be set to the value: 'baz' and the `foochange` event will be fired.
  25372. */
  25373. if (data.onClassExtended) {
  25374. Class.onExtended(data.onClassExtended, Class);
  25375. delete data.onClassExtended;
  25376. }
  25377. }, true);
  25378. // true to always run this preprocessor even w/o "extend" keyword
  25379. /**
  25380. * @cfg {Object} privates
  25381. * The `privates` config is a list of methods intended to be used internally by the
  25382. * framework. Methods are placed in a `privates` block to prevent developers from
  25383. * accidentally overriding framework methods in custom classes.
  25384. *
  25385. * Ext.define('Computer', {
  25386. * privates: {
  25387. * runFactory: function(brand) {
  25388. * // internal only processing of brand passed to factory
  25389. * this.factory(brand);
  25390. * }
  25391. * },
  25392. *
  25393. * factory: function (brand) {}
  25394. * });
  25395. *
  25396. * In order to override a method from a `privates` block, the overridden method must
  25397. * also be placed in a `privates` block within the override class.
  25398. *
  25399. * Ext.define('Override.Computer', {
  25400. * override: 'Computer',
  25401. * privates: {
  25402. * runFactory: function() {
  25403. * // overriding logic
  25404. * }
  25405. * }
  25406. * });
  25407. */
  25408. ExtClass.registerPreprocessor('privates', function(Class, data) {
  25409. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#privatePreprocessor', arguments);
  25410. var privates = data.privates,
  25411. statics = privates.statics,
  25412. privacy = privates.privacy || true;
  25413. delete data.privates;
  25414. delete privates.statics;
  25415. // We have to add this preprocessor so that private getters/setters are picked up
  25416. // by the config system. This also catches duplication in the public part of the
  25417. // class since it is an error to override a private method with a public one.
  25418. Class.addMembers(privates, false, privacy);
  25419. if (statics) {
  25420. Class.addMembers(statics, true, privacy);
  25421. }
  25422. });
  25423. /**
  25424. * @cfg {Object} statics
  25425. * List of static methods for this class. For example:
  25426. *
  25427. * Ext.define('Computer', {
  25428. * statics: {
  25429. * factory: function(brand) {
  25430. * // 'this' in static methods refer to the class itself
  25431. * return new this(brand);
  25432. * }
  25433. * },
  25434. *
  25435. * constructor: function() { ... }
  25436. * });
  25437. *
  25438. * var dellComputer = Computer.factory('Dell');
  25439. */
  25440. ExtClass.registerPreprocessor('statics', function(Class, data) {
  25441. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#staticsPreprocessor', arguments);
  25442. Class.addStatics(data.statics);
  25443. delete data.statics;
  25444. });
  25445. /**
  25446. * @cfg {Object} inheritableStatics
  25447. * List of inheritable static methods for this class.
  25448. * Otherwise just like {@link #statics} but subclasses inherit these methods.
  25449. */
  25450. ExtClass.registerPreprocessor('inheritableStatics', function(Class, data) {
  25451. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#inheritableStaticsPreprocessor', arguments);
  25452. Class.addInheritableStatics(data.inheritableStatics);
  25453. delete data.inheritableStatics;
  25454. });
  25455. Ext.createRuleFn = function(code) {
  25456. return new Function('$c', 'with($c) { try { return (' + code + '); } catch(e) { return false;}}');
  25457. };
  25458. Ext.expressionCache = new Ext.util.Cache({
  25459. miss: Ext.createRuleFn
  25460. });
  25461. Ext.ruleKeySortFn = ruleKeySortFn;
  25462. Ext.getPlatformConfigKeys = function(platformConfig) {
  25463. var ret = [],
  25464. platform, rule;
  25465. for (platform in platformConfig) {
  25466. rule = Ext.expressionCache.get(platform);
  25467. if (rule(Ext.platformTags)) {
  25468. ret.push(platform);
  25469. }
  25470. }
  25471. ret.sort(ruleKeySortFn);
  25472. return ret;
  25473. };
  25474. /**
  25475. * @cfg {Object} config
  25476. *
  25477. * List of configuration options with their default values.
  25478. *
  25479. * __Note:__ You need to make sure {@link Ext.Base#initConfig} is called from your constructor if you are defining
  25480. * your own class or singleton, unless you are extending a Component. Otherwise the generated getter and setter
  25481. * methods will not be initialized.
  25482. *
  25483. * Each config item will have its own setter and getter method automatically generated inside the class prototype
  25484. * during class creation time, if the class does not have those methods explicitly defined.
  25485. *
  25486. * As an example, let's convert the name property of a Person class to be a config item, then add extra age and
  25487. * gender items.
  25488. *
  25489. * Ext.define('My.sample.Person', {
  25490. * config: {
  25491. * name: 'Mr. Unknown',
  25492. * age: 0,
  25493. * gender: 'Male'
  25494. * },
  25495. *
  25496. * constructor: function(config) {
  25497. * this.initConfig(config);
  25498. *
  25499. * return this;
  25500. * }
  25501. *
  25502. * // ...
  25503. * });
  25504. *
  25505. * Within the class, this.name still has the default value of "Mr. Unknown". However, it's now publicly accessible
  25506. * without sacrificing encapsulation, via setter and getter methods.
  25507. *
  25508. * var jacky = new My.sample.Person({
  25509. * name: "Jacky",
  25510. * age: 35
  25511. * });
  25512. *
  25513. * alert(jacky.getAge()); // alerts 35
  25514. * alert(jacky.getGender()); // alerts "Male"
  25515. *
  25516. * jacky.setName("Mr. Nguyen");
  25517. * alert(jacky.getName()); // alerts "Mr. Nguyen"
  25518. *
  25519. * Notice that we changed the class constructor to invoke this.initConfig() and pass in the provided config object.
  25520. * Two key things happened:
  25521. *
  25522. * - The provided config object when the class is instantiated is recursively merged with the default config object.
  25523. * - All corresponding setter methods are called with the merged values.
  25524. *
  25525. * Beside storing the given values, throughout the frameworks, setters generally have two key responsibilities:
  25526. *
  25527. * - Filtering / validation / transformation of the given value before it's actually stored within the instance.
  25528. * - Notification (such as firing events) / post-processing after the value has been set, or changed from a
  25529. * previous value.
  25530. *
  25531. * By standardize this common pattern, the default generated setters provide two extra template methods that you
  25532. * can put your own custom logic into, i.e: an "applyFoo" and "updateFoo" method for a "foo" config item, which are
  25533. * executed before and after the value is actually set, respectively. Back to the example class, let's validate that
  25534. * age must be a valid positive number, and fire an 'agechange' if the value is modified.
  25535. *
  25536. * Ext.define('My.sample.Person', {
  25537. * config: {
  25538. * // ...
  25539. * },
  25540. *
  25541. * constructor: {
  25542. * // ...
  25543. * },
  25544. *
  25545. * applyAge: function(age) {
  25546. * if (typeof age !== 'number' || age < 0) {
  25547. * console.warn("Invalid age, must be a positive number");
  25548. * return;
  25549. * }
  25550. *
  25551. * return age;
  25552. * },
  25553. *
  25554. * updateAge: function(newAge, oldAge) {
  25555. * // age has changed from "oldAge" to "newAge"
  25556. * this.fireEvent('agechange', this, newAge, oldAge);
  25557. * }
  25558. *
  25559. * // ...
  25560. * });
  25561. *
  25562. * var jacky = new My.sample.Person({
  25563. * name: "Jacky",
  25564. * age: 'invalid'
  25565. * });
  25566. *
  25567. * alert(jacky.getAge()); // alerts 0
  25568. *
  25569. * alert(jacky.setAge(-100)); // alerts 0
  25570. * alert(jacky.getAge()); // alerts 0
  25571. *
  25572. * alert(jacky.setAge(35)); // alerts 0
  25573. * alert(jacky.getAge()); // alerts 35
  25574. *
  25575. * In other words, when leveraging the config feature, you mostly never need to define setter and getter methods
  25576. * explicitly. Instead, "apply*" and "update*" methods should be implemented where necessary. Your code will be
  25577. * consistent throughout and only contain the minimal logic that you actually care about.
  25578. *
  25579. * When it comes to inheritance, the default config of the parent class is automatically, recursively merged with
  25580. * the child's default config. The same applies for mixins.
  25581. */
  25582. ExtClass.registerPreprocessor('config', function(Class, data) {
  25583. // Need to copy to the prototype here because that happens after preprocessors
  25584. if (data.hasOwnProperty('$configPrefixed')) {
  25585. Class.prototype.$configPrefixed = data.$configPrefixed;
  25586. }
  25587. Class.addConfig(data.config);
  25588. // We need to remove this or it will be applied by addMembers and smash the
  25589. // "config" placed on the prototype by Configurator (which includes *all* configs
  25590. // such as cachedConfigs).
  25591. delete data.config;
  25592. });
  25593. /**
  25594. * @cfg {Object} cachedConfig
  25595. *
  25596. * This configuration works in a very similar manner to the {@link #config} option.
  25597. * The difference is that the configurations are only ever processed when the first instance
  25598. * of that class is created. The processed value is then stored on the class prototype and
  25599. * will not be processed on subsequent instances of the class. Getters/setters will be generated
  25600. * in exactly the same way as {@link #config}.
  25601. *
  25602. * This option is useful for expensive objects that can be shared across class instances.
  25603. * The class itself ensures that the creation only occurs once.
  25604. */
  25605. ExtClass.registerPreprocessor('cachedConfig', function(Class, data) {
  25606. // Need to copy to the prototype here because that happens after preprocessors
  25607. if (data.hasOwnProperty('$configPrefixed')) {
  25608. Class.prototype.$configPrefixed = data.$configPrefixed;
  25609. }
  25610. Class.addCachedConfig(data.cachedConfig);
  25611. // Remove this so it won't be placed on the prototype.
  25612. delete data.cachedConfig;
  25613. });
  25614. /**
  25615. * @cfg {String[]/Object} mixins
  25616. * List of classes to mix into this class. For example:
  25617. *
  25618. * Ext.define('CanSing', {
  25619. * sing: function() {
  25620. * alert("For he's a jolly good fellow...")
  25621. * }
  25622. * });
  25623. *
  25624. * Ext.define('Musician', {
  25625. * mixins: ['CanSing']
  25626. * })
  25627. *
  25628. * In this case the Musician class will get a `sing` method from CanSing mixin.
  25629. *
  25630. * But what if the Musician already has a `sing` method? Or you want to mix
  25631. * in two classes, both of which define `sing`? In such a cases it's good
  25632. * to define mixins as an object, where you assign a name to each mixin:
  25633. *
  25634. * Ext.define('Musician', {
  25635. * mixins: {
  25636. * canSing: 'CanSing'
  25637. * },
  25638. *
  25639. * sing: function() {
  25640. * // delegate singing operation to mixin
  25641. * this.mixins.canSing.sing.call(this);
  25642. * }
  25643. * })
  25644. *
  25645. * In this case the `sing` method of Musician will overwrite the
  25646. * mixed in `sing` method. But you can access the original mixed in method
  25647. * through special `mixins` property.
  25648. */
  25649. ExtClass.registerPreprocessor('mixins', function(Class, data, hooks) {
  25650. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#mixinsPreprocessor', arguments);
  25651. var mixins = data.mixins,
  25652. onCreated = hooks.onCreated;
  25653. delete data.mixins;
  25654. hooks.onCreated = function() {
  25655. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#mixinsPreprocessor#beforeCreated', arguments);
  25656. // Put back the original onCreated before processing mixins. This allows a
  25657. // mixin to hook onCreated by access Class._classHooks.
  25658. hooks.onCreated = onCreated;
  25659. Class.mixin(mixins);
  25660. // We must go back to hooks.onCreated here because it may have changed during
  25661. // calls to onClassMixedIn.
  25662. return hooks.onCreated.apply(this, arguments);
  25663. };
  25664. });
  25665. // Backwards compatible
  25666. Ext.extend = function(Class, Parent, members) {
  25667. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#extend-backwards-compatible', arguments);
  25668. if (arguments.length === 2 && Ext.isObject(Parent)) {
  25669. members = Parent;
  25670. Parent = Class;
  25671. Class = null;
  25672. }
  25673. var cls;
  25674. if (!Parent) {
  25675. throw new Error("[Ext.extend] Attempting to extend from a class which has not been loaded on the page.");
  25676. }
  25677. members.extend = Parent;
  25678. members.preprocessors = [
  25679. 'extend',
  25680. 'statics',
  25681. 'inheritableStatics',
  25682. 'mixins',
  25683. 'config'
  25684. ];
  25685. if (Class) {
  25686. cls = new ExtClass(Class, members);
  25687. // The 'constructor' is given as 'Class' but also needs to be on prototype
  25688. cls.prototype.constructor = Class;
  25689. } else {
  25690. cls = new ExtClass(members);
  25691. }
  25692. cls.prototype.override = function(o) {
  25693. for (var m in o) {
  25694. if (o.hasOwnProperty(m)) {
  25695. this[m] = o[m];
  25696. }
  25697. }
  25698. };
  25699. return cls;
  25700. };
  25701. }());
  25702. /**
  25703. * This object contains properties that describe the current device or platform. These
  25704. * values can be used in `{@link Ext.Class#platformConfig platformConfig}` as well as
  25705. * `{@link Ext.mixin.Responsive#responsiveConfig responsiveConfig}` statements.
  25706. *
  25707. * This object can be modified to include tags that are useful for the application. To
  25708. * add custom properties, it is advisable to use a sub-object. For example:
  25709. *
  25710. * Ext.platformTags.app = {
  25711. * mobile: true
  25712. * };
  25713. *
  25714. * @property {Object} platformTags
  25715. * @property {Boolean} platformTags.phone
  25716. * @property {Boolean} platformTags.tablet
  25717. * @property {Boolean} platformTags.desktop
  25718. * @property {Boolean} platformTags.touch Indicates touch inputs are available.
  25719. * @property {Boolean} platformTags.safari
  25720. * @property {Boolean} platformTags.chrome
  25721. * @property {Boolean} platformTags.windows
  25722. * @property {Boolean} platformTags.firefox
  25723. * @property {Boolean} platformTags.ios True for iPad, iPhone and iPod.
  25724. * @property {Boolean} platformTags.android
  25725. * @property {Boolean} platformTags.blackberry
  25726. * @property {Boolean} platformTags.tizen
  25727. * @member Ext
  25728. */
  25729. // @tag class
  25730. /**
  25731. * @class Ext.Inventory
  25732. * @private
  25733. */
  25734. Ext.Inventory = function() {
  25735. // @define Ext.Script
  25736. // @define Ext.Inventory
  25737. // @require Ext.Function
  25738. var me = this;
  25739. me.names = [];
  25740. me.paths = {};
  25741. me.alternateToName = {};
  25742. me.aliasToName = {};
  25743. me.nameToAliases = {};
  25744. me.nameToAlternates = {};
  25745. me.nameToPrefix = {};
  25746. };
  25747. Ext.Inventory.prototype = {
  25748. _array1: [
  25749. 0
  25750. ],
  25751. prefixes: null,
  25752. dotRe: /\./g,
  25753. wildcardRe: /\*/g,
  25754. addAlias: function(className, alias, update) {
  25755. return this.addMapping(className, alias, this.aliasToName, this.nameToAliases, update);
  25756. },
  25757. addAlternate: function(className, alternate) {
  25758. return this.addMapping(className, alternate, this.alternateToName, this.nameToAlternates);
  25759. },
  25760. addMapping: function(className, alternate, toName, nameTo, update) {
  25761. var name = className.$className || className,
  25762. mappings = name,
  25763. array = this._array1,
  25764. a, aliases, cls, i, length, nameMapping;
  25765. if (Ext.isString(name)) {
  25766. mappings = {};
  25767. mappings[name] = alternate;
  25768. }
  25769. for (cls in mappings) {
  25770. aliases = mappings[cls];
  25771. if (Ext.isString(aliases)) {
  25772. array[0] = aliases;
  25773. aliases = array;
  25774. }
  25775. length = aliases.length;
  25776. nameMapping = nameTo[cls] || (nameTo[cls] = []);
  25777. for (i = 0; i < length; ++i) {
  25778. if (!(a = aliases[i])) {
  25779. continue;
  25780. }
  25781. if (toName[a] !== cls) {
  25782. if (!update && toName[a] && ('Ext.Gadget' !== a)) {
  25783. Ext.log.warn("Overriding existing mapping: '" + a + "' From '" + toName[a] + "' to '" + cls + "'. Is this intentional?");
  25784. }
  25785. toName[a] = cls;
  25786. nameMapping.push(a);
  25787. }
  25788. }
  25789. }
  25790. },
  25791. /**
  25792. * Get the aliases of a class by the class name
  25793. *
  25794. * @param {String} name
  25795. * @return {Array} aliases
  25796. */
  25797. getAliasesByName: function(name) {
  25798. return this.nameToAliases[name] || null;
  25799. },
  25800. getAlternatesByName: function(name) {
  25801. return this.nameToAlternates[name] || null;
  25802. },
  25803. /**
  25804. * Get the name of a class by its alias.
  25805. *
  25806. * @param {String} alias
  25807. * @return {String} className
  25808. */
  25809. getNameByAlias: function(alias) {
  25810. return this.aliasToName[alias] || '';
  25811. },
  25812. /**
  25813. * Get the name of a class by its alternate name.
  25814. *
  25815. * @param {String} alternate
  25816. * @return {String} className
  25817. */
  25818. getNameByAlternate: function(alternate) {
  25819. return this.alternateToName[alternate] || '';
  25820. },
  25821. /**
  25822. * Converts a string expression to an array of matching class names. An expression can
  25823. * either refers to class aliases or class names. Expressions support wildcards:
  25824. *
  25825. * // returns ['Ext.window.Window']
  25826. * var window = Ext.ClassManager.getNamesByExpression('widget.window');
  25827. *
  25828. * // returns ['widget.panel', 'widget.window', ...]
  25829. * var allWidgets = Ext.ClassManager.getNamesByExpression('widget.*');
  25830. *
  25831. * // returns ['Ext.data.Store', 'Ext.data.ArrayProxy', ...]
  25832. * var allData = Ext.ClassManager.getNamesByExpression('Ext.data.*');
  25833. *
  25834. * @param {String/String[]} expression
  25835. * @param {Object} [exclude=null] An object keyed by class name containing classes to
  25836. * exclude from the returned classes. This must be provided if `accumulate` is set to
  25837. * `true`.
  25838. * @param {Boolean} [accumulate=false] Pass `true` to add matching classes to the
  25839. * specified `exclude` object.
  25840. * @return {String[]} An array of class names.
  25841. */
  25842. getNamesByExpression: function(expression, exclude, accumulate) {
  25843. var me = this,
  25844. aliasToName = me.aliasToName,
  25845. alternateToName = me.alternateToName,
  25846. nameToAliases = me.nameToAliases,
  25847. nameToAlternates = me.nameToAlternates,
  25848. map = accumulate ? exclude : {},
  25849. names = [],
  25850. expressions = Ext.isString(expression) ? [
  25851. expression
  25852. ] : expression,
  25853. length = expressions.length,
  25854. wildcardRe = me.wildcardRe,
  25855. expr, i, list, match, n, name, regex;
  25856. for (i = 0; i < length; ++i) {
  25857. if ((expr = expressions[i]).indexOf('*') < 0) {
  25858. // No wildcard
  25859. if (!(name = aliasToName[expr])) {
  25860. if (!(name = alternateToName[expr])) {
  25861. name = expr;
  25862. }
  25863. }
  25864. if (!(name in map) && !(exclude && (name in exclude))) {
  25865. map[name] = 1;
  25866. names.push(name);
  25867. }
  25868. } else {
  25869. regex = new RegExp('^' + expr.replace(wildcardRe, '(.*?)') + '$');
  25870. for (name in nameToAliases) {
  25871. if (!(name in map) && !(exclude && (name in exclude))) {
  25872. if (!(match = regex.test(name))) {
  25873. n = (list = nameToAliases[name]).length;
  25874. while (!match && n-- > 0) {
  25875. match = regex.test(list[n]);
  25876. }
  25877. list = nameToAlternates[name];
  25878. if (list && !match) {
  25879. n = list.length;
  25880. while (!match && n-- > 0) {
  25881. match = regex.test(list[n]);
  25882. }
  25883. }
  25884. }
  25885. if (match) {
  25886. map[name] = 1;
  25887. names.push(name);
  25888. }
  25889. }
  25890. }
  25891. }
  25892. }
  25893. return names;
  25894. },
  25895. getPath: function(className) {
  25896. var me = this,
  25897. paths = me.paths,
  25898. ret = '',
  25899. prefix;
  25900. if (className in paths) {
  25901. ret = paths[className];
  25902. } else {
  25903. prefix = me.nameToPrefix[className] || (me.nameToPrefix[className] = me.getPrefix(className));
  25904. if (prefix) {
  25905. className = className.substring(prefix.length + 1);
  25906. ret = paths[prefix];
  25907. if (ret) {
  25908. ret += '/';
  25909. }
  25910. }
  25911. ret += className.replace(me.dotRe, '/') + '.js';
  25912. }
  25913. return ret;
  25914. },
  25915. getPrefix: function(className) {
  25916. if (className in this.paths) {
  25917. return className;
  25918. } else if (className in this.nameToPrefix) {
  25919. return this.nameToPrefix[className];
  25920. }
  25921. var prefixes = this.getPrefixes(),
  25922. length = className.length,
  25923. items, currChar, currSubstr, prefix, j, jlen;
  25924. // Walk the prefixes backwards so we consider the longest ones first.
  25925. // Prefixes are kept in a sparse array grouped by length so we don't have to
  25926. // iterate over all of them, just the ones we need.
  25927. while (length-- > 0) {
  25928. items = prefixes[length];
  25929. if (items) {
  25930. currChar = className.charAt(length);
  25931. if (currChar !== '.') {
  25932. continue;
  25933. }
  25934. currSubstr = className.substring(0, length);
  25935. for (j = 0 , jlen = items.length; j < jlen; j++) {
  25936. prefix = items[j];
  25937. if (prefix === className.substring(0, length)) {
  25938. return prefix;
  25939. }
  25940. }
  25941. }
  25942. }
  25943. return '';
  25944. },
  25945. getPrefixes: function() {
  25946. var me = this,
  25947. prefixes = me.prefixes,
  25948. names, name, nameLength, items, i, len;
  25949. if (!prefixes) {
  25950. names = me.names.slice(0);
  25951. me.prefixes = prefixes = [];
  25952. for (i = 0 , len = names.length; i < len; i++) {
  25953. name = names[i];
  25954. nameLength = name.length;
  25955. items = prefixes[nameLength] || (prefixes[nameLength] = []);
  25956. items.push(name);
  25957. }
  25958. }
  25959. return prefixes;
  25960. },
  25961. removeName: function(name) {
  25962. var me = this,
  25963. aliasToName = me.aliasToName,
  25964. alternateToName = me.alternateToName,
  25965. nameToAliases = me.nameToAliases,
  25966. nameToAlternates = me.nameToAlternates,
  25967. aliases = nameToAliases[name],
  25968. alternates = nameToAlternates[name],
  25969. i, a;
  25970. delete nameToAliases[name];
  25971. delete nameToAlternates[name];
  25972. delete me.nameToPrefix[name];
  25973. if (aliases) {
  25974. for (i = aliases.length; i--; ) {
  25975. // Aliases can be reassigned so if this class is the current mapping of
  25976. // the alias, remove it. Since there is no chain to restore what was
  25977. // removed this is not perfect.
  25978. if (name === aliasToName[a = aliases[i]]) {
  25979. delete aliasToName[a];
  25980. }
  25981. }
  25982. }
  25983. if (alternates) {
  25984. for (i = alternates.length; i--; ) {
  25985. // Like aliases, alternate class names can also be remapped.
  25986. if (name === alternateToName[a = alternates[i]]) {
  25987. delete alternateToName[a];
  25988. }
  25989. }
  25990. }
  25991. },
  25992. resolveName: function(name) {
  25993. var me = this,
  25994. trueName;
  25995. // If the name has a registered alias, it is a true className (not an alternate)
  25996. // so we can stop now.
  25997. if (!(name in me.nameToAliases)) {
  25998. // The name is not a known class name, so check to see if it is a known alias:
  25999. if (!(trueName = me.aliasToName[name])) {
  26000. // The name does not correspond to a known alias, so check if it is a known
  26001. // alternateClassName:
  26002. trueName = me.alternateToName[name];
  26003. }
  26004. }
  26005. return trueName || name;
  26006. },
  26007. /**
  26008. * This method returns a selector object that produces a selection of classes and
  26009. * delivers them to the desired `receiver`.
  26010. *
  26011. * The returned selector object has the same methods as the given `receiver` object
  26012. * but these methods on the selector accept a first argument that expects a pattern
  26013. * or array of patterns. The actual method on the `receiver` will be called with an
  26014. * array of classes that match these patterns but with any patterns passed to an
  26015. * `exclude` call removed.
  26016. *
  26017. * For example:
  26018. *
  26019. * var sel = inventory.select({
  26020. * require: function (classes) {
  26021. * console.log('Classes: ' + classes.join(','));
  26022. * }
  26023. * });
  26024. *
  26025. * sel.exclude('Ext.chart.*').exclude('Ext.draw.*').require('*');
  26026. *
  26027. * // Logs all classes except those in the Ext.chart and Ext.draw namespaces.
  26028. *
  26029. * @param {Object} receiver
  26030. * @param {Object} [scope] Optional scope to use when calling `receiver` methods.
  26031. * @return {Object} An object with the same methods as `receiver` plus `exclude`.
  26032. */
  26033. select: function(receiver, scope) {
  26034. var me = this,
  26035. excludes = {},
  26036. ret = {
  26037. excludes: excludes,
  26038. exclude: function() {
  26039. me.getNamesByExpression(arguments[0], excludes, true);
  26040. return this;
  26041. }
  26042. },
  26043. name;
  26044. for (name in receiver) {
  26045. ret[name] = me.selectMethod(excludes, receiver[name], scope || receiver);
  26046. }
  26047. return ret;
  26048. },
  26049. selectMethod: function(excludes, fn, scope) {
  26050. var me = this;
  26051. return function(include) {
  26052. var args = Ext.Array.slice(arguments, 1);
  26053. args.unshift(me.getNamesByExpression(include, excludes));
  26054. return fn.apply(scope, args);
  26055. };
  26056. },
  26057. /**
  26058. * Sets the path of a namespace.
  26059. * For Example:
  26060. *
  26061. * inventory.setPath('Ext', '.');
  26062. * inventory.setPath({
  26063. * Ext: '.'
  26064. * });
  26065. *
  26066. * @param {String/Object} name The name of a single mapping or an object of mappings.
  26067. * @param {String} [path] If `name` is a String, then this is the path for that name.
  26068. * Otherwise this parameter is ignored.
  26069. * @return {Ext.Inventory} this
  26070. * @method
  26071. */
  26072. setPath: Ext.Function.flexSetter(function(name, path) {
  26073. var me = this;
  26074. me.paths[name] = path;
  26075. me.names.push(name);
  26076. me.prefixes = null;
  26077. me.nameToPrefix = {};
  26078. return me;
  26079. })
  26080. };
  26081. // @tag class
  26082. /**
  26083. * @class Ext.ClassManager
  26084. *
  26085. * Ext.ClassManager manages all classes and handles mapping from string class name to
  26086. * actual class objects throughout the whole framework. It is not generally accessed directly, rather through
  26087. * these convenient shorthands:
  26088. *
  26089. * - {@link Ext#define Ext.define}
  26090. * - {@link Ext#method!create Ext.create}
  26091. * - {@link Ext#widget Ext.widget}
  26092. * - {@link Ext#getClass Ext.getClass}
  26093. * - {@link Ext#getClassName Ext.getClassName}
  26094. *
  26095. * # Basic syntax:
  26096. *
  26097. * Ext.define(className, properties);
  26098. *
  26099. * in which `properties` is an object represent a collection of properties that apply to the class. See
  26100. * {@link Ext.ClassManager#method!create} for more detailed instructions.
  26101. *
  26102. * Ext.define('Person', {
  26103. * name: 'Unknown',
  26104. *
  26105. * constructor: function(name) {
  26106. * if (name) {
  26107. * this.name = name;
  26108. * }
  26109. * },
  26110. *
  26111. * eat: function(foodType) {
  26112. * alert("I'm eating: " + foodType);
  26113. *
  26114. * return this;
  26115. * }
  26116. * });
  26117. *
  26118. * var aaron = new Person("Aaron");
  26119. * aaron.eat("Sandwich"); // alert("I'm eating: Sandwich");
  26120. *
  26121. * Ext.Class has a powerful set of extensible {@link Ext.Class#registerPreprocessor pre-processors} which takes care of
  26122. * everything related to class creation, including but not limited to inheritance, mixins, configuration, statics, etc.
  26123. *
  26124. * # Inheritance:
  26125. *
  26126. * Ext.define('Developer', {
  26127. * extend: 'Person',
  26128. *
  26129. * constructor: function(name, isGeek) {
  26130. * this.isGeek = isGeek;
  26131. *
  26132. * // Apply a method from the parent class' prototype
  26133. * this.callParent([name]);
  26134. * },
  26135. *
  26136. * code: function(language) {
  26137. * alert("I'm coding in: " + language);
  26138. *
  26139. * this.eat("Bugs");
  26140. *
  26141. * return this;
  26142. * }
  26143. * });
  26144. *
  26145. * var jacky = new Developer("Jacky", true);
  26146. * jacky.code("JavaScript"); // alert("I'm coding in: JavaScript");
  26147. * // alert("I'm eating: Bugs");
  26148. *
  26149. * See {@link Ext.Base#method!callParent} for more details on calling superclass' methods
  26150. *
  26151. * # Mixins:
  26152. *
  26153. * Ext.define('CanPlayGuitar', {
  26154. * playGuitar: function() {
  26155. * alert("F#...G...D...A");
  26156. * }
  26157. * });
  26158. *
  26159. * Ext.define('CanComposeSongs', {
  26160. * composeSongs: function() { ... }
  26161. * });
  26162. *
  26163. * Ext.define('CanSing', {
  26164. * sing: function() {
  26165. * alert("For he's a jolly good fellow...")
  26166. * }
  26167. * });
  26168. *
  26169. * Ext.define('Musician', {
  26170. * extend: 'Person',
  26171. *
  26172. * mixins: {
  26173. * canPlayGuitar: 'CanPlayGuitar',
  26174. * canComposeSongs: 'CanComposeSongs',
  26175. * canSing: 'CanSing'
  26176. * }
  26177. * })
  26178. *
  26179. * Ext.define('CoolPerson', {
  26180. * extend: 'Person',
  26181. *
  26182. * mixins: {
  26183. * canPlayGuitar: 'CanPlayGuitar',
  26184. * canSing: 'CanSing'
  26185. * },
  26186. *
  26187. * sing: function() {
  26188. * alert("Ahem....");
  26189. *
  26190. * this.mixins.canSing.sing.call(this);
  26191. *
  26192. * alert("[Playing guitar at the same time...]");
  26193. *
  26194. * this.playGuitar();
  26195. * }
  26196. * });
  26197. *
  26198. * var me = new CoolPerson("Jacky");
  26199. *
  26200. * me.sing(); // alert("Ahem...");
  26201. * // alert("For he's a jolly good fellow...");
  26202. * // alert("[Playing guitar at the same time...]");
  26203. * // alert("F#...G...D...A");
  26204. *
  26205. * # Config:
  26206. *
  26207. * Ext.define('SmartPhone', {
  26208. * config: {
  26209. * hasTouchScreen: false,
  26210. * operatingSystem: 'Other',
  26211. * price: 500
  26212. * },
  26213. *
  26214. * isExpensive: false,
  26215. *
  26216. * constructor: function(config) {
  26217. * this.initConfig(config);
  26218. * },
  26219. *
  26220. * applyPrice: function(price) {
  26221. * this.isExpensive = (price > 500);
  26222. *
  26223. * return price;
  26224. * },
  26225. *
  26226. * applyOperatingSystem: function(operatingSystem) {
  26227. * if (!(/^(iOS|Android|BlackBerry)$/i).test(operatingSystem)) {
  26228. * return 'Other';
  26229. * }
  26230. *
  26231. * return operatingSystem;
  26232. * }
  26233. * });
  26234. *
  26235. * var iPhone = new SmartPhone({
  26236. * hasTouchScreen: true,
  26237. * operatingSystem: 'iOS'
  26238. * });
  26239. *
  26240. * iPhone.getPrice(); // 500;
  26241. * iPhone.getOperatingSystem(); // 'iOS'
  26242. * iPhone.getHasTouchScreen(); // true;
  26243. *
  26244. * iPhone.isExpensive; // false;
  26245. * iPhone.setPrice(600);
  26246. * iPhone.getPrice(); // 600
  26247. * iPhone.isExpensive; // true;
  26248. *
  26249. * iPhone.setOperatingSystem('AlienOS');
  26250. * iPhone.getOperatingSystem(); // 'Other'
  26251. *
  26252. * # Statics:
  26253. *
  26254. * Ext.define('Computer', {
  26255. * statics: {
  26256. * factory: function(brand) {
  26257. * // 'this' in static methods refer to the class itself
  26258. * return new this(brand);
  26259. * }
  26260. * },
  26261. *
  26262. * constructor: function() { ... }
  26263. * });
  26264. *
  26265. * var dellComputer = Computer.factory('Dell');
  26266. *
  26267. * Also see {@link Ext.Base#statics} and {@link Ext.Base#self} for more details on accessing
  26268. * static properties within class methods
  26269. *
  26270. * @singleton
  26271. */
  26272. Ext.ClassManager = (function(Class, alias, arraySlice, arrayFrom, global) {
  26273. // @define Ext.ClassManager
  26274. // @require Ext.Inventory
  26275. // @require Ext.Class
  26276. // @require Ext.Function
  26277. // @require Ext.Array
  26278. var makeCtor = Ext.Class.makeCtor,
  26279. nameLookupStack = [],
  26280. namespaceCache = {
  26281. Ext: {
  26282. name: 'Ext',
  26283. value: Ext
  26284. }
  26285. },
  26286. // specially added for sandbox (Ext === global.Ext6)
  26287. /*
  26288. 'Ext.grid': {
  26289. name: 'grid',
  26290. parent: namespaceCache['Ext']
  26291. },
  26292. 'Ext.grid.Panel': {
  26293. name: 'Panel',
  26294. parent: namespaceCache['Ext.grid']
  26295. },
  26296. ...
  26297. Also,
  26298. 'MyApp': {
  26299. name: 'MyApp',
  26300. value: MyApp
  26301. }
  26302. */
  26303. Manager = Ext.apply(new Ext.Inventory(), {
  26304. /**
  26305. * @property {Object} classes
  26306. * All classes which were defined through the ClassManager. Keys are the
  26307. * name of the classes and the values are references to the classes.
  26308. * @private
  26309. */
  26310. classes: {},
  26311. classCount: 0,
  26312. classState: {},
  26313. /*
  26314. * 'Ext.foo.Bar': <state enum>
  26315. *
  26316. * 10 = Ext.define called
  26317. * 20 = Ext.define/override called
  26318. * 30 = Manager.existCache[<name>] == true for define
  26319. * 40 = Manager.existCache[<name>] == true for define/override
  26320. * 50 = Manager.isCreated(<name>) == true for define
  26321. * 60 = Manager.isCreated(<name>) == true for define/override
  26322. *
  26323. */
  26324. /**
  26325. * @private
  26326. */
  26327. existCache: {},
  26328. /** @private */
  26329. instantiators: [],
  26330. /**
  26331. * Checks if a class has already been created.
  26332. *
  26333. * @param {String} className
  26334. * @return {Boolean} exist
  26335. */
  26336. isCreated: function(className) {
  26337. if (typeof className !== 'string' || className.length < 1) {
  26338. throw new Error("[Ext.ClassManager] Invalid classname, must be a string and must not be empty");
  26339. }
  26340. if (Manager.classes[className] || Manager.existCache[className]) {
  26341. return true;
  26342. }
  26343. if (!Manager.lookupName(className, false)) {
  26344. return false;
  26345. }
  26346. Manager.triggerCreated(className);
  26347. return true;
  26348. },
  26349. /**
  26350. * @private
  26351. */
  26352. createdListeners: [],
  26353. /**
  26354. * @private
  26355. */
  26356. nameCreatedListeners: {},
  26357. /**
  26358. * @private
  26359. */
  26360. existsListeners: [],
  26361. /**
  26362. * @private
  26363. */
  26364. nameExistsListeners: {},
  26365. /**
  26366. * @private
  26367. */
  26368. overrideMap: {},
  26369. /**
  26370. * @private
  26371. */
  26372. triggerCreated: function(className, state) {
  26373. Manager.existCache[className] = state || 1;
  26374. Manager.classState[className] += 40;
  26375. Manager.notify(className, Manager.createdListeners, Manager.nameCreatedListeners);
  26376. },
  26377. /**
  26378. * @private
  26379. */
  26380. onCreated: function(fn, scope, className) {
  26381. Manager.addListener(fn, scope, className, Manager.createdListeners, Manager.nameCreatedListeners);
  26382. },
  26383. /**
  26384. * @private
  26385. */
  26386. notify: function(className, listeners, nameListeners) {
  26387. var alternateNames = Manager.getAlternatesByName(className),
  26388. names = [
  26389. className
  26390. ],
  26391. i, ln, j, subLn, listener, name;
  26392. for (i = 0 , ln = listeners.length; i < ln; i++) {
  26393. listener = listeners[i];
  26394. listener.fn.call(listener.scope, className);
  26395. }
  26396. while (names) {
  26397. for (i = 0 , ln = names.length; i < ln; i++) {
  26398. name = names[i];
  26399. listeners = nameListeners[name];
  26400. if (listeners) {
  26401. for (j = 0 , subLn = listeners.length; j < subLn; j++) {
  26402. listener = listeners[j];
  26403. listener.fn.call(listener.scope, name);
  26404. }
  26405. delete nameListeners[name];
  26406. }
  26407. }
  26408. names = alternateNames;
  26409. // for 2nd pass (if needed)
  26410. alternateNames = null;
  26411. }
  26412. },
  26413. // no 3rd pass
  26414. /**
  26415. * @private
  26416. */
  26417. addListener: function(fn, scope, className, listeners, nameListeners) {
  26418. if (Ext.isArray(className)) {
  26419. fn = Ext.Function.createBarrier(className.length, fn, scope);
  26420. for (i = 0; i < className.length; i++) {
  26421. this.addListener(fn, null, className[i], listeners, nameListeners);
  26422. }
  26423. return;
  26424. }
  26425. var i,
  26426. listener = {
  26427. fn: fn,
  26428. scope: scope
  26429. };
  26430. if (className) {
  26431. if (this.isCreated(className)) {
  26432. fn.call(scope, className);
  26433. return;
  26434. }
  26435. if (!nameListeners[className]) {
  26436. nameListeners[className] = [];
  26437. }
  26438. nameListeners[className].push(listener);
  26439. } else {
  26440. listeners.push(listener);
  26441. }
  26442. },
  26443. /**
  26444. * Supports namespace rewriting.
  26445. * @private
  26446. */
  26447. $namespaceCache: namespaceCache,
  26448. /**
  26449. * See `{@link Ext#addRootNamespaces Ext.addRootNamespaces}`.
  26450. * @since 6.0.0
  26451. * @private
  26452. */
  26453. addRootNamespaces: function(namespaces) {
  26454. for (var name in namespaces) {
  26455. namespaceCache[name] = {
  26456. name: name,
  26457. value: namespaces[name]
  26458. };
  26459. }
  26460. },
  26461. /**
  26462. * Clears the namespace lookup cache. After application launch, this cache can
  26463. * often contain several hundred entries that are unlikely to be needed again.
  26464. * These will be rebuilt as needed, so it is harmless to clear this cache even
  26465. * if its results will be used again.
  26466. * @since 6.0.0
  26467. * @private
  26468. */
  26469. clearNamespaceCache: function() {
  26470. nameLookupStack.length = 0;
  26471. for (var name in namespaceCache) {
  26472. if (!namespaceCache[name].value) {
  26473. delete namespaceCache[name];
  26474. }
  26475. }
  26476. },
  26477. /**
  26478. * Return the namespace cache entry for the given a class name or namespace (e.g.,
  26479. * "Ext.grid.Panel").
  26480. *
  26481. * @param {String} namespace The namespace or class name to lookup.
  26482. * @return {Object} The cache entry.
  26483. * @return {String} return.name The leaf name ("Panel" for "Ext.grid.Panel").
  26484. * @return {Object} return.parent The entry of the parent namespace (i.e., "Ext.grid").
  26485. * @return {Object} return.value The namespace object. This is only set for
  26486. * top-level namespace entries to support renaming them for sandboxing ("Ext6" vs
  26487. * "Ext").
  26488. * @since 6.0.0
  26489. * @private
  26490. */
  26491. getNamespaceEntry: function(namespace) {
  26492. if (typeof namespace !== 'string') {
  26493. return namespace;
  26494. }
  26495. // assume we've been given an entry object
  26496. var entry = namespaceCache[namespace],
  26497. i;
  26498. if (!entry) {
  26499. i = namespace.lastIndexOf('.');
  26500. if (i < 0) {
  26501. entry = {
  26502. name: namespace
  26503. };
  26504. } else {
  26505. entry = {
  26506. name: namespace.substring(i + 1),
  26507. parent: Manager.getNamespaceEntry(namespace.substring(0, i))
  26508. };
  26509. }
  26510. namespaceCache[namespace] = entry;
  26511. }
  26512. return entry;
  26513. },
  26514. /**
  26515. * Return the value of the given "dot path" name. This supports remapping (for use
  26516. * in sandbox builds) as well as auto-creating of namespaces.
  26517. *
  26518. * @param {String} namespace The name of the namespace or class.
  26519. * @param {Boolean} [autoCreate] Pass `true` to create objects for undefined names.
  26520. * @return {Object} The object that is the namespace or class name.
  26521. * @since 6.0.0
  26522. * @private
  26523. */
  26524. lookupName: function(namespace, autoCreate) {
  26525. var entry = Manager.getNamespaceEntry(namespace),
  26526. scope = Ext.global,
  26527. i = 0,
  26528. e, parent;
  26529. // Put entries on the stack in reverse order: [ 'Panel', 'grid', 'Ext' ]
  26530. for (e = entry; e; e = e.parent) {
  26531. // since we process only what we add to the array, and that always
  26532. // starts at index=0, we don't need to clean up the array (that would
  26533. // just encourage the GC to do something pointless).
  26534. nameLookupStack[i++] = e;
  26535. }
  26536. while (scope && i-- > 0) {
  26537. // We'll process entries in top-down order ('Ext', 'grid' then 'Panel').
  26538. e = nameLookupStack[i];
  26539. parent = scope;
  26540. scope = e.value || scope[e.name];
  26541. if (!scope && autoCreate) {
  26542. parent[e.name] = scope = {};
  26543. }
  26544. }
  26545. return scope;
  26546. },
  26547. /**
  26548. * Creates a namespace and assign the `value` to the created object.
  26549. *
  26550. * Ext.ClassManager.setNamespace('MyCompany.pkg.Example', someObject);
  26551. *
  26552. * alert(MyCompany.pkg.Example === someObject); // alerts true
  26553. *
  26554. * @param {String} namespace
  26555. * @param {Object} value
  26556. */
  26557. setNamespace: function(namespace, value) {
  26558. var entry = Manager.getNamespaceEntry(namespace),
  26559. scope = Ext.global;
  26560. if (entry.parent) {
  26561. scope = Manager.lookupName(entry.parent, true);
  26562. }
  26563. scope[entry.name] = value;
  26564. return value;
  26565. },
  26566. /**
  26567. * Changes the mapping of an `xtype` to map to the specified component class.
  26568. * @param {String/Ext.Class} cls The class or class name to which `xtype` is mapped.
  26569. * @param {String} xtype The `xtype` to map or redefine as `cls`.
  26570. * @since 6.0.1
  26571. * @private
  26572. */
  26573. setXType: function(cls, xtype) {
  26574. var className = cls.$className,
  26575. C = className ? cls : Manager.get(className = cls),
  26576. proto = C.prototype,
  26577. xtypes = proto.xtypes,
  26578. xtypesChain = proto.xtypesChain,
  26579. xtypesMap = proto.xtypesMap;
  26580. if (!proto.hasOwnProperty('xtypes')) {
  26581. proto.xtypes = xtypes = [];
  26582. proto.xtypesChain = xtypesChain = xtypesChain ? xtypesChain.slice(0) : [];
  26583. proto.xtypesMap = xtypesMap = Ext.apply({}, xtypesMap);
  26584. }
  26585. Manager.addAlias(className, 'widget.' + xtype, true);
  26586. xtypes.push(xtype);
  26587. xtypesChain.push(xtype);
  26588. xtypesMap[xtype] = true;
  26589. },
  26590. //TODO consider updating derived class xtypesChain / xtypesMap
  26591. /**
  26592. * Sets a name reference to a class.
  26593. *
  26594. * @param {String} name
  26595. * @param {Object} value
  26596. * @return {Ext.ClassManager} this
  26597. */
  26598. set: function(name, value) {
  26599. var targetName = Manager.getName(value);
  26600. Manager.classes[name] = Manager.setNamespace(name, value);
  26601. Manager.classCount++;
  26602. if (targetName && targetName !== name) {
  26603. Manager.addAlternate(targetName, name);
  26604. }
  26605. return Manager;
  26606. },
  26607. /**
  26608. * Retrieve a class by its name.
  26609. *
  26610. * @param {String} name
  26611. * @return {Ext.Class} class
  26612. */
  26613. get: function(name) {
  26614. return Manager.classes[name] || Manager.lookupName(name, false);
  26615. },
  26616. /**
  26617. * Adds a batch of class name to alias mappings.
  26618. * @param {Object} aliases The set of mappings of the form.
  26619. * className : [values...]
  26620. */
  26621. addNameAliasMappings: function(aliases) {
  26622. Manager.addAlias(aliases);
  26623. },
  26624. /**
  26625. *
  26626. * @param {Object} alternates The set of mappings of the form
  26627. * className : [values...]
  26628. */
  26629. addNameAlternateMappings: function(alternates) {
  26630. Manager.addAlternate(alternates);
  26631. },
  26632. /**
  26633. * Get a reference to the class by its alias.
  26634. *
  26635. * @param {String} alias
  26636. * @return {Ext.Class} class
  26637. */
  26638. getByAlias: function(alias) {
  26639. return Manager.get(Manager.getNameByAlias(alias));
  26640. },
  26641. /**
  26642. * Get a component class name from a config object.
  26643. * @param {Object} config The config object.
  26644. * @param {String} [aliasPrefix] A prefix to use when getting
  26645. * a class name by alias.
  26646. * @return {Ext.Class} The class.
  26647. *
  26648. * @private
  26649. */
  26650. getByConfig: function(config, aliasPrefix) {
  26651. var xclass = config.xclass,
  26652. name;
  26653. if (xclass) {
  26654. name = xclass;
  26655. } else {
  26656. name = config.xtype;
  26657. if (name) {
  26658. aliasPrefix = 'widget.';
  26659. } else {
  26660. name = config.type;
  26661. }
  26662. name = Manager.getNameByAlias(aliasPrefix + name);
  26663. }
  26664. return Manager.get(name);
  26665. },
  26666. /**
  26667. * Get the name of the class by its reference or its instance. This is
  26668. * usually invoked by the shorthand {@link Ext#getClassName}.
  26669. *
  26670. * Ext.ClassManager.getName(Ext.Action); // returns "Ext.Action"
  26671. *
  26672. * @param {Ext.Class/Object} object
  26673. * @return {String} className
  26674. */
  26675. getName: function(object) {
  26676. return object && object.$className || '';
  26677. },
  26678. /**
  26679. * Get the class of the provided object; returns null if it's not an instance
  26680. * of any class created with Ext.define. This is usually invoked by the
  26681. * shorthand {@link Ext#getClass}.
  26682. *
  26683. * var component = new Ext.Component();
  26684. *
  26685. * Ext.getClass(component); // returns Ext.Component
  26686. *
  26687. * @param {Object} object
  26688. * @return {Ext.Class} class
  26689. */
  26690. getClass: function(object) {
  26691. return object && object.self || null;
  26692. },
  26693. /**
  26694. * Defines a class.
  26695. * @deprecated 4.1 Use {@link Ext#define} instead.
  26696. * @private
  26697. */
  26698. create: function(className, data, createdFn) {
  26699. if (className != null && typeof className !== 'string') {
  26700. throw new Error("[Ext.define] Invalid class name '" + className + "' specified, must be a non-empty string");
  26701. }
  26702. var ctor = makeCtor(className);
  26703. if (typeof data === 'function') {
  26704. data = data(ctor);
  26705. }
  26706. if (className) {
  26707. if (Manager.classes[className]) {
  26708. Ext.log.warn("[Ext.define] Duplicate class name '" + className + "' specified, must be a non-empty string");
  26709. }
  26710. ctor.name = className;
  26711. }
  26712. data.$className = className;
  26713. return new Class(ctor, data, function() {
  26714. var postprocessorStack = data.postprocessors || Manager.defaultPostprocessors,
  26715. registeredPostprocessors = Manager.postprocessors,
  26716. postprocessors = [],
  26717. postprocessor, i, ln, j, subLn, postprocessorProperties, postprocessorProperty;
  26718. delete data.postprocessors;
  26719. for (i = 0 , ln = postprocessorStack.length; i < ln; i++) {
  26720. postprocessor = postprocessorStack[i];
  26721. if (typeof postprocessor === 'string') {
  26722. postprocessor = registeredPostprocessors[postprocessor];
  26723. postprocessorProperties = postprocessor.properties;
  26724. if (postprocessorProperties === true) {
  26725. postprocessors.push(postprocessor.fn);
  26726. } else if (postprocessorProperties) {
  26727. for (j = 0 , subLn = postprocessorProperties.length; j < subLn; j++) {
  26728. postprocessorProperty = postprocessorProperties[j];
  26729. if (data.hasOwnProperty(postprocessorProperty)) {
  26730. postprocessors.push(postprocessor.fn);
  26731. break;
  26732. }
  26733. }
  26734. }
  26735. } else {
  26736. postprocessors.push(postprocessor);
  26737. }
  26738. }
  26739. data.postprocessors = postprocessors;
  26740. data.createdFn = createdFn;
  26741. Manager.processCreate(className, this, data);
  26742. });
  26743. },
  26744. processCreate: function(className, cls, clsData) {
  26745. var me = this,
  26746. postprocessor = clsData.postprocessors.shift(),
  26747. createdFn = clsData.createdFn;
  26748. if (!postprocessor) {
  26749. Ext.classSystemMonitor && Ext.classSystemMonitor(className, 'Ext.ClassManager#classCreated', arguments);
  26750. if (className) {
  26751. me.set(className, cls);
  26752. }
  26753. delete cls._classHooks;
  26754. if (createdFn) {
  26755. createdFn.call(cls, cls);
  26756. }
  26757. if (className) {
  26758. me.triggerCreated(className);
  26759. }
  26760. return;
  26761. }
  26762. if (postprocessor.call(me, className, cls, clsData, me.processCreate) !== false) {
  26763. me.processCreate(className, cls, clsData);
  26764. }
  26765. },
  26766. createOverride: function(className, data, createdFn) {
  26767. var me = this,
  26768. overriddenClassName = data.override,
  26769. requires = data.requires,
  26770. uses = data.uses,
  26771. mixins = data.mixins,
  26772. mixinsIsArray,
  26773. compat = 1,
  26774. // default if 'compatibility' is not specified
  26775. dependenciesLoaded,
  26776. classReady = function() {
  26777. var cls, dependencies, i, key, temp;
  26778. if (!dependenciesLoaded) {
  26779. dependencies = requires ? requires.slice(0) : [];
  26780. if (mixins) {
  26781. if (!(mixinsIsArray = mixins instanceof Array)) {
  26782. for (key in mixins) {
  26783. if (Ext.isString(cls = mixins[key])) {
  26784. dependencies.push(cls);
  26785. }
  26786. }
  26787. } else {
  26788. for (i = 0 , temp = mixins.length; i < temp; ++i) {
  26789. if (Ext.isString(cls = mixins[i])) {
  26790. dependencies.push(cls);
  26791. }
  26792. }
  26793. }
  26794. }
  26795. dependenciesLoaded = true;
  26796. if (dependencies.length) {
  26797. // Since the override is going to be used (its target class is
  26798. // now created), we need to fetch the required classes for the
  26799. // override and call us back once they are loaded:
  26800. Ext.require(dependencies, classReady);
  26801. return;
  26802. }
  26803. }
  26804. // else we have no dependencies, so proceed
  26805. // transform mixin class names into class references, This
  26806. // loop can handle both the array and object forms of
  26807. // mixin definitions
  26808. if (mixinsIsArray) {
  26809. for (i = 0 , temp = mixins.length; i < temp; ++i) {
  26810. if (Ext.isString(cls = mixins[i])) {
  26811. mixins[i] = Ext.ClassManager.get(cls);
  26812. }
  26813. }
  26814. } else if (mixins) {
  26815. for (key in mixins) {
  26816. if (Ext.isString(cls = mixins[key])) {
  26817. mixins[key] = Ext.ClassManager.get(cls);
  26818. }
  26819. }
  26820. }
  26821. // The target class and the required classes for this override are
  26822. // ready, so we can apply the override now:
  26823. cls = overriddenClassName.$isClass ? overriddenClassName : me.get(overriddenClassName);
  26824. // We don't want to apply these:
  26825. delete data.override;
  26826. delete data.compatibility;
  26827. delete data.requires;
  26828. delete data.uses;
  26829. Ext.override(cls, data);
  26830. // This pushes the overriding file itself into Ext.Loader.history
  26831. // Hence if the target class never exists, the overriding file will
  26832. // never be included in the build.
  26833. Ext.Loader.history.push(className);
  26834. if (uses) {
  26835. // This "hides" from the Cmd auto-dependency scanner since
  26836. // the reference is circular (Loader requires us).
  26837. Ext['Loader'].addUsedClasses(uses);
  26838. }
  26839. // get these classes too!
  26840. if (createdFn) {
  26841. createdFn.call(cls, cls);
  26842. }
  26843. };
  26844. // last but not least!
  26845. if (className) {
  26846. Manager.overrideMap[className] = true;
  26847. }
  26848. // If specified, parse strings as versions, but otherwise treat as a
  26849. // boolean (maybe "compatibility: Ext.isIE8" or something).
  26850. //
  26851. if ('compatibility' in data) {
  26852. compat = data.compatibility;
  26853. if (!compat) {
  26854. // Cast '', null, undefined, 0 to false.
  26855. compat = false;
  26856. } else if (typeof compat === 'number') {
  26857. // By virtue of the condition above we must be a nonzero number.
  26858. compat = true;
  26859. } else if (typeof compat !== 'boolean') {
  26860. compat = Ext.checkVersion(compat);
  26861. }
  26862. }
  26863. if (compat) {
  26864. // override the target class right after it's created
  26865. if (overriddenClassName.$isClass) {
  26866. classReady();
  26867. } else {
  26868. me.onCreated(classReady, me, overriddenClassName);
  26869. }
  26870. }
  26871. me.triggerCreated(className, 2);
  26872. return me;
  26873. },
  26874. /**
  26875. * Instantiate a class by its alias. This is usually invoked by the
  26876. * shorthand {@link Ext#createByAlias}.
  26877. *
  26878. * If {@link Ext.Loader} is {@link Ext.Loader#setConfig enabled} and the class
  26879. * has not been defined yet, it will attempt to load the class via synchronous
  26880. * loading.
  26881. *
  26882. * var window = Ext.createByAlias('widget.window', { width: 600, height: 800 });
  26883. *
  26884. * @param {String} alias
  26885. * @param {Object...} args Additional arguments after the alias will be passed to the
  26886. * class constructor.
  26887. * @return {Object} instance
  26888. */
  26889. instantiateByAlias: function() {
  26890. var alias = arguments[0],
  26891. args = arraySlice.call(arguments),
  26892. className = this.getNameByAlias(alias);
  26893. if (!className) {
  26894. throw new Error("[Ext.createByAlias] Unrecognized alias: " + alias);
  26895. }
  26896. args[0] = className;
  26897. return Ext.create.apply(Ext, args);
  26898. },
  26899. /**
  26900. * Instantiate a class by either full name, alias or alternate name
  26901. * @param {String} name
  26902. * @param {Mixed} args Additional arguments after the name will be passed to the class' constructor.
  26903. * @return {Object} instance
  26904. * @deprecated 5.0 Use Ext.create() instead.
  26905. */
  26906. instantiate: function() {
  26907. Ext.log.warn('Ext.ClassManager.instantiate() is deprecated. Use Ext.create() instead.');
  26908. return Ext.create.apply(Ext, arguments);
  26909. },
  26910. /**
  26911. * @private
  26912. * @param name
  26913. * @param args
  26914. */
  26915. dynInstantiate: function(name, args) {
  26916. args = arrayFrom(args, true);
  26917. args.unshift(name);
  26918. return Ext.create.apply(Ext, args);
  26919. },
  26920. /**
  26921. * @private
  26922. * @param length
  26923. */
  26924. getInstantiator: function(length) {
  26925. var instantiators = this.instantiators,
  26926. instantiator, i, args;
  26927. instantiator = instantiators[length];
  26928. if (!instantiator) {
  26929. i = length;
  26930. args = [];
  26931. for (i = 0; i < length; i++) {
  26932. args.push('a[' + i + ']');
  26933. }
  26934. instantiator = instantiators[length] = new Function('c', 'a', 'return new c(' + args.join(',') + ')');
  26935. instantiator.name = "Ext.create" + length;
  26936. }
  26937. return instantiator;
  26938. },
  26939. /**
  26940. * @private
  26941. */
  26942. postprocessors: {},
  26943. /**
  26944. * @private
  26945. */
  26946. defaultPostprocessors: [],
  26947. /**
  26948. * Register a post-processor function.
  26949. *
  26950. * @param {String} name
  26951. * @param {Function} fn
  26952. * @param {String/String[]} properties
  26953. * @param {String} position
  26954. * @param {String} relativeTo
  26955. * @private
  26956. */
  26957. registerPostprocessor: function(name, fn, properties, position, relativeTo) {
  26958. if (!position) {
  26959. position = 'last';
  26960. }
  26961. if (!properties) {
  26962. properties = [
  26963. name
  26964. ];
  26965. }
  26966. this.postprocessors[name] = {
  26967. name: name,
  26968. properties: properties || false,
  26969. fn: fn
  26970. };
  26971. this.setDefaultPostprocessorPosition(name, position, relativeTo);
  26972. return this;
  26973. },
  26974. /**
  26975. * Set the default post processors array stack which are applied to every class.
  26976. *
  26977. * @private
  26978. * @param {String/Array} postprocessors The name of a registered post processor or an array of registered names.
  26979. * @return {Ext.ClassManager} this
  26980. */
  26981. setDefaultPostprocessors: function(postprocessors) {
  26982. this.defaultPostprocessors = arrayFrom(postprocessors);
  26983. return this;
  26984. },
  26985. /**
  26986. * Insert this post-processor at a specific position in the stack, optionally relative to
  26987. * any existing post-processor
  26988. *
  26989. * @private
  26990. * @param {String} name The post-processor name. Note that it needs to be registered with
  26991. * {@link Ext.ClassManager#registerPostprocessor} before this
  26992. * @param {String} offset The insertion position. Four possible values are:
  26993. * 'first', 'last', or: 'before', 'after' (relative to the name provided in the third argument)
  26994. * @param {String} relativeName
  26995. * @return {Ext.ClassManager} this
  26996. */
  26997. setDefaultPostprocessorPosition: function(name, offset, relativeName) {
  26998. var defaultPostprocessors = this.defaultPostprocessors,
  26999. index;
  27000. if (typeof offset === 'string') {
  27001. if (offset === 'first') {
  27002. defaultPostprocessors.unshift(name);
  27003. return this;
  27004. } else if (offset === 'last') {
  27005. defaultPostprocessors.push(name);
  27006. return this;
  27007. }
  27008. offset = (offset === 'after') ? 1 : -1;
  27009. }
  27010. index = Ext.Array.indexOf(defaultPostprocessors, relativeName);
  27011. if (index !== -1) {
  27012. Ext.Array.splice(defaultPostprocessors, Math.max(0, index + offset), 0, name);
  27013. }
  27014. return this;
  27015. }
  27016. });
  27017. /**
  27018. * @cfg xtype
  27019. * @member Ext.Class
  27020. * @inheritdoc Ext.Component#cfg-xtype
  27021. */
  27022. /**
  27023. * @cfg {String} override
  27024. * @member Ext.Class
  27025. * Overrides members of the specified `target` class.
  27026. *
  27027. * **NOTE:** the overridden class must have been defined using
  27028. * {@link Ext#define Ext.define} in order to use the `override` config.
  27029. *
  27030. * Methods defined on the overriding class will not automatically call the methods of
  27031. * the same name in the ancestor class chain. To call the parent's method of the
  27032. * same name you must call {@link Ext.Base#method!callParent callParent}. To skip the
  27033. * method of the overridden class and call its parent you will instead call
  27034. * {@link Ext.Base#method!callSuper callSuper}.
  27035. *
  27036. * See {@link Ext#define Ext.define} for additional usage examples.
  27037. */
  27038. /**
  27039. * @cfg {Object} platformConfig
  27040. * Allows setting config values for a class based on specific platforms. The value
  27041. * of this config is an object whose properties are "rules" and whose values are
  27042. * objects containing config values.
  27043. *
  27044. * For example:
  27045. *
  27046. * Ext.define('App.view.Foo', {
  27047. * extend: 'Ext.panel.Panel',
  27048. *
  27049. * platformConfig: {
  27050. * desktop: {
  27051. * title: 'Some Rather Descriptive Title'
  27052. * },
  27053. *
  27054. * '!desktop': {
  27055. * title: 'Short Title'
  27056. * }
  27057. * }
  27058. * });
  27059. *
  27060. * In the above, "desktop" and "!desktop" are (mutually exclusive) rules. Whichever
  27061. * evaluates to `true` will have its configs applied to the class. In this case, only
  27062. * the "title" property, but the object can contain any number of config properties.
  27063. * In this case, the `platformConfig` is evaluated as part of the class and there is
  27064. * no cost for each instance created.
  27065. *
  27066. * The rules are evaluated expressions in the context of the platform tags contained
  27067. * in `{@link Ext#platformTags Ext.platformTags}`. Any properties of that object are
  27068. * implicitly usable (as shown above).
  27069. *
  27070. * If a `platformConfig` specifies a config value, it will replace any values declared
  27071. * on the class itself.
  27072. *
  27073. * Use of `platformConfig` on instances is handled by the config system when classes
  27074. * call `{@link Ext.Base#initConfig initConfig}`. For example:
  27075. *
  27076. * Ext.create({
  27077. * xtype: 'panel',
  27078. *
  27079. * platformConfig: {
  27080. * desktop: {
  27081. * title: 'Some Rather Descriptive Title'
  27082. * },
  27083. *
  27084. * '!desktop': {
  27085. * title: 'Short Title'
  27086. * }
  27087. * }
  27088. * });
  27089. *
  27090. * The following is equivalent to the above:
  27091. *
  27092. * if (Ext.platformTags.desktop) {
  27093. * Ext.create({
  27094. * xtype: 'panel',
  27095. * title: 'Some Rather Descriptive Title'
  27096. * });
  27097. * } else {
  27098. * Ext.create({
  27099. * xtype: 'panel',
  27100. * title: 'Short Title'
  27101. * });
  27102. * }
  27103. *
  27104. * To adjust configs based on dynamic conditions, see `{@link Ext.mixin.Responsive}`.
  27105. */
  27106. Manager.registerPostprocessor('platformConfig', function(name, Class, data) {
  27107. Class.addPlatformConfig(data);
  27108. });
  27109. /**
  27110. * @cfg {String/String[]} alias
  27111. * @member Ext.Class
  27112. * List of short aliases for class names. An alias consists of a namespace and a name
  27113. * concatenated by a period as &#60;namespace&#62;.&#60;name&#62;
  27114. *
  27115. * - **namespace** - The namespace describes what kind of alias this is and must be
  27116. * all lowercase.
  27117. * - **name** - The name of the alias which allows the lazy-instantiation via the
  27118. * alias. The name shouldn't contain any periods.
  27119. *
  27120. * A list of namespaces and the usages are:
  27121. *
  27122. * - **feature** - {@link Ext.grid.Panel Grid} features
  27123. * - **plugin** - Plugins
  27124. * - **store** - {@link Ext.data.Store}
  27125. * - **widget** - Components
  27126. *
  27127. * Most useful for defining xtypes for widgets:
  27128. *
  27129. * Ext.define('MyApp.CoolPanel', {
  27130. * extend: 'Ext.panel.Panel',
  27131. * alias: ['widget.coolpanel'],
  27132. * title: 'Yeah!'
  27133. * });
  27134. *
  27135. * // Using Ext.create
  27136. * Ext.create('widget.coolpanel');
  27137. *
  27138. * // Using the shorthand for defining widgets by xtype
  27139. * Ext.widget('panel', {
  27140. * items: [
  27141. * {xtype: 'coolpanel', html: 'Foo'},
  27142. * {xtype: 'coolpanel', html: 'Bar'}
  27143. * ]
  27144. * });
  27145. */
  27146. Manager.registerPostprocessor('alias', function(name, cls, data) {
  27147. Ext.classSystemMonitor && Ext.classSystemMonitor(name, 'Ext.ClassManager#aliasPostProcessor', arguments);
  27148. var aliases = Ext.Array.from(data.alias),
  27149. i, ln;
  27150. for (i = 0 , ln = aliases.length; i < ln; i++) {
  27151. alias = aliases[i];
  27152. this.addAlias(cls, alias);
  27153. }
  27154. }, [
  27155. 'xtype',
  27156. 'alias'
  27157. ]);
  27158. /**
  27159. * @cfg {Boolean} singleton
  27160. * @member Ext.Class
  27161. * When set to true, the class will be instantiated as singleton. For example:
  27162. *
  27163. * Ext.define('Logger', {
  27164. * singleton: true,
  27165. * log: function(msg) {
  27166. * console.log(msg);
  27167. * }
  27168. * });
  27169. *
  27170. * Logger.log('Hello');
  27171. */
  27172. Manager.registerPostprocessor('singleton', function(name, cls, data, fn) {
  27173. Ext.classSystemMonitor && Ext.classSystemMonitor(name, 'Ext.ClassManager#singletonPostProcessor', arguments);
  27174. if (data.singleton) {
  27175. fn.call(this, name, new cls(), data);
  27176. } else {
  27177. return true;
  27178. }
  27179. return false;
  27180. });
  27181. /**
  27182. * @cfg {String/String[]} alternateClassName
  27183. * @member Ext.Class
  27184. * Defines alternate names for this class. For example:
  27185. *
  27186. * Ext.define('Developer', {
  27187. * alternateClassName: ['Coder', 'Hacker'],
  27188. * code: function(msg) {
  27189. * alert('Typing... ' + msg);
  27190. * }
  27191. * });
  27192. *
  27193. * var joe = Ext.create('Developer');
  27194. * joe.code('stackoverflow');
  27195. *
  27196. * var rms = Ext.create('Hacker');
  27197. * rms.code('hack hack');
  27198. */
  27199. Manager.registerPostprocessor('alternateClassName', function(name, cls, data) {
  27200. Ext.classSystemMonitor && Ext.classSystemMonitor(name, 'Ext.ClassManager#alternateClassNamePostprocessor', arguments);
  27201. var alternates = data.alternateClassName,
  27202. i, ln, alternate;
  27203. if (!(alternates instanceof Array)) {
  27204. alternates = [
  27205. alternates
  27206. ];
  27207. }
  27208. for (i = 0 , ln = alternates.length; i < ln; i++) {
  27209. alternate = alternates[i];
  27210. if (typeof alternate !== 'string') {
  27211. throw new Error("[Ext.define] Invalid alternate of: '" + alternate + "' for class: '" + name + "'; must be a valid string");
  27212. }
  27213. this.set(alternate, cls);
  27214. }
  27215. });
  27216. /**
  27217. * @cfg {Object} debugHooks
  27218. * A collection of diagnostic methods to decorate the real methods of the class. These
  27219. * methods are applied as an `override` if this class has debug enabled as defined by
  27220. * `Ext.isDebugEnabled`.
  27221. *
  27222. * These will be automatically removed by the Sencha Cmd compiler for production builds.
  27223. *
  27224. * Example usage:
  27225. *
  27226. * Ext.define('Foo.bar.Class', {
  27227. * foo: function (a, b, c) {
  27228. * ...
  27229. * },
  27230. *
  27231. * bar: function (a, b) {
  27232. * ...
  27233. * return 42;
  27234. * },
  27235. *
  27236. * debugHooks: {
  27237. * foo: function (a, b, c) {
  27238. * // check arguments...
  27239. * return this.callParent(arguments);
  27240. * }
  27241. * }
  27242. * });
  27243. *
  27244. * If you specify a `$enabled` property in the `debugHooks` object that will be used
  27245. * as the default enabled state for the hooks. If the `{@link Ext#manifest}` contains
  27246. * a `debug` object of if `{@link Ext#debugConfig}` is specified, the `$enabled` flag
  27247. * will override its "*" value.
  27248. */
  27249. Manager.registerPostprocessor('debugHooks', function(name, Class, data) {
  27250. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#debugHooks', arguments);
  27251. if (Ext.isDebugEnabled(Class.$className, data.debugHooks.$enabled)) {
  27252. delete data.debugHooks.$enabled;
  27253. Ext.override(Class, data.debugHooks);
  27254. }
  27255. // may already have an instance here in the case of singleton
  27256. var target = Class.isInstance ? Class.self : Class;
  27257. delete target.prototype.debugHooks;
  27258. });
  27259. /**
  27260. * @cfg {Object} deprecated
  27261. * The object given has properties that describe the versions at which the deprecations
  27262. * apply.
  27263. *
  27264. * The purpose of the `deprecated` declaration is to enable development mode to give
  27265. * suitable error messages when deprecated methods or properties are used. Methods can
  27266. * always be injected to provide this feedback, but properties can only be handled on
  27267. * some browsers (those that support `Object.defineProperty`).
  27268. *
  27269. * In some cases, deprecated methods can be restored to their previous behavior or
  27270. * added back if they have been removed.
  27271. *
  27272. * The structure of a `deprecated` declaration is this:
  27273. *
  27274. * Ext.define('Foo.bar.Class', {
  27275. * ...
  27276. *
  27277. * deprecated: {
  27278. * // Optional package name - default is the framework (ext or touch)
  27279. * name: 'foobar',
  27280. *
  27281. * '5.0': {
  27282. * methods: {
  27283. * // Throws: '"removedMethod" is deprecated.'
  27284. * removedMethod: null,
  27285. *
  27286. * // Throws: '"oldMethod" is deprecated. Please use "newMethod" instead.'
  27287. * oldMethod: 'newMethod',
  27288. *
  27289. * // When this block is enabled, this method is applied as an
  27290. * // override. Otherwise you get same as "removeMethod".
  27291. * method: function () {
  27292. * // Do what v5 "method" did. If "method" exists in newer
  27293. * // versions callParent can call it. If 5.1 has "method"
  27294. * // then it would be next in line, otherwise 5.2 and last
  27295. * // would be the current class.
  27296. * },
  27297. *
  27298. * moreHelpful: {
  27299. * message: 'Something helpful to do instead.',
  27300. * fn: function () {
  27301. * // The v5 "moreHelpful" method to use when enabled.
  27302. * }
  27303. * }
  27304. * },
  27305. * properties: {
  27306. * // Throws: '"removedProp" is deprecated.'
  27307. * removedProp: null,
  27308. *
  27309. * // Throws: '"oldProp" is deprecated. Please use "newProp" instead.'
  27310. * oldProp: 'newProp',
  27311. *
  27312. * helpful: {
  27313. * message: 'Something helpful message about what to do.'
  27314. * }
  27315. * ...
  27316. * },
  27317. * statics: {
  27318. * methods: {
  27319. * ...
  27320. * },
  27321. * properties: {
  27322. * ...
  27323. * },
  27324. * }
  27325. * },
  27326. *
  27327. * '5.1': {
  27328. * ...
  27329. * },
  27330. *
  27331. * '5.2': {
  27332. * ...
  27333. * }
  27334. * }
  27335. * });
  27336. *
  27337. * The primary content of `deprecated` are the version number keys. These indicate
  27338. * a version number where methods or properties were deprecated. These versions are
  27339. * compared to the version reported by `Ext.getCompatVersion` to determine the action
  27340. * to take for each "block".
  27341. *
  27342. * When the compatibility version is set to a value less than a version number key,
  27343. * that block is said to be "enabled". For example, if a method was deprecated in
  27344. * version 5.0 but the desired compatibility level is 4.2 then the block is used to
  27345. * patch methods and (to some degree) restore pre-5.0 compatibility.
  27346. *
  27347. * When multiple active blocks have the same method name, each method is applied as
  27348. * an override in reverse order of version. In the above example, if a method appears
  27349. * in the "5.0", "5.1" and "5.2" blocks then the "5.2" method is applied as an override
  27350. * first, followed by the "5.1" method and finally the "5.0" method. This means that
  27351. * the `callParent` from the "5.0" method calls the "5.1" method which calls the
  27352. * "5.2" method which can (if applicable) call the current version.
  27353. */
  27354. Manager.registerPostprocessor('deprecated', function(name, Class, data) {
  27355. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#deprecated', arguments);
  27356. // may already have an instance here in the case of singleton
  27357. var target = Class.isInstance ? Class.self : Class;
  27358. target.addDeprecations(data.deprecated);
  27359. delete target.prototype.deprecated;
  27360. });
  27361. Ext.apply(Ext, {
  27362. /**
  27363. * Instantiate a class by either full name, alias or alternate name.
  27364. *
  27365. * If {@link Ext.Loader} is {@link Ext.Loader#setConfig enabled} and the class has
  27366. * not been defined yet, it will attempt to load the class via synchronous loading.
  27367. *
  27368. * For example, all these three lines return the same result:
  27369. *
  27370. * // xtype
  27371. * var window = Ext.create({
  27372. * xtype: 'window',
  27373. * width: 600,
  27374. * height: 800,
  27375. * ...
  27376. * });
  27377. *
  27378. * // alias
  27379. * var window = Ext.create('widget.window', {
  27380. * width: 600,
  27381. * height: 800,
  27382. * ...
  27383. * });
  27384. *
  27385. * // alternate name
  27386. * var window = Ext.create('Ext.Window', {
  27387. * width: 600,
  27388. * height: 800,
  27389. * ...
  27390. * });
  27391. *
  27392. * // full class name
  27393. * var window = Ext.create('Ext.window.Window', {
  27394. * width: 600,
  27395. * height: 800,
  27396. * ...
  27397. * });
  27398. *
  27399. * // single object with xclass property:
  27400. * var window = Ext.create({
  27401. * xclass: 'Ext.window.Window', // any valid value for 'name' (above)
  27402. * width: 600,
  27403. * height: 800,
  27404. * ...
  27405. * });
  27406. *
  27407. * @param {String} [name] The class name or alias. Can be specified as `xclass`
  27408. * property if only one object parameter is specified.
  27409. * @param {Object...} [args] Additional arguments after the name will be passed to
  27410. * the class' constructor.
  27411. * @return {Object} instance
  27412. * @member Ext
  27413. * @method create
  27414. */
  27415. create: function() {
  27416. var name = arguments[0],
  27417. nameType = typeof name,
  27418. args = arraySlice.call(arguments, 1),
  27419. cls;
  27420. if (nameType === 'function') {
  27421. cls = name;
  27422. } else {
  27423. if (nameType !== 'string' && args.length === 0) {
  27424. args = [
  27425. name
  27426. ];
  27427. if (!(name = name.xclass)) {
  27428. name = args[0].xtype;
  27429. if (name) {
  27430. name = 'widget.' + name;
  27431. }
  27432. }
  27433. }
  27434. if (typeof name !== 'string' || name.length < 1) {
  27435. throw new Error("[Ext.create] Invalid class name or alias '" + name + "' specified, must be a non-empty string");
  27436. }
  27437. name = Manager.resolveName(name);
  27438. cls = Manager.get(name);
  27439. }
  27440. // Still not existing at this point, try to load it via synchronous mode as the last resort
  27441. if (!cls) {
  27442. Ext.log.warn("[Ext.Loader] Synchronously loading '" + name + "'; consider adding " + "Ext.require('" + name + "') above Ext.onReady");
  27443. Ext.syncRequire(name);
  27444. cls = Manager.get(name);
  27445. }
  27446. if (!cls) {
  27447. throw new Error("[Ext.create] Unrecognized class name / alias: " + name);
  27448. }
  27449. if (typeof cls !== 'function') {
  27450. throw new Error("[Ext.create] Singleton '" + name + "' cannot be instantiated.");
  27451. }
  27452. return Manager.getInstantiator(args.length)(cls, args);
  27453. },
  27454. /**
  27455. * Convenient shorthand to create a widget by its xtype or a config object.
  27456. *
  27457. * var button = Ext.widget('button'); // Equivalent to Ext.create('widget.button');
  27458. *
  27459. * var panel = Ext.widget('panel', { // Equivalent to Ext.create('widget.panel')
  27460. * title: 'Panel'
  27461. * });
  27462. *
  27463. * var grid = Ext.widget({
  27464. * xtype: 'grid',
  27465. * ...
  27466. * });
  27467. *
  27468. * If a {@link Ext.Component component} instance is passed, it is simply returned.
  27469. *
  27470. * @member Ext
  27471. * @param {String} [name] The xtype of the widget to create.
  27472. * @param {Object} [config] The configuration object for the widget constructor.
  27473. * @return {Object} The widget instance
  27474. */
  27475. widget: function(name, config) {
  27476. // forms:
  27477. // 1: (xtype)
  27478. // 2: (xtype, config)
  27479. // 3: (config)
  27480. // 4: (xtype, component)
  27481. // 5: (component)
  27482. //
  27483. var xtype = name,
  27484. alias, className, T;
  27485. if (typeof xtype !== 'string') {
  27486. // if (form 3 or 5)
  27487. // first arg is config or component
  27488. config = name;
  27489. // arguments[0]
  27490. xtype = config.xtype;
  27491. className = config.xclass;
  27492. } else {
  27493. config = config || {};
  27494. }
  27495. if (config.isComponent) {
  27496. return config;
  27497. }
  27498. if (!className) {
  27499. alias = 'widget.' + xtype;
  27500. className = Manager.getNameByAlias(alias);
  27501. }
  27502. // this is needed to support demand loading of the class
  27503. if (className) {
  27504. T = Manager.get(className);
  27505. }
  27506. if (!T) {
  27507. return Ext.create(className || alias, config);
  27508. }
  27509. return new T(config);
  27510. },
  27511. /**
  27512. * @method createByAlias
  27513. * @inheritdoc Ext.ClassManager#method-instantiateByAlias
  27514. * @member Ext
  27515. */
  27516. createByAlias: alias(Manager, 'instantiateByAlias'),
  27517. /**
  27518. * Defines a class or override. A basic class is defined like this:
  27519. *
  27520. * Ext.define('My.awesome.Class', {
  27521. * someProperty: 'something',
  27522. *
  27523. * someMethod: function(s) {
  27524. * alert(s + this.someProperty);
  27525. * }
  27526. *
  27527. * ...
  27528. * });
  27529. *
  27530. * var obj = new My.awesome.Class();
  27531. *
  27532. * obj.someMethod('Say '); // alerts 'Say something'
  27533. *
  27534. * To create an anonymous class, pass `null` for the `className`:
  27535. *
  27536. * Ext.define(null, {
  27537. * constructor: function () {
  27538. * // ...
  27539. * }
  27540. * });
  27541. *
  27542. * In some cases, it is helpful to create a nested scope to contain some private
  27543. * properties. The best way to do this is to pass a function instead of an object
  27544. * as the second parameter. This function will be called to produce the class
  27545. * body:
  27546. *
  27547. * Ext.define('MyApp.foo.Bar', function () {
  27548. * var id = 0;
  27549. *
  27550. * return {
  27551. * nextId: function () {
  27552. * return ++id;
  27553. * }
  27554. * };
  27555. * });
  27556. *
  27557. * _Note_ that when using override, the above syntax will not override successfully, because
  27558. * the passed function would need to be executed first to determine whether or not the result
  27559. * is an override or defining a new object. As such, an alternative syntax that immediately
  27560. * invokes the function can be used:
  27561. *
  27562. * Ext.define('MyApp.override.BaseOverride', function () {
  27563. * var counter = 0;
  27564. *
  27565. * return {
  27566. * override: 'Ext.Component',
  27567. * logId: function () {
  27568. * console.log(++counter, this.id);
  27569. * }
  27570. * };
  27571. * }());
  27572. *
  27573. *
  27574. * When using this form of `Ext.define`, the function is passed a reference to its
  27575. * class. This can be used as an efficient way to access any static properties you
  27576. * may have:
  27577. *
  27578. * Ext.define('MyApp.foo.Bar', function (Bar) {
  27579. * return {
  27580. * statics: {
  27581. * staticMethod: function () {
  27582. * // ...
  27583. * }
  27584. * },
  27585. *
  27586. * method: function () {
  27587. * return Bar.staticMethod();
  27588. * }
  27589. * };
  27590. * });
  27591. *
  27592. * To define an override, include the `override` property. The content of an
  27593. * override is aggregated with the specified class in order to extend or modify
  27594. * that class. This can be as simple as setting default property values or it can
  27595. * extend and/or replace methods. This can also extend the statics of the class.
  27596. *
  27597. * One use for an override is to break a large class into manageable pieces.
  27598. *
  27599. * // File: /src/app/Panel.js
  27600. *
  27601. * Ext.define('My.app.Panel', {
  27602. * extend: 'Ext.panel.Panel',
  27603. * requires: [
  27604. * 'My.app.PanelPart2',
  27605. * 'My.app.PanelPart3'
  27606. * ]
  27607. *
  27608. * constructor: function (config) {
  27609. * this.callParent(arguments); // calls Ext.panel.Panel's constructor
  27610. * //...
  27611. * },
  27612. *
  27613. * statics: {
  27614. * method: function () {
  27615. * return 'abc';
  27616. * }
  27617. * }
  27618. * });
  27619. *
  27620. * // File: /src/app/PanelPart2.js
  27621. * Ext.define('My.app.PanelPart2', {
  27622. * override: 'My.app.Panel',
  27623. *
  27624. * constructor: function (config) {
  27625. * this.callParent(arguments); // calls My.app.Panel's constructor
  27626. * //...
  27627. * }
  27628. * });
  27629. *
  27630. * Another use of overrides is to provide optional parts of classes that can be
  27631. * independently required. In this case, the class may even be unaware of the
  27632. * override altogether.
  27633. *
  27634. * Ext.define('My.ux.CoolTip', {
  27635. * override: 'Ext.tip.ToolTip',
  27636. *
  27637. * constructor: function (config) {
  27638. * this.callParent(arguments); // calls Ext.tip.ToolTip's constructor
  27639. * //...
  27640. * }
  27641. * });
  27642. *
  27643. * The above override can now be required as normal.
  27644. *
  27645. * Ext.define('My.app.App', {
  27646. * requires: [
  27647. * 'My.ux.CoolTip'
  27648. * ]
  27649. * });
  27650. *
  27651. * Overrides can also contain statics, inheritableStatics, or privates:
  27652. *
  27653. * Ext.define('My.app.BarMod', {
  27654. * override: 'Ext.foo.Bar',
  27655. *
  27656. * statics: {
  27657. * method: function (x) {
  27658. * return this.callParent([x * 2]); // call Ext.foo.Bar.method
  27659. * }
  27660. * }
  27661. * });
  27662. *
  27663. * Starting in version 4.2.2, overrides can declare their `compatibility` based
  27664. * on the framework version or on versions of other packages. For details on the
  27665. * syntax and options for these checks, see `Ext.checkVersion`.
  27666. *
  27667. * The simplest use case is to test framework version for compatibility:
  27668. *
  27669. * Ext.define('App.overrides.grid.Panel', {
  27670. * override: 'Ext.grid.Panel',
  27671. *
  27672. * compatibility: '4.2.2', // only if framework version is 4.2.2
  27673. *
  27674. * //...
  27675. * });
  27676. *
  27677. * An array is treated as an OR, so if any specs match, the override is
  27678. * compatible.
  27679. *
  27680. * Ext.define('App.overrides.some.Thing', {
  27681. * override: 'Foo.some.Thing',
  27682. *
  27683. * compatibility: [
  27684. * '4.2.2',
  27685. * 'foo@1.0.1-1.0.2'
  27686. * ],
  27687. *
  27688. * //...
  27689. * });
  27690. *
  27691. * To require that all specifications match, an object can be provided:
  27692. *
  27693. * Ext.define('App.overrides.some.Thing', {
  27694. * override: 'Foo.some.Thing',
  27695. *
  27696. * compatibility: {
  27697. * and: [
  27698. * '4.2.2',
  27699. * 'foo@1.0.1-1.0.2'
  27700. * ]
  27701. * },
  27702. *
  27703. * //...
  27704. * });
  27705. *
  27706. * Because the object form is just a recursive check, these can be nested:
  27707. *
  27708. * Ext.define('App.overrides.some.Thing', {
  27709. * override: 'Foo.some.Thing',
  27710. *
  27711. * compatibility: {
  27712. * and: [
  27713. * '4.2.2', // exactly version 4.2.2 of the framework *AND*
  27714. * {
  27715. * // either (or both) of these package specs:
  27716. * or: [
  27717. * 'foo@1.0.1-1.0.2',
  27718. * 'bar@3.0+'
  27719. * ]
  27720. * }
  27721. * ]
  27722. * },
  27723. *
  27724. * //...
  27725. * });
  27726. *
  27727. * IMPORTANT: An override is only included in a build if the class it overrides is
  27728. * required. Otherwise, the override, like the target class, is not included. In
  27729. * Sencha Cmd v4, the `compatibility` declaration can likewise be used to remove
  27730. * incompatible overrides from a build.
  27731. *
  27732. * @param {String} className The class name to create in string dot-namespaced format, for example:
  27733. * 'My.very.awesome.Class', 'FeedViewer.plugin.CoolPager'
  27734. * It is highly recommended to follow this simple convention:
  27735. * - The root and the class name are 'CamelCased'
  27736. * - Everything else is lower-cased
  27737. * Pass `null` to create an anonymous class.
  27738. * @param {Object} data The key - value pairs of properties to apply to this class. Property names can be of any valid
  27739. * strings, except those in the reserved listed below:
  27740. *
  27741. * - {@link Ext.Class#cfg-alias alias}
  27742. * - {@link Ext.Class#cfg-alternateClassName alternateClassName}
  27743. * - {@link Ext.Class#cfg-cachedConfig cachedConfig}
  27744. * - {@link Ext.Class#cfg-config config}
  27745. * - {@link Ext.Class#cfg-extend extend}
  27746. * - {@link Ext.Class#cfg-inheritableStatics inheritableStatics}
  27747. * - {@link Ext.Class#cfg-mixins mixins}
  27748. * - {@link Ext.Class#cfg-override override}
  27749. * - {@link Ext.Class#cfg-platformConfig platformConfig}
  27750. * - {@link Ext.Class#cfg-privates privates}
  27751. * - {@link Ext.Class#cfg-requires requires}
  27752. * - `self`
  27753. * - {@link Ext.Class#cfg-singleton singleton}
  27754. * - {@link Ext.Class#cfg-statics statics}
  27755. * - {@link Ext.Class#cfg-uses uses}
  27756. * - {@link Ext.Class#cfg-xtype xtype} (for {@link Ext.Component Components} only)
  27757. *
  27758. * @param {Function} [createdFn] Callback to execute after the class is created, the execution scope of which
  27759. * (`this`) will be the newly created class itself.
  27760. * @return {Ext.Base}
  27761. * @member Ext
  27762. */
  27763. define: function(className, data, createdFn) {
  27764. Ext.classSystemMonitor && Ext.classSystemMonitor(className, 'ClassManager#define', arguments);
  27765. if (data.override) {
  27766. Manager.classState[className] = 20;
  27767. return Manager.createOverride.apply(Manager, arguments);
  27768. }
  27769. Manager.classState[className] = 10;
  27770. return Manager.create.apply(Manager, arguments);
  27771. },
  27772. /**
  27773. * Undefines a class defined using the #define method. Typically used
  27774. * for unit testing where setting up and tearing down a class multiple
  27775. * times is required. For example:
  27776. *
  27777. * // define a class
  27778. * Ext.define('Foo', {
  27779. * ...
  27780. * });
  27781. *
  27782. * // run test
  27783. *
  27784. * // undefine the class
  27785. * Ext.undefine('Foo');
  27786. * @param {String} className The class name to undefine in string dot-namespaced format.
  27787. * @private
  27788. */
  27789. undefine: function(className) {
  27790. Ext.classSystemMonitor && Ext.classSystemMonitor(className, 'Ext.ClassManager#undefine', arguments);
  27791. var classes = Manager.classes;
  27792. if (classes[className]) {
  27793. Manager.classCount--;
  27794. }
  27795. delete classes[className];
  27796. delete Manager.existCache[className];
  27797. delete Manager.classState[className];
  27798. Manager.removeName(className);
  27799. // Indiscriminately clear all factory caches here. It might be slightly inefficient however undefine
  27800. // is typically only called during unit testing.
  27801. Ext.Factory.clearCaches();
  27802. var entry = Manager.getNamespaceEntry(className),
  27803. scope = entry.parent ? Manager.lookupName(entry.parent, false) : Ext.global,
  27804. entryName;
  27805. if (scope) {
  27806. entryName = entry.name;
  27807. // Old IE blows up on attempt to delete window property
  27808. try {
  27809. delete scope[entryName];
  27810. } catch (e) {
  27811. scope[entryName] = undefined;
  27812. }
  27813. }
  27814. // We need to know entry name in unit tests
  27815. return entryName;
  27816. },
  27817. /**
  27818. * @method getClassName
  27819. * @inheritdoc Ext.ClassManager#method-getName
  27820. * @member Ext
  27821. */
  27822. getClassName: alias(Manager, 'getName'),
  27823. /**
  27824. * Returns the displayName property or className or object. When all else fails, returns "Anonymous".
  27825. * @param {Object} object
  27826. * @return {String}
  27827. */
  27828. getDisplayName: function(object) {
  27829. if (object) {
  27830. if (object.displayName) {
  27831. return object.displayName;
  27832. }
  27833. if (object.$name && object.$class) {
  27834. return Ext.getClassName(object.$class) + '#' + object.$name;
  27835. }
  27836. if (object.$className) {
  27837. return object.$className;
  27838. }
  27839. }
  27840. return 'Anonymous';
  27841. },
  27842. /**
  27843. * @method getClass
  27844. * @inheritdoc Ext.ClassManager#method-getClass
  27845. * @member Ext
  27846. */
  27847. getClass: alias(Manager, 'getClass'),
  27848. /**
  27849. * Creates namespaces to be used for scoping variables and classes so that they are not global.
  27850. * Specifying the last node of a namespace implicitly creates all other nodes. Usage:
  27851. *
  27852. * Ext.namespace('Company', 'Company.data');
  27853. *
  27854. * // equivalent and preferable to the above syntax
  27855. * Ext.ns('Company.data');
  27856. *
  27857. * Company.Widget = function() { ... };
  27858. *
  27859. * Company.data.CustomStore = function(config) { ... };
  27860. *
  27861. * @param {String...} namespaces
  27862. * @return {Object} The (last) namespace object created.
  27863. * @member Ext
  27864. * @method namespace
  27865. */
  27866. namespace: function() {
  27867. var root = global,
  27868. i;
  27869. for (i = arguments.length; i-- > 0; ) {
  27870. root = Manager.lookupName(arguments[i], true);
  27871. }
  27872. return root;
  27873. }
  27874. });
  27875. /**
  27876. * This function registers top-level (root) namespaces. This is needed for "sandbox"
  27877. * builds.
  27878. *
  27879. * Ext.addRootNamespaces({
  27880. * MyApp: MyApp,
  27881. * Common: Common
  27882. * });
  27883. *
  27884. * In the above example, `MyApp` and `Common` are top-level namespaces that happen
  27885. * to also be included in the sandbox closure. Something like this:
  27886. *
  27887. * (function(Ext) {
  27888. *
  27889. * Ext.sandboxName = 'Ext6';
  27890. * Ext.isSandboxed = true;
  27891. * Ext.buildSettings = { baseCSSPrefix: "x6-", scopeResetCSS: true };
  27892. *
  27893. * var MyApp = MyApp || {};
  27894. * Ext.addRootNamespaces({ MyApp: MyApp );
  27895. *
  27896. * ... normal app.js goes here ...
  27897. *
  27898. * })(this.Ext6 || (this.Ext6 = {}));
  27899. *
  27900. * The sandbox wrapper around the normally built `app.js` content has to take care
  27901. * of introducing top-level namespaces as well as call this method.
  27902. *
  27903. * @param {Object} namespaces
  27904. * @method addRootNamespaces
  27905. * @member Ext
  27906. * @since 6.0.0
  27907. * @private
  27908. */
  27909. Ext.addRootNamespaces = Manager.addRootNamespaces;
  27910. /**
  27911. * Old name for {@link Ext#widget}.
  27912. * @deprecated 5.0 Use {@link Ext#widget} instead.
  27913. * @method createWidget
  27914. * @member Ext
  27915. * @private
  27916. */
  27917. Ext.createWidget = Ext.widget;
  27918. /**
  27919. * @method ns
  27920. * Convenient alias for {@link Ext#namespace Ext.namespace}.
  27921. * @inheritdoc Ext#method-namespace
  27922. * @member Ext
  27923. */
  27924. Ext.ns = Ext.namespace;
  27925. Class.registerPreprocessor('className', function(cls, data) {
  27926. if ('$className' in data) {
  27927. cls.$className = data.$className;
  27928. cls.displayName = cls.$className;
  27929. }
  27930. Ext.classSystemMonitor && Ext.classSystemMonitor(cls, 'Ext.ClassManager#classNamePreprocessor', arguments);
  27931. }, true, 'first');
  27932. Class.registerPreprocessor('alias', function(cls, data) {
  27933. Ext.classSystemMonitor && Ext.classSystemMonitor(cls, 'Ext.ClassManager#aliasPreprocessor', arguments);
  27934. var prototype = cls.prototype,
  27935. xtypes = arrayFrom(data.xtype),
  27936. aliases = arrayFrom(data.alias),
  27937. widgetPrefix = 'widget.',
  27938. widgetPrefixLength = widgetPrefix.length,
  27939. xtypesChain = Array.prototype.slice.call(prototype.xtypesChain || []),
  27940. xtypesMap = Ext.merge({}, prototype.xtypesMap || {}),
  27941. i, ln, alias, xtype;
  27942. for (i = 0 , ln = aliases.length; i < ln; i++) {
  27943. alias = aliases[i];
  27944. if (typeof alias !== 'string' || alias.length < 1) {
  27945. throw new Error("[Ext.define] Invalid alias of: '" + alias + "' for class: '" + name + "'; must be a valid string");
  27946. }
  27947. if (alias.substring(0, widgetPrefixLength) === widgetPrefix) {
  27948. xtype = alias.substring(widgetPrefixLength);
  27949. Ext.Array.include(xtypes, xtype);
  27950. }
  27951. }
  27952. cls.xtype = data.xtype = xtypes[0];
  27953. data.xtypes = xtypes;
  27954. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  27955. xtype = xtypes[i];
  27956. if (!xtypesMap[xtype]) {
  27957. xtypesMap[xtype] = true;
  27958. xtypesChain.push(xtype);
  27959. }
  27960. }
  27961. data.xtypesChain = xtypesChain;
  27962. data.xtypesMap = xtypesMap;
  27963. // Class is already extended at this point
  27964. Ext.Function.interceptAfterOnce(cls, 'onClassCreated', function() {
  27965. var cls = this,
  27966. prototype = cls.prototype,
  27967. mixins = prototype.mixins,
  27968. key, mixin;
  27969. Ext.classSystemMonitor && Ext.classSystemMonitor(cls, 'Ext.ClassManager#aliasPreprocessor#afterClassCreated', arguments);
  27970. for (key in mixins) {
  27971. if (mixins.hasOwnProperty(key)) {
  27972. mixin = mixins[key];
  27973. xtypes = mixin.xtypes;
  27974. if (xtypes) {
  27975. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  27976. xtype = xtypes[i];
  27977. if (!xtypesMap[xtype]) {
  27978. xtypesMap[xtype] = true;
  27979. xtypesChain.push(xtype);
  27980. }
  27981. }
  27982. }
  27983. }
  27984. }
  27985. });
  27986. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  27987. xtype = xtypes[i];
  27988. if (typeof xtype !== 'string' || xtype.length < 1) {
  27989. throw new Error("[Ext.define] Invalid xtype of: '" + xtype + "' for class: '" + name + "'; must be a valid non-empty string");
  27990. }
  27991. Ext.Array.include(aliases, widgetPrefix + xtype);
  27992. }
  27993. data.alias = aliases;
  27994. }, [
  27995. 'xtype',
  27996. 'alias'
  27997. ]);
  27998. // load the cmd-5 style app manifest metadata now, if available...
  27999. if (Ext.manifest) {
  28000. var manifest = Ext.manifest,
  28001. classes = manifest.classes,
  28002. paths = manifest.paths,
  28003. aliases = {},
  28004. alternates = {},
  28005. className, obj, name, path, baseUrl;
  28006. if (paths) {
  28007. // if the manifest paths were calculated as relative to the
  28008. // bootstrap file, then we need to prepend Boot.baseUrl to the
  28009. // paths before processing
  28010. if (manifest.bootRelative) {
  28011. baseUrl = Ext.Boot.baseUrl;
  28012. for (path in paths) {
  28013. if (paths.hasOwnProperty(path)) {
  28014. paths[path] = baseUrl + paths[path];
  28015. }
  28016. }
  28017. }
  28018. Manager.setPath(paths);
  28019. }
  28020. if (classes) {
  28021. for (className in classes) {
  28022. alternates[className] = [];
  28023. aliases[className] = [];
  28024. obj = classes[className];
  28025. if (obj.alias) {
  28026. aliases[className] = obj.alias;
  28027. }
  28028. if (obj.alternates) {
  28029. alternates[className] = obj.alternates;
  28030. }
  28031. }
  28032. }
  28033. Manager.addAlias(aliases);
  28034. Manager.addAlternate(alternates);
  28035. }
  28036. return Manager;
  28037. }(Ext.Class, Ext.Function.alias, Array.prototype.slice, Ext.Array.from, Ext.global));
  28038. /**
  28039. * @class Ext.env.Browser
  28040. * Provides information about browser.
  28041. *
  28042. * Should not be manually instantiated unless for unit-testing.
  28043. * Access the global instance stored in {@link Ext.browser} instead.
  28044. * @private
  28045. */
  28046. (Ext.env || (Ext.env = {})).Browser = function(userAgent, publish) {
  28047. // @define Ext.env.Browser
  28048. // @define Ext.browser
  28049. // @require Ext.Object
  28050. // @require Ext.Version
  28051. var me = this,
  28052. browserPrefixes = Ext.Boot.browserPrefixes,
  28053. browserNames = Ext.Boot.browserNames,
  28054. enginePrefixes = me.enginePrefixes,
  28055. engineNames = me.engineNames,
  28056. browserMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(browserPrefixes).join(')|(?:') + '))([\\w\\._]+)')),
  28057. engineMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(enginePrefixes).join(')|(?:') + '))([\\w\\._]+)')),
  28058. browserName = browserNames.other,
  28059. engineName = engineNames.other,
  28060. browserVersion = '',
  28061. engineVersion = '',
  28062. majorVer = '',
  28063. isWebView = false,
  28064. edgeRE = /(Edge\/)([\w.]+)/,
  28065. ripple = '',
  28066. i, prefix, name;
  28067. /**
  28068. * @property {String}
  28069. * Browser User Agent string.
  28070. */
  28071. me.userAgent = userAgent;
  28072. /**
  28073. * A "hybrid" property, can be either accessed as a method call, for example:
  28074. *
  28075. * if (Ext.browser.is('IE')) {
  28076. * // ...
  28077. * }
  28078. *
  28079. * Or as an object with Boolean properties, for example:
  28080. *
  28081. * if (Ext.browser.is.IE) {
  28082. * // ...
  28083. * }
  28084. *
  28085. * Versions can be conveniently checked as well. For example:
  28086. *
  28087. * if (Ext.browser.is.IE10) {
  28088. * // Equivalent to (Ext.browser.is.IE && Ext.browser.version.equals(10))
  28089. * }
  28090. *
  28091. * __Note:__ Only {@link Ext.Version#getMajor major component} and {@link Ext.Version#getShortVersion simplified}
  28092. * value of the version are available via direct property checking.
  28093. *
  28094. * Supported values are:
  28095. *
  28096. * - IE
  28097. * - Firefox
  28098. * - Safari
  28099. * - Chrome
  28100. * - Opera
  28101. * - WebKit
  28102. * - Gecko
  28103. * - Presto
  28104. * - Trident
  28105. * - WebView
  28106. * - Other
  28107. *
  28108. * @param {String} name The OS name to check.
  28109. * @return {Boolean}
  28110. */
  28111. this.is = function(name) {
  28112. // Since this function reference also acts as a map, we do not want it to be
  28113. // shared between instances, so it is defined here, not on the prototype.
  28114. return !!this.is[name];
  28115. };
  28116. // Edge has a userAgent with All browsers so we manage it separately
  28117. // "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
  28118. if (/Edge\//.test(userAgent)) {
  28119. browserMatch = userAgent.match(edgeRE);
  28120. engineMatch = userAgent.match(edgeRE);
  28121. }
  28122. if (browserMatch) {
  28123. browserName = browserNames[Ext.Object.getKey(browserPrefixes, browserMatch[1])];
  28124. if (browserName === 'Safari' && /^Opera/.test(userAgent)) {
  28125. // Prevent Opera 12 and earlier from being incorrectly reported as Safari
  28126. browserName = 'Opera';
  28127. }
  28128. browserVersion = new Ext.Version(browserMatch[2]);
  28129. }
  28130. if (engineMatch) {
  28131. engineName = engineNames[Ext.Object.getKey(enginePrefixes, engineMatch[1])];
  28132. engineVersion = new Ext.Version(engineMatch[2]);
  28133. }
  28134. if (engineName === 'Trident' && browserName !== 'IE') {
  28135. browserName = 'IE';
  28136. var version = userAgent.match(/.*rv:(\d+.\d+)/);
  28137. if (version && version.length) {
  28138. version = version[1];
  28139. browserVersion = new Ext.Version(version);
  28140. }
  28141. }
  28142. if (browserName && browserVersion) {
  28143. Ext.setVersion(browserName, browserVersion);
  28144. }
  28145. /**
  28146. * @property chromeVersion
  28147. * The current version of Chrome (0 if the browser is not Chrome).
  28148. * @readonly
  28149. * @type Number
  28150. * @member Ext
  28151. */
  28152. /**
  28153. * @property firefoxVersion
  28154. * The current version of Firefox (0 if the browser is not Firefox).
  28155. * @readonly
  28156. * @type Number
  28157. * @member Ext
  28158. */
  28159. /**
  28160. * @property ieVersion
  28161. * The current version of IE (0 if the browser is not IE). This does not account
  28162. * for the documentMode of the current page, which is factored into {@link #isIE8},
  28163. * and {@link #isIE9}. Thus this is not always true:
  28164. *
  28165. * Ext.isIE8 == (Ext.ieVersion == 8)
  28166. *
  28167. * @readonly
  28168. * @type Number
  28169. * @member Ext
  28170. */
  28171. /**
  28172. * @property isChrome
  28173. * True if the detected browser is Chrome.
  28174. * @readonly
  28175. * @type Boolean
  28176. * @member Ext
  28177. */
  28178. /**
  28179. * @property isGecko
  28180. * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
  28181. * @readonly
  28182. * @type Boolean
  28183. * @member Ext
  28184. */
  28185. /**
  28186. * @property isIE
  28187. * True if the detected browser is Internet Explorer.
  28188. * @readonly
  28189. * @type Boolean
  28190. * @member Ext
  28191. */
  28192. /**
  28193. * @property isIE8
  28194. * True if the detected browser is Internet Explorer 8.x.
  28195. * @readonly
  28196. * @type Boolean
  28197. * @member Ext
  28198. */
  28199. /**
  28200. * @property isIE8m
  28201. * True if the detected browser is Internet Explorer 8.x or lower.
  28202. * @readonly
  28203. * @type Boolean
  28204. * @member Ext
  28205. */
  28206. /**
  28207. * @property isIE8p
  28208. * True if the detected browser is Internet Explorer 8.x or higher.
  28209. * @readonly
  28210. * @type Boolean
  28211. * @member Ext
  28212. */
  28213. /**
  28214. * @property isIE9
  28215. * True if the detected browser is Internet Explorer 9.x.
  28216. * @readonly
  28217. * @type Boolean
  28218. * @member Ext
  28219. */
  28220. /**
  28221. * @property isIE9m
  28222. * True if the detected browser is Internet Explorer 9.x or lower.
  28223. * @readonly
  28224. * @type Boolean
  28225. * @member Ext
  28226. */
  28227. /**
  28228. * @property isIE9p
  28229. * True if the detected browser is Internet Explorer 9.x or higher.
  28230. * @readonly
  28231. * @type Boolean
  28232. * @member Ext
  28233. */
  28234. /**
  28235. * @property isIE10
  28236. * True if the detected browser is Internet Explorer 10.x.
  28237. * @readonly
  28238. * @type Boolean
  28239. * @member Ext
  28240. */
  28241. /**
  28242. * @property isIE10m
  28243. * True if the detected browser is Internet Explorer 10.x or lower.
  28244. * @readonly
  28245. * @type Boolean
  28246. * @member Ext
  28247. */
  28248. /**
  28249. * @property isIE10p
  28250. * True if the detected browser is Internet Explorer 10.x or higher.
  28251. * @readonly
  28252. * @type Boolean
  28253. * @member Ext
  28254. */
  28255. /**
  28256. * @property isIE11
  28257. * True if the detected browser is Internet Explorer 11.x.
  28258. * @readonly
  28259. * @type Boolean
  28260. * @member Ext
  28261. */
  28262. /**
  28263. * @property isIE11m
  28264. * True if the detected browser is Internet Explorer 11.x or lower.
  28265. * @readonly
  28266. * @type Boolean
  28267. * @member Ext
  28268. */
  28269. /**
  28270. * @property isIE11p
  28271. * True if the detected browser is Internet Explorer 11.x or higher.
  28272. * @readonly
  28273. * @type Boolean
  28274. * @member Ext
  28275. */
  28276. /**
  28277. * @property isEdge
  28278. * True if the detected browser is Edge.
  28279. * @readonly
  28280. * @type Boolean
  28281. * @member Ext
  28282. */
  28283. /**
  28284. * @property isLinux
  28285. * True if the detected platform is Linux.
  28286. * @readonly
  28287. * @type Boolean
  28288. * @member Ext
  28289. */
  28290. /**
  28291. * @property isMac
  28292. * True if the detected platform is Mac OS.
  28293. * @readonly
  28294. * @type Boolean
  28295. * @member Ext
  28296. */
  28297. /**
  28298. * @property isOpera
  28299. * True if the detected browser is Opera.
  28300. * @readonly
  28301. * @type Boolean
  28302. * @member Ext
  28303. */
  28304. /**
  28305. * @property isSafari
  28306. * True if the detected browser is Safari.
  28307. * @readonly
  28308. * @type Boolean
  28309. * @member Ext
  28310. */
  28311. /**
  28312. * @property isWebKit
  28313. * True if the detected browser uses WebKit.
  28314. * @readonly
  28315. * @type Boolean
  28316. * @member Ext
  28317. */
  28318. /**
  28319. * @property isWindows
  28320. * True if the detected platform is Windows.
  28321. * @readonly
  28322. * @type Boolean
  28323. * @member Ext
  28324. */
  28325. /**
  28326. * @property operaVersion
  28327. * The current version of Opera (0 if the browser is not Opera).
  28328. * @readonly
  28329. * @type Number
  28330. * @member Ext
  28331. */
  28332. /**
  28333. * @property safariVersion
  28334. * The current version of Safari (0 if the browser is not Safari).
  28335. * @readonly
  28336. * @type Number
  28337. * @member Ext
  28338. */
  28339. /**
  28340. * @property webKitVersion
  28341. * The current version of WebKit (0 if the browser does not use WebKit).
  28342. * @readonly
  28343. * @type Number
  28344. * @member Ext
  28345. */
  28346. // Facebook changes the userAgent when you view a website within their iOS app. For some reason, the strip out information
  28347. // about the browser, so we have to detect that and fake it...
  28348. if (userAgent.match(/FB/) && browserName === 'Other') {
  28349. browserName = browserNames.safari;
  28350. engineName = engineNames.webkit;
  28351. }
  28352. // Detect chrome first as Chrome in Android 8.0 introduced OPR in the user agent
  28353. else if (userAgent.match(/Android.*Chrome/g)) {
  28354. browserName = 'ChromeMobile';
  28355. } else {
  28356. browserMatch = userAgent.match(/OPR\/(\d+.\d+)/);
  28357. if (browserMatch) {
  28358. browserName = 'Opera';
  28359. browserVersion = new Ext.Version(browserMatch[1]);
  28360. }
  28361. }
  28362. Ext.apply(this, {
  28363. engineName: engineName,
  28364. engineVersion: engineVersion,
  28365. name: browserName,
  28366. version: browserVersion
  28367. });
  28368. this.setFlag(browserName, true, publish);
  28369. // e.g., Ext.isIE
  28370. if (browserVersion) {
  28371. majorVer = browserVersion.getMajor() || '';
  28372. if (me.is.IE) {
  28373. majorVer = document.documentMode || parseInt(majorVer, 10);
  28374. for (i = 7; i <= 11; ++i) {
  28375. prefix = 'isIE' + i;
  28376. Ext[prefix] = majorVer === i;
  28377. Ext[prefix + 'm'] = majorVer <= i;
  28378. Ext[prefix + 'p'] = majorVer >= i;
  28379. }
  28380. }
  28381. if (me.is.Opera && parseInt(majorVer, 10) <= 12) {
  28382. Ext.isOpera12m = true;
  28383. }
  28384. Ext.chromeVersion = Ext.isChrome ? majorVer : 0;
  28385. Ext.firefoxVersion = Ext.isFirefox ? majorVer : 0;
  28386. Ext.ieVersion = Ext.isIE ? majorVer : 0;
  28387. Ext.operaVersion = Ext.isOpera ? majorVer : 0;
  28388. Ext.safariVersion = Ext.isSafari ? majorVer : 0;
  28389. Ext.webKitVersion = Ext.isWebKit ? majorVer : 0;
  28390. this.setFlag(browserName + majorVer, true, publish);
  28391. // Ext.isIE10
  28392. this.setFlag(browserName + browserVersion.getShortVersion());
  28393. }
  28394. for (i in browserNames) {
  28395. if (browserNames.hasOwnProperty(i)) {
  28396. name = browserNames[i];
  28397. this.setFlag(name, browserName === name);
  28398. }
  28399. }
  28400. this.setFlag(name);
  28401. if (engineVersion) {
  28402. this.setFlag(engineName + (engineVersion.getMajor() || ''));
  28403. this.setFlag(engineName + engineVersion.getShortVersion());
  28404. }
  28405. for (i in engineNames) {
  28406. if (engineNames.hasOwnProperty(i)) {
  28407. name = engineNames[i];
  28408. this.setFlag(name, engineName === name, publish);
  28409. }
  28410. }
  28411. this.setFlag('Standalone', !!navigator.standalone);
  28412. // Cross domain access could throw an error
  28413. try {
  28414. ripple = window.top.ripple;
  28415. } catch (e) {}
  28416. // Do nothing, can't access cross frame so leave it empty
  28417. this.setFlag('Ripple', !!document.getElementById("tinyhippos-injected") && !Ext.isEmpty(ripple));
  28418. this.setFlag('WebWorks', !!window.blackberry);
  28419. if (window.PhoneGap !== undefined || window.Cordova !== undefined || window.cordova !== undefined) {
  28420. isWebView = true;
  28421. this.setFlag('PhoneGap');
  28422. this.setFlag('Cordova');
  28423. }
  28424. // Check if running in UIWebView
  28425. if (/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(userAgent)) {
  28426. isWebView = true;
  28427. }
  28428. // Flag to check if it we are in the WebView
  28429. this.setFlag('WebView', isWebView);
  28430. /**
  28431. * @property {Boolean}
  28432. * `true` if browser is using strict mode.
  28433. */
  28434. this.isStrict = Ext.isStrict = document.compatMode === "CSS1Compat";
  28435. /**
  28436. * @property {Boolean}
  28437. * `true` if page is running over SSL.
  28438. */
  28439. this.isSecure = Ext.isSecure;
  28440. // IE10Quirks, Chrome26Strict, etc.
  28441. this.identity = browserName + majorVer + (this.isStrict ? 'Strict' : 'Quirks');
  28442. };
  28443. Ext.env.Browser.prototype = {
  28444. constructor: Ext.env.Browser,
  28445. engineNames: {
  28446. edge: 'Edge',
  28447. webkit: 'WebKit',
  28448. gecko: 'Gecko',
  28449. presto: 'Presto',
  28450. trident: 'Trident',
  28451. other: 'Other'
  28452. },
  28453. enginePrefixes: {
  28454. edge: 'Edge/',
  28455. webkit: 'AppleWebKit/',
  28456. gecko: 'Gecko/',
  28457. presto: 'Presto/',
  28458. trident: 'Trident/'
  28459. },
  28460. styleDashPrefixes: {
  28461. WebKit: '-webkit-',
  28462. Gecko: '-moz-',
  28463. Trident: '-ms-',
  28464. Presto: '-o-',
  28465. Other: ''
  28466. },
  28467. stylePrefixes: {
  28468. WebKit: 'Webkit',
  28469. Gecko: 'Moz',
  28470. Trident: 'ms',
  28471. Presto: 'O',
  28472. Other: ''
  28473. },
  28474. propertyPrefixes: {
  28475. WebKit: 'webkit',
  28476. Gecko: 'moz',
  28477. Trident: 'ms',
  28478. Presto: 'o',
  28479. Other: ''
  28480. },
  28481. // scope: Ext.env.Browser.prototype
  28482. /**
  28483. * The full name of the current browser.
  28484. * Possible values are:
  28485. *
  28486. * - IE
  28487. * - Firefox
  28488. * - Safari
  28489. * - Chrome
  28490. * - Opera
  28491. * - Other
  28492. * @type String
  28493. * @readonly
  28494. */
  28495. name: null,
  28496. /**
  28497. * Refer to {@link Ext.Version}.
  28498. * @type Ext.Version
  28499. * @readonly
  28500. */
  28501. version: null,
  28502. /**
  28503. * The full name of the current browser's engine.
  28504. * Possible values are:
  28505. *
  28506. * - WebKit
  28507. * - Gecko
  28508. * - Presto
  28509. * - Trident
  28510. * - Other
  28511. * @type String
  28512. * @readonly
  28513. */
  28514. engineName: null,
  28515. /**
  28516. * Refer to {@link Ext.Version}.
  28517. * @type Ext.Version
  28518. * @readonly
  28519. */
  28520. engineVersion: null,
  28521. setFlag: function(name, value, publish) {
  28522. if (value === undefined) {
  28523. value = true;
  28524. }
  28525. this.is[name] = value;
  28526. this.is[name.toLowerCase()] = value;
  28527. if (publish) {
  28528. Ext['is' + name] = value;
  28529. }
  28530. return this;
  28531. },
  28532. getStyleDashPrefix: function() {
  28533. return this.styleDashPrefixes[this.engineName];
  28534. },
  28535. getStylePrefix: function() {
  28536. return this.stylePrefixes[this.engineName];
  28537. },
  28538. getVendorProperyName: function(name) {
  28539. var prefix = this.propertyPrefixes[this.engineName];
  28540. if (prefix.length > 0) {
  28541. return prefix + Ext.String.capitalize(name);
  28542. }
  28543. return name;
  28544. }
  28545. };
  28546. /**
  28547. * @class Ext.browser
  28548. * @extends Ext.env.Browser
  28549. * @singleton
  28550. * Provides useful information about the current browser.
  28551. *
  28552. * Example:
  28553. *
  28554. * if (Ext.browser.is.IE) {
  28555. * // IE specific code here
  28556. * }
  28557. *
  28558. * if (Ext.browser.is.WebKit) {
  28559. * // WebKit specific code here
  28560. * }
  28561. *
  28562. * console.log("Version " + Ext.browser.version);
  28563. *
  28564. * For a full list of supported values, refer to {@link #is} property/method.
  28565. *
  28566. */
  28567. (function(userAgent) {
  28568. Ext.browser = new Ext.env.Browser(userAgent, true);
  28569. Ext.userAgent = userAgent.toLowerCase();
  28570. /**
  28571. * @property {String} SSL_SECURE_URL
  28572. * URL to a blank file used by Ext when in secure mode for iframe src and onReady src
  28573. * to prevent the IE insecure content warning (`'about:blank'`, except for IE
  28574. * in secure mode, which is `'javascript:""'`).
  28575. * @member Ext
  28576. */
  28577. Ext.SSL_SECURE_URL = Ext.isSecure && Ext.isIE ? 'javascript:\'\'' : 'about:blank';
  28578. }(// jshint ignore:line
  28579. Ext.global.navigator.userAgent));
  28580. /**
  28581. * @class Ext.env.OS
  28582. *
  28583. * Provides information about operating system environment.
  28584. *
  28585. * Should not be manually instantiated unless for unit-testing.
  28586. * Access the global instance stored in {@link Ext.os} instead.
  28587. * @private
  28588. */
  28589. Ext.env.OS = function(userAgent, platform, browserScope) {
  28590. // @define Ext.env.OS
  28591. // @define Ext.os
  28592. // @require Ext.Version
  28593. // @require Ext.env.Browser
  28594. var me = this,
  28595. names = Ext.Boot.osNames,
  28596. prefixes = Ext.Boot.osPrefixes,
  28597. name,
  28598. version = '',
  28599. is = me.is,
  28600. i, prefix, match, item, match1;
  28601. browserScope = browserScope || Ext.browser;
  28602. for (i in prefixes) {
  28603. if (prefixes.hasOwnProperty(i)) {
  28604. prefix = prefixes[i];
  28605. match = userAgent.match(new RegExp('(?:' + prefix + ')([^\\s;]+)'));
  28606. if (match) {
  28607. name = names[i];
  28608. match1 = match[1];
  28609. // This is here because some HTC android devices show an OSX Snow Leopard userAgent by default.
  28610. // And the Kindle Fire doesn't have any indicator of Android as the OS in its User Agent
  28611. if (match1 && match1 === "HTC_") {
  28612. version = new Ext.Version("2.3");
  28613. } else if (match1 && match1 === "Silk/") {
  28614. version = new Ext.Version("2.3");
  28615. } else {
  28616. version = new Ext.Version(match[match.length - 1]);
  28617. }
  28618. break;
  28619. }
  28620. }
  28621. }
  28622. if (!name) {
  28623. name = names[(userAgent.toLowerCase().match(/mac|win|linux/) || [
  28624. 'other'
  28625. ])[0]];
  28626. version = new Ext.Version('');
  28627. }
  28628. this.name = name;
  28629. this.version = version;
  28630. // This is added as a workaround for Chrome iPad emulation mode
  28631. // it will report the platform of the machine (MacIntel, Win32, etc) instead
  28632. // of an emulated platform
  28633. if (userAgent.match(/ipad/i)) {
  28634. platform = 'iPad';
  28635. }
  28636. if (platform) {
  28637. this.setFlag(platform.replace(/ simulator$/i, ''));
  28638. }
  28639. this.setFlag(name);
  28640. if (version) {
  28641. this.setFlag(name + (version.getMajor() || ''));
  28642. this.setFlag(name + version.getShortVersion());
  28643. }
  28644. for (i in names) {
  28645. if (names.hasOwnProperty(i)) {
  28646. item = names[i];
  28647. if (!is.hasOwnProperty(name)) {
  28648. this.setFlag(item, (name === item));
  28649. }
  28650. }
  28651. }
  28652. // Detect if the device is the iPhone 5.
  28653. if (this.name === "iOS" && window.screen.height === 568) {
  28654. this.setFlag('iPhone5');
  28655. }
  28656. if (browserScope.is.Safari || browserScope.is.Silk) {
  28657. // Ext.browser.version.shortVersion == 501 is for debugging off device
  28658. if (this.is.Android2 || this.is.Android3 || browserScope.version.shortVersion === 501) {
  28659. browserScope.setFlag("AndroidStock");
  28660. }
  28661. if (this.is.Android4) {
  28662. browserScope.setFlag("AndroidStock");
  28663. browserScope.setFlag("AndroidStock4");
  28664. }
  28665. }
  28666. };
  28667. Ext.env.OS.prototype = {
  28668. constructor: Ext.env.OS,
  28669. /**
  28670. * A "hybrid" property, can be either accessed as a method call, i.e:
  28671. *
  28672. * if (Ext.os.is('Android')) {
  28673. * // ...
  28674. * }
  28675. *
  28676. * or as an object with boolean properties, i.e:
  28677. *
  28678. * if (Ext.os.is.Android) {
  28679. * // ...
  28680. * }
  28681. *
  28682. * Versions can be conveniently checked as well. For example:
  28683. *
  28684. * if (Ext.os.is.Android2) {
  28685. * // Equivalent to (Ext.os.is.Android && Ext.os.version.equals(2))
  28686. * }
  28687. *
  28688. * if (Ext.os.is.iOS32) {
  28689. * // Equivalent to (Ext.os.is.iOS && Ext.os.version.equals(3.2))
  28690. * }
  28691. *
  28692. * Note that only {@link Ext.Version#getMajor major component} and {@link Ext.Version#getShortVersion simplified}
  28693. * value of the version are available via direct property checking. Supported values are:
  28694. *
  28695. * - iOS
  28696. * - iPad
  28697. * - iPhone
  28698. * - iPhone5 (also true for 4in iPods).
  28699. * - iPod
  28700. * - Android
  28701. * - WebOS
  28702. * - BlackBerry
  28703. * - Bada
  28704. * - MacOS
  28705. * - Windows
  28706. * - Linux
  28707. * - Other
  28708. * @member Ext.os
  28709. * @param {String} name The OS name to check.
  28710. * @return {Boolean}
  28711. */
  28712. is: function(name) {
  28713. return !!this[name];
  28714. },
  28715. /**
  28716. * @property {String} [name=null]
  28717. * @readonly
  28718. * @member Ext.os
  28719. * The full name of the current operating system. Possible values are:
  28720. *
  28721. * - iOS
  28722. * - Android
  28723. * - WebOS
  28724. * - BlackBerry,
  28725. * - MacOS
  28726. * - Windows
  28727. * - Linux
  28728. * - Other
  28729. */
  28730. name: null,
  28731. /**
  28732. * @property {Ext.Version} [version=null]
  28733. * Refer to {@link Ext.Version}
  28734. * @member Ext.os
  28735. * @readonly
  28736. */
  28737. version: null,
  28738. setFlag: function(name, value) {
  28739. if (value === undefined) {
  28740. value = true;
  28741. }
  28742. if (this.flags) {
  28743. this.flags[name] = value;
  28744. }
  28745. this.is[name] = value;
  28746. this.is[name.toLowerCase()] = value;
  28747. return this;
  28748. }
  28749. };
  28750. (function() {
  28751. var navigation = Ext.global.navigator,
  28752. userAgent = navigation.userAgent,
  28753. OS = Ext.env.OS,
  28754. is = (Ext.is || (Ext.is = {})),
  28755. osEnv, osName, deviceType;
  28756. OS.prototype.flags = is;
  28757. /**
  28758. * @class Ext.os
  28759. * @extends Ext.env.OS
  28760. * @singleton
  28761. * Provides useful information about the current operating system environment.
  28762. *
  28763. * Example:
  28764. *
  28765. * if (Ext.os.is.Windows) {
  28766. * // Windows specific code here
  28767. * }
  28768. *
  28769. * if (Ext.os.is.iOS) {
  28770. * // iPad, iPod, iPhone, etc.
  28771. * }
  28772. *
  28773. * console.log("Version " + Ext.os.version);
  28774. *
  28775. * For a full list of supported values, refer to the {@link #is} property/method.
  28776. *
  28777. */
  28778. Ext.os = osEnv = new OS(userAgent, navigation.platform);
  28779. osName = osEnv.name;
  28780. // A couple compatible flavors:
  28781. Ext['is' + osName] = true;
  28782. // e.g., Ext.isWindows
  28783. Ext.isMac = is.Mac = is.MacOS;
  28784. Ext.isApple = Ext.isMac || Ext.isiOS;
  28785. var search = window.location.search.match(/deviceType=(Tablet|Phone)/),
  28786. nativeDeviceType = window.deviceType;
  28787. // Override deviceType by adding a get variable of deviceType. NEEDED FOR DOCS APP.
  28788. // E.g: example/kitchen-sink.html?deviceType=Phone
  28789. if (search && search[1]) {
  28790. deviceType = search[1];
  28791. } else if (nativeDeviceType === 'iPhone') {
  28792. deviceType = 'Phone';
  28793. } else if (nativeDeviceType === 'iPad') {
  28794. deviceType = 'Tablet';
  28795. } else {
  28796. if (!osEnv.is.Android && !osEnv.is.iOS && !osEnv.is.WindowsPhone && /Windows|Linux|MacOS|ChromeOS/.test(osName)) {
  28797. deviceType = 'Desktop';
  28798. // always set it to false when you are on a desktop not using Ripple Emulation
  28799. Ext.browser.is.WebView = !!Ext.browser.is.Ripple;
  28800. } else if (osEnv.is.iPad || osEnv.is.RIMTablet || osEnv.is.Android3 || Ext.browser.is.Silk || (osEnv.is.Android && userAgent.search(/mobile/i) === -1)) {
  28801. deviceType = 'Tablet';
  28802. } else {
  28803. deviceType = 'Phone';
  28804. }
  28805. }
  28806. /**
  28807. * @property {String} deviceType
  28808. * The generic type of the current device.
  28809. *
  28810. * Possible values:
  28811. *
  28812. * - Phone
  28813. * - Tablet
  28814. * - Desktop
  28815. *
  28816. * For testing purposes the deviceType can be overridden by adding
  28817. * a deviceType parameter to the URL of the page, like so:
  28818. *
  28819. * http://localhost/mypage.html?deviceType=Tablet
  28820. *
  28821. * @member Ext.os
  28822. */
  28823. osEnv.setFlag(deviceType, true);
  28824. osEnv.deviceType = deviceType;
  28825. delete OS.prototype.flags;
  28826. }());
  28827. /**
  28828. * @class Ext.feature
  28829. * @singleton
  28830. *
  28831. * A simple class to verify if a browser feature exists or not on the current device.
  28832. *
  28833. * if (Ext.feature.has.Canvas) {
  28834. * // do some cool things with canvas here
  28835. * }
  28836. *
  28837. * See the {@link #has} property/method for details of the features that can be detected.
  28838. *
  28839. */
  28840. Ext.feature = {
  28841. // @define Ext.env.Feature
  28842. // @define Ext.feature
  28843. // @define Ext.supports
  28844. // @require Ext.String
  28845. // @require Ext.env.Browser
  28846. // @require Ext.env.OS
  28847. /**
  28848. * @method has
  28849. * @member Ext.feature
  28850. * Verifies if a browser feature exists or not on the current device.
  28851. *
  28852. * A "hybrid" property, can be either accessed as a method call, i.e:
  28853. *
  28854. * if (Ext.feature.has('Canvas')) {
  28855. * // ...
  28856. * }
  28857. *
  28858. * or as an object with boolean properties, i.e:
  28859. *
  28860. * if (Ext.feature.has.Canvas) {
  28861. * // ...
  28862. * }
  28863. *
  28864. * For possible properties/parameter values see `Ext.supports`.
  28865. *
  28866. * @param {String} name The feature name to check.
  28867. * @return {Boolean}
  28868. */
  28869. has: function(name) {
  28870. return !!this.has[name];
  28871. },
  28872. testElements: {},
  28873. getTestElement: function(tag, createNew) {
  28874. if (tag === undefined) {
  28875. tag = 'div';
  28876. } else if (typeof tag !== 'string') {
  28877. return tag;
  28878. }
  28879. if (createNew) {
  28880. return document.createElement(tag);
  28881. }
  28882. if (!this.testElements[tag]) {
  28883. this.testElements[tag] = document.createElement(tag);
  28884. }
  28885. return this.testElements[tag];
  28886. },
  28887. isStyleSupported: function(name, tag) {
  28888. var elementStyle = this.getTestElement(tag).style,
  28889. cName = Ext.String.capitalize(name);
  28890. if (typeof elementStyle[name] !== 'undefined' || typeof elementStyle[Ext.browser.getStylePrefix(name) + cName] !== 'undefined') {
  28891. return true;
  28892. }
  28893. return false;
  28894. },
  28895. isStyleSupportedWithoutPrefix: function(name, tag) {
  28896. var elementStyle = this.getTestElement(tag).style;
  28897. if (typeof elementStyle[name] !== 'undefined') {
  28898. return true;
  28899. }
  28900. return false;
  28901. },
  28902. isEventSupported: function(name, tag) {
  28903. if (tag === undefined) {
  28904. tag = window;
  28905. }
  28906. var element = this.getTestElement(tag),
  28907. eventName = 'on' + name.toLowerCase(),
  28908. isSupported = (eventName in element);
  28909. if (!isSupported) {
  28910. if (element.setAttribute && element.removeAttribute) {
  28911. element.setAttribute(eventName, '');
  28912. isSupported = typeof element[eventName] === 'function';
  28913. if (typeof element[eventName] !== 'undefined') {
  28914. element[eventName] = undefined;
  28915. }
  28916. element.removeAttribute(eventName);
  28917. }
  28918. }
  28919. return isSupported;
  28920. },
  28921. // This is a local copy of certain logic from Element.getStyle
  28922. // to break a dependancy between the supports mechanism and Element
  28923. // use this instead of element references to check for styling info
  28924. getStyle: function(element, styleName) {
  28925. var view = element.ownerDocument.defaultView,
  28926. style = (view ? view.getComputedStyle(element, null) : element.currentStyle);
  28927. return (style || element.style)[styleName];
  28928. },
  28929. getSupportedPropertyName: function(object, name) {
  28930. var vendorName = Ext.browser.getVendorProperyName(name);
  28931. if (vendorName in object) {
  28932. return vendorName;
  28933. } else if (name in object) {
  28934. return name;
  28935. }
  28936. return null;
  28937. },
  28938. /**
  28939. * Runs feature detection routines and sets the various flags. This is called when
  28940. * the scripts loads (very early) and again at {@link Ext#onReady}. Some detections
  28941. * can be run immediately. Others that require the document body will not run until
  28942. * domready (these have the `ready` flag set).
  28943. *
  28944. * Each test is run only once, so calling this method from an onReady function is safe
  28945. * and ensures that all flags have been set.
  28946. * @private
  28947. */
  28948. detect: function(isReady) {
  28949. var me = this,
  28950. doc = document,
  28951. toRun = me.toRun || me.tests,
  28952. n = toRun.length,
  28953. div = doc.createElement('div'),
  28954. notRun = [],
  28955. supports = Ext.supports,
  28956. has = me.has,
  28957. name, names, test, vector, value;
  28958. // Only the legacy browser tests use this div so clip this out if we don't need
  28959. // to use it.
  28960. div.innerHTML = '<div style="height:30px;width:50px;">' + '<div style="height:20px;width:20px;"></div>' + '</div>' + '<div style="width: 200px; height: 200px; position: relative; padding: 5px;">' + '<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></div>' + '</div>' + '<div style="position: absolute; left: 10%; top: 10%;"></div>' + '<div style="float:left; background-color:transparent;"></div>';
  28961. if (isReady) {
  28962. doc.body.appendChild(div);
  28963. }
  28964. vector = me.preDetected[Ext.browser.identity] || [];
  28965. while (n--) {
  28966. test = toRun[n];
  28967. value = vector[n];
  28968. name = test.name;
  28969. names = test.names;
  28970. if (value === undefined) {
  28971. if (!isReady && test.ready) {
  28972. // test requires domready state
  28973. notRun.push(test);
  28974. continue;
  28975. }
  28976. value = test.fn.call(me, doc, div);
  28977. }
  28978. // Store test results on Ext.supports and Ext.feature.has
  28979. if (name) {
  28980. supports[name] = has[name] = value;
  28981. } else if (names) {
  28982. while (names.length) {
  28983. name = names.pop();
  28984. supports[name] = has[name] = value;
  28985. }
  28986. }
  28987. }
  28988. if (isReady) {
  28989. doc.body.removeChild(div);
  28990. }
  28991. me.toRun = notRun;
  28992. },
  28993. //</debug>
  28994. report: function() {
  28995. var values = [],
  28996. len = this.tests.length,
  28997. i;
  28998. for (i = 0; i < len; ++i) {
  28999. values.push(this.has[this.tests[i].name] ? 1 : 0);
  29000. }
  29001. Ext.log(Ext.browser.identity + ': [' + values.join(',') + ']');
  29002. },
  29003. //</debug>
  29004. preDetected: {},
  29005. // TODO
  29006. /**
  29007. * @class Ext.supports
  29008. *
  29009. * Contains information about features supported in the current environment as well
  29010. * as bugs detected.
  29011. *
  29012. * @singleton
  29013. */
  29014. tests: [
  29015. {
  29016. /**
  29017. * @property CloneNodeCopiesExpando `true` if the native DOM cloneNode method copies
  29018. * expando properties to the newly cloned node.
  29019. *
  29020. * This property is available at application boot time, before document ready.
  29021. * @type {Boolean}
  29022. */
  29023. name: 'CloneNodeCopiesExpando',
  29024. fn: function() {
  29025. var el = document.createElement('div');
  29026. el.expandoProp = {};
  29027. return el.cloneNode().expandoProp === el.expandoProp;
  29028. }
  29029. },
  29030. {
  29031. /**
  29032. * @property CSSPointerEvents `true` if document environment supports the CSS3
  29033. * pointer-events style.
  29034. *
  29035. * This property is available at application boot time, before document ready.
  29036. * @type {Boolean}
  29037. */
  29038. name: 'CSSPointerEvents',
  29039. fn: function(doc) {
  29040. return 'pointerEvents' in doc.documentElement.style;
  29041. }
  29042. },
  29043. {
  29044. /**
  29045. * @property CSS3BoxShadow `true` if document environment supports the CSS3
  29046. * box-shadow style.
  29047. *
  29048. * This property is available at application boot time, before document ready.
  29049. * @type {Boolean}
  29050. */
  29051. name: 'CSS3BoxShadow',
  29052. fn: function(doc) {
  29053. return 'boxShadow' in doc.documentElement.style || 'WebkitBoxShadow' in doc.documentElement.style || 'MozBoxShadow' in doc.documentElement.style;
  29054. }
  29055. },
  29056. {
  29057. name: 'CSS3NegationSelector',
  29058. fn: function(doc) {
  29059. try {
  29060. doc.querySelectorAll("foo:not(bar)");
  29061. } catch (e) {
  29062. return false;
  29063. }
  29064. return true;
  29065. }
  29066. },
  29067. {
  29068. /**
  29069. * @property ClassList `true` if document environment supports the HTML5
  29070. * classList API.
  29071. *
  29072. * This property is available at application boot time, before document ready.
  29073. * @type {Boolean}
  29074. */
  29075. name: 'ClassList',
  29076. fn: function(doc) {
  29077. return !!doc.documentElement.classList;
  29078. }
  29079. },
  29080. {
  29081. /**
  29082. * @property Canvas `true` if the device supports Canvas.
  29083. *
  29084. * This property is available at application boot time, before document ready.
  29085. * @type {Boolean}
  29086. */
  29087. name: 'Canvas',
  29088. fn: function() {
  29089. var element = this.getTestElement('canvas');
  29090. return !!(element && element.getContext && element.getContext('2d'));
  29091. }
  29092. },
  29093. {
  29094. /**
  29095. * @property Svg `true` if the device supports SVG.
  29096. *
  29097. * This property is available at application boot time, before document ready.
  29098. * @type {Boolean}
  29099. */
  29100. name: 'Svg',
  29101. fn: function(doc) {
  29102. return !!(doc.createElementNS && !!doc.createElementNS("http:/" + "/www.w3.org/2000/svg", "svg").createSVGRect);
  29103. }
  29104. },
  29105. {
  29106. /**
  29107. * @property Vml `true` if the device supports VML.
  29108. * @type {Boolean}
  29109. *
  29110. * This property is available at application boot time, before document ready.
  29111. */
  29112. name: 'Vml',
  29113. fn: function() {
  29114. var element = this.getTestElement(),
  29115. ret = false;
  29116. element.innerHTML = "<!--[if vml]><br><![endif]-->";
  29117. ret = (element.childNodes.length === 1);
  29118. element.innerHTML = "";
  29119. return ret;
  29120. }
  29121. },
  29122. {
  29123. /**
  29124. * @property {Boolean} Touch `true` if the browser supports touch input.
  29125. *
  29126. * This property is available at application boot time, before document ready.
  29127. */
  29128. name: 'Touch',
  29129. fn: function() {
  29130. // IE10 uses a vendor-prefixed maxTouchPoints property
  29131. var maxTouchPoints = navigator.msMaxTouchPoints || navigator.maxTouchPoints;
  29132. // if the browser has touch events we can be reasonably sure the device has
  29133. // a touch screen
  29134. // browsers that use pointer event have maxTouchPoints > 1 if the
  29135. // device supports touch input
  29136. // Chrome Desktop < 39 reports maxTouchPoints === 1 even if there is no
  29137. // touch support on the device
  29138. // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
  29139. // Chrome Desktop > 39 properly reports maxTouchPoints === 0 and
  29140. // Chrome Desktop Device Emulation mode reports maxTouchPoints === 1
  29141. if (Ext.browser.is.Chrome && Ext.browser.version.isLessThanOrEqual(39)) {
  29142. return (Ext.supports.TouchEvents && maxTouchPoints !== 1) || maxTouchPoints > 1;
  29143. } else {
  29144. return Ext.supports.TouchEvents || maxTouchPoints > 0;
  29145. }
  29146. }
  29147. },
  29148. {
  29149. /**
  29150. * @property {Boolean} PointerEvents
  29151. * @type {Boolean}
  29152. * @private
  29153. *
  29154. * `true` If the event system should use [pointer events](https://www.w3.org/TR/pointerevents/).
  29155. * Currently only set to true if the browser supports pointer events and does not
  29156. * also support touch events. Touch events are preferred since they allow run-time
  29157. * cancellation of browser default behavior such as scrolling by invoking `e.preventDefault()`
  29158. * whereas pointer events require such intentions to be declared in advance via
  29159. * CSS [touch-action](https://www.w3.org/TR/pointerevents/#h3_the-touch-action-css-property).
  29160. * This means that when pointer events are used, certain interactions are not possible
  29161. * such as long-press to drag within a scrollable element.
  29162. */
  29163. name: 'PointerEvents',
  29164. fn: function() {
  29165. return !!(window.PointerEvent && !Ext.supports.TouchEvents);
  29166. }
  29167. },
  29168. {
  29169. /**
  29170. * @property {Boolean} MSPointerEvents
  29171. * @private
  29172. */
  29173. name: 'MSPointerEvents',
  29174. fn: function() {
  29175. return Ext.isIE10;
  29176. }
  29177. },
  29178. {
  29179. /**
  29180. * @property {Boolean} TouchEvents
  29181. *
  29182. * `true` if the device supports touch events (`touchstart`, `touchmove`, `touchend`).
  29183. *
  29184. * This property is available at application boot time, before document ready.
  29185. */
  29186. name: 'TouchEvents',
  29187. fn: function() {
  29188. return this.isEventSupported('touchend');
  29189. }
  29190. },
  29191. {
  29192. /**
  29193. * @property {Boolean} TouchAction
  29194. * @private
  29195. *
  29196. * A bit flag representing which property values the browser recognizes as valid
  29197. * values of the CSS `touch-action` property.
  29198. *
  29199. * panX 1 "00000001"
  29200. * panY 2 "00000010"
  29201. * pinchZoom 4 "00000100"
  29202. * doubleTapZoom 8 "00001000"
  29203. */
  29204. name: 'TouchAction',
  29205. ready: true,
  29206. fn: function(doc, div) {
  29207. if (!window.getComputedStyle) {
  29208. return 0;
  29209. }
  29210. var values = [
  29211. 'pan-x',
  29212. 'pan-y',
  29213. 'pinch-zoom',
  29214. 'double-tap-zoom'
  29215. ],
  29216. flags = [
  29217. 1,
  29218. 2,
  29219. 4,
  29220. 8
  29221. ],
  29222. ln = values.length,
  29223. flag = 0,
  29224. i, value;
  29225. for (i = 0; i < ln; i++) {
  29226. value = values[i];
  29227. div.style.touchAction = value;
  29228. if (getComputedStyle(div).touchAction === value) {
  29229. flag |= flags[i];
  29230. }
  29231. }
  29232. return flag;
  29233. }
  29234. },
  29235. {
  29236. /**
  29237. * @property Orientation `true` if the device supports different orientations.
  29238. * @type {Boolean}
  29239. *
  29240. * This property is available at application boot time, before document ready.
  29241. */
  29242. name: 'Orientation',
  29243. fn: function() {
  29244. return ('orientation' in window) && this.isEventSupported('orientationchange');
  29245. }
  29246. },
  29247. {
  29248. /**
  29249. * @property OrientationChange `true` if the device supports the `orientationchange`
  29250. * event.
  29251. *
  29252. * This property is available at application boot time, before document ready.
  29253. * @type {Boolean}
  29254. */
  29255. name: 'OrientationChange',
  29256. fn: function() {
  29257. return this.isEventSupported('orientationchange');
  29258. }
  29259. },
  29260. {
  29261. /**
  29262. * @property DeviceMotion `true` if the device supports device motion (acceleration
  29263. * and rotation rate).
  29264. *
  29265. * This property is available at application boot time, before document ready.
  29266. * @type {Boolean}
  29267. */
  29268. name: 'DeviceMotion',
  29269. fn: function() {
  29270. return this.isEventSupported('devicemotion');
  29271. }
  29272. },
  29273. {
  29274. /**
  29275. * @property Geolocation `true` if the device supports GeoLocation.
  29276. * @type {Boolean}
  29277. *
  29278. * This property is available at application boot time, before document ready.
  29279. */
  29280. /**
  29281. * @property GeoLocation `true` if the device supports Geo-location.
  29282. * @type {Boolean}
  29283. * @deprecated 5.0.0 Use `Geolocation` instead (notice the lower-casing of 'L').
  29284. */
  29285. names: [
  29286. 'Geolocation',
  29287. 'GeoLocation'
  29288. ],
  29289. fn: function() {
  29290. return 'geolocation' in window.navigator;
  29291. }
  29292. },
  29293. {
  29294. name: 'SqlDatabase',
  29295. fn: function() {
  29296. return 'openDatabase' in window;
  29297. }
  29298. },
  29299. {
  29300. name: 'WebSockets',
  29301. fn: function() {
  29302. return 'WebSocket' in window;
  29303. }
  29304. },
  29305. {
  29306. /**
  29307. * @property Range `true` if browser support document.createRange native method.
  29308. * See https://developer.mozilla.org/en/DOM/range.
  29309. *
  29310. * This property is available at application boot time, before document ready.
  29311. * @type {Boolean}
  29312. */
  29313. name: 'Range',
  29314. fn: function() {
  29315. return !!document.createRange;
  29316. }
  29317. },
  29318. {
  29319. /**
  29320. * @property CreateContextualFragment `true` if browser support CreateContextualFragment
  29321. * range native methods.
  29322. * See https://developer.mozilla.org/en/DOM/range.createContextualFragment
  29323. *
  29324. * This property is available at application boot time, before document ready.
  29325. * @type {Boolean}
  29326. */
  29327. name: 'CreateContextualFragment',
  29328. fn: function() {
  29329. var range = !!document.createRange ? document.createRange() : false;
  29330. return range && !!range.createContextualFragment;
  29331. }
  29332. },
  29333. {
  29334. /**
  29335. * @property History `true` if the device supports HTML5 history. See
  29336. * https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history
  29337. *
  29338. * This property is available at application boot time, before document ready.
  29339. * @type {Boolean}
  29340. */
  29341. name: 'History',
  29342. fn: function() {
  29343. return ('history' in window && 'pushState' in window.history);
  29344. }
  29345. },
  29346. {
  29347. /**
  29348. * @property Css3DTransforms `true` if the device supports CSS3DTransform.
  29349. * @type {Boolean}
  29350. *
  29351. * This property is available at application boot time, before document ready.
  29352. */
  29353. name: 'Css3dTransforms',
  29354. fn: function() {
  29355. // See https://sencha.jira.com/browse/TOUCH-1544
  29356. return this.has('CssTransforms') && this.isStyleSupported('perspective');
  29357. }
  29358. },
  29359. // TODO - double check vs Ext JS flavor:
  29360. //return (typeof WebKitCSSMatrix != 'undefined' && new WebKitCSSMatrix().hasOwnProperty('m41'));
  29361. {
  29362. // Important that this goes after Css3dTransforms, since tests are run in reverse order
  29363. name: 'CssTransforms',
  29364. fn: function() {
  29365. return this.isStyleSupported('transform');
  29366. }
  29367. },
  29368. {
  29369. name: 'CssTransformNoPrefix',
  29370. fn: function() {
  29371. return this.isStyleSupportedWithoutPrefix('transform');
  29372. }
  29373. },
  29374. {
  29375. name: 'CssAnimations',
  29376. fn: function() {
  29377. return this.isStyleSupported('animationName');
  29378. }
  29379. },
  29380. {
  29381. /**
  29382. * @property Transitions `true` if the device supports CSS3 Transitions.
  29383. *
  29384. * This property is available at application boot time, before document ready.
  29385. * @type {Boolean}
  29386. */
  29387. names: [
  29388. 'CssTransitions',
  29389. 'Transitions'
  29390. ],
  29391. fn: function() {
  29392. return this.isStyleSupported('transitionProperty');
  29393. }
  29394. },
  29395. {
  29396. /**
  29397. * @property Audio `true` if the device supports the HTML5 `audio` tag.
  29398. *
  29399. * This property is available at application boot time, before document ready.
  29400. * @type {Boolean}
  29401. */
  29402. /**
  29403. * @property AudioTag `true` if the device supports the HTML5 `audio` tag.
  29404. * @type {Boolean}
  29405. * @deprecated 5.0.0 Use `Audio` instead.
  29406. */
  29407. names: [
  29408. 'Audio',
  29409. 'AudioTag'
  29410. ],
  29411. fn: function() {
  29412. return !!this.getTestElement('audio').canPlayType;
  29413. }
  29414. },
  29415. {
  29416. /**
  29417. * @property Video `true` if the device supports the HTML5 `video` tag.
  29418. *
  29419. * This property is available at application boot time, before document ready.
  29420. * @type {Boolean}
  29421. */
  29422. name: 'Video',
  29423. fn: function() {
  29424. return !!this.getTestElement('video').canPlayType;
  29425. }
  29426. },
  29427. {
  29428. /**
  29429. * @property LocalStorage `true` if localStorage is supported.
  29430. *
  29431. * This property is available at application boot time, before document ready.
  29432. * @type {Boolean}
  29433. */
  29434. name: 'LocalStorage',
  29435. fn: function() {
  29436. try {
  29437. // IE10/Win8 throws "Access Denied" accessing window.localStorage, so
  29438. // this test needs to have a try/catch
  29439. if ('localStorage' in window && window['localStorage'] !== null) {
  29440. // jshint ignore:line
  29441. //this should throw an error in private browsing mode in iOS as well
  29442. localStorage.setItem('sencha-localstorage-test', 'test success');
  29443. //clean up if setItem worked
  29444. localStorage.removeItem('sencha-localstorage-test');
  29445. return true;
  29446. }
  29447. } catch (e) {}
  29448. // ignore
  29449. return false;
  29450. }
  29451. },
  29452. {
  29453. /**
  29454. * @property {Boolean} XmlQuerySelector `true` if the browsers supports querySelector
  29455. * and querySelectorAll methods on XML nodes.
  29456. *
  29457. * This property is available at application boot time, before document ready.
  29458. */
  29459. name: 'XmlQuerySelector',
  29460. fn: function() {
  29461. var xmlString = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><root></root>',
  29462. xmlDoc;
  29463. // IE10 doesn't create IXMLDOMDocument via DOMParser
  29464. if (window.ActiveXObject) {
  29465. xmlDoc = new ActiveXObject("Microsoft.xmlDOM");
  29466. xmlDoc.async = false;
  29467. xmlDoc.loadXML(xmlString);
  29468. } else if (window.DOMParser) {
  29469. var parser = new DOMParser();
  29470. xmlDoc = parser.parseFromString(xmlString, 'text/xml');
  29471. }
  29472. return xmlDoc ? !!xmlDoc.lastChild.querySelector : false;
  29473. }
  29474. },
  29475. {
  29476. /**
  29477. * @property XHR2 `true` if the browser supports XMLHttpRequest
  29478. *
  29479. * This property is available at application boot time, before document ready.
  29480. * @type {Boolean}
  29481. */
  29482. name: 'XHR2',
  29483. fn: function() {
  29484. return window.ProgressEvent && window.FormData && window.XMLHttpRequest && ('withCredentials' in new XMLHttpRequest());
  29485. }
  29486. },
  29487. {
  29488. /**
  29489. * @property XHRUploadProgress `true` if the browser supports XMLHttpRequest
  29490. * upload progress info
  29491. *
  29492. * This property is available at application boot time, before document ready.
  29493. * @type {Boolean}
  29494. */
  29495. name: 'XHRUploadProgress',
  29496. fn: function() {
  29497. if (window.XMLHttpRequest && !Ext.browser.is.AndroidStock) {
  29498. var xhr = new XMLHttpRequest();
  29499. return xhr && ('upload' in xhr) && ('onprogress' in xhr.upload);
  29500. }
  29501. return false;
  29502. }
  29503. },
  29504. {
  29505. /**
  29506. * @property NumericInputPlaceHolder `true` if the browser supports placeholders
  29507. * on numeric input fields
  29508. *
  29509. * This property is available at application boot time, before document ready.
  29510. * @type {Boolean}
  29511. */
  29512. name: 'NumericInputPlaceHolder',
  29513. fn: function() {
  29514. return !(Ext.browser.is.AndroidStock4 && Ext.os.version.getMinor() < 2);
  29515. }
  29516. },
  29517. /**
  29518. * @property {String} matchesSelector
  29519. * The method name which matches an element against a selector if implemented in this environment.
  29520. *
  29521. * This property is available at application boot time, before document ready.
  29522. */
  29523. {
  29524. name: 'matchesSelector',
  29525. fn: function() {
  29526. var el = document.documentElement,
  29527. w3 = 'matches',
  29528. wk = 'webkitMatchesSelector',
  29529. ms = 'msMatchesSelector',
  29530. mz = 'mozMatchesSelector';
  29531. return el[w3] ? w3 : el[wk] ? wk : el[ms] ? ms : el[mz] ? mz : null;
  29532. }
  29533. },
  29534. /**
  29535. * @property RightMargin `true` if the device supports right margin.
  29536. * See https://bugs.webkit.org/show_bug.cgi?id=13343 for why this is needed.
  29537. *
  29538. * This property is *NOT* available at application boot time. Only after the document ready event.
  29539. * @type {Boolean}
  29540. */
  29541. {
  29542. name: 'RightMargin',
  29543. ready: true,
  29544. fn: function(doc, div) {
  29545. var view = doc.defaultView;
  29546. return !(view && view.getComputedStyle(div.firstChild.firstChild, null).marginRight !== '0px');
  29547. }
  29548. },
  29549. /**
  29550. * @property DisplayChangeInputSelectionBug `true` if INPUT elements lose their
  29551. * selection when their display style is changed. Essentially, if a text input
  29552. * has focus and its display style is changed, the I-beam disappears.
  29553. *
  29554. * This bug is encountered due to the work around in place for the {@link #RightMargin}
  29555. * bug. This has been observed in Safari 4.0.4 and older, and appears to be fixed
  29556. * in Safari 5. It's not clear if Safari 4.1 has the bug, but it has the same WebKit
  29557. * version number as Safari 5 (according to http://unixpapa.com/js/gecko.html).
  29558. *
  29559. * This property is available at application boot time, before document ready.
  29560. */
  29561. {
  29562. name: 'DisplayChangeInputSelectionBug',
  29563. fn: function() {
  29564. var webKitVersion = Ext.webKitVersion;
  29565. // WebKit but older than Safari 5 or Chrome 6:
  29566. return 0 < webKitVersion && webKitVersion < 533;
  29567. }
  29568. },
  29569. /**
  29570. * @property DisplayChangeTextAreaSelectionBug `true` if TEXTAREA elements lose their
  29571. * selection when their display style is changed. Essentially, if a text area has
  29572. * focus and its display style is changed, the I-beam disappears.
  29573. *
  29574. * This bug is encountered due to the work around in place for the {@link #RightMargin}
  29575. * bug. This has been observed in Chrome 10 and Safari 5 and older, and appears to
  29576. * be fixed in Chrome 11.
  29577. *
  29578. * This property is available at application boot time, before document ready.
  29579. */
  29580. {
  29581. name: 'DisplayChangeTextAreaSelectionBug',
  29582. fn: function() {
  29583. var webKitVersion = Ext.webKitVersion;
  29584. /*
  29585. Has bug w/textarea:
  29586. (Chrome) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US)
  29587. AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127
  29588. Safari/534.16
  29589. (Safari) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us)
  29590. AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5
  29591. Safari/533.21.1
  29592. No bug:
  29593. (Chrome) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7)
  29594. AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57
  29595. Safari/534.24
  29596. */
  29597. return 0 < webKitVersion && webKitVersion < 534.24;
  29598. }
  29599. },
  29600. /**
  29601. * @property TransparentColor `true` if the device supports transparent color.
  29602. * @type {Boolean}
  29603. *
  29604. * This property is *NOT* available at application boot time. Only after the document ready event.
  29605. */
  29606. {
  29607. name: 'TransparentColor',
  29608. ready: true,
  29609. fn: function(doc, div, view) {
  29610. view = doc.defaultView;
  29611. return !(view && view.getComputedStyle(div.lastChild, null).backgroundColor !== 'transparent');
  29612. }
  29613. },
  29614. /**
  29615. * @property ComputedStyle `true` if the browser supports document.defaultView.getComputedStyle().
  29616. * @type {Boolean}
  29617. *
  29618. * This property is *NOT* available at application boot time. Only after the document ready event.
  29619. */
  29620. {
  29621. name: 'ComputedStyle',
  29622. ready: true,
  29623. fn: function(doc, div, view) {
  29624. view = doc.defaultView;
  29625. return !!(view && view.getComputedStyle);
  29626. }
  29627. },
  29628. /**
  29629. * @property Float `true` if the device supports CSS float.
  29630. * @type {Boolean}
  29631. *
  29632. * This property is available at application boot time, before document ready.
  29633. */
  29634. {
  29635. name: 'Float',
  29636. fn: function(doc) {
  29637. return 'cssFloat' in doc.documentElement.style;
  29638. }
  29639. },
  29640. /**
  29641. * @property CSS3BorderRadius `true` if the device supports CSS3 border radius.
  29642. * @type {Boolean}
  29643. *
  29644. * This property is *NOT* available at application boot time. Only after the document ready event.
  29645. */
  29646. {
  29647. name: 'CSS3BorderRadius',
  29648. ready: true,
  29649. fn: function(doc) {
  29650. var domPrefixes = [
  29651. 'borderRadius',
  29652. 'BorderRadius',
  29653. 'MozBorderRadius',
  29654. 'WebkitBorderRadius',
  29655. 'OBorderRadius',
  29656. 'KhtmlBorderRadius'
  29657. ],
  29658. pass = false,
  29659. i;
  29660. for (i = 0; i < domPrefixes.length; i++) {
  29661. if (doc.documentElement.style[domPrefixes[i]] !== undefined) {
  29662. pass = true;
  29663. }
  29664. }
  29665. return pass && !Ext.isIE9;
  29666. }
  29667. },
  29668. /**
  29669. * @property CSS3LinearGradient `true` if the device supports CSS3 linear gradients.
  29670. * @type {Boolean}
  29671. *
  29672. * This property is available at application boot time, before document ready.
  29673. */
  29674. {
  29675. name: 'CSS3LinearGradient',
  29676. fn: function(doc, div) {
  29677. var property = 'background-image:',
  29678. webkit = '-webkit-gradient(linear, left top, right bottom, from(black), to(white))',
  29679. w3c = 'linear-gradient(left top, black, white)',
  29680. moz = '-moz-' + w3c,
  29681. ms = '-ms-' + w3c,
  29682. opera = '-o-' + w3c,
  29683. options = [
  29684. property + webkit,
  29685. property + w3c,
  29686. property + moz,
  29687. property + ms,
  29688. property + opera
  29689. ];
  29690. div.style.cssText = options.join(';');
  29691. return (("" + div.style.backgroundImage).indexOf('gradient') !== -1) && !Ext.isIE9;
  29692. }
  29693. },
  29694. /**
  29695. * @property MouseEnterLeave `true` if the browser supports mouseenter and mouseleave events
  29696. * @type {Boolean}
  29697. *
  29698. * This property is available at application boot time, before document ready.
  29699. */
  29700. {
  29701. name: 'MouseEnterLeave',
  29702. fn: function(doc) {
  29703. return ('onmouseenter' in doc.documentElement && 'onmouseleave' in doc.documentElement);
  29704. }
  29705. },
  29706. /**
  29707. * @property MouseWheel `true` if the browser supports the mousewheel event
  29708. * @type {Boolean}
  29709. *
  29710. * This property is available at application boot time, before document ready.
  29711. */
  29712. {
  29713. name: 'MouseWheel',
  29714. fn: function(doc) {
  29715. return ('onmousewheel' in doc.documentElement);
  29716. }
  29717. },
  29718. /**
  29719. * @property Opacity `true` if the browser supports normal css opacity
  29720. * @type {Boolean}
  29721. *
  29722. * This property is available at application boot time, before document ready.
  29723. */
  29724. {
  29725. name: 'Opacity',
  29726. fn: function(doc, div) {
  29727. // Not a strict equal comparison in case opacity can be converted to a number.
  29728. if (Ext.isIE8) {
  29729. return false;
  29730. }
  29731. div.firstChild.style.cssText = 'opacity:0.73';
  29732. return div.firstChild.style.opacity == '0.73';
  29733. }
  29734. },
  29735. // jshint ignore:line
  29736. /**
  29737. * @property Placeholder `true` if the browser supports the HTML5 placeholder attribute on inputs
  29738. * @type {Boolean}
  29739. *
  29740. * This property is available at application boot time, before document ready.
  29741. */
  29742. {
  29743. name: 'Placeholder',
  29744. fn: function(doc) {
  29745. return 'placeholder' in doc.createElement('input');
  29746. }
  29747. },
  29748. /**
  29749. * @property Direct2DBug `true` if when asking for an element's dimension via offsetWidth or offsetHeight,
  29750. * getBoundingClientRect, etc. the browser returns the subpixel width rounded to the nearest pixel.
  29751. *
  29752. * This property is available at application boot time, before document ready.
  29753. * @type {Boolean}
  29754. */
  29755. {
  29756. name: 'Direct2DBug',
  29757. fn: function(doc) {
  29758. return Ext.isString(doc.documentElement.style.msTransformOrigin) && Ext.isIE9m;
  29759. }
  29760. },
  29761. /**
  29762. * @property BoundingClientRect `true` if the browser supports the getBoundingClientRect method on elements
  29763. * @type {Boolean}
  29764. *
  29765. * This property is available at application boot time, before document ready.
  29766. */
  29767. {
  29768. name: 'BoundingClientRect',
  29769. fn: function(doc) {
  29770. return 'getBoundingClientRect' in doc.documentElement;
  29771. }
  29772. },
  29773. /**
  29774. * @property RotatedBoundingClientRect `true` if the BoundingClientRect is
  29775. * rotated when the element is rotated using a CSS transform.
  29776. * @type {Boolean}
  29777. *
  29778. * This property is *NOT* available at application boot time. Only after the document ready event.
  29779. */
  29780. {
  29781. name: 'RotatedBoundingClientRect',
  29782. ready: true,
  29783. fn: function(doc) {
  29784. var body = doc.body,
  29785. supports = false,
  29786. el = doc.createElement('div'),
  29787. style = el.style;
  29788. if (el.getBoundingClientRect) {
  29789. // If the document body already has child nodes (text nodes etc) we can end
  29790. // up with subpixel rounding errors in IE11 when measuring the height.
  29791. // Absolute positioning prevents this.
  29792. style.position = 'absolute';
  29793. style.top = "0";
  29794. style.WebkitTransform = style.MozTransform = style.msTransform = style.OTransform = style.transform = 'rotate(90deg)';
  29795. style.width = '100px';
  29796. style.height = '30px';
  29797. body.appendChild(el);
  29798. supports = el.getBoundingClientRect().height !== 100;
  29799. body.removeChild(el);
  29800. }
  29801. return supports;
  29802. }
  29803. },
  29804. /**
  29805. * @property ChildContentClearedWhenSettingInnerHTML `true` if created child elements
  29806. * lose their innerHTML when modifying the innerHTML of the parent element.
  29807. * @type {Boolean}
  29808. *
  29809. * This property is *NOT* available at application boot time. Only after the document ready event.
  29810. */
  29811. {
  29812. name: 'ChildContentClearedWhenSettingInnerHTML',
  29813. ready: true,
  29814. fn: function() {
  29815. var el = this.getTestElement(),
  29816. child;
  29817. el.innerHTML = '<div>a</div>';
  29818. child = el.firstChild;
  29819. el.innerHTML = '<div>b</div>';
  29820. return child.innerHTML !== 'a';
  29821. }
  29822. },
  29823. {
  29824. name: 'IncludePaddingInWidthCalculation',
  29825. ready: true,
  29826. fn: function(doc, div) {
  29827. return div.childNodes[1].firstChild.offsetWidth === 210;
  29828. }
  29829. },
  29830. {
  29831. name: 'IncludePaddingInHeightCalculation',
  29832. ready: true,
  29833. fn: function(doc, div) {
  29834. return div.childNodes[1].firstChild.offsetHeight === 210;
  29835. }
  29836. },
  29837. /**
  29838. * @property TextAreaMaxLength `true` if the browser supports maxlength on textareas.
  29839. * @type {Boolean}
  29840. *
  29841. * This property is available at application boot time, before document ready.
  29842. */
  29843. {
  29844. name: 'TextAreaMaxLength',
  29845. fn: function(doc) {
  29846. return ('maxlength' in doc.createElement('textarea'));
  29847. }
  29848. },
  29849. /**
  29850. * @property GetPositionPercentage `true` if the browser will return the left/top/right/bottom
  29851. * position as a percentage when explicitly set as a percentage value.
  29852. *
  29853. * This property is *NOT* available at application boot time. Only after the document ready event.
  29854. * @type {Boolean}
  29855. */
  29856. // Related bug: https://bugzilla.mozilla.org/show_bug.cgi?id=707691#c7
  29857. {
  29858. name: 'GetPositionPercentage',
  29859. ready: true,
  29860. fn: function(doc, div) {
  29861. return Ext.feature.getStyle(div.childNodes[2], 'left') === '10%';
  29862. }
  29863. },
  29864. /**
  29865. * @property {Boolean} PercentageHeightOverflowBug
  29866. * In some browsers (IE quirks, IE6, IE7, IE9, chrome, safari and opera at the time
  29867. * of this writing) a percentage-height element ignores the horizontal scrollbar
  29868. * of its parent element. This method returns true if the browser is affected
  29869. * by this bug.
  29870. *
  29871. * This property is *NOT* available at application boot time. Only after the document ready event.
  29872. * @private
  29873. */
  29874. {
  29875. name: 'PercentageHeightOverflowBug',
  29876. ready: true,
  29877. fn: function(doc) {
  29878. var hasBug = false,
  29879. style, el;
  29880. if (Ext.getScrollbarSize().height) {
  29881. // must have space-consuming scrollbars for bug to be possible
  29882. el = this.getTestElement('div', true);
  29883. style = el.style;
  29884. style.height = '50px';
  29885. style.width = '50px';
  29886. style.overflow = 'auto';
  29887. style.position = 'absolute';
  29888. el.innerHTML = [
  29889. '<div style="display:table;height:100%;">',
  29890. // The element that causes the horizontal overflow must be
  29891. // a child of the element with the 100% height, otherwise
  29892. // horizontal overflow is not triggered in webkit quirks mode
  29893. '<div style="width:51px;"></div>',
  29894. '</div>'
  29895. ].join('');
  29896. doc.body.appendChild(el);
  29897. if (el.firstChild.offsetHeight === 50) {
  29898. hasBug = true;
  29899. }
  29900. doc.body.removeChild(el);
  29901. }
  29902. return hasBug;
  29903. }
  29904. },
  29905. /**
  29906. * @property {Boolean} xOriginBug
  29907. * In Chrome 24.0, an RTL element which has vertical overflow positions its right X origin incorrectly.
  29908. * It skips a non-existent scrollbar which has been moved to the left edge due to the RTL setting.
  29909. *
  29910. * http://code.google.com/p/chromium/issues/detail?id=174656
  29911. *
  29912. * This method returns true if the browser is affected by this bug.
  29913. *
  29914. * This property is *NOT* available at application boot time. Only after the document ready event.
  29915. * @private
  29916. */
  29917. {
  29918. name: 'xOriginBug',
  29919. ready: true,
  29920. fn: function(doc, div) {
  29921. div.innerHTML = '<div id="b1" style="height:100px;width:100px;direction:rtl;position:relative;overflow:scroll">' + '<div id="b2" style="position:relative;width:100%;height:20px;"></div>' + '<div id="b3" style="position:absolute;width:20px;height:20px;top:0px;right:0px"></div>' + '</div>';
  29922. var outerBox = document.getElementById('b1').getBoundingClientRect(),
  29923. b2 = document.getElementById('b2').getBoundingClientRect(),
  29924. b3 = document.getElementById('b3').getBoundingClientRect();
  29925. return (b2.left !== outerBox.left && b3.right !== outerBox.right);
  29926. }
  29927. },
  29928. /**
  29929. * @property {Boolean} ScrollWidthInlinePaddingBug
  29930. * In some browsers the right padding of an overflowing element is not accounted
  29931. * for in its scrollWidth. The result can vary depending on whether or not
  29932. * The element contains block-level children. This method tests the effect
  29933. * of padding on scrollWidth when there are no block-level children inside the
  29934. * overflowing element.
  29935. *
  29936. * This method returns true if the browser is affected by this bug.
  29937. *
  29938. * This property is *NOT* available at application boot time. Only after the document ready event.
  29939. */
  29940. {
  29941. name: 'ScrollWidthInlinePaddingBug',
  29942. ready: true,
  29943. fn: function(doc) {
  29944. var hasBug = false,
  29945. style, el;
  29946. el = doc.createElement('div');
  29947. style = el.style;
  29948. style.height = '50px';
  29949. style.width = '50px';
  29950. style.padding = '10px';
  29951. style.overflow = 'hidden';
  29952. style.position = 'absolute';
  29953. el.innerHTML = '<span style="display:inline-block;zoom:1;height:60px;width:60px;"></span>';
  29954. doc.body.appendChild(el);
  29955. if (el.scrollWidth === 70) {
  29956. hasBug = true;
  29957. }
  29958. doc.body.removeChild(el);
  29959. return hasBug;
  29960. }
  29961. },
  29962. /**
  29963. * @property {Boolean} rtlVertScrollbarOnRight
  29964. * Safari, in RTL mode keeps the scrollbar at the right side.
  29965. * This means that when two elements must keep their left/right positions synched, if one has no vert
  29966. * scrollbar, it must have some extra padding.
  29967. * See https://sencha.jira.com/browse/EXTJSIV-11245
  29968. *
  29969. * This property is *NOT* available at application boot time. Only after the document ready event.
  29970. * @private
  29971. */
  29972. {
  29973. name: 'rtlVertScrollbarOnRight',
  29974. ready: true,
  29975. fn: function(doc, div) {
  29976. div.innerHTML = '<div style="height:100px;width:100px;direction:rtl;overflow:scroll">' + '<div style="width:20px;height:200px;"></div>' + '</div>';
  29977. var outerBox = div.firstChild,
  29978. innerBox = outerBox.firstChild;
  29979. return (innerBox.offsetLeft + innerBox.offsetWidth !== outerBox.offsetLeft + outerBox.offsetWidth);
  29980. }
  29981. },
  29982. /**
  29983. * @property {Boolean} rtlVertScrollbarOverflowBug
  29984. * In Chrome, in RTL mode, horizontal overflow only into the vertical scrollbar does NOT trigger horizontal scrollability.
  29985. * See https://code.google.com/p/chromium/issues/detail?id=179332
  29986. * We need to detect this for when a grid header needs to have exactly the same horizontal scrolling range as its table view.
  29987. * See {@link Ext.grid.ColumnLayout#publishInnerCtSize}
  29988. * TODO: Remove this when all supported Chrome versions are fixed.
  29989. *
  29990. * This property is *NOT* available at application boot time. Only after the document ready event.
  29991. * @private
  29992. */
  29993. {
  29994. name: 'rtlVertScrollbarOverflowBug',
  29995. ready: true,
  29996. fn: function(doc, div) {
  29997. div.innerHTML = '<div style="height:100px;width:100px;direction:rtl;overflow:auto">' + '<div style="width:95px;height:200px;"></div>' + '</div>';
  29998. // If the bug is present, the 95 pixel wide inner div, encroaches into the
  29999. // vertical scrollbar, but does NOT trigger horizontal overflow, so the clientHeight remains
  30000. // equal to the offset height.
  30001. var outerBox = div.firstChild,
  30002. style = div.style,
  30003. pos = style.position;
  30004. // This issue seems to require a repaint to measure correctly
  30005. style.position = 'absolute';
  30006. outerBox.offsetHeight;
  30007. style.position = pos;
  30008. return outerBox.clientHeight === outerBox.offsetHeight;
  30009. }
  30010. },
  30011. {
  30012. identity: 'defineProperty',
  30013. fn: function() {
  30014. if (Ext.isIE8m) {
  30015. Ext.Object.defineProperty = Ext.emptyFn;
  30016. return false;
  30017. }
  30018. return true;
  30019. }
  30020. },
  30021. {
  30022. identify: 'nativeXhr',
  30023. fn: function() {
  30024. if (typeof XMLHttpRequest !== 'undefined') {
  30025. return true;
  30026. }
  30027. // Apply a polyfill:
  30028. XMLHttpRequest = function() {
  30029. // jshint ignore:line
  30030. try {
  30031. return new ActiveXObject('MSXML2.XMLHTTP.3.0');
  30032. } // jshint ignore:line
  30033. catch (ex) {
  30034. return null;
  30035. }
  30036. };
  30037. return false;
  30038. }
  30039. },
  30040. /**
  30041. * @property {Boolean} SpecialKeyDownRepeat
  30042. * True if the browser fires the keydown event on specialkey autorepeat
  30043. *
  30044. * note 1: IE fires ONLY the keydown event on specialkey autorepeat
  30045. * note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on
  30046. * specialkey autorepeat (research done by Jan Wolter at
  30047. * http://unixpapa.com/js/key.html)
  30048. * note 3: Opera 12 behaves like other modern browsers so this workaround does not
  30049. * work anymore
  30050. *
  30051. * This property is available at application boot time, before document ready.
  30052. */
  30053. {
  30054. name: 'SpecialKeyDownRepeat',
  30055. fn: function() {
  30056. return Ext.isWebKit ? parseInt(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1], 10) >= 525 : !(!(Ext.isGecko || Ext.isIE || Ext.isEdge) || (Ext.isOpera && Ext.operaVersion < 12));
  30057. }
  30058. },
  30059. /**
  30060. * @property {Boolean} EmulatedMouseOver
  30061. * True if the browser emulates a mouseover event on tap (mobile safari)
  30062. *
  30063. * This property is available at application boot time, before document ready.
  30064. */
  30065. {
  30066. name: 'EmulatedMouseOver',
  30067. fn: function() {
  30068. // TODO: is it possible to feature detect this?
  30069. return Ext.os.is.iOS;
  30070. }
  30071. },
  30072. /**
  30073. * @property Hashchange True if the user agent supports the hashchange event
  30074. *
  30075. * This property is available at application boot time, before document ready.
  30076. * @type {Boolean}
  30077. */
  30078. {
  30079. // support Vector 12
  30080. name: 'Hashchange',
  30081. fn: function() {
  30082. // Note that IE8 in IE7 compatibility mode reports true for 'onhashchange' in window, so also test documentMode
  30083. var docMode = document.documentMode;
  30084. return 'onhashchange' in window && (docMode === undefined || docMode > 7);
  30085. }
  30086. },
  30087. /**
  30088. * @property FixedTableWidthBug
  30089. * @private
  30090. * @type {Boolean}
  30091. * `true` if the browser has this bug: https://bugs.webkit.org/show_bug.cgi?id=130239
  30092. *
  30093. * This property is *NOT* available at application boot time. Only after the document ready event.
  30094. */
  30095. {
  30096. name: 'FixedTableWidthBug',
  30097. ready: true,
  30098. fn: function() {
  30099. if (Ext.isIE8) {
  30100. // IE8 incorrectly detects that we have this bug.
  30101. return false;
  30102. }
  30103. var outer = document.createElement('div'),
  30104. inner = document.createElement('div'),
  30105. width;
  30106. outer.setAttribute('style', 'display:table;table-layout:fixed;');
  30107. inner.setAttribute('style', 'display:table-cell;min-width:50px;');
  30108. outer.appendChild(inner);
  30109. document.body.appendChild(outer);
  30110. // must poke offsetWidth to trigger a reflow before setting width
  30111. outer.offsetWidth;
  30112. // jshint ignore:line
  30113. outer.style.width = '25px';
  30114. width = outer.offsetWidth;
  30115. document.body.removeChild(outer);
  30116. return width === 50;
  30117. }
  30118. },
  30119. /**
  30120. * @property FocusinFocusoutEvents
  30121. * @private
  30122. * @type {Boolean}
  30123. * `true` if the browser supports focusin and focusout events:
  30124. * https://developer.mozilla.org/en-US/docs/Web/Events/focusin
  30125. * At this point, only Firefox does not, see this bug:
  30126. * https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  30127. *
  30128. * This property is available at application boot time, before document ready.
  30129. */
  30130. {
  30131. name: 'FocusinFocusoutEvents',
  30132. fn: function() {
  30133. // There is no reliable way to feature detect focusin/focusout event support.
  30134. // window.onfocusin will return undefined both in Chrome (where it is supported)
  30135. // and in Firefox (where it is not supported); adding an element and trying to
  30136. // focus it will fail when the browser window itself is not focused.
  30137. return !(Ext.isGecko && Ext.firefoxVersion < 52);
  30138. }
  30139. },
  30140. /**
  30141. * @property {Boolean} AsyncFocusEvents
  30142. * `true` if the browser fires focus events (focus, blur, focusin, focusout)
  30143. * asynchronously, i.e. in a separate event loop invocation. This is only true
  30144. * for all versions Internet Explorer; Microsoft Edge and other browsers fire
  30145. * focus events synchronously.
  30146. */
  30147. {
  30148. name: 'AsyncFocusEvents',
  30149. fn: function() {
  30150. // The sad part is that we can't feature detect this because the focus
  30151. // event won't be fired when the browser window itself is not focused.
  30152. // Private shortcut for brevity
  30153. return Ext.asyncFocus = !!Ext.isIE;
  30154. }
  30155. },
  30156. /**
  30157. * @property {Object} accessibility Accessibility features.
  30158. *
  30159. * @property {Boolean} accessibility.Images `true` if the browser is configured
  30160. * to display images.
  30161. *
  30162. * @property {Boolean} accessibility.BackgroundImages `true` if the browser
  30163. * is configured to display background images.
  30164. *
  30165. * @property {Boolean} accessibility.BorderColors `true` if the browser
  30166. * is configured to honor CSS styling for border colors.
  30167. *
  30168. * @property {Boolean} accessibility.LightOnDark `true` if the browser
  30169. * is currently using reverse colors in light-on-dark accessibility mode.
  30170. */
  30171. {
  30172. name: 'accessibility',
  30173. ready: true,
  30174. fn: function(doc) {
  30175. var body = doc.body,
  30176. div, img, style, supports, bgImg;
  30177. function getColor(colorTxt) {
  30178. var values = [],
  30179. colorValue = 0,
  30180. regex, match;
  30181. if (colorTxt.indexOf('rgb(') !== -1) {
  30182. values = colorTxt.replace('rgb(', '').replace(')', '').split(', ');
  30183. } else if (colorTxt.indexOf('#') !== -1) {
  30184. regex = colorTxt.length === 7 ? /^#(\S\S)(\S\S)(\S\S)$/ : /^#(\S)(\S)(\S)$/;
  30185. match = colorTxt.match(regex);
  30186. if (match) {
  30187. values = [
  30188. '0x' + match[1],
  30189. '0x' + match[2],
  30190. '0x' + match[3]
  30191. ];
  30192. }
  30193. }
  30194. for (var i = 0; i < values.length; i++) {
  30195. colorValue += parseInt(values[i]);
  30196. }
  30197. return colorValue;
  30198. }
  30199. div = doc.createElement('div');
  30200. img = doc.createElement('img');
  30201. style = div.style;
  30202. Ext.apply(style, {
  30203. width: '2px',
  30204. position: 'absolute',
  30205. clip: 'rect(1px,1px,1px,1px)',
  30206. borderWidth: '1px',
  30207. borderStyle: 'solid',
  30208. borderTopTolor: '#f00',
  30209. borderRightColor: '#ff0',
  30210. backgroundColor: '#fff',
  30211. backgroundImage: 'url(' + Ext.BLANK_IMAGE_URL + ')'
  30212. });
  30213. img.alt = '';
  30214. img.src = Ext.BLANK_IMAGE_URL;
  30215. div.appendChild(img);
  30216. body.appendChild(div);
  30217. // Now check if the styles were indeed honored
  30218. style = div.currentStyle || div.style;
  30219. bgImg = style.backgroundImage;
  30220. supports = {
  30221. // In IE it is possible to untick "Show pictures" option in Advanced
  30222. // settings; this will result in img element reporting its readyState
  30223. // as 'uninitialized'.
  30224. // See http://www.paciellogroup.com/blog/2011/10/detecting-if-images-are-disabled-in-browsers/
  30225. Images: img.offsetWidth === 1 && img.readyState !== 'uninitialized',
  30226. BackgroundImages: !(bgImg !== null && (bgImg === "none" || bgImg === "url(invalid-url:)")),
  30227. BorderColors: style.borderTopColor !== style.borderRightColor,
  30228. LightOnDark: getColor(style.color) - getColor(style.backgroundColor) > 0
  30229. };
  30230. Ext.supports.HighContrastMode = !supports.BackgroundImages;
  30231. body.removeChild(div);
  30232. div = img = null;
  30233. return supports;
  30234. }
  30235. },
  30236. {
  30237. /**
  30238. * @property ViewportUnits `true` if the device supports ViewportUnits.
  30239. * @type {Boolean}
  30240. *
  30241. */
  30242. name: 'ViewportUnits',
  30243. ready: true,
  30244. fn: function(doc) {
  30245. // Even attempting to detect the feature throws a fatal error on IE8
  30246. if (Ext.isIE8) {
  30247. return false;
  30248. }
  30249. var body = doc.body,
  30250. div = document.createElement('div'),
  30251. style = div.currentStyle || div.style,
  30252. width, divWidth;
  30253. body.appendChild(div);
  30254. Ext.apply(style, {
  30255. width: '50vw'
  30256. });
  30257. width = parseInt(window.innerWidth / 2, 10);
  30258. divWidth = parseInt((window.getComputedStyle ? getComputedStyle(div, null) : div.currentStyle).width, 10);
  30259. body.removeChild(div);
  30260. div = null;
  30261. return width === divWidth;
  30262. }
  30263. },
  30264. {
  30265. name: 'CSSVariables',
  30266. ready: false,
  30267. fn: function() {
  30268. // Legacy browsers do not have this method.
  30269. if (!window.getComputedStyle) {
  30270. return false;
  30271. }
  30272. return window.CSS && window.CSS.supports && window.CSS.supports('--test-var', 0);
  30273. }
  30274. },
  30275. {
  30276. /**
  30277. * @property Selectors2 `true` if the browser supports the CSS selector API level 2.
  30278. * https://dev.w3.org/2006/webapi/selectors-api2/
  30279. * @type {Boolean}
  30280. *
  30281. */
  30282. name: 'Selectors2',
  30283. ready: false,
  30284. fn: function(doc) {
  30285. try {
  30286. return !!doc.querySelectorAll(':scope');
  30287. } catch (e) {
  30288. return false;
  30289. }
  30290. }
  30291. },
  30292. {
  30293. /**
  30294. * @property CSSScrollSnap
  30295. * @private
  30296. * @type {Boolean}
  30297. */
  30298. name: 'CSSScrollSnap',
  30299. ready: false,
  30300. fn: function(doc) {
  30301. var style = doc.documentElement.style;
  30302. return 'scrollSnapType' in style || 'webkitScrollSnapType' in style || 'msScrollSnapType' in style;
  30303. }
  30304. },
  30305. /**
  30306. * @property TranslateYCausesHorizontalScroll
  30307. * @private
  30308. * @type {Boolean}
  30309. *
  30310. * Bug for Edge logged here: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9743268/
  30311. */
  30312. {
  30313. name: 'TranslateYCausesHorizontalScroll',
  30314. ready: true,
  30315. fn: function(doc, div) {
  30316. div.innerHTML = '<div style="position: relative; overflow: auto; height: 200px; width: 200px;">' + '<div>' + '<div style="transform: translateY(260px); width: 50px;">a</div>' + '</div>' + '</div>';
  30317. return div.firstChild.scrollWidth > div.firstChild.clientWidth;
  30318. }
  30319. },
  30320. {
  30321. /**
  30322. * @property FlexBoxBasisBug
  30323. * @private
  30324. * @type {Boolean}
  30325. * Allows align: stretch to align items to the height of the tallest item
  30326. * in an auto-heighted hbox layout.
  30327. * can't use flex-basis: auto everywhere because it breaks percentage-sized children
  30328. * https://bugs.chromium.org/p/chromium/issues/detail?id=680484
  30329. */
  30330. name: 'FlexBoxBasisBug',
  30331. ready: true,
  30332. fn: function() {
  30333. if (Ext.isIE11 || (Ext.os.is.iOS && Ext.os.version.major <= 10) || (Ext.isSafari && Ext.browser.version.isLessThan(11)) || (Ext.os.is.Android && Ext.os.version.isLessThan(6))) {
  30334. return true;
  30335. }
  30336. return false;
  30337. }
  30338. },
  30339. {
  30340. /**
  30341. * @property PercentageSizeFlexBug
  30342. * @private
  30343. * @type {Boolean}
  30344. *
  30345. * Detects https://bugs.webkit.org/show_bug.cgi?id=137730
  30346. */
  30347. name: 'PercentageSizeFlexBug',
  30348. ready: true,
  30349. fn: function(doc, div) {
  30350. if (Ext.isIE9m) {
  30351. return false;
  30352. }
  30353. var style = div.style;
  30354. style.display = 'flex';
  30355. style.flexDirection = 'column';
  30356. style.height = style.width = '100px';
  30357. div.innerHTML = '<div style="flex: 1 1;"><div style="height:50%"></div></div>';
  30358. return div.firstChild.firstChild.offsetHeight !== 50;
  30359. }
  30360. },
  30361. {
  30362. /**
  30363. * @property CannotScrollExactHeight
  30364. * @type {Boolean}
  30365. *
  30366. * Feature detect the support of browsers that are unable to scroll elements that are the same
  30367. * height as the native scrollbar height.
  30368. */
  30369. name: 'CannotScrollExactHeight',
  30370. fn: function() {
  30371. return Ext.isIE10p;
  30372. }
  30373. },
  30374. {
  30375. /**
  30376. * @property WebKitTextInputMarginBug
  30377. * @private
  30378. * @type {Boolean}
  30379. *
  30380. * Detects the following bug:
  30381. * https://bugs.webkit.org/show_bug.cgi?id=137693
  30382. *
  30383. * Feb 22, 2017: This bug used to affect chrome as well, but appears to be fixed in
  30384. * Chrome 56. The issue still exists in safari 10
  30385. */
  30386. name: 'WebKitInputTableBoxModelBug',
  30387. ready: true,
  30388. fn: function(doc, div) {
  30389. var table = document.createElement('div'),
  30390. cell = document.createElement('div'),
  30391. input = document.createElement('input'),
  30392. tableStyle = table.style,
  30393. cellStyle = cell.style,
  30394. inputStyle = input.style,
  30395. body = doc.body,
  30396. hasBug;
  30397. input.type = 'text';
  30398. tableStyle.display = 'table';
  30399. tableStyle.height = '100px';
  30400. cellStyle.display = 'table-cell';
  30401. inputStyle.border = '0';
  30402. inputStyle.padding = '10px';
  30403. inputStyle.boxSizing = 'border-box';
  30404. inputStyle.height = '100%';
  30405. cell.appendChild(input);
  30406. table.appendChild(cell);
  30407. body.appendChild(table);
  30408. hasBug = input.offsetHeight === 80;
  30409. body.removeChild(table);
  30410. return hasBug;
  30411. }
  30412. },
  30413. {
  30414. /**
  30415. * @property PassiveEventListener
  30416. * @private
  30417. * @type {Boolean}
  30418. *
  30419. * Detects support for the "passive" event listener option
  30420. */
  30421. name: 'PassiveEventListener',
  30422. fn: function(doc, div) {
  30423. var supportsPassive = false,
  30424. options;
  30425. try {
  30426. options = Object.defineProperty({}, 'passive', {
  30427. get: function() {
  30428. supportsPassive = true;
  30429. }
  30430. });
  30431. window.addEventListener('e', null, options);
  30432. window.removeEventListener('e', null, options);
  30433. } catch (e) {}
  30434. return supportsPassive;
  30435. }
  30436. },
  30437. {
  30438. /**
  30439. * @property MinContent
  30440. * @private
  30441. * @type {Boolean}
  30442. *
  30443. * Detects support for CSS "min-content"
  30444. */
  30445. name: 'CSSMinContent',
  30446. ready: true,
  30447. fn: function(doc, div) {
  30448. // As of 3/24/2017 IE/Edge have no min-content support, and firefox has
  30449. // partial/buggy support: https://bugzilla.mozilla.org/show_bug.cgi?id=135015
  30450. // This feature detector is designed to return false if there is not "full" support.
  30451. div.innerHTML = '<div style="height:4px;width:4px;min-height:-webkit-min-content;min-height:-moz-min-content;min-height:min-content"><div style="height:8px;width:8px"></div></div>';
  30452. return div.firstChild.offsetHeight === 8;
  30453. }
  30454. },
  30455. {
  30456. name: 'ComputedSizeIncludesPadding',
  30457. ready: true,
  30458. fn: function(doc, div) {
  30459. var ret = false,
  30460. bd = document.body,
  30461. el, w;
  30462. if (window.getComputedStyle) {
  30463. el = document.createElement('div');
  30464. el.style.cssText = 'width:10px;padding:2px;' + '-webkit-box-sizing:border-box;box-sizing:border-box;';
  30465. bd.appendChild(el);
  30466. w = window.getComputedStyle(el, null).width;
  30467. ret = w === '10px';
  30468. bd.removeChild(el);
  30469. }
  30470. return ret;
  30471. }
  30472. },
  30473. 0
  30474. ]
  30475. };
  30476. // placeholder so legacy browser detectors can come/go cleanly
  30477. Ext.feature.tests.pop();
  30478. // remove the placeholder
  30479. Ext.supports = {};
  30480. Ext.feature.detect();
  30481. /**
  30482. * This class manages ready detection and handling. Direct use of this class is not
  30483. * recommended. Instead use `Ext.onReady`:
  30484. *
  30485. * Ext.onReady(function () {
  30486. * // DOM and Framework are ready...
  30487. * });
  30488. *
  30489. * ## DOM Ready
  30490. *
  30491. * The lowest-level of readiness is DOM readiness. This level implies only that the document
  30492. * body exists. Many things require the DOM to be ready for manipulation. If that is all
  30493. * that is required, the `Ext.onDocumentReady` method can be called to register a callback
  30494. * to be called as soon as the DOM is ready:
  30495. *
  30496. * Ext.onDocumentReady(function () {
  30497. * // the document body is ready
  30498. * });
  30499. *
  30500. * ## Framework Ready
  30501. *
  30502. * In production builds of applications it is common to have all of the code loaded before
  30503. * DOM ready, so the need to wait for "onReady" is often confused with only that concern.
  30504. * This is easy to understand, at least in part because historically `Ext.onReady` only
  30505. * waited for DOM ready.
  30506. *
  30507. * With the introduction of `Ext.Loader`, however, it became common for DOM ready to occur
  30508. * in the middle of dynamically loading code. If application code were executed at that
  30509. * time, any use of the yet-to-be-loaded classes would throw errors. As a consequence of
  30510. * this, the `Ext.onReady` mechanism was extended to wait for both DOM ready *and* all of
  30511. * the required classes to be loaded.
  30512. *
  30513. * When the framework enters or leaves a state where it is not ready (for example, the
  30514. * first dynamic load is requested or last load completes), `Ext.env.Ready` is informed.
  30515. * For example:
  30516. *
  30517. * Ext.env.Ready.block();
  30518. *
  30519. * //...
  30520. *
  30521. * Ext.env.Ready.unblock();
  30522. *
  30523. * When there are no blocks and the DOM is ready, the Framework is ready and the "onReady"
  30524. * callbacks are called.
  30525. *
  30526. * Priority can be used to control the ordering of onReady listeners, for example:
  30527. *
  30528. * Ext.onReady(function() {
  30529. *
  30530. * }, null, {
  30531. * priority: 100
  30532. * });
  30533. *
  30534. * Ready listeners with higher priorities will run sooner than those with lower priorities,
  30535. * the default priority being `0`. Internally the framework reserves priorities of 1000
  30536. * or greater, and -1000 or lesser for onReady handlers that must run before or after
  30537. * any application code. Applications should stick to using priorities in the -999 - 999
  30538. * range. The following priorities are currently in use by the framework:
  30539. *
  30540. * - Element_scroll rtl override: `1001`
  30541. * - Event system initialization: `2000`
  30542. * - Ext.dom.Element: `1500`
  30543. *
  30544. * @class Ext.env.Ready
  30545. * @singleton
  30546. * @private
  30547. * @since 5.0.0
  30548. */
  30549. Ext.env.Ready = {
  30550. // @define Ext.env.Ready
  30551. // @require Ext.env.Browser
  30552. // @require Ext.env.OS
  30553. // @require Ext.env.Feature
  30554. /**
  30555. * @property {Number} blocks The number of Framework readiness blocks.
  30556. * @private
  30557. */
  30558. blocks: (location.search || '').indexOf('ext-pauseReadyFire') > 0 ? 1 : 0,
  30559. /**
  30560. * @property {Number} bound This property stores the state of event listeners bound
  30561. * to the document or window to detect ready state.
  30562. * @private
  30563. */
  30564. bound: 0,
  30565. /**
  30566. * @property {Number} [delay=1]
  30567. * This allows the DOM listener thread to complete (usually desirable with mobWebkit,
  30568. * Gecko) before firing the entire onReady chain (high stack load on Loader). For mobile
  30569. * devices when running from Home Screen, the splash screen will not disappear until
  30570. * all external resource requests finish. This delay clears the splash screen.
  30571. * @private
  30572. */
  30573. delay: 1,
  30574. /**
  30575. * @property {Event[]} events An array of events that have triggered ready state. This
  30576. * is for diagnostic purposes only and is only available in debug builds.
  30577. * An array
  30578. * @private
  30579. */
  30580. events: [],
  30581. /**
  30582. * @property {Boolean} firing This property is `true` when we currently calling the
  30583. * listeners.
  30584. * @private
  30585. */
  30586. firing: false,
  30587. /**
  30588. * @property {Number} generation A counter of the number of mutations of `listeners`.
  30589. * @private
  30590. */
  30591. generation: 0,
  30592. /**
  30593. * @property {Object[]} listeners The set of listeners waiting for ready.
  30594. * @private
  30595. */
  30596. listeners: [],
  30597. /**
  30598. * @property {Number} nextId A counter so we can assign listeners an `id` to keep
  30599. * them in FIFO order.
  30600. * @private
  30601. */
  30602. nextId: 0,
  30603. /**
  30604. * @property {Number} sortGeneration A captured value of `generation` that indicates
  30605. * when the `listeners` were last sorted.
  30606. * @private
  30607. */
  30608. sortGeneration: 0,
  30609. /**
  30610. * @property {Number} state
  30611. * Holds the current ready state as managed by this class. The values possible are:
  30612. *
  30613. * * 0 - Not ready.
  30614. * * 1 - Ready detected but listeners are not yet notified.
  30615. * * 2 - Ready detected and listeners are notified. See also `firing`.
  30616. *
  30617. * @private
  30618. */
  30619. state: 0,
  30620. /**
  30621. * @property {Object} timer The handle from `setTimeout` for the delayed notification
  30622. * of ready.
  30623. * @private
  30624. */
  30625. timer: null,
  30626. /**
  30627. * Binds the appropriate browser event for checking if the DOM has loaded.
  30628. * @private
  30629. */
  30630. bind: function() {
  30631. var me = Ext.env.Ready,
  30632. doc = document;
  30633. if (!me.bound) {
  30634. // Test scenario where load is dynamic AFTER window.load
  30635. if (doc.readyState === 'complete') {
  30636. // Firefox4+ got support for this state, others already do.
  30637. me.onReadyEvent({
  30638. type: doc.readyState || 'body'
  30639. });
  30640. } else {
  30641. me.bound = 1;
  30642. if (Ext.browser.is.PhoneGap && !Ext.os.is.Desktop) {
  30643. me.bound = 2;
  30644. doc.addEventListener('deviceready', me.onReadyEvent, false);
  30645. }
  30646. doc.addEventListener('DOMContentLoaded', me.onReadyEvent, false);
  30647. window.addEventListener('load', me.onReadyEvent, false);
  30648. }
  30649. }
  30650. },
  30651. block: function() {
  30652. ++this.blocks;
  30653. Ext.isReady = false;
  30654. },
  30655. /**
  30656. * This method starts the process of firing the ready event. This may be delayed based
  30657. * on the `delay` property.
  30658. * @private
  30659. */
  30660. fireReady: function() {
  30661. var me = Ext.env.Ready;
  30662. if (!me.state) {
  30663. Ext._readyTime = Ext.ticks();
  30664. Ext.isDomReady = true;
  30665. me.state = 1;
  30666. // As soon as we transition to domready, complete the feature detection:
  30667. Ext.feature.detect(true);
  30668. if (!me.delay) {
  30669. me.handleReady();
  30670. } else if (navigator.standalone) {
  30671. // When running from Home Screen, the splash screen will not disappear
  30672. // until all external resource requests finish.
  30673. // The first timeout clears the splash screen
  30674. // The second timeout allows inital HTML content to be displayed
  30675. me.timer = Ext.defer(function() {
  30676. me.timer = null;
  30677. me.handleReadySoon();
  30678. }, 1);
  30679. } else {
  30680. me.handleReadySoon();
  30681. }
  30682. }
  30683. },
  30684. /**
  30685. * This method iterates over the `listeners` and invokes them. This advances the
  30686. * `state` from 1 to 2 and ensure the proper subset of `listeners` are invoked.
  30687. * @private
  30688. */
  30689. handleReady: function() {
  30690. var me = this;
  30691. if (me.state === 1) {
  30692. me.state = 2;
  30693. Ext._beforeReadyTime = Ext.ticks();
  30694. me.invokeAll();
  30695. Ext._afterReadyTime = Ext.ticks();
  30696. }
  30697. },
  30698. /**
  30699. * This method is called to schedule a call to `handleReady` using a `setTimeout`. It
  30700. * ensures that only one timer is pending.
  30701. * @param {Number} [delay] If passed, this overrides the `delay` property.
  30702. * @private
  30703. */
  30704. handleReadySoon: function(delay) {
  30705. var me = this;
  30706. if (!me.timer) {
  30707. me.timer = Ext.defer(function() {
  30708. me.timer = null;
  30709. me.handleReady();
  30710. }, delay || me.delay);
  30711. }
  30712. },
  30713. /**
  30714. * This method invokes the given `listener` instance based on its options.
  30715. * @param {Object} listener
  30716. */
  30717. invoke: function(listener) {
  30718. var delay = listener.delay;
  30719. if (delay) {
  30720. Ext.defer(listener.fn, delay, listener.scope);
  30721. } else {
  30722. if (Ext.elevateFunction) {
  30723. Ext.elevateFunction(listener.fn, listener.scope);
  30724. } else {
  30725. listener.fn.call(listener.scope);
  30726. }
  30727. }
  30728. },
  30729. /**
  30730. * Invokes as many listeners as are appropriate given the current state. This should
  30731. * only be called when DOM ready is achieved. The remaining business of `blocks` is
  30732. * handled here.
  30733. */
  30734. invokeAll: function() {
  30735. if (Ext.elevateFunction) {
  30736. Ext.elevateFunction(this.doInvokeAll, this);
  30737. } else {
  30738. this.doInvokeAll();
  30739. }
  30740. },
  30741. doInvokeAll: function() {
  30742. var me = this,
  30743. listeners = me.listeners,
  30744. listener;
  30745. if (!me.blocks) {
  30746. // Since DOM is ready and we have no blocks, we mark the framework as ready.
  30747. Ext.isReady = true;
  30748. }
  30749. me.firing = true;
  30750. // NOTE: We cannot cache this length because each time through the loop a callback
  30751. // may have added new callbacks.
  30752. while (listeners.length) {
  30753. if (me.sortGeneration !== me.generation) {
  30754. me.sortGeneration = me.generation;
  30755. // This will happen just once on the first pass... if nothing is being
  30756. // added as we call the callbacks. This sorts the listeners such that the
  30757. // highest priority listener is at the *end* of the array ... so we can
  30758. // use pop (as opposed to shift) to extract it.
  30759. listeners.sort(me.sortFn);
  30760. }
  30761. listener = listeners.pop();
  30762. if (me.blocks && !listener.dom) {
  30763. // If we are blocked (i.e., only DOM ready) and this listener is not a
  30764. // DOM-ready listener we have reached the end of the line. The remaining
  30765. // listeners are Framework ready listeners.
  30766. listeners.push(listener);
  30767. break;
  30768. }
  30769. me.invoke(listener);
  30770. }
  30771. me.firing = false;
  30772. },
  30773. /**
  30774. * This method wraps the given listener pieces in a proper object for the `listeners`
  30775. * array and `invoke` methods.
  30776. * @param {Function} fn The method to call.
  30777. * @param {Object} [scope] The scope (`this` reference) in which the `fn` executes.
  30778. * Defaults to the browser window.
  30779. * @param {Object} [options] An object with extra options.
  30780. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  30781. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  30782. * number will result in the callback being sorted before the others. Priorities
  30783. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  30784. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  30785. * means full Framework and DOM readiness.
  30786. * @return {Object} The listener instance.
  30787. * @private
  30788. */
  30789. makeListener: function(fn, scope, options) {
  30790. var ret = {
  30791. fn: fn,
  30792. id: ++this.nextId,
  30793. // so sortFn can respect FIFO
  30794. scope: scope,
  30795. dom: false,
  30796. priority: 0
  30797. };
  30798. if (options) {
  30799. Ext.apply(ret, options);
  30800. }
  30801. ret.phase = ret.dom ? 0 : 1;
  30802. // to simplify the sortFn
  30803. return ret;
  30804. },
  30805. /**
  30806. * Adds a listener to be notified when the document is ready (before onload and before
  30807. * images are loaded).
  30808. *
  30809. * @param {Function} fn The method to call.
  30810. * @param {Object} [scope] The scope (`this` reference) in which the `fn` executes.
  30811. * Defaults to the browser window.
  30812. * @param {Object} [options] An object with extra options.
  30813. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  30814. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  30815. * number will result in the callback being sorted before the others. Priorities
  30816. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  30817. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  30818. * means full Framework and DOM readiness.
  30819. * @private
  30820. */
  30821. on: function(fn, scope, options) {
  30822. var me = Ext.env.Ready,
  30823. listener = me.makeListener(fn, scope, options);
  30824. if (me.state === 2 && !me.firing && (listener.dom || !me.blocks)) {
  30825. // If we are DOM ready (state === 2) and not currently in invokeAll (!firing)
  30826. // and this listener is ready to call (either a DOM ready listener or there
  30827. // are no blocks), then we need to invoke the listener now.
  30828. //
  30829. // Otherwise we can fall to the else block and push the listener. The eventual
  30830. // (or currently executing) call to handleReady or unblock will trigger its
  30831. // delivery in proper priority order.
  30832. me.invoke(listener);
  30833. } else {
  30834. me.listeners.push(listener);
  30835. ++me.generation;
  30836. if (!me.bound) {
  30837. // If we have never bound then bind the ready event now. If we have unbound
  30838. // the event then me.bound == -1 and we don't want to rebind it as the DOM
  30839. // is ready.
  30840. me.bind();
  30841. }
  30842. }
  30843. },
  30844. /**
  30845. * This is a generic event handler method attached to all of the various events that
  30846. * may indicate ready state. The first call to this method indicates ready state has
  30847. * been achieved.
  30848. * @param {Event} [ev] The event instance.
  30849. * @private
  30850. */
  30851. onReadyEvent: function(ev) {
  30852. var me = Ext.env.Ready;
  30853. if (Ext.elevateFunction) {
  30854. Ext.elevateFunction(me.doReadyEvent, me, arguments);
  30855. } else {
  30856. me.doReadyEvent(ev);
  30857. }
  30858. },
  30859. doReadyEvent: function(ev) {
  30860. var me = this;
  30861. if (ev && ev.type) {
  30862. me.events.push(ev);
  30863. }
  30864. if (me.bound > 0) {
  30865. me.unbind();
  30866. me.bound = -1;
  30867. }
  30868. // NOTE: *not* 0 or false - we never want to rebind!
  30869. if (!me.state) {
  30870. me.fireReady();
  30871. }
  30872. },
  30873. /**
  30874. * Sorts the `listeners` array by `phase` and `priority` such that the first listener
  30875. * to fire can be determined using `pop` on the `listeners` array.
  30876. * @private
  30877. */
  30878. sortFn: function(a, b) {
  30879. return -((a.phase - b.phase) || (b.priority - a.priority) || (a.id - b.id));
  30880. },
  30881. unblock: function() {
  30882. var me = this;
  30883. if (me.blocks) {
  30884. if (!--me.blocks) {
  30885. if (me.state === 2 && !me.firing) {
  30886. // We have already finished handleReady (the DOM ready handler) so
  30887. // this trigger just needs to dispatch all the remaining listeners.
  30888. me.invokeAll();
  30889. }
  30890. }
  30891. }
  30892. },
  30893. // if we are currently firing then invokeAll will pick up the Framework
  30894. // ready listeners automatically.
  30895. //
  30896. // If me.state < 2 then we are waiting for DOM ready so it will eventually
  30897. // call handleReady and invokeAll when everything is ready.
  30898. /**
  30899. * This method is called to remove all event listeners that may have been set up to
  30900. * detect ready state.
  30901. * @private
  30902. */
  30903. unbind: function() {
  30904. var me = this,
  30905. doc = document;
  30906. if (me.bound > 1) {
  30907. doc.removeEventListener('deviceready', me.onReadyEvent, false);
  30908. }
  30909. doc.removeEventListener('DOMContentLoaded', me.onReadyEvent, false);
  30910. window.removeEventListener('load', me.onReadyEvent, false);
  30911. }
  30912. };
  30913. (function() {
  30914. var Ready = Ext.env.Ready;
  30915. /*
  30916. * EXTJS-13522
  30917. * Although IE 9 has the DOMContentLoaded event available, usage of that causes
  30918. * timing issues when attempting to access document.namespaces (VmlCanvas.js).
  30919. * Consequently, even in IE 9 we need to use the legacy bind override for ready
  30920. * detection. This defers ready firing enough to allow access to the
  30921. * document.namespaces property.
  30922. *
  30923. * NOTE: this issue is very timing sensitive, and typically only displays itself
  30924. * when there is a large amount of latency between the browser and the server, and
  30925. * when testing against a built page (ext-all.js) and not a dev mode page.
  30926. */
  30927. if (Ext.isIE9m) {
  30928. /* Customized implementation for Legacy IE. The default implementation is
  30929. * configured for use with all other 'standards compliant' agents.
  30930. * References: http://javascript.nwbox.com/IEContentLoaded/
  30931. * licensed courtesy of http://developer.yahoo.com/yui/license.html
  30932. */
  30933. Ext.apply(Ready, {
  30934. /**
  30935. * Timer for doScroll polling
  30936. * @private
  30937. */
  30938. scrollTimer: null,
  30939. /**
  30940. * @private
  30941. */
  30942. readyStatesRe: /complete/i,
  30943. /**
  30944. * This strategy has minimal benefits for Sencha solutions that build
  30945. * themselves (ie. minimal initial page markup). However, progressively-enhanced
  30946. * pages (with image content and/or embedded frames) will benefit the most
  30947. * from it. Browser timer resolution is too poor to ensure a doScroll check
  30948. * more than once on a page loaded with minimal assets (the readystatechange
  30949. * event 'complete' usually beats the doScroll timer on a 'lightly-loaded'
  30950. * initial document).
  30951. * @private
  30952. */
  30953. pollScroll: function() {
  30954. var scrollable = true;
  30955. try {
  30956. document.documentElement.doScroll('left');
  30957. } catch (e) {
  30958. scrollable = false;
  30959. }
  30960. // on IE8, when running within an iFrame, document.body is not immediately
  30961. // available
  30962. if (scrollable && document.body) {
  30963. Ready.onReadyEvent({
  30964. type: 'doScroll'
  30965. });
  30966. } else {
  30967. // Minimize thrashing --
  30968. // adjusted for setTimeout's close-to-minimums (not too low),
  30969. // as this method SHOULD always be called once initially
  30970. Ready.scrollTimer = Ext.defer(Ready.pollScroll, 20);
  30971. }
  30972. return scrollable;
  30973. },
  30974. bind: function() {
  30975. if (Ready.bound) {
  30976. return;
  30977. }
  30978. var doc = document,
  30979. topContext;
  30980. // See if we are in an IFRAME? (doScroll ineffective here)
  30981. try {
  30982. topContext = window.frameElement === undefined;
  30983. } catch (e) {}
  30984. // If we throw an exception, it means we're probably getting access
  30985. // denied, which means we're in an iframe cross domain.
  30986. if (!topContext || !doc.documentElement.doScroll) {
  30987. Ready.pollScroll = Ext.emptyFn;
  30988. }
  30989. //then noop this test altogether
  30990. else if (Ready.pollScroll()) {
  30991. // starts scroll polling if necessary
  30992. return;
  30993. }
  30994. if (doc.readyState === 'complete') {
  30995. // Loaded AFTER initial document write/load...
  30996. Ready.onReadyEvent({
  30997. type: 'already ' + (doc.readyState || 'body')
  30998. });
  30999. } else {
  31000. doc.attachEvent('onreadystatechange', Ready.onReadyStateChange);
  31001. window.attachEvent('onload', Ready.onReadyEvent);
  31002. Ready.bound = 1;
  31003. }
  31004. },
  31005. unbind: function() {
  31006. document.detachEvent('onreadystatechange', Ready.onReadyStateChange);
  31007. window.detachEvent('onload', Ready.onReadyEvent);
  31008. if (Ext.isNumber(Ready.scrollTimer)) {
  31009. Ext.undefer(Ready.scrollTimer);
  31010. Ready.scrollTimer = null;
  31011. }
  31012. },
  31013. /**
  31014. * This event handler is called when the readyState changes.
  31015. * @private
  31016. */
  31017. onReadyStateChange: function() {
  31018. var state = document.readyState;
  31019. if (Ready.readyStatesRe.test(state)) {
  31020. Ready.onReadyEvent({
  31021. type: state
  31022. });
  31023. }
  31024. }
  31025. });
  31026. }
  31027. /**
  31028. * @property {Boolean} isDomReady
  31029. * `true` when the document body is ready for use.
  31030. * @member Ext
  31031. * @readonly
  31032. */
  31033. /**
  31034. * @property {Boolean} isReady
  31035. * `true` when `isDomReady` is true and the Framework is ready for use.
  31036. * @member Ext
  31037. * @readonly
  31038. */
  31039. /**
  31040. * @method onDocumentReady
  31041. * @member Ext
  31042. * Adds a listener to be notified when the document is ready (before onload and before
  31043. * images are loaded).
  31044. *
  31045. * @param {Function} fn The method to call.
  31046. * @param {Object} [scope] The scope (`this` reference) in which the handler function
  31047. * executes. Defaults to the browser window.
  31048. * @param {Object} [options] An object with extra options.
  31049. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  31050. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  31051. * number will result in the callback being sorted before the others. Priorities
  31052. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  31053. * @private
  31054. */
  31055. Ext.onDocumentReady = function(fn, scope, options) {
  31056. var opt = {
  31057. dom: true
  31058. };
  31059. if (options) {
  31060. Ext.apply(opt, options);
  31061. }
  31062. Ready.on(fn, scope, opt);
  31063. };
  31064. /**
  31065. * @method onReady
  31066. * @member Ext
  31067. * Adds a listener to be notified when the document is ready (before onload and before
  31068. * images are loaded).
  31069. *
  31070. * @param {Function} fn The method to call.
  31071. * @param {Object} [scope] The scope (`this` reference) in which the handler function
  31072. * executes. Defaults to the browser window.
  31073. * @param {Object} [options] An object with extra options.
  31074. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  31075. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  31076. * number will result in the callback being sorted before the others. Priorities
  31077. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  31078. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  31079. * means full Framework and DOM readiness.
  31080. * numbers are reserved.
  31081. */
  31082. Ext.onReady = function(fn, scope, options) {
  31083. Ready.on(fn, scope, options);
  31084. };
  31085. // A shortcut method for onReady with a high priority
  31086. Ext.onInternalReady = function(fn, scope, options) {
  31087. Ready.on(fn, scope, Ext.apply({
  31088. priority: 1000
  31089. }, options));
  31090. };
  31091. Ready.bind();
  31092. }());
  31093. // @tag class
  31094. /**
  31095. * This class provides dynamic loading support for JavaScript classes. Application code
  31096. * does not typically need to call `Ext.Loader` except perhaps to configure path mappings
  31097. * when not using [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/).
  31098. *
  31099. * Ext.Loader.setPath('MyApp', 'app');
  31100. *
  31101. * When using Sencha Cmd, this is handled by the "bootstrap" provided by the application
  31102. * build script and such configuration is not necessary.
  31103. *
  31104. * # Typical Usage
  31105. *
  31106. * The `Ext.Loader` is most often used behind the scenes to satisfy class references in
  31107. * class declarations. Like so:
  31108. *
  31109. * Ext.define('MyApp.view.Main', {
  31110. * extend: 'Ext.panel.Panel',
  31111. *
  31112. * mixins: [
  31113. * 'MyApp.util.Mixin'
  31114. * ],
  31115. *
  31116. * requires: [
  31117. * 'Ext.grid.Panel'
  31118. * ],
  31119. *
  31120. * uses: [
  31121. * 'MyApp.util.Stuff'
  31122. * ]
  31123. * });
  31124. *
  31125. * In all of these cases, `Ext.Loader` is used internally to resolve these class names
  31126. * and ensure that the necessary class files are loaded.
  31127. *
  31128. * During development, these files are loaded individually for optimal debugging. For a
  31129. * production use, [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/) will replace
  31130. * all of these strings with the actual resolved class references because it ensures that
  31131. * the classes are all contained in the build in the correct order. In development, these
  31132. * files will not be loaded until the `MyApp.view.Main` class indicates they are needed
  31133. * as shown above.
  31134. *
  31135. * # Loading Classes
  31136. *
  31137. * You can also use `Ext.Loader` directly to load classes or files. The simplest form of
  31138. * use is `{@link Ext#require}`.
  31139. *
  31140. * For example:
  31141. *
  31142. * Ext.require('MyApp.view.Main', function () {
  31143. * // On callback, the MyApp.view.Main class is now loaded
  31144. *
  31145. * var view = new MyApp.view.Main();
  31146. * });
  31147. *
  31148. * You can alternatively require classes by alias or wildcard.
  31149. *
  31150. * Ext.require('widget.window');
  31151. *
  31152. * Ext.require(['widget.window', 'layout.border', 'Ext.data.Connection']);
  31153. *
  31154. * Ext.require(['widget.*', 'layout.*', 'Ext.data.*']);
  31155. *
  31156. * The callback function is optional.
  31157. *
  31158. * **Note** Using `Ext.require` at global scope will cause `{@link Ext#onReady}` and
  31159. * `{@link Ext.app.Application#launch}` methods to be deferred until the required classes
  31160. * are loaded. It is these cases where the callback function is most often unnecessary.
  31161. *
  31162. * ## Using Excludes
  31163. *
  31164. * Alternatively, you can exclude what you don't need:
  31165. *
  31166. * // Include everything except Ext.tree.*
  31167. * Ext.exclude('Ext.tree.*').require('*');
  31168. *
  31169. * // Include all widgets except widget.checkbox* (this will exclude
  31170. * // widget.checkbox, widget.checkboxfield, widget.checkboxgroup, etc.)
  31171. * Ext.exclude('widget.checkbox*').require('widget.*');
  31172. *
  31173. * # Dynamic Instantiation
  31174. *
  31175. * Another feature enabled by `Ext.Loader` is instantiation using class names or aliases.
  31176. *
  31177. * For example:
  31178. *
  31179. * var win = Ext.create({
  31180. * xtype: 'window',
  31181. *
  31182. * // or
  31183. * // xclass: 'Ext.window.Window'
  31184. *
  31185. * title: 'Hello'
  31186. * });
  31187. *
  31188. * This form of creation can be useful if the type to create (`window` in the above) is
  31189. * not known statically. Internally, `{@link Ext#method!create}` may need to *synchronously*
  31190. * load the desired class and its requirements. Doing this will generate a warning in
  31191. * the console:
  31192. *
  31193. * [Ext.Loader] Synchronously loading 'Ext.window.Window'...
  31194. *
  31195. * If you see these in your debug console, you should add the indicated class(es) to the
  31196. * appropriate `requires` array (as above) or make an `{@link Ext#require}` call.
  31197. *
  31198. *
  31199. * **Note** Using `{@link Ext#method!create}` has some performance overhead and is best reserved
  31200. * for cases where the target class is not known until run-time.
  31201. *
  31202. * @class Ext.Loader
  31203. * @singleton
  31204. */
  31205. Ext.Loader = (new function() {
  31206. // jshint ignore:line
  31207. // @define Ext.Loader
  31208. // @require Ext.Base
  31209. // @require Ext.Class
  31210. // @require Ext.ClassManager
  31211. // @require Ext.Function
  31212. // @require Ext.Array
  31213. // @require Ext.env.Ready
  31214. var Loader = this,
  31215. Manager = Ext.ClassManager,
  31216. // this is an instance of Ext.Inventory
  31217. Boot = Ext.Boot,
  31218. Class = Ext.Class,
  31219. Ready = Ext.env.Ready,
  31220. alias = Ext.Function.alias,
  31221. dependencyProperties = [
  31222. 'extend',
  31223. 'mixins',
  31224. 'requires'
  31225. ],
  31226. isInHistory = {},
  31227. history = [],
  31228. readyListeners = [],
  31229. usedClasses = [],
  31230. _requiresMap = {},
  31231. _config = {
  31232. /**
  31233. * @cfg {Boolean} [enabled=true]
  31234. * Whether or not to enable the dynamic dependency loading feature.
  31235. */
  31236. enabled: true,
  31237. /**
  31238. * @cfg {Boolean} [scriptChainDelay=false]
  31239. * millisecond delay between asynchronous script injection (prevents stack
  31240. * overflow on some user agents) 'false' disables delay but potentially
  31241. * increases stack load.
  31242. */
  31243. scriptChainDelay: false,
  31244. /**
  31245. * @cfg {Boolean} [disableCaching=true]
  31246. * Appends current timestamp to script files to prevent caching.
  31247. */
  31248. disableCaching: true,
  31249. /**
  31250. * @cfg {String} [disableCachingParam="_dc"]
  31251. * The get parameter name for the cache buster's timestamp.
  31252. */
  31253. disableCachingParam: '_dc',
  31254. /**
  31255. * @cfg {Object} paths
  31256. * The mapping from namespaces to file paths
  31257. *
  31258. * {
  31259. * 'Ext': '.', // This is set by default, Ext.layout.container.Container will be
  31260. * // loaded from ./layout/Container.js
  31261. *
  31262. * 'My': './src/my_own_folder' // My.layout.Container will be loaded from
  31263. * // ./src/my_own_folder/layout/Container.js
  31264. * }
  31265. *
  31266. * Note that all relative paths are relative to the current HTML document.
  31267. * If not being specified, for example, `Other.awesome.Class` will simply be
  31268. * loaded from `"./Other/awesome/Class.js"`.
  31269. */
  31270. paths: Manager.paths,
  31271. /**
  31272. * @cfg {Boolean} preserveScripts
  31273. * `false` to remove asynchronously loaded scripts, `true` to retain script
  31274. * element for browser debugger compatibility and improved load performance.
  31275. */
  31276. preserveScripts: true,
  31277. /**
  31278. * @cfg {String} scriptCharset
  31279. * Optional charset to specify encoding of dynamic script content.
  31280. */
  31281. scriptCharset: undefined
  31282. },
  31283. // These configs are delegated to Ext.Script and may need different names:
  31284. delegatedConfigs = {
  31285. disableCaching: true,
  31286. disableCachingParam: true,
  31287. preserveScripts: true,
  31288. scriptChainDelay: 'loadDelay'
  31289. };
  31290. Ext.apply(Loader, {
  31291. /**
  31292. * @private
  31293. */
  31294. isInHistory: isInHistory,
  31295. /**
  31296. * Flag indicating whether there are still files being loaded
  31297. * @private
  31298. */
  31299. isLoading: false,
  31300. /**
  31301. * An array of class names to keep track of the dependency loading order.
  31302. * This is not guaranteed to be the same everytime due to the asynchronous
  31303. * nature of the Loader.
  31304. *
  31305. * @property {Array} history
  31306. */
  31307. history: history,
  31308. /**
  31309. * Configuration
  31310. * @private
  31311. */
  31312. config: _config,
  31313. /**
  31314. * Maintain the list of listeners to execute when all required scripts are fully loaded
  31315. * @private
  31316. */
  31317. readyListeners: readyListeners,
  31318. /**
  31319. * Contains classes referenced in `uses` properties.
  31320. * @private
  31321. */
  31322. optionalRequires: usedClasses,
  31323. /**
  31324. * Map of fully qualified class names to an array of dependent classes.
  31325. * @private
  31326. */
  31327. requiresMap: _requiresMap,
  31328. /** @private */
  31329. hasFileLoadError: false,
  31330. /**
  31331. * The number of scripts loading via loadScript.
  31332. * @private
  31333. */
  31334. scriptsLoading: 0,
  31335. /**
  31336. * @private
  31337. */
  31338. classesLoading: {},
  31339. missingCount: 0,
  31340. missingQueue: {},
  31341. /**
  31342. * @private
  31343. */
  31344. syncModeEnabled: false,
  31345. init: function() {
  31346. // initalize the default path of the framework
  31347. var scripts = document.getElementsByTagName('script'),
  31348. src = scripts[scripts.length - 1].src,
  31349. path = src.substring(0, src.lastIndexOf('/') + 1),
  31350. meta = Ext._classPathMetadata,
  31351. microloader = Ext.Microloader,
  31352. manifest = Ext.manifest,
  31353. loadOrder, classes, className, idx, baseUrl, loadlen, l, loadItem;
  31354. if (src.indexOf("packages/core/src/") !== -1) {
  31355. path = path + "../../";
  31356. } else if (src.indexOf("/core/src/class/") !== -1) {
  31357. path = path + "../../../";
  31358. }
  31359. if (!Manager.getPath("Ext")) {
  31360. Manager.setPath('Ext', path + 'src');
  31361. }
  31362. // Pull in Cmd generated metadata if available.
  31363. if (meta) {
  31364. Ext._classPathMetadata = null;
  31365. Loader.addClassPathMappings(meta);
  31366. }
  31367. if (manifest) {
  31368. loadOrder = manifest.loadOrder;
  31369. // if the manifest paths were calculated as relative to the
  31370. // bootstrap file, then we need to prepend Boot.baseUrl to the
  31371. // paths before processing
  31372. baseUrl = Ext.Boot.baseUrl;
  31373. if (loadOrder && manifest.bootRelative) {
  31374. for (loadlen = loadOrder.length , l = 0; l < loadlen; l++) {
  31375. loadItem = loadOrder[l];
  31376. loadItem.path = baseUrl + loadItem.path;
  31377. loadItem.canonicalPath = true;
  31378. }
  31379. }
  31380. }
  31381. if (microloader) {
  31382. Ready.block();
  31383. microloader.onMicroloaderReady(function() {
  31384. Ready.unblock();
  31385. });
  31386. }
  31387. },
  31388. /**
  31389. * @method setConfig
  31390. * Set the configuration for the loader. This should be called right after ext-(debug).js
  31391. * is included in the page, and before Ext.onReady. i.e:
  31392. *
  31393. * <script type="text/javascript" src="ext-core-debug.js"></script>
  31394. * <script type="text/javascript">
  31395. * Ext.Loader.setConfig({
  31396. * enabled: true,
  31397. * paths: {
  31398. * 'My': 'my_own_path'
  31399. * }
  31400. * });
  31401. * </script>
  31402. * <script type="text/javascript">
  31403. * Ext.require(...);
  31404. *
  31405. * Ext.onReady(function() {
  31406. * // application code here
  31407. * });
  31408. * </script>
  31409. *
  31410. * Refer to config options of {@link Ext.Loader} for the list of possible properties
  31411. *
  31412. * @param {Object} config The config object to override the default values
  31413. * @return {Ext.Loader} this
  31414. */
  31415. setConfig: Ext.Function.flexSetter(function(name, value) {
  31416. if (name === 'paths') {
  31417. Loader.setPath(value);
  31418. } else {
  31419. _config[name] = value;
  31420. var delegated = delegatedConfigs[name];
  31421. if (delegated) {
  31422. Boot.setConfig((delegated === true) ? name : delegated, value);
  31423. }
  31424. }
  31425. return Loader;
  31426. }),
  31427. /**
  31428. * Get the config value corresponding to the specified name. If no name is given,
  31429. * will return the config object
  31430. *
  31431. * @param {String} name The config property name
  31432. * @return {Object}
  31433. */
  31434. getConfig: function(name) {
  31435. return name ? _config[name] : _config;
  31436. },
  31437. /**
  31438. * Sets the path of a namespace.
  31439. * For Example:
  31440. *
  31441. * Ext.Loader.setPath('Ext', '.');
  31442. *
  31443. * @param {String/Object} name See {@link Ext.Function#flexSetter flexSetter}
  31444. * @param {String} [path] See {@link Ext.Function#flexSetter flexSetter}
  31445. * @return {Ext.Loader} this
  31446. * @method
  31447. */
  31448. setPath: function() {
  31449. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  31450. Manager.setPath.apply(Manager, arguments);
  31451. return Loader;
  31452. },
  31453. /**
  31454. * Sets a batch of path entries
  31455. *
  31456. * @param {Object} paths a set of className: path mappings
  31457. * @return {Ext.Loader} this
  31458. */
  31459. addClassPathMappings: function(paths) {
  31460. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  31461. Manager.setPath(paths);
  31462. return Loader;
  31463. },
  31464. /**
  31465. * fixes up loader path configs by prepending Ext.Boot#baseUrl to the beginning
  31466. * of the path, then delegates to Ext.Loader#addClassPathMappings
  31467. * @param pathConfig
  31468. */
  31469. addBaseUrlClassPathMappings: function(pathConfig) {
  31470. for (var name in pathConfig) {
  31471. pathConfig[name] = Boot.baseUrl + pathConfig[name];
  31472. }
  31473. Ext.Loader.addClassPathMappings(pathConfig);
  31474. },
  31475. /**
  31476. * Translates a className to a file path by adding the
  31477. * the proper prefix and converting the .'s to /'s. For example:
  31478. *
  31479. * Ext.Loader.setPath('My', '/path/to/My');
  31480. *
  31481. * alert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/path/to/My/awesome/Class.js'
  31482. *
  31483. * Note that the deeper namespace levels, if explicitly set, are always resolved first.
  31484. * For example:
  31485. *
  31486. * Ext.Loader.setPath({
  31487. * 'My': '/path/to/lib',
  31488. * 'My.awesome': '/other/path/for/awesome/stuff',
  31489. * 'My.awesome.more': '/more/awesome/path'
  31490. * });
  31491. *
  31492. * alert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/other/path/for/awesome/stuff/Class.js'
  31493. *
  31494. * alert(Ext.Loader.getPath('My.awesome.more.Class')); // alerts '/more/awesome/path/Class.js'
  31495. *
  31496. * alert(Ext.Loader.getPath('My.cool.Class')); // alerts '/path/to/lib/cool/Class.js'
  31497. *
  31498. * alert(Ext.Loader.getPath('Unknown.strange.Stuff')); // alerts 'Unknown/strange/Stuff.js'
  31499. *
  31500. * @param {String} className
  31501. * @return {String} path
  31502. */
  31503. getPath: function(className) {
  31504. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  31505. return Manager.getPath(className);
  31506. },
  31507. require: function(expressions, fn, scope, excludes) {
  31508. if (excludes) {
  31509. return Loader.exclude(excludes).require(expressions, fn, scope);
  31510. }
  31511. var classNames = Manager.getNamesByExpression(expressions);
  31512. return Loader.load(classNames, fn, scope);
  31513. },
  31514. syncRequire: function() {
  31515. var wasEnabled = Loader.syncModeEnabled;
  31516. Loader.syncModeEnabled = true;
  31517. var ret = Loader.require.apply(Loader, arguments);
  31518. Loader.syncModeEnabled = wasEnabled;
  31519. return ret;
  31520. },
  31521. exclude: function(excludes) {
  31522. var selector = Manager.select({
  31523. require: function(classNames, fn, scope) {
  31524. return Loader.load(classNames, fn, scope);
  31525. },
  31526. syncRequire: function(classNames, fn, scope) {
  31527. var wasEnabled = Loader.syncModeEnabled;
  31528. Loader.syncModeEnabled = true;
  31529. var ret = Loader.load(classNames, fn, scope);
  31530. Loader.syncModeEnabled = wasEnabled;
  31531. return ret;
  31532. }
  31533. });
  31534. selector.exclude(excludes);
  31535. return selector;
  31536. },
  31537. load: function(classNames, callback, scope) {
  31538. if (callback) {
  31539. if (callback.length) {
  31540. // If callback expects arguments, shim it with a function that will map
  31541. // the requires class(es) from the names we are given.
  31542. callback = Loader.makeLoadCallback(classNames, callback);
  31543. }
  31544. callback = callback.bind(scope || Ext.global);
  31545. }
  31546. var state = Manager.classState,
  31547. missingClassNames = [],
  31548. urls = [],
  31549. urlByClass = {},
  31550. numClasses = classNames.length,
  31551. url, className, i, numMissing;
  31552. for (i = 0; i < numClasses; ++i) {
  31553. className = Manager.resolveName(classNames[i]);
  31554. if (!Manager.isCreated(className)) {
  31555. missingClassNames.push(className);
  31556. if (!state[className]) {
  31557. urlByClass[className] = Loader.getPath(className);
  31558. urls.push(urlByClass[className]);
  31559. }
  31560. }
  31561. }
  31562. // If the dynamic dependency feature is not being used, throw an error
  31563. // if the dependencies are not defined
  31564. numMissing = missingClassNames.length;
  31565. if (numMissing) {
  31566. Loader.missingCount += numMissing;
  31567. Manager.onCreated(function() {
  31568. if (callback) {
  31569. Ext.callback(callback, scope, arguments);
  31570. }
  31571. Loader.checkReady();
  31572. }, Loader, missingClassNames);
  31573. if (!_config.enabled) {
  31574. Ext.raise("Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. " + "Missing required class" + ((missingClassNames.length > 1) ? "es" : "") + ": " + missingClassNames.join(', '));
  31575. }
  31576. if (urls.length) {
  31577. Loader.loadScripts({
  31578. url: urls,
  31579. // scope will be this options object so we can pass these along:
  31580. _classNames: missingClassNames,
  31581. _urlByClass: urlByClass
  31582. });
  31583. } else {
  31584. // need to call checkReady here, as the _missingCoun
  31585. // may have transitioned from 0 to > 0, meaning we
  31586. // need to block ready
  31587. Loader.checkReady();
  31588. }
  31589. } else {
  31590. if (callback) {
  31591. callback.call(scope);
  31592. }
  31593. // need to call checkReady here, as the _missingCoun
  31594. // may have transitioned from 0 to > 0, meaning we
  31595. // need to block ready
  31596. Loader.checkReady();
  31597. }
  31598. if (Loader.syncModeEnabled) {
  31599. // Class may have been just loaded or was already loaded
  31600. if (numClasses === 1) {
  31601. return Manager.get(classNames[0]);
  31602. }
  31603. }
  31604. return Loader;
  31605. },
  31606. makeLoadCallback: function(classNames, callback) {
  31607. return function() {
  31608. var classes = [],
  31609. i = classNames.length;
  31610. while (i-- > 0) {
  31611. classes[i] = Manager.get(classNames[i]);
  31612. }
  31613. return callback.apply(this, classes);
  31614. };
  31615. },
  31616. onLoadFailure: function(request) {
  31617. var options = this,
  31618. entries = request.entries || [],
  31619. onError = options.onError,
  31620. error, entry, i;
  31621. Loader.hasFileLoadError = true;
  31622. --Loader.scriptsLoading;
  31623. if (onError) {
  31624. for (i = 0; i < entries.length; i++) {
  31625. entry = entries[i];
  31626. if (entry.error) {
  31627. error = new Error('Failed to load: ' + entry.url);
  31628. break;
  31629. }
  31630. }
  31631. error = error || new Error('Failed to load');
  31632. onError.call(options.userScope, options, error, request);
  31633. } else {
  31634. Ext.log.error("[Ext.Loader] Some requested files failed to load.");
  31635. }
  31636. Loader.checkReady();
  31637. },
  31638. onLoadSuccess: function() {
  31639. var options = this,
  31640. onLoad = options.onLoad,
  31641. classNames = options._classNames,
  31642. urlByClass = options._urlByClass,
  31643. state = Manager.classState,
  31644. missingQueue = Loader.missingQueue,
  31645. className, i, len;
  31646. --Loader.scriptsLoading;
  31647. if (onLoad) {
  31648. //TODO: need an adapter to convert to v4 onLoad signatures
  31649. onLoad.call(options.userScope, options);
  31650. }
  31651. // onLoad can cause more loads to start, so it must run first
  31652. // classNames is the array of *all* classes that load() was asked to load,
  31653. // including those that might have been already loaded but not yet created.
  31654. // urlByClass is a map of only those classes that we asked Boot to load.
  31655. for (i = 0 , len = classNames.length; i < len; i++) {
  31656. className = classNames[i];
  31657. // When a script is loaded and executed, we should have Ext.define() called
  31658. // for at least one of the classes in the list, which will set the state
  31659. // for that class. That by itself does not mean that the class is available
  31660. // *now* but it means that ClassManager is tracking it and will fire the
  31661. // onCreated callback that we set back in load().
  31662. // However if there is no state for the class, that may mean two things:
  31663. // either it is not a Ext class, or it is truly missing. In any case we need
  31664. // to watch for that thing ourselves, which we will do every checkReady().
  31665. if (!state[className]) {
  31666. missingQueue[className] = urlByClass[className];
  31667. }
  31668. }
  31669. Loader.checkReady();
  31670. },
  31671. // TODO: this timing of this needs to be deferred until all classes have had
  31672. // a chance to be created
  31673. reportMissingClasses: function() {
  31674. if (!Loader.syncModeEnabled && !Loader.scriptsLoading && Loader.isLoading && !Loader.hasFileLoadError) {
  31675. var missingQueue = Loader.missingQueue,
  31676. missingClasses = [],
  31677. missingPaths = [];
  31678. for (var missingClassName in missingQueue) {
  31679. missingClasses.push(missingClassName);
  31680. missingPaths.push(missingQueue[missingClassName]);
  31681. }
  31682. if (missingClasses.length) {
  31683. throw new Error("The following classes are not declared even if their files have been " + "loaded: '" + missingClasses.join("', '") + "'. Please check the source code of their " + "corresponding files for possible typos: '" + missingPaths.join("', '"));
  31684. }
  31685. }
  31686. },
  31687. /**
  31688. * Add a new listener to be executed when all required scripts are fully loaded
  31689. *
  31690. * @param {Function} fn The function callback to be executed
  31691. * @param {Object} scope The execution scope (`this`) of the callback function.
  31692. * @param {Boolean} [withDomReady=true] Pass `false` to not also wait for document
  31693. * dom ready.
  31694. * @param {Object} [options] Additional callback options.
  31695. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  31696. * @param {Number} [options.priority=0] Relative priority of this callback. Negative
  31697. * numbers are reserved.
  31698. */
  31699. onReady: function(fn, scope, withDomReady, options) {
  31700. if (withDomReady) {
  31701. Ready.on(fn, scope, options);
  31702. } else {
  31703. var listener = Ready.makeListener(fn, scope, options);
  31704. if (Loader.isLoading) {
  31705. readyListeners.push(listener);
  31706. } else {
  31707. Ready.invoke(listener);
  31708. }
  31709. }
  31710. },
  31711. /**
  31712. * @private
  31713. * Ensure that any classes referenced in the `uses` property are loaded.
  31714. */
  31715. addUsedClasses: function(classes) {
  31716. var cls, i, ln;
  31717. if (classes) {
  31718. classes = (typeof classes === 'string') ? [
  31719. classes
  31720. ] : classes;
  31721. for (i = 0 , ln = classes.length; i < ln; i++) {
  31722. cls = classes[i];
  31723. if (typeof cls === 'string' && !Ext.Array.contains(usedClasses, cls)) {
  31724. usedClasses.push(cls);
  31725. }
  31726. }
  31727. }
  31728. return Loader;
  31729. },
  31730. /**
  31731. * @private
  31732. */
  31733. triggerReady: function() {
  31734. var listener,
  31735. refClasses = usedClasses;
  31736. if (Loader.isLoading && refClasses.length) {
  31737. // Empty the array to eliminate potential recursive loop issue
  31738. usedClasses = [];
  31739. // this may immediately call us back if all 'uses' classes
  31740. // have been loaded
  31741. Loader.require(refClasses);
  31742. } else {
  31743. // Must clear this before calling callbacks. This will cause any new loads
  31744. // to call Ready.block() again. See below for more on this.
  31745. Loader.isLoading = false;
  31746. // These listeners are just those attached directly to Loader to wait for
  31747. // class loading only.
  31748. readyListeners.sort(Ready.sortFn);
  31749. // this method can be called with Loader.isLoading either true or false
  31750. // (can be called with false when all 'uses' classes are already loaded)
  31751. // this may bypass the above if condition
  31752. while (readyListeners.length && !Loader.isLoading) {
  31753. // we may re-enter triggerReady so we cannot necessarily iterate the
  31754. // readyListeners array
  31755. listener = readyListeners.pop();
  31756. Ready.invoke(listener);
  31757. }
  31758. // If the DOM is also ready, this will fire the normal onReady listeners.
  31759. // An astute observer would note that we may now be back to isLoading and
  31760. // so ask "Why you call unblock?". The reason is that we must match the
  31761. // calls to block and since we transitioned from isLoading to !isLoading
  31762. // here we must call unblock. If we have transitioned back to isLoading in
  31763. // the above loop it will have called block again so the counter will be
  31764. // increased and this call will not reduce the block count to 0. This is
  31765. // done by loadScripts.
  31766. Ready.unblock();
  31767. }
  31768. },
  31769. /**
  31770. * @private
  31771. * @param {String} className
  31772. */
  31773. historyPush: function(className) {
  31774. if (className && !isInHistory[className] && !Manager.overrideMap[className]) {
  31775. isInHistory[className] = true;
  31776. history.push(className);
  31777. }
  31778. return Loader;
  31779. },
  31780. /**
  31781. * This is an internal method that delegate content loading to the
  31782. * bootstrap layer.
  31783. * @private
  31784. * @param params
  31785. */
  31786. loadScripts: function(params) {
  31787. var manifest = Ext.manifest,
  31788. loadOrder = manifest && manifest.loadOrder,
  31789. loadOrderMap = manifest && manifest.loadOrderMap,
  31790. options;
  31791. ++Loader.scriptsLoading;
  31792. // if the load order map hasn't been created, create it now
  31793. // and cache on the manifest
  31794. if (loadOrder && !loadOrderMap) {
  31795. manifest.loadOrderMap = loadOrderMap = Boot.createLoadOrderMap(loadOrder);
  31796. }
  31797. // verify the loading state, as this may have transitioned us from
  31798. // not loading to loading
  31799. Loader.checkReady();
  31800. options = Ext.apply({
  31801. loadOrder: loadOrder,
  31802. loadOrderMap: loadOrderMap,
  31803. charset: _config.scriptCharset,
  31804. success: Loader.onLoadSuccess,
  31805. failure: Loader.onLoadFailure,
  31806. sync: Loader.syncModeEnabled,
  31807. _classNames: []
  31808. }, params);
  31809. options.userScope = options.scope;
  31810. options.scope = options;
  31811. Boot.load(options);
  31812. },
  31813. /**
  31814. * This method is provide for use by the bootstrap layer.
  31815. * @private
  31816. * @param {String[]} urls
  31817. */
  31818. loadScriptsSync: function(urls) {
  31819. var syncwas = Loader.syncModeEnabled;
  31820. Loader.syncModeEnabled = true;
  31821. Loader.loadScripts({
  31822. url: urls
  31823. });
  31824. Loader.syncModeEnabled = syncwas;
  31825. },
  31826. /**
  31827. * This method is provide for use by the bootstrap layer.
  31828. * @private
  31829. * @param {String[]} urls
  31830. */
  31831. loadScriptsSyncBasePrefix: function(urls) {
  31832. var syncwas = Loader.syncModeEnabled;
  31833. Loader.syncModeEnabled = true;
  31834. Loader.loadScripts({
  31835. url: urls,
  31836. prependBaseUrl: true
  31837. });
  31838. Loader.syncModeEnabled = syncwas;
  31839. },
  31840. /**
  31841. * Loads the specified script URL and calls the supplied callbacks. If this method
  31842. * is called before {@link Ext#isReady}, the script's load will delay the transition
  31843. * to ready. This can be used to load arbitrary scripts that may contain further
  31844. * {@link Ext#require Ext.require} calls.
  31845. *
  31846. * @param {Object/String/String[]} options The options object or simply the URL(s) to load.
  31847. * @param {String} options.url The URL from which to load the script.
  31848. * @param {Function} [options.onLoad] The callback to call on successful load.
  31849. * @param {Function} [options.onError] The callback to call on failure to load.
  31850. * @param {Object} [options.scope] The scope (`this`) for the supplied callbacks.
  31851. */
  31852. loadScript: function(options) {
  31853. var isString = typeof options === 'string',
  31854. isArray = options instanceof Array,
  31855. isObject = !isArray && !isString,
  31856. url = isObject ? options.url : options,
  31857. onError = isObject && options.onError,
  31858. onLoad = isObject && options.onLoad,
  31859. scope = isObject && options.scope,
  31860. request = {
  31861. url: url,
  31862. scope: scope,
  31863. onLoad: onLoad,
  31864. onError: onError,
  31865. _classNames: []
  31866. };
  31867. Loader.loadScripts(request);
  31868. },
  31869. /**
  31870. * @private
  31871. */
  31872. checkMissingQueue: function() {
  31873. var missingQueue = Loader.missingQueue,
  31874. newQueue = {},
  31875. name,
  31876. missing = 0;
  31877. for (name in missingQueue) {
  31878. // If class state is available for the name, that means ClassManager
  31879. // is tracking it and will fire callback when it is created.
  31880. // We only need to track non-class things in the Loader.
  31881. if (!(Manager.classState[name] || Manager.isCreated(name))) {
  31882. newQueue[name] = missingQueue[name];
  31883. missing++;
  31884. }
  31885. }
  31886. Loader.missingCount = missing;
  31887. Loader.missingQueue = newQueue;
  31888. },
  31889. /**
  31890. * @private
  31891. */
  31892. checkReady: function() {
  31893. var wasLoading = Loader.isLoading,
  31894. isLoading;
  31895. Loader.checkMissingQueue();
  31896. isLoading = Loader.missingCount + Loader.scriptsLoading;
  31897. if (isLoading && !wasLoading) {
  31898. Ready.block();
  31899. Loader.isLoading = !!isLoading;
  31900. } else if (!isLoading && wasLoading) {
  31901. Loader.triggerReady();
  31902. }
  31903. if (!Loader.scriptsLoading && Loader.missingCount) {
  31904. // Things look bad, but since load requests may come later, defer this
  31905. // for a bit then check if things are still stuck.
  31906. Ext.defer(function() {
  31907. if (!Loader.scriptsLoading && Loader.missingCount) {
  31908. Ext.log.error('[Loader] The following classes failed to load:');
  31909. for (var name in Loader.missingQueue) {
  31910. Ext.log.error('[Loader] ' + name + ' from ' + Loader.missingQueue[name]);
  31911. }
  31912. }
  31913. }, 1000);
  31914. }
  31915. }
  31916. });
  31917. /**
  31918. * Loads all classes by the given names and all their direct dependencies; optionally
  31919. * executes the given callback function when finishes, within the optional scope.
  31920. *
  31921. * @param {String/String[]} expressions The class, classes or wildcards to load.
  31922. * @param {Function} [fn] The callback function.
  31923. * @param {Object} [scope] The execution scope (`this`) of the callback function.
  31924. * @member Ext
  31925. * @method require
  31926. */
  31927. Ext.require = alias(Loader, 'require');
  31928. /**
  31929. * Synchronously loads all classes by the given names and all their direct dependencies; optionally
  31930. * executes the given callback function when finishes, within the optional scope.
  31931. *
  31932. * @param {String/String[]} expressions The class, classes or wildcards to load.
  31933. * @param {Function} [fn] The callback function.
  31934. * @param {Object} [scope] The execution scope (`this`) of the callback function.
  31935. * @member Ext
  31936. * @method syncRequire
  31937. */
  31938. Ext.syncRequire = alias(Loader, 'syncRequire');
  31939. /**
  31940. * Explicitly exclude files from being loaded. Useful when used in conjunction with a
  31941. * broad include expression. Can be chained with more `require` and `exclude` methods,
  31942. * for example:
  31943. *
  31944. * Ext.exclude('Ext.data.*').require('*');
  31945. *
  31946. * Ext.exclude('widget.button*').require('widget.*');
  31947. *
  31948. * @param {String/String[]} excludes
  31949. * @return {Object} Contains `exclude`, `require` and `syncRequire` methods for chaining.
  31950. * @member Ext
  31951. * @method exclude
  31952. */
  31953. Ext.exclude = alias(Loader, 'exclude');
  31954. /**
  31955. * @cfg {String[]} requires
  31956. * @member Ext.Class
  31957. * List of classes that have to be loaded before instantiating this class.
  31958. * For example:
  31959. *
  31960. * Ext.define('Mother', {
  31961. * requires: ['Child'],
  31962. * giveBirth: function() {
  31963. * // we can be sure that child class is available.
  31964. * return new Child();
  31965. * }
  31966. * });
  31967. */
  31968. Class.registerPreprocessor('loader', function(cls, data, hooks, continueFn) {
  31969. Ext.classSystemMonitor && Ext.classSystemMonitor(cls, 'Ext.Loader#loaderPreprocessor', arguments);
  31970. // jshint ignore:line
  31971. var me = this,
  31972. dependencies = [],
  31973. dependency,
  31974. className = Manager.getName(cls),
  31975. i, j, ln, subLn, value, propertyName, propertyValue, requiredMap;
  31976. /*
  31977. Loop through the dependencyProperties, look for string class names and push
  31978. them into a stack, regardless of whether the property's value is a string, array or object. For example:
  31979. {
  31980. extend: 'Ext.MyClass',
  31981. requires: ['Ext.some.OtherClass'],
  31982. mixins: {
  31983. thing: 'Foo.bar.Thing';
  31984. }
  31985. }
  31986. which will later be transformed into:
  31987. {
  31988. extend: Ext.MyClass,
  31989. requires: [Ext.some.OtherClass],
  31990. mixins: {
  31991. thing: Foo.bar.Thing;
  31992. }
  31993. }
  31994. */
  31995. for (i = 0 , ln = dependencyProperties.length; i < ln; i++) {
  31996. propertyName = dependencyProperties[i];
  31997. if (data.hasOwnProperty(propertyName)) {
  31998. propertyValue = data[propertyName];
  31999. if (typeof propertyValue === 'string') {
  32000. dependencies.push(propertyValue);
  32001. } else if (propertyValue instanceof Array) {
  32002. for (j = 0 , subLn = propertyValue.length; j < subLn; j++) {
  32003. value = propertyValue[j];
  32004. if (typeof value === 'string') {
  32005. dependencies.push(value);
  32006. }
  32007. }
  32008. } else if (typeof propertyValue !== 'function') {
  32009. for (j in propertyValue) {
  32010. if (propertyValue.hasOwnProperty(j)) {
  32011. value = propertyValue[j];
  32012. if (typeof value === 'string') {
  32013. dependencies.push(value);
  32014. }
  32015. }
  32016. }
  32017. }
  32018. }
  32019. }
  32020. if (dependencies.length === 0) {
  32021. return;
  32022. }
  32023. if (className) {
  32024. _requiresMap[className] = dependencies;
  32025. }
  32026. var manifestClasses = Ext.manifest && Ext.manifest.classes,
  32027. deadlockPath = [],
  32028. detectDeadlock;
  32029. /*
  32030. * Automatically detect deadlocks before-hand,
  32031. * will throw an error with detailed path for ease of debugging. Examples
  32032. * of deadlock cases:
  32033. *
  32034. * - A extends B, then B extends A
  32035. * - A requires B, B requires C, then C requires A
  32036. *
  32037. * The detectDeadlock function will recursively transverse till the leaf, hence
  32038. * it can detect deadlocks no matter how deep the path is. However we don't need
  32039. * to run this check if the class name is in the manifest: that means Cmd has
  32040. * already resolved all dependencies for this class with no deadlocks.
  32041. */
  32042. if (className && (!manifestClasses || !manifestClasses[className])) {
  32043. requiredMap = Loader.requiredByMap || (Loader.requiredByMap = {});
  32044. for (i = 0 , ln = dependencies.length; i < ln; i++) {
  32045. dependency = dependencies[i];
  32046. (requiredMap[dependency] || (requiredMap[dependency] = [])).push(className);
  32047. }
  32048. detectDeadlock = function(cls) {
  32049. deadlockPath.push(cls);
  32050. var requires = _requiresMap[cls],
  32051. dep, i, ln;
  32052. if (requires) {
  32053. if (Ext.Array.contains(requires, className)) {
  32054. Ext.Error.raise("Circular requirement detected! '" + className + "' and '" + deadlockPath[1] + "' mutually require each other. Path: " + deadlockPath.join(' -> ') + " -> " + deadlockPath[0]);
  32055. }
  32056. for (i = 0 , ln = requires.length; i < ln; i++) {
  32057. dep = requires[i];
  32058. if (!isInHistory[dep]) {
  32059. detectDeadlock(requires[i]);
  32060. }
  32061. }
  32062. }
  32063. };
  32064. detectDeadlock(className);
  32065. }
  32066. (className ? Loader.exclude(className) : Loader).require(dependencies, function() {
  32067. for (i = 0 , ln = dependencyProperties.length; i < ln; i++) {
  32068. propertyName = dependencyProperties[i];
  32069. if (data.hasOwnProperty(propertyName)) {
  32070. propertyValue = data[propertyName];
  32071. if (typeof propertyValue === 'string') {
  32072. data[propertyName] = Manager.get(propertyValue);
  32073. } else if (propertyValue instanceof Array) {
  32074. for (j = 0 , subLn = propertyValue.length; j < subLn; j++) {
  32075. value = propertyValue[j];
  32076. if (typeof value === 'string') {
  32077. data[propertyName][j] = Manager.get(value);
  32078. }
  32079. }
  32080. } else if (typeof propertyValue !== 'function') {
  32081. for (var k in propertyValue) {
  32082. if (propertyValue.hasOwnProperty(k)) {
  32083. value = propertyValue[k];
  32084. if (typeof value === 'string') {
  32085. data[propertyName][k] = Manager.get(value);
  32086. }
  32087. }
  32088. }
  32089. }
  32090. }
  32091. }
  32092. continueFn.call(me, cls, data, hooks);
  32093. });
  32094. return false;
  32095. }, true, 'after', 'className');
  32096. /**
  32097. * @cfg {String[]} uses
  32098. * @member Ext.Class
  32099. * List of optional classes to load together with this class. These aren't neccessarily loaded before
  32100. * this class is created, but are guaranteed to be available before Ext.onReady listeners are
  32101. * invoked. For example:
  32102. *
  32103. * Ext.define('Mother', {
  32104. * uses: ['Child'],
  32105. * giveBirth: function() {
  32106. * // This code might, or might not work:
  32107. * // return new Child();
  32108. *
  32109. * // Instead use Ext.create() to load the class at the spot if not loaded already:
  32110. * return Ext.create('Child');
  32111. * }
  32112. * });
  32113. */
  32114. Manager.registerPostprocessor('uses', function(name, cls, data) {
  32115. Ext.classSystemMonitor && Ext.classSystemMonitor(cls, 'Ext.Loader#usesPostprocessor', arguments);
  32116. // jshint ignore:line
  32117. var uses = data.uses,
  32118. classNames;
  32119. if (uses) {
  32120. classNames = Manager.getNamesByExpression(data.uses);
  32121. Loader.addUsedClasses(classNames);
  32122. }
  32123. });
  32124. Manager.onCreated(Loader.historyPush);
  32125. Loader.init();
  32126. }());
  32127. //-----------------------------------------------------------------------------
  32128. // Use performance.now when available to keep timestamps consistent.
  32129. Ext._endTime = Ext.ticks();
  32130. // This hook is to allow tools like DynaTrace to deterministically detect the availability
  32131. // of Ext.onReady. Since Loader takes over Ext.onReady this must be done here and not in
  32132. // Ext.env.Ready.
  32133. if (Ext._beforereadyhandler) {
  32134. Ext._beforereadyhandler();
  32135. }
  32136. /**
  32137. * @class Ext.util.Positionable
  32138. */
  32139. Ext.define('Ext.overrides.util.Positionable', {
  32140. override: 'Ext.util.Positionable',
  32141. /**
  32142. * @method alignTo
  32143. * @param {Ext.util.Positionable/HTMLElement/String} anchorToEl The Positionable,
  32144. * HTMLElement, or id of the element to align to.
  32145. * @param {String} [alignment="tl-bl?"] The position to align to
  32146. * @param {Number[]} [offsets] Offset the positioning by [x, y]
  32147. * @param {Boolean/Object} [animate] true for the default animation or a standard
  32148. * Element animation config object
  32149. * @return {Ext.util.Positionable} this
  32150. */
  32151. /**
  32152. * @method anchorTo
  32153. * Anchors an element to another element and realigns it when the window is resized.
  32154. * @param {Ext.util.Positionable/HTMLElement/String} anchorToEl The Positionable,
  32155. * HTMLElement, or id of the element to align to.
  32156. * @param {String} [alignment="tl-bl?"] The position to align to
  32157. * @param {Number[]} [offsets] Offset the positioning by [x, y]
  32158. * @param {Boolean/Object} [animate] true for the default animation or a standard
  32159. * Element animation config object
  32160. * @param {Boolean/Number} [monitorScroll=50] True to monitor body scroll and
  32161. * reposition. If this parameter is a number, it is used as the buffer delay in
  32162. * milliseconds.
  32163. * @param {Function} [callback] The function to call after the animation finishes
  32164. * @return {Ext.util.Positionable} this
  32165. */
  32166. anchorTo: function(anchorToEl, alignment, offsets, animate, monitorScroll, callback) {
  32167. var me = this,
  32168. scroll = !Ext.isEmpty(monitorScroll),
  32169. action = function() {
  32170. me.mixins.positionable.alignTo.call(me, anchorToEl, alignment, offsets, animate);
  32171. Ext.callback(callback, me);
  32172. },
  32173. anchor = me.getAnchor();
  32174. // previous listener anchor, remove it
  32175. me.removeAnchor();
  32176. Ext.apply(anchor, {
  32177. fn: action,
  32178. scroll: scroll
  32179. });
  32180. Ext.on('resize', action, null);
  32181. if (scroll) {
  32182. Ext.getWin().on('scroll', action, null, {
  32183. buffer: !isNaN(monitorScroll) ? monitorScroll : 50
  32184. });
  32185. }
  32186. action();
  32187. // align immediately
  32188. return me;
  32189. },
  32190. getAnchor: function() {
  32191. var el = this.el,
  32192. data, anchor;
  32193. if (!el || !el.dom) {
  32194. return;
  32195. }
  32196. data = el.getData();
  32197. anchor = data._anchor;
  32198. if (!anchor) {
  32199. anchor = data._anchor = {};
  32200. }
  32201. return anchor;
  32202. },
  32203. alignTo: function(element, position, offsets, /* private (documented in ext) */
  32204. animate) {
  32205. var me = this,
  32206. el = me.el,
  32207. newMaxHeight, newRegion;
  32208. // Release any height constraint prior to aligning if we are shrinkwrap height.
  32209. if (me.isComponent && me.getSizeModel().height.shrinkWrap) {
  32210. if (me.maxHeight) {
  32211. me.setMaxHeight(null);
  32212. }
  32213. newMaxHeight = true;
  32214. }
  32215. newRegion = me.getAlignToRegion(element, position, offsets, me.minHeight || 150);
  32216. me.setXY([
  32217. newRegion.x,
  32218. newRegion.y
  32219. ], el.anim && !!animate ? el.anim(animate) : false);
  32220. // Impose calculated height constraint.
  32221. if (newMaxHeight && (newMaxHeight = newRegion.getHeight()) !== me.getHeight()) {
  32222. me.setMaxHeight(newMaxHeight);
  32223. }
  32224. return me;
  32225. },
  32226. /**
  32227. * @method move
  32228. * Move the element relative to its current position.
  32229. * @param {String} direction Possible values are:
  32230. *
  32231. * - `"l"` (or `"left"`)
  32232. * - `"r"` (or `"right"`)
  32233. * - `"t"` (or `"top"`, or `"up"`)
  32234. * - `"b"` (or `"bottom"`, or `"down"`)
  32235. *
  32236. * @param {Number} distance How far to move the element in pixels
  32237. * @param {Boolean/Object} [animate] true for the default animation or a standard
  32238. * Element animation config object
  32239. */
  32240. /**
  32241. * Remove any anchor to this element. See {@link #anchorTo}.
  32242. * @return {Ext.util.Positionable} this
  32243. */
  32244. removeAnchor: function() {
  32245. var anchor = this.getAnchor();
  32246. if (anchor && anchor.fn) {
  32247. Ext.un('resize', anchor.fn);
  32248. if (anchor.scroll) {
  32249. Ext.getWin().on('scroll', anchor.fn);
  32250. }
  32251. delete anchor.fn;
  32252. }
  32253. return this;
  32254. },
  32255. /**
  32256. * @method setBox
  32257. * Sets the element's box. If animate is true then x, y, width, and height will be
  32258. * animated concurrently.
  32259. * @param {Object} box The box to fill {x, y, width, height}
  32260. * @param {Boolean/Object} [animate] true for the default animation or a standard
  32261. * Element animation config object
  32262. * @return {Ext.util.Positionable} this
  32263. */
  32264. setBox: function(box, animate) {
  32265. var me = this;
  32266. if (box.isRegion) {
  32267. box = {
  32268. x: box.left,
  32269. y: box.top,
  32270. width: box.right - box.left,
  32271. height: box.bottom - box.top
  32272. };
  32273. }
  32274. if (animate) {
  32275. me.constrainBox(box);
  32276. me.animate(Ext.applyIf({
  32277. to: box,
  32278. listeners: {
  32279. afteranimate: Ext.Function.bind(me.afterSetPosition, me, [
  32280. box.x,
  32281. box.y
  32282. ])
  32283. }
  32284. }, animate));
  32285. } else {
  32286. me.callParent([
  32287. box
  32288. ]);
  32289. }
  32290. return me;
  32291. }
  32292. });
  32293. /**
  32294. * @method setX
  32295. * Sets the X position of the DOM element based on page coordinates.
  32296. * @param {Number} x The X position
  32297. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  32298. * Element animation config object
  32299. * @return {Ext.util.Positionable} this
  32300. */
  32301. /**
  32302. * @method setXY
  32303. * Sets the position of the DOM element in page coordinates.
  32304. * @param {Number[]} pos Contains X & Y [x, y] values for new position (coordinates
  32305. * are page-based)
  32306. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  32307. * Element animation config object
  32308. * @return {Ext.util.Positionable} this
  32309. */
  32310. /**
  32311. * @method setY
  32312. * Sets the Y position of the DOM element based on page coordinates.
  32313. * @param {Number} y The Y position
  32314. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  32315. * Element animation config object
  32316. * @return {Ext.util.Positionable} this
  32317. */
  32318. /**
  32319. * @class Ext.event.Event
  32320. */
  32321. Ext.define('Ext.overrides.event.Event', {
  32322. override: 'Ext.event.Event',
  32323. /**
  32324. * @method injectEvent
  32325. * @member Ext.event.Event
  32326. * Injects a DOM event using the data in this object and (optionally) a new target.
  32327. * This is a low-level technique and not likely to be used by application code. The
  32328. * currently supported event types are:
  32329. * <p><b>HTMLEvents</b></p>
  32330. * <ul>
  32331. * <li>load</li>
  32332. * <li>unload</li>
  32333. * <li>select</li>
  32334. * <li>change</li>
  32335. * <li>submit</li>
  32336. * <li>reset</li>
  32337. * <li>resize</li>
  32338. * <li>scroll</li>
  32339. * </ul>
  32340. * <p><b>MouseEvents</b></p>
  32341. * <ul>
  32342. * <li>click</li>
  32343. * <li>dblclick</li>
  32344. * <li>mousedown</li>
  32345. * <li>mouseup</li>
  32346. * <li>mouseover</li>
  32347. * <li>mousemove</li>
  32348. * <li>mouseout</li>
  32349. * </ul>
  32350. * <p><b>UIEvents</b></p>
  32351. * <ul>
  32352. * <li>focusin</li>
  32353. * <li>focusout</li>
  32354. * <li>activate</li>
  32355. * <li>focus</li>
  32356. * <li>blur</li>
  32357. * </ul>
  32358. * @param {Ext.Element/HTMLElement} target (optional) If specified, the target for the event. This
  32359. * is likely to be used when relaying a DOM event. If not specified, {@link #getTarget}
  32360. * is used to determine the target.
  32361. */
  32362. injectEvent: (function() {
  32363. var API,
  32364. dispatchers = {},
  32365. // keyed by event type (e.g., 'mousedown')
  32366. crazyIEButtons;
  32367. // Good reference: http://developer.yahoo.com/yui/docs/UserAction.js.html
  32368. // IE9 has createEvent, but this code causes major problems with htmleditor (it
  32369. // blocks all mouse events and maybe more). TODO
  32370. if (!Ext.isIE9m && document.createEvent) {
  32371. // if (DOM compliant)
  32372. API = {
  32373. createHtmlEvent: function(doc, type, bubbles, cancelable) {
  32374. var event = doc.createEvent('HTMLEvents');
  32375. event.initEvent(type, bubbles, cancelable);
  32376. return event;
  32377. },
  32378. createMouseEvent: function(doc, type, bubbles, cancelable, detail, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
  32379. var event = doc.createEvent('MouseEvents'),
  32380. view = doc.defaultView || window;
  32381. if (event.initMouseEvent) {
  32382. event.initMouseEvent(type, bubbles, cancelable, view, detail, clientX, clientY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);
  32383. } else {
  32384. // old Safari
  32385. event = doc.createEvent('UIEvents');
  32386. event.initEvent(type, bubbles, cancelable);
  32387. event.view = view;
  32388. event.detail = detail;
  32389. event.screenX = clientX;
  32390. event.screenY = clientY;
  32391. event.clientX = clientX;
  32392. event.clientY = clientY;
  32393. event.ctrlKey = ctrlKey;
  32394. event.altKey = altKey;
  32395. event.metaKey = metaKey;
  32396. event.shiftKey = shiftKey;
  32397. event.button = button;
  32398. event.relatedTarget = relatedTarget;
  32399. }
  32400. return event;
  32401. },
  32402. createUIEvent: function(doc, type, bubbles, cancelable, detail) {
  32403. var event = doc.createEvent('UIEvents'),
  32404. view = doc.defaultView || window;
  32405. event.initUIEvent(type, bubbles, cancelable, view, detail);
  32406. return event;
  32407. },
  32408. fireEvent: function(target, type, event) {
  32409. target.dispatchEvent(event);
  32410. }
  32411. };
  32412. } else if (document.createEventObject) {
  32413. // else if (IE)
  32414. crazyIEButtons = {
  32415. 0: 1,
  32416. 1: 4,
  32417. 2: 2
  32418. };
  32419. API = {
  32420. createHtmlEvent: function(doc, type, bubbles, cancelable) {
  32421. var event = doc.createEventObject();
  32422. event.bubbles = bubbles;
  32423. event.cancelable = cancelable;
  32424. return event;
  32425. },
  32426. createMouseEvent: function(doc, type, bubbles, cancelable, detail, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
  32427. var event = doc.createEventObject();
  32428. event.bubbles = bubbles;
  32429. event.cancelable = cancelable;
  32430. event.detail = detail;
  32431. event.screenX = clientX;
  32432. event.screenY = clientY;
  32433. event.clientX = clientX;
  32434. event.clientY = clientY;
  32435. event.ctrlKey = ctrlKey;
  32436. event.altKey = altKey;
  32437. event.shiftKey = shiftKey;
  32438. event.metaKey = metaKey;
  32439. event.button = crazyIEButtons[button] || button;
  32440. event.relatedTarget = relatedTarget;
  32441. // cannot assign to/fromElement
  32442. return event;
  32443. },
  32444. createUIEvent: function(doc, type, bubbles, cancelable, detail) {
  32445. var event = doc.createEventObject();
  32446. event.bubbles = bubbles;
  32447. event.cancelable = cancelable;
  32448. return event;
  32449. },
  32450. fireEvent: function(target, type, event) {
  32451. target.fireEvent('on' + type, event);
  32452. }
  32453. };
  32454. }
  32455. //----------------
  32456. // HTMLEvents
  32457. Ext.Object.each({
  32458. load: [
  32459. false,
  32460. false
  32461. ],
  32462. unload: [
  32463. false,
  32464. false
  32465. ],
  32466. select: [
  32467. true,
  32468. false
  32469. ],
  32470. change: [
  32471. true,
  32472. false
  32473. ],
  32474. submit: [
  32475. true,
  32476. true
  32477. ],
  32478. reset: [
  32479. true,
  32480. false
  32481. ],
  32482. resize: [
  32483. true,
  32484. false
  32485. ],
  32486. scroll: [
  32487. true,
  32488. false
  32489. ]
  32490. }, function(name, value) {
  32491. var bubbles = value[0],
  32492. cancelable = value[1];
  32493. dispatchers[name] = function(targetEl, srcEvent) {
  32494. var e = API.createHtmlEvent(name, bubbles, cancelable);
  32495. API.fireEvent(targetEl, name, e);
  32496. };
  32497. });
  32498. //----------------
  32499. // MouseEvents
  32500. function createMouseEventDispatcher(type, detail) {
  32501. var cancelable = (type !== 'mousemove');
  32502. return function(targetEl, srcEvent) {
  32503. var xy = srcEvent.getXY(),
  32504. e = API.createMouseEvent(targetEl.ownerDocument, type, true, cancelable, detail, xy[0], xy[1], srcEvent.ctrlKey, srcEvent.altKey, srcEvent.shiftKey, srcEvent.metaKey, srcEvent.button, srcEvent.relatedTarget);
  32505. API.fireEvent(targetEl, type, e);
  32506. };
  32507. }
  32508. Ext.each([
  32509. 'click',
  32510. 'dblclick',
  32511. 'mousedown',
  32512. 'mouseup',
  32513. 'mouseover',
  32514. 'mousemove',
  32515. 'mouseout'
  32516. ], function(eventName) {
  32517. dispatchers[eventName] = createMouseEventDispatcher(eventName, 1);
  32518. });
  32519. //----------------
  32520. // UIEvents
  32521. Ext.Object.each({
  32522. focusin: [
  32523. true,
  32524. false
  32525. ],
  32526. focusout: [
  32527. true,
  32528. false
  32529. ],
  32530. activate: [
  32531. true,
  32532. true
  32533. ],
  32534. focus: [
  32535. false,
  32536. false
  32537. ],
  32538. blur: [
  32539. false,
  32540. false
  32541. ]
  32542. }, function(name, value) {
  32543. var bubbles = value[0],
  32544. cancelable = value[1];
  32545. dispatchers[name] = function(targetEl, srcEvent) {
  32546. var e = API.createUIEvent(targetEl.ownerDocument, name, bubbles, cancelable, 1);
  32547. API.fireEvent(targetEl, name, e);
  32548. };
  32549. });
  32550. //---------
  32551. if (!API) {
  32552. // not even sure what ancient browsers fall into this category...
  32553. dispatchers = {};
  32554. // never mind all those we just built :P
  32555. API = {};
  32556. }
  32557. function cannotInject(target, srcEvent) {}
  32558. // TODO log something
  32559. return function(target) {
  32560. var me = this,
  32561. dispatcher = dispatchers[me.type] || cannotInject,
  32562. t = target ? (target.dom || target) : me.getTarget();
  32563. dispatcher(t, me);
  32564. };
  32565. }()),
  32566. // call to produce method
  32567. preventDefault: function(browserOnly) {
  32568. var me = this,
  32569. event = me.browserEvent,
  32570. parentEvent = me.parentEvent,
  32571. unselectable, target, fn;
  32572. // This check is for IE8/9. The event object may have been
  32573. // invalidated, so we can't delve into the details of it. If so,
  32574. // just fall out gracefully and don't attempt to do anything.
  32575. if (typeof event.type !== 'unknown') {
  32576. // In some cases we want to prevent default on the browser event
  32577. // but keep propagating it through our event system. For example,
  32578. // in Checkbox selection where the cells with checkboxes should
  32579. // prevent focusing on mousedown but still fire the click event.
  32580. if (!browserOnly) {
  32581. me.defaultPrevented = true;
  32582. }
  32583. // if the event was created by prototype-chaining a new object to an existing event
  32584. // instance, we need to make sure the parent event is defaultPrevented as well.
  32585. if (parentEvent) {
  32586. parentEvent.defaultPrevented = true;
  32587. }
  32588. if (event.preventDefault) {
  32589. event.preventDefault();
  32590. } else {
  32591. // The purpose of the code below is for preventDefault to stop focus from
  32592. // occurring like it does in other modern browsers. This only happens in
  32593. // IE8/9 when using attachEvent. The use of unselectable seems the most reliable
  32594. // way to prevent this from happening. We need to use a timeout to restore the
  32595. // unselectable state because if we don't setting it has no effect. It's important
  32596. // to set the atrribute to 'on' as opposed to just setting the property on the DOM element.
  32597. // See the link below for a discussion on the issue:
  32598. // http://bugs.jquery.com/ticket/10345
  32599. if (event.type === 'mousedown') {
  32600. target = event.target;
  32601. unselectable = target.getAttribute('unselectable');
  32602. if (unselectable !== 'on') {
  32603. target.setAttribute('unselectable', 'on');
  32604. fn = function() {
  32605. target.setAttribute('unselectable', unselectable);
  32606. };
  32607. // This function is hard to track, with a potential to be called
  32608. // for any HtmlElement in the document. It may be a Fly, it may
  32609. // not belong to any Component, and it may even be created by
  32610. // 3rd party code that we have no control over and cannot intercept
  32611. // the element being destroyed.
  32612. // On the other hand, the function is pretty simple, cannot lead
  32613. // to memory leaks and is only fired once. So, no harm no foul.
  32614. fn.$skipTimerCheck = true;
  32615. Ext.defer(fn, 1);
  32616. }
  32617. }
  32618. // IE9 and earlier do not support preventDefault
  32619. event.returnValue = false;
  32620. // Some keys events require setting the keyCode to -1 to be prevented
  32621. // all ctrl + X and F1 -> F12
  32622. if (event.ctrlKey || event.keyCode > 111 && event.keyCode < 124) {
  32623. event.keyCode = -1;
  32624. }
  32625. }
  32626. }
  32627. return me;
  32628. },
  32629. deprecated: {
  32630. '5.0': {
  32631. methods: {
  32632. /**
  32633. * @method clone
  32634. * @member Ext.event.Event
  32635. * Clones this event.
  32636. * @return {Ext.event.Event} The cloned copy
  32637. * @deprecated 5.0.0 This method is deprecated.
  32638. */
  32639. clone: function() {
  32640. return new this.self(this.browserEvent, this);
  32641. }
  32642. }
  32643. }
  32644. }
  32645. }, function() {
  32646. var Event = this,
  32647. btnMap;
  32648. if (Ext.isIE9m) {
  32649. btnMap = {
  32650. 0: 0,
  32651. 1: 0,
  32652. 4: 1,
  32653. 2: 2
  32654. };
  32655. Event.override({
  32656. statics: {
  32657. /**
  32658. * @member Ext.event.Event
  32659. * When events are attached using IE's attachEvent API instead of
  32660. * addEventListener accessing any members of an event object asynchronously
  32661. * results in "Member not found" error. To work around this we fabricate
  32662. * our own event object by copying all of its members to a new object.
  32663. * @param {Event} browserEvent The native browser event object
  32664. * @private
  32665. * @static
  32666. */
  32667. enableIEAsync: function(browserEvent) {
  32668. var name,
  32669. fakeEvent = {};
  32670. for (name in browserEvent) {
  32671. fakeEvent[name] = browserEvent[name];
  32672. }
  32673. return fakeEvent;
  32674. }
  32675. },
  32676. constructor: function(event, info, touchesMap, identifiers) {
  32677. var me = this;
  32678. me.callParent([
  32679. event,
  32680. info,
  32681. touchesMap,
  32682. identifiers
  32683. ]);
  32684. me.button = btnMap[event.button];
  32685. if (event.type === 'contextmenu') {
  32686. me.button = 2;
  32687. }
  32688. // IE8/9 reports click as 0, so we can at least attempt to infer here
  32689. // IE8 can throw an error when trying to access properties on a browserEvent
  32690. // object when the event has been buffered or delayed. Cache them here
  32691. // so we can access them later.
  32692. me.toElement = event.toElement;
  32693. me.fromElement = event.fromElement;
  32694. },
  32695. mouseLeaveRe: /(mouseout|mouseleave)/,
  32696. mouseEnterRe: /(mouseover|mouseenter)/,
  32697. /**
  32698. * @method enableIEAsync
  32699. * @member Ext.event.Event
  32700. * @inheritdoc Ext.event.Event#static-method-enableIEAsync
  32701. * @private
  32702. */
  32703. enableIEAsync: function(browserEvent) {
  32704. this.browserEvent = this.self.enableIEAsync(browserEvent);
  32705. },
  32706. getRelatedTarget: function(selector, maxDepth, returnEl) {
  32707. var me = this,
  32708. type, target;
  32709. if (!me.relatedTarget) {
  32710. type = me.type;
  32711. if (me.mouseLeaveRe.test(type)) {
  32712. target = me.toElement;
  32713. } else if (me.mouseEnterRe.test(type)) {
  32714. target = me.fromElement;
  32715. }
  32716. if (target) {
  32717. me.relatedTarget = me.self.resolveTextNode(target);
  32718. }
  32719. }
  32720. return me.callParent([
  32721. selector,
  32722. maxDepth,
  32723. returnEl
  32724. ]);
  32725. }
  32726. });
  32727. // We place these listeners to capture Tab and Shift-Tab key strokes
  32728. // and pass this information in the focus/blur event if it happens
  32729. // between keydown/keyup pair.
  32730. document.attachEvent('onkeydown', Ext.event.Event.globalTabKeyDown);
  32731. document.attachEvent('onkeyup', Ext.event.Event.globalTabKeyUp);
  32732. window.attachEvent('onunload', function() {
  32733. document.detachEvent('onkeydown', Ext.event.Event.globalTabKeyDown);
  32734. document.detachEvent('onkeyup', Ext.event.Event.globalTabKeyUp);
  32735. });
  32736. }
  32737. });
  32738. Ext.define('Ext.overrides.event.publisher.Dom', {
  32739. override: 'Ext.event.publisher.Dom'
  32740. }, function(DomPublisher) {
  32741. var focusEvents = {
  32742. focus: true,
  32743. focusin: true,
  32744. focusout: true,
  32745. blur: true
  32746. };
  32747. if (Ext.isIE10m) {
  32748. DomPublisher.override({
  32749. isEventBlocked: function(e) {
  32750. if (!focusEvents[e.type]) {
  32751. return this.callParent([
  32752. e
  32753. ]);
  32754. }
  32755. var body = document.body,
  32756. ev = e.browserEvent,
  32757. el = Ext.synchronouslyFocusing;
  32758. // This horrid hack is necessary to work around the issue with input elements
  32759. // in IE10m that can fail to focus under certain conditions. See comment in
  32760. // Ext.dom.Element override.
  32761. if (el && ((ev.type === 'focusout' && (ev.srcElement === el || ev.srcElement === window) && ev.toElement === body) || (ev.type === 'focusin' && (ev.srcElement === body || ev.srcElement === window) && ev.fromElement === el && ev.toElement === null))) {
  32762. return true;
  32763. }
  32764. return false;
  32765. }
  32766. });
  32767. }
  32768. if (Ext.isIE9m) {
  32769. var docElement = document.documentElement,
  32770. docBody = document.body,
  32771. prototype = DomPublisher.prototype,
  32772. onDirectEvent, onDirectCaptureEvent;
  32773. prototype.target = document;
  32774. prototype.directBoundListeners = {};
  32775. // This method gets bound to the element scope in addDirectListener so that
  32776. // the currentTarget can be captured using "this".
  32777. onDirectEvent = function(e, publisher, capture) {
  32778. e.target = e.srcElement || window;
  32779. e.currentTarget = this;
  32780. if (capture) {
  32781. // Although directly attached capture listeners are not supported in IE9m
  32782. // we still need to call the handler so at least the event fires.
  32783. publisher.onDirectCaptureEvent(e);
  32784. } else {
  32785. publisher.onDirectEvent(e);
  32786. }
  32787. };
  32788. onDirectCaptureEvent = function(e, publisher) {
  32789. e.target = e.srcElement || window;
  32790. e.currentTarget = this;
  32791. // this, not DomPublisher
  32792. publisher.onDirectCaptureEvent(e);
  32793. };
  32794. DomPublisher.override({
  32795. addDelegatedListener: function(eventName) {
  32796. this.delegatedListeners[eventName] = 1;
  32797. // Use attachEvent for IE9 and below. Even though IE9 strict supports
  32798. // addEventListener, it has issues with using synthetic events.
  32799. this.target.attachEvent('on' + eventName, this.onDelegatedEvent);
  32800. },
  32801. removeDelegatedListener: function(eventName) {
  32802. delete this.delegatedListeners[eventName];
  32803. this.target.detachEvent('on' + eventName, this.onDelegatedEvent);
  32804. },
  32805. addDirectListener: function(eventName, element, capture) {
  32806. var me = this,
  32807. dom = element.dom,
  32808. // binding the listener to the element allows us to capture the
  32809. // "currentTarget" (see onDirectEvent)
  32810. boundFn = Ext.Function.bind(onDirectEvent, dom, [
  32811. me,
  32812. capture
  32813. ], true),
  32814. directBoundListeners = me.directBoundListeners,
  32815. handlers = directBoundListeners[eventName] || (directBoundListeners[eventName] = {});
  32816. handlers[dom.id] = boundFn;
  32817. // may be called with an SVG element here, which
  32818. // does not have the attachEvent method on IE 9 strict
  32819. if (dom.attachEvent) {
  32820. dom.attachEvent('on' + eventName, boundFn);
  32821. } else {
  32822. me.callParent([
  32823. eventName,
  32824. element,
  32825. capture
  32826. ]);
  32827. }
  32828. },
  32829. removeDirectListener: function(eventName, element, capture) {
  32830. var dom = element.dom;
  32831. if (dom.detachEvent) {
  32832. dom.detachEvent('on' + eventName, this.directBoundListeners[eventName][dom.id]);
  32833. } else {
  32834. this.callParent([
  32835. eventName,
  32836. element,
  32837. capture
  32838. ]);
  32839. }
  32840. },
  32841. doDelegatedEvent: function(e) {
  32842. e.target = e.srcElement || window;
  32843. if (e.type === 'focusin') {
  32844. // IE8 sometimes happen to focus <html> element instead of the body
  32845. e.relatedTarget = e.fromElement === docBody || e.fromElement === docElement ? null : e.fromElement;
  32846. } else if (e.type === 'focusout') {
  32847. e.relatedTarget = e.toElement === docBody || e.toElement === docElement ? null : e.toElement;
  32848. }
  32849. return this.callParent([
  32850. e
  32851. ]);
  32852. }
  32853. });
  32854. // can't capture any events without addEventListener. Have to have direct
  32855. // listeners for every event that does not bubble.
  32856. Ext.apply(prototype.directEvents, prototype.captureEvents);
  32857. // These do not bubble in IE9m so have to attach direct listeners as well.
  32858. Ext.apply(prototype.directEvents, {
  32859. change: 1,
  32860. input: 1,
  32861. paste: 1
  32862. });
  32863. prototype.captureEvents = {};
  32864. }
  32865. });
  32866. Ext.define('Ext.overrides.event.publisher.Gesture', {
  32867. override: 'Ext.event.publisher.Gesture'
  32868. }, function() {
  32869. if (Ext.isIE9m) {
  32870. this.override({
  32871. updateTouches: function(e, isEnd) {
  32872. var browserEvent = e.browserEvent,
  32873. xy = e.getXY();
  32874. // I don't always set pageX and pageY on the event object, but when I do
  32875. // it's because the Gesture publisher expects an event object that has them.
  32876. browserEvent.pageX = xy[0];
  32877. browserEvent.pageY = xy[1];
  32878. this.callParent([
  32879. e,
  32880. isEnd
  32881. ]);
  32882. },
  32883. doDelegatedEvent: function(e) {
  32884. // Workaround IE's "Member not found" errors when accessing an event
  32885. // object asynchronously. Needed for all gesture handlers because
  32886. // they use requestAnimationFrame (see enableIEAsync for more details)
  32887. this.callParent([
  32888. Ext.event.Event.enableIEAsync(e)
  32889. ]);
  32890. }
  32891. });
  32892. }
  32893. });
  32894. /**
  32895. * @class Ext.dom.Element
  32896. * @override Ext.dom.Element
  32897. */
  32898. Ext.define('Ext.overrides.dom.Element', (function() {
  32899. var Element,
  32900. // we cannot do this yet "= Ext.dom.Element"
  32901. WIN = window,
  32902. DOC = document,
  32903. HIDDEN = 'hidden',
  32904. ISCLIPPED = 'isClipped',
  32905. OVERFLOW = 'overflow',
  32906. OVERFLOWX = 'overflow-x',
  32907. OVERFLOWY = 'overflow-y',
  32908. ORIGINALCLIP = 'originalClip',
  32909. HEIGHT = 'height',
  32910. WIDTH = 'width',
  32911. VISIBILITY = 'visibility',
  32912. DISPLAY = 'display',
  32913. NONE = 'none',
  32914. OFFSETS = 'offsets',
  32915. CLIP = 'clip',
  32916. ORIGINALDISPLAY = 'originalDisplay',
  32917. VISMODE = 'visibilityMode',
  32918. ISVISIBLE = 'isVisible',
  32919. OFFSETCLASS = Ext.baseCSSPrefix + 'hidden-offsets',
  32920. CLIPCLASS = Ext.baseCSSPrefix + 'hidden-clip',
  32921. boxMarkup = [
  32922. '<div class="{0}-tl" role="presentation">',
  32923. '<div class="{0}-tr" role="presentation">',
  32924. '<div class="{0}-tc" role="presentation"></div>',
  32925. '</div>',
  32926. '</div>',
  32927. '<div class="{0}-ml" role="presentation">',
  32928. '<div class="{0}-mr" role="presentation">',
  32929. '<div class="{0}-mc" role="presentation"></div>',
  32930. '</div>',
  32931. '</div>',
  32932. '<div class="{0}-bl" role="presentation">',
  32933. '<div class="{0}-br" role="presentation">',
  32934. '<div class="{0}-bc" role="presentation"></div>',
  32935. '</div>',
  32936. '</div>'
  32937. ].join(''),
  32938. scriptTagRe = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,
  32939. replaceScriptTagRe = /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,
  32940. srcRe = /\ssrc=([\'\"])(.*?)\1/i,
  32941. nonSpaceRe = /\S/,
  32942. typeRe = /\stype=([\'\"])(.*?)\1/i,
  32943. adjustDirect2DTableRe = /table-row|table-.*-group/,
  32944. msRe = /^-ms-/,
  32945. camelRe = /(-[a-z])/gi,
  32946. camelReplaceFn = function(m, a) {
  32947. return a.charAt(1).toUpperCase();
  32948. },
  32949. XMASKED = Ext.baseCSSPrefix + "masked",
  32950. XMASKEDRELATIVE = Ext.baseCSSPrefix + "masked-relative",
  32951. EXTELMASKMSG = Ext.baseCSSPrefix + "mask-msg",
  32952. bodyRe = /^body/i,
  32953. propertyCache = {},
  32954. getVisMode = function(el) {
  32955. var data = el.getData(),
  32956. visMode = data[VISMODE];
  32957. if (visMode === undefined) {
  32958. data[VISMODE] = visMode = Element.VISIBILITY;
  32959. }
  32960. return visMode;
  32961. },
  32962. emptyRange = DOC.createRange ? DOC.createRange() : null,
  32963. syncContentFly;
  32964. if (Ext.isIE8) {
  32965. var garbageBin = DOC.createElement('div'),
  32966. destroyQueue = [],
  32967. // prevent memory leaks in IE8
  32968. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  32969. // This function is called to fully destroy an element on a timer so that code following the
  32970. // remove call can still access the element.
  32971. clearGarbage,
  32972. clearGarbageFn = function() {
  32973. var len = destroyQueue.length,
  32974. i;
  32975. for (i = 0; i < len; i++) {
  32976. garbageBin.appendChild(destroyQueue[i]);
  32977. }
  32978. garbageBin.innerHTML = '';
  32979. destroyQueue.length = 0;
  32980. };
  32981. clearGarbageFn.$skipTimerCheck = true;
  32982. clearGarbage = Ext.Function.createBuffered(clearGarbageFn, 10);
  32983. }
  32984. return {
  32985. override: 'Ext.dom.Element',
  32986. mixins: [
  32987. 'Ext.util.Animate'
  32988. ],
  32989. uses: [
  32990. 'Ext.dom.GarbageCollector',
  32991. 'Ext.dom.Fly',
  32992. 'Ext.event.publisher.MouseEnterLeave',
  32993. 'Ext.fx.Manager',
  32994. 'Ext.fx.Anim'
  32995. ],
  32996. skipGarbageCollection: false,
  32997. _init: function(E) {
  32998. Element = E;
  32999. // now we can poke this into closure scope
  33000. // We want to expose destroyQueue on the prototype for testing purposes
  33001. if (WIN.__UNIT_TESTING__) {
  33002. E.destroyQueue = destroyQueue;
  33003. }
  33004. },
  33005. statics: {
  33006. normalize: function(prop) {
  33007. if (prop === 'float') {
  33008. prop = Ext.supports.Float ? 'cssFloat' : 'styleFloat';
  33009. }
  33010. // For '-ms-foo' we need msFoo
  33011. return propertyCache[prop] || (propertyCache[prop] = prop.replace(msRe, 'ms-').replace(camelRe, camelReplaceFn));
  33012. }
  33013. },
  33014. /**
  33015. * Convenience method for constructing a KeyMap
  33016. * @param {String/Number/Number[]/Object} key Either a string with the keys to listen for, the numeric key code,
  33017. * array of key codes or an object with the following options:
  33018. * @param {Number/Array} key.key
  33019. * @param {Boolean} key.shift
  33020. * @param {Boolean} key.ctrl
  33021. * @param {Boolean} key.alt
  33022. * @param {Function} fn The function to call
  33023. * @param {Object} [scope] The scope (`this` reference) in which the specified function is executed. Defaults to this Element.
  33024. * @return {Ext.util.KeyMap} The KeyMap created
  33025. */
  33026. addKeyListener: function(key, fn, scope) {
  33027. var config;
  33028. if (typeof key !== 'object' || Ext.isArray(key)) {
  33029. config = {
  33030. target: this,
  33031. key: key,
  33032. fn: fn,
  33033. scope: scope
  33034. };
  33035. } else {
  33036. config = {
  33037. target: this,
  33038. key: key.key,
  33039. shift: key.shift,
  33040. ctrl: key.ctrl,
  33041. alt: key.alt,
  33042. fn: fn,
  33043. scope: scope
  33044. };
  33045. }
  33046. return new Ext.util.KeyMap(config);
  33047. },
  33048. /**
  33049. * Creates a KeyMap for this element
  33050. * @param {Object} config The KeyMap config. See {@link Ext.util.KeyMap} for more details
  33051. * @return {Ext.util.KeyMap} The KeyMap created
  33052. */
  33053. addKeyMap: function(config) {
  33054. return new Ext.util.KeyMap(Ext.apply({
  33055. target: this
  33056. }, config));
  33057. },
  33058. /**
  33059. * @private
  33060. * Returns the fractional portion of this element's measurement in the given dimension.
  33061. * (IE9+ only)
  33062. * @return {Number}
  33063. */
  33064. adjustDirect2DDimension: function(dimension) {
  33065. var me = this,
  33066. dom = me.dom,
  33067. display = me.getStyle('display'),
  33068. inlineDisplay = dom.style.display,
  33069. inlinePosition = dom.style.position,
  33070. originIndex = dimension === WIDTH ? 0 : 1,
  33071. currentStyle = dom.currentStyle,
  33072. floating;
  33073. if (display === 'inline') {
  33074. dom.style.display = 'inline-block';
  33075. }
  33076. dom.style.position = display.match(adjustDirect2DTableRe) ? 'absolute' : 'static';
  33077. // floating will contain digits that appears after the decimal point
  33078. // if height or width are set to auto we fallback to msTransformOrigin calculation
  33079. // Use currentStyle here instead of getStyle. In some difficult to reproduce
  33080. // instances it resets the scrollWidth of the element
  33081. floating = (parseFloat(currentStyle[dimension]) || parseFloat(currentStyle.msTransformOrigin.split(' ')[originIndex]) * 2) % 1;
  33082. dom.style.position = inlinePosition;
  33083. if (display === 'inline') {
  33084. dom.style.display = inlineDisplay;
  33085. }
  33086. return floating;
  33087. },
  33088. /**
  33089. * @private
  33090. */
  33091. afterAnimate: function() {
  33092. var shadow = this.shadow;
  33093. if (shadow && !shadow.disabled && !shadow.animate) {
  33094. shadow.show();
  33095. }
  33096. },
  33097. /**
  33098. * @private
  33099. */
  33100. anchorAnimX: function(anchor) {
  33101. var xName = (anchor === 'l') ? 'right' : 'left';
  33102. this.dom.style[xName] = '0px';
  33103. },
  33104. /**
  33105. * @private
  33106. * process the passed fx configuration.
  33107. */
  33108. anim: function(config) {
  33109. if (!Ext.isObject(config)) {
  33110. return (config) ? {} : false;
  33111. }
  33112. var me = this,
  33113. duration = config.duration || Ext.fx.Anim.prototype.duration,
  33114. easing = config.easing || 'ease',
  33115. animConfig;
  33116. if (config.stopAnimation) {
  33117. me.stopAnimation();
  33118. }
  33119. Ext.applyIf(config, Ext.fx.Manager.getFxDefaults(me.id));
  33120. // Clear any 'paused' defaults.
  33121. Ext.fx.Manager.setFxDefaults(me.id, {
  33122. delay: 0
  33123. });
  33124. animConfig = {
  33125. // Pass the DOM reference. That's tested first so will be converted to an Ext.fx.Target fastest.
  33126. target: me.dom,
  33127. remove: config.remove,
  33128. alternate: config.alternate || false,
  33129. duration: duration,
  33130. easing: easing,
  33131. callback: config.callback,
  33132. listeners: config.listeners,
  33133. iterations: config.iterations || 1,
  33134. scope: config.scope,
  33135. block: config.block,
  33136. concurrent: config.concurrent,
  33137. delay: config.delay || 0,
  33138. paused: true,
  33139. keyframes: config.keyframes,
  33140. from: config.from || {},
  33141. to: Ext.apply({}, config),
  33142. userConfig: config
  33143. };
  33144. Ext.apply(animConfig.to, config.to);
  33145. // Anim API properties - backward compat
  33146. delete animConfig.to.to;
  33147. delete animConfig.to.from;
  33148. delete animConfig.to.remove;
  33149. delete animConfig.to.alternate;
  33150. delete animConfig.to.keyframes;
  33151. delete animConfig.to.iterations;
  33152. delete animConfig.to.listeners;
  33153. delete animConfig.to.target;
  33154. delete animConfig.to.paused;
  33155. delete animConfig.to.callback;
  33156. delete animConfig.to.scope;
  33157. delete animConfig.to.duration;
  33158. delete animConfig.to.easing;
  33159. delete animConfig.to.concurrent;
  33160. delete animConfig.to.block;
  33161. delete animConfig.to.stopAnimation;
  33162. delete animConfig.to.delay;
  33163. return animConfig;
  33164. },
  33165. /**
  33166. * Calls `{@link #addAnimation}` and returns this Element (for call chaining). For
  33167. * details, see `{@link #addAnimation}`.
  33168. *
  33169. * @param {Object} config Configuration for {@link Ext.fx.Anim}.
  33170. * Note that the {@link Ext.fx.Anim#to to} config is required.
  33171. * @return {Ext.dom.Element} this
  33172. */
  33173. animate: function(config) {
  33174. this.addAnimation(config);
  33175. return this;
  33176. },
  33177. /**
  33178. * Starts a custom animation on this Element.
  33179. *
  33180. * The following properties may be specified in `from`, `to`, and `keyframe` objects:
  33181. *
  33182. * - `x` - The page X position in pixels.
  33183. * - `y` - The page Y position in pixels
  33184. * - `left` - The element's CSS `left` value. Units must be supplied.
  33185. * - `top` - The element's CSS `top` value. Units must be supplied.
  33186. * - `width` - The element's CSS `width` value. Units must be supplied.
  33187. * - `height` - The element's CSS `height` value. Units must be supplied.
  33188. * - `scrollLeft` - The element's `scrollLeft` value.
  33189. * - `scrollTop` - The element's `scrollTop` value.
  33190. * - `opacity` - The element's `opacity` value (between `0` and `1`).
  33191. *
  33192. * **Be aware** that animating an Element which is being used by an Ext Component
  33193. * without in some way informing the Component about the changed element state will
  33194. * result in incorrect Component behaviour. This is because the Component will be
  33195. * using the old state of the element. To avoid this problem, it is now possible
  33196. * to directly animate certain properties of Components.
  33197. *
  33198. * @param {Object} config Configuration for {@link Ext.fx.Anim}.
  33199. * Note that the {@link Ext.fx.Anim#to to} config is required.
  33200. * @return {Ext.fx.Anim} The new animation.
  33201. */
  33202. addAnimation: function(config) {
  33203. var me = this,
  33204. animId = me.dom.id || Ext.id(me.dom),
  33205. listeners, anim, end;
  33206. if (!Ext.fx.Manager.hasFxBlock(animId)) {
  33207. // Bit of gymnastics here to ensure our internal listeners get bound first
  33208. if (config.listeners) {
  33209. listeners = config.listeners;
  33210. delete config.listeners;
  33211. }
  33212. if (config.internalListeners) {
  33213. config.listeners = config.internalListeners;
  33214. delete config.internalListeners;
  33215. }
  33216. end = config.autoEnd;
  33217. delete config.autoEnd;
  33218. anim = new Ext.fx.Anim(me.anim(config));
  33219. anim.on({
  33220. afteranimate: 'afterAnimate',
  33221. beforeanimate: 'beforeAnimate',
  33222. scope: me,
  33223. single: true
  33224. });
  33225. if (listeners) {
  33226. anim.on(listeners);
  33227. }
  33228. Ext.fx.Manager.queueFx(anim);
  33229. if (end) {
  33230. anim.jumpToEnd();
  33231. }
  33232. }
  33233. return anim;
  33234. },
  33235. /**
  33236. * @private
  33237. */
  33238. beforeAnimate: function() {
  33239. var shadow = this.shadow;
  33240. if (shadow && !shadow.disabled && !shadow.animate) {
  33241. shadow.hide();
  33242. }
  33243. },
  33244. /**
  33245. * Wraps the specified element with a special 9 element markup/CSS block that renders by default as
  33246. * a gray container with a gradient background, rounded corners and a 4-way shadow.
  33247. *
  33248. * This special markup is used throughout Ext when box wrapping elements ({@link Ext.button.Button},
  33249. * {@link Ext.panel.Panel} when {@link Ext.panel.Panel#frame frame=true}, {@link Ext.window.Window}).
  33250. * The markup is of this form:
  33251. *
  33252. * <div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div>
  33253. * <div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div>
  33254. * <div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>
  33255. *
  33256. * Example usage:
  33257. *
  33258. * // Basic box wrap
  33259. * Ext.get("foo").boxWrap();
  33260. *
  33261. * // You can also add a custom class and use CSS inheritance rules to customize the box look.
  33262. * // 'x-box-blue' is a built-in alternative -- look at the related CSS definitions as an example
  33263. * // for how to create a custom box wrap style.
  33264. * Ext.get("foo").boxWrap().addCls("x-box-blue");
  33265. *
  33266. * @param {String} [cls='x-box'] A base CSS class to apply to the containing wrapper element.
  33267. * Note that there are a number of CSS rules that are dependent on this name to make the overall effect work,
  33268. * so if you supply an alternate base class, make sure you also supply all of the necessary rules.
  33269. * @return {Ext.dom.Element} The outermost wrapping element of the created box structure.
  33270. */
  33271. boxWrap: function(cls) {
  33272. cls = cls || Ext.baseCSSPrefix + 'box';
  33273. var el = Ext.get(this.insertHtml("beforeBegin", "<div class='" + cls + "' role='presentation'>" + Ext.String.format(boxMarkup, cls) + "</div>"));
  33274. el.selectNode('.' + cls + '-mc').appendChild(this.dom);
  33275. return el;
  33276. },
  33277. /**
  33278. * Removes Empty, or whitespace filled text nodes. Combines adjacent text nodes.
  33279. * @param {Boolean} [forceReclean=false] By default the element keeps track if it has been cleaned already
  33280. * so you can call this over and over. However, if you update the element and need to force a re-clean, you
  33281. * can pass true.
  33282. */
  33283. clean: function(forceReclean) {
  33284. var me = this,
  33285. dom = me.dom,
  33286. data = me.getData(),
  33287. n = dom.firstChild,
  33288. ni = -1,
  33289. nx;
  33290. if (data.isCleaned && forceReclean !== true) {
  33291. return me;
  33292. }
  33293. while (n) {
  33294. nx = n.nextSibling;
  33295. if (n.nodeType === 3) {
  33296. // Remove empty/whitespace text nodes
  33297. if (!(nonSpaceRe.test(n.nodeValue))) {
  33298. dom.removeChild(n);
  33299. }
  33300. // Combine adjacent text nodes
  33301. else if (nx && nx.nodeType === 3) {
  33302. n.appendData(Ext.String.trim(nx.data));
  33303. dom.removeChild(nx);
  33304. nx = n.nextSibling;
  33305. n.nodeIndex = ++ni;
  33306. }
  33307. } else {
  33308. // Recursively clean
  33309. Ext.fly(n, '_clean').clean();
  33310. n.nodeIndex = ++ni;
  33311. }
  33312. n = nx;
  33313. }
  33314. data.isCleaned = true;
  33315. return me;
  33316. },
  33317. /**
  33318. * @method
  33319. * Empties this element. Removes all child nodes.
  33320. */
  33321. empty: emptyRange ? function() {
  33322. var dom = this.dom;
  33323. if (dom.firstChild) {
  33324. emptyRange.setStartBefore(dom.firstChild);
  33325. emptyRange.setEndAfter(dom.lastChild);
  33326. emptyRange.deleteContents();
  33327. }
  33328. } : function() {
  33329. var dom = this.dom;
  33330. while (dom.lastChild) {
  33331. dom.removeChild(dom.lastChild);
  33332. }
  33333. },
  33334. clearListeners: function() {
  33335. this.removeAnchor();
  33336. this.callParent();
  33337. },
  33338. /**
  33339. * Clears positioning back to the default when the document was loaded.
  33340. * @param {String} [value=''] The value to use for the left, right, top, bottom.
  33341. * You could use 'auto'.
  33342. * @return {Ext.dom.Element} this
  33343. */
  33344. clearPositioning: function(value) {
  33345. value = value || '';
  33346. return this.setStyle({
  33347. left: value,
  33348. right: value,
  33349. top: value,
  33350. bottom: value,
  33351. 'z-index': '',
  33352. position: 'static'
  33353. });
  33354. },
  33355. /**
  33356. * Creates a proxy element of this element
  33357. * @param {String/Object} config The class name of the proxy element or a DomHelper config object
  33358. * @param {String/HTMLElement} [renderTo] The element or element id to render the proxy to. Defaults to: document.body.
  33359. * @param {Boolean} [matchBox=false] True to align and size the proxy to this element now.
  33360. * @return {Ext.dom.Element} The new proxy element
  33361. */
  33362. createProxy: function(config, renderTo, matchBox) {
  33363. config = (typeof config === 'object') ? config : {
  33364. tag: "div",
  33365. role: 'presentation',
  33366. cls: config
  33367. };
  33368. var me = this,
  33369. proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) : Ext.DomHelper.insertBefore(me.dom, config, true);
  33370. proxy.setVisibilityMode(Element.DISPLAY);
  33371. proxy.hide();
  33372. if (matchBox && me.setBox && me.getBox) {
  33373. // check to make sure Element_position.js is loaded
  33374. proxy.setBox(me.getBox());
  33375. }
  33376. return proxy;
  33377. },
  33378. /**
  33379. * Clears any opacity settings from this element. Required in some cases for IE.
  33380. * @return {Ext.dom.Element} this
  33381. */
  33382. clearOpacity: function() {
  33383. return this.setOpacity('');
  33384. },
  33385. /**
  33386. * Store the current overflow setting and clip overflow on the element - use {@link #unclip} to remove
  33387. * @return {Ext.dom.Element} this
  33388. */
  33389. clip: function() {
  33390. var me = this,
  33391. data = me.getData(),
  33392. style;
  33393. if (!data[ISCLIPPED]) {
  33394. data[ISCLIPPED] = true;
  33395. style = me.getStyle([
  33396. OVERFLOW,
  33397. OVERFLOWX,
  33398. OVERFLOWY
  33399. ]);
  33400. data[ORIGINALCLIP] = {
  33401. o: style[OVERFLOW],
  33402. x: style[OVERFLOWX],
  33403. y: style[OVERFLOWY]
  33404. };
  33405. me.setStyle(OVERFLOW, HIDDEN);
  33406. me.setStyle(OVERFLOWX, HIDDEN);
  33407. me.setStyle(OVERFLOWY, HIDDEN);
  33408. }
  33409. return me;
  33410. },
  33411. destroy: function() {
  33412. var me = this,
  33413. dom = me.dom,
  33414. data = me.peekData(),
  33415. maskEl, maskMsg;
  33416. if (dom) {
  33417. if (me.isAnimate) {
  33418. me.stopAnimation(true);
  33419. }
  33420. me.removeAnchor();
  33421. }
  33422. if (me.deferredFocusTimer) {
  33423. Ext.undefer(me.deferredFocusTimer);
  33424. me.deferredFocusTimer = null;
  33425. }
  33426. me.callParent();
  33427. // prevent memory leaks in IE8
  33428. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  33429. // must not be document, documentElement, body or window object
  33430. // Have to use != instead of !== for IE8 or it will not recognize that the window
  33431. // objects are equal
  33432. if (dom && Ext.isIE8 && (dom.window != dom) && (dom.nodeType !== 9) && (dom.tagName !== 'BODY') && (dom.tagName !== 'HTML')) {
  33433. destroyQueue[destroyQueue.length] = dom;
  33434. // Will perform extra IE8 cleanup in 10 milliseconds
  33435. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  33436. clearGarbage();
  33437. }
  33438. if (data) {
  33439. maskEl = data.maskEl;
  33440. maskMsg = data.maskMsg;
  33441. if (maskEl) {
  33442. maskEl.destroy();
  33443. }
  33444. if (maskMsg) {
  33445. maskMsg.destroy();
  33446. }
  33447. }
  33448. },
  33449. /**
  33450. * Convenience method for setVisibilityMode(Element.DISPLAY).
  33451. * @param {String} [display] What to set display to when visible
  33452. * @return {Ext.dom.Element} this
  33453. */
  33454. enableDisplayMode: function(display) {
  33455. var me = this;
  33456. me.setVisibilityMode(Element.DISPLAY);
  33457. if (display !== undefined) {
  33458. me.getData()[ORIGINALDISPLAY] = display;
  33459. }
  33460. return me;
  33461. },
  33462. /**
  33463. * Fade an element in (from transparent to opaque). The ending opacity can be specified using the `opacity`
  33464. * config option. Usage:
  33465. *
  33466. * // default: fade in from opacity 0 to 100%
  33467. * el.fadeIn();
  33468. *
  33469. * // custom: fade in from opacity 0 to 75% over 2 seconds
  33470. * el.fadeIn({ opacity: .75, duration: 2000});
  33471. *
  33472. * // common config options shown with default values
  33473. * el.fadeIn({
  33474. * opacity: 1, //can be any value between 0 and 1 (e.g. .5)
  33475. * easing: 'easeOut',
  33476. * duration: 500
  33477. * });
  33478. *
  33479. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  33480. * @return {Ext.dom.Element} The Element
  33481. */
  33482. fadeIn: function(options) {
  33483. var me = this,
  33484. dom = me.dom,
  33485. animFly = new Ext.dom.Fly();
  33486. me.animate(Ext.apply({}, options, {
  33487. opacity: 1,
  33488. internalListeners: {
  33489. beforeanimate: function(anim) {
  33490. // Reattach to the DOM in case the caller animated a Fly
  33491. // in which case the dom reference will have changed by now.
  33492. animFly.attach(dom);
  33493. // restore any visibility/display that may have
  33494. // been applied by a fadeout animation
  33495. if (animFly.isStyle('display', 'none')) {
  33496. animFly.setDisplayed('');
  33497. } else {
  33498. animFly.show();
  33499. }
  33500. }
  33501. }
  33502. }));
  33503. return this;
  33504. },
  33505. /**
  33506. * Fade an element out (from opaque to transparent). The ending opacity can be specified using the `opacity`
  33507. * config option. Note that IE may require `useDisplay:true` in order to redisplay correctly.
  33508. * Usage:
  33509. *
  33510. * // default: fade out from the element's current opacity to 0
  33511. * el.fadeOut();
  33512. *
  33513. * // custom: fade out from the element's current opacity to 25% over 2 seconds
  33514. * el.fadeOut({ opacity: .25, duration: 2000});
  33515. *
  33516. * // common config options shown with default values
  33517. * el.fadeOut({
  33518. * opacity: 0, //can be any value between 0 and 1 (e.g. .5)
  33519. * easing: 'easeOut',
  33520. * duration: 500,
  33521. * remove: false,
  33522. * useDisplay: false
  33523. * });
  33524. *
  33525. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  33526. * @return {Ext.dom.Element} The Element
  33527. */
  33528. fadeOut: function(options) {
  33529. var me = this,
  33530. dom = me.dom,
  33531. animFly = new Ext.dom.Fly();
  33532. options = Ext.apply({
  33533. opacity: 0,
  33534. internalListeners: {
  33535. afteranimate: function(anim) {
  33536. if (anim.to.opacity === 0) {
  33537. // Reattach to the DOM in case the caller animated a Fly
  33538. // in which case the dom reference will have changed by now.
  33539. animFly.attach(dom);
  33540. // Reattach to the DOM in case the caller animated a Fly
  33541. // in which case the dom reference will have changed by now.
  33542. animFly.attach(dom);
  33543. if (options.useDisplay) {
  33544. animFly.setDisplayed(false);
  33545. } else {
  33546. animFly.hide();
  33547. }
  33548. }
  33549. }
  33550. }
  33551. }, options);
  33552. me.animate(options);
  33553. return me;
  33554. },
  33555. /**
  33556. * @private
  33557. */
  33558. fixDisplay: function() {
  33559. var me = this;
  33560. if (me.isStyle(DISPLAY, NONE)) {
  33561. me.setStyle(VISIBILITY, HIDDEN);
  33562. me.setStyle(DISPLAY, me._getDisplay());
  33563. // first try reverting to default
  33564. if (me.isStyle(DISPLAY, NONE)) {
  33565. // if that fails, default to block
  33566. me.setStyle(DISPLAY, "block");
  33567. }
  33568. }
  33569. },
  33570. /**
  33571. * Shows a ripple of exploding, attenuating borders to draw attention to an Element. Usage:
  33572. *
  33573. * // default: a single light blue ripple
  33574. * el.frame();
  33575. *
  33576. * // custom: 3 red ripples lasting 3 seconds total
  33577. * el.frame("#ff0000", 3, { duration: 3000 });
  33578. *
  33579. * // common config options shown with default values
  33580. * el.frame("#C3DAF9", 1, {
  33581. * duration: 1000 // duration of each individual ripple.
  33582. * // Note: Easing is not configurable and will be ignored if included
  33583. * });
  33584. *
  33585. * @param {String} [color='#C3DAF9'] The hex color value for the border.
  33586. * @param {Number} [count=1] The number of ripples to display.
  33587. * @param {Object} [obj] Object literal with any of the {@link Ext.fx.Anim} config options
  33588. * @return {Ext.dom.Element} The Element
  33589. */
  33590. frame: function(color, count, obj) {
  33591. var me = this,
  33592. dom = me.dom,
  33593. animFly = new Ext.dom.Fly(),
  33594. beforeAnim;
  33595. color = color || '#C3DAF9';
  33596. count = count || 1;
  33597. obj = obj || {};
  33598. beforeAnim = function() {
  33599. var animScope = this,
  33600. box, proxy, proxyAnim;
  33601. // Reattach to the DOM in case the caller animated a Fly
  33602. // in which case the dom reference will have changed by now.
  33603. animFly.attach(dom);
  33604. animFly.show();
  33605. box = animFly.getBox();
  33606. proxy = Ext.getBody().createChild({
  33607. role: 'presentation',
  33608. id: animFly.dom.id + '-anim-proxy',
  33609. style: {
  33610. position: 'absolute',
  33611. 'pointer-events': 'none',
  33612. 'z-index': 35000,
  33613. border: '0px solid ' + color
  33614. }
  33615. });
  33616. proxyAnim = new Ext.fx.Anim({
  33617. target: proxy,
  33618. duration: obj.duration || 1000,
  33619. iterations: count,
  33620. from: {
  33621. top: box.y,
  33622. left: box.x,
  33623. borderWidth: 0,
  33624. opacity: 1,
  33625. height: box.height,
  33626. width: box.width
  33627. },
  33628. to: {
  33629. top: box.y - 20,
  33630. left: box.x - 20,
  33631. borderWidth: 10,
  33632. opacity: 0,
  33633. height: box.height + 40,
  33634. width: box.width + 40
  33635. }
  33636. });
  33637. proxyAnim.on('afteranimate', function() {
  33638. proxy.destroy();
  33639. // kill the no-op element animation created below
  33640. animScope.end();
  33641. });
  33642. };
  33643. me.animate({
  33644. // See "A Note About Wrapped Animations" at the top of this class:
  33645. duration: (Math.max(obj.duration, 500) * 2) || 2000,
  33646. listeners: {
  33647. beforeanimate: {
  33648. fn: beforeAnim
  33649. }
  33650. },
  33651. callback: obj.callback,
  33652. scope: obj.scope
  33653. });
  33654. return me;
  33655. },
  33656. /**
  33657. * Return the CSS color for the specified CSS attribute. rgb, 3 digit (like `#fff`)
  33658. * and valid values are convert to standard 6 digit hex color.
  33659. * @param {String} attr The css attribute
  33660. * @param {String} defaultValue The default value to use when a valid color isn't found
  33661. * @param {String} [prefix] defaults to #. Use an empty string when working with
  33662. * color anims.
  33663. * @private
  33664. */
  33665. getColor: function(attr, defaultValue, prefix) {
  33666. var v = this.getStyle(attr),
  33667. color = prefix || prefix === '' ? prefix : '#',
  33668. h, len,
  33669. i = 0;
  33670. if (!v || (/transparent|inherit/.test(v))) {
  33671. return defaultValue;
  33672. }
  33673. if (/^r/.test(v)) {
  33674. v = v.slice(4, v.length - 1).split(',');
  33675. len = v.length;
  33676. for (; i < len; i++) {
  33677. h = parseInt(v[i], 10);
  33678. color += (h < 16 ? '0' : '') + h.toString(16);
  33679. }
  33680. } else {
  33681. v = v.replace('#', '');
  33682. color += v.length === 3 ? v.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3') : v;
  33683. }
  33684. return (color.length > 5 ? color.toLowerCase() : defaultValue);
  33685. },
  33686. /**
  33687. * Gets this element's {@link Ext.ElementLoader ElementLoader}
  33688. * @return {Ext.ElementLoader} The loader
  33689. */
  33690. getLoader: function() {
  33691. var me = this,
  33692. data = me.getData(),
  33693. loader = data.loader;
  33694. if (!loader) {
  33695. data.loader = loader = new Ext.ElementLoader({
  33696. target: me
  33697. });
  33698. }
  33699. return loader;
  33700. },
  33701. /**
  33702. * Gets an object with all CSS positioning properties. Useful along with
  33703. * `setPositioning` to get snapshot before performing an update and then restoring
  33704. * the element.
  33705. * @param {Boolean} [autoPx=false] true to return pixel values for "auto" styles.
  33706. * @return {Object}
  33707. */
  33708. getPositioning: function(autoPx) {
  33709. var styles = this.getStyle([
  33710. 'left',
  33711. 'top',
  33712. 'position',
  33713. 'z-index'
  33714. ]),
  33715. dom = this.dom;
  33716. if (autoPx) {
  33717. if (styles.left === 'auto') {
  33718. styles.left = dom.offsetLeft + 'px';
  33719. }
  33720. if (styles.top === 'auto') {
  33721. styles.top = dom.offsetTop + 'px';
  33722. }
  33723. }
  33724. return styles;
  33725. },
  33726. /**
  33727. * Slides the element while fading it out of view. An anchor point can be optionally passed to set the ending point
  33728. * of the effect. Usage:
  33729. *
  33730. * // default: slide the element downward while fading out
  33731. * el.ghost();
  33732. *
  33733. * // custom: slide the element out to the right with a 2-second duration
  33734. * el.ghost('r', { duration: 2000 });
  33735. *
  33736. * // common config options shown with default values
  33737. * el.ghost('b', {
  33738. * easing: 'easeOut',
  33739. * duration: 500
  33740. * });
  33741. *
  33742. * @param {String} [anchor] One of the valid {@link Ext.fx.Anim} anchor positions (defaults to bottom: 'b')
  33743. * @param {Object} [options] Object literal with any of the {@link Ext.fx.Anim} config options
  33744. * @return {Ext.dom.Element} The Element
  33745. */
  33746. ghost: function(anchor, options) {
  33747. var me = this,
  33748. dom = me.dom,
  33749. animFly = new Ext.dom.Fly(),
  33750. beforeAnim;
  33751. anchor = anchor || "b";
  33752. beforeAnim = function() {
  33753. // Reattach to the DOM in case the caller animated a Fly
  33754. // in which case the dom reference will have changed by now.
  33755. animFly.attach(dom);
  33756. var width = animFly.getWidth(),
  33757. height = animFly.getHeight(),
  33758. xy = animFly.getXY(),
  33759. position = animFly.getPositioning(),
  33760. to = {
  33761. opacity: 0
  33762. };
  33763. switch (anchor) {
  33764. case 't':
  33765. to.y = xy[1] - height;
  33766. break;
  33767. case 'l':
  33768. to.x = xy[0] - width;
  33769. break;
  33770. case 'r':
  33771. to.x = xy[0] + width;
  33772. break;
  33773. case 'b':
  33774. to.y = xy[1] + height;
  33775. break;
  33776. case 'tl':
  33777. to.x = xy[0] - width;
  33778. to.y = xy[1] - height;
  33779. break;
  33780. case 'bl':
  33781. to.x = xy[0] - width;
  33782. to.y = xy[1] + height;
  33783. break;
  33784. case 'br':
  33785. to.x = xy[0] + width;
  33786. to.y = xy[1] + height;
  33787. break;
  33788. case 'tr':
  33789. to.x = xy[0] + width;
  33790. to.y = xy[1] - height;
  33791. break;
  33792. }
  33793. this.to = to;
  33794. this.on('afteranimate', function() {
  33795. // Reattach to the DOM in case the caller animated a Fly
  33796. // in which case the dom reference will have changed by now.
  33797. animFly.attach(dom);
  33798. if (animFly) {
  33799. animFly.hide();
  33800. animFly.clearOpacity();
  33801. animFly.setPositioning(position);
  33802. }
  33803. });
  33804. };
  33805. me.animate(Ext.applyIf(options || {}, {
  33806. duration: 500,
  33807. easing: 'ease-out',
  33808. listeners: {
  33809. beforeanimate: beforeAnim
  33810. }
  33811. }));
  33812. return me;
  33813. },
  33814. getTextSelection: function() {
  33815. var ret = this.callParent();
  33816. if (typeof ret[0] !== 'number') {
  33817. var dom = this.dom;
  33818. var doc = dom.ownerDocument;
  33819. var range = doc.selection.createRange();
  33820. var textRange = dom.createTextRange();
  33821. textRange.setEndPoint('EndToStart', range);
  33822. ret[0] = textRange.text.length;
  33823. ret[1] = ret[0] + range.text.length;
  33824. }
  33825. return ret;
  33826. },
  33827. /**
  33828. * Hide this element - Uses display mode to determine whether to use "display",
  33829. * "visibility", "offsets", or "clip". See {@link #setVisible}.
  33830. * @param {Boolean/Object} [animate] true for the default animation or a standard
  33831. * Element animation config object
  33832. * @return {Ext.dom.Element} this
  33833. */
  33834. hide: function(animate) {
  33835. // hideMode override
  33836. if (typeof animate === 'string') {
  33837. this.setVisible(false, animate);
  33838. return this;
  33839. }
  33840. this.setVisible(false, this.anim(animate));
  33841. return this;
  33842. },
  33843. /**
  33844. * Highlights the Element by setting a color (applies to the background-color by default, but can be changed using
  33845. * the "attr" config option) and then fading back to the original color. If no original color is available, you
  33846. * should provide the "endColor" config option which will be cleared after the animation. Usage:
  33847. *
  33848. * // default: highlight background to yellow
  33849. * el.highlight();
  33850. *
  33851. * // custom: highlight foreground text to blue for 2 seconds
  33852. * el.highlight("0000ff", { attr: 'color', duration: 2000 });
  33853. *
  33854. * // common config options shown with default values
  33855. * el.highlight("ffff9c", {
  33856. * attr: "backgroundColor", //can be any valid CSS property (attribute) that supports a color value
  33857. * endColor: (current color) or "ffffff",
  33858. * easing: 'easeIn',
  33859. * duration: 1000
  33860. * });
  33861. *
  33862. * @param {String} color (optional) The highlight color. Should be a 6 char hex color without the leading #
  33863. * (defaults to yellow: 'ffff9c')
  33864. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  33865. * @return {Ext.dom.Element} The Element
  33866. */
  33867. highlight: function(color, options) {
  33868. var me = this,
  33869. dom = me.dom,
  33870. from = {},
  33871. animFly = new Ext.dom.Fly(),
  33872. restore, to, attr, lns, event, fn;
  33873. options = options || {};
  33874. lns = options.listeners || {};
  33875. attr = options.attr || 'backgroundColor';
  33876. from[attr] = color || 'ffff9c';
  33877. if (!options.to) {
  33878. to = {};
  33879. to[attr] = options.endColor || me.getColor(attr, 'ffffff', '');
  33880. } else {
  33881. to = options.to;
  33882. }
  33883. // Don't apply directly on lns, since we reference it in our own callbacks below
  33884. options.listeners = Ext.apply(Ext.apply({}, lns), {
  33885. beforeanimate: function() {
  33886. // Reattach to the DOM in case the caller animated a Fly
  33887. // in which case the dom reference will have changed by now.
  33888. animFly.attach(dom);
  33889. restore = dom.style[attr];
  33890. animFly.clearOpacity();
  33891. animFly.show();
  33892. event = lns.beforeanimate;
  33893. if (event) {
  33894. fn = event.fn || event;
  33895. return fn.apply(event.scope || lns.scope || WIN, arguments);
  33896. }
  33897. },
  33898. afteranimate: function() {
  33899. if (dom) {
  33900. dom.style[attr] = restore;
  33901. }
  33902. event = lns.afteranimate;
  33903. if (event) {
  33904. fn = event.fn || event;
  33905. fn.apply(event.scope || lns.scope || WIN, arguments);
  33906. }
  33907. }
  33908. });
  33909. me.animate(Ext.apply({}, options, {
  33910. duration: 1000,
  33911. easing: 'ease-in',
  33912. from: from,
  33913. to: to
  33914. }));
  33915. return me;
  33916. },
  33917. /**
  33918. * Initializes a {@link Ext.dd.DD} drag drop object for this element.
  33919. * @param {String} group The group the DD object is member of
  33920. * @param {Object} config The DD config object
  33921. * @param {Object} overrides An object containing methods to override/implement on the DD object
  33922. * @return {Ext.dd.DD} The DD object
  33923. */
  33924. initDD: function(group, config, overrides) {
  33925. var dd = new Ext.dd.DD(Ext.id(this.dom), group, config);
  33926. return Ext.apply(dd, overrides);
  33927. },
  33928. /**
  33929. * Initializes a {@link Ext.dd.DDProxy} object for this element.
  33930. * @param {String} group The group the DDProxy object is member of
  33931. * @param {Object} config The DDProxy config object
  33932. * @param {Object} overrides An object containing methods to override/implement on the DDProxy object
  33933. * @return {Ext.dd.DDProxy} The DDProxy object
  33934. */
  33935. initDDProxy: function(group, config, overrides) {
  33936. var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config);
  33937. return Ext.apply(dd, overrides);
  33938. },
  33939. /**
  33940. * Initializes a {@link Ext.dd.DDTarget} object for this element.
  33941. * @param {String} group The group the DDTarget object is member of
  33942. * @param {Object} config The DDTarget config object
  33943. * @param {Object} overrides An object containing methods to override/implement on the DDTarget object
  33944. * @return {Ext.dd.DDTarget} The DDTarget object
  33945. */
  33946. initDDTarget: function(group, config, overrides) {
  33947. var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config);
  33948. return Ext.apply(dd, overrides);
  33949. },
  33950. /**
  33951. * Returns true if this element is masked. Also re-centers any displayed message
  33952. * within the mask.
  33953. *
  33954. * @param {Boolean} [deep] Go up the DOM hierarchy to determine if any parent
  33955. * element is masked.
  33956. *
  33957. * @return {Boolean}
  33958. */
  33959. isMasked: function(deep) {
  33960. var me = this,
  33961. data = me.getData(),
  33962. maskEl = data.maskEl,
  33963. maskMsg = data.maskMsg,
  33964. hasMask = false,
  33965. parent;
  33966. if (maskEl && maskEl.isVisible()) {
  33967. if (maskMsg) {
  33968. maskMsg.center(me);
  33969. }
  33970. hasMask = true;
  33971. } else if (deep) {
  33972. parent = me.findParentNode();
  33973. if (parent) {
  33974. return Ext.fly(parent).isMasked(deep);
  33975. }
  33976. }
  33977. return hasMask;
  33978. },
  33979. /**
  33980. * Direct access to the Ext.ElementLoader {@link Ext.ElementLoader#method-load} method.
  33981. * The method takes the same object parameter as {@link Ext.ElementLoader#method-load}
  33982. * @param {Object} options a options object for Ext.ElementLoader {@link Ext.ElementLoader#method-load}
  33983. * @return {Ext.dom.Element} this
  33984. */
  33985. load: function(options) {
  33986. this.getLoader().load(options);
  33987. return this;
  33988. },
  33989. /**
  33990. * Puts a mask over this element to disable user interaction.
  33991. * This method can only be applied to elements which accept child nodes. Use
  33992. * {@link #unmask} to remove the mask.
  33993. *
  33994. * @param {String} [msg] A message to display in the mask
  33995. * @param {String} [msgCls] A css class to apply to the msg element
  33996. * @param {Number} elHeight (private) Passed by AbstractComponent.mask to avoid the need to interrogate the DOM to get the height
  33997. * @return {Ext.dom.Element} The mask element
  33998. */
  33999. mask: function(msg, msgCls, elHeight) {
  34000. var me = this,
  34001. dom = me.dom,
  34002. data = me.getData(),
  34003. maskEl = data.maskEl,
  34004. maskMsg;
  34005. if (!(bodyRe.test(dom.tagName) && me.getStyle('position') === 'static')) {
  34006. me.addCls(XMASKEDRELATIVE);
  34007. }
  34008. // We always needs to recreate the mask since the DOM element may have been re-created
  34009. if (maskEl) {
  34010. maskEl.destroy();
  34011. }
  34012. maskEl = Ext.DomHelper.append(dom, {
  34013. role: 'presentation',
  34014. cls: Ext.baseCSSPrefix + "mask " + Ext.baseCSSPrefix + "border-box",
  34015. children: {
  34016. role: 'presentation',
  34017. cls: msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG,
  34018. cn: {
  34019. tag: 'div',
  34020. role: 'presentation',
  34021. cls: Ext.baseCSSPrefix + 'mask-msg-inner',
  34022. cn: {
  34023. tag: 'div',
  34024. role: 'presentation',
  34025. cls: Ext.baseCSSPrefix + 'mask-msg-text',
  34026. html: msg || ''
  34027. }
  34028. }
  34029. }
  34030. }, true);
  34031. maskMsg = Ext.fly(maskEl.dom.firstChild);
  34032. data.maskEl = maskEl;
  34033. me.addCls(XMASKED);
  34034. maskEl.setDisplayed(true);
  34035. if (typeof msg === 'string') {
  34036. maskMsg.setDisplayed(true);
  34037. maskMsg.center(me);
  34038. } else {
  34039. maskMsg.setDisplayed(false);
  34040. }
  34041. if (dom === DOC.body) {
  34042. maskEl.addCls(Ext.baseCSSPrefix + 'mask-fixed');
  34043. }
  34044. // When masking the body, don't touch its tabbable state
  34045. me.saveTabbableState({
  34046. skipSelf: dom === DOC.body
  34047. });
  34048. // ie will not expand full height automatically
  34049. if (Ext.isIE9m && dom !== DOC.body && me.isStyle('height', 'auto')) {
  34050. maskEl.setSize(undefined, elHeight || me.getHeight());
  34051. }
  34052. return maskEl;
  34053. },
  34054. /**
  34055. * Fades the element out while slowly expanding it in all directions. When the effect is completed, the element will
  34056. * be hidden (visibility = 'hidden') but block elements will still take up space in the document. Usage:
  34057. *
  34058. * // default
  34059. * el.puff();
  34060. *
  34061. * // common config options shown with default values
  34062. * el.puff({
  34063. * easing: 'easeOut',
  34064. * duration: 500,
  34065. * useDisplay: false
  34066. * });
  34067. *
  34068. * @param {Object} obj (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  34069. * @return {Ext.dom.Element} The Element
  34070. */
  34071. puff: function(obj) {
  34072. var me = this,
  34073. dom = me.dom,
  34074. animFly = new Ext.dom.Fly(),
  34075. beforeAnim,
  34076. box = me.getBox(),
  34077. originalStyles = me.getStyle([
  34078. 'width',
  34079. 'height',
  34080. 'left',
  34081. 'right',
  34082. 'top',
  34083. 'bottom',
  34084. 'position',
  34085. 'z-index',
  34086. 'font-size',
  34087. 'opacity'
  34088. ], true);
  34089. obj = Ext.applyIf(obj || {}, {
  34090. easing: 'ease-out',
  34091. duration: 500,
  34092. useDisplay: false
  34093. });
  34094. beforeAnim = function() {
  34095. // Reattach to the DOM in case the caller animated a Fly
  34096. // in which case the dom reference will have changed by now.
  34097. animFly.attach(dom);
  34098. animFly.clearOpacity();
  34099. animFly.show();
  34100. this.to = {
  34101. width: box.width * 2,
  34102. height: box.height * 2,
  34103. x: box.x - (box.width / 2),
  34104. y: box.y - (box.height / 2),
  34105. opacity: 0,
  34106. fontSize: '200%'
  34107. };
  34108. this.on('afteranimate', function() {
  34109. // Reattach to the DOM in case the caller animated a Fly
  34110. // in which case the dom reference will have changed by now.
  34111. animFly.attach(dom);
  34112. if (obj.useDisplay) {
  34113. animFly.setDisplayed(false);
  34114. } else {
  34115. animFly.hide();
  34116. }
  34117. animFly.setStyle(originalStyles);
  34118. Ext.callback(obj.callback, obj.scope);
  34119. });
  34120. };
  34121. me.animate({
  34122. duration: obj.duration,
  34123. easing: obj.easing,
  34124. listeners: {
  34125. beforeanimate: {
  34126. fn: beforeAnim
  34127. }
  34128. }
  34129. });
  34130. return me;
  34131. },
  34132. // private
  34133. // used to ensure the mouseup event is captured if it occurs outside of the
  34134. // window in IE9m. The only reason this method exists, (vs just calling
  34135. // el.dom.setCapture() directly) is so that we can override it to emptyFn
  34136. // during testing because setCapture() can wreak havoc on emulated mouse events
  34137. // http://msdn.microsoft.com/en-us/library/windows/desktop/ms646262(v=vs.85).aspx
  34138. setCapture: function() {
  34139. var dom = this.dom;
  34140. if (Ext.isIE9m && dom.setCapture) {
  34141. dom.setCapture();
  34142. }
  34143. },
  34144. /**
  34145. * Set the height of this Element.
  34146. *
  34147. * // change the height to 200px and animate with default configuration
  34148. * Ext.fly('elementId').setHeight(200, true);
  34149. *
  34150. * // change the height to 150px and animate with a custom configuration
  34151. * Ext.fly('elId').setHeight(150, {
  34152. * duration : 500, // animation will have a duration of .5 seconds
  34153. * // will change the content to "finished"
  34154. * callback: function(){ this.setHtml("finished"); }
  34155. * });
  34156. *
  34157. * @param {Number/String} height The new height. This may be one of:
  34158. *
  34159. * - A Number specifying the new height in pixels.
  34160. * - A String used to set the CSS height style. Animation may **not** be used.
  34161. *
  34162. * @param {Boolean/Object} [animate] a standard Element animation config object or `true` for
  34163. * the default animation (`{duration: 350, easing: 'ease-in'}`)
  34164. * @return {Ext.dom.Element} this
  34165. */
  34166. setHeight: function(height, animate) {
  34167. var me = this;
  34168. if (!animate || !me.anim) {
  34169. me.callParent(arguments);
  34170. } else {
  34171. if (!Ext.isObject(animate)) {
  34172. animate = {};
  34173. }
  34174. me.animate(Ext.applyIf({
  34175. to: {
  34176. height: height
  34177. }
  34178. }, animate));
  34179. }
  34180. return me;
  34181. },
  34182. /**
  34183. * Removes "vertical" state from this element (reverses everything done
  34184. * by {@link #setVertical}).
  34185. * @private
  34186. */
  34187. setHorizontal: function() {
  34188. var me = this,
  34189. cls = me.verticalCls;
  34190. delete me.vertical;
  34191. if (cls) {
  34192. delete me.verticalCls;
  34193. me.removeCls(cls);
  34194. }
  34195. // delete the inverted methods and revert to inheriting from the prototype
  34196. delete me.setWidth;
  34197. delete me.setHeight;
  34198. if (!Ext.isIE8) {
  34199. delete me.getWidth;
  34200. delete me.getHeight;
  34201. }
  34202. // revert to inheriting styleHooks from the prototype
  34203. delete me.styleHooks;
  34204. },
  34205. /**
  34206. * Updates the *text* value of this element.
  34207. * Replaces the content of this element with a *single text node* containing the passed text.
  34208. * @param {String} text The text to display in this Element.
  34209. */
  34210. updateText: function(text) {
  34211. var me = this,
  34212. dom, textNode;
  34213. if (dom) {
  34214. textNode = dom.firstChild;
  34215. if (!textNode || (textNode.nodeType !== 3 || textNode.nextSibling)) {
  34216. textNode = DOC.createTextNode();
  34217. me.empty();
  34218. dom.appendChild(textNode);
  34219. }
  34220. if (text) {
  34221. textNode.data = text;
  34222. }
  34223. }
  34224. },
  34225. /**
  34226. * Updates the innerHTML of this element, optionally searching for and processing scripts.
  34227. * @param {String} html The new HTML
  34228. * @param {Boolean} [loadScripts] Pass `true` to look for and process scripts.
  34229. * @param {Function} [callback] For async script loading you can be notified when the update completes.
  34230. * @param {Object} [scope=`this`] The scope (`this` reference) in which to execute the callback.
  34231. *
  34232. * Also used as the scope for any *inline* script source if the `loadScripts` parameter is `true`.
  34233. * Scripts with a `src` attribute cannot be executed in this scope.
  34234. *
  34235. * Defaults to this Element.
  34236. * @return {Ext.dom.Element} this
  34237. */
  34238. setHtml: function(html, loadScripts, callback, scope) {
  34239. var me = this,
  34240. id, dom, interval;
  34241. if (!me.dom) {
  34242. return me;
  34243. }
  34244. html = html || '';
  34245. dom = me.dom;
  34246. if (loadScripts !== true) {
  34247. dom.innerHTML = html;
  34248. Ext.callback(callback, me);
  34249. return me;
  34250. }
  34251. id = Ext.id();
  34252. html += '<span id="' + id + '" role="presentation"></span>';
  34253. interval = Ext.interval(function() {
  34254. var hd, match, attrs, srcMatch, typeMatch, el, s;
  34255. if (!(el = DOC.getElementById(id))) {
  34256. return false;
  34257. }
  34258. Ext.uninterval(interval);
  34259. Ext.removeNode(el);
  34260. hd = Ext.getHead().dom;
  34261. while ((match = scriptTagRe.exec(html))) {
  34262. attrs = match[1];
  34263. srcMatch = attrs ? attrs.match(srcRe) : false;
  34264. if (srcMatch && srcMatch[2]) {
  34265. s = DOC.createElement("script");
  34266. s.src = srcMatch[2];
  34267. typeMatch = attrs.match(typeRe);
  34268. if (typeMatch && typeMatch[2]) {
  34269. s.type = typeMatch[2];
  34270. }
  34271. hd.appendChild(s);
  34272. } else if (match[2] && match[2].length > 0) {
  34273. if (scope) {
  34274. Ext.functionFactory(match[2]).call(scope);
  34275. } else {
  34276. Ext.globalEval(match[2]);
  34277. }
  34278. }
  34279. }
  34280. Ext.callback(callback, scope || me);
  34281. }, 20);
  34282. dom.innerHTML = html.replace(replaceScriptTagRe, '');
  34283. return me;
  34284. },
  34285. /**
  34286. * Set the opacity of the element
  34287. * @param {Number} opacity The new opacity. 0 = transparent, .5 = 50% visible, 1 = fully visible, etc
  34288. * @param {Boolean/Object} [animate] a standard Element animation config object or `true` for
  34289. * the default animation (`{duration: 350, easing: 'ease-in'}`)
  34290. * @return {Ext.dom.Element} this
  34291. */
  34292. setOpacity: function(opacity, animate) {
  34293. var me = this;
  34294. if (!me.dom) {
  34295. return me;
  34296. }
  34297. if (!animate || !me.anim) {
  34298. me.setStyle('opacity', opacity);
  34299. } else {
  34300. if (typeof animate != 'object') {
  34301. animate = {
  34302. duration: 350,
  34303. easing: 'ease-in'
  34304. };
  34305. }
  34306. me.animate(Ext.applyIf({
  34307. to: {
  34308. opacity: opacity
  34309. }
  34310. }, animate));
  34311. }
  34312. return me;
  34313. },
  34314. /**
  34315. * Set positioning with an object returned by `getPositioning`.
  34316. * @param {Object} pc
  34317. * @return {Ext.dom.Element} this
  34318. */
  34319. setPositioning: function(pc) {
  34320. return this.setStyle(pc);
  34321. },
  34322. /**
  34323. * Changes this Element's state to "vertical" (rotated 90 or 270 degrees).
  34324. * This involves inverting the getters and setters for height and width,
  34325. * and applying hooks for rotating getters and setters for border/margin/padding.
  34326. * (getWidth becomes getHeight and vice versa), setStyle and getStyle will
  34327. * also return the inverse when height or width are being operated on.
  34328. *
  34329. * @param {Number} angle the angle of rotation - either 90 or 270
  34330. * @param {String} cls an optional css class that contains the required
  34331. * styles for switching the element to vertical orientation. Omit this if
  34332. * the element already contains vertical styling. If cls is provided,
  34333. * it will be removed from the element when {@link #setHorizontal} is called.
  34334. * @private
  34335. */
  34336. setVertical: function(angle, cls) {
  34337. var me = this,
  34338. proto = Element.prototype;
  34339. me.vertical = true;
  34340. if (cls) {
  34341. me.addCls(me.verticalCls = cls);
  34342. }
  34343. me.setWidth = proto.setHeight;
  34344. me.setHeight = proto.setWidth;
  34345. if (!Ext.isIE8) {
  34346. // In browsers that use CSS3 transforms we must invert getHeight and
  34347. // get Width. In IE8 no adjustment is needed because we use
  34348. // a BasicImage filter to rotate the element and the element's
  34349. // offsetWidth and offsetHeight are automatically inverted.
  34350. me.getWidth = proto.getHeight;
  34351. me.getHeight = proto.getWidth;
  34352. }
  34353. // Switch to using the appropriate vertical style hooks
  34354. me.styleHooks = (angle === 270) ? proto.verticalStyleHooks270 : proto.verticalStyleHooks90;
  34355. },
  34356. /**
  34357. * Set the size of this Element. If animation is true, both width and height will be animated concurrently.
  34358. * @param {Number/String} width The new width. This may be one of:
  34359. *
  34360. * - A Number specifying the new width in pixels.
  34361. * - A String used to set the CSS width style. Animation may **not** be used.
  34362. * - A size object in the format `{width: widthValue, height: heightValue}`.
  34363. *
  34364. * @param {Number/String} height The new height. This may be one of:
  34365. *
  34366. * - A Number specifying the new height in pixels.
  34367. * - A String used to set the CSS height style. Animation may **not** be used.
  34368. *
  34369. * @param {Boolean/Object} [animate] a standard Element animation config object or `true` for
  34370. * the default animation (`{duration: 350, easing: 'ease-in'}`)
  34371. *
  34372. * @return {Ext.dom.Element} this
  34373. */
  34374. setSize: function(width, height, animate) {
  34375. var me = this;
  34376. if (Ext.isObject(width)) {
  34377. // in case of object from getSize()
  34378. animate = height;
  34379. height = width.height;
  34380. width = width.width;
  34381. }
  34382. if (!animate || !me.anim) {
  34383. me.dom.style.width = Element.addUnits(width);
  34384. me.dom.style.height = Element.addUnits(height);
  34385. if (me.shadow || me.shim) {
  34386. me.syncUnderlays();
  34387. }
  34388. } else {
  34389. if (animate === true) {
  34390. animate = {};
  34391. }
  34392. me.animate(Ext.applyIf({
  34393. to: {
  34394. width: width,
  34395. height: height
  34396. }
  34397. }, animate));
  34398. }
  34399. return me;
  34400. },
  34401. /**
  34402. * Sets the visibility of the element (see details). If the visibilityMode is set
  34403. * to Element.DISPLAY, it will use the display property to hide the element,
  34404. * otherwise it uses visibility. The default is to hide and show using the
  34405. * visibility property.
  34406. *
  34407. * @param {Boolean} visible Whether the element is visible
  34408. * @param {Boolean/Object} [animate] True for the default animation,
  34409. * or a standard Element animation config object.
  34410. *
  34411. * @return {Ext.dom.Element} this
  34412. */
  34413. setVisible: function(visible, animate) {
  34414. var me = this,
  34415. dom = me.dom,
  34416. animFly,
  34417. visMode = getVisMode(me);
  34418. // hideMode string override
  34419. if (typeof animate === 'string') {
  34420. switch (animate) {
  34421. case DISPLAY:
  34422. visMode = Element.DISPLAY;
  34423. break;
  34424. case VISIBILITY:
  34425. visMode = Element.VISIBILITY;
  34426. break;
  34427. case OFFSETS:
  34428. visMode = Element.OFFSETS;
  34429. break;
  34430. case CLIP:
  34431. visMode = Element.CLIP;
  34432. break;
  34433. }
  34434. me.setVisibilityMode(visMode);
  34435. animate = false;
  34436. }
  34437. if (!animate || !me.anim) {
  34438. if (visMode === Element.DISPLAY) {
  34439. return me.setDisplayed(visible);
  34440. } else if (visMode === Element.OFFSETS) {
  34441. me[visible ? 'removeCls' : 'addCls'](OFFSETCLASS);
  34442. } else if (visMode === Element.CLIP) {
  34443. me[visible ? 'removeCls' : 'addCls'](CLIPCLASS);
  34444. } else if (visMode === Element.VISIBILITY) {
  34445. me.fixDisplay();
  34446. // Show by clearing visibility style. Explicitly setting to "visible" overrides parent visibility setting
  34447. dom.style.visibility = visible ? '' : HIDDEN;
  34448. }
  34449. } else {
  34450. // closure for composites
  34451. if (visible) {
  34452. me.setOpacity(0.01);
  34453. me.setVisible(true);
  34454. }
  34455. if (!Ext.isObject(animate)) {
  34456. animate = {
  34457. duration: 350,
  34458. easing: 'ease-in'
  34459. };
  34460. }
  34461. animFly = new Ext.dom.Fly() , me.animate(Ext.applyIf({
  34462. callback: function() {
  34463. if (!visible) {
  34464. // Grab the dom again, since the reference may have changed if we use fly
  34465. animFly.attach(dom).setVisible(false).setOpacity(1);
  34466. }
  34467. },
  34468. to: {
  34469. opacity: (visible) ? 1 : 0
  34470. }
  34471. }, animate));
  34472. }
  34473. me.getData()[ISVISIBLE] = visible;
  34474. if (me.shadow || me.shim) {
  34475. me.setUnderlaysVisible(visible);
  34476. }
  34477. return me;
  34478. },
  34479. /**
  34480. * Set the width of this Element.
  34481. *
  34482. * // change the width to 200px and animate with default configuration
  34483. * Ext.fly('elementId').setWidth(200, true);
  34484. *
  34485. * // change the width to 150px and animate with a custom configuration
  34486. * Ext.fly('elId').setWidth(150, {
  34487. * duration : 500, // animation will have a duration of .5 seconds
  34488. * // will change the content to "finished"
  34489. * callback: function(){ this.setHtml("finished"); }
  34490. * });
  34491. *
  34492. * @param {Number/String} width The new width. This may be one of:
  34493. *
  34494. * - A Number specifying the new width in pixels.
  34495. * - A String used to set the CSS width style. Animation may **not** be used.
  34496. *
  34497. * @param {Boolean/Object} [animate] a standard Element animation config object or `true` for
  34498. * the default animation (`{duration: 350, easing: 'ease-in'}`)
  34499. * @return {Ext.dom.Element} this
  34500. */
  34501. setWidth: function(width, animate) {
  34502. var me = this;
  34503. if (!animate || !me.anim) {
  34504. me.callParent(arguments);
  34505. } else {
  34506. if (!Ext.isObject(animate)) {
  34507. animate = {};
  34508. }
  34509. me.animate(Ext.applyIf({
  34510. to: {
  34511. width: width
  34512. }
  34513. }, animate));
  34514. }
  34515. return me;
  34516. },
  34517. setX: function(x, animate) {
  34518. return this.setXY([
  34519. x,
  34520. this.getY()
  34521. ], animate);
  34522. },
  34523. setXY: function(xy, animate) {
  34524. var me = this;
  34525. if (!animate || !me.anim) {
  34526. me.callParent([
  34527. xy
  34528. ]);
  34529. } else {
  34530. if (!Ext.isObject(animate)) {
  34531. animate = {};
  34532. }
  34533. me.animate(Ext.applyIf({
  34534. to: {
  34535. x: xy[0],
  34536. y: xy[1]
  34537. }
  34538. }, animate));
  34539. }
  34540. return this;
  34541. },
  34542. setY: function(y, animate) {
  34543. return this.setXY([
  34544. this.getX(),
  34545. y
  34546. ], animate);
  34547. },
  34548. /**
  34549. * Show this element - Uses display mode to determine whether to use "display",
  34550. * "visibility", "offsets", or "clip". See {@link #setVisible}.
  34551. *
  34552. * @param {Boolean/Object} [animate] true for the default animation or a standard
  34553. * Element animation config object.
  34554. *
  34555. * @return {Ext.dom.Element} this
  34556. */
  34557. show: function(animate) {
  34558. // hideMode override
  34559. if (typeof animate === 'string') {
  34560. this.setVisible(true, animate);
  34561. return this;
  34562. }
  34563. this.setVisible(true, this.anim(animate));
  34564. return this;
  34565. },
  34566. /**
  34567. * Slides the element into view. An anchor point can be optionally passed to set the point of origin for the slide
  34568. * effect. This function automatically handles wrapping the element with a fixed-size container if needed. See the
  34569. * {@link Ext.fx.Anim} class overview for valid anchor point options. Usage:
  34570. *
  34571. * // default: slide the element in from the top
  34572. * el.slideIn();
  34573. *
  34574. * // custom: slide the element in from the right with a 2-second duration
  34575. * el.slideIn('r', { duration: 2000 });
  34576. *
  34577. * // common config options shown with default values
  34578. * el.slideIn('t', {
  34579. * easing: 'easeOut',
  34580. * duration: 500
  34581. * });
  34582. *
  34583. * @param {String} [anchor] One of the valid {@link Ext.fx.Anim} anchor positions (defaults to top: 't')
  34584. * @param {Object} [options] Object literal with any of the {@link Ext.fx.Anim} config options
  34585. * @param {Boolean} options.preserveScroll Set to true if preservation of any descendant elements'
  34586. * `scrollTop` values is required. By default the DOM wrapping operation performed by `slideIn` and
  34587. * `slideOut` causes the browser to lose all scroll positions.
  34588. * @param {Boolean} slideOut
  34589. * @return {Ext.dom.Element} The Element
  34590. */
  34591. slideIn: function(anchor, options, slideOut) {
  34592. var me = this,
  34593. dom = me.dom,
  34594. elStyle = dom.style,
  34595. animFly = new Ext.dom.Fly(),
  34596. beforeAnim, wrapAnim, restoreScroll, wrapDomParentNode;
  34597. anchor = anchor || "t";
  34598. options = options || {};
  34599. beforeAnim = function() {
  34600. // Reattach to the DOM in case the caller animated a Fly
  34601. // in which case the dom reference will have changed by now.
  34602. animFly.attach(dom);
  34603. var animScope = this,
  34604. listeners = options.listeners,
  34605. box, originalStyles, anim, wrap;
  34606. if (!slideOut) {
  34607. animFly.fixDisplay();
  34608. }
  34609. box = animFly.getBox();
  34610. if ((anchor === 't' || anchor === 'b') && box.height === 0) {
  34611. box.height = dom.scrollHeight;
  34612. } else if ((anchor === 'l' || anchor === 'r') && box.width === 0) {
  34613. box.width = dom.scrollWidth;
  34614. }
  34615. originalStyles = animFly.getStyle([
  34616. 'width',
  34617. 'height',
  34618. 'left',
  34619. 'right',
  34620. 'top',
  34621. 'bottom',
  34622. 'position',
  34623. 'z-index'
  34624. ], true);
  34625. animFly.setSize(box.width, box.height);
  34626. // Cache all descendants' scrollTop & scrollLeft values if configured to preserve scroll.
  34627. if (options.preserveScroll) {
  34628. restoreScroll = animFly.cacheScrollValues();
  34629. }
  34630. wrap = animFly.wrap({
  34631. role: 'presentation',
  34632. id: Ext.id() + '-anim-wrap-for-' + dom.id,
  34633. style: {
  34634. visibility: slideOut ? 'visible' : 'hidden'
  34635. }
  34636. });
  34637. wrapDomParentNode = wrap.dom.parentNode;
  34638. wrap.setPositioning(animFly.getPositioning());
  34639. if (wrap.isStyle('position', 'static')) {
  34640. wrap.position('relative');
  34641. }
  34642. animFly.clearPositioning('auto');
  34643. wrap.clip();
  34644. // The wrap will have reset all descendant scrollTops. Restore them if we cached them.
  34645. if (restoreScroll) {
  34646. restoreScroll();
  34647. }
  34648. // This element is temporarily positioned absolute within its wrapper.
  34649. // Restore to its default, CSS-inherited visibility setting.
  34650. // We cannot explicitly poke visibility:visible into its style because that overrides the visibility of the wrap.
  34651. animFly.setStyle({
  34652. visibility: '',
  34653. position: 'absolute'
  34654. });
  34655. if (slideOut) {
  34656. wrap.setSize(box.width, box.height);
  34657. }
  34658. switch (anchor) {
  34659. case 't':
  34660. anim = {
  34661. from: {
  34662. width: box.width + 'px',
  34663. height: '0px'
  34664. },
  34665. to: {
  34666. width: box.width + 'px',
  34667. height: box.height + 'px'
  34668. }
  34669. };
  34670. elStyle.bottom = '0px';
  34671. break;
  34672. case 'l':
  34673. anim = {
  34674. from: {
  34675. width: '0px',
  34676. height: box.height + 'px'
  34677. },
  34678. to: {
  34679. width: box.width + 'px',
  34680. height: box.height + 'px'
  34681. }
  34682. };
  34683. me.anchorAnimX(anchor);
  34684. break;
  34685. case 'r':
  34686. anim = {
  34687. from: {
  34688. x: box.x + box.width,
  34689. width: '0px',
  34690. height: box.height + 'px'
  34691. },
  34692. to: {
  34693. x: box.x,
  34694. width: box.width + 'px',
  34695. height: box.height + 'px'
  34696. }
  34697. };
  34698. me.anchorAnimX(anchor);
  34699. break;
  34700. case 'b':
  34701. anim = {
  34702. from: {
  34703. y: box.y + box.height,
  34704. width: box.width + 'px',
  34705. height: '0px'
  34706. },
  34707. to: {
  34708. y: box.y,
  34709. width: box.width + 'px',
  34710. height: box.height + 'px'
  34711. }
  34712. };
  34713. break;
  34714. case 'tl':
  34715. anim = {
  34716. from: {
  34717. x: box.x,
  34718. y: box.y,
  34719. width: '0px',
  34720. height: '0px'
  34721. },
  34722. to: {
  34723. width: box.width + 'px',
  34724. height: box.height + 'px'
  34725. }
  34726. };
  34727. elStyle.bottom = '0px';
  34728. me.anchorAnimX('l');
  34729. break;
  34730. case 'bl':
  34731. anim = {
  34732. from: {
  34733. y: box.y + box.height,
  34734. width: '0px',
  34735. height: '0px'
  34736. },
  34737. to: {
  34738. y: box.y,
  34739. width: box.width + 'px',
  34740. height: box.height + 'px'
  34741. }
  34742. };
  34743. me.anchorAnimX('l');
  34744. break;
  34745. case 'br':
  34746. anim = {
  34747. from: {
  34748. x: box.x + box.width,
  34749. y: box.y + box.height,
  34750. width: '0px',
  34751. height: '0px'
  34752. },
  34753. to: {
  34754. x: box.x,
  34755. y: box.y,
  34756. width: box.width + 'px',
  34757. height: box.height + 'px'
  34758. }
  34759. };
  34760. me.anchorAnimX('r');
  34761. break;
  34762. case 'tr':
  34763. anim = {
  34764. from: {
  34765. x: box.x + box.width,
  34766. width: '0px',
  34767. height: '0px'
  34768. },
  34769. to: {
  34770. x: box.x,
  34771. width: box.width + 'px',
  34772. height: box.height + 'px'
  34773. }
  34774. };
  34775. elStyle.bottom = '0px';
  34776. me.anchorAnimX('r');
  34777. break;
  34778. }
  34779. wrap.show();
  34780. wrapAnim = Ext.apply({}, options);
  34781. delete wrapAnim.listeners;
  34782. wrapAnim = new Ext.fx.Anim(Ext.applyIf(wrapAnim, {
  34783. target: wrap,
  34784. duration: 500,
  34785. easing: 'ease-out',
  34786. from: slideOut ? anim.to : anim.from,
  34787. to: slideOut ? anim.from : anim.to
  34788. }));
  34789. // In the absence of a callback, this listener MUST be added first
  34790. wrapAnim.on('afteranimate', function() {
  34791. // Reattach to the DOM in case the caller animated a Fly
  34792. // in which case the dom reference will have changed by now.
  34793. animFly.attach(dom);
  34794. animFly.setStyle(originalStyles);
  34795. if (slideOut) {
  34796. if (options.useDisplay) {
  34797. animFly.setDisplayed(false);
  34798. } else {
  34799. animFly.hide();
  34800. }
  34801. }
  34802. if (wrap.dom) {
  34803. if (wrap.dom.parentNode) {
  34804. wrap.dom.parentNode.insertBefore(dom, wrap.dom);
  34805. } else {
  34806. wrapDomParentNode.appendChild(dom);
  34807. }
  34808. wrap.destroy();
  34809. }
  34810. // The unwrap will have reset all descendant scrollTops. Restore them if we cached them.
  34811. if (restoreScroll) {
  34812. restoreScroll();
  34813. }
  34814. // kill the no-op element animation created below
  34815. animScope.end();
  34816. });
  34817. // Add configured listeners after
  34818. if (listeners) {
  34819. wrapAnim.on(listeners);
  34820. }
  34821. };
  34822. me.animate({
  34823. // See "A Note About Wrapped Animations" at the top of this class:
  34824. duration: options.duration ? Math.max(options.duration, 500) * 2 : 1000,
  34825. listeners: {
  34826. beforeanimate: beforeAnim
  34827. }
  34828. });
  34829. // kick off the wrap animation
  34830. return me;
  34831. },
  34832. /**
  34833. * Slides the element out of view. An anchor point can be optionally passed to set the end point for the slide
  34834. * effect. When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will
  34835. * still take up space in the document. The element must be removed from the DOM using the 'remove' config option if
  34836. * desired. This function automatically handles wrapping the element with a fixed-size container if needed. See the
  34837. * {@link Ext.fx.Anim} class overview for valid anchor point options. Usage:
  34838. *
  34839. * // default: slide the element out to the top
  34840. * el.slideOut();
  34841. *
  34842. * // custom: slide the element out to the right with a 2-second duration
  34843. * el.slideOut('r', { duration: 2000 });
  34844. *
  34845. * // common config options shown with default values
  34846. * el.slideOut('t', {
  34847. * easing: 'easeOut',
  34848. * duration: 500,
  34849. * remove: false,
  34850. * useDisplay: false
  34851. * });
  34852. *
  34853. * @param {String} anchor (optional) One of the valid {@link Ext.fx.Anim} anchor positions (defaults to top: 't')
  34854. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  34855. * @return {Ext.dom.Element} The Element
  34856. */
  34857. slideOut: function(anchor, options) {
  34858. return this.slideIn(anchor, options, true);
  34859. },
  34860. /**
  34861. * Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television).
  34862. * When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still
  34863. * take up space in the document. The element must be removed from the DOM using the 'remove' config option if
  34864. * desired. Usage:
  34865. *
  34866. * // default
  34867. * el.switchOff();
  34868. *
  34869. * // all config options shown with default values
  34870. * el.switchOff({
  34871. * easing: 'easeIn',
  34872. * duration: .3,
  34873. * remove: false,
  34874. * useDisplay: false
  34875. * });
  34876. *
  34877. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  34878. * @return {Ext.dom.Element} The Element
  34879. */
  34880. switchOff: function(options) {
  34881. var me = this,
  34882. dom = me.dom,
  34883. animFly = new Ext.dom.Fly(),
  34884. beforeAnim;
  34885. options = Ext.applyIf(options || {}, {
  34886. easing: 'ease-in',
  34887. duration: 500,
  34888. remove: false,
  34889. useDisplay: false
  34890. });
  34891. beforeAnim = function() {
  34892. // Reattach to the DOM in case the caller animated a Fly
  34893. // in which case the dom reference will have changed by now.
  34894. animFly.attach(dom);
  34895. var animScope = this,
  34896. size = animFly.getSize(),
  34897. xy = animFly.getXY(),
  34898. keyframe, position;
  34899. animFly.clearOpacity();
  34900. animFly.clip();
  34901. position = animFly.getPositioning();
  34902. keyframe = new Ext.fx.Animator({
  34903. target: dom,
  34904. duration: options.duration,
  34905. easing: options.easing,
  34906. keyframes: {
  34907. 33: {
  34908. opacity: 0.3
  34909. },
  34910. 66: {
  34911. height: 1,
  34912. y: xy[1] + size.height / 2
  34913. },
  34914. 100: {
  34915. width: 1,
  34916. x: xy[0] + size.width / 2
  34917. }
  34918. }
  34919. });
  34920. keyframe.on('afteranimate', function() {
  34921. // Reattach to the DOM in case the caller animated a Fly
  34922. // in which case the dom reference will have changed by now.
  34923. animFly.attach(dom);
  34924. if (options.useDisplay) {
  34925. animFly.setDisplayed(false);
  34926. } else {
  34927. animFly.hide();
  34928. }
  34929. animFly.clearOpacity();
  34930. animFly.setPositioning(position);
  34931. animFly.setSize(size);
  34932. // kill the no-op element animation created below
  34933. animScope.end();
  34934. });
  34935. };
  34936. me.animate({
  34937. // See "A Note About Wrapped Animations" at the top of this class:
  34938. duration: (Math.max(options.duration, 500) * 2),
  34939. listeners: {
  34940. beforeanimate: {
  34941. fn: beforeAnim
  34942. }
  34943. },
  34944. callback: options.callback,
  34945. scope: options.scope
  34946. });
  34947. return me;
  34948. },
  34949. /**
  34950. * @private
  34951. * Currently used for updating grid cells without modifying DOM structure
  34952. *
  34953. * Synchronizes content of this Element with the content of the passed element.
  34954. *
  34955. * Style and CSS class are copied from source into this Element, and contents are synced
  34956. * recursively. If a child node is a text node, the textual data is copied.
  34957. */
  34958. syncContent: function(source) {
  34959. source = Ext.getDom(source);
  34960. var sourceNodes = source.childNodes,
  34961. sourceLen = sourceNodes.length,
  34962. dest = this.dom,
  34963. destNodes = dest.childNodes,
  34964. destLen = destNodes.length,
  34965. i, destNode, sourceNode, sourceStyle, nodeType, newAttrs, attLen, attName, value,
  34966. elData = dest._extData;
  34967. if (!syncContentFly) {
  34968. syncContentFly = new Ext.dom.Fly();
  34969. }
  34970. // Update any attributes who's values have changed..
  34971. newAttrs = source.attributes;
  34972. attLen = newAttrs.length;
  34973. for (i = 0; i < attLen; i++) {
  34974. attName = newAttrs[i].name;
  34975. value = newAttrs[i].value;
  34976. if (attName !== 'id' && dest.getAttribute(attName) !== value) {
  34977. dest.setAttribute(attName, newAttrs[i].value);
  34978. }
  34979. }
  34980. // The element's data is no longer synchronized. We just overwrite it in the DOM
  34981. if (elData) {
  34982. elData.isSynchronized = false;
  34983. }
  34984. // If the number of child nodes does not match, fall back to replacing innerHTML
  34985. if (sourceLen !== destLen) {
  34986. dest.innerHTML = source.innerHTML;
  34987. return;
  34988. }
  34989. // Loop through source nodes.
  34990. // If there are fewer, we must remove excess
  34991. for (i = 0; i < sourceLen; i++) {
  34992. sourceNode = sourceNodes[i];
  34993. destNode = destNodes[i];
  34994. nodeType = sourceNode.nodeType;
  34995. sourceStyle = sourceNode.style;
  34996. // If node structure is out of sync, just drop innerHTML in and return
  34997. if (nodeType !== destNode.nodeType || (nodeType === 1 && sourceNode.tagName !== destNode.tagName)) {
  34998. dest.innerHTML = source.innerHTML;
  34999. return;
  35000. }
  35001. // Update non-Element node (text, comment)
  35002. if (!sourceStyle) {
  35003. destNode.data = sourceNode.data;
  35004. } else // Sync element content
  35005. {
  35006. if (sourceNode.id && destNode.id !== sourceNode.id) {
  35007. destNode.id = sourceNode.id;
  35008. }
  35009. destNode.style.cssText = sourceStyle.cssText;
  35010. destNode.className = sourceNode.className;
  35011. syncContentFly.attach(destNode).syncContent(sourceNode);
  35012. }
  35013. }
  35014. },
  35015. /**
  35016. * Toggles the element's visibility, depending on visibility mode.
  35017. * @param {Boolean/Object} [animate] True for the default animation, or a standard Element animation config object
  35018. * @return {Ext.dom.Element} this
  35019. */
  35020. toggle: function(animate) {
  35021. var me = this;
  35022. me.setVisible(!me.isVisible(), me.anim(animate));
  35023. return me;
  35024. },
  35025. /**
  35026. * Hides a previously applied mask.
  35027. */
  35028. unmask: function() {
  35029. var me = this,
  35030. data = me.getData(),
  35031. maskEl = data.maskEl,
  35032. style;
  35033. if (maskEl) {
  35034. style = maskEl.dom.style;
  35035. // Remove resource-intensive CSS expressions as soon as they are not required.
  35036. if (style.clearExpression) {
  35037. style.clearExpression('width');
  35038. style.clearExpression('height');
  35039. }
  35040. if (maskEl) {
  35041. maskEl.destroy();
  35042. delete data.maskEl;
  35043. }
  35044. me.removeCls([
  35045. XMASKED,
  35046. XMASKEDRELATIVE
  35047. ]);
  35048. }
  35049. me.restoreTabbableState(me.dom === DOC.body);
  35050. },
  35051. /**
  35052. * Return clipping (overflow) to original clipping before {@link #clip} was called
  35053. * @return {Ext.dom.Element} this
  35054. */
  35055. unclip: function() {
  35056. var me = this,
  35057. data = me.getData(),
  35058. clip;
  35059. if (data[ISCLIPPED]) {
  35060. data[ISCLIPPED] = false;
  35061. clip = data[ORIGINALCLIP];
  35062. if (clip.o) {
  35063. me.setStyle(OVERFLOW, clip.o);
  35064. }
  35065. if (clip.x) {
  35066. me.setStyle(OVERFLOWX, clip.x);
  35067. }
  35068. if (clip.y) {
  35069. me.setStyle(OVERFLOWY, clip.y);
  35070. }
  35071. }
  35072. return me;
  35073. },
  35074. translate: function(x, y, z) {
  35075. if (Ext.supports.CssTransforms && !Ext.isIE9m) {
  35076. this.callParent(arguments);
  35077. } else {
  35078. if (x != null) {
  35079. this.dom.style.left = x + 'px';
  35080. }
  35081. if (y != null) {
  35082. this.dom.style.top = y + 'px';
  35083. }
  35084. }
  35085. },
  35086. deprecated: {
  35087. '4.0': {
  35088. methods: {
  35089. /**
  35090. * @method pause
  35091. * Creates a pause before any subsequent queued effects begin. If there are no effects queued after the pause it will
  35092. * have no effect. Usage:
  35093. *
  35094. * el.pause(1);
  35095. *
  35096. * @deprecated 4.0 Use the `delay` config to {@link #animate} instead.
  35097. * @param {Number} ms The length of time to pause (in milliseconds)
  35098. * @return {Ext.dom.Element} The Element
  35099. */
  35100. pause: function(ms) {
  35101. var me = this;
  35102. Ext.fx.Manager.setFxDefaults(me.id, {
  35103. delay: ms
  35104. });
  35105. return me;
  35106. },
  35107. /**
  35108. * @method scale
  35109. * Animates the transition of an element's dimensions from a starting height/width to an ending height/width. This
  35110. * method is a convenience implementation of {@link #shift}. Usage:
  35111. *
  35112. * // change height and width to 100x100 pixels
  35113. * el.scale(100, 100);
  35114. *
  35115. * // common config options shown with default values. The height and width will default to
  35116. * // the element's existing values if passed as null.
  35117. * el.scale(
  35118. * [element's width],
  35119. * [element's height], {
  35120. * easing: 'easeOut',
  35121. * duration: 350
  35122. * }
  35123. * );
  35124. *
  35125. * @deprecated 4.0 Just use {@link #animate} instead.
  35126. * @param {Number} width The new width (pass undefined to keep the original width)
  35127. * @param {Number} height The new height (pass undefined to keep the original height)
  35128. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  35129. * @return {Ext.dom.Element} The Element
  35130. */
  35131. scale: function(width, height, options) {
  35132. this.animate(Ext.apply({}, options, {
  35133. width: width,
  35134. height: height
  35135. }));
  35136. return this;
  35137. },
  35138. /**
  35139. * @method shift
  35140. * Animates the transition of any combination of an element's dimensions, xy position and/or opacity. Any of these
  35141. * properties not specified in the config object will not be changed. This effect requires that at least one new
  35142. * dimension, position or opacity setting must be passed in on the config object in order for the function to have
  35143. * any effect. Usage:
  35144. *
  35145. * // slide the element horizontally to x position 200 while changing the height and opacity
  35146. * el.shift({ x: 200, height: 50, opacity: .8 });
  35147. *
  35148. * // common config options shown with default values.
  35149. * el.shift({
  35150. * width: [element's width],
  35151. * height: [element's height],
  35152. * x: [element's x position],
  35153. * y: [element's y position],
  35154. * opacity: [element's opacity],
  35155. * easing: 'easeOut',
  35156. * duration: 350
  35157. * });
  35158. *
  35159. * @deprecated 4.0 Just use {@link #animate} instead.
  35160. * @param {Object} options Object literal with any of the {@link Ext.fx.Anim} config options
  35161. * @return {Ext.dom.Element} The Element
  35162. */
  35163. shift: function(options) {
  35164. this.animate(options);
  35165. return this;
  35166. }
  35167. }
  35168. },
  35169. '4.2': {
  35170. methods: {
  35171. /**
  35172. * @method moveTo
  35173. * Sets the position of the element in page coordinates.
  35174. * @param {Number} x X value for new position (coordinates are page-based)
  35175. * @param {Number} y Y value for new position (coordinates are page-based)
  35176. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  35177. * Element animation config object
  35178. * @return {Ext.dom.Element} this
  35179. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setXY} instead.
  35180. */
  35181. moveTo: function(x, y, animate) {
  35182. return this.setXY([
  35183. x,
  35184. y
  35185. ], animate);
  35186. },
  35187. /**
  35188. * @method setBounds
  35189. * Sets the element's position and size in one shot. If animation is true then
  35190. * width, height, x and y will be animated concurrently.
  35191. *
  35192. * @param {Number} x X value for new position (coordinates are page-based)
  35193. * @param {Number} y Y value for new position (coordinates are page-based)
  35194. * @param {Number/String} width The new width. This may be one of:
  35195. *
  35196. * - A Number specifying the new width in pixels
  35197. * - A String used to set the CSS width style. Animation may **not** be used.
  35198. *
  35199. * @param {Number/String} height The new height. This may be one of:
  35200. *
  35201. * - A Number specifying the new height in pixels
  35202. * - A String used to set the CSS height style. Animation may **not** be used.
  35203. *
  35204. * @param {Boolean/Object} [animate] true for the default animation or
  35205. * a standard Element animation config object
  35206. *
  35207. * @return {Ext.dom.Element} this
  35208. * @deprecated 4.2.0 Use {@link Ext.util.Positionable#setBox} instead.
  35209. */
  35210. setBounds: function(x, y, width, height, animate) {
  35211. return this.setBox({
  35212. x: x,
  35213. y: y,
  35214. width: width,
  35215. height: height
  35216. }, animate);
  35217. },
  35218. /**
  35219. * @method setLeftTop
  35220. * Sets the element's left and top positions directly using CSS style
  35221. * @param {Number/String} left Number of pixels or CSS string value to
  35222. * set as the left CSS property value
  35223. * @param {Number/String} top Number of pixels or CSS string value to
  35224. * set as the top CSS property value
  35225. * @return {Ext.dom.Element} this
  35226. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setLocalXY} instead
  35227. */
  35228. setLeftTop: function(left, top) {
  35229. var me = this,
  35230. style = me.dom.style;
  35231. style.left = Element.addUnits(left);
  35232. style.top = Element.addUnits(top);
  35233. if (me.shadow || me.shim) {
  35234. me.syncUnderlays();
  35235. }
  35236. return me;
  35237. },
  35238. /**
  35239. * @method setLocation
  35240. * Sets the position of the element in page coordinates.
  35241. * @param {Number} x X value for new position
  35242. * @param {Number} y Y value for new position
  35243. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  35244. * Element animation config object
  35245. * @return {Ext.dom.Element} this
  35246. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setXY} instead.
  35247. */
  35248. setLocation: function(x, y, animate) {
  35249. return this.setXY([
  35250. x,
  35251. y
  35252. ], animate);
  35253. }
  35254. }
  35255. },
  35256. '5.0': {
  35257. methods: {
  35258. /**
  35259. * @method getAttributeNS
  35260. * Returns the value of a namespaced attribute from the element's underlying DOM node.
  35261. * @param {String} namespace The namespace in which to look for the attribute
  35262. * @param {String} name The attribute name
  35263. * @return {String} The attribute value
  35264. * @deprecated 5.0.0 Please use {@link Ext.dom.Element#getAttribute} instead.
  35265. */
  35266. getAttributeNS: function(namespace, name) {
  35267. return this.getAttribute(name, namespace);
  35268. },
  35269. /**
  35270. * @method getCenterXY
  35271. * Calculates the x, y to center this element on the screen
  35272. * @return {Number[]} The x, y values [x, y]
  35273. * @deprecated 5.0.0 Use {@link Ext.dom.Element#getAlignToXY} instead.
  35274. * el.getAlignToXY(document, 'c-c');
  35275. */
  35276. getCenterXY: function() {
  35277. return this.getAlignToXY(DOC, 'c-c');
  35278. },
  35279. /**
  35280. * @method getComputedHeight
  35281. * Returns either the offsetHeight or the height of this element based on CSS height adjusted by padding or borders
  35282. * when needed to simulate offsetHeight when offsets aren't available. This may not work on display:none elements
  35283. * if a height has not been set using CSS.
  35284. * @return {Number}
  35285. * @deprecated 5.0.0 use {@link Ext.dom.Element#getHeight} instead
  35286. */
  35287. getComputedHeight: function() {
  35288. return Math.max(this.dom.offsetHeight, this.dom.clientHeight) || parseFloat(this.getStyle(HEIGHT)) || 0;
  35289. },
  35290. /**
  35291. * @method getComputedWidth
  35292. * Returns either the offsetWidth or the width of this element based on CSS width adjusted by padding or borders
  35293. * when needed to simulate offsetWidth when offsets aren't available. This may not work on display:none elements
  35294. * if a width has not been set using CSS.
  35295. * @return {Number}
  35296. * @deprecated 5.0.0 use {@link Ext.dom.Element#getWidth} instead.
  35297. */
  35298. getComputedWidth: function() {
  35299. return Math.max(this.dom.offsetWidth, this.dom.clientWidth) || parseFloat(this.getStyle(WIDTH)) || 0;
  35300. },
  35301. /**
  35302. * @method getStyleSize
  35303. * Returns the dimensions of the element available to lay content out in.
  35304. *
  35305. * getStyleSize utilizes prefers style sizing if present, otherwise it chooses the larger of offsetHeight/clientHeight and
  35306. * offsetWidth/clientWidth. To obtain the size excluding scrollbars, use getViewSize.
  35307. *
  35308. * Sizing of the document body is handled at the adapter level which handles special cases for IE and strict modes, etc.
  35309. *
  35310. * @return {Object} Object describing width and height.
  35311. * @return {Number} return.width
  35312. * @return {Number} return.height
  35313. * @deprecated 5.0.0 Use {@link Ext.dom.Element#getSize} instead.
  35314. */
  35315. getStyleSize: function() {
  35316. var me = this,
  35317. d = this.dom,
  35318. isDoc = (d === DOC || d === DOC.body),
  35319. s, w, h;
  35320. // If the body, use static methods
  35321. if (isDoc) {
  35322. return {
  35323. width: Element.getViewportWidth(),
  35324. height: Element.getViewportHeight()
  35325. };
  35326. }
  35327. s = me.getStyle([
  35328. 'height',
  35329. 'width'
  35330. ], true);
  35331. //seek inline
  35332. // Use Styles if they are set
  35333. if (s.width && s.width !== 'auto') {
  35334. w = parseFloat(s.width);
  35335. }
  35336. // Use Styles if they are set
  35337. if (s.height && s.height !== 'auto') {
  35338. h = parseFloat(s.height);
  35339. }
  35340. // Use getWidth/getHeight if style not set.
  35341. return {
  35342. width: w || me.getWidth(true),
  35343. height: h || me.getHeight(true)
  35344. };
  35345. },
  35346. /**
  35347. * @method isBorderBox
  35348. * Returns true if this element uses the border-box-sizing model. This method is
  35349. * deprecated as of version 5.0 because border-box sizing is forced upon all elements
  35350. * via a style sheet rule, and the browsers that do not support border-box (IE6/7 strict
  35351. * mode) are no longer supported.
  35352. * @deprecated 5.0.0 This method is deprecated. Browsers that do not
  35353. * support border-box (IE6/7 strict mode) are no longer supported.
  35354. * @return {Boolean}
  35355. */
  35356. isBorderBox: function() {
  35357. return true;
  35358. },
  35359. /**
  35360. * @method isDisplayed
  35361. * Returns true if display is not "none"
  35362. * @return {Boolean}
  35363. * @deprecated 5.0.0 use element.isStyle('display', 'none');
  35364. */
  35365. isDisplayed: function() {
  35366. return !this.isStyle('display', 'none');
  35367. },
  35368. /**
  35369. * @method focusable
  35370. * Checks whether this element can be focused.
  35371. * @return {Boolean} True if the element is focusable
  35372. * @deprecated 5.0.0 use {@link #isFocusable} instead
  35373. */
  35374. focusable: 'isFocusable'
  35375. }
  35376. }
  35377. }
  35378. };
  35379. })(), function() {
  35380. var Element = Ext.dom.Element,
  35381. proto = Element.prototype,
  35382. useDocForId = !Ext.isIE8,
  35383. DOC = document,
  35384. view = DOC.defaultView,
  35385. opacityRe = /alpha\(opacity=(.*)\)/i,
  35386. trimRe = /^\s+|\s+$/g,
  35387. styleHooks = proto.styleHooks,
  35388. supports = Ext.supports,
  35389. verticalStyleHooks90, verticalStyleHooks270, edges, k, edge, borderWidth, getBorderWidth;
  35390. proto._init(Element);
  35391. delete proto._init;
  35392. Ext.plainTableCls = Ext.baseCSSPrefix + 'table-plain';
  35393. Ext.plainListCls = Ext.baseCSSPrefix + 'list-plain';
  35394. // ensure that any methods added by this override are also added to Ext.CompositeElementLite
  35395. if (Ext.CompositeElementLite) {
  35396. Ext.CompositeElementLite.importElementMethods();
  35397. }
  35398. if (!supports.Opacity && Ext.isIE) {
  35399. Ext.apply(styleHooks.opacity, {
  35400. get: function(dom) {
  35401. var filter = dom.style.filter,
  35402. match, opacity;
  35403. if (filter.match) {
  35404. match = filter.match(opacityRe);
  35405. if (match) {
  35406. opacity = parseFloat(match[1]);
  35407. if (!isNaN(opacity)) {
  35408. return opacity ? opacity / 100 : 0;
  35409. }
  35410. }
  35411. }
  35412. return 1;
  35413. },
  35414. set: function(dom, value) {
  35415. var style = dom.style,
  35416. val = style.filter.replace(opacityRe, '').replace(trimRe, '');
  35417. style.zoom = 1;
  35418. // ensure dom.hasLayout
  35419. // value can be a number or '' or null... so treat falsey as no opacity
  35420. if (typeof (value) === 'number' && value >= 0 && value < 1) {
  35421. value *= 100;
  35422. style.filter = val + (val.length ? ' ' : '') + 'alpha(opacity=' + value + ')';
  35423. } else {
  35424. style.filter = val;
  35425. }
  35426. }
  35427. });
  35428. }
  35429. if (!supports.matchesSelector) {
  35430. // Match basic tagName.ClassName selector syntax for is implementation
  35431. var simpleSelectorRe = /^([a-z]+|\*)?(?:\.([a-z][a-z\-_0-9]*))?$/i,
  35432. dashRe = /\-/g,
  35433. fragment,
  35434. classMatcher = function(tag, cls) {
  35435. var classRe = new RegExp('(?:^|\\s+)' + cls.replace(dashRe, '\\-') + '(?:\\s+|$)');
  35436. if (tag && tag !== '*') {
  35437. tag = tag.toUpperCase();
  35438. return function(el) {
  35439. return el.tagName === tag && classRe.test(el.className);
  35440. };
  35441. }
  35442. return function(el) {
  35443. return classRe.test(el.className);
  35444. };
  35445. },
  35446. tagMatcher = function(tag) {
  35447. tag = tag.toUpperCase();
  35448. return function(el) {
  35449. return el.tagName === tag;
  35450. };
  35451. },
  35452. cache = {};
  35453. proto.matcherCache = cache;
  35454. proto.is = function(selector) {
  35455. // Empty selector always matches
  35456. if (!selector) {
  35457. return true;
  35458. }
  35459. var dom = this.dom,
  35460. cls, match, testFn, root, isOrphan, is, tag;
  35461. // Only Element node types can be matched.
  35462. if (dom.nodeType !== 1) {
  35463. return false;
  35464. }
  35465. if (!(testFn = Ext.isFunction(selector) ? selector : cache[selector])) {
  35466. if (!(match = selector.match(simpleSelectorRe))) {
  35467. // Not a simple tagName.className selector, do it the hard way
  35468. root = dom.parentNode;
  35469. if (!root) {
  35470. isOrphan = true;
  35471. root = fragment || (fragment = DOC.createDocumentFragment());
  35472. fragment.appendChild(dom);
  35473. }
  35474. is = Ext.Array.indexOf(Ext.fly(root, '_is').query(selector), dom) !== -1;
  35475. if (isOrphan) {
  35476. fragment.removeChild(dom);
  35477. }
  35478. return is;
  35479. }
  35480. tag = match[1];
  35481. cls = match[2];
  35482. cache[selector] = testFn = cls ? classMatcher(tag, cls) : tagMatcher(tag);
  35483. }
  35484. return testFn(dom);
  35485. };
  35486. }
  35487. // IE8 needs its own implementation of getStyle because it doesn't support getComputedStyle
  35488. if (!view || !view.getComputedStyle) {
  35489. proto.getStyle = function(property, inline) {
  35490. var me = this,
  35491. dom = me.dom,
  35492. multiple = typeof property !== 'string',
  35493. prop = property,
  35494. props = prop,
  35495. len = 1,
  35496. isInline = inline,
  35497. styleHooks = me.styleHooks,
  35498. camel, domStyle, values, hook, out, style, i;
  35499. if (multiple) {
  35500. values = {};
  35501. prop = props[0];
  35502. i = 0;
  35503. if (!(len = props.length)) {
  35504. return values;
  35505. }
  35506. }
  35507. if (!dom || dom.documentElement) {
  35508. return values || '';
  35509. }
  35510. domStyle = dom.style;
  35511. if (inline) {
  35512. style = domStyle;
  35513. } else {
  35514. style = dom.currentStyle;
  35515. // fallback to inline style if rendering context not available
  35516. if (!style) {
  35517. isInline = true;
  35518. style = domStyle;
  35519. }
  35520. }
  35521. do {
  35522. hook = styleHooks[prop];
  35523. if (!hook) {
  35524. styleHooks[prop] = hook = {
  35525. name: Element.normalize(prop)
  35526. };
  35527. }
  35528. if (hook.get) {
  35529. out = hook.get(dom, me, isInline, style);
  35530. } else {
  35531. camel = hook.name;
  35532. out = style[camel];
  35533. }
  35534. if (!multiple) {
  35535. return out;
  35536. }
  35537. values[prop] = out;
  35538. prop = props[++i];
  35539. } while (i < len);
  35540. return values;
  35541. };
  35542. }
  35543. // override getStyle for border-*-width
  35544. if (Ext.isIE8) {
  35545. getBorderWidth = function(dom, el, inline, style) {
  35546. if (style[this.styleName] === 'none') {
  35547. return '0px';
  35548. }
  35549. return style[this.name];
  35550. };
  35551. edges = [
  35552. 'Top',
  35553. 'Right',
  35554. 'Bottom',
  35555. 'Left'
  35556. ];
  35557. k = edges.length;
  35558. while (k--) {
  35559. edge = edges[k];
  35560. borderWidth = 'border' + edge + 'Width';
  35561. styleHooks['border-' + edge.toLowerCase() + '-width'] = styleHooks[borderWidth] = {
  35562. name: borderWidth,
  35563. styleName: 'border' + edge + 'Style',
  35564. get: getBorderWidth
  35565. };
  35566. }
  35567. // IE8 has an odd bug with handling font icons in pseudo elements;
  35568. // it will render the icon once and not update it when something
  35569. // like text color is changed via style addition or removal.
  35570. // We have to force icon repaint by adding a style with forced empty
  35571. // pseudo element content, (x-sync-repaint) and removing it back to work
  35572. // around this issue.
  35573. // See this: https://github.com/FortAwesome/Font-Awesome/issues/954
  35574. // and this: https://github.com/twbs/bootstrap/issues/13863
  35575. var syncRepaintCls = Ext.baseCSSPrefix + 'sync-repaint';
  35576. proto.syncRepaint = function() {
  35577. this.addCls(syncRepaintCls);
  35578. // Measuring element width will make the browser to repaint it
  35579. this.getWidth();
  35580. // Removing empty content makes the icon to appear again and be redrawn
  35581. this.removeCls(syncRepaintCls);
  35582. };
  35583. }
  35584. if (Ext.isIE10m) {
  35585. Ext.override(Element, {
  35586. focus: function(defer, dom) {
  35587. var me = this,
  35588. ex;
  35589. dom = dom || me.dom;
  35590. if (me.deferredFocusTimer) {
  35591. Ext.undefer(me.deferredFocusTimer);
  35592. }
  35593. me.deferredFocusTimer = null;
  35594. if (Number(defer)) {
  35595. me.deferredFocusTimer = Ext.defer(me.focus, defer, me, [
  35596. null,
  35597. dom
  35598. ]);
  35599. } else {
  35600. Ext.GlobalEvents.fireEvent('beforefocus', dom);
  35601. // IE10m has an acute problem with focusing input elements;
  35602. // when the element was just shown and did not have enough
  35603. // time to initialize, focusing it might fail. The problem
  35604. // is somewhat random in nature; most of the time focusing
  35605. // an input element will succeed, failing only occasionally.
  35606. // When it fails, the focus will be thrown to the document
  35607. // body element, with subsequent focusout/focusin event pair
  35608. // on the body, which throws off our focusenter/focusleave
  35609. // processing.
  35610. // Fortunately for us, when this focus failure happens, the
  35611. // resulting focusout event will happen *synchronously*
  35612. // unlike the normal focusing events which IE will fire
  35613. // asynchronously. Also fortunately for us, in most cases
  35614. // trying to focus the given element the second time
  35615. // immediately after it failed to focus the first time
  35616. // seems to do the trick; however when second focus attempt
  35617. // succeeds, it will result in focusout on the body and
  35618. // focusin on the given element, which again wreaks havoc
  35619. // on our focusenter/focusleave handling.
  35620. // The only workable solution we have is to pretend that
  35621. // focus never went to the document body and ignore the
  35622. // focusout and focusin caused by failed first focus attempt.
  35623. // To this end, we fudge the event stream in Focus publisher
  35624. // override.
  35625. if (dom && (dom.tagName === 'INPUT' || dom.tagname === 'TEXTAREA')) {
  35626. Ext.synchronouslyFocusing = document.activeElement;
  35627. }
  35628. // Also note that trying to focus an unfocusable element
  35629. // might throw an exception in IE8. What a cute idea, MS. :(
  35630. try {
  35631. dom.focus();
  35632. } catch (xcpt) {
  35633. ex = xcpt;
  35634. }
  35635. // Ok so now we have this situation when we tried to focus
  35636. // the first time but did not succeed. Let's try again but
  35637. // not if there was an exception the first time - when the
  35638. // "focus failure" happens it does so silently. :(
  35639. if (Ext.synchronouslyFocusing && document.activeElement !== dom && !ex) {
  35640. dom.focus();
  35641. }
  35642. Ext.synchronouslyFocusing = null;
  35643. }
  35644. return me;
  35645. }
  35646. });
  35647. }
  35648. Ext.apply(Ext, {
  35649. /**
  35650. * `true` to automatically uncache orphaned Ext.Elements periodically. If set to
  35651. * `false`, the application will be required to clean up orphaned Ext.Elements and
  35652. * it's listeners as to not cause memory leakage.
  35653. * @member Ext
  35654. */
  35655. enableGarbageCollector: true,
  35656. // In sencha v5 isBorderBox is no longer needed since all supported browsers
  35657. // support border-box, but it is hard coded to true for backward compatibility
  35658. isBorderBox: true,
  35659. /**
  35660. * @property {Boolean} useShims
  35661. * @member Ext
  35662. * Set to `true` to use a {@link Ext.util.Floating#shim shim} on all floating Components
  35663. * and {@link Ext.LoadMask LoadMasks}
  35664. */
  35665. useShims: false,
  35666. getElementById: function(id) {
  35667. var el = DOC.getElementById(id),
  35668. detachedBodyEl;
  35669. if (!el && (detachedBodyEl = Ext.detachedBodyEl)) {
  35670. el = detachedBodyEl.dom.querySelector(Ext.makeIdSelector(id));
  35671. }
  35672. return el;
  35673. },
  35674. /**
  35675. * Applies event listeners to elements by selectors when the document is ready.
  35676. * The event name is specified with an `@` suffix.
  35677. *
  35678. * Ext.addBehaviors({
  35679. * // add a listener for click on all anchors in element with id foo
  35680. * '#foo a@click': function(e, t){
  35681. * // do something
  35682. * },
  35683. *
  35684. * // add the same listener to multiple selectors (separated by comma BEFORE the @)
  35685. * '#foo a, #bar span.some-class@mouseover': function(){
  35686. * // do something
  35687. * }
  35688. * });
  35689. *
  35690. * @param {Object} obj The list of behaviors to apply
  35691. * @member Ext
  35692. */
  35693. addBehaviors: function(obj) {
  35694. if (!Ext.isReady) {
  35695. Ext.onInternalReady(function() {
  35696. Ext.addBehaviors(obj);
  35697. });
  35698. } else {
  35699. var cache = {},
  35700. // simple cache for applying multiple behaviors to same selector does query multiple times
  35701. parts, b, s;
  35702. for (b in obj) {
  35703. if ((parts = b.split('@'))[1]) {
  35704. // for Object prototype breakers
  35705. s = parts[0];
  35706. if (!cache[s]) {
  35707. cache[s] = Ext.fly(document).select(s, true);
  35708. }
  35709. cache[s].on(parts[1], obj[b]);
  35710. }
  35711. }
  35712. cache = null;
  35713. }
  35714. }
  35715. });
  35716. if (Ext.isIE9m) {
  35717. Ext.getElementById = function(id) {
  35718. var el = DOC.getElementById(id),
  35719. detachedBodyEl;
  35720. if (!el && (detachedBodyEl = Ext.detachedBodyEl)) {
  35721. el = detachedBodyEl.dom.all[id];
  35722. }
  35723. return el;
  35724. };
  35725. proto.getById = function(id, asDom) {
  35726. var dom = this.dom,
  35727. ret = null,
  35728. entry, el;
  35729. if (dom) {
  35730. // for normal elements getElementById is the best solution, but if the el is
  35731. // not part of the document.body, we need to use all[]
  35732. el = (useDocForId && DOC.getElementById(id)) || dom.all[id];
  35733. if (el) {
  35734. if (asDom) {
  35735. ret = el;
  35736. } else {
  35737. // calling Element.get here is a real hit (2x slower) because it has to
  35738. // redetermine that we are giving it a dom el.
  35739. entry = Ext.cache[id];
  35740. if (entry) {
  35741. if (entry.skipGarbageCollection || !Ext.isGarbage(entry.dom)) {
  35742. ret = entry;
  35743. } else {
  35744. Ext.raise("Stale Element with id '" + el.id + "' found in Element cache. " + "Make sure to clean up Element instances using destroy()");
  35745. entry.destroy();
  35746. }
  35747. }
  35748. ret = ret || new Ext.Element(el);
  35749. }
  35750. }
  35751. }
  35752. return ret;
  35753. };
  35754. } else if (!DOC.querySelector) {
  35755. Ext.getDetachedBody = Ext.getBody;
  35756. Ext.getElementById = function(id) {
  35757. return DOC.getElementById(id);
  35758. };
  35759. proto.getById = function(id, asDom) {
  35760. var dom = DOC.getElementById(id);
  35761. return asDom ? dom : (dom ? Ext.get(dom) : null);
  35762. };
  35763. }
  35764. if (Ext.isIE && !(Ext.isIE9p && DOC.documentMode >= 9)) {
  35765. // Essentially all web browsers (Firefox, Internet Explorer, recent versions of Opera, Safari, Konqueror, and iCab,
  35766. // as a non-exhaustive list) return null when the specified attribute does not exist on the specified element.
  35767. // The DOM specification says that the correct return value in this case is actually the empty string, and some
  35768. // DOM implementations implement this behavior. The implementation of getAttribute in XUL (Gecko) actually follows
  35769. // the specification and returns an empty string. Consequently, you should use hasAttribute to check for an attribute's
  35770. // existence prior to calling getAttribute() if it is possible that the requested attribute does not exist on the specified element.
  35771. //
  35772. // https://developer.mozilla.org/en-US/docs/DOM/element.getAttribute
  35773. // http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614
  35774. proto.getAttribute = function(name, ns) {
  35775. var d = this.dom,
  35776. type;
  35777. if (ns) {
  35778. type = typeof d[ns + ":" + name];
  35779. if (type !== 'undefined' && type !== 'unknown') {
  35780. return d[ns + ":" + name] || null;
  35781. }
  35782. return null;
  35783. }
  35784. if (name === "for") {
  35785. name = "htmlFor";
  35786. }
  35787. return d[name] || null;
  35788. };
  35789. }
  35790. Ext.onInternalReady(function() {
  35791. var transparentRe = /^(?:transparent|(?:rgba[(](?:\s*\d+\s*[,]){3}\s*0\s*[)]))$/i,
  35792. origSetWidth = proto.setWidth,
  35793. origSetHeight = proto.setHeight,
  35794. origSetSize = proto.setSize,
  35795. origUnselectable = proto.unselectable,
  35796. pxRe = /^\d+(?:\.\d*)?px$/i,
  35797. colorStyles, i, name, camel;
  35798. if (supports.FixedTableWidthBug) {
  35799. // EXTJSIV-12665
  35800. // https://bugs.webkit.org/show_bug.cgi?id=130239
  35801. // Webkit browsers fail to layout correctly when a form field's width is less
  35802. // than the min-width of the body element. The only way to fix it seems to be
  35803. // to toggle the display style of the field's element before and after setting
  35804. // the width. Note: once the bug has been corrected by toggling the element's
  35805. // display, successive calls to setWidth will work without the hack. It's only
  35806. // when going from naturally widthed to having an explicit width that the bug
  35807. // occurs.
  35808. styleHooks.width = {
  35809. name: 'width',
  35810. set: function(dom, value, el) {
  35811. var style = dom.style,
  35812. needsFix = el._needsTableWidthFix,
  35813. origDisplay = style.display;
  35814. if (needsFix) {
  35815. style.display = 'none';
  35816. }
  35817. style.width = value;
  35818. if (needsFix) {
  35819. // repaint
  35820. dom.scrollWidth;
  35821. // jshint ignore:line
  35822. style.display = origDisplay;
  35823. }
  35824. }
  35825. };
  35826. proto.setWidth = function(width, animate) {
  35827. var me = this,
  35828. dom = me.dom,
  35829. style = dom.style,
  35830. needsFix = me._needsTableWidthFix,
  35831. origDisplay = style.display;
  35832. if (needsFix && !animate) {
  35833. style.display = 'none';
  35834. }
  35835. origSetWidth.call(me, width, animate);
  35836. if (needsFix && !animate) {
  35837. // repaint
  35838. dom.scrollWidth;
  35839. // jshint ignore:line
  35840. style.display = origDisplay;
  35841. }
  35842. return me;
  35843. };
  35844. proto.setSize = function(width, height, animate) {
  35845. var me = this,
  35846. dom = me.dom,
  35847. style = dom.style,
  35848. needsFix = me._needsTableWidthFix,
  35849. origDisplay = style.display;
  35850. if (needsFix && !animate) {
  35851. style.display = 'none';
  35852. }
  35853. origSetSize.call(me, width, height, animate);
  35854. if (needsFix && !animate) {
  35855. // repaint
  35856. dom.scrollWidth;
  35857. // jshint ignore:line
  35858. style.display = origDisplay;
  35859. }
  35860. return me;
  35861. };
  35862. }
  35863. if (Ext.isIE8) {
  35864. styleHooks.height = {
  35865. name: 'height',
  35866. set: function(dom, value, el) {
  35867. var component = el.component,
  35868. frameInfo, frameBodyStyle;
  35869. if (component && component._syncFrameHeight && el === component.el) {
  35870. frameBodyStyle = component.frameBody.dom.style;
  35871. if (pxRe.test(value)) {
  35872. frameInfo = component.getFrameInfo();
  35873. if (frameInfo) {
  35874. frameBodyStyle.height = (parseInt(value, 10) - frameInfo.height) + 'px';
  35875. }
  35876. } else if (!value || value === 'auto') {
  35877. frameBodyStyle.height = '';
  35878. }
  35879. }
  35880. dom.style.height = value;
  35881. }
  35882. };
  35883. proto.setHeight = function(height, animate) {
  35884. var component = this.component,
  35885. frameInfo, frameBodyStyle;
  35886. if (component && component._syncFrameHeight && this === component.el) {
  35887. frameBodyStyle = component.frameBody.dom.style;
  35888. if (!height || height === 'auto') {
  35889. frameBodyStyle.height = '';
  35890. } else {
  35891. frameInfo = component.getFrameInfo();
  35892. if (frameInfo) {
  35893. frameBodyStyle.height = (height - frameInfo.height) + 'px';
  35894. }
  35895. }
  35896. }
  35897. return origSetHeight.call(this, height, animate);
  35898. };
  35899. proto.setSize = function(width, height, animate) {
  35900. var component = this.component,
  35901. frameInfo, frameBodyStyle;
  35902. if (component && component._syncFrameHeight && this === component.el) {
  35903. frameBodyStyle = component.frameBody.dom.style;
  35904. if (!height || height === 'auto') {
  35905. frameBodyStyle.height = '';
  35906. } else {
  35907. frameInfo = component.getFrameInfo();
  35908. if (frameInfo) {
  35909. frameBodyStyle.height = (height - frameInfo.height) + 'px';
  35910. }
  35911. }
  35912. }
  35913. return origSetSize.call(this, width, height, animate);
  35914. };
  35915. // Override for IE8 which throws an error setting innerHTML when inside
  35916. // an event handler invoked from that element.
  35917. proto.setText = function(text) {
  35918. var dom = this.dom;
  35919. // Remove all child nodes, leave only a single textNode
  35920. if (!(dom.childNodes.length === 1 && dom.firstChild.nodeType === 3)) {
  35921. while (dom.lastChild && dom.lastChild.nodeType !== 3) {
  35922. dom.removeChild(dom.lastChild);
  35923. }
  35924. dom.appendChild(document.createTextNode());
  35925. }
  35926. // Set the data of the textNode
  35927. dom.firstChild.data = text;
  35928. };
  35929. proto.unselectable = function() {
  35930. origUnselectable.call(this);
  35931. this.dom.onselectstart = function() {
  35932. return false;
  35933. };
  35934. };
  35935. }
  35936. function fixTransparent(dom, el, inline, style) {
  35937. var value = style[this.name] || '';
  35938. return transparentRe.test(value) ? 'transparent' : value;
  35939. }
  35940. /*
  35941. * Helper function to create the function that will restore the selection.
  35942. */
  35943. function makeSelectionRestoreFn(activeEl, start, end) {
  35944. return function() {
  35945. activeEl.selectionStart = start;
  35946. activeEl.selectionEnd = end;
  35947. };
  35948. }
  35949. /*
  35950. * Creates a function to call to clean up problems with the work-around for the
  35951. * WebKit RightMargin bug. The work-around is to add "display: 'inline-block'" to
  35952. * the element before calling getComputedStyle and then to restore its original
  35953. * display value. The problem with this is that it corrupts the selection of an
  35954. * INPUT or TEXTAREA element (as in the "I-beam" goes away but the focus remains).
  35955. * To cleanup after this, we need to capture the selection of any such element and
  35956. * then restore it after we have restored the display style.
  35957. *
  35958. * @param {HTMLElement} target The top-most element being adjusted.
  35959. * @private
  35960. */
  35961. function getRightMarginFixCleaner(target) {
  35962. var hasInputBug = supports.DisplayChangeInputSelectionBug,
  35963. hasTextAreaBug = supports.DisplayChangeTextAreaSelectionBug,
  35964. activeEl, tag, start, end;
  35965. if (hasInputBug || hasTextAreaBug) {
  35966. activeEl = Element.getActiveElement();
  35967. tag = activeEl && activeEl.tagName;
  35968. if ((hasTextAreaBug && tag === 'TEXTAREA') || (hasInputBug && tag === 'INPUT' && activeEl.type === 'text')) {
  35969. if (Ext.fly(target).isAncestor(activeEl)) {
  35970. start = activeEl.selectionStart;
  35971. end = activeEl.selectionEnd;
  35972. if (Ext.isNumber(start) && Ext.isNumber(end)) {
  35973. // to be safe...
  35974. // We don't create the raw closure here inline because that
  35975. // will be costly even if we don't want to return it (nested
  35976. // function decls and exprs are often instantiated on entry
  35977. // regardless of whether execution ever reaches them):
  35978. return makeSelectionRestoreFn(activeEl, start, end);
  35979. }
  35980. }
  35981. }
  35982. }
  35983. return Ext.emptyFn;
  35984. }
  35985. // avoid special cases, just return a nop
  35986. function fixRightMargin(dom, el, inline, style) {
  35987. var result = style.marginRight,
  35988. domStyle, display;
  35989. // Ignore cases when the margin is correctly reported as 0, the bug only shows
  35990. // numbers larger.
  35991. if (result !== '0px') {
  35992. domStyle = dom.style;
  35993. display = domStyle.display;
  35994. domStyle.display = 'inline-block';
  35995. result = (inline ? style : dom.ownerDocument.defaultView.getComputedStyle(dom, null)).marginRight;
  35996. domStyle.display = display;
  35997. }
  35998. return result;
  35999. }
  36000. function fixRightMarginAndInputFocus(dom, el, inline, style) {
  36001. var result = style.marginRight,
  36002. domStyle, cleaner, display;
  36003. if (result !== '0px') {
  36004. domStyle = dom.style;
  36005. cleaner = getRightMarginFixCleaner(dom);
  36006. display = domStyle.display;
  36007. domStyle.display = 'inline-block';
  36008. result = (inline ? style : dom.ownerDocument.defaultView.getComputedStyle(dom, '')).marginRight;
  36009. domStyle.display = display;
  36010. cleaner();
  36011. }
  36012. return result;
  36013. }
  36014. //TODO - this was fixed in Safari 3 - verify if this is still an issue
  36015. // Fix bug caused by this: https://bugs.webkit.org/show_bug.cgi?id=13343
  36016. if (!supports.RightMargin) {
  36017. styleHooks.marginRight = styleHooks['margin-right'] = {
  36018. name: 'marginRight',
  36019. // TODO - Touch should use conditional compilation here or ensure that the
  36020. // underlying Ext.supports flags are set correctly...
  36021. get: (supports.DisplayChangeInputSelectionBug || supports.DisplayChangeTextAreaSelectionBug) ? fixRightMarginAndInputFocus : fixRightMargin
  36022. };
  36023. }
  36024. if (!supports.TransparentColor) {
  36025. colorStyles = [
  36026. 'background-color',
  36027. 'border-color',
  36028. 'color',
  36029. 'outline-color'
  36030. ];
  36031. for (i = colorStyles.length; i--; ) {
  36032. name = colorStyles[i];
  36033. camel = Element.normalize(name);
  36034. styleHooks[name] = styleHooks[camel] = {
  36035. name: camel,
  36036. get: fixTransparent
  36037. };
  36038. }
  36039. }
  36040. // When elements are rotated 80 or 270 degrees, their border, margin and padding hooks
  36041. // need to be rotated as well.
  36042. proto.verticalStyleHooks90 = verticalStyleHooks90 = Ext.Object.chain(styleHooks);
  36043. proto.verticalStyleHooks270 = verticalStyleHooks270 = Ext.Object.chain(styleHooks);
  36044. verticalStyleHooks90.width = styleHooks.height || {
  36045. name: 'height'
  36046. };
  36047. verticalStyleHooks90.height = styleHooks.width || {
  36048. name: 'width'
  36049. };
  36050. verticalStyleHooks90['margin-top'] = {
  36051. name: 'marginLeft'
  36052. };
  36053. verticalStyleHooks90['margin-right'] = {
  36054. name: 'marginTop'
  36055. };
  36056. verticalStyleHooks90['margin-bottom'] = {
  36057. name: 'marginRight'
  36058. };
  36059. verticalStyleHooks90['margin-left'] = {
  36060. name: 'marginBottom'
  36061. };
  36062. verticalStyleHooks90['padding-top'] = {
  36063. name: 'paddingLeft'
  36064. };
  36065. verticalStyleHooks90['padding-right'] = {
  36066. name: 'paddingTop'
  36067. };
  36068. verticalStyleHooks90['padding-bottom'] = {
  36069. name: 'paddingRight'
  36070. };
  36071. verticalStyleHooks90['padding-left'] = {
  36072. name: 'paddingBottom'
  36073. };
  36074. verticalStyleHooks90['border-top'] = {
  36075. name: 'borderLeft'
  36076. };
  36077. verticalStyleHooks90['border-right'] = {
  36078. name: 'borderTop'
  36079. };
  36080. verticalStyleHooks90['border-bottom'] = {
  36081. name: 'borderRight'
  36082. };
  36083. verticalStyleHooks90['border-left'] = {
  36084. name: 'borderBottom'
  36085. };
  36086. verticalStyleHooks270.width = styleHooks.height || {
  36087. name: 'height'
  36088. };
  36089. verticalStyleHooks270.height = styleHooks.width || {
  36090. name: 'width'
  36091. };
  36092. verticalStyleHooks270['margin-top'] = {
  36093. name: 'marginRight'
  36094. };
  36095. verticalStyleHooks270['margin-right'] = {
  36096. name: 'marginBottom'
  36097. };
  36098. verticalStyleHooks270['margin-bottom'] = {
  36099. name: 'marginLeft'
  36100. };
  36101. verticalStyleHooks270['margin-left'] = {
  36102. name: 'marginTop'
  36103. };
  36104. verticalStyleHooks270['padding-top'] = {
  36105. name: 'paddingRight'
  36106. };
  36107. verticalStyleHooks270['padding-right'] = {
  36108. name: 'paddingBottom'
  36109. };
  36110. verticalStyleHooks270['padding-bottom'] = {
  36111. name: 'paddingLeft'
  36112. };
  36113. verticalStyleHooks270['padding-left'] = {
  36114. name: 'paddingTop'
  36115. };
  36116. verticalStyleHooks270['border-top'] = {
  36117. name: 'borderRight'
  36118. };
  36119. verticalStyleHooks270['border-right'] = {
  36120. name: 'borderBottom'
  36121. };
  36122. verticalStyleHooks270['border-bottom'] = {
  36123. name: 'borderLeft'
  36124. };
  36125. verticalStyleHooks270['border-left'] = {
  36126. name: 'borderTop'
  36127. };
  36128. /**
  36129. * @property {Boolean} scopeCss
  36130. * @member Ext
  36131. * Set this to true before onReady to prevent any styling from being added to
  36132. * the body element. By default a few styles such as font-family, and color
  36133. * are added to the body element via a "x-body" class. When this is set to
  36134. * `true` the "x-body" class is not added to the body element, but is added
  36135. * to the elements of root-level containers instead.
  36136. */
  36137. if (!Ext.scopeCss) {
  36138. Ext.getBody().addCls(Ext.baseCSSPrefix + 'body');
  36139. }
  36140. }, null, {
  36141. priority: 1500
  36142. });
  36143. });
  36144. // onReady
  36145. // @tag core
  36146. /**
  36147. * @class Ext.GlobalEvents
  36148. */
  36149. Ext.define('Ext.overrides.GlobalEvents', {
  36150. override: 'Ext.GlobalEvents',
  36151. /**
  36152. * @event resumelayouts
  36153. * Fires after global layout processing has been resumed in {@link
  36154. * Ext.Component#resumeLayouts}.
  36155. */
  36156. attachListeners: function() {
  36157. var me = this,
  36158. docElement, bufferedFn;
  36159. // In IE9- when using legacy onresize event via attachEvent or onresize property,
  36160. // the event may fire for *content size changes* as well as actual document view
  36161. // size changes. See this: https://msdn.microsoft.com/en-us/library/ms536959(v=vs.85).aspx
  36162. // and this: http://stackoverflow.com/questions/1852751/window-resize-event-firing-in-internet-explorer
  36163. // The amount of these events firing all at once can be entirely staggering, and they
  36164. // often happen during layouts so we have to be über careful to execute as few JavaScript
  36165. // statements as possible to improve overall framework performance.
  36166. if (Ext.isIE8) {
  36167. docElement = Ext.getDoc().dom.documentElement;
  36168. bufferedFn = Ext.Function.createBuffered(me.fireResize, me.resizeBuffer, me);
  36169. Ext.getWin().dom.attachEvent('onresize', function() {
  36170. if (docElement.clientWidth !== Ext.GlobalEvents.curWidth || docElement.clientHeight !== Ext.GlobalEvents.curHeight) {
  36171. bufferedFn();
  36172. }
  36173. });
  36174. }
  36175. me.callParent();
  36176. },
  36177. deprecated: {
  36178. 5: {
  36179. methods: {
  36180. addListener: function(ename, fn, scope, options, order, caller, eventOptions) {
  36181. var name, readyFn;
  36182. // The "ready" event was removed from Ext.globalEvents in 5.0 in favor of
  36183. // Ext.onReady(). This function adds compatibility for the ready event
  36184. if (ename === 'ready') {
  36185. readyFn = fn;
  36186. } else if (typeof ename !== 'string') {
  36187. for (name in ename) {
  36188. if (name === 'ready') {
  36189. readyFn = ename[name];
  36190. }
  36191. }
  36192. }
  36193. if (readyFn) {
  36194. Ext.log.warn("Ext.on('ready', fn) is deprecated. Please use Ext.onReady(fn) instead.");
  36195. Ext.onReady(readyFn);
  36196. }
  36197. this.callParent([
  36198. ename,
  36199. fn,
  36200. scope,
  36201. options,
  36202. order,
  36203. caller,
  36204. eventOptions
  36205. ]);
  36206. }
  36207. }
  36208. }
  36209. }
  36210. });
  36211. /**
  36212. * @class Ext.plugin.Abstract
  36213. */
  36214. Ext.define('Ext.overrides.plugin.Abstract', {
  36215. override: 'Ext.plugin.Abstract',
  36216. $configStrict: false,
  36217. $configPrefixed: false,
  36218. disabled: false,
  36219. /**
  36220. * @cfg {String|Array} stateEvents
  36221. * The configured list of stateEvents used to (optionally) participate in Owner Component's state management.
  36222. * @member Ext.plugin.Abstract
  36223. */
  36224. /**
  36225. * @method
  36226. * The getState method is invoked by the client Component's State mixin when one or more of the the specified {@link #stateEvents} are raised.
  36227. *
  36228. * The supplied implementation is empty. If plugin Subclasses are to (optionally) participate in the client Component's
  36229. * state management, implementers should provide a suitable method which returns a state object.
  36230. * @return {Object} state
  36231. * @member Ext.plugin.Abstract
  36232. */
  36233. getState: null,
  36234. /**
  36235. * @method
  36236. * The applyState method is invoked by the client Component's State mixin after initComponent method has been run for the client.
  36237. *
  36238. * The supplied implementation is empty. If plugin Subclasses are to (optionally) participate in the client Component's
  36239. * state management, implementers should provide a suitable method to utilize it.
  36240. * @param {Object} state The current plugin state object to be applied.
  36241. * @param {Object} allState The current aggregate state of the Component and all plugins.
  36242. * @member Ext.plugin.Abstract
  36243. */
  36244. applyState: null,
  36245. /**
  36246. * The base implementation just sets the plugin's `disabled` flag to `false`
  36247. *
  36248. * Plugin subclasses which need more complex processing may implement an overriding implementation.
  36249. * @member Ext.plugin.Abstract
  36250. */
  36251. enable: function() {
  36252. this.disabled = false;
  36253. },
  36254. /**
  36255. * The base implementation just sets the plugin's `disabled` flag to `true`
  36256. *
  36257. * Plugin subclasses which need more complex processing may implement an overriding implementation.
  36258. * @member Ext.plugin.Abstract
  36259. */
  36260. disable: function() {
  36261. this.disabled = true;
  36262. }
  36263. });
  36264. /**
  36265. * @class Ext.Widget
  36266. */
  36267. Ext.define('Ext.overrides.Widget', {
  36268. override: 'Ext.Widget',
  36269. uses: [
  36270. 'Ext.Component',
  36271. 'Ext.layout.component.Auto'
  36272. ],
  36273. $configStrict: false,
  36274. isComponent: true,
  36275. liquidLayout: true,
  36276. // in Ext JS the rendered flag is set as soon as a component has its element. Since
  36277. // widgets always have an element when constructed, they are always considered to be
  36278. // "rendered"
  36279. rendered: true,
  36280. rendering: true,
  36281. config: {
  36282. renderTo: null
  36283. },
  36284. constructor: function(config) {
  36285. var me = this,
  36286. renderTo;
  36287. me.callParent([
  36288. config
  36289. ]);
  36290. // initialize the component layout
  36291. me.getComponentLayout();
  36292. renderTo = me.getRenderTo();
  36293. if (renderTo) {
  36294. me.render(renderTo);
  36295. }
  36296. },
  36297. addClsWithUI: function(cls) {
  36298. this.el.addCls(cls);
  36299. },
  36300. afterComponentLayout: Ext.emptyFn,
  36301. updateLayout: function() {
  36302. var owner = this.getRefOwner();
  36303. if (owner) {
  36304. owner.updateLayout();
  36305. }
  36306. },
  36307. destroy: function() {
  36308. var me = this,
  36309. ownerCt = me.ownerCt;
  36310. if (ownerCt && ownerCt.remove) {
  36311. ownerCt.remove(me, false);
  36312. }
  36313. me.callParent();
  36314. },
  36315. finishRender: function() {
  36316. this.rendering = false;
  36317. this.initBindable();
  36318. this.initKeyMap();
  36319. },
  36320. getAnimationProps: function() {
  36321. // see Ext.util.Animate mixin
  36322. return {};
  36323. },
  36324. getComponentLayout: function() {
  36325. var me = this,
  36326. layout = me.componentLayout;
  36327. if (!layout) {
  36328. layout = me.componentLayout = new Ext.layout.component.Auto();
  36329. layout.setOwner(me);
  36330. }
  36331. return layout;
  36332. },
  36333. getEl: function() {
  36334. return this.element;
  36335. },
  36336. /**
  36337. * @private
  36338. * Needed for when widget is rendered into a grid cell. The class to add to the cell element.
  36339. * @member Ext.Widget
  36340. */
  36341. getTdCls: function() {
  36342. return Ext.baseCSSPrefix + this.getTdType() + '-' + (this.ui || 'default') + '-cell';
  36343. },
  36344. /**
  36345. * @private
  36346. * Partner method to {@link #getTdCls}.
  36347. *
  36348. * Returns the base type for the component. Defaults to return `this.xtype`, but
  36349. * All derived classes of {@link Ext.form.field.Text TextField} can return the type 'textfield',
  36350. * and all derived classes of {@link Ext.button.Button Button} can return the type 'button'
  36351. * @member Ext.Widget
  36352. */
  36353. getTdType: function() {
  36354. return this.xtype;
  36355. },
  36356. getItemId: function() {
  36357. // needed by ComponentQuery
  36358. return this.itemId || this.id;
  36359. },
  36360. getSizeModel: function() {
  36361. return Ext.Component.prototype.getSizeModel.apply(this, arguments);
  36362. },
  36363. onAdded: function(container, pos, instanced) {
  36364. var me = this;
  36365. me.ownerCt = container;
  36366. me.onInheritedAdd(me, instanced);
  36367. // this component is no longer detached from the body
  36368. me.isDetached = false;
  36369. },
  36370. onRemoved: function(destroying) {
  36371. this.onInheritedRemove(destroying);
  36372. this.ownerCt = this.ownerLayout = null;
  36373. },
  36374. parseBox: function(box) {
  36375. return Ext.Element.parseBox(box);
  36376. },
  36377. removeClsWithUI: function(cls) {
  36378. this.el.removeCls(cls);
  36379. },
  36380. render: function(container, position) {
  36381. var me = this,
  36382. element = me.element,
  36383. proto = Ext.Component.prototype,
  36384. nextSibling;
  36385. if (!me.ownerCt || me.floating) {
  36386. if (Ext.scopeCss) {
  36387. element.addCls(proto.rootCls);
  36388. }
  36389. element.addCls(proto.borderBoxCls);
  36390. }
  36391. if (position) {
  36392. nextSibling = container.childNodes[position];
  36393. if (nextSibling) {
  36394. Ext.fly(container).insertBefore(element, nextSibling);
  36395. return;
  36396. }
  36397. }
  36398. Ext.fly(container).appendChild(element);
  36399. me.finishRender();
  36400. },
  36401. setPosition: function(x, y) {
  36402. this.el.setLocalXY(x, y);
  36403. },
  36404. up: function() {
  36405. return Ext.Component.prototype.up.apply(this, arguments);
  36406. },
  36407. isAncestor: function() {
  36408. return Ext.Component.prototype.isAncestor.apply(this, arguments);
  36409. },
  36410. onFocusEnter: function() {
  36411. return Ext.Component.prototype.onFocusEnter.apply(this, arguments);
  36412. },
  36413. onFocusLeave: function() {
  36414. return Ext.Component.prototype.onFocusLeave.apply(this, arguments);
  36415. },
  36416. isLayoutChild: function(candidate) {
  36417. var ownerCt = this.ownerCt;
  36418. return ownerCt ? (ownerCt === candidate || ownerCt.isLayoutChild(candidate)) : false;
  36419. },
  36420. privates: {
  36421. doAddListener: function(name, fn, scope, options, order, caller, manager) {
  36422. if (name == 'painted' || name == 'resize') {
  36423. this.element.doAddListener(name, fn, scope || this, options, order);
  36424. }
  36425. this.callParent([
  36426. name,
  36427. fn,
  36428. scope,
  36429. options,
  36430. order,
  36431. caller,
  36432. manager
  36433. ]);
  36434. },
  36435. doRemoveListener: function(name, fn, scope) {
  36436. if (name == 'painted' || name == 'resize') {
  36437. this.element.doRemoveListener(name, fn, scope);
  36438. }
  36439. this.callParent([
  36440. name,
  36441. fn,
  36442. scope
  36443. ]);
  36444. }
  36445. }
  36446. }, function(Cls) {
  36447. var prototype = Cls.prototype;
  36448. if (Ext.isIE9m) {
  36449. // Since IE8/9 don't not support Object.defineProperty correctly we can't add the reference
  36450. // nodes on demand, so we just fall back to adding all references up front.
  36451. prototype.addElementReferenceOnDemand = prototype.addElementReference;
  36452. }
  36453. });
  36454. /**
  36455. * @class Ext.Progress
  36456. *
  36457. * @example
  36458. * Ext.create({
  36459. * xtype: 'grid',
  36460. * title: 'Simpsons',
  36461. * store: {
  36462. * data: [
  36463. * { name: 'Lisa', progress: .159 },
  36464. * { name: 'Bart', progress: .216 },
  36465. * { name: 'Homer', progress: .55 },
  36466. * { name: 'Maggie', progress: .167 },
  36467. * { name: 'Marge', progress: .145 }
  36468. * ]
  36469. * },
  36470. * columns: [
  36471. * { text: 'Name', dataIndex: 'name' },
  36472. * {
  36473. * text: 'Progress',
  36474. * xtype: 'widgetcolumn',
  36475. * width: 120,
  36476. * dataIndex: 'progress',
  36477. * widget: {
  36478. * xtype: 'progress'
  36479. * }
  36480. * }
  36481. * ],
  36482. * height: 200,
  36483. * width: 400,
  36484. * renderTo: Ext.getBody()
  36485. * });
  36486. */
  36487. Ext.define('Ext.overrides.Progress', {
  36488. override: 'Ext.Progress',
  36489. config: {
  36490. ui: 'default'
  36491. },
  36492. updateWidth: function(width, oldWidth) {
  36493. var me = this;
  36494. me.callParent([
  36495. width,
  36496. oldWidth
  36497. ]);
  36498. width -= me.element.getBorderWidth('lr');
  36499. me.backgroundEl.setWidth(width);
  36500. me.textEl.setWidth(width);
  36501. },
  36502. privates: {
  36503. startBarAnimation: function(o) {
  36504. this.barEl.animate(o);
  36505. },
  36506. stopBarAnimation: function() {
  36507. this.barEl.stopAnimation();
  36508. }
  36509. }
  36510. });
  36511. /**
  36512. * @class Ext.mixin.Focusable
  36513. */
  36514. Ext.define('Ext.overrides.mixin.Focusable', {
  36515. override: 'Ext.Component',
  36516. /**
  36517. * @cfg {String} [focusCls='focus'] CSS class suffix that will be used to
  36518. * compose the CSS class name that will be added to Component's {@link #focusClsEl},
  36519. * and removed when Component blurs.
  36520. *
  36521. * **Note** that this is not a full CSS class name; this suffix will be combined
  36522. * with component's UI class via {@link #addClsWithUI} and {@link #removeClsWithUI} methods.
  36523. */
  36524. focusCls: 'focus',
  36525. /**
  36526. * Try to focus this component.
  36527. *
  36528. * If this component is disabled, a close relation will be targeted for focus instead
  36529. * to keep focus localized for keyboard users.
  36530. * @param {Mixed} [selectText] If applicable, `true` to also select all the text in this component, or an array consisting of start and end (defaults to start) position of selection.
  36531. * @param {Boolean/Number} [delay] Delay the focus this number of milliseconds (true for 10 milliseconds).
  36532. * @param {Function} [callback] Only needed if the `delay` parameter is used. A function to call upon focus.
  36533. * @param {Function} [scope] Only needed if the `delay` parameter is used. The scope (`this` reference) in which to execute the callback.
  36534. * @return {Ext.Component} The focused Component. Usually `this` Component. Some Containers may
  36535. * delegate focus to a descendant Component ({@link Ext.window.Window Window}s can do this through their
  36536. * {@link Ext.window.Window#defaultFocus defaultFocus} config option. If this component is disabled, a closely
  36537. * related component will be focused and that will be returned.
  36538. */
  36539. focus: function(selectText, delay, callback, scope) {
  36540. var me = this,
  36541. containerScrollTop;
  36542. if ((!me.focusable && !me.isContainer) || me.destroyed || me.destroying) {
  36543. return me;
  36544. }
  36545. // If delay is wanted, queue a call to this function.
  36546. if (delay) {
  36547. me.getFocusTask().delay(Ext.isNumber(delay) ? delay : 10, me.focus, me, [
  36548. selectText,
  36549. false,
  36550. callback,
  36551. scope
  36552. ]);
  36553. return me;
  36554. }
  36555. // An immediate focus call must cancel any outstanding delayed focus calls.
  36556. me.cancelFocus();
  36557. if (me.floating && me.container && me.container.dom) {
  36558. containerScrollTop = me.container.dom.scrollTop;
  36559. }
  36560. // Core Focusable method will return true if focusing was attempted
  36561. if (me.mixins.focusable.focus.apply(me, arguments) !== false) {
  36562. if (callback) {
  36563. Ext.callback(callback, scope);
  36564. }
  36565. // Focusing a floating Component brings it to the front of its stack.
  36566. // this is performed by its zIndexManager. Pass preventFocus true to avoid recursion.
  36567. if (me.floating && containerScrollTop !== undefined) {
  36568. me.container.dom.scrollTop = containerScrollTop;
  36569. }
  36570. }
  36571. return me;
  36572. },
  36573. /**
  36574. * Cancel any deferred focus on this component
  36575. * @protected
  36576. */
  36577. cancelFocus: function() {
  36578. var me = this,
  36579. task = me.getFocusTask();
  36580. if (task) {
  36581. task.cancel();
  36582. }
  36583. },
  36584. /**
  36585. * @method
  36586. * Template method to do any pre-blur processing.
  36587. * @protected
  36588. * @param {Ext.event.Event} e The event object
  36589. */
  36590. beforeBlur: Ext.emptyFn,
  36591. /**
  36592. * @method
  36593. * Template method to do any post-blur processing.
  36594. * @protected
  36595. * @param {Ext.event.Event} e The event object
  36596. */
  36597. postBlur: Ext.emptyFn,
  36598. /**
  36599. * @method
  36600. * Template method to do any pre-focus processing.
  36601. * @protected
  36602. * @param {Ext.event.Event} e The event object
  36603. */
  36604. beforeFocus: Ext.emptyFn,
  36605. /**
  36606. * @method
  36607. * Template method to do any post-focus processing.
  36608. * @protected
  36609. * @param {Ext.event.Event} e The event object
  36610. */
  36611. postFocus: Ext.emptyFn,
  36612. onFocusEnter: function(e) {
  36613. var me = this;
  36614. if (me.destroying || me.destroyed) {
  36615. return;
  36616. }
  36617. // Focusing must being a floating component to the front.
  36618. // Only bring to front if this component is not the manager's
  36619. // topmost component (may be a result of focusOnToFront).
  36620. if (me.floating && me !== me.zIndexManager.getActive()) {
  36621. me.toFront(true);
  36622. }
  36623. me.callParent([
  36624. e
  36625. ]);
  36626. },
  36627. destroyFocusable: function() {
  36628. var me = this;
  36629. // Calling cancelFocus() will assign focusTask property,
  36630. // which we don't want during destruction
  36631. if (me.focusTask) {
  36632. me.focusTask.stop(me.focus, me);
  36633. }
  36634. me.callParent();
  36635. },
  36636. privates: {
  36637. addFocusCls: function(e) {
  36638. var me = this,
  36639. focusCls = me.focusCls,
  36640. el;
  36641. if (focusCls) {
  36642. el = me.getFocusClsEl(e);
  36643. if (el) {
  36644. el.addCls(me.addClsWithUI(focusCls, true));
  36645. }
  36646. }
  36647. },
  36648. removeFocusCls: function(e) {
  36649. var me = this,
  36650. focusCls = me.focusCls,
  36651. el;
  36652. if (focusCls) {
  36653. el = me.getFocusClsEl(e);
  36654. if (el) {
  36655. el.removeCls(me.removeClsWithUI(focusCls, true));
  36656. }
  36657. }
  36658. },
  36659. /**
  36660. * @private
  36661. */
  36662. getFocusTask: function() {
  36663. if (!this.focusTask) {
  36664. this.focusTask = Ext.focusTask;
  36665. }
  36666. return this.focusTask;
  36667. },
  36668. updateMaskState: function(state, mask) {
  36669. var me = this,
  36670. ariaEl = me.ariaEl.dom,
  36671. value;
  36672. if (state) {
  36673. me.disableTabbing();
  36674. me.setMasked(true);
  36675. if (ariaEl) {
  36676. ariaEl.setAttribute('aria-busy', 'true');
  36677. // It is possible that ariaEl already has aria-describedby attribute;
  36678. // in that case we need to save it to restore later.
  36679. value = ariaEl.getAttribute('aria-describedby');
  36680. if (value) {
  36681. me._savedAriaDescribedBy = value;
  36682. }
  36683. ariaEl.setAttribute('aria-describedby', mask.ariaEl.id);
  36684. }
  36685. } else {
  36686. me.enableTabbing();
  36687. me.setMasked(false);
  36688. if (ariaEl) {
  36689. ariaEl.removeAttribute('aria-busy');
  36690. value = ariaEl.getAttribute('aria-describedby');
  36691. ariaEl.removeAttribute('aria-describedby');
  36692. if (value === mask.ariaEl.id && me._savedAriaDescribedBy) {
  36693. ariaEl.setAttribute('aria-describedby', me._savedAriaDescribedBy);
  36694. delete me._savedAriaDescribedBy;
  36695. }
  36696. }
  36697. }
  36698. }
  36699. }
  36700. }, function() {
  36701. // One global DelayedTask to assign focus
  36702. // So that the last focus call wins.
  36703. if (!Ext.focusTask) {
  36704. Ext.focusTask = new Ext.util.DelayedTask();
  36705. }
  36706. });
  36707. Ext.define('Ext.overrides.app.domain.Component', {
  36708. override: 'Ext.app.domain.Component',
  36709. requires: [
  36710. 'Ext.Component'
  36711. ]
  36712. }, function(ComponentDomain) {
  36713. // The core Component domain monitors events on the Ext.Widget class
  36714. // in Ext Components are not widgets so we need to monitor Ext.Component as well.
  36715. ComponentDomain.monitor(Ext.Component);
  36716. });
  36717. // This is an override because it must be loaded very early, possibly before Ext.app.Application
  36718. // in dev mode so that Ext.application() can be called.
  36719. // Being an override also ensures that it is only included in a built app if Ext.app.Application
  36720. // is present.
  36721. //
  36722. // @override Ext.app.Application
  36723. /**
  36724. * @method application
  36725. * @member Ext
  36726. * Loads Ext.app.Application class and starts it up with given configuration after the
  36727. * page is ready.
  36728. *
  36729. * See `Ext.app.Application` for details.
  36730. *
  36731. * @param {Object/String} config Application config object or name of a class derived
  36732. * from Ext.app.Application.
  36733. */
  36734. Ext.application = function(config) {
  36735. var createApp = function(App) {
  36736. // This won't be called until App class has been created.
  36737. Ext.onReady(function() {
  36738. var Viewport = Ext.viewport;
  36739. Viewport = Viewport && Viewport['Viewport'];
  36740. if (Viewport && Viewport.setup) {
  36741. Viewport.setup(App.prototype.config.viewport);
  36742. }
  36743. Ext.app.Application.instance = new App();
  36744. });
  36745. };
  36746. if (typeof config === "string") {
  36747. Ext.require(config, function() {
  36748. createApp(Ext.ClassManager.get(config));
  36749. });
  36750. } else {
  36751. config = Ext.apply({
  36752. extend: 'Ext.app.Application'
  36753. }, // can be replaced by config!
  36754. config);
  36755. // We have to process "paths" before creating Application class,
  36756. // or `requires` won't work.
  36757. Ext.app.setupPaths(config.name, config.appFolder, config.paths);
  36758. config['paths processed'] = true;
  36759. // Let Ext.define do the hard work but don't assign a class name.
  36760. Ext.define(config.name + ".$application", config, function() {
  36761. createApp(this);
  36762. });
  36763. }
  36764. };
  36765. /**
  36766. * @class Ext.app.Application
  36767. */
  36768. Ext.define('Ext.overrides.app.Application', {
  36769. override: 'Ext.app.Application',
  36770. uses: [
  36771. 'Ext.tip.QuickTipManager'
  36772. ],
  36773. // @cmd-auto-dependency {aliasPrefix: "view.", mvc: true, requires: ["Ext.plugin.Viewport"]}
  36774. /**
  36775. * @cfg {Boolean/String} [autoCreateViewport=false]
  36776. * @deprecated 5.1 Instead use {@link #mainView}
  36777. * @member Ext.app.Application
  36778. */
  36779. autoCreateViewport: false,
  36780. config: {
  36781. /**
  36782. * @cfg {Boolean} enableQuickTips
  36783. * @deprecated 6.2.0 Use {@link #quickTips}.
  36784. */
  36785. enableQuickTips: null
  36786. },
  36787. /**
  36788. * @cfg {Boolean} quickTips
  36789. * True to automatically set up Ext.tip.QuickTip support.
  36790. *
  36791. * @since 6.2.0
  36792. */
  36793. quickTips: true,
  36794. updateEnableQuickTips: function(enableQuickTips) {
  36795. this.setQuickTips(enableQuickTips);
  36796. },
  36797. applyMainView: function(mainView) {
  36798. var view, proto, config, protoPlugins, configPlugins;
  36799. if (typeof mainView === 'string') {
  36800. view = this.getView(mainView);
  36801. config = {};
  36802. } else {
  36803. config = mainView;
  36804. view = Ext.ClassManager.getByConfig(mainView);
  36805. }
  36806. proto = view.prototype;
  36807. if (!proto.isViewport) {
  36808. // Need to copy over any plugins defined on the prototype and on the config.
  36809. protoPlugins = Ext.Array.from(proto.plugins);
  36810. configPlugins = Ext.Array.from(config.plugins);
  36811. config = Ext.apply({}, config);
  36812. config.plugins = [
  36813. 'viewport'
  36814. ].concat(protoPlugins, configPlugins);
  36815. }
  36816. return view.create(config);
  36817. },
  36818. getDependencies: function(cls, data, requires) {
  36819. var Controller = Ext.app.Controller,
  36820. proto = cls.prototype,
  36821. namespace = data.$namespace,
  36822. viewportClass = data.autoCreateViewport;
  36823. if (viewportClass) {
  36824. if (!namespace) {
  36825. Ext.raise("[Ext.app.Application] Can't resolve namespace for " + data.$className + ", did you forget to specify 'name' property?");
  36826. }
  36827. if (viewportClass === true) {
  36828. viewportClass = 'Viewport';
  36829. } else {
  36830. requires.push('Ext.plugin.Viewport');
  36831. }
  36832. Controller.processDependencies(proto, requires, namespace, 'view', viewportClass);
  36833. }
  36834. },
  36835. onBeforeLaunch: function() {
  36836. var me = this,
  36837. autoCreateViewport = me.autoCreateViewport;
  36838. if (me.getQuickTips()) {
  36839. me.initQuickTips();
  36840. }
  36841. if (autoCreateViewport) {
  36842. me.initViewport();
  36843. }
  36844. this.callParent(arguments);
  36845. },
  36846. getViewportName: function() {
  36847. var name = null,
  36848. autoCreate = this.autoCreateViewport;
  36849. if (autoCreate) {
  36850. name = (autoCreate === true) ? 'Viewport' : autoCreate;
  36851. }
  36852. return name;
  36853. },
  36854. initViewport: function() {
  36855. this.setMainView(this.getViewportName());
  36856. },
  36857. initQuickTips: function() {
  36858. Ext.tip.QuickTipManager.init();
  36859. }
  36860. });
  36861. Ext.define('Ext.overrides.app.domain.View', {
  36862. override: 'Ext.app.domain.View',
  36863. requires: [
  36864. 'Ext.Component'
  36865. ],
  36866. constructor: function(controller) {
  36867. this.callParent([
  36868. controller
  36869. ]);
  36870. // The base class handles Ext.Widget, which encompasses
  36871. // component for modern, so we only need the override here.
  36872. this.monitoredClasses.push(Ext.Component);
  36873. }
  36874. });
  36875. /**
  36876. * @class Ext.dom.Helper
  36877. */
  36878. Ext.define('Ext.overrides.dom.Helper', (function() {
  36879. var tableRe = /^(?:table|thead|tbody|tr|td)$/i,
  36880. tableElRe = /td|tr|tbody|thead/i,
  36881. ts = '<table>',
  36882. te = '</table>',
  36883. tbs = ts + '<tbody>',
  36884. tbe = '</tbody>' + te,
  36885. trs = tbs + '<tr>',
  36886. tre = '</tr>' + tbe;
  36887. return {
  36888. override: 'Ext.dom.Helper',
  36889. ieInsertHtml: function(where, el, html) {
  36890. var frag = null;
  36891. // IE's incomplete table implementation: http://www.ericvasilik.com/2006/07/code-karma.html
  36892. if (Ext.isIE9m && tableRe.test(el.tagName)) {
  36893. frag = this.insertIntoTable(el.tagName.toLowerCase(), where, el, html);
  36894. }
  36895. return frag;
  36896. },
  36897. ieOverwrite: function(el, html) {
  36898. // IE Inserting HTML into a table/tbody/tr requires extra processing:
  36899. // http://www.ericvasilik.com/2006/07/code-karma.html
  36900. if (Ext.isIE9m && tableRe.test(el.tagName)) {
  36901. // Clearing table elements requires removal of all elements.
  36902. while (el.firstChild) {
  36903. el.removeChild(el.firstChild);
  36904. }
  36905. if (html) {
  36906. return this.insertHtml('afterbegin', el, html);
  36907. }
  36908. }
  36909. },
  36910. ieTable: function(depth, openingTags, htmlContent, closingTags) {
  36911. var i = -1,
  36912. el = this.detachedDiv,
  36913. ns, nx;
  36914. el.innerHTML = [
  36915. openingTags,
  36916. htmlContent,
  36917. closingTags
  36918. ].join('');
  36919. while (++i < depth) {
  36920. el = el.firstChild;
  36921. }
  36922. // If the result is multiple siblings, then encapsulate them into one fragment.
  36923. ns = el.nextSibling;
  36924. if (ns) {
  36925. ns = el;
  36926. el = document.createDocumentFragment();
  36927. while (ns) {
  36928. nx = ns.nextSibling;
  36929. el.appendChild(ns);
  36930. ns = nx;
  36931. }
  36932. }
  36933. return el;
  36934. },
  36935. /**
  36936. * @private
  36937. * @method insertIntoTable
  36938. * @member Ext.dom.Helper
  36939. * workaround for broken table implementation in IE9m
  36940. * http://www.ericvasilik.com/2006/07/code-karma.html
  36941. */
  36942. insertIntoTable: function(tag, where, destinationEl, html) {
  36943. var node, before,
  36944. bb = where === 'beforebegin',
  36945. ab = where === 'afterbegin',
  36946. be = where === 'beforeend',
  36947. ae = where === 'afterend';
  36948. if (tag === 'td' && (ab || be) || !tableElRe.test(tag) && (bb || ae)) {
  36949. return null;
  36950. }
  36951. before = bb ? destinationEl : ae ? destinationEl.nextSibling : ab ? destinationEl.firstChild : null;
  36952. if (bb || ae) {
  36953. destinationEl = destinationEl.parentNode;
  36954. }
  36955. if (tag === 'td' || (tag === 'tr' && (be || ab))) {
  36956. node = this.ieTable(4, trs, html, tre);
  36957. } else if (((tag === 'tbody' || tag === 'thead') && (be || ab)) || (tag === 'tr' && (bb || ae))) {
  36958. node = this.ieTable(3, tbs, html, tbe);
  36959. } else {
  36960. node = this.ieTable(2, ts, html, te);
  36961. }
  36962. destinationEl.insertBefore(node, before);
  36963. return node;
  36964. }
  36965. };
  36966. })());
  36967. /**
  36968. * @class Ext.list.AbstractTreeItem
  36969. */
  36970. Ext.define('Ext.overrides.list.AbstractTreeItem', {
  36971. override: 'Ext.list.AbstractTreeItem',
  36972. // This config is used by TreeIten, however to support the generic API (RootItem),
  36973. // we need this up here.
  36974. config: {
  36975. floated: null
  36976. }
  36977. });
  36978. /**
  36979. * @class Ext.list.TreeItem
  36980. */
  36981. Ext.define('Ext.overrides.list.TreeItem', {
  36982. override: 'Ext.list.TreeItem',
  36983. // Implement a setter.
  36984. // There *is* no "floated" config in Classic.
  36985. // We're still an inner item, we just get put inside a Container.
  36986. setFloated: function(floated) {
  36987. var me = this,
  36988. el = me.element,
  36989. placeholder = me.placeholder,
  36990. node, wasExpanded;
  36991. if (me.treeItemFloated !== floated) {
  36992. if (floated) {
  36993. placeholder = el.clone(false, true);
  36994. // shallow, asDom
  36995. placeholder.id += '-placeholder';
  36996. // avoid duplicate id
  36997. me.placeholder = Ext.get(placeholder);
  36998. me.wasExpanded = me.getExpanded();
  36999. me.setExpanded(true);
  37000. el.addCls(me.floatedCls);
  37001. el.dom.parentNode.insertBefore(placeholder, el.dom);
  37002. me.floater = me.createFloater();
  37003. }
  37004. // toolkit-specific
  37005. else if (placeholder) {
  37006. wasExpanded = me.wasExpanded;
  37007. node = me.getNode();
  37008. me.setExpanded(wasExpanded);
  37009. if (!wasExpanded && node.isExpanded()) {
  37010. // If we have been floating and expanded a child, we may have been
  37011. // expanded as part of the ancestors. Attempt to restore state.
  37012. me.preventAnimation = true;
  37013. node.collapse();
  37014. me.preventAnimation = false;
  37015. }
  37016. me.floater.remove(me, false);
  37017. // don't destroy
  37018. el.removeCls(me.floatedCls);
  37019. placeholder.dom.parentNode.insertBefore(el.dom, placeholder.dom);
  37020. placeholder.destroy();
  37021. me.floater.destroy();
  37022. me.placeholder = me.floater = null;
  37023. }
  37024. // Use an internal property name. We are NOT really floated
  37025. me.treeItemFloated = floated;
  37026. }
  37027. },
  37028. getFloated: function() {
  37029. return this.treeItemFloated;
  37030. },
  37031. runAnimation: function(animation) {
  37032. return this.itemContainer.addAnimation(animation);
  37033. },
  37034. stopAnimation: function(animation) {
  37035. animation.jumpToEnd();
  37036. },
  37037. privates: {
  37038. createFloater: function() {
  37039. var me = this,
  37040. owner = me.getOwner(),
  37041. ownerTree = me.up('treelist'),
  37042. floater,
  37043. toolElement = me.getToolElement(),
  37044. expandedWidth = ownerTree.expandedWidth,
  37045. defaultListWidth = ownerTree.defaultListWidth;
  37046. if (expandedWidth === null) {
  37047. expandedWidth = defaultListWidth;
  37048. }
  37049. me.floater = floater = new Ext.container.Container({
  37050. cls: ownerTree.self.prototype.element.cls + ' ' + ownerTree.uiPrefix + ownerTree.getUi() + ' ' + Ext.baseCSSPrefix + 'treelist-floater',
  37051. floating: true,
  37052. // We do not get element resize events on IE8
  37053. // so fall back to 6.0.1 sizing to 200 wide.
  37054. width: Ext.isIE8 ? defaultListWidth : (expandedWidth - toolElement.getWidth()),
  37055. shadow: false,
  37056. hidden: true,
  37057. renderTo: Ext.getBody(),
  37058. listeners: {
  37059. element: 'el',
  37060. click: function(e) {
  37061. return owner.onClick(e);
  37062. }
  37063. }
  37064. });
  37065. floater.add(me);
  37066. floater.show();
  37067. floater.el.alignTo(toolElement, 'tr?');
  37068. return floater;
  37069. }
  37070. }
  37071. });
  37072. /**
  37073. * @class Ext.list.Tree
  37074. */
  37075. Ext.define('Ext.overrides.list.Tree', {
  37076. override: 'Ext.list.Tree',
  37077. canMeasure: true,
  37078. constructor: function(config) {
  37079. this.callParent([
  37080. config
  37081. ]);
  37082. // Track size so that we can track the expanded size
  37083. // for use by the floated state of items when in micro mode.
  37084. // Browsers where this event is not supported, fall back to a width
  37085. // of 200px for floated tree items.
  37086. if (!Ext.isIE8) {
  37087. this.element.on('resize', 'onElResize', this);
  37088. }
  37089. },
  37090. beforeLayout: function() {
  37091. this.syncIconSize();
  37092. },
  37093. onElResize: function(el, details) {
  37094. if (!this.getMicro() && this.canMeasure) {
  37095. this.expandedWidth = details.width;
  37096. }
  37097. },
  37098. privates: {
  37099. defaultListWidth: 200,
  37100. expandedWidth: null
  37101. }
  37102. });
  37103. /**
  37104. * @class Ext.sparkline.Base
  37105. */
  37106. Ext.define('Ext.override.sparkline.Base', {
  37107. override: 'Ext.sparkline.Base',
  37108. statics: {
  37109. constructTip: function() {
  37110. return new Ext.tip['ToolTip']({
  37111. id: 'sparklines-tooltip',
  37112. showDelay: 0,
  37113. dismissDelay: 0,
  37114. hideDelay: 400
  37115. });
  37116. }
  37117. },
  37118. onMouseMove: function(e) {
  37119. this.getSharedTooltip().triggerEvent = e;
  37120. this.callParent([
  37121. e
  37122. ]);
  37123. },
  37124. onMouseLeave: function(e) {
  37125. this.callParent([
  37126. e
  37127. ]);
  37128. this.getSharedTooltip().target = null;
  37129. },
  37130. privates: {
  37131. hideTip: function() {
  37132. var tip = this.getSharedTooltip();
  37133. tip.target = null;
  37134. tip.hide();
  37135. },
  37136. showTip: function() {
  37137. var tip = this.getSharedTooltip();
  37138. tip.target = this.el;
  37139. tip.onTargetOver(tip.triggerEvent);
  37140. }
  37141. }
  37142. }, function(Cls) {
  37143. // If we are on a VML platform (IE8 - TODO: remove this when that retires)...
  37144. if (!Ext.supports.Canvas) {
  37145. Cls.prototype.element = {
  37146. tag: 'span',
  37147. reference: 'element',
  37148. listeners: {
  37149. mouseenter: 'onMouseEnter',
  37150. mouseleave: 'onMouseLeave',
  37151. mousemove: 'onMouseMove'
  37152. },
  37153. style: {
  37154. display: 'inline-block',
  37155. position: 'relative',
  37156. overflow: 'hidden',
  37157. margin: '0px',
  37158. padding: '0px',
  37159. verticalAlign: 'top',
  37160. cursor: 'default'
  37161. },
  37162. children: [
  37163. {
  37164. tag: 'svml:group',
  37165. reference: 'groupEl',
  37166. coordorigin: '0 0',
  37167. coordsize: '0 0',
  37168. style: 'position:absolute;width:0;height:0;pointer-events:none'
  37169. }
  37170. ]
  37171. };
  37172. }
  37173. });
  37174. /**
  37175. * @class Ext.app.ViewController
  37176. */
  37177. /**
  37178. * @method beforeRender
  37179. * @template
  37180. * Template method called by the owning component's
  37181. * {@link Ext.Component#method-beforeRender beforeRender} method.
  37182. * @param {Ext.Component} component The owner component attached to the
  37183. * ViewController
  37184. */
  37185. /**
  37186. * @method afterRender
  37187. * @template
  37188. * Template method called by the owning component's
  37189. * {@link Ext.Component#method-afterRender afterRender} method.
  37190. * @param {Ext.Component} component The owner component attached to the
  37191. * ViewController
  37192. */
  37193. /**
  37194. * @method boxReady
  37195. * @template
  37196. * Template method called by the owning component's
  37197. * {@link Ext.Component#method-onBoxReady onBoxReady} method.
  37198. * @param {Ext.Component} component The owner component attached to the
  37199. * ViewController
  37200. */
  37201. /**
  37202. * @class Ext.form.field.Checkbox
  37203. */
  37204. Ext.define(null, {
  37205. override: 'Ext.form.field.Checkbox',
  37206. compatibility: Ext.isIE8,
  37207. // IE8 does not support change event but it has propertychange which is even better
  37208. changeEventName: 'propertychange',
  37209. onChangeEvent: function(e) {
  37210. // IE8 propertychange fires for *any* property change but we're only interested in checked
  37211. // We also don't want to react to propertychange fired as the result of assigning
  37212. // checked property in setRawValue().
  37213. if (this.duringSetRawValue || e.browserEvent.propertyName !== 'checked') {
  37214. return;
  37215. }
  37216. this.callParent([
  37217. e
  37218. ]);
  37219. },
  37220. updateCheckedCls: function(checked) {
  37221. var me = this,
  37222. displayEl = me.displayEl;
  37223. me.callParent([
  37224. checked
  37225. ]);
  37226. // IE8 has a bug with font icons and pseudo-elements
  37227. if (displayEl && checked !== me.lastValue) {
  37228. displayEl.repaint();
  37229. }
  37230. }
  37231. });
  37232. /**
  37233. * @class Ext.form.field.Radio
  37234. */
  37235. Ext.define(null, {
  37236. override: 'Ext.form.field.Radio',
  37237. compatibility: Ext.isIE8,
  37238. getSubTplData: function(fieldData) {
  37239. var data = this.callParent([
  37240. fieldData
  37241. ]);
  37242. // Rendering a radio button with checked attribute
  37243. // will have a curious side effect in IE8: the DOM
  37244. // node will have checked property set to `true` but
  37245. // radio group (radios with the same name attribute)
  37246. // will behave as if no radio is checked in the group;
  37247. // tabbing into the group will select first or last
  37248. // button instead of the checked one.
  37249. // So instead of rendering the attribute we will set
  37250. // checked value in the DOM after rendering. Apparently
  37251. // such a tiny nudge is enough for the browser to behave.
  37252. delete data.checked;
  37253. return data;
  37254. },
  37255. afterRender: function() {
  37256. this.callParent();
  37257. if (this.checked) {
  37258. this.inputEl.dom.checked = true;
  37259. }
  37260. },
  37261. onChange: function(newValue, oldValue) {
  37262. // We don't need to bother updating other radio buttons in IE8
  37263. // since it will fire propertychange event on any change, not only false -> true.
  37264. // This is unlike standard compliant browsers, see main class.
  37265. this.callSuper([
  37266. newValue,
  37267. oldValue
  37268. ]);
  37269. }
  37270. });
  37271. /**
  37272. * @class Ext.scroll.Scroller
  37273. */
  37274. Ext.define(null, {
  37275. override: 'Ext.scroll.Scroller',
  37276. compatibility: Ext.isIE8,
  37277. privates: {
  37278. // Important note: this code had to be copied as a whole
  37279. // because the scrollLeft assignment trickery only works
  37280. // reliably when it is done within the same function context.
  37281. doScrollTo: function(x, y, animate) {
  37282. var me = this,
  37283. element = me.getScrollElement(),
  37284. maxPosition, dom, to, xInf, yInf, ret, deferred, callback;
  37285. if (element && !element.destroyed) {
  37286. dom = element.dom;
  37287. xInf = (x === Infinity);
  37288. yInf = (y === Infinity);
  37289. if (xInf || yInf) {
  37290. maxPosition = me.getMaxPosition();
  37291. if (xInf) {
  37292. x = maxPosition.x;
  37293. }
  37294. if (yInf) {
  37295. y = maxPosition.y;
  37296. }
  37297. }
  37298. if (x !== null) {
  37299. x = me.convertX(x);
  37300. }
  37301. if (animate) {
  37302. to = {};
  37303. if (y != null) {
  37304. to.scrollTop = y;
  37305. }
  37306. if (x != null) {
  37307. to.scrollLeft = x;
  37308. }
  37309. animate = Ext.mergeIf({
  37310. to: {
  37311. scrollTop: y,
  37312. scrollLeft: x
  37313. }
  37314. }, animate);
  37315. deferred = new Ext.Deferred();
  37316. callback = animate.callback;
  37317. animate.callback = function() {
  37318. if (callback) {
  37319. callback.call(animate.scope || Ext.global, arguments);
  37320. }
  37321. // The callback will be called if the element is destroyed
  37322. if (me.destroyed) {
  37323. deferred.reject();
  37324. } else {
  37325. deferred.resolve();
  37326. }
  37327. };
  37328. element.animate(animate);
  37329. ret = deferred.promise;
  37330. } else {
  37331. // When we need to assign both scrollTop and scrollLeft,
  37332. // IE8 might fire scroll event on the first assignment
  37333. // but not on the second; that behavior is unlike the other
  37334. // browsers which will wait for the second assignment
  37335. // to happen before firing the event. This leads to our
  37336. // scrollstart event firing prematurely, when the scrolling
  37337. // has not actually finished yet.
  37338. // To work around that, we ignore the first event and then
  37339. // force another one by assigning scrollLeft the second time.
  37340. if ((x != null && x !== 0) && y != null) {
  37341. me.deferDomScroll = true;
  37342. }
  37343. if (y != null) {
  37344. dom.scrollTop = y;
  37345. }
  37346. if (x != null) {
  37347. dom.scrollLeft = x;
  37348. }
  37349. if (me.deferDomScroll) {
  37350. me.deferDomScroll = false;
  37351. // Reading the DOM makes sure the second assignment
  37352. // will fire the event.
  37353. +dom.scrollLeft;
  37354. dom.scrollLeft = x;
  37355. +dom.scrollTop;
  37356. dom.scrollTop = y;
  37357. }
  37358. ret = Ext.Deferred.getCachedResolved();
  37359. }
  37360. // Our position object will need refreshing before returning.
  37361. me.positionDirty = true;
  37362. } else {
  37363. ret = Ext.Deferred.getCachedRejected();
  37364. }
  37365. return ret;
  37366. },
  37367. onDomScroll: function() {
  37368. var me = this;
  37369. if (me.deferDomScroll) {
  37370. return;
  37371. }
  37372. me.callParent();
  37373. }
  37374. }
  37375. });