ext-debug.js 1.2 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460
  1. /*
  2. This file is part of Ext JS 6.6.0.258
  3. Copyright (c) 2011-2018 Sencha Inc
  4. license: http://www.sencha.com/legal/sencha-software-license-agreement
  5. Contact: http://www.sencha.com/contact
  6. Commercial Usage
  7. Licensees holding valid commercial licenses may use this file in accordance with the Commercial
  8. Software License Agreement referenced above or, alternatively, in accordance with the
  9. terms contained in a written agreement between you and Sencha.
  10. If you are unsure which license is appropriate for your use, please contact the sales department
  11. at http://www.sencha.com/contact.
  12. Version: 6.6.0.258 Build date: 2018-06-19 05:16:53 (a26fc5ffb54acf6e1afd5f18c467b14161985898)
  13. */
  14. var Ext = Ext || {};
  15. (function(manifest){
  16. if(!Ext.manifest) {
  17. Ext.manifest = manifest;
  18. } else {
  19. for(var name in manifest) {
  20. Ext.manifest[name] = manifest[name];
  21. }
  22. }
  23. })({
  24. "paths": {
  25. "Ext": "../classic/classic/src",
  26. "Ext.AbstractManager": "../packages/core/src/AbstractManager.js",
  27. "Ext.Ajax": "../packages/core/src/Ajax.js",
  28. "Ext.AnimationQueue": "../packages/core/src/AnimationQueue.js",
  29. "Ext.ComponentManager": "../packages/core/src/ComponentManager.js",
  30. "Ext.ComponentQuery": "../packages/core/src/ComponentQuery.js",
  31. "Ext.Deferred": "../packages/core/src/Deferred.js",
  32. "Ext.Evented": "../packages/core/src/Evented.js",
  33. "Ext.Factory": "../packages/core/src/mixin/Factoryable.js",
  34. "Ext.GlobalEvents": "../packages/core/src/GlobalEvents.js",
  35. "Ext.Glyph": "../packages/core/src/Glyph.js",
  36. "Ext.JSON": "../packages/core/src/JSON.js",
  37. "Ext.Mixin": "../packages/core/src/class/Mixin.js",
  38. "Ext.Msg": "../classic/classic/src/window/MessageBox.js",
  39. "Ext.Progress": "../packages/core/src/Progress.js",
  40. "Ext.ProgressBase": "../packages/core/src/ProgressBase.js",
  41. "Ext.Promise": "../packages/core/src/Promise.js",
  42. "Ext.String.format": "../packages/core/src/Template.js",
  43. "Ext.TaskQueue": "../packages/core/src/TaskQueue.js",
  44. "Ext.Template": "../packages/core/src/Template.js",
  45. "Ext.Widget": "../packages/core/src/Widget.js",
  46. "Ext.XTemplate": "../packages/core/src/XTemplate.js",
  47. "Ext.app": "../packages/core/src/app",
  48. "Ext.data": "../packages/core/src/data",
  49. "Ext.direct": "../packages/core/src/direct",
  50. "Ext.dom": "../packages/core/src/dom",
  51. "Ext.dom.ButtonElement": "../classic/classic/src/dom/ButtonElement.js",
  52. "Ext.dom.Layer": "../classic/classic/src/dom/Layer.js",
  53. "Ext.drag": "../packages/core/src/drag",
  54. "Ext.event": "../packages/core/src/event",
  55. "Ext.event.publisher.MouseEnterLeave": "../classic/classic/src/event/publisher/MouseEnterLeave.js",
  56. "Ext.field": "../packages/core/src/field",
  57. "Ext.fx.Animation": "../packages/core/src/fx/Animation.js",
  58. "Ext.fx.Runner": "../packages/core/src/fx/Runner.js",
  59. "Ext.fx.State": "../packages/core/src/fx/State.js",
  60. "Ext.fx.animation": "../packages/core/src/fx/animation",
  61. "Ext.fx.easing": "../packages/core/src/fx/easing",
  62. "Ext.fx.runner": "../packages/core/src/fx/runner",
  63. "Ext.list": "../packages/core/src/list",
  64. "Ext.mixin": "../packages/core/src/mixin",
  65. "Ext.parse": "../packages/core/src/parse",
  66. "Ext.perf": "../packages/core/src/perf",
  67. "Ext.plugin.Abstract": "../packages/core/src/plugin/Abstract.js",
  68. "Ext.plugin.AbstractClipboard": "../packages/core/src/plugin/AbstractClipboard.js",
  69. "Ext.plugin.MouseEnter": "../packages/core/src/plugin/MouseEnter.js",
  70. "Ext.promise": "../packages/core/src/promise",
  71. "Ext.route": "../packages/core/src/route",
  72. "Ext.scroll.Scroller": "../packages/core/src/scroll/Scroller.js",
  73. "Ext.sparkline": "../packages/core/src/sparkline",
  74. "Ext.util": "../packages/core/src/util",
  75. "Ext.util.Animate": "../classic/classic/src/util/Animate.js",
  76. "Ext.util.ComponentDragger": "../classic/classic/src/util/ComponentDragger.js",
  77. "Ext.util.ElementContainer": "../classic/classic/src/util/ElementContainer.js",
  78. "Ext.util.Floating": "../classic/classic/src/util/Floating.js",
  79. "Ext.util.Format.format": "../packages/core/src/Template.js",
  80. "Ext.util.Memento": "../classic/classic/src/util/Memento.js",
  81. "Ext.util.ProtoElement": "../classic/classic/src/util/ProtoElement.js",
  82. "Ext.util.Queue": "../classic/classic/src/util/Queue.js",
  83. "Ext.util.Renderable": "../classic/classic/src/util/Renderable.js",
  84. "Ext.util.StoreHolder": "../classic/classic/src/util/StoreHolder.js",
  85. "Ext.util.TsvDecoder": "../packages/core/src/util/TSV.js"
  86. },
  87. "loadOrder": [
  88. {
  89. "path": "../packages/core/src/class/Mixin.js",
  90. "requires": [],
  91. "uses": [],
  92. "idx": 0
  93. },
  94. {
  95. "path": "../packages/core/src/util/DelayedTask.js",
  96. "requires": [],
  97. "uses": [
  98. 76
  99. ],
  100. "idx": 1
  101. },
  102. {
  103. "path": "../packages/core/src/util/Event.js",
  104. "requires": [
  105. 1
  106. ],
  107. "uses": [
  108. 24
  109. ],
  110. "idx": 2
  111. },
  112. {
  113. "path": "../packages/core/src/mixin/Identifiable.js",
  114. "requires": [],
  115. "uses": [],
  116. "idx": 3
  117. },
  118. {
  119. "path": "../packages/core/src/mixin/Observable.js",
  120. "requires": [
  121. 0,
  122. 2,
  123. 3
  124. ],
  125. "uses": [
  126. 51
  127. ],
  128. "idx": 4
  129. },
  130. {
  131. "path": "../packages/core/src/util/HashMap.js",
  132. "requires": [
  133. 4
  134. ],
  135. "uses": [],
  136. "idx": 5
  137. },
  138. {
  139. "path": "../packages/core/src/AbstractManager.js",
  140. "requires": [
  141. 5
  142. ],
  143. "uses": [],
  144. "idx": 6
  145. },
  146. {
  147. "path": "../packages/core/src/promise/Consequence.js",
  148. "requires": [],
  149. "uses": [
  150. 8
  151. ],
  152. "idx": 7
  153. },
  154. {
  155. "path": "../packages/core/src/promise/Deferred.js",
  156. "requires": [
  157. 7
  158. ],
  159. "uses": [
  160. 9
  161. ],
  162. "idx": 8
  163. },
  164. {
  165. "path": "../packages/core/src/promise/Promise.js",
  166. "requires": [
  167. 8
  168. ],
  169. "uses": [],
  170. "idx": 9
  171. },
  172. {
  173. "path": "../packages/core/src/Promise.js",
  174. "requires": [
  175. 9
  176. ],
  177. "uses": [
  178. 8
  179. ],
  180. "idx": 10
  181. },
  182. {
  183. "path": "../packages/core/src/Deferred.js",
  184. "requires": [
  185. 8,
  186. 10
  187. ],
  188. "uses": [
  189. 9
  190. ],
  191. "idx": 11
  192. },
  193. {
  194. "path": "../packages/core/src/mixin/Factoryable.js",
  195. "requires": [],
  196. "uses": [],
  197. "idx": 12
  198. },
  199. {
  200. "path": "../packages/core/src/data/request/Base.js",
  201. "requires": [
  202. 11,
  203. 12
  204. ],
  205. "uses": [
  206. 17
  207. ],
  208. "idx": 13
  209. },
  210. {
  211. "path": "../packages/core/src/data/flash/BinaryXhr.js",
  212. "requires": [],
  213. "uses": [
  214. 76
  215. ],
  216. "idx": 14
  217. },
  218. {
  219. "path": "../packages/core/src/data/request/Ajax.js",
  220. "requires": [
  221. 13,
  222. 14
  223. ],
  224. "uses": [],
  225. "idx": 15
  226. },
  227. {
  228. "path": "../packages/core/src/data/request/Form.js",
  229. "requires": [
  230. 13
  231. ],
  232. "uses": [],
  233. "idx": 16
  234. },
  235. {
  236. "path": "../packages/core/src/data/Connection.js",
  237. "requires": [
  238. 4,
  239. 11,
  240. 14,
  241. 15,
  242. 16
  243. ],
  244. "uses": [
  245. 12,
  246. 49
  247. ],
  248. "idx": 17
  249. },
  250. {
  251. "path": "../packages/core/src/Ajax.js",
  252. "requires": [
  253. 17
  254. ],
  255. "uses": [],
  256. "idx": 18
  257. },
  258. {
  259. "path": "../packages/core/src/AnimationQueue.js",
  260. "requires": [],
  261. "uses": [],
  262. "idx": 19
  263. },
  264. {
  265. "path": "../packages/core/src/mixin/Bufferable.js",
  266. "requires": [
  267. 0
  268. ],
  269. "uses": [],
  270. "idx": 20
  271. },
  272. {
  273. "path": "../packages/core/src/ComponentManager.js",
  274. "requires": [
  275. 20
  276. ],
  277. "uses": [
  278. 24,
  279. 36,
  280. 49,
  281. 88
  282. ],
  283. "idx": 21
  284. },
  285. {
  286. "path": "../packages/core/src/util/Operators.js",
  287. "requires": [],
  288. "uses": [],
  289. "idx": 22
  290. },
  291. {
  292. "path": "../packages/core/src/util/LruCache.js",
  293. "requires": [
  294. 5
  295. ],
  296. "uses": [],
  297. "idx": 23
  298. },
  299. {
  300. "path": "../packages/core/src/ComponentQuery.js",
  301. "requires": [
  302. 21,
  303. 22,
  304. 23
  305. ],
  306. "uses": [
  307. 92
  308. ],
  309. "idx": 24
  310. },
  311. {
  312. "path": "../packages/core/src/Evented.js",
  313. "requires": [
  314. 4
  315. ],
  316. "uses": [],
  317. "idx": 25
  318. },
  319. {
  320. "path": "../packages/core/src/util/Positionable.js",
  321. "requires": [],
  322. "uses": [
  323. 34,
  324. 49
  325. ],
  326. "idx": 26
  327. },
  328. {
  329. "path": "../packages/core/src/dom/UnderlayPool.js",
  330. "requires": [],
  331. "uses": [
  332. 49
  333. ],
  334. "idx": 27
  335. },
  336. {
  337. "path": "../packages/core/src/dom/Underlay.js",
  338. "requires": [
  339. 27
  340. ],
  341. "uses": [],
  342. "idx": 28
  343. },
  344. {
  345. "path": "../packages/core/src/dom/Shadow.js",
  346. "requires": [
  347. 28
  348. ],
  349. "uses": [],
  350. "idx": 29
  351. },
  352. {
  353. "path": "../packages/core/src/dom/Shim.js",
  354. "requires": [
  355. 28
  356. ],
  357. "uses": [],
  358. "idx": 30
  359. },
  360. {
  361. "path": "../packages/core/src/dom/ElementEvent.js",
  362. "requires": [
  363. 2
  364. ],
  365. "uses": [
  366. 37
  367. ],
  368. "idx": 31
  369. },
  370. {
  371. "path": "../packages/core/src/event/publisher/Publisher.js",
  372. "requires": [],
  373. "uses": [],
  374. "idx": 32
  375. },
  376. {
  377. "path": "../packages/core/src/util/Offset.js",
  378. "requires": [],
  379. "uses": [],
  380. "idx": 33
  381. },
  382. {
  383. "path": "../packages/core/src/util/Region.js",
  384. "requires": [
  385. 33
  386. ],
  387. "uses": [
  388. 49
  389. ],
  390. "idx": 34
  391. },
  392. {
  393. "path": "../packages/core/src/util/Point.js",
  394. "requires": [
  395. 34
  396. ],
  397. "uses": [],
  398. "idx": 35
  399. },
  400. {
  401. "path": "../packages/core/src/event/Event.js",
  402. "requires": [
  403. 35
  404. ],
  405. "uses": [
  406. 37,
  407. 76
  408. ],
  409. "idx": 36
  410. },
  411. {
  412. "path": "../packages/core/src/event/publisher/Dom.js",
  413. "requires": [
  414. 32,
  415. 36
  416. ],
  417. "uses": [
  418. 76
  419. ],
  420. "idx": 37
  421. },
  422. {
  423. "path": "../packages/core/src/event/publisher/Gesture.js",
  424. "requires": [
  425. 19,
  426. 35,
  427. 37
  428. ],
  429. "uses": [
  430. 36,
  431. 49,
  432. 296,
  433. 307,
  434. 308,
  435. 309,
  436. 310,
  437. 311,
  438. 312,
  439. 313,
  440. 314,
  441. 315,
  442. 316,
  443. 317
  444. ],
  445. "idx": 38
  446. },
  447. {
  448. "path": "../packages/core/src/mixin/Templatable.js",
  449. "requires": [
  450. 0
  451. ],
  452. "uses": [
  453. 49
  454. ],
  455. "idx": 39
  456. },
  457. {
  458. "path": "../packages/core/src/TaskQueue.js",
  459. "requires": [
  460. 19
  461. ],
  462. "uses": [],
  463. "idx": 40
  464. },
  465. {
  466. "path": "../packages/core/src/util/sizemonitor/Abstract.js",
  467. "requires": [
  468. 39,
  469. 40
  470. ],
  471. "uses": [],
  472. "idx": 41
  473. },
  474. {
  475. "path": "../packages/core/src/util/sizemonitor/Scroll.js",
  476. "requires": [
  477. 41
  478. ],
  479. "uses": [
  480. 40
  481. ],
  482. "idx": 42
  483. },
  484. {
  485. "path": "../packages/core/src/util/SizeMonitor.js",
  486. "requires": [
  487. 42
  488. ],
  489. "uses": [],
  490. "idx": 43
  491. },
  492. {
  493. "path": "../packages/core/src/event/publisher/ElementSize.js",
  494. "requires": [
  495. 32,
  496. 43
  497. ],
  498. "uses": [
  499. 40
  500. ],
  501. "idx": 44
  502. },
  503. {
  504. "path": "../packages/core/src/util/paintmonitor/Abstract.js",
  505. "requires": [],
  506. "uses": [
  507. 49
  508. ],
  509. "idx": 45
  510. },
  511. {
  512. "path": "../packages/core/src/util/paintmonitor/CssAnimation.js",
  513. "requires": [
  514. 45
  515. ],
  516. "uses": [],
  517. "idx": 46
  518. },
  519. {
  520. "path": "../packages/core/src/util/PaintMonitor.js",
  521. "requires": [
  522. 46
  523. ],
  524. "uses": [],
  525. "idx": 47
  526. },
  527. {
  528. "path": "../packages/core/src/event/publisher/ElementPaint.js",
  529. "requires": [
  530. 32,
  531. 40,
  532. 47
  533. ],
  534. "uses": [],
  535. "idx": 48
  536. },
  537. {
  538. "path": "../packages/core/src/dom/Element.js",
  539. "requires": [
  540. 4,
  541. 26,
  542. 29,
  543. 30,
  544. 31,
  545. 37,
  546. 38,
  547. 44,
  548. 48
  549. ],
  550. "uses": [
  551. 32,
  552. 34,
  553. 36,
  554. 74,
  555. 75,
  556. 76,
  557. 92,
  558. 99,
  559. 240,
  560. 297,
  561. 318,
  562. 329,
  563. 331
  564. ],
  565. "idx": 49
  566. },
  567. {
  568. "path": "../packages/core/src/util/Filter.js",
  569. "requires": [],
  570. "uses": [],
  571. "idx": 50
  572. },
  573. {
  574. "path": "../packages/core/src/util/Observable.js",
  575. "requires": [
  576. 4
  577. ],
  578. "uses": [],
  579. "idx": 51
  580. },
  581. {
  582. "path": "../packages/core/src/util/AbstractMixedCollection.js",
  583. "requires": [
  584. 50,
  585. 51
  586. ],
  587. "uses": [],
  588. "idx": 52
  589. },
  590. {
  591. "path": "../packages/core/src/util/Sorter.js",
  592. "requires": [],
  593. "uses": [],
  594. "idx": 53
  595. },
  596. {
  597. "path": "../packages/core/src/util/Sortable.js",
  598. "requires": [
  599. 53
  600. ],
  601. "uses": [
  602. 55
  603. ],
  604. "idx": 54
  605. },
  606. {
  607. "path": "../packages/core/src/util/MixedCollection.js",
  608. "requires": [
  609. 52,
  610. 54
  611. ],
  612. "uses": [],
  613. "idx": 55
  614. },
  615. {
  616. "path": "../packages/core/src/util/TaskRunner.js",
  617. "requires": [],
  618. "uses": [],
  619. "idx": 56
  620. },
  621. {
  622. "path": "../classic/classic/src/fx/target/Target.js",
  623. "requires": [],
  624. "uses": [],
  625. "idx": 57
  626. },
  627. {
  628. "path": "../classic/classic/src/fx/target/Element.js",
  629. "requires": [
  630. 57
  631. ],
  632. "uses": [],
  633. "idx": 58
  634. },
  635. {
  636. "path": "../classic/classic/src/fx/target/ElementCSS.js",
  637. "requires": [
  638. 58
  639. ],
  640. "uses": [],
  641. "idx": 59
  642. },
  643. {
  644. "path": "../classic/classic/src/fx/target/CompositeElement.js",
  645. "requires": [
  646. 58
  647. ],
  648. "uses": [],
  649. "idx": 60
  650. },
  651. {
  652. "path": "../classic/classic/src/fx/target/CompositeElementCSS.js",
  653. "requires": [
  654. 59,
  655. 60
  656. ],
  657. "uses": [],
  658. "idx": 61
  659. },
  660. {
  661. "path": "../classic/classic/src/fx/target/Sprite.js",
  662. "requires": [
  663. 57
  664. ],
  665. "uses": [],
  666. "idx": 62
  667. },
  668. {
  669. "path": "../classic/classic/src/fx/target/CompositeSprite.js",
  670. "requires": [
  671. 62
  672. ],
  673. "uses": [],
  674. "idx": 63
  675. },
  676. {
  677. "path": "../classic/classic/src/fx/target/Component.js",
  678. "requires": [
  679. 57
  680. ],
  681. "uses": [
  682. 76
  683. ],
  684. "idx": 64
  685. },
  686. {
  687. "path": "../classic/classic/src/fx/Queue.js",
  688. "requires": [
  689. 5
  690. ],
  691. "uses": [],
  692. "idx": 65
  693. },
  694. {
  695. "path": "../classic/classic/src/fx/Manager.js",
  696. "requires": [
  697. 55,
  698. 56,
  699. 58,
  700. 59,
  701. 60,
  702. 61,
  703. 62,
  704. 63,
  705. 64,
  706. 65
  707. ],
  708. "uses": [],
  709. "idx": 66
  710. },
  711. {
  712. "path": "../classic/classic/src/fx/Animator.js",
  713. "requires": [
  714. 51,
  715. 66
  716. ],
  717. "uses": [
  718. 72
  719. ],
  720. "idx": 67
  721. },
  722. {
  723. "path": "../classic/classic/src/fx/CubicBezier.js",
  724. "requires": [],
  725. "uses": [],
  726. "idx": 68
  727. },
  728. {
  729. "path": "../classic/classic/src/fx/Easing.js",
  730. "requires": [
  731. 68
  732. ],
  733. "uses": [],
  734. "idx": 69
  735. },
  736. {
  737. "path": "../classic/classic/src/fx/DrawPath.js",
  738. "requires": [],
  739. "uses": [],
  740. "idx": 70
  741. },
  742. {
  743. "path": "../classic/classic/src/fx/PropertyHandler.js",
  744. "requires": [
  745. 70
  746. ],
  747. "uses": [],
  748. "idx": 71
  749. },
  750. {
  751. "path": "../classic/classic/src/fx/Anim.js",
  752. "requires": [
  753. 51,
  754. 66,
  755. 67,
  756. 68,
  757. 69,
  758. 71
  759. ],
  760. "uses": [],
  761. "idx": 72
  762. },
  763. {
  764. "path": "../classic/classic/src/util/Animate.js",
  765. "requires": [
  766. 66,
  767. 72
  768. ],
  769. "uses": [],
  770. "idx": 73
  771. },
  772. {
  773. "path": "../packages/core/src/dom/Fly.js",
  774. "requires": [
  775. 49
  776. ],
  777. "uses": [],
  778. "idx": 74
  779. },
  780. {
  781. "path": "../packages/core/src/dom/CompositeElementLite.js",
  782. "requires": [
  783. 74
  784. ],
  785. "uses": [
  786. 49
  787. ],
  788. "idx": 75
  789. },
  790. {
  791. "path": "../packages/core/src/GlobalEvents.js",
  792. "requires": [
  793. 4,
  794. 49
  795. ],
  796. "uses": [
  797. 21
  798. ],
  799. "idx": 76
  800. },
  801. {
  802. "path": "../packages/core/src/Glyph.js",
  803. "requires": [],
  804. "uses": [],
  805. "idx": 77
  806. },
  807. {
  808. "path": "../packages/core/src/JSON.js",
  809. "requires": [],
  810. "uses": [],
  811. "idx": 78
  812. },
  813. {
  814. "path": "../packages/core/src/Manifest.js",
  815. "requires": [],
  816. "uses": [],
  817. "idx": 79
  818. },
  819. {
  820. "path": "../packages/core/src/mixin/Inheritable.js",
  821. "requires": [
  822. 0
  823. ],
  824. "uses": [
  825. 21
  826. ],
  827. "idx": 80
  828. },
  829. {
  830. "path": "../packages/core/src/mixin/Bindable.js",
  831. "requires": [],
  832. "uses": [
  833. 12
  834. ],
  835. "idx": 81
  836. },
  837. {
  838. "path": "../packages/core/src/mixin/ComponentDelegation.js",
  839. "requires": [
  840. 0,
  841. 4
  842. ],
  843. "uses": [
  844. 2
  845. ],
  846. "idx": 82
  847. },
  848. {
  849. "path": "../packages/core/src/plugin/Abstract.js",
  850. "requires": [],
  851. "uses": [],
  852. "idx": 83
  853. },
  854. {
  855. "path": "../packages/core/src/mixin/Pluggable.js",
  856. "requires": [
  857. 83
  858. ],
  859. "uses": [],
  860. "idx": 84
  861. },
  862. {
  863. "path": "../packages/core/src/mixin/Keyboard.js",
  864. "requires": [
  865. 0
  866. ],
  867. "uses": [
  868. 36
  869. ],
  870. "idx": 85
  871. },
  872. {
  873. "path": "../packages/core/src/mixin/Focusable.js",
  874. "requires": [],
  875. "uses": [
  876. 21,
  877. 24,
  878. 36,
  879. 49
  880. ],
  881. "idx": 86
  882. },
  883. {
  884. "path": "../packages/core/src/mixin/Accessible.js",
  885. "requires": [
  886. 0
  887. ],
  888. "uses": [],
  889. "idx": 87
  890. },
  891. {
  892. "path": "../packages/core/src/Widget.js",
  893. "requires": [
  894. 12,
  895. 25,
  896. 49,
  897. 80,
  898. 81,
  899. 82,
  900. 84,
  901. 85,
  902. 86,
  903. 87
  904. ],
  905. "uses": [
  906. 21,
  907. 24,
  908. 95
  909. ],
  910. "idx": 88
  911. },
  912. {
  913. "path": "../packages/core/src/ProgressBase.js",
  914. "requires": [],
  915. "uses": [
  916. 95
  917. ],
  918. "idx": 89
  919. },
  920. {
  921. "path": "../packages/core/src/Progress.js",
  922. "requires": [
  923. 88,
  924. 89
  925. ],
  926. "uses": [],
  927. "idx": 90
  928. },
  929. {
  930. "path": "../packages/core/src/util/Format.js",
  931. "requires": [],
  932. "uses": [
  933. 92,
  934. 240
  935. ],
  936. "idx": 91
  937. },
  938. {
  939. "path": "../packages/core/src/Template.js",
  940. "requires": [
  941. 91
  942. ],
  943. "uses": [
  944. 240
  945. ],
  946. "idx": 92
  947. },
  948. {
  949. "path": "../packages/core/src/util/XTemplateParser.js",
  950. "requires": [],
  951. "uses": [],
  952. "idx": 93
  953. },
  954. {
  955. "path": "../packages/core/src/util/XTemplateCompiler.js",
  956. "requires": [
  957. 93
  958. ],
  959. "uses": [],
  960. "idx": 94
  961. },
  962. {
  963. "path": "../packages/core/src/XTemplate.js",
  964. "requires": [
  965. 92,
  966. 94
  967. ],
  968. "uses": [],
  969. "idx": 95
  970. },
  971. {
  972. "path": "../packages/core/src/app/EventDomain.js",
  973. "requires": [
  974. 2
  975. ],
  976. "uses": [],
  977. "idx": 96
  978. },
  979. {
  980. "path": "../packages/core/src/app/domain/Component.js",
  981. "requires": [
  982. 88,
  983. 96
  984. ],
  985. "uses": [],
  986. "idx": 97
  987. },
  988. {
  989. "path": "../classic/classic/src/util/ProtoElement.js",
  990. "requires": [],
  991. "uses": [
  992. 49,
  993. 240
  994. ],
  995. "idx": 98
  996. },
  997. {
  998. "path": "../packages/core/src/dom/CompositeElement.js",
  999. "requires": [
  1000. 75
  1001. ],
  1002. "uses": [],
  1003. "idx": 99
  1004. },
  1005. {
  1006. "path": "../classic/classic/src/plugin/Manager.js",
  1007. "requires": [],
  1008. "uses": [],
  1009. "idx": 100
  1010. },
  1011. {
  1012. "path": "../packages/core/src/util/CSS.js",
  1013. "requires": [],
  1014. "uses": [
  1015. 49
  1016. ],
  1017. "idx": 101
  1018. },
  1019. {
  1020. "path": "../packages/core/src/fx/easing/Abstract.js",
  1021. "requires": [],
  1022. "uses": [],
  1023. "idx": 102
  1024. },
  1025. {
  1026. "path": "../packages/core/src/fx/easing/Linear.js",
  1027. "requires": [
  1028. 102
  1029. ],
  1030. "uses": [],
  1031. "idx": 103
  1032. },
  1033. {
  1034. "path": "../packages/core/src/util/translatable/Abstract.js",
  1035. "requires": [
  1036. 12,
  1037. 25,
  1038. 103
  1039. ],
  1040. "uses": [
  1041. 19
  1042. ],
  1043. "idx": 104
  1044. },
  1045. {
  1046. "path": "../packages/core/src/util/translatable/Dom.js",
  1047. "requires": [
  1048. 104
  1049. ],
  1050. "uses": [],
  1051. "idx": 105
  1052. },
  1053. {
  1054. "path": "../packages/core/src/util/translatable/ScrollPosition.js",
  1055. "requires": [
  1056. 105
  1057. ],
  1058. "uses": [],
  1059. "idx": 106
  1060. },
  1061. {
  1062. "path": "../packages/core/src/scroll/Scroller.js",
  1063. "requires": [
  1064. 11,
  1065. 12,
  1066. 20,
  1067. 25,
  1068. 101,
  1069. 106
  1070. ],
  1071. "uses": [
  1072. 76
  1073. ],
  1074. "idx": 107
  1075. },
  1076. {
  1077. "path": "../classic/classic/src/util/Floating.js",
  1078. "requires": [],
  1079. "uses": [
  1080. 21,
  1081. 49,
  1082. 74,
  1083. 403
  1084. ],
  1085. "idx": 108
  1086. },
  1087. {
  1088. "path": "../classic/classic/src/util/ElementContainer.js",
  1089. "requires": [],
  1090. "uses": [],
  1091. "idx": 109
  1092. },
  1093. {
  1094. "path": "../classic/classic/src/util/Renderable.js",
  1095. "requires": [
  1096. 49
  1097. ],
  1098. "uses": [
  1099. 95,
  1100. 114,
  1101. 240
  1102. ],
  1103. "idx": 110
  1104. },
  1105. {
  1106. "path": "../classic/classic/src/state/Provider.js",
  1107. "requires": [
  1108. 51
  1109. ],
  1110. "uses": [],
  1111. "idx": 111
  1112. },
  1113. {
  1114. "path": "../classic/classic/src/state/Manager.js",
  1115. "requires": [
  1116. 111
  1117. ],
  1118. "uses": [],
  1119. "idx": 112
  1120. },
  1121. {
  1122. "path": "../classic/classic/src/state/Stateful.js",
  1123. "requires": [
  1124. 56,
  1125. 112
  1126. ],
  1127. "uses": [],
  1128. "idx": 113
  1129. },
  1130. {
  1131. "path": "../classic/classic/src/Component.js",
  1132. "requires": [
  1133. 21,
  1134. 24,
  1135. 26,
  1136. 51,
  1137. 73,
  1138. 76,
  1139. 80,
  1140. 81,
  1141. 82,
  1142. 83,
  1143. 85,
  1144. 86,
  1145. 87,
  1146. 98,
  1147. 99,
  1148. 100,
  1149. 107,
  1150. 108,
  1151. 109,
  1152. 110,
  1153. 113
  1154. ],
  1155. "uses": [
  1156. 1,
  1157. 49,
  1158. 66,
  1159. 95,
  1160. 240,
  1161. 398,
  1162. 399,
  1163. 400,
  1164. 403,
  1165. 411,
  1166. 413,
  1167. 479,
  1168. 626,
  1169. 645
  1170. ],
  1171. "idx": 114
  1172. },
  1173. {
  1174. "path": "../classic/classic/src/layout/container/border/Region.js",
  1175. "requires": [],
  1176. "uses": [],
  1177. "idx": 115
  1178. },
  1179. {
  1180. "path": "../packages/core/src/app/EventBus.js",
  1181. "requires": [
  1182. 97
  1183. ],
  1184. "uses": [
  1185. 96
  1186. ],
  1187. "idx": 116
  1188. },
  1189. {
  1190. "path": "../packages/core/src/app/domain/Global.js",
  1191. "requires": [
  1192. 76,
  1193. 96
  1194. ],
  1195. "uses": [],
  1196. "idx": 117
  1197. },
  1198. {
  1199. "path": "../packages/core/src/route/Handler.js",
  1200. "requires": [],
  1201. "uses": [],
  1202. "idx": 118
  1203. },
  1204. {
  1205. "path": "../packages/core/src/route/Action.js",
  1206. "requires": [],
  1207. "uses": [
  1208. 11
  1209. ],
  1210. "idx": 119
  1211. },
  1212. {
  1213. "path": "../packages/core/src/route/Route.js",
  1214. "requires": [
  1215. 118,
  1216. 119
  1217. ],
  1218. "uses": [
  1219. 10,
  1220. 122
  1221. ],
  1222. "idx": 120
  1223. },
  1224. {
  1225. "path": "../packages/core/src/util/History.js",
  1226. "requires": [
  1227. 51
  1228. ],
  1229. "uses": [],
  1230. "idx": 121
  1231. },
  1232. {
  1233. "path": "../packages/core/src/route/Router.js",
  1234. "requires": [
  1235. 119,
  1236. 120,
  1237. 121
  1238. ],
  1239. "uses": [
  1240. 118
  1241. ],
  1242. "idx": 122
  1243. },
  1244. {
  1245. "path": "../packages/core/src/route/Mixin.js",
  1246. "requires": [
  1247. 0,
  1248. 118,
  1249. 122
  1250. ],
  1251. "uses": [
  1252. 121
  1253. ],
  1254. "idx": 123
  1255. },
  1256. {
  1257. "path": "../packages/core/src/app/BaseController.js",
  1258. "requires": [
  1259. 4,
  1260. 116,
  1261. 117,
  1262. 123
  1263. ],
  1264. "uses": [
  1265. 219
  1266. ],
  1267. "idx": 124
  1268. },
  1269. {
  1270. "path": "../packages/core/src/app/Util.js",
  1271. "requires": [],
  1272. "uses": [],
  1273. "idx": 125
  1274. },
  1275. {
  1276. "path": "../packages/core/src/util/CollectionKey.js",
  1277. "requires": [
  1278. 3
  1279. ],
  1280. "uses": [],
  1281. "idx": 126
  1282. },
  1283. {
  1284. "path": "../packages/core/src/util/Grouper.js",
  1285. "requires": [
  1286. 53
  1287. ],
  1288. "uses": [],
  1289. "idx": 127
  1290. },
  1291. {
  1292. "path": "../packages/core/src/util/Collection.js",
  1293. "requires": [
  1294. 4,
  1295. 50,
  1296. 53,
  1297. 126,
  1298. 127
  1299. ],
  1300. "uses": [
  1301. 172,
  1302. 173,
  1303. 174
  1304. ],
  1305. "idx": 128
  1306. },
  1307. {
  1308. "path": "../packages/core/src/data/Range.js",
  1309. "requires": [
  1310. 1
  1311. ],
  1312. "uses": [],
  1313. "idx": 129
  1314. },
  1315. {
  1316. "path": "../packages/core/src/util/ObjectTemplate.js",
  1317. "requires": [
  1318. 95
  1319. ],
  1320. "uses": [],
  1321. "idx": 130
  1322. },
  1323. {
  1324. "path": "../packages/core/src/data/schema/Role.js",
  1325. "requires": [],
  1326. "uses": [
  1327. 12
  1328. ],
  1329. "idx": 131
  1330. },
  1331. {
  1332. "path": "../packages/core/src/data/schema/Association.js",
  1333. "requires": [
  1334. 131
  1335. ],
  1336. "uses": [],
  1337. "idx": 132
  1338. },
  1339. {
  1340. "path": "../packages/core/src/data/schema/OneToOne.js",
  1341. "requires": [
  1342. 132
  1343. ],
  1344. "uses": [],
  1345. "idx": 133
  1346. },
  1347. {
  1348. "path": "../packages/core/src/data/schema/ManyToOne.js",
  1349. "requires": [
  1350. 132
  1351. ],
  1352. "uses": [],
  1353. "idx": 134
  1354. },
  1355. {
  1356. "path": "../packages/core/src/data/schema/ManyToMany.js",
  1357. "requires": [
  1358. 132
  1359. ],
  1360. "uses": [],
  1361. "idx": 135
  1362. },
  1363. {
  1364. "path": "../packages/core/src/util/Inflector.js",
  1365. "requires": [],
  1366. "uses": [],
  1367. "idx": 136
  1368. },
  1369. {
  1370. "path": "../packages/core/src/data/schema/Namer.js",
  1371. "requires": [
  1372. 12,
  1373. 136
  1374. ],
  1375. "uses": [],
  1376. "idx": 137
  1377. },
  1378. {
  1379. "path": "../packages/core/src/data/schema/Schema.js",
  1380. "requires": [
  1381. 12,
  1382. 130,
  1383. 133,
  1384. 134,
  1385. 135,
  1386. 137
  1387. ],
  1388. "uses": [],
  1389. "idx": 138
  1390. },
  1391. {
  1392. "path": "../packages/core/src/data/AbstractStore.js",
  1393. "requires": [
  1394. 4,
  1395. 12,
  1396. 50,
  1397. 128,
  1398. 129,
  1399. 138
  1400. ],
  1401. "uses": [
  1402. 178
  1403. ],
  1404. "idx": 139
  1405. },
  1406. {
  1407. "path": "../packages/core/src/data/Error.js",
  1408. "requires": [],
  1409. "uses": [],
  1410. "idx": 140
  1411. },
  1412. {
  1413. "path": "../packages/core/src/data/ErrorCollection.js",
  1414. "requires": [
  1415. 55,
  1416. 140
  1417. ],
  1418. "uses": [
  1419. 149
  1420. ],
  1421. "idx": 141
  1422. },
  1423. {
  1424. "path": "../packages/core/src/data/operation/Operation.js",
  1425. "requires": [],
  1426. "uses": [],
  1427. "idx": 142
  1428. },
  1429. {
  1430. "path": "../packages/core/src/data/operation/Create.js",
  1431. "requires": [
  1432. 142
  1433. ],
  1434. "uses": [],
  1435. "idx": 143
  1436. },
  1437. {
  1438. "path": "../packages/core/src/data/operation/Destroy.js",
  1439. "requires": [
  1440. 142
  1441. ],
  1442. "uses": [],
  1443. "idx": 144
  1444. },
  1445. {
  1446. "path": "../packages/core/src/data/operation/Read.js",
  1447. "requires": [
  1448. 142
  1449. ],
  1450. "uses": [],
  1451. "idx": 145
  1452. },
  1453. {
  1454. "path": "../packages/core/src/data/operation/Update.js",
  1455. "requires": [
  1456. 142
  1457. ],
  1458. "uses": [],
  1459. "idx": 146
  1460. },
  1461. {
  1462. "path": "../packages/core/src/data/SortTypes.js",
  1463. "requires": [],
  1464. "uses": [],
  1465. "idx": 147
  1466. },
  1467. {
  1468. "path": "../packages/core/src/data/validator/Validator.js",
  1469. "requires": [
  1470. 12
  1471. ],
  1472. "uses": [],
  1473. "idx": 148
  1474. },
  1475. {
  1476. "path": "../packages/core/src/data/field/Field.js",
  1477. "requires": [
  1478. 12,
  1479. 147,
  1480. 148
  1481. ],
  1482. "uses": [],
  1483. "idx": 149
  1484. },
  1485. {
  1486. "path": "../packages/core/src/data/field/Boolean.js",
  1487. "requires": [
  1488. 149
  1489. ],
  1490. "uses": [],
  1491. "idx": 150
  1492. },
  1493. {
  1494. "path": "../packages/core/src/data/field/Date.js",
  1495. "requires": [
  1496. 149
  1497. ],
  1498. "uses": [],
  1499. "idx": 151
  1500. },
  1501. {
  1502. "path": "../packages/core/src/data/field/Integer.js",
  1503. "requires": [
  1504. 149
  1505. ],
  1506. "uses": [],
  1507. "idx": 152
  1508. },
  1509. {
  1510. "path": "../packages/core/src/data/field/Number.js",
  1511. "requires": [
  1512. 152
  1513. ],
  1514. "uses": [],
  1515. "idx": 153
  1516. },
  1517. {
  1518. "path": "../packages/core/src/data/field/String.js",
  1519. "requires": [
  1520. 149
  1521. ],
  1522. "uses": [],
  1523. "idx": 154
  1524. },
  1525. {
  1526. "path": "../packages/core/src/data/identifier/Generator.js",
  1527. "requires": [
  1528. 12
  1529. ],
  1530. "uses": [],
  1531. "idx": 155
  1532. },
  1533. {
  1534. "path": "../packages/core/src/data/identifier/Sequential.js",
  1535. "requires": [
  1536. 155
  1537. ],
  1538. "uses": [],
  1539. "idx": 156
  1540. },
  1541. {
  1542. "path": "../packages/core/src/data/Model.js",
  1543. "requires": [
  1544. 138,
  1545. 141,
  1546. 142,
  1547. 143,
  1548. 144,
  1549. 145,
  1550. 146,
  1551. 148,
  1552. 149,
  1553. 150,
  1554. 151,
  1555. 152,
  1556. 153,
  1557. 154,
  1558. 155,
  1559. 156
  1560. ],
  1561. "uses": [
  1562. 12,
  1563. 159,
  1564. 239
  1565. ],
  1566. "idx": 157
  1567. },
  1568. {
  1569. "path": "../packages/core/src/data/ResultSet.js",
  1570. "requires": [],
  1571. "uses": [],
  1572. "idx": 158
  1573. },
  1574. {
  1575. "path": "../packages/core/src/data/reader/Reader.js",
  1576. "requires": [
  1577. 4,
  1578. 12,
  1579. 23,
  1580. 95,
  1581. 158
  1582. ],
  1583. "uses": [
  1584. 138
  1585. ],
  1586. "idx": 159
  1587. },
  1588. {
  1589. "path": "../packages/core/src/data/writer/Writer.js",
  1590. "requires": [
  1591. 12
  1592. ],
  1593. "uses": [],
  1594. "idx": 160
  1595. },
  1596. {
  1597. "path": "../packages/core/src/data/proxy/Proxy.js",
  1598. "requires": [
  1599. 4,
  1600. 12,
  1601. 138,
  1602. 159,
  1603. 160
  1604. ],
  1605. "uses": [
  1606. 142,
  1607. 143,
  1608. 144,
  1609. 145,
  1610. 146,
  1611. 157,
  1612. 187
  1613. ],
  1614. "idx": 161
  1615. },
  1616. {
  1617. "path": "../packages/core/src/data/proxy/Client.js",
  1618. "requires": [
  1619. 161
  1620. ],
  1621. "uses": [],
  1622. "idx": 162
  1623. },
  1624. {
  1625. "path": "../packages/core/src/data/proxy/Memory.js",
  1626. "requires": [
  1627. 162
  1628. ],
  1629. "uses": [
  1630. 50,
  1631. 54
  1632. ],
  1633. "idx": 163
  1634. },
  1635. {
  1636. "path": "../packages/core/src/data/ProxyStore.js",
  1637. "requires": [
  1638. 139,
  1639. 142,
  1640. 143,
  1641. 144,
  1642. 145,
  1643. 146,
  1644. 157,
  1645. 161,
  1646. 163
  1647. ],
  1648. "uses": [
  1649. 138
  1650. ],
  1651. "idx": 164
  1652. },
  1653. {
  1654. "path": "../packages/core/src/util/Group.js",
  1655. "requires": [
  1656. 128
  1657. ],
  1658. "uses": [],
  1659. "idx": 165
  1660. },
  1661. {
  1662. "path": "../packages/core/src/data/Group.js",
  1663. "requires": [
  1664. 165
  1665. ],
  1666. "uses": [],
  1667. "idx": 166
  1668. },
  1669. {
  1670. "path": "../packages/core/src/data/LocalStore.js",
  1671. "requires": [
  1672. 0,
  1673. 166
  1674. ],
  1675. "uses": [
  1676. 128
  1677. ],
  1678. "idx": 167
  1679. },
  1680. {
  1681. "path": "../packages/core/src/data/proxy/Server.js",
  1682. "requires": [
  1683. 161
  1684. ],
  1685. "uses": [
  1686. 92,
  1687. 236
  1688. ],
  1689. "idx": 168
  1690. },
  1691. {
  1692. "path": "../packages/core/src/data/proxy/Ajax.js",
  1693. "requires": [
  1694. 18,
  1695. 168
  1696. ],
  1697. "uses": [],
  1698. "idx": 169
  1699. },
  1700. {
  1701. "path": "../packages/core/src/data/reader/Json.js",
  1702. "requires": [
  1703. 78,
  1704. 159
  1705. ],
  1706. "uses": [],
  1707. "idx": 170
  1708. },
  1709. {
  1710. "path": "../packages/core/src/data/writer/Json.js",
  1711. "requires": [
  1712. 160
  1713. ],
  1714. "uses": [],
  1715. "idx": 171
  1716. },
  1717. {
  1718. "path": "../packages/core/src/util/SorterCollection.js",
  1719. "requires": [
  1720. 53,
  1721. 128
  1722. ],
  1723. "uses": [],
  1724. "idx": 172
  1725. },
  1726. {
  1727. "path": "../packages/core/src/util/FilterCollection.js",
  1728. "requires": [
  1729. 50,
  1730. 128
  1731. ],
  1732. "uses": [],
  1733. "idx": 173
  1734. },
  1735. {
  1736. "path": "../packages/core/src/util/GroupCollection.js",
  1737. "requires": [
  1738. 128,
  1739. 165,
  1740. 172,
  1741. 173
  1742. ],
  1743. "uses": [],
  1744. "idx": 174
  1745. },
  1746. {
  1747. "path": "../packages/core/src/data/Store.js",
  1748. "requires": [
  1749. 1,
  1750. 157,
  1751. 164,
  1752. 167,
  1753. 169,
  1754. 170,
  1755. 171,
  1756. 174
  1757. ],
  1758. "uses": [
  1759. 127,
  1760. 178
  1761. ],
  1762. "idx": 175
  1763. },
  1764. {
  1765. "path": "../packages/core/src/data/reader/Array.js",
  1766. "requires": [
  1767. 170
  1768. ],
  1769. "uses": [],
  1770. "idx": 176
  1771. },
  1772. {
  1773. "path": "../packages/core/src/data/ArrayStore.js",
  1774. "requires": [
  1775. 163,
  1776. 175,
  1777. 176
  1778. ],
  1779. "uses": [],
  1780. "idx": 177
  1781. },
  1782. {
  1783. "path": "../packages/core/src/data/StoreManager.js",
  1784. "requires": [
  1785. 55,
  1786. 177
  1787. ],
  1788. "uses": [
  1789. 12,
  1790. 163,
  1791. 171,
  1792. 175,
  1793. 176
  1794. ],
  1795. "idx": 178
  1796. },
  1797. {
  1798. "path": "../packages/core/src/app/domain/Store.js",
  1799. "requires": [
  1800. 96,
  1801. 139
  1802. ],
  1803. "uses": [],
  1804. "idx": 179
  1805. },
  1806. {
  1807. "path": "../packages/core/src/app/Controller.js",
  1808. "requires": [
  1809. 21,
  1810. 97,
  1811. 124,
  1812. 125,
  1813. 178,
  1814. 179
  1815. ],
  1816. "uses": [
  1817. 24,
  1818. 138
  1819. ],
  1820. "idx": 180
  1821. },
  1822. {
  1823. "path": "../packages/core/src/app/Application.js",
  1824. "requires": [
  1825. 55,
  1826. 121,
  1827. 180
  1828. ],
  1829. "uses": [
  1830. 122
  1831. ],
  1832. "idx": 181
  1833. },
  1834. {
  1835. "path": "../packages/core/src/app/Profile.js",
  1836. "requires": [
  1837. 4,
  1838. 180
  1839. ],
  1840. "uses": [],
  1841. "idx": 182
  1842. },
  1843. {
  1844. "path": "../packages/core/src/app/domain/View.js",
  1845. "requires": [
  1846. 88,
  1847. 96
  1848. ],
  1849. "uses": [],
  1850. "idx": 183
  1851. },
  1852. {
  1853. "path": "../packages/core/src/app/ViewController.js",
  1854. "requires": [
  1855. 12,
  1856. 124,
  1857. 183
  1858. ],
  1859. "uses": [],
  1860. "idx": 184
  1861. },
  1862. {
  1863. "path": "../packages/core/src/util/Bag.js",
  1864. "requires": [],
  1865. "uses": [],
  1866. "idx": 185
  1867. },
  1868. {
  1869. "path": "../packages/core/src/util/Scheduler.js",
  1870. "requires": [
  1871. 4,
  1872. 185
  1873. ],
  1874. "uses": [
  1875. 76
  1876. ],
  1877. "idx": 186
  1878. },
  1879. {
  1880. "path": "../packages/core/src/data/Batch.js",
  1881. "requires": [
  1882. 4
  1883. ],
  1884. "uses": [],
  1885. "idx": 187
  1886. },
  1887. {
  1888. "path": "../packages/core/src/data/matrix/Slice.js",
  1889. "requires": [],
  1890. "uses": [],
  1891. "idx": 188
  1892. },
  1893. {
  1894. "path": "../packages/core/src/data/matrix/Side.js",
  1895. "requires": [
  1896. 188
  1897. ],
  1898. "uses": [],
  1899. "idx": 189
  1900. },
  1901. {
  1902. "path": "../packages/core/src/data/matrix/Matrix.js",
  1903. "requires": [
  1904. 189
  1905. ],
  1906. "uses": [],
  1907. "idx": 190
  1908. },
  1909. {
  1910. "path": "../packages/core/src/data/session/ChangesVisitor.js",
  1911. "requires": [],
  1912. "uses": [],
  1913. "idx": 191
  1914. },
  1915. {
  1916. "path": "../packages/core/src/data/session/ChildChangesVisitor.js",
  1917. "requires": [
  1918. 191
  1919. ],
  1920. "uses": [],
  1921. "idx": 192
  1922. },
  1923. {
  1924. "path": "../packages/core/src/data/session/BatchVisitor.js",
  1925. "requires": [],
  1926. "uses": [
  1927. 187
  1928. ],
  1929. "idx": 193
  1930. },
  1931. {
  1932. "path": "../packages/core/src/mixin/Dirty.js",
  1933. "requires": [],
  1934. "uses": [],
  1935. "idx": 194
  1936. },
  1937. {
  1938. "path": "../packages/core/src/data/Session.js",
  1939. "requires": [
  1940. 4,
  1941. 138,
  1942. 187,
  1943. 190,
  1944. 191,
  1945. 192,
  1946. 193,
  1947. 194
  1948. ],
  1949. "uses": [],
  1950. "idx": 195
  1951. },
  1952. {
  1953. "path": "../packages/core/src/util/Schedulable.js",
  1954. "requires": [],
  1955. "uses": [],
  1956. "idx": 196
  1957. },
  1958. {
  1959. "path": "../packages/core/src/app/bind/BaseBinding.js",
  1960. "requires": [
  1961. 196
  1962. ],
  1963. "uses": [],
  1964. "idx": 197
  1965. },
  1966. {
  1967. "path": "../packages/core/src/app/bind/Binding.js",
  1968. "requires": [
  1969. 197
  1970. ],
  1971. "uses": [],
  1972. "idx": 198
  1973. },
  1974. {
  1975. "path": "../packages/core/src/app/bind/AbstractStub.js",
  1976. "requires": [
  1977. 196,
  1978. 198
  1979. ],
  1980. "uses": [],
  1981. "idx": 199
  1982. },
  1983. {
  1984. "path": "../packages/core/src/app/bind/Stub.js",
  1985. "requires": [
  1986. 198,
  1987. 199
  1988. ],
  1989. "uses": [
  1990. 204
  1991. ],
  1992. "idx": 200
  1993. },
  1994. {
  1995. "path": "../packages/core/src/app/bind/LinkStub.js",
  1996. "requires": [
  1997. 200
  1998. ],
  1999. "uses": [],
  2000. "idx": 201
  2001. },
  2002. {
  2003. "path": "../packages/core/src/app/bind/RootStub.js",
  2004. "requires": [
  2005. 199,
  2006. 200,
  2007. 201
  2008. ],
  2009. "uses": [],
  2010. "idx": 202
  2011. },
  2012. {
  2013. "path": "../packages/core/src/app/bind/Multi.js",
  2014. "requires": [
  2015. 197
  2016. ],
  2017. "uses": [],
  2018. "idx": 203
  2019. },
  2020. {
  2021. "path": "../packages/core/src/app/bind/Formula.js",
  2022. "requires": [
  2023. 23,
  2024. 196
  2025. ],
  2026. "uses": [],
  2027. "idx": 204
  2028. },
  2029. {
  2030. "path": "../packages/core/src/util/Fly.js",
  2031. "requires": [],
  2032. "uses": [],
  2033. "idx": 205
  2034. },
  2035. {
  2036. "path": "../packages/core/src/parse/Tokenizer.js",
  2037. "requires": [
  2038. 205
  2039. ],
  2040. "uses": [],
  2041. "idx": 206
  2042. },
  2043. {
  2044. "path": "../packages/core/src/parse/Symbol.js",
  2045. "requires": [],
  2046. "uses": [],
  2047. "idx": 207
  2048. },
  2049. {
  2050. "path": "../packages/core/src/parse/symbol/Constant.js",
  2051. "requires": [
  2052. 207
  2053. ],
  2054. "uses": [],
  2055. "idx": 208
  2056. },
  2057. {
  2058. "path": "../packages/core/src/parse/symbol/Infix.js",
  2059. "requires": [
  2060. 207
  2061. ],
  2062. "uses": [],
  2063. "idx": 209
  2064. },
  2065. {
  2066. "path": "../packages/core/src/parse/symbol/InfixRight.js",
  2067. "requires": [
  2068. 209
  2069. ],
  2070. "uses": [],
  2071. "idx": 210
  2072. },
  2073. {
  2074. "path": "../packages/core/src/parse/symbol/Paren.js",
  2075. "requires": [
  2076. 207
  2077. ],
  2078. "uses": [],
  2079. "idx": 211
  2080. },
  2081. {
  2082. "path": "../packages/core/src/parse/symbol/Prefix.js",
  2083. "requires": [
  2084. 207
  2085. ],
  2086. "uses": [],
  2087. "idx": 212
  2088. },
  2089. {
  2090. "path": "../packages/core/src/parse/Parser.js",
  2091. "requires": [
  2092. 205,
  2093. 206,
  2094. 208,
  2095. 210,
  2096. 211,
  2097. 212
  2098. ],
  2099. "uses": [
  2100. 207,
  2101. 209
  2102. ],
  2103. "idx": 213
  2104. },
  2105. {
  2106. "path": "../packages/core/src/app/bind/Parser.js",
  2107. "requires": [
  2108. 91,
  2109. 213
  2110. ],
  2111. "uses": [],
  2112. "idx": 214
  2113. },
  2114. {
  2115. "path": "../packages/core/src/app/bind/Template.js",
  2116. "requires": [
  2117. 91,
  2118. 214
  2119. ],
  2120. "uses": [],
  2121. "idx": 215
  2122. },
  2123. {
  2124. "path": "../packages/core/src/app/bind/TemplateBinding.js",
  2125. "requires": [
  2126. 197,
  2127. 203,
  2128. 215
  2129. ],
  2130. "uses": [],
  2131. "idx": 216
  2132. },
  2133. {
  2134. "path": "../packages/core/src/data/ChainedStore.js",
  2135. "requires": [
  2136. 139,
  2137. 167
  2138. ],
  2139. "uses": [
  2140. 92,
  2141. 178
  2142. ],
  2143. "idx": 217
  2144. },
  2145. {
  2146. "path": "../packages/core/src/app/ViewModel.js",
  2147. "requires": [
  2148. 3,
  2149. 12,
  2150. 186,
  2151. 195,
  2152. 201,
  2153. 202,
  2154. 203,
  2155. 204,
  2156. 216,
  2157. 217
  2158. ],
  2159. "uses": [
  2160. 1,
  2161. 138
  2162. ],
  2163. "idx": 218
  2164. },
  2165. {
  2166. "path": "../packages/core/src/app/domain/Controller.js",
  2167. "requires": [
  2168. 96,
  2169. 180
  2170. ],
  2171. "uses": [
  2172. 124
  2173. ],
  2174. "idx": 219
  2175. },
  2176. {
  2177. "path": "../packages/core/src/direct/Manager.js",
  2178. "requires": [
  2179. 4,
  2180. 55
  2181. ],
  2182. "uses": [
  2183. 92
  2184. ],
  2185. "idx": 220
  2186. },
  2187. {
  2188. "path": "../packages/core/src/direct/Provider.js",
  2189. "requires": [
  2190. 4,
  2191. 220
  2192. ],
  2193. "uses": [
  2194. 18
  2195. ],
  2196. "idx": 221
  2197. },
  2198. {
  2199. "path": "../packages/core/src/app/domain/Direct.js",
  2200. "requires": [
  2201. 96,
  2202. 221
  2203. ],
  2204. "uses": [],
  2205. "idx": 222
  2206. },
  2207. {
  2208. "path": "../packages/core/src/data/PageMap.js",
  2209. "requires": [
  2210. 23
  2211. ],
  2212. "uses": [],
  2213. "idx": 223
  2214. },
  2215. {
  2216. "path": "../packages/core/src/data/BufferedStore.js",
  2217. "requires": [
  2218. 50,
  2219. 53,
  2220. 127,
  2221. 164,
  2222. 223
  2223. ],
  2224. "uses": [
  2225. 172,
  2226. 173,
  2227. 174
  2228. ],
  2229. "idx": 224
  2230. },
  2231. {
  2232. "path": "../packages/core/src/data/proxy/Direct.js",
  2233. "requires": [
  2234. 168,
  2235. 220
  2236. ],
  2237. "uses": [],
  2238. "idx": 225
  2239. },
  2240. {
  2241. "path": "../packages/core/src/data/DirectStore.js",
  2242. "requires": [
  2243. 175,
  2244. 225
  2245. ],
  2246. "uses": [],
  2247. "idx": 226
  2248. },
  2249. {
  2250. "path": "../packages/core/src/data/JsonP.js",
  2251. "requires": [],
  2252. "uses": [],
  2253. "idx": 227
  2254. },
  2255. {
  2256. "path": "../packages/core/src/data/proxy/JsonP.js",
  2257. "requires": [
  2258. 168,
  2259. 227
  2260. ],
  2261. "uses": [],
  2262. "idx": 228
  2263. },
  2264. {
  2265. "path": "../packages/core/src/data/JsonPStore.js",
  2266. "requires": [
  2267. 170,
  2268. 175,
  2269. 228
  2270. ],
  2271. "uses": [],
  2272. "idx": 229
  2273. },
  2274. {
  2275. "path": "../packages/core/src/data/JsonStore.js",
  2276. "requires": [
  2277. 169,
  2278. 170,
  2279. 171,
  2280. 175
  2281. ],
  2282. "uses": [],
  2283. "idx": 230
  2284. },
  2285. {
  2286. "path": "../packages/core/src/data/ModelManager.js",
  2287. "requires": [
  2288. 138
  2289. ],
  2290. "uses": [
  2291. 157
  2292. ],
  2293. "idx": 231
  2294. },
  2295. {
  2296. "path": "../packages/core/src/data/NodeInterface.js",
  2297. "requires": [
  2298. 4,
  2299. 150,
  2300. 152,
  2301. 154,
  2302. 171
  2303. ],
  2304. "uses": [
  2305. 138
  2306. ],
  2307. "idx": 232
  2308. },
  2309. {
  2310. "path": "../packages/core/src/mixin/Queryable.js",
  2311. "requires": [],
  2312. "uses": [
  2313. 24
  2314. ],
  2315. "idx": 233
  2316. },
  2317. {
  2318. "path": "../packages/core/src/data/TreeModel.js",
  2319. "requires": [
  2320. 157,
  2321. 232,
  2322. 233
  2323. ],
  2324. "uses": [],
  2325. "idx": 234
  2326. },
  2327. {
  2328. "path": "../packages/core/src/data/NodeStore.js",
  2329. "requires": [
  2330. 175,
  2331. 232,
  2332. 234
  2333. ],
  2334. "uses": [
  2335. 157
  2336. ],
  2337. "idx": 235
  2338. },
  2339. {
  2340. "path": "../packages/core/src/data/Request.js",
  2341. "requires": [],
  2342. "uses": [],
  2343. "idx": 236
  2344. },
  2345. {
  2346. "path": "../packages/core/src/data/TreeStore.js",
  2347. "requires": [
  2348. 53,
  2349. 175,
  2350. 232,
  2351. 234
  2352. ],
  2353. "uses": [
  2354. 157
  2355. ],
  2356. "idx": 237
  2357. },
  2358. {
  2359. "path": "../packages/core/src/data/Types.js",
  2360. "requires": [
  2361. 147
  2362. ],
  2363. "uses": [],
  2364. "idx": 238
  2365. },
  2366. {
  2367. "path": "../packages/core/src/data/Validation.js",
  2368. "requires": [
  2369. 157
  2370. ],
  2371. "uses": [],
  2372. "idx": 239
  2373. },
  2374. {
  2375. "path": "../packages/core/src/dom/Helper.js",
  2376. "requires": [],
  2377. "uses": [
  2378. 92
  2379. ],
  2380. "idx": 240
  2381. },
  2382. {
  2383. "path": "../packages/core/src/dom/Query.js",
  2384. "requires": [
  2385. 22,
  2386. 240
  2387. ],
  2388. "uses": [
  2389. 23
  2390. ],
  2391. "idx": 241
  2392. },
  2393. {
  2394. "path": "../packages/core/src/data/reader/Xml.js",
  2395. "requires": [
  2396. 159,
  2397. 241
  2398. ],
  2399. "uses": [],
  2400. "idx": 242
  2401. },
  2402. {
  2403. "path": "../packages/core/src/data/writer/Xml.js",
  2404. "requires": [
  2405. 160
  2406. ],
  2407. "uses": [],
  2408. "idx": 243
  2409. },
  2410. {
  2411. "path": "../packages/core/src/data/XmlStore.js",
  2412. "requires": [
  2413. 169,
  2414. 175,
  2415. 242,
  2416. 243
  2417. ],
  2418. "uses": [],
  2419. "idx": 244
  2420. },
  2421. {
  2422. "path": "../packages/core/src/data/identifier/Negative.js",
  2423. "requires": [
  2424. 156
  2425. ],
  2426. "uses": [],
  2427. "idx": 245
  2428. },
  2429. {
  2430. "path": "../packages/core/src/data/identifier/Uuid.js",
  2431. "requires": [
  2432. 155
  2433. ],
  2434. "uses": [],
  2435. "idx": 246
  2436. },
  2437. {
  2438. "path": "../packages/core/src/data/proxy/WebStorage.js",
  2439. "requires": [
  2440. 156,
  2441. 162
  2442. ],
  2443. "uses": [
  2444. 53,
  2445. 92,
  2446. 158
  2447. ],
  2448. "idx": 247
  2449. },
  2450. {
  2451. "path": "../packages/core/src/data/proxy/LocalStorage.js",
  2452. "requires": [
  2453. 247
  2454. ],
  2455. "uses": [],
  2456. "idx": 248
  2457. },
  2458. {
  2459. "path": "../packages/core/src/data/proxy/Rest.js",
  2460. "requires": [
  2461. 169
  2462. ],
  2463. "uses": [],
  2464. "idx": 249
  2465. },
  2466. {
  2467. "path": "../packages/core/src/data/proxy/SessionStorage.js",
  2468. "requires": [
  2469. 247
  2470. ],
  2471. "uses": [],
  2472. "idx": 250
  2473. },
  2474. {
  2475. "path": "../packages/core/src/data/schema/BelongsTo.js",
  2476. "requires": [],
  2477. "uses": [],
  2478. "idx": 251
  2479. },
  2480. {
  2481. "path": "../packages/core/src/data/schema/HasMany.js",
  2482. "requires": [],
  2483. "uses": [],
  2484. "idx": 252
  2485. },
  2486. {
  2487. "path": "../packages/core/src/data/schema/HasOne.js",
  2488. "requires": [],
  2489. "uses": [],
  2490. "idx": 253
  2491. },
  2492. {
  2493. "path": "../packages/core/src/data/schema/Reference.js",
  2494. "requires": [],
  2495. "uses": [],
  2496. "idx": 254
  2497. },
  2498. {
  2499. "path": "../packages/core/src/data/summary/Base.js",
  2500. "requires": [
  2501. 12
  2502. ],
  2503. "uses": [],
  2504. "idx": 255
  2505. },
  2506. {
  2507. "path": "../packages/core/src/data/summary/Sum.js",
  2508. "requires": [
  2509. 255
  2510. ],
  2511. "uses": [],
  2512. "idx": 256
  2513. },
  2514. {
  2515. "path": "../packages/core/src/data/summary/Average.js",
  2516. "requires": [
  2517. 256
  2518. ],
  2519. "uses": [],
  2520. "idx": 257
  2521. },
  2522. {
  2523. "path": "../packages/core/src/data/summary/Count.js",
  2524. "requires": [
  2525. 255
  2526. ],
  2527. "uses": [],
  2528. "idx": 258
  2529. },
  2530. {
  2531. "path": "../packages/core/src/data/summary/Max.js",
  2532. "requires": [
  2533. 255
  2534. ],
  2535. "uses": [],
  2536. "idx": 259
  2537. },
  2538. {
  2539. "path": "../packages/core/src/data/summary/Min.js",
  2540. "requires": [
  2541. 255
  2542. ],
  2543. "uses": [],
  2544. "idx": 260
  2545. },
  2546. {
  2547. "path": "../packages/core/src/data/validator/AbstractDate.js",
  2548. "requires": [
  2549. 148
  2550. ],
  2551. "uses": [],
  2552. "idx": 261
  2553. },
  2554. {
  2555. "path": "../packages/core/src/data/validator/Bound.js",
  2556. "requires": [
  2557. 148
  2558. ],
  2559. "uses": [
  2560. 92
  2561. ],
  2562. "idx": 262
  2563. },
  2564. {
  2565. "path": "../packages/core/src/data/validator/Format.js",
  2566. "requires": [
  2567. 148
  2568. ],
  2569. "uses": [],
  2570. "idx": 263
  2571. },
  2572. {
  2573. "path": "../packages/core/src/data/validator/CIDRv4.js",
  2574. "requires": [
  2575. 263
  2576. ],
  2577. "uses": [],
  2578. "idx": 264
  2579. },
  2580. {
  2581. "path": "../packages/core/src/data/validator/CIDRv6.js",
  2582. "requires": [
  2583. 263
  2584. ],
  2585. "uses": [],
  2586. "idx": 265
  2587. },
  2588. {
  2589. "path": "../packages/core/src/data/validator/Number.js",
  2590. "requires": [
  2591. 148
  2592. ],
  2593. "uses": [
  2594. 91
  2595. ],
  2596. "idx": 266
  2597. },
  2598. {
  2599. "path": "../packages/core/src/data/validator/Currency.js",
  2600. "requires": [
  2601. 266
  2602. ],
  2603. "uses": [
  2604. 91
  2605. ],
  2606. "idx": 267
  2607. },
  2608. {
  2609. "path": "../packages/core/src/data/validator/CurrencyUS.js",
  2610. "requires": [
  2611. 267
  2612. ],
  2613. "uses": [],
  2614. "idx": 268
  2615. },
  2616. {
  2617. "path": "../packages/core/src/data/validator/Date.js",
  2618. "requires": [
  2619. 261
  2620. ],
  2621. "uses": [],
  2622. "idx": 269
  2623. },
  2624. {
  2625. "path": "../packages/core/src/data/validator/DateTime.js",
  2626. "requires": [
  2627. 261
  2628. ],
  2629. "uses": [],
  2630. "idx": 270
  2631. },
  2632. {
  2633. "path": "../packages/core/src/data/validator/Email.js",
  2634. "requires": [
  2635. 263
  2636. ],
  2637. "uses": [],
  2638. "idx": 271
  2639. },
  2640. {
  2641. "path": "../packages/core/src/data/validator/List.js",
  2642. "requires": [
  2643. 148
  2644. ],
  2645. "uses": [],
  2646. "idx": 272
  2647. },
  2648. {
  2649. "path": "../packages/core/src/data/validator/Exclusion.js",
  2650. "requires": [
  2651. 272
  2652. ],
  2653. "uses": [],
  2654. "idx": 273
  2655. },
  2656. {
  2657. "path": "../packages/core/src/data/validator/IPAddress.js",
  2658. "requires": [
  2659. 263
  2660. ],
  2661. "uses": [],
  2662. "idx": 274
  2663. },
  2664. {
  2665. "path": "../packages/core/src/data/validator/Inclusion.js",
  2666. "requires": [
  2667. 272
  2668. ],
  2669. "uses": [],
  2670. "idx": 275
  2671. },
  2672. {
  2673. "path": "../packages/core/src/data/validator/Length.js",
  2674. "requires": [
  2675. 262
  2676. ],
  2677. "uses": [],
  2678. "idx": 276
  2679. },
  2680. {
  2681. "path": "../packages/core/src/data/validator/Presence.js",
  2682. "requires": [
  2683. 148
  2684. ],
  2685. "uses": [],
  2686. "idx": 277
  2687. },
  2688. {
  2689. "path": "../packages/core/src/data/validator/NotNull.js",
  2690. "requires": [
  2691. 277
  2692. ],
  2693. "uses": [],
  2694. "idx": 278
  2695. },
  2696. {
  2697. "path": "../packages/core/src/data/validator/Phone.js",
  2698. "requires": [
  2699. 263
  2700. ],
  2701. "uses": [],
  2702. "idx": 279
  2703. },
  2704. {
  2705. "path": "../packages/core/src/data/validator/Range.js",
  2706. "requires": [
  2707. 262
  2708. ],
  2709. "uses": [],
  2710. "idx": 280
  2711. },
  2712. {
  2713. "path": "../packages/core/src/data/validator/Time.js",
  2714. "requires": [
  2715. 261
  2716. ],
  2717. "uses": [],
  2718. "idx": 281
  2719. },
  2720. {
  2721. "path": "../packages/core/src/data/validator/Url.js",
  2722. "requires": [
  2723. 263
  2724. ],
  2725. "uses": [],
  2726. "idx": 282
  2727. },
  2728. {
  2729. "path": "../packages/core/src/data/virtual/Group.js",
  2730. "requires": [],
  2731. "uses": [],
  2732. "idx": 283
  2733. },
  2734. {
  2735. "path": "../packages/core/src/data/virtual/Page.js",
  2736. "requires": [],
  2737. "uses": [],
  2738. "idx": 284
  2739. },
  2740. {
  2741. "path": "../packages/core/src/data/virtual/PageMap.js",
  2742. "requires": [
  2743. 284
  2744. ],
  2745. "uses": [],
  2746. "idx": 285
  2747. },
  2748. {
  2749. "path": "../packages/core/src/data/virtual/Range.js",
  2750. "requires": [
  2751. 129
  2752. ],
  2753. "uses": [],
  2754. "idx": 286
  2755. },
  2756. {
  2757. "path": "../packages/core/src/data/virtual/Store.js",
  2758. "requires": [
  2759. 164,
  2760. 172,
  2761. 173,
  2762. 285,
  2763. 286
  2764. ],
  2765. "uses": [
  2766. 127,
  2767. 128,
  2768. 283
  2769. ],
  2770. "idx": 287
  2771. },
  2772. {
  2773. "path": "../packages/core/src/direct/Event.js",
  2774. "requires": [],
  2775. "uses": [],
  2776. "idx": 288
  2777. },
  2778. {
  2779. "path": "../packages/core/src/direct/RemotingEvent.js",
  2780. "requires": [
  2781. 288
  2782. ],
  2783. "uses": [
  2784. 220
  2785. ],
  2786. "idx": 289
  2787. },
  2788. {
  2789. "path": "../packages/core/src/direct/ExceptionEvent.js",
  2790. "requires": [
  2791. 289
  2792. ],
  2793. "uses": [],
  2794. "idx": 290
  2795. },
  2796. {
  2797. "path": "../packages/core/src/direct/JsonProvider.js",
  2798. "requires": [
  2799. 221
  2800. ],
  2801. "uses": [
  2802. 220,
  2803. 290
  2804. ],
  2805. "idx": 291
  2806. },
  2807. {
  2808. "path": "../packages/core/src/direct/PollingProvider.js",
  2809. "requires": [
  2810. 18,
  2811. 56,
  2812. 290,
  2813. 291
  2814. ],
  2815. "uses": [
  2816. 220,
  2817. 389
  2818. ],
  2819. "idx": 292
  2820. },
  2821. {
  2822. "path": "../packages/core/src/direct/RemotingMethod.js",
  2823. "requires": [],
  2824. "uses": [],
  2825. "idx": 293
  2826. },
  2827. {
  2828. "path": "../packages/core/src/direct/Transaction.js",
  2829. "requires": [],
  2830. "uses": [],
  2831. "idx": 294
  2832. },
  2833. {
  2834. "path": "../packages/core/src/direct/RemotingProvider.js",
  2835. "requires": [
  2836. 1,
  2837. 55,
  2838. 220,
  2839. 291,
  2840. 293,
  2841. 294
  2842. ],
  2843. "uses": [
  2844. 78,
  2845. 290
  2846. ],
  2847. "idx": 295
  2848. },
  2849. {
  2850. "path": "../packages/core/src/dom/GarbageCollector.js",
  2851. "requires": [],
  2852. "uses": [
  2853. 49
  2854. ],
  2855. "idx": 296
  2856. },
  2857. {
  2858. "path": "../packages/core/src/dom/TouchAction.js",
  2859. "requires": [
  2860. 35,
  2861. 49
  2862. ],
  2863. "uses": [],
  2864. "idx": 297
  2865. },
  2866. {
  2867. "path": "../packages/core/src/drag/Constraint.js",
  2868. "requires": [
  2869. 12
  2870. ],
  2871. "uses": [
  2872. 34
  2873. ],
  2874. "idx": 298
  2875. },
  2876. {
  2877. "path": "../packages/core/src/drag/Info.js",
  2878. "requires": [
  2879. 10
  2880. ],
  2881. "uses": [],
  2882. "idx": 299
  2883. },
  2884. {
  2885. "path": "../packages/core/src/drag/Item.js",
  2886. "requires": [
  2887. 3,
  2888. 4
  2889. ],
  2890. "uses": [],
  2891. "idx": 300
  2892. },
  2893. {
  2894. "path": "../packages/core/src/drag/Manager.js",
  2895. "requires": [],
  2896. "uses": [
  2897. 49,
  2898. 80,
  2899. 299
  2900. ],
  2901. "idx": 301
  2902. },
  2903. {
  2904. "path": "../packages/core/src/drag/Source.js",
  2905. "requires": [
  2906. 76,
  2907. 298,
  2908. 300
  2909. ],
  2910. "uses": [
  2911. 12,
  2912. 299
  2913. ],
  2914. "idx": 302
  2915. },
  2916. {
  2917. "path": "../packages/core/src/drag/Target.js",
  2918. "requires": [
  2919. 300,
  2920. 301
  2921. ],
  2922. "uses": [],
  2923. "idx": 303
  2924. },
  2925. {
  2926. "path": "../packages/core/src/drag/proxy/None.js",
  2927. "requires": [
  2928. 12
  2929. ],
  2930. "uses": [],
  2931. "idx": 304
  2932. },
  2933. {
  2934. "path": "../packages/core/src/drag/proxy/Original.js",
  2935. "requires": [
  2936. 304
  2937. ],
  2938. "uses": [],
  2939. "idx": 305
  2940. },
  2941. {
  2942. "path": "../packages/core/src/drag/proxy/Placeholder.js",
  2943. "requires": [
  2944. 304
  2945. ],
  2946. "uses": [],
  2947. "idx": 306
  2948. },
  2949. {
  2950. "path": "../packages/core/src/event/gesture/Recognizer.js",
  2951. "requires": [
  2952. 3,
  2953. 38
  2954. ],
  2955. "uses": [],
  2956. "idx": 307
  2957. },
  2958. {
  2959. "path": "../packages/core/src/event/gesture/SingleTouch.js",
  2960. "requires": [
  2961. 307
  2962. ],
  2963. "uses": [],
  2964. "idx": 308
  2965. },
  2966. {
  2967. "path": "../packages/core/src/event/gesture/DoubleTap.js",
  2968. "requires": [
  2969. 308
  2970. ],
  2971. "uses": [
  2972. 49
  2973. ],
  2974. "idx": 309
  2975. },
  2976. {
  2977. "path": "../packages/core/src/event/gesture/Drag.js",
  2978. "requires": [
  2979. 308
  2980. ],
  2981. "uses": [
  2982. 49
  2983. ],
  2984. "idx": 310
  2985. },
  2986. {
  2987. "path": "../packages/core/src/event/gesture/Swipe.js",
  2988. "requires": [
  2989. 308
  2990. ],
  2991. "uses": [],
  2992. "idx": 311
  2993. },
  2994. {
  2995. "path": "../packages/core/src/event/gesture/EdgeSwipe.js",
  2996. "requires": [
  2997. 311
  2998. ],
  2999. "uses": [
  3000. 49
  3001. ],
  3002. "idx": 312
  3003. },
  3004. {
  3005. "path": "../packages/core/src/event/gesture/LongPress.js",
  3006. "requires": [
  3007. 308
  3008. ],
  3009. "uses": [
  3010. 38,
  3011. 49,
  3012. 310
  3013. ],
  3014. "idx": 313
  3015. },
  3016. {
  3017. "path": "../packages/core/src/event/gesture/MultiTouch.js",
  3018. "requires": [
  3019. 307
  3020. ],
  3021. "uses": [],
  3022. "idx": 314
  3023. },
  3024. {
  3025. "path": "../packages/core/src/event/gesture/Pinch.js",
  3026. "requires": [
  3027. 314
  3028. ],
  3029. "uses": [],
  3030. "idx": 315
  3031. },
  3032. {
  3033. "path": "../packages/core/src/event/gesture/Rotate.js",
  3034. "requires": [
  3035. 314
  3036. ],
  3037. "uses": [],
  3038. "idx": 316
  3039. },
  3040. {
  3041. "path": "../packages/core/src/event/gesture/Tap.js",
  3042. "requires": [
  3043. 308
  3044. ],
  3045. "uses": [
  3046. 49
  3047. ],
  3048. "idx": 317
  3049. },
  3050. {
  3051. "path": "../packages/core/src/event/publisher/Focus.js",
  3052. "requires": [
  3053. 37,
  3054. 49,
  3055. 74,
  3056. 76
  3057. ],
  3058. "uses": [
  3059. 36
  3060. ],
  3061. "idx": 318
  3062. },
  3063. {
  3064. "path": "../packages/core/src/field/InputMask.js",
  3065. "requires": [],
  3066. "uses": [],
  3067. "idx": 319
  3068. },
  3069. {
  3070. "path": "../packages/core/src/fx/State.js",
  3071. "requires": [],
  3072. "uses": [],
  3073. "idx": 320
  3074. },
  3075. {
  3076. "path": "../packages/core/src/fx/animation/Abstract.js",
  3077. "requires": [
  3078. 12,
  3079. 25,
  3080. 320
  3081. ],
  3082. "uses": [],
  3083. "idx": 321
  3084. },
  3085. {
  3086. "path": "../packages/core/src/fx/animation/Slide.js",
  3087. "requires": [
  3088. 321
  3089. ],
  3090. "uses": [],
  3091. "idx": 322
  3092. },
  3093. {
  3094. "path": "../packages/core/src/fx/animation/SlideOut.js",
  3095. "requires": [
  3096. 322
  3097. ],
  3098. "uses": [],
  3099. "idx": 323
  3100. },
  3101. {
  3102. "path": "../packages/core/src/fx/animation/Fade.js",
  3103. "requires": [
  3104. 321
  3105. ],
  3106. "uses": [],
  3107. "idx": 324
  3108. },
  3109. {
  3110. "path": "../packages/core/src/fx/animation/FadeOut.js",
  3111. "requires": [
  3112. 324
  3113. ],
  3114. "uses": [],
  3115. "idx": 325
  3116. },
  3117. {
  3118. "path": "../packages/core/src/fx/animation/Flip.js",
  3119. "requires": [
  3120. 321
  3121. ],
  3122. "uses": [],
  3123. "idx": 326
  3124. },
  3125. {
  3126. "path": "../packages/core/src/fx/animation/Pop.js",
  3127. "requires": [
  3128. 321
  3129. ],
  3130. "uses": [],
  3131. "idx": 327
  3132. },
  3133. {
  3134. "path": "../packages/core/src/fx/animation/PopOut.js",
  3135. "requires": [
  3136. 327
  3137. ],
  3138. "uses": [],
  3139. "idx": 328
  3140. },
  3141. {
  3142. "path": "../packages/core/src/fx/Animation.js",
  3143. "requires": [
  3144. 322,
  3145. 323,
  3146. 324,
  3147. 325,
  3148. 326,
  3149. 327,
  3150. 328
  3151. ],
  3152. "uses": [
  3153. 321
  3154. ],
  3155. "idx": 329
  3156. },
  3157. {
  3158. "path": "../packages/core/src/fx/runner/Css.js",
  3159. "requires": [
  3160. 25,
  3161. 329
  3162. ],
  3163. "uses": [
  3164. 49
  3165. ],
  3166. "idx": 330
  3167. },
  3168. {
  3169. "path": "../packages/core/src/fx/runner/CssTransition.js",
  3170. "requires": [
  3171. 19,
  3172. 330
  3173. ],
  3174. "uses": [
  3175. 329
  3176. ],
  3177. "idx": 331
  3178. },
  3179. {
  3180. "path": "../packages/core/src/fx/Runner.js",
  3181. "requires": [
  3182. 331
  3183. ],
  3184. "uses": [],
  3185. "idx": 332
  3186. },
  3187. {
  3188. "path": "../packages/core/src/fx/animation/Cube.js",
  3189. "requires": [
  3190. 321
  3191. ],
  3192. "uses": [],
  3193. "idx": 333
  3194. },
  3195. {
  3196. "path": "../packages/core/src/fx/animation/Wipe.js",
  3197. "requires": [
  3198. 329
  3199. ],
  3200. "uses": [],
  3201. "idx": 334
  3202. },
  3203. {
  3204. "path": "../packages/core/src/fx/animation/WipeOut.js",
  3205. "requires": [
  3206. 334
  3207. ],
  3208. "uses": [],
  3209. "idx": 335
  3210. },
  3211. {
  3212. "path": "../packages/core/src/fx/easing/Bounce.js",
  3213. "requires": [
  3214. 102
  3215. ],
  3216. "uses": [],
  3217. "idx": 336
  3218. },
  3219. {
  3220. "path": "../packages/core/src/fx/easing/Momentum.js",
  3221. "requires": [
  3222. 102
  3223. ],
  3224. "uses": [],
  3225. "idx": 337
  3226. },
  3227. {
  3228. "path": "../packages/core/src/fx/easing/BoundMomentum.js",
  3229. "requires": [
  3230. 102,
  3231. 336,
  3232. 337
  3233. ],
  3234. "uses": [],
  3235. "idx": 338
  3236. },
  3237. {
  3238. "path": "../packages/core/src/fx/easing/EaseIn.js",
  3239. "requires": [
  3240. 103
  3241. ],
  3242. "uses": [],
  3243. "idx": 339
  3244. },
  3245. {
  3246. "path": "../packages/core/src/fx/easing/EaseOut.js",
  3247. "requires": [
  3248. 103
  3249. ],
  3250. "uses": [],
  3251. "idx": 340
  3252. },
  3253. {
  3254. "path": "../packages/core/src/fx/easing/Easing.js",
  3255. "requires": [
  3256. 103
  3257. ],
  3258. "uses": [],
  3259. "idx": 341
  3260. },
  3261. {
  3262. "path": "../packages/core/src/fx/runner/CssAnimation.js",
  3263. "requires": [
  3264. 330
  3265. ],
  3266. "uses": [
  3267. 329
  3268. ],
  3269. "idx": 342
  3270. },
  3271. {
  3272. "path": "../packages/core/src/list/AbstractTreeItem.js",
  3273. "requires": [
  3274. 88
  3275. ],
  3276. "uses": [],
  3277. "idx": 343
  3278. },
  3279. {
  3280. "path": "../packages/core/src/list/RootTreeItem.js",
  3281. "requires": [
  3282. 343
  3283. ],
  3284. "uses": [],
  3285. "idx": 344
  3286. },
  3287. {
  3288. "path": "../packages/core/src/mixin/ItemRippler.js",
  3289. "requires": [],
  3290. "uses": [],
  3291. "idx": 345
  3292. },
  3293. {
  3294. "path": "../packages/core/src/list/TreeItem.js",
  3295. "requires": [
  3296. 88,
  3297. 343
  3298. ],
  3299. "uses": [],
  3300. "idx": 346
  3301. },
  3302. {
  3303. "path": "../packages/core/src/list/Tree.js",
  3304. "requires": [
  3305. 88,
  3306. 344,
  3307. 345,
  3308. 346
  3309. ],
  3310. "uses": [
  3311. 157,
  3312. 178
  3313. ],
  3314. "idx": 347
  3315. },
  3316. {
  3317. "path": "../packages/core/src/mixin/ConfigProxy.js",
  3318. "requires": [
  3319. 0
  3320. ],
  3321. "uses": [],
  3322. "idx": 348
  3323. },
  3324. {
  3325. "path": "../packages/core/src/mixin/ConfigState.js",
  3326. "requires": [
  3327. 0
  3328. ],
  3329. "uses": [],
  3330. "idx": 349
  3331. },
  3332. {
  3333. "path": "../packages/core/src/mixin/Container.js",
  3334. "requires": [
  3335. 0
  3336. ],
  3337. "uses": [
  3338. 21
  3339. ],
  3340. "idx": 350
  3341. },
  3342. {
  3343. "path": "../packages/core/src/util/KeyMap.js",
  3344. "requires": [],
  3345. "uses": [],
  3346. "idx": 351
  3347. },
  3348. {
  3349. "path": "../packages/core/src/util/KeyNav.js",
  3350. "requires": [
  3351. 351
  3352. ],
  3353. "uses": [
  3354. 36
  3355. ],
  3356. "idx": 352
  3357. },
  3358. {
  3359. "path": "../packages/core/src/mixin/FocusableContainer.js",
  3360. "requires": [
  3361. 0,
  3362. 352
  3363. ],
  3364. "uses": [
  3365. 21
  3366. ],
  3367. "idx": 353
  3368. },
  3369. {
  3370. "path": "../packages/core/src/mixin/Hookable.js",
  3371. "requires": [
  3372. 0
  3373. ],
  3374. "uses": [],
  3375. "idx": 354
  3376. },
  3377. {
  3378. "path": "../packages/core/src/mixin/Mashup.js",
  3379. "requires": [
  3380. 0
  3381. ],
  3382. "uses": [
  3383. 92
  3384. ],
  3385. "idx": 355
  3386. },
  3387. {
  3388. "path": "../packages/core/src/mixin/Responsive.js",
  3389. "requires": [
  3390. 0,
  3391. 76
  3392. ],
  3393. "uses": [
  3394. 49
  3395. ],
  3396. "idx": 356
  3397. },
  3398. {
  3399. "path": "../packages/core/src/mixin/Selectable.js",
  3400. "requires": [
  3401. 0
  3402. ],
  3403. "uses": [
  3404. 128
  3405. ],
  3406. "idx": 357
  3407. },
  3408. {
  3409. "path": "../packages/core/src/mixin/StoreWatcher.js",
  3410. "requires": [],
  3411. "uses": [],
  3412. "idx": 358
  3413. },
  3414. {
  3415. "path": "../packages/core/src/mixin/StyleCacher.js",
  3416. "requires": [
  3417. 0
  3418. ],
  3419. "uses": [],
  3420. "idx": 359
  3421. },
  3422. {
  3423. "path": "../packages/core/src/mixin/Traversable.js",
  3424. "requires": [
  3425. 0
  3426. ],
  3427. "uses": [],
  3428. "idx": 360
  3429. },
  3430. {
  3431. "path": "../packages/core/src/perf/Accumulator.js",
  3432. "requires": [
  3433. 95
  3434. ],
  3435. "uses": [],
  3436. "idx": 361
  3437. },
  3438. {
  3439. "path": "../packages/core/src/perf/Monitor.js",
  3440. "requires": [
  3441. 361
  3442. ],
  3443. "uses": [],
  3444. "idx": 362
  3445. },
  3446. {
  3447. "path": "../packages/core/src/plugin/AbstractClipboard.js",
  3448. "requires": [
  3449. 83,
  3450. 351
  3451. ],
  3452. "uses": [
  3453. 49
  3454. ],
  3455. "idx": 363
  3456. },
  3457. {
  3458. "path": "../packages/core/src/plugin/MouseEnter.js",
  3459. "requires": [
  3460. 83
  3461. ],
  3462. "uses": [],
  3463. "idx": 364
  3464. },
  3465. {
  3466. "path": "../packages/core/src/sparkline/Shape.js",
  3467. "requires": [],
  3468. "uses": [],
  3469. "idx": 365
  3470. },
  3471. {
  3472. "path": "../packages/core/src/sparkline/CanvasBase.js",
  3473. "requires": [
  3474. 365
  3475. ],
  3476. "uses": [],
  3477. "idx": 366
  3478. },
  3479. {
  3480. "path": "../packages/core/src/sparkline/CanvasCanvas.js",
  3481. "requires": [
  3482. 366
  3483. ],
  3484. "uses": [],
  3485. "idx": 367
  3486. },
  3487. {
  3488. "path": "../packages/core/src/sparkline/VmlCanvas.js",
  3489. "requires": [
  3490. 366
  3491. ],
  3492. "uses": [],
  3493. "idx": 368
  3494. },
  3495. {
  3496. "path": "../packages/core/src/util/Color.js",
  3497. "requires": [],
  3498. "uses": [],
  3499. "idx": 369
  3500. },
  3501. {
  3502. "path": "../packages/core/src/sparkline/Base.js",
  3503. "requires": [
  3504. 88,
  3505. 95,
  3506. 367,
  3507. 368,
  3508. 369
  3509. ],
  3510. "uses": [],
  3511. "idx": 370
  3512. },
  3513. {
  3514. "path": "../packages/core/src/sparkline/BarBase.js",
  3515. "requires": [
  3516. 370
  3517. ],
  3518. "uses": [],
  3519. "idx": 371
  3520. },
  3521. {
  3522. "path": "../packages/core/src/sparkline/RangeMap.js",
  3523. "requires": [],
  3524. "uses": [],
  3525. "idx": 372
  3526. },
  3527. {
  3528. "path": "../packages/core/src/sparkline/Bar.js",
  3529. "requires": [
  3530. 371,
  3531. 372
  3532. ],
  3533. "uses": [],
  3534. "idx": 373
  3535. },
  3536. {
  3537. "path": "../packages/core/src/sparkline/Box.js",
  3538. "requires": [
  3539. 370
  3540. ],
  3541. "uses": [],
  3542. "idx": 374
  3543. },
  3544. {
  3545. "path": "../packages/core/src/sparkline/Bullet.js",
  3546. "requires": [
  3547. 370
  3548. ],
  3549. "uses": [],
  3550. "idx": 375
  3551. },
  3552. {
  3553. "path": "../packages/core/src/sparkline/Discrete.js",
  3554. "requires": [
  3555. 371
  3556. ],
  3557. "uses": [],
  3558. "idx": 376
  3559. },
  3560. {
  3561. "path": "../packages/core/src/sparkline/Line.js",
  3562. "requires": [
  3563. 370,
  3564. 372
  3565. ],
  3566. "uses": [],
  3567. "idx": 377
  3568. },
  3569. {
  3570. "path": "../packages/core/src/sparkline/Pie.js",
  3571. "requires": [
  3572. 370
  3573. ],
  3574. "uses": [],
  3575. "idx": 378
  3576. },
  3577. {
  3578. "path": "../packages/core/src/sparkline/TriState.js",
  3579. "requires": [
  3580. 371,
  3581. 372
  3582. ],
  3583. "uses": [],
  3584. "idx": 379
  3585. },
  3586. {
  3587. "path": "../packages/core/src/util/Base64.js",
  3588. "requires": [],
  3589. "uses": [],
  3590. "idx": 380
  3591. },
  3592. {
  3593. "path": "../packages/core/src/util/DelimitedValue.js",
  3594. "requires": [],
  3595. "uses": [],
  3596. "idx": 381
  3597. },
  3598. {
  3599. "path": "../packages/core/src/util/CSV.js",
  3600. "requires": [
  3601. 381
  3602. ],
  3603. "uses": [],
  3604. "idx": 382
  3605. },
  3606. {
  3607. "path": "../packages/core/src/util/ClickRepeater.js",
  3608. "requires": [
  3609. 4
  3610. ],
  3611. "uses": [],
  3612. "idx": 383
  3613. },
  3614. {
  3615. "path": "../packages/core/src/util/Cookies.js",
  3616. "requires": [],
  3617. "uses": [],
  3618. "idx": 384
  3619. },
  3620. {
  3621. "path": "../packages/core/src/util/ItemCollection.js",
  3622. "requires": [
  3623. 55
  3624. ],
  3625. "uses": [],
  3626. "idx": 385
  3627. },
  3628. {
  3629. "path": "../packages/core/src/util/LocalStorage.js",
  3630. "requires": [],
  3631. "uses": [],
  3632. "idx": 386
  3633. },
  3634. {
  3635. "path": "../packages/core/src/util/Spans.js",
  3636. "requires": [],
  3637. "uses": [],
  3638. "idx": 387
  3639. },
  3640. {
  3641. "path": "../packages/core/src/util/TSV.js",
  3642. "requires": [
  3643. 381
  3644. ],
  3645. "uses": [],
  3646. "idx": 388
  3647. },
  3648. {
  3649. "path": "../packages/core/src/util/TaskManager.js",
  3650. "requires": [
  3651. 56
  3652. ],
  3653. "uses": [],
  3654. "idx": 389
  3655. },
  3656. {
  3657. "path": "../packages/core/src/util/TextMetrics.js",
  3658. "requires": [
  3659. 49
  3660. ],
  3661. "uses": [
  3662. 74
  3663. ],
  3664. "idx": 390
  3665. },
  3666. {
  3667. "path": "../packages/core/src/util/paintmonitor/OverflowChange.js",
  3668. "requires": [
  3669. 45
  3670. ],
  3671. "uses": [],
  3672. "idx": 391
  3673. },
  3674. {
  3675. "path": "../packages/core/src/util/sizemonitor/OverflowChange.js",
  3676. "requires": [
  3677. 41
  3678. ],
  3679. "uses": [
  3680. 40
  3681. ],
  3682. "idx": 392
  3683. },
  3684. {
  3685. "path": "../packages/core/src/util/translatable/CssPosition.js",
  3686. "requires": [
  3687. 105
  3688. ],
  3689. "uses": [],
  3690. "idx": 393
  3691. },
  3692. {
  3693. "path": "../packages/core/src/util/translatable/CssTransform.js",
  3694. "requires": [
  3695. 105
  3696. ],
  3697. "uses": [],
  3698. "idx": 394
  3699. },
  3700. {
  3701. "path": "../packages/core/src/util/translatable/ScrollParent.js",
  3702. "requires": [
  3703. 105
  3704. ],
  3705. "uses": [],
  3706. "idx": 395
  3707. },
  3708. {
  3709. "path": "../classic/classic/src/Action.js",
  3710. "requires": [],
  3711. "uses": [],
  3712. "idx": 396
  3713. },
  3714. {
  3715. "path": "../classic/classic/src/ElementLoader.js",
  3716. "requires": [
  3717. 51
  3718. ],
  3719. "uses": [
  3720. 17,
  3721. 18
  3722. ],
  3723. "idx": 397
  3724. },
  3725. {
  3726. "path": "../classic/classic/src/ComponentLoader.js",
  3727. "requires": [
  3728. 397
  3729. ],
  3730. "uses": [],
  3731. "idx": 398
  3732. },
  3733. {
  3734. "path": "../classic/classic/src/layout/SizeModel.js",
  3735. "requires": [],
  3736. "uses": [],
  3737. "idx": 399
  3738. },
  3739. {
  3740. "path": "../classic/classic/src/layout/Layout.js",
  3741. "requires": [
  3742. 12,
  3743. 95,
  3744. 399
  3745. ],
  3746. "uses": [
  3747. 626
  3748. ],
  3749. "idx": 400
  3750. },
  3751. {
  3752. "path": "../classic/classic/src/layout/container/Container.js",
  3753. "requires": [
  3754. 95,
  3755. 109,
  3756. 400
  3757. ],
  3758. "uses": [
  3759. 240
  3760. ],
  3761. "idx": 401
  3762. },
  3763. {
  3764. "path": "../classic/classic/src/layout/container/Auto.js",
  3765. "requires": [
  3766. 401
  3767. ],
  3768. "uses": [
  3769. 95
  3770. ],
  3771. "idx": 402
  3772. },
  3773. {
  3774. "path": "../classic/classic/src/ZIndexManager.js",
  3775. "requires": [
  3776. 76,
  3777. 172,
  3778. 173
  3779. ],
  3780. "uses": [
  3781. 49,
  3782. 128
  3783. ],
  3784. "idx": 403
  3785. },
  3786. {
  3787. "path": "../classic/classic/src/container/Container.js",
  3788. "requires": [
  3789. 55,
  3790. 114,
  3791. 233,
  3792. 350,
  3793. 353,
  3794. 385,
  3795. 396,
  3796. 402,
  3797. 403
  3798. ],
  3799. "uses": [
  3800. 12,
  3801. 21,
  3802. 24,
  3803. 49
  3804. ],
  3805. "idx": 404
  3806. },
  3807. {
  3808. "path": "../classic/classic/src/layout/container/Editor.js",
  3809. "requires": [
  3810. 401
  3811. ],
  3812. "uses": [],
  3813. "idx": 405
  3814. },
  3815. {
  3816. "path": "../classic/classic/src/Editor.js",
  3817. "requires": [
  3818. 404,
  3819. 405
  3820. ],
  3821. "uses": [
  3822. 1,
  3823. 21
  3824. ],
  3825. "idx": 406
  3826. },
  3827. {
  3828. "path": "../classic/classic/src/EventManager.js",
  3829. "requires": [],
  3830. "uses": [
  3831. 76
  3832. ],
  3833. "idx": 407
  3834. },
  3835. {
  3836. "path": "../classic/classic/src/Gadget.js",
  3837. "requires": [],
  3838. "uses": [],
  3839. "idx": 408
  3840. },
  3841. {
  3842. "path": "../classic/classic/src/Img.js",
  3843. "requires": [
  3844. 77,
  3845. 114
  3846. ],
  3847. "uses": [],
  3848. "idx": 409
  3849. },
  3850. {
  3851. "path": "../classic/classic/src/util/StoreHolder.js",
  3852. "requires": [
  3853. 178
  3854. ],
  3855. "uses": [],
  3856. "idx": 410
  3857. },
  3858. {
  3859. "path": "../classic/classic/src/LoadMask.js",
  3860. "requires": [
  3861. 114,
  3862. 410
  3863. ],
  3864. "uses": [
  3865. 49,
  3866. 76,
  3867. 178
  3868. ],
  3869. "idx": 411
  3870. },
  3871. {
  3872. "path": "../classic/classic/src/layout/component/Component.js",
  3873. "requires": [
  3874. 400
  3875. ],
  3876. "uses": [],
  3877. "idx": 412
  3878. },
  3879. {
  3880. "path": "../classic/classic/src/layout/component/Auto.js",
  3881. "requires": [
  3882. 412
  3883. ],
  3884. "uses": [],
  3885. "idx": 413
  3886. },
  3887. {
  3888. "path": "../classic/classic/src/layout/component/ProgressBar.js",
  3889. "requires": [
  3890. 413
  3891. ],
  3892. "uses": [],
  3893. "idx": 414
  3894. },
  3895. {
  3896. "path": "../classic/classic/src/ProgressBar.js",
  3897. "requires": [
  3898. 89,
  3899. 92,
  3900. 99,
  3901. 114,
  3902. 389,
  3903. 414
  3904. ],
  3905. "uses": [
  3906. 72
  3907. ],
  3908. "idx": 415
  3909. },
  3910. {
  3911. "path": "../classic/classic/src/dom/ButtonElement.js",
  3912. "requires": [
  3913. 49
  3914. ],
  3915. "uses": [],
  3916. "idx": 416
  3917. },
  3918. {
  3919. "path": "../classic/classic/src/button/Manager.js",
  3920. "requires": [],
  3921. "uses": [],
  3922. "idx": 417
  3923. },
  3924. {
  3925. "path": "../classic/classic/src/menu/Manager.js",
  3926. "requires": [],
  3927. "uses": [
  3928. 21,
  3929. 107,
  3930. 114,
  3931. 590
  3932. ],
  3933. "idx": 418
  3934. },
  3935. {
  3936. "path": "../classic/classic/src/button/Button.js",
  3937. "requires": [
  3938. 77,
  3939. 114,
  3940. 233,
  3941. 383,
  3942. 390,
  3943. 416,
  3944. 417,
  3945. 418
  3946. ],
  3947. "uses": [
  3948. 49,
  3949. 534
  3950. ],
  3951. "idx": 419
  3952. },
  3953. {
  3954. "path": "../classic/classic/src/button/Split.js",
  3955. "requires": [
  3956. 419
  3957. ],
  3958. "uses": [
  3959. 49,
  3960. 417
  3961. ],
  3962. "idx": 420
  3963. },
  3964. {
  3965. "path": "../classic/classic/src/button/Cycle.js",
  3966. "requires": [
  3967. 420
  3968. ],
  3969. "uses": [],
  3970. "idx": 421
  3971. },
  3972. {
  3973. "path": "../classic/classic/src/layout/container/SegmentedButton.js",
  3974. "requires": [
  3975. 401
  3976. ],
  3977. "uses": [],
  3978. "idx": 422
  3979. },
  3980. {
  3981. "path": "../classic/classic/src/button/Segmented.js",
  3982. "requires": [
  3983. 404,
  3984. 419,
  3985. 422
  3986. ],
  3987. "uses": [],
  3988. "idx": 423
  3989. },
  3990. {
  3991. "path": "../classic/classic/src/panel/Bar.js",
  3992. "requires": [
  3993. 404
  3994. ],
  3995. "uses": [],
  3996. "idx": 424
  3997. },
  3998. {
  3999. "path": "../classic/classic/src/panel/Title.js",
  4000. "requires": [
  4001. 77,
  4002. 114
  4003. ],
  4004. "uses": [],
  4005. "idx": 425
  4006. },
  4007. {
  4008. "path": "../classic/classic/src/panel/Tool.js",
  4009. "requires": [
  4010. 77,
  4011. 114
  4012. ],
  4013. "uses": [
  4014. 534
  4015. ],
  4016. "idx": 426
  4017. },
  4018. {
  4019. "path": "../classic/classic/src/panel/Header.js",
  4020. "requires": [
  4021. 413,
  4022. 424,
  4023. 425,
  4024. 426
  4025. ],
  4026. "uses": [
  4027. 21
  4028. ],
  4029. "idx": 427
  4030. },
  4031. {
  4032. "path": "../classic/classic/src/layout/container/boxOverflow/None.js",
  4033. "requires": [
  4034. 12
  4035. ],
  4036. "uses": [],
  4037. "idx": 428
  4038. },
  4039. {
  4040. "path": "../classic/classic/src/layout/container/boxOverflow/Scroller.js",
  4041. "requires": [
  4042. 4,
  4043. 49,
  4044. 383,
  4045. 428
  4046. ],
  4047. "uses": [
  4048. 114
  4049. ],
  4050. "idx": 429
  4051. },
  4052. {
  4053. "path": "../classic/classic/src/dd/DragDropManager.js",
  4054. "requires": [
  4055. 34,
  4056. 35
  4057. ],
  4058. "uses": [
  4059. 49,
  4060. 462,
  4061. 534
  4062. ],
  4063. "idx": 430
  4064. },
  4065. {
  4066. "path": "../classic/classic/src/resizer/Splitter.js",
  4067. "requires": [
  4068. 95,
  4069. 114
  4070. ],
  4071. "uses": [
  4072. 458
  4073. ],
  4074. "idx": 431
  4075. },
  4076. {
  4077. "path": "../classic/classic/src/layout/container/Box.js",
  4078. "requires": [
  4079. 91,
  4080. 401,
  4081. 428,
  4082. 429,
  4083. 430,
  4084. 431
  4085. ],
  4086. "uses": [
  4087. 12,
  4088. 399,
  4089. 413
  4090. ],
  4091. "idx": 432
  4092. },
  4093. {
  4094. "path": "../classic/classic/src/layout/container/HBox.js",
  4095. "requires": [
  4096. 432
  4097. ],
  4098. "uses": [],
  4099. "idx": 433
  4100. },
  4101. {
  4102. "path": "../classic/classic/src/layout/container/VBox.js",
  4103. "requires": [
  4104. 432
  4105. ],
  4106. "uses": [],
  4107. "idx": 434
  4108. },
  4109. {
  4110. "path": "../classic/classic/src/toolbar/Toolbar.js",
  4111. "requires": [
  4112. 404,
  4113. 413,
  4114. 433,
  4115. 434
  4116. ],
  4117. "uses": [
  4118. 114,
  4119. 364,
  4120. 516,
  4121. 537,
  4122. 661,
  4123. 662
  4124. ],
  4125. "idx": 435
  4126. },
  4127. {
  4128. "path": "../classic/classic/src/dd/DragDrop.js",
  4129. "requires": [
  4130. 430
  4131. ],
  4132. "uses": [
  4133. 49
  4134. ],
  4135. "idx": 436
  4136. },
  4137. {
  4138. "path": "../classic/classic/src/dd/DD.js",
  4139. "requires": [
  4140. 430,
  4141. 436
  4142. ],
  4143. "uses": [
  4144. 49
  4145. ],
  4146. "idx": 437
  4147. },
  4148. {
  4149. "path": "../classic/classic/src/dd/DDProxy.js",
  4150. "requires": [
  4151. 437
  4152. ],
  4153. "uses": [
  4154. 430
  4155. ],
  4156. "idx": 438
  4157. },
  4158. {
  4159. "path": "../classic/classic/src/dd/StatusProxy.js",
  4160. "requires": [
  4161. 114
  4162. ],
  4163. "uses": [],
  4164. "idx": 439
  4165. },
  4166. {
  4167. "path": "../classic/classic/src/dd/DragSource.js",
  4168. "requires": [
  4169. 430,
  4170. 438,
  4171. 439
  4172. ],
  4173. "uses": [
  4174. 413
  4175. ],
  4176. "idx": 440
  4177. },
  4178. {
  4179. "path": "../classic/classic/src/panel/Proxy.js",
  4180. "requires": [],
  4181. "uses": [
  4182. 49
  4183. ],
  4184. "idx": 441
  4185. },
  4186. {
  4187. "path": "../classic/classic/src/panel/DD.js",
  4188. "requires": [
  4189. 440,
  4190. 441
  4191. ],
  4192. "uses": [],
  4193. "idx": 442
  4194. },
  4195. {
  4196. "path": "../classic/classic/src/layout/component/Dock.js",
  4197. "requires": [
  4198. 412
  4199. ],
  4200. "uses": [
  4201. 24,
  4202. 49,
  4203. 399
  4204. ],
  4205. "idx": 443
  4206. },
  4207. {
  4208. "path": "../classic/classic/src/util/Memento.js",
  4209. "requires": [],
  4210. "uses": [],
  4211. "idx": 444
  4212. },
  4213. {
  4214. "path": "../classic/classic/src/container/DockingContainer.js",
  4215. "requires": [
  4216. 49,
  4217. 55
  4218. ],
  4219. "uses": [
  4220. 24,
  4221. 240,
  4222. 385
  4223. ],
  4224. "idx": 445
  4225. },
  4226. {
  4227. "path": "../classic/classic/src/panel/Panel.js",
  4228. "requires": [
  4229. 49,
  4230. 55,
  4231. 72,
  4232. 95,
  4233. 404,
  4234. 427,
  4235. 435,
  4236. 442,
  4237. 443,
  4238. 444,
  4239. 445
  4240. ],
  4241. "uses": [
  4242. 1,
  4243. 21,
  4244. 34,
  4245. 91,
  4246. 98,
  4247. 99,
  4248. 114,
  4249. 240,
  4250. 352,
  4251. 402,
  4252. 413,
  4253. 426,
  4254. 479
  4255. ],
  4256. "idx": 446
  4257. },
  4258. {
  4259. "path": "../classic/classic/src/layout/container/Table.js",
  4260. "requires": [
  4261. 401
  4262. ],
  4263. "uses": [],
  4264. "idx": 447
  4265. },
  4266. {
  4267. "path": "../classic/classic/src/container/ButtonGroup.js",
  4268. "requires": [
  4269. 446,
  4270. 447
  4271. ],
  4272. "uses": [],
  4273. "idx": 448
  4274. },
  4275. {
  4276. "path": "../classic/classic/src/container/Monitor.js",
  4277. "requires": [],
  4278. "uses": [
  4279. 24,
  4280. 55
  4281. ],
  4282. "idx": 449
  4283. },
  4284. {
  4285. "path": "../classic/classic/src/plugin/Responsive.js",
  4286. "requires": [
  4287. 356
  4288. ],
  4289. "uses": [],
  4290. "idx": 450
  4291. },
  4292. {
  4293. "path": "../classic/classic/src/plugin/Viewport.js",
  4294. "requires": [
  4295. 450
  4296. ],
  4297. "uses": [
  4298. 49,
  4299. 399
  4300. ],
  4301. "idx": 451
  4302. },
  4303. {
  4304. "path": "../classic/classic/src/container/Viewport.js",
  4305. "requires": [
  4306. 356,
  4307. 404,
  4308. 451
  4309. ],
  4310. "uses": [],
  4311. "idx": 452
  4312. },
  4313. {
  4314. "path": "../classic/classic/src/layout/container/Anchor.js",
  4315. "requires": [
  4316. 402
  4317. ],
  4318. "uses": [],
  4319. "idx": 453
  4320. },
  4321. {
  4322. "path": "../classic/classic/src/dashboard/Panel.js",
  4323. "requires": [
  4324. 446
  4325. ],
  4326. "uses": [
  4327. 21
  4328. ],
  4329. "idx": 454
  4330. },
  4331. {
  4332. "path": "../classic/classic/src/dashboard/Column.js",
  4333. "requires": [
  4334. 404,
  4335. 453,
  4336. 454
  4337. ],
  4338. "uses": [],
  4339. "idx": 455
  4340. },
  4341. {
  4342. "path": "../classic/classic/src/layout/container/Column.js",
  4343. "requires": [
  4344. 402
  4345. ],
  4346. "uses": [],
  4347. "idx": 456
  4348. },
  4349. {
  4350. "path": "../classic/classic/src/dd/DragTracker.js",
  4351. "requires": [
  4352. 51
  4353. ],
  4354. "uses": [
  4355. 34,
  4356. 114,
  4357. 352
  4358. ],
  4359. "idx": 457
  4360. },
  4361. {
  4362. "path": "../classic/classic/src/resizer/SplitterTracker.js",
  4363. "requires": [
  4364. 34,
  4365. 457
  4366. ],
  4367. "uses": [
  4368. 49,
  4369. 103
  4370. ],
  4371. "idx": 458
  4372. },
  4373. {
  4374. "path": "../classic/classic/src/layout/container/ColumnSplitterTracker.js",
  4375. "requires": [
  4376. 458
  4377. ],
  4378. "uses": [],
  4379. "idx": 459
  4380. },
  4381. {
  4382. "path": "../classic/classic/src/layout/container/ColumnSplitter.js",
  4383. "requires": [
  4384. 431,
  4385. 459
  4386. ],
  4387. "uses": [],
  4388. "idx": 460
  4389. },
  4390. {
  4391. "path": "../classic/classic/src/layout/container/Dashboard.js",
  4392. "requires": [
  4393. 456,
  4394. 460
  4395. ],
  4396. "uses": [
  4397. 413
  4398. ],
  4399. "idx": 461
  4400. },
  4401. {
  4402. "path": "../classic/classic/src/dd/DDTarget.js",
  4403. "requires": [
  4404. 436
  4405. ],
  4406. "uses": [],
  4407. "idx": 462
  4408. },
  4409. {
  4410. "path": "../classic/classic/src/dd/ScrollManager.js",
  4411. "requires": [
  4412. 430
  4413. ],
  4414. "uses": [],
  4415. "idx": 463
  4416. },
  4417. {
  4418. "path": "../classic/classic/src/dd/DropTarget.js",
  4419. "requires": [
  4420. 462,
  4421. 463
  4422. ],
  4423. "uses": [],
  4424. "idx": 464
  4425. },
  4426. {
  4427. "path": "../classic/classic/src/dashboard/DropZone.js",
  4428. "requires": [
  4429. 464
  4430. ],
  4431. "uses": [],
  4432. "idx": 465
  4433. },
  4434. {
  4435. "path": "../classic/classic/src/dashboard/Part.js",
  4436. "requires": [
  4437. 3,
  4438. 12,
  4439. 130
  4440. ],
  4441. "uses": [],
  4442. "idx": 466
  4443. },
  4444. {
  4445. "path": "../classic/classic/src/dashboard/Dashboard.js",
  4446. "requires": [
  4447. 446,
  4448. 455,
  4449. 461,
  4450. 465,
  4451. 466
  4452. ],
  4453. "uses": [
  4454. 12,
  4455. 112,
  4456. 128
  4457. ],
  4458. "idx": 467
  4459. },
  4460. {
  4461. "path": "../classic/classic/src/dd/DragZone.js",
  4462. "requires": [
  4463. 440
  4464. ],
  4465. "uses": [
  4466. 463,
  4467. 469
  4468. ],
  4469. "idx": 468
  4470. },
  4471. {
  4472. "path": "../classic/classic/src/dd/Registry.js",
  4473. "requires": [],
  4474. "uses": [],
  4475. "idx": 469
  4476. },
  4477. {
  4478. "path": "../classic/classic/src/dd/DropZone.js",
  4479. "requires": [
  4480. 464,
  4481. 469
  4482. ],
  4483. "uses": [
  4484. 430
  4485. ],
  4486. "idx": 470
  4487. },
  4488. {
  4489. "path": "../classic/classic/src/dom/Layer.js",
  4490. "requires": [
  4491. 49
  4492. ],
  4493. "uses": [
  4494. 240
  4495. ],
  4496. "idx": 471
  4497. },
  4498. {
  4499. "path": "../classic/classic/src/enums.js",
  4500. "requires": [],
  4501. "uses": [],
  4502. "idx": 472
  4503. },
  4504. {
  4505. "path": "../classic/classic/src/event/publisher/MouseEnterLeave.js",
  4506. "requires": [
  4507. 37
  4508. ],
  4509. "uses": [],
  4510. "idx": 473
  4511. },
  4512. {
  4513. "path": "../classic/classic/src/flash/Component.js",
  4514. "requires": [
  4515. 114
  4516. ],
  4517. "uses": [],
  4518. "idx": 474
  4519. },
  4520. {
  4521. "path": "../classic/classic/src/form/action/Action.js",
  4522. "requires": [],
  4523. "uses": [],
  4524. "idx": 475
  4525. },
  4526. {
  4527. "path": "../classic/classic/src/form/action/Load.js",
  4528. "requires": [
  4529. 17,
  4530. 475
  4531. ],
  4532. "uses": [
  4533. 18
  4534. ],
  4535. "idx": 476
  4536. },
  4537. {
  4538. "path": "../classic/classic/src/form/action/Submit.js",
  4539. "requires": [
  4540. 475
  4541. ],
  4542. "uses": [
  4543. 18,
  4544. 240
  4545. ],
  4546. "idx": 477
  4547. },
  4548. {
  4549. "path": "../classic/classic/src/form/action/StandardSubmit.js",
  4550. "requires": [
  4551. 477
  4552. ],
  4553. "uses": [],
  4554. "idx": 478
  4555. },
  4556. {
  4557. "path": "../classic/classic/src/util/ComponentDragger.js",
  4558. "requires": [
  4559. 457
  4560. ],
  4561. "uses": [
  4562. 34,
  4563. 49
  4564. ],
  4565. "idx": 479
  4566. },
  4567. {
  4568. "path": "../classic/classic/src/window/Window.js",
  4569. "requires": [
  4570. 34,
  4571. 446,
  4572. 479
  4573. ],
  4574. "uses": [],
  4575. "idx": 480
  4576. },
  4577. {
  4578. "path": "../classic/classic/src/form/Labelable.js",
  4579. "requires": [
  4580. 0,
  4581. 95
  4582. ],
  4583. "uses": [
  4584. 49,
  4585. 533
  4586. ],
  4587. "idx": 481
  4588. },
  4589. {
  4590. "path": "../classic/classic/src/form/field/Field.js",
  4591. "requires": [],
  4592. "uses": [],
  4593. "idx": 482
  4594. },
  4595. {
  4596. "path": "../classic/classic/src/form/field/Base.js",
  4597. "requires": [
  4598. 1,
  4599. 95,
  4600. 114,
  4601. 481,
  4602. 482
  4603. ],
  4604. "uses": [
  4605. 92,
  4606. 240
  4607. ],
  4608. "idx": 483
  4609. },
  4610. {
  4611. "path": "../classic/classic/src/layout/component/field/Text.js",
  4612. "requires": [
  4613. 413
  4614. ],
  4615. "uses": [],
  4616. "idx": 484
  4617. },
  4618. {
  4619. "path": "../classic/classic/src/form/field/VTypes.js",
  4620. "requires": [],
  4621. "uses": [],
  4622. "idx": 485
  4623. },
  4624. {
  4625. "path": "../classic/classic/src/form/trigger/Trigger.js",
  4626. "requires": [
  4627. 12,
  4628. 383
  4629. ],
  4630. "uses": [
  4631. 49,
  4632. 95
  4633. ],
  4634. "idx": 486
  4635. },
  4636. {
  4637. "path": "../classic/classic/src/form/field/Text.js",
  4638. "requires": [
  4639. 390,
  4640. 399,
  4641. 483,
  4642. 484,
  4643. 485,
  4644. 486
  4645. ],
  4646. "uses": [
  4647. 91,
  4648. 92,
  4649. 99
  4650. ],
  4651. "idx": 487
  4652. },
  4653. {
  4654. "path": "../classic/classic/src/form/field/TextArea.js",
  4655. "requires": [
  4656. 1,
  4657. 95,
  4658. 487
  4659. ],
  4660. "uses": [
  4661. 91,
  4662. 390
  4663. ],
  4664. "idx": 488
  4665. },
  4666. {
  4667. "path": "../classic/classic/src/window/MessageBox.js",
  4668. "requires": [
  4669. 415,
  4670. 419,
  4671. 433,
  4672. 435,
  4673. 453,
  4674. 480,
  4675. 487,
  4676. 488
  4677. ],
  4678. "uses": [
  4679. 114,
  4680. 404,
  4681. 413,
  4682. 414
  4683. ],
  4684. "idx": 489
  4685. },
  4686. {
  4687. "path": "../classic/classic/src/form/Basic.js",
  4688. "requires": [
  4689. 1,
  4690. 51,
  4691. 55,
  4692. 141,
  4693. 476,
  4694. 477,
  4695. 478,
  4696. 489
  4697. ],
  4698. "uses": [
  4699. 449
  4700. ],
  4701. "idx": 490
  4702. },
  4703. {
  4704. "path": "../classic/classic/src/form/FieldAncestor.js",
  4705. "requires": [
  4706. 0,
  4707. 449
  4708. ],
  4709. "uses": [],
  4710. "idx": 491
  4711. },
  4712. {
  4713. "path": "../classic/classic/src/layout/component/field/FieldContainer.js",
  4714. "requires": [
  4715. 413
  4716. ],
  4717. "uses": [],
  4718. "idx": 492
  4719. },
  4720. {
  4721. "path": "../classic/classic/src/form/FieldContainer.js",
  4722. "requires": [
  4723. 404,
  4724. 481,
  4725. 491,
  4726. 492
  4727. ],
  4728. "uses": [],
  4729. "idx": 493
  4730. },
  4731. {
  4732. "path": "../classic/classic/src/layout/container/CheckboxGroup.js",
  4733. "requires": [
  4734. 401
  4735. ],
  4736. "uses": [
  4737. 240
  4738. ],
  4739. "idx": 494
  4740. },
  4741. {
  4742. "path": "../classic/classic/src/form/CheckboxManager.js",
  4743. "requires": [
  4744. 55
  4745. ],
  4746. "uses": [],
  4747. "idx": 495
  4748. },
  4749. {
  4750. "path": "../classic/classic/src/form/field/Checkbox.js",
  4751. "requires": [
  4752. 95,
  4753. 483,
  4754. 495
  4755. ],
  4756. "uses": [],
  4757. "idx": 496
  4758. },
  4759. {
  4760. "path": "../classic/classic/src/form/CheckboxGroup.js",
  4761. "requires": [
  4762. 482,
  4763. 483,
  4764. 493,
  4765. 494,
  4766. 496
  4767. ],
  4768. "uses": [],
  4769. "idx": 497
  4770. },
  4771. {
  4772. "path": "../classic/classic/src/form/FieldSet.js",
  4773. "requires": [
  4774. 404,
  4775. 491
  4776. ],
  4777. "uses": [
  4778. 49,
  4779. 98,
  4780. 114,
  4781. 240,
  4782. 413,
  4783. 426,
  4784. 453,
  4785. 496,
  4786. 629
  4787. ],
  4788. "idx": 498
  4789. },
  4790. {
  4791. "path": "../classic/classic/src/form/Label.js",
  4792. "requires": [
  4793. 91,
  4794. 114
  4795. ],
  4796. "uses": [],
  4797. "idx": 499
  4798. },
  4799. {
  4800. "path": "../classic/classic/src/form/Panel.js",
  4801. "requires": [
  4802. 56,
  4803. 446,
  4804. 490,
  4805. 491
  4806. ],
  4807. "uses": [
  4808. 389
  4809. ],
  4810. "idx": 500
  4811. },
  4812. {
  4813. "path": "../classic/classic/src/form/RadioManager.js",
  4814. "requires": [
  4815. 55
  4816. ],
  4817. "uses": [],
  4818. "idx": 501
  4819. },
  4820. {
  4821. "path": "../classic/classic/src/form/field/Radio.js",
  4822. "requires": [
  4823. 496,
  4824. 501
  4825. ],
  4826. "uses": [],
  4827. "idx": 502
  4828. },
  4829. {
  4830. "path": "../classic/classic/src/form/RadioGroup.js",
  4831. "requires": [
  4832. 497,
  4833. 502
  4834. ],
  4835. "uses": [
  4836. 501
  4837. ],
  4838. "idx": 503
  4839. },
  4840. {
  4841. "path": "../classic/classic/src/form/action/DirectAction.js",
  4842. "requires": [
  4843. 0
  4844. ],
  4845. "uses": [
  4846. 220
  4847. ],
  4848. "idx": 504
  4849. },
  4850. {
  4851. "path": "../classic/classic/src/form/action/DirectLoad.js",
  4852. "requires": [
  4853. 220,
  4854. 476,
  4855. 504
  4856. ],
  4857. "uses": [],
  4858. "idx": 505
  4859. },
  4860. {
  4861. "path": "../classic/classic/src/form/action/DirectSubmit.js",
  4862. "requires": [
  4863. 220,
  4864. 477,
  4865. 504
  4866. ],
  4867. "uses": [],
  4868. "idx": 506
  4869. },
  4870. {
  4871. "path": "../classic/classic/src/form/field/Picker.js",
  4872. "requires": [
  4873. 352,
  4874. 487
  4875. ],
  4876. "uses": [],
  4877. "idx": 507
  4878. },
  4879. {
  4880. "path": "../classic/classic/src/selection/Model.js",
  4881. "requires": [
  4882. 4,
  4883. 12,
  4884. 185,
  4885. 410
  4886. ],
  4887. "uses": [],
  4888. "idx": 508
  4889. },
  4890. {
  4891. "path": "../classic/classic/src/selection/DataViewModel.js",
  4892. "requires": [
  4893. 352,
  4894. 508
  4895. ],
  4896. "uses": [],
  4897. "idx": 509
  4898. },
  4899. {
  4900. "path": "../classic/classic/src/view/NavigationModel.js",
  4901. "requires": [
  4902. 12,
  4903. 51,
  4904. 410
  4905. ],
  4906. "uses": [
  4907. 352
  4908. ],
  4909. "idx": 510
  4910. },
  4911. {
  4912. "path": "../classic/classic/src/view/AbstractView.js",
  4913. "requires": [
  4914. 74,
  4915. 75,
  4916. 101,
  4917. 114,
  4918. 410,
  4919. 411,
  4920. 509,
  4921. 510
  4922. ],
  4923. "uses": [
  4924. 1,
  4925. 12,
  4926. 49,
  4927. 92,
  4928. 95,
  4929. 178,
  4930. 240
  4931. ],
  4932. "idx": 511
  4933. },
  4934. {
  4935. "path": "../classic/classic/src/view/View.js",
  4936. "requires": [
  4937. 511
  4938. ],
  4939. "uses": [],
  4940. "idx": 512
  4941. },
  4942. {
  4943. "path": "../classic/classic/src/view/BoundListKeyNav.js",
  4944. "requires": [
  4945. 510
  4946. ],
  4947. "uses": [
  4948. 36,
  4949. 352
  4950. ],
  4951. "idx": 513
  4952. },
  4953. {
  4954. "path": "../classic/classic/src/layout/component/BoundList.js",
  4955. "requires": [
  4956. 413
  4957. ],
  4958. "uses": [],
  4959. "idx": 514
  4960. },
  4961. {
  4962. "path": "../classic/classic/src/toolbar/Item.js",
  4963. "requires": [
  4964. 114,
  4965. 435
  4966. ],
  4967. "uses": [],
  4968. "idx": 515
  4969. },
  4970. {
  4971. "path": "../classic/classic/src/toolbar/TextItem.js",
  4972. "requires": [
  4973. 95,
  4974. 435,
  4975. 515
  4976. ],
  4977. "uses": [],
  4978. "idx": 516
  4979. },
  4980. {
  4981. "path": "../classic/classic/src/form/trigger/Spinner.js",
  4982. "requires": [
  4983. 486
  4984. ],
  4985. "uses": [],
  4986. "idx": 517
  4987. },
  4988. {
  4989. "path": "../classic/classic/src/form/field/Spinner.js",
  4990. "requires": [
  4991. 352,
  4992. 487,
  4993. 517
  4994. ],
  4995. "uses": [],
  4996. "idx": 518
  4997. },
  4998. {
  4999. "path": "../classic/classic/src/form/field/Number.js",
  5000. "requires": [
  5001. 518
  5002. ],
  5003. "uses": [
  5004. 91,
  5005. 92
  5006. ],
  5007. "idx": 519
  5008. },
  5009. {
  5010. "path": "../classic/classic/src/toolbar/Paging.js",
  5011. "requires": [
  5012. 410,
  5013. 435,
  5014. 516,
  5015. 519
  5016. ],
  5017. "uses": [
  5018. 92,
  5019. 413,
  5020. 484,
  5021. 517
  5022. ],
  5023. "idx": 520
  5024. },
  5025. {
  5026. "path": "../classic/classic/src/view/BoundList.js",
  5027. "requires": [
  5028. 49,
  5029. 233,
  5030. 512,
  5031. 513,
  5032. 514,
  5033. 520
  5034. ],
  5035. "uses": [
  5036. 95,
  5037. 413
  5038. ],
  5039. "idx": 521
  5040. },
  5041. {
  5042. "path": "../classic/classic/src/form/field/ComboBox.js",
  5043. "requires": [
  5044. 1,
  5045. 178,
  5046. 410,
  5047. 507,
  5048. 521
  5049. ],
  5050. "uses": [
  5051. 49,
  5052. 50,
  5053. 95,
  5054. 128,
  5055. 157,
  5056. 173,
  5057. 240,
  5058. 352,
  5059. 509,
  5060. 513,
  5061. 514
  5062. ],
  5063. "idx": 522
  5064. },
  5065. {
  5066. "path": "../classic/classic/src/picker/Month.js",
  5067. "requires": [
  5068. 95,
  5069. 114,
  5070. 383,
  5071. 419
  5072. ],
  5073. "uses": [
  5074. 413
  5075. ],
  5076. "idx": 523
  5077. },
  5078. {
  5079. "path": "../classic/classic/src/picker/Date.js",
  5080. "requires": [
  5081. 66,
  5082. 95,
  5083. 114,
  5084. 352,
  5085. 383,
  5086. 419,
  5087. 420,
  5088. 523
  5089. ],
  5090. "uses": [
  5091. 92,
  5092. 240,
  5093. 413
  5094. ],
  5095. "idx": 524
  5096. },
  5097. {
  5098. "path": "../classic/classic/src/form/field/Date.js",
  5099. "requires": [
  5100. 507,
  5101. 524
  5102. ],
  5103. "uses": [
  5104. 92,
  5105. 413
  5106. ],
  5107. "idx": 525
  5108. },
  5109. {
  5110. "path": "../classic/classic/src/form/field/Display.js",
  5111. "requires": [
  5112. 91,
  5113. 95,
  5114. 483
  5115. ],
  5116. "uses": [],
  5117. "idx": 526
  5118. },
  5119. {
  5120. "path": "../classic/classic/src/form/field/FileButton.js",
  5121. "requires": [
  5122. 419
  5123. ],
  5124. "uses": [],
  5125. "idx": 527
  5126. },
  5127. {
  5128. "path": "../classic/classic/src/form/trigger/Component.js",
  5129. "requires": [
  5130. 486
  5131. ],
  5132. "uses": [],
  5133. "idx": 528
  5134. },
  5135. {
  5136. "path": "../classic/classic/src/form/field/File.js",
  5137. "requires": [
  5138. 487,
  5139. 527,
  5140. 528
  5141. ],
  5142. "uses": [
  5143. 413
  5144. ],
  5145. "idx": 529
  5146. },
  5147. {
  5148. "path": "../classic/classic/src/form/field/Hidden.js",
  5149. "requires": [
  5150. 483
  5151. ],
  5152. "uses": [],
  5153. "idx": 530
  5154. },
  5155. {
  5156. "path": "../classic/classic/src/tip/Tip.js",
  5157. "requires": [
  5158. 446
  5159. ],
  5160. "uses": [
  5161. 35,
  5162. 114
  5163. ],
  5164. "idx": 531
  5165. },
  5166. {
  5167. "path": "../classic/classic/src/tip/ToolTip.js",
  5168. "requires": [
  5169. 33,
  5170. 531
  5171. ],
  5172. "uses": [
  5173. 35,
  5174. 74
  5175. ],
  5176. "idx": 532
  5177. },
  5178. {
  5179. "path": "../classic/classic/src/tip/QuickTip.js",
  5180. "requires": [
  5181. 532
  5182. ],
  5183. "uses": [],
  5184. "idx": 533
  5185. },
  5186. {
  5187. "path": "../classic/classic/src/tip/QuickTipManager.js",
  5188. "requires": [
  5189. 533
  5190. ],
  5191. "uses": [],
  5192. "idx": 534
  5193. },
  5194. {
  5195. "path": "../classic/classic/src/picker/Color.js",
  5196. "requires": [
  5197. 95,
  5198. 114
  5199. ],
  5200. "uses": [],
  5201. "idx": 535
  5202. },
  5203. {
  5204. "path": "../classic/classic/src/layout/component/field/HtmlEditor.js",
  5205. "requires": [
  5206. 492
  5207. ],
  5208. "uses": [],
  5209. "idx": 536
  5210. },
  5211. {
  5212. "path": "../classic/classic/src/toolbar/Separator.js",
  5213. "requires": [
  5214. 435,
  5215. 515
  5216. ],
  5217. "uses": [],
  5218. "idx": 537
  5219. },
  5220. {
  5221. "path": "../classic/classic/src/layout/container/boxOverflow/Menu.js",
  5222. "requires": [
  5223. 419,
  5224. 428,
  5225. 537
  5226. ],
  5227. "uses": [
  5228. 413,
  5229. 429,
  5230. 434,
  5231. 443,
  5232. 496,
  5233. 588,
  5234. 590,
  5235. 661
  5236. ],
  5237. "idx": 538
  5238. },
  5239. {
  5240. "path": "../classic/classic/src/form/field/HtmlEditor.js",
  5241. "requires": [
  5242. 91,
  5243. 389,
  5244. 434,
  5245. 435,
  5246. 482,
  5247. 493,
  5248. 515,
  5249. 534,
  5250. 535,
  5251. 536,
  5252. 538
  5253. ],
  5254. "uses": [
  5255. 1,
  5256. 92,
  5257. 114,
  5258. 240,
  5259. 413,
  5260. 429,
  5261. 443,
  5262. 590
  5263. ],
  5264. "idx": 539
  5265. },
  5266. {
  5267. "path": "../classic/classic/src/view/TagKeyNav.js",
  5268. "requires": [
  5269. 513
  5270. ],
  5271. "uses": [],
  5272. "idx": 540
  5273. },
  5274. {
  5275. "path": "../classic/classic/src/form/field/Tag.js",
  5276. "requires": [
  5277. 175,
  5278. 217,
  5279. 508,
  5280. 522,
  5281. 540
  5282. ],
  5283. "uses": [
  5284. 50,
  5285. 92,
  5286. 95,
  5287. 163,
  5288. 170,
  5289. 171
  5290. ],
  5291. "idx": 541
  5292. },
  5293. {
  5294. "path": "../classic/classic/src/picker/Time.js",
  5295. "requires": [
  5296. 175,
  5297. 521
  5298. ],
  5299. "uses": [
  5300. 50
  5301. ],
  5302. "idx": 542
  5303. },
  5304. {
  5305. "path": "../classic/classic/src/form/field/Time.js",
  5306. "requires": [
  5307. 513,
  5308. 522,
  5309. 525,
  5310. 542
  5311. ],
  5312. "uses": [
  5313. 92,
  5314. 95,
  5315. 509,
  5316. 514
  5317. ],
  5318. "idx": 543
  5319. },
  5320. {
  5321. "path": "../classic/classic/src/form/field/Trigger.js",
  5322. "requires": [
  5323. 240,
  5324. 383,
  5325. 487
  5326. ],
  5327. "uses": [],
  5328. "idx": 544
  5329. },
  5330. {
  5331. "path": "../classic/classic/src/grid/CellContext.js",
  5332. "requires": [],
  5333. "uses": [],
  5334. "idx": 545
  5335. },
  5336. {
  5337. "path": "../classic/classic/src/grid/CellEditor.js",
  5338. "requires": [
  5339. 406
  5340. ],
  5341. "uses": [
  5342. 49,
  5343. 404
  5344. ],
  5345. "idx": 546
  5346. },
  5347. {
  5348. "path": "../classic/classic/src/grid/ColumnComponentLayout.js",
  5349. "requires": [
  5350. 413
  5351. ],
  5352. "uses": [],
  5353. "idx": 547
  5354. },
  5355. {
  5356. "path": "../classic/classic/src/layout/container/Fit.js",
  5357. "requires": [
  5358. 401
  5359. ],
  5360. "uses": [],
  5361. "idx": 548
  5362. },
  5363. {
  5364. "path": "../classic/classic/src/panel/Table.js",
  5365. "requires": [
  5366. 446,
  5367. 548
  5368. ],
  5369. "uses": [
  5370. 1,
  5371. 76,
  5372. 112,
  5373. 178,
  5374. 218,
  5375. 240,
  5376. 545,
  5377. 552,
  5378. 559,
  5379. 569,
  5380. 603,
  5381. 604,
  5382. 646,
  5383. 647,
  5384. 648
  5385. ],
  5386. "idx": 549
  5387. },
  5388. {
  5389. "path": "../classic/classic/src/grid/ColumnLayout.js",
  5390. "requires": [
  5391. 433,
  5392. 549
  5393. ],
  5394. "uses": [],
  5395. "idx": 550
  5396. },
  5397. {
  5398. "path": "../classic/classic/src/grid/ColumnManager.js",
  5399. "requires": [],
  5400. "uses": [],
  5401. "idx": 551
  5402. },
  5403. {
  5404. "path": "../classic/classic/src/grid/NavigationModel.js",
  5405. "requires": [
  5406. 510
  5407. ],
  5408. "uses": [
  5409. 21,
  5410. 36,
  5411. 49,
  5412. 74,
  5413. 114,
  5414. 352,
  5415. 545
  5416. ],
  5417. "idx": 552
  5418. },
  5419. {
  5420. "path": "../classic/classic/src/view/TableLayout.js",
  5421. "requires": [
  5422. 413
  5423. ],
  5424. "uses": [],
  5425. "idx": 553
  5426. },
  5427. {
  5428. "path": "../classic/classic/src/grid/locking/RowSynchronizer.js",
  5429. "requires": [],
  5430. "uses": [],
  5431. "idx": 554
  5432. },
  5433. {
  5434. "path": "../classic/classic/src/view/NodeCache.js",
  5435. "requires": [
  5436. 75
  5437. ],
  5438. "uses": [
  5439. 49,
  5440. 74
  5441. ],
  5442. "idx": 555
  5443. },
  5444. {
  5445. "path": "../classic/classic/src/scroll/TableScroller.js",
  5446. "requires": [
  5447. 107
  5448. ],
  5449. "uses": [
  5450. 10
  5451. ],
  5452. "idx": 556
  5453. },
  5454. {
  5455. "path": "../classic/classic/src/view/Table.js",
  5456. "requires": [
  5457. 1,
  5458. 55,
  5459. 74,
  5460. 233,
  5461. 512,
  5462. 545,
  5463. 553,
  5464. 554,
  5465. 555,
  5466. 556
  5467. ],
  5468. "uses": [
  5469. 12,
  5470. 49,
  5471. 95,
  5472. 114,
  5473. 157,
  5474. 569
  5475. ],
  5476. "idx": 557
  5477. },
  5478. {
  5479. "path": "../classic/classic/src/grid/Panel.js",
  5480. "requires": [
  5481. 549,
  5482. 557
  5483. ],
  5484. "uses": [],
  5485. "idx": 558
  5486. },
  5487. {
  5488. "path": "../classic/classic/src/grid/RowContext.js",
  5489. "requires": [],
  5490. "uses": [
  5491. 12
  5492. ],
  5493. "idx": 559
  5494. },
  5495. {
  5496. "path": "../classic/classic/src/grid/RowEditorButtons.js",
  5497. "requires": [
  5498. 404
  5499. ],
  5500. "uses": [
  5501. 413,
  5502. 419,
  5503. 446
  5504. ],
  5505. "idx": 560
  5506. },
  5507. {
  5508. "path": "../classic/classic/src/grid/RowEditor.js",
  5509. "requires": [
  5510. 352,
  5511. 500,
  5512. 532,
  5513. 560
  5514. ],
  5515. "uses": [
  5516. 49,
  5517. 66,
  5518. 76,
  5519. 402,
  5520. 404,
  5521. 413,
  5522. 443,
  5523. 526,
  5524. 545
  5525. ],
  5526. "idx": 561
  5527. },
  5528. {
  5529. "path": "../classic/classic/src/grid/Scroller.js",
  5530. "requires": [],
  5531. "uses": [],
  5532. "idx": 562
  5533. },
  5534. {
  5535. "path": "../classic/classic/src/view/DropZone.js",
  5536. "requires": [
  5537. 470
  5538. ],
  5539. "uses": [
  5540. 114,
  5541. 413
  5542. ],
  5543. "idx": 563
  5544. },
  5545. {
  5546. "path": "../classic/classic/src/grid/ViewDropZone.js",
  5547. "requires": [
  5548. 563
  5549. ],
  5550. "uses": [],
  5551. "idx": 564
  5552. },
  5553. {
  5554. "path": "../classic/classic/src/grid/plugin/HeaderResizer.js",
  5555. "requires": [
  5556. 34,
  5557. 83,
  5558. 457
  5559. ],
  5560. "uses": [
  5561. 570
  5562. ],
  5563. "idx": 565
  5564. },
  5565. {
  5566. "path": "../classic/classic/src/grid/header/DragZone.js",
  5567. "requires": [
  5568. 468
  5569. ],
  5570. "uses": [],
  5571. "idx": 566
  5572. },
  5573. {
  5574. "path": "../classic/classic/src/grid/header/DropZone.js",
  5575. "requires": [
  5576. 470
  5577. ],
  5578. "uses": [
  5579. 430
  5580. ],
  5581. "idx": 567
  5582. },
  5583. {
  5584. "path": "../classic/classic/src/grid/plugin/HeaderReorderer.js",
  5585. "requires": [
  5586. 83,
  5587. 566,
  5588. 567
  5589. ],
  5590. "uses": [],
  5591. "idx": 568
  5592. },
  5593. {
  5594. "path": "../classic/classic/src/grid/header/Container.js",
  5595. "requires": [
  5596. 352,
  5597. 404,
  5598. 550,
  5599. 565,
  5600. 568
  5601. ],
  5602. "uses": [
  5603. 1,
  5604. 114,
  5605. 413,
  5606. 429,
  5607. 434,
  5608. 443,
  5609. 551,
  5610. 570,
  5611. 588,
  5612. 589,
  5613. 590
  5614. ],
  5615. "idx": 569
  5616. },
  5617. {
  5618. "path": "../classic/classic/src/grid/column/Column.js",
  5619. "requires": [
  5620. 214,
  5621. 547,
  5622. 550,
  5623. 569
  5624. ],
  5625. "uses": [
  5626. 53,
  5627. 91,
  5628. 565
  5629. ],
  5630. "idx": 570
  5631. },
  5632. {
  5633. "path": "../classic/classic/src/grid/column/ActionProxy.js",
  5634. "requires": [],
  5635. "uses": [],
  5636. "idx": 571
  5637. },
  5638. {
  5639. "path": "../classic/classic/src/grid/column/Action.js",
  5640. "requires": [
  5641. 77,
  5642. 91,
  5643. 570,
  5644. 571
  5645. ],
  5646. "uses": [
  5647. 49
  5648. ],
  5649. "idx": 572
  5650. },
  5651. {
  5652. "path": "../classic/classic/src/grid/column/Boolean.js",
  5653. "requires": [
  5654. 570
  5655. ],
  5656. "uses": [],
  5657. "idx": 573
  5658. },
  5659. {
  5660. "path": "../classic/classic/src/grid/column/Check.js",
  5661. "requires": [
  5662. 570
  5663. ],
  5664. "uses": [
  5665. 545
  5666. ],
  5667. "idx": 574
  5668. },
  5669. {
  5670. "path": "../classic/classic/src/grid/column/Date.js",
  5671. "requires": [
  5672. 570
  5673. ],
  5674. "uses": [
  5675. 91
  5676. ],
  5677. "idx": 575
  5678. },
  5679. {
  5680. "path": "../classic/classic/src/grid/column/Number.js",
  5681. "requires": [
  5682. 91,
  5683. 570
  5684. ],
  5685. "uses": [],
  5686. "idx": 576
  5687. },
  5688. {
  5689. "path": "../classic/classic/src/grid/column/RowNumberer.js",
  5690. "requires": [
  5691. 570
  5692. ],
  5693. "uses": [
  5694. 545
  5695. ],
  5696. "idx": 577
  5697. },
  5698. {
  5699. "path": "../classic/classic/src/grid/column/Template.js",
  5700. "requires": [
  5701. 95,
  5702. 570
  5703. ],
  5704. "uses": [
  5705. 574
  5706. ],
  5707. "idx": 578
  5708. },
  5709. {
  5710. "path": "../classic/classic/src/grid/column/Widget.js",
  5711. "requires": [
  5712. 359,
  5713. 570
  5714. ],
  5715. "uses": [],
  5716. "idx": 579
  5717. },
  5718. {
  5719. "path": "../classic/classic/src/grid/feature/Feature.js",
  5720. "requires": [
  5721. 51
  5722. ],
  5723. "uses": [],
  5724. "idx": 580
  5725. },
  5726. {
  5727. "path": "../classic/classic/src/grid/feature/AbstractSummary.js",
  5728. "requires": [
  5729. 580
  5730. ],
  5731. "uses": [],
  5732. "idx": 581
  5733. },
  5734. {
  5735. "path": "../classic/classic/src/grid/feature/GroupStore.js",
  5736. "requires": [
  5737. 51
  5738. ],
  5739. "uses": [
  5740. 128
  5741. ],
  5742. "idx": 582
  5743. },
  5744. {
  5745. "path": "../classic/classic/src/grid/feature/Grouping.js",
  5746. "requires": [
  5747. 580,
  5748. 581,
  5749. 582
  5750. ],
  5751. "uses": [
  5752. 95,
  5753. 157
  5754. ],
  5755. "idx": 583
  5756. },
  5757. {
  5758. "path": "../classic/classic/src/grid/feature/GroupingSummary.js",
  5759. "requires": [
  5760. 583
  5761. ],
  5762. "uses": [],
  5763. "idx": 584
  5764. },
  5765. {
  5766. "path": "../classic/classic/src/grid/feature/RowBody.js",
  5767. "requires": [
  5768. 580
  5769. ],
  5770. "uses": [
  5771. 95
  5772. ],
  5773. "idx": 585
  5774. },
  5775. {
  5776. "path": "../classic/classic/src/grid/feature/Summary.js",
  5777. "requires": [
  5778. 581
  5779. ],
  5780. "uses": [
  5781. 114,
  5782. 157,
  5783. 413
  5784. ],
  5785. "idx": 586
  5786. },
  5787. {
  5788. "path": "../classic/classic/src/menu/Item.js",
  5789. "requires": [
  5790. 77,
  5791. 114,
  5792. 233
  5793. ],
  5794. "uses": [
  5795. 418,
  5796. 534
  5797. ],
  5798. "idx": 587
  5799. },
  5800. {
  5801. "path": "../classic/classic/src/menu/CheckItem.js",
  5802. "requires": [
  5803. 587
  5804. ],
  5805. "uses": [
  5806. 418
  5807. ],
  5808. "idx": 588
  5809. },
  5810. {
  5811. "path": "../classic/classic/src/menu/Separator.js",
  5812. "requires": [
  5813. 587
  5814. ],
  5815. "uses": [],
  5816. "idx": 589
  5817. },
  5818. {
  5819. "path": "../classic/classic/src/menu/Menu.js",
  5820. "requires": [
  5821. 418,
  5822. 434,
  5823. 446,
  5824. 587,
  5825. 588,
  5826. 589
  5827. ],
  5828. "uses": [
  5829. 1,
  5830. 21,
  5831. 36,
  5832. 49,
  5833. 352,
  5834. 413
  5835. ],
  5836. "idx": 590
  5837. },
  5838. {
  5839. "path": "../classic/classic/src/grid/filters/filter/Base.js",
  5840. "requires": [
  5841. 12,
  5842. 429,
  5843. 434,
  5844. 443,
  5845. 590
  5846. ],
  5847. "uses": [
  5848. 1,
  5849. 50
  5850. ],
  5851. "idx": 591
  5852. },
  5853. {
  5854. "path": "../classic/classic/src/grid/filters/filter/SingleFilter.js",
  5855. "requires": [
  5856. 591
  5857. ],
  5858. "uses": [],
  5859. "idx": 592
  5860. },
  5861. {
  5862. "path": "../classic/classic/src/grid/filters/filter/Boolean.js",
  5863. "requires": [
  5864. 592
  5865. ],
  5866. "uses": [],
  5867. "idx": 593
  5868. },
  5869. {
  5870. "path": "../classic/classic/src/grid/filters/filter/TriFilter.js",
  5871. "requires": [
  5872. 591
  5873. ],
  5874. "uses": [],
  5875. "idx": 594
  5876. },
  5877. {
  5878. "path": "../classic/classic/src/grid/filters/filter/Date.js",
  5879. "requires": [
  5880. 413,
  5881. 588,
  5882. 594
  5883. ],
  5884. "uses": [
  5885. 429,
  5886. 434,
  5887. 443,
  5888. 524,
  5889. 639
  5890. ],
  5891. "idx": 595
  5892. },
  5893. {
  5894. "path": "../classic/classic/src/grid/filters/filter/List.js",
  5895. "requires": [
  5896. 592
  5897. ],
  5898. "uses": [
  5899. 175,
  5900. 178
  5901. ],
  5902. "idx": 596
  5903. },
  5904. {
  5905. "path": "../classic/classic/src/grid/filters/filter/Number.js",
  5906. "requires": [
  5907. 484,
  5908. 517,
  5909. 594
  5910. ],
  5911. "uses": [
  5912. 519
  5913. ],
  5914. "idx": 597
  5915. },
  5916. {
  5917. "path": "../classic/classic/src/grid/filters/filter/String.js",
  5918. "requires": [
  5919. 484,
  5920. 487,
  5921. 592
  5922. ],
  5923. "uses": [
  5924. 50
  5925. ],
  5926. "idx": 598
  5927. },
  5928. {
  5929. "path": "../classic/classic/src/grid/filters/Filters.js",
  5930. "requires": [
  5931. 83,
  5932. 410,
  5933. 591,
  5934. 592,
  5935. 593,
  5936. 594,
  5937. 595,
  5938. 596,
  5939. 597,
  5940. 598
  5941. ],
  5942. "uses": [
  5943. 12
  5944. ],
  5945. "idx": 599
  5946. },
  5947. {
  5948. "path": "../classic/classic/src/grid/locking/HeaderContainer.js",
  5949. "requires": [
  5950. 551,
  5951. 569
  5952. ],
  5953. "uses": [],
  5954. "idx": 600
  5955. },
  5956. {
  5957. "path": "../classic/classic/src/grid/locking/View.js",
  5958. "requires": [
  5959. 51,
  5960. 86,
  5961. 114,
  5962. 410,
  5963. 511,
  5964. 557
  5965. ],
  5966. "uses": [
  5967. 107,
  5968. 411,
  5969. 545
  5970. ],
  5971. "idx": 601
  5972. },
  5973. {
  5974. "path": "../classic/classic/src/scroll/LockingScroller.js",
  5975. "requires": [
  5976. 107
  5977. ],
  5978. "uses": [
  5979. 10
  5980. ],
  5981. "idx": 602
  5982. },
  5983. {
  5984. "path": "../classic/classic/src/grid/locking/Lockable.js",
  5985. "requires": [
  5986. 114,
  5987. 557,
  5988. 569,
  5989. 600,
  5990. 601,
  5991. 602
  5992. ],
  5993. "uses": [
  5994. 1,
  5995. 34,
  5996. 107,
  5997. 178,
  5998. 402,
  5999. 413,
  6000. 431,
  6001. 432,
  6002. 446,
  6003. 549
  6004. ],
  6005. "idx": 603
  6006. },
  6007. {
  6008. "path": "../classic/classic/src/grid/plugin/BufferedRenderer.js",
  6009. "requires": [
  6010. 83,
  6011. 554
  6012. ],
  6013. "uses": [
  6014. 1,
  6015. 49,
  6016. 114
  6017. ],
  6018. "idx": 604
  6019. },
  6020. {
  6021. "path": "../classic/classic/src/grid/plugin/Editing.js",
  6022. "requires": [
  6023. 4,
  6024. 83,
  6025. 352,
  6026. 483,
  6027. 557,
  6028. 570
  6029. ],
  6030. "uses": [
  6031. 21,
  6032. 114,
  6033. 413,
  6034. 545
  6035. ],
  6036. "idx": 605
  6037. },
  6038. {
  6039. "path": "../classic/classic/src/grid/plugin/CellEditing.js",
  6040. "requires": [
  6041. 1,
  6042. 546,
  6043. 605
  6044. ],
  6045. "uses": [
  6046. 55,
  6047. 405,
  6048. 413,
  6049. 545
  6050. ],
  6051. "idx": 606
  6052. },
  6053. {
  6054. "path": "../classic/classic/src/grid/plugin/Clipboard.js",
  6055. "requires": [
  6056. 91,
  6057. 363,
  6058. 388
  6059. ],
  6060. "uses": [
  6061. 545
  6062. ],
  6063. "idx": 607
  6064. },
  6065. {
  6066. "path": "../classic/classic/src/grid/plugin/DragDrop.js",
  6067. "requires": [
  6068. 83
  6069. ],
  6070. "uses": [
  6071. 564,
  6072. 667
  6073. ],
  6074. "idx": 608
  6075. },
  6076. {
  6077. "path": "../classic/classic/src/grid/plugin/RowEditing.js",
  6078. "requires": [
  6079. 561,
  6080. 605
  6081. ],
  6082. "uses": [],
  6083. "idx": 609
  6084. },
  6085. {
  6086. "path": "../classic/classic/src/grid/plugin/RowExpander.js",
  6087. "requires": [
  6088. 83,
  6089. 585
  6090. ],
  6091. "uses": [
  6092. 95,
  6093. 570
  6094. ],
  6095. "idx": 610
  6096. },
  6097. {
  6098. "path": "../classic/classic/src/grid/plugin/RowWidget.js",
  6099. "requires": [
  6100. 3,
  6101. 359,
  6102. 610
  6103. ],
  6104. "uses": [
  6105. 83,
  6106. 585
  6107. ],
  6108. "idx": 611
  6109. },
  6110. {
  6111. "path": "../classic/classic/src/grid/property/Grid.js",
  6112. "requires": [
  6113. 558
  6114. ],
  6115. "uses": [
  6116. 21,
  6117. 95,
  6118. 157,
  6119. 405,
  6120. 413,
  6121. 483,
  6122. 484,
  6123. 487,
  6124. 517,
  6125. 519,
  6126. 522,
  6127. 525,
  6128. 545,
  6129. 546,
  6130. 557,
  6131. 606,
  6132. 613,
  6133. 616
  6134. ],
  6135. "idx": 612
  6136. },
  6137. {
  6138. "path": "../classic/classic/src/grid/property/HeaderContainer.js",
  6139. "requires": [
  6140. 91,
  6141. 569
  6142. ],
  6143. "uses": [],
  6144. "idx": 613
  6145. },
  6146. {
  6147. "path": "../classic/classic/src/grid/property/Property.js",
  6148. "requires": [
  6149. 157
  6150. ],
  6151. "uses": [],
  6152. "idx": 614
  6153. },
  6154. {
  6155. "path": "../classic/classic/src/grid/property/Reader.js",
  6156. "requires": [
  6157. 159
  6158. ],
  6159. "uses": [
  6160. 158
  6161. ],
  6162. "idx": 615
  6163. },
  6164. {
  6165. "path": "../classic/classic/src/grid/property/Store.js",
  6166. "requires": [
  6167. 163,
  6168. 175,
  6169. 614,
  6170. 615
  6171. ],
  6172. "uses": [
  6173. 171
  6174. ],
  6175. "idx": 616
  6176. },
  6177. {
  6178. "path": "../classic/classic/src/grid/selection/Selection.js",
  6179. "requires": [],
  6180. "uses": [],
  6181. "idx": 617
  6182. },
  6183. {
  6184. "path": "../classic/classic/src/grid/selection/Cells.js",
  6185. "requires": [
  6186. 617
  6187. ],
  6188. "uses": [
  6189. 545
  6190. ],
  6191. "idx": 618
  6192. },
  6193. {
  6194. "path": "../classic/classic/src/grid/selection/Columns.js",
  6195. "requires": [
  6196. 617
  6197. ],
  6198. "uses": [
  6199. 545
  6200. ],
  6201. "idx": 619
  6202. },
  6203. {
  6204. "path": "../classic/classic/src/grid/selection/Replicator.js",
  6205. "requires": [
  6206. 83
  6207. ],
  6208. "uses": [],
  6209. "idx": 620
  6210. },
  6211. {
  6212. "path": "../classic/classic/src/grid/selection/Rows.js",
  6213. "requires": [
  6214. 128,
  6215. 617
  6216. ],
  6217. "uses": [
  6218. 545
  6219. ],
  6220. "idx": 621
  6221. },
  6222. {
  6223. "path": "../classic/classic/src/grid/selection/SelectionExtender.js",
  6224. "requires": [
  6225. 457
  6226. ],
  6227. "uses": [
  6228. 49,
  6229. 389
  6230. ],
  6231. "idx": 622
  6232. },
  6233. {
  6234. "path": "../classic/classic/src/grid/selection/SpreadsheetModel.js",
  6235. "requires": [
  6236. 508,
  6237. 577,
  6238. 617,
  6239. 618,
  6240. 619,
  6241. 621,
  6242. 622
  6243. ],
  6244. "uses": [
  6245. 389,
  6246. 402,
  6247. 463,
  6248. 545,
  6249. 547,
  6250. 574
  6251. ],
  6252. "idx": 623
  6253. },
  6254. {
  6255. "path": "../classic/classic/src/util/Queue.js",
  6256. "requires": [],
  6257. "uses": [],
  6258. "idx": 624
  6259. },
  6260. {
  6261. "path": "../classic/classic/src/layout/ContextItem.js",
  6262. "requires": [],
  6263. "uses": [
  6264. 55,
  6265. 66,
  6266. 72,
  6267. 399
  6268. ],
  6269. "idx": 625
  6270. },
  6271. {
  6272. "path": "../classic/classic/src/layout/Context.js",
  6273. "requires": [
  6274. 66,
  6275. 72,
  6276. 362,
  6277. 400,
  6278. 624,
  6279. 625
  6280. ],
  6281. "uses": [],
  6282. "idx": 626
  6283. },
  6284. {
  6285. "path": "../classic/classic/src/layout/SizePolicy.js",
  6286. "requires": [],
  6287. "uses": [],
  6288. "idx": 627
  6289. },
  6290. {
  6291. "path": "../classic/classic/src/layout/component/Body.js",
  6292. "requires": [
  6293. 413
  6294. ],
  6295. "uses": [],
  6296. "idx": 628
  6297. },
  6298. {
  6299. "path": "../classic/classic/src/layout/component/FieldSet.js",
  6300. "requires": [
  6301. 628
  6302. ],
  6303. "uses": [],
  6304. "idx": 629
  6305. },
  6306. {
  6307. "path": "../classic/classic/src/layout/container/Absolute.js",
  6308. "requires": [
  6309. 453
  6310. ],
  6311. "uses": [],
  6312. "idx": 630
  6313. },
  6314. {
  6315. "path": "../classic/classic/src/layout/container/Accordion.js",
  6316. "requires": [
  6317. 434
  6318. ],
  6319. "uses": [],
  6320. "idx": 631
  6321. },
  6322. {
  6323. "path": "../classic/classic/src/resizer/BorderSplitter.js",
  6324. "requires": [
  6325. 431
  6326. ],
  6327. "uses": [
  6328. 642
  6329. ],
  6330. "idx": 632
  6331. },
  6332. {
  6333. "path": "../classic/classic/src/layout/container/Border.js",
  6334. "requires": [
  6335. 72,
  6336. 115,
  6337. 401,
  6338. 632
  6339. ],
  6340. "uses": [
  6341. 91,
  6342. 413
  6343. ],
  6344. "idx": 633
  6345. },
  6346. {
  6347. "path": "../classic/classic/src/layout/container/Card.js",
  6348. "requires": [
  6349. 548
  6350. ],
  6351. "uses": [
  6352. 49
  6353. ],
  6354. "idx": 634
  6355. },
  6356. {
  6357. "path": "../classic/classic/src/layout/container/Center.js",
  6358. "requires": [
  6359. 548
  6360. ],
  6361. "uses": [],
  6362. "idx": 635
  6363. },
  6364. {
  6365. "path": "../classic/classic/src/layout/container/Form.js",
  6366. "requires": [
  6367. 402
  6368. ],
  6369. "uses": [],
  6370. "idx": 636
  6371. },
  6372. {
  6373. "path": "../classic/classic/src/menu/Bar.js",
  6374. "requires": [
  6375. 590
  6376. ],
  6377. "uses": [],
  6378. "idx": 637
  6379. },
  6380. {
  6381. "path": "../classic/classic/src/menu/ColorPicker.js",
  6382. "requires": [
  6383. 535,
  6384. 590
  6385. ],
  6386. "uses": [
  6387. 413,
  6388. 418
  6389. ],
  6390. "idx": 638
  6391. },
  6392. {
  6393. "path": "../classic/classic/src/menu/DatePicker.js",
  6394. "requires": [
  6395. 524,
  6396. 590
  6397. ],
  6398. "uses": [
  6399. 413,
  6400. 418
  6401. ],
  6402. "idx": 639
  6403. },
  6404. {
  6405. "path": "../classic/classic/src/panel/Pinnable.js",
  6406. "requires": [
  6407. 0
  6408. ],
  6409. "uses": [
  6410. 413,
  6411. 426
  6412. ],
  6413. "idx": 640
  6414. },
  6415. {
  6416. "path": "../classic/classic/src/plugin/LazyItems.js",
  6417. "requires": [
  6418. 83
  6419. ],
  6420. "uses": [],
  6421. "idx": 641
  6422. },
  6423. {
  6424. "path": "../classic/classic/src/resizer/BorderSplitterTracker.js",
  6425. "requires": [
  6426. 34,
  6427. 458
  6428. ],
  6429. "uses": [],
  6430. "idx": 642
  6431. },
  6432. {
  6433. "path": "../classic/classic/src/resizer/Handle.js",
  6434. "requires": [
  6435. 114
  6436. ],
  6437. "uses": [],
  6438. "idx": 643
  6439. },
  6440. {
  6441. "path": "../classic/classic/src/resizer/ResizeTracker.js",
  6442. "requires": [
  6443. 457
  6444. ],
  6445. "uses": [
  6446. 49
  6447. ],
  6448. "idx": 644
  6449. },
  6450. {
  6451. "path": "../classic/classic/src/resizer/Resizer.js",
  6452. "requires": [
  6453. 51
  6454. ],
  6455. "uses": [
  6456. 49,
  6457. 92,
  6458. 114,
  6459. 644
  6460. ],
  6461. "idx": 645
  6462. },
  6463. {
  6464. "path": "../classic/classic/src/selection/CellModel.js",
  6465. "requires": [
  6466. 509,
  6467. 545
  6468. ],
  6469. "uses": [],
  6470. "idx": 646
  6471. },
  6472. {
  6473. "path": "../classic/classic/src/selection/RowModel.js",
  6474. "requires": [
  6475. 509,
  6476. 545
  6477. ],
  6478. "uses": [],
  6479. "idx": 647
  6480. },
  6481. {
  6482. "path": "../classic/classic/src/selection/CheckboxModel.js",
  6483. "requires": [
  6484. 574,
  6485. 647
  6486. ],
  6487. "uses": [
  6488. 402,
  6489. 545,
  6490. 547
  6491. ],
  6492. "idx": 648
  6493. },
  6494. {
  6495. "path": "../classic/classic/src/selection/TreeModel.js",
  6496. "requires": [
  6497. 647
  6498. ],
  6499. "uses": [],
  6500. "idx": 649
  6501. },
  6502. {
  6503. "path": "../classic/classic/src/slider/Thumb.js",
  6504. "requires": [
  6505. 91,
  6506. 457
  6507. ],
  6508. "uses": [
  6509. 72
  6510. ],
  6511. "idx": 650
  6512. },
  6513. {
  6514. "path": "../classic/classic/src/slider/Tip.js",
  6515. "requires": [
  6516. 531
  6517. ],
  6518. "uses": [],
  6519. "idx": 651
  6520. },
  6521. {
  6522. "path": "../classic/classic/src/slider/Multi.js",
  6523. "requires": [
  6524. 91,
  6525. 92,
  6526. 483,
  6527. 650,
  6528. 651
  6529. ],
  6530. "uses": [
  6531. 240
  6532. ],
  6533. "idx": 652
  6534. },
  6535. {
  6536. "path": "../classic/classic/src/slider/Single.js",
  6537. "requires": [
  6538. 652
  6539. ],
  6540. "uses": [],
  6541. "idx": 653
  6542. },
  6543. {
  6544. "path": "../classic/classic/src/slider/Widget.js",
  6545. "requires": [
  6546. 88,
  6547. 652
  6548. ],
  6549. "uses": [
  6550. 72,
  6551. 91
  6552. ],
  6553. "idx": 654
  6554. },
  6555. {
  6556. "path": "../classic/classic/src/state/CookieProvider.js",
  6557. "requires": [
  6558. 111
  6559. ],
  6560. "uses": [],
  6561. "idx": 655
  6562. },
  6563. {
  6564. "path": "../classic/classic/src/state/LocalStorageProvider.js",
  6565. "requires": [
  6566. 111,
  6567. 386
  6568. ],
  6569. "uses": [],
  6570. "idx": 656
  6571. },
  6572. {
  6573. "path": "../classic/classic/src/tab/Tab.js",
  6574. "requires": [
  6575. 419
  6576. ],
  6577. "uses": [],
  6578. "idx": 657
  6579. },
  6580. {
  6581. "path": "../classic/classic/src/tab/Bar.js",
  6582. "requires": [
  6583. 35,
  6584. 424,
  6585. 628,
  6586. 657
  6587. ],
  6588. "uses": [
  6589. 34
  6590. ],
  6591. "idx": 658
  6592. },
  6593. {
  6594. "path": "../classic/classic/src/tab/Panel.js",
  6595. "requires": [
  6596. 446,
  6597. 634,
  6598. 658
  6599. ],
  6600. "uses": [
  6601. 413,
  6602. 657
  6603. ],
  6604. "idx": 659
  6605. },
  6606. {
  6607. "path": "../classic/classic/src/toolbar/Breadcrumb.js",
  6608. "requires": [
  6609. 237,
  6610. 404,
  6611. 420
  6612. ],
  6613. "uses": [
  6614. 24,
  6615. 178
  6616. ],
  6617. "idx": 660
  6618. },
  6619. {
  6620. "path": "../classic/classic/src/toolbar/Fill.js",
  6621. "requires": [
  6622. 114,
  6623. 435
  6624. ],
  6625. "uses": [],
  6626. "idx": 661
  6627. },
  6628. {
  6629. "path": "../classic/classic/src/toolbar/Spacer.js",
  6630. "requires": [
  6631. 114,
  6632. 435
  6633. ],
  6634. "uses": [],
  6635. "idx": 662
  6636. },
  6637. {
  6638. "path": "../classic/classic/src/tree/Column.js",
  6639. "requires": [
  6640. 570
  6641. ],
  6642. "uses": [
  6643. 77
  6644. ],
  6645. "idx": 663
  6646. },
  6647. {
  6648. "path": "../classic/classic/src/tree/NavigationModel.js",
  6649. "requires": [
  6650. 552
  6651. ],
  6652. "uses": [
  6653. 36
  6654. ],
  6655. "idx": 664
  6656. },
  6657. {
  6658. "path": "../classic/classic/src/tree/View.js",
  6659. "requires": [
  6660. 557
  6661. ],
  6662. "uses": [
  6663. 49
  6664. ],
  6665. "idx": 665
  6666. },
  6667. {
  6668. "path": "../classic/classic/src/tree/Panel.js",
  6669. "requires": [
  6670. 237,
  6671. 549,
  6672. 649,
  6673. 663,
  6674. 664,
  6675. 665
  6676. ],
  6677. "uses": [
  6678. 178,
  6679. 402,
  6680. 547
  6681. ],
  6682. "idx": 666
  6683. },
  6684. {
  6685. "path": "../classic/classic/src/view/DragZone.js",
  6686. "requires": [
  6687. 468
  6688. ],
  6689. "uses": [
  6690. 49,
  6691. 92
  6692. ],
  6693. "idx": 667
  6694. },
  6695. {
  6696. "path": "../classic/classic/src/tree/ViewDragZone.js",
  6697. "requires": [
  6698. 667
  6699. ],
  6700. "uses": [
  6701. 92
  6702. ],
  6703. "idx": 668
  6704. },
  6705. {
  6706. "path": "../classic/classic/src/tree/ViewDropZone.js",
  6707. "requires": [
  6708. 563
  6709. ],
  6710. "uses": [],
  6711. "idx": 669
  6712. },
  6713. {
  6714. "path": "../classic/classic/src/tree/plugin/TreeViewDragDrop.js",
  6715. "requires": [
  6716. 83
  6717. ],
  6718. "uses": [
  6719. 668,
  6720. 669
  6721. ],
  6722. "idx": 670
  6723. },
  6724. {
  6725. "path": "../classic/classic/src/view/MultiSelectorSearch.js",
  6726. "requires": [
  6727. 446
  6728. ],
  6729. "uses": [
  6730. 50,
  6731. 178,
  6732. 443,
  6733. 484,
  6734. 487,
  6735. 548,
  6736. 558
  6737. ],
  6738. "idx": 671
  6739. },
  6740. {
  6741. "path": "../classic/classic/src/view/MultiSelector.js",
  6742. "requires": [
  6743. 443,
  6744. 548,
  6745. 558,
  6746. 671
  6747. ],
  6748. "uses": [],
  6749. "idx": 672
  6750. },
  6751. {
  6752. "path": "../classic/classic/src/window/Toast.js",
  6753. "requires": [
  6754. 480
  6755. ],
  6756. "uses": [
  6757. 1
  6758. ],
  6759. "idx": 673
  6760. }
  6761. ],
  6762. "classes": {
  6763. "Ext.AbstractManager": {
  6764. "idx": 6,
  6765. "alias": [],
  6766. "alternates": []
  6767. },
  6768. "Ext.Action": {
  6769. "idx": 396,
  6770. "alias": [],
  6771. "alternates": []
  6772. },
  6773. "Ext.Ajax": {
  6774. "idx": 18,
  6775. "alias": [],
  6776. "alternates": []
  6777. },
  6778. "Ext.AnimationQueue": {
  6779. "idx": 19,
  6780. "alias": [],
  6781. "alternates": []
  6782. },
  6783. "Ext.Component": {
  6784. "idx": 114,
  6785. "alias": [
  6786. "widget.box",
  6787. "widget.component"
  6788. ],
  6789. "alternates": [
  6790. "Ext.AbstractComponent"
  6791. ]
  6792. },
  6793. "Ext.ComponentLoader": {
  6794. "idx": 398,
  6795. "alias": [],
  6796. "alternates": []
  6797. },
  6798. "Ext.ComponentManager": {
  6799. "idx": 21,
  6800. "alias": [],
  6801. "alternates": [
  6802. "Ext.ComponentMgr"
  6803. ]
  6804. },
  6805. "Ext.ComponentQuery": {
  6806. "idx": 24,
  6807. "alias": [],
  6808. "alternates": []
  6809. },
  6810. "Ext.Deferred": {
  6811. "idx": 11,
  6812. "alias": [],
  6813. "alternates": []
  6814. },
  6815. "Ext.Editor": {
  6816. "idx": 406,
  6817. "alias": [
  6818. "widget.editor"
  6819. ],
  6820. "alternates": []
  6821. },
  6822. "Ext.ElementLoader": {
  6823. "idx": 397,
  6824. "alias": [],
  6825. "alternates": []
  6826. },
  6827. "Ext.EventManager": {
  6828. "idx": 407,
  6829. "alias": [],
  6830. "alternates": []
  6831. },
  6832. "Ext.Evented": {
  6833. "idx": 25,
  6834. "alias": [],
  6835. "alternates": [
  6836. "Ext.EventedBase"
  6837. ]
  6838. },
  6839. "Ext.GlobalEvents": {
  6840. "idx": 76,
  6841. "alias": [],
  6842. "alternates": [
  6843. "Ext.globalEvents"
  6844. ]
  6845. },
  6846. "Ext.Glyph": {
  6847. "idx": 77,
  6848. "alias": [],
  6849. "alternates": []
  6850. },
  6851. "Ext.Img": {
  6852. "idx": 409,
  6853. "alias": [
  6854. "widget.image",
  6855. "widget.imagecomponent"
  6856. ],
  6857. "alternates": []
  6858. },
  6859. "Ext.LoadMask": {
  6860. "idx": 411,
  6861. "alias": [
  6862. "widget.loadmask"
  6863. ],
  6864. "alternates": []
  6865. },
  6866. "Ext.Mixin": {
  6867. "idx": 0,
  6868. "alias": [],
  6869. "alternates": []
  6870. },
  6871. "Ext.Progress": {
  6872. "idx": 90,
  6873. "alias": [
  6874. "widget.progress",
  6875. "widget.progressbarwidget"
  6876. ],
  6877. "alternates": [
  6878. "Ext.ProgressBarWidget"
  6879. ]
  6880. },
  6881. "Ext.ProgressBar": {
  6882. "idx": 415,
  6883. "alias": [
  6884. "widget.progressbar"
  6885. ],
  6886. "alternates": []
  6887. },
  6888. "Ext.ProgressBase": {
  6889. "idx": 89,
  6890. "alias": [],
  6891. "alternates": []
  6892. },
  6893. "Ext.Promise": {
  6894. "idx": 10,
  6895. "alias": [],
  6896. "alternates": []
  6897. },
  6898. "Ext.TaskQueue": {
  6899. "idx": 40,
  6900. "alias": [],
  6901. "alternates": []
  6902. },
  6903. "Ext.Template": {
  6904. "idx": 92,
  6905. "alias": [],
  6906. "alternates": []
  6907. },
  6908. "Ext.Widget": {
  6909. "idx": 88,
  6910. "alias": [
  6911. "widget.widget"
  6912. ],
  6913. "alternates": [
  6914. "Ext.Gadget"
  6915. ]
  6916. },
  6917. "Ext.XTemplate": {
  6918. "idx": 95,
  6919. "alias": [],
  6920. "alternates": []
  6921. },
  6922. "Ext.ZIndexManager": {
  6923. "idx": 403,
  6924. "alias": [],
  6925. "alternates": [
  6926. "Ext.WindowGroup"
  6927. ]
  6928. },
  6929. "Ext.app.Application": {
  6930. "idx": 181,
  6931. "alias": [],
  6932. "alternates": []
  6933. },
  6934. "Ext.app.BaseController": {
  6935. "idx": 124,
  6936. "alias": [],
  6937. "alternates": []
  6938. },
  6939. "Ext.app.Controller": {
  6940. "idx": 180,
  6941. "alias": [],
  6942. "alternates": []
  6943. },
  6944. "Ext.app.EventBus": {
  6945. "idx": 116,
  6946. "alias": [],
  6947. "alternates": []
  6948. },
  6949. "Ext.app.EventDomain": {
  6950. "idx": 96,
  6951. "alias": [],
  6952. "alternates": []
  6953. },
  6954. "Ext.app.Profile": {
  6955. "idx": 182,
  6956. "alias": [],
  6957. "alternates": []
  6958. },
  6959. "Ext.app.Util": {
  6960. "idx": 125,
  6961. "alias": [],
  6962. "alternates": []
  6963. },
  6964. "Ext.app.ViewController": {
  6965. "idx": 184,
  6966. "alias": [
  6967. "controller.controller"
  6968. ],
  6969. "alternates": []
  6970. },
  6971. "Ext.app.ViewModel": {
  6972. "idx": 218,
  6973. "alias": [
  6974. "viewmodel.default"
  6975. ],
  6976. "alternates": []
  6977. },
  6978. "Ext.app.bind.AbstractStub": {
  6979. "idx": 199,
  6980. "alias": [],
  6981. "alternates": []
  6982. },
  6983. "Ext.app.bind.BaseBinding": {
  6984. "idx": 197,
  6985. "alias": [],
  6986. "alternates": []
  6987. },
  6988. "Ext.app.bind.Binding": {
  6989. "idx": 198,
  6990. "alias": [],
  6991. "alternates": []
  6992. },
  6993. "Ext.app.bind.Formula": {
  6994. "idx": 204,
  6995. "alias": [],
  6996. "alternates": []
  6997. },
  6998. "Ext.app.bind.LinkStub": {
  6999. "idx": 201,
  7000. "alias": [],
  7001. "alternates": []
  7002. },
  7003. "Ext.app.bind.Multi": {
  7004. "idx": 203,
  7005. "alias": [],
  7006. "alternates": []
  7007. },
  7008. "Ext.app.bind.Parser": {
  7009. "idx": 214,
  7010. "alias": [],
  7011. "alternates": []
  7012. },
  7013. "Ext.app.bind.RootStub": {
  7014. "idx": 202,
  7015. "alias": [],
  7016. "alternates": []
  7017. },
  7018. "Ext.app.bind.Stub": {
  7019. "idx": 200,
  7020. "alias": [],
  7021. "alternates": []
  7022. },
  7023. "Ext.app.bind.Template": {
  7024. "idx": 215,
  7025. "alias": [],
  7026. "alternates": []
  7027. },
  7028. "Ext.app.bind.TemplateBinding": {
  7029. "idx": 216,
  7030. "alias": [],
  7031. "alternates": []
  7032. },
  7033. "Ext.app.domain.Component": {
  7034. "idx": 97,
  7035. "alias": [],
  7036. "alternates": []
  7037. },
  7038. "Ext.app.domain.Controller": {
  7039. "idx": 219,
  7040. "alias": [],
  7041. "alternates": []
  7042. },
  7043. "Ext.app.domain.Direct": {
  7044. "idx": 222,
  7045. "alias": [],
  7046. "alternates": []
  7047. },
  7048. "Ext.app.domain.Global": {
  7049. "idx": 117,
  7050. "alias": [],
  7051. "alternates": []
  7052. },
  7053. "Ext.app.domain.Store": {
  7054. "idx": 179,
  7055. "alias": [],
  7056. "alternates": []
  7057. },
  7058. "Ext.app.domain.View": {
  7059. "idx": 183,
  7060. "alias": [],
  7061. "alternates": []
  7062. },
  7063. "Ext.button.Button": {
  7064. "idx": 419,
  7065. "alias": [
  7066. "widget.button"
  7067. ],
  7068. "alternates": [
  7069. "Ext.Button"
  7070. ]
  7071. },
  7072. "Ext.button.Cycle": {
  7073. "idx": 421,
  7074. "alias": [
  7075. "widget.cycle"
  7076. ],
  7077. "alternates": [
  7078. "Ext.CycleButton"
  7079. ]
  7080. },
  7081. "Ext.button.Manager": {
  7082. "idx": 417,
  7083. "alias": [],
  7084. "alternates": [
  7085. "Ext.ButtonToggleManager"
  7086. ]
  7087. },
  7088. "Ext.button.Segmented": {
  7089. "idx": 423,
  7090. "alias": [
  7091. "widget.segmentedbutton"
  7092. ],
  7093. "alternates": []
  7094. },
  7095. "Ext.button.Split": {
  7096. "idx": 420,
  7097. "alias": [
  7098. "widget.splitbutton"
  7099. ],
  7100. "alternates": [
  7101. "Ext.SplitButton"
  7102. ]
  7103. },
  7104. "Ext.container.ButtonGroup": {
  7105. "idx": 448,
  7106. "alias": [
  7107. "widget.buttongroup"
  7108. ],
  7109. "alternates": [
  7110. "Ext.ButtonGroup"
  7111. ]
  7112. },
  7113. "Ext.container.Container": {
  7114. "idx": 404,
  7115. "alias": [
  7116. "widget.container"
  7117. ],
  7118. "alternates": [
  7119. "Ext.Container",
  7120. "Ext.AbstractContainer"
  7121. ]
  7122. },
  7123. "Ext.container.DockingContainer": {
  7124. "idx": 445,
  7125. "alias": [],
  7126. "alternates": []
  7127. },
  7128. "Ext.container.Monitor": {
  7129. "idx": 449,
  7130. "alias": [],
  7131. "alternates": []
  7132. },
  7133. "Ext.container.Viewport": {
  7134. "idx": 452,
  7135. "alias": [
  7136. "widget.viewport"
  7137. ],
  7138. "alternates": [
  7139. "Ext.Viewport"
  7140. ]
  7141. },
  7142. "Ext.dashboard.Column": {
  7143. "idx": 455,
  7144. "alias": [
  7145. "widget.dashboard-column"
  7146. ],
  7147. "alternates": []
  7148. },
  7149. "Ext.dashboard.Dashboard": {
  7150. "idx": 467,
  7151. "alias": [
  7152. "widget.dashboard"
  7153. ],
  7154. "alternates": []
  7155. },
  7156. "Ext.dashboard.DropZone": {
  7157. "idx": 465,
  7158. "alias": [],
  7159. "alternates": []
  7160. },
  7161. "Ext.dashboard.Panel": {
  7162. "idx": 454,
  7163. "alias": [
  7164. "widget.dashboard-panel"
  7165. ],
  7166. "alternates": []
  7167. },
  7168. "Ext.dashboard.Part": {
  7169. "idx": 466,
  7170. "alias": [
  7171. "part.part"
  7172. ],
  7173. "alternates": []
  7174. },
  7175. "Ext.data.AbstractStore": {
  7176. "idx": 139,
  7177. "alias": [],
  7178. "alternates": []
  7179. },
  7180. "Ext.data.ArrayStore": {
  7181. "idx": 177,
  7182. "alias": [
  7183. "store.array"
  7184. ],
  7185. "alternates": [
  7186. "Ext.data.SimpleStore"
  7187. ]
  7188. },
  7189. "Ext.data.Batch": {
  7190. "idx": 187,
  7191. "alias": [],
  7192. "alternates": []
  7193. },
  7194. "Ext.data.BufferedStore": {
  7195. "idx": 224,
  7196. "alias": [
  7197. "store.buffered"
  7198. ],
  7199. "alternates": []
  7200. },
  7201. "Ext.data.ChainedStore": {
  7202. "idx": 217,
  7203. "alias": [
  7204. "store.chained"
  7205. ],
  7206. "alternates": []
  7207. },
  7208. "Ext.data.Connection": {
  7209. "idx": 17,
  7210. "alias": [],
  7211. "alternates": []
  7212. },
  7213. "Ext.data.DirectStore": {
  7214. "idx": 226,
  7215. "alias": [
  7216. "store.direct"
  7217. ],
  7218. "alternates": []
  7219. },
  7220. "Ext.data.Error": {
  7221. "idx": 140,
  7222. "alias": [],
  7223. "alternates": []
  7224. },
  7225. "Ext.data.ErrorCollection": {
  7226. "idx": 141,
  7227. "alias": [],
  7228. "alternates": [
  7229. "Ext.data.Errors"
  7230. ]
  7231. },
  7232. "Ext.data.Group": {
  7233. "idx": 166,
  7234. "alias": [],
  7235. "alternates": []
  7236. },
  7237. "Ext.data.JsonP": {
  7238. "idx": 227,
  7239. "alias": [],
  7240. "alternates": []
  7241. },
  7242. "Ext.data.JsonPStore": {
  7243. "idx": 229,
  7244. "alias": [
  7245. "store.jsonp"
  7246. ],
  7247. "alternates": []
  7248. },
  7249. "Ext.data.JsonStore": {
  7250. "idx": 230,
  7251. "alias": [
  7252. "store.json"
  7253. ],
  7254. "alternates": []
  7255. },
  7256. "Ext.data.LocalStore": {
  7257. "idx": 167,
  7258. "alias": [],
  7259. "alternates": []
  7260. },
  7261. "Ext.data.Model": {
  7262. "idx": 157,
  7263. "alias": [],
  7264. "alternates": [
  7265. "Ext.data.Record"
  7266. ]
  7267. },
  7268. "Ext.data.ModelManager": {
  7269. "idx": 231,
  7270. "alias": [],
  7271. "alternates": [
  7272. "Ext.ModelMgr"
  7273. ]
  7274. },
  7275. "Ext.data.NodeInterface": {
  7276. "idx": 232,
  7277. "alias": [],
  7278. "alternates": []
  7279. },
  7280. "Ext.data.NodeStore": {
  7281. "idx": 235,
  7282. "alias": [
  7283. "store.node"
  7284. ],
  7285. "alternates": []
  7286. },
  7287. "Ext.data.PageMap": {
  7288. "idx": 223,
  7289. "alias": [],
  7290. "alternates": []
  7291. },
  7292. "Ext.data.ProxyStore": {
  7293. "idx": 164,
  7294. "alias": [],
  7295. "alternates": []
  7296. },
  7297. "Ext.data.Range": {
  7298. "idx": 129,
  7299. "alias": [],
  7300. "alternates": []
  7301. },
  7302. "Ext.data.Request": {
  7303. "idx": 236,
  7304. "alias": [],
  7305. "alternates": []
  7306. },
  7307. "Ext.data.ResultSet": {
  7308. "idx": 158,
  7309. "alias": [],
  7310. "alternates": []
  7311. },
  7312. "Ext.data.Session": {
  7313. "idx": 195,
  7314. "alias": [],
  7315. "alternates": []
  7316. },
  7317. "Ext.data.SortTypes": {
  7318. "idx": 147,
  7319. "alias": [],
  7320. "alternates": []
  7321. },
  7322. "Ext.data.Store": {
  7323. "idx": 175,
  7324. "alias": [
  7325. "store.store"
  7326. ],
  7327. "alternates": []
  7328. },
  7329. "Ext.data.StoreManager": {
  7330. "idx": 178,
  7331. "alias": [],
  7332. "alternates": [
  7333. "Ext.StoreMgr",
  7334. "Ext.data.StoreMgr",
  7335. "Ext.StoreManager"
  7336. ]
  7337. },
  7338. "Ext.data.TreeModel": {
  7339. "idx": 234,
  7340. "alias": [],
  7341. "alternates": []
  7342. },
  7343. "Ext.data.TreeStore": {
  7344. "idx": 237,
  7345. "alias": [
  7346. "store.tree"
  7347. ],
  7348. "alternates": []
  7349. },
  7350. "Ext.data.Types": {
  7351. "idx": 238,
  7352. "alias": [],
  7353. "alternates": []
  7354. },
  7355. "Ext.data.Validation": {
  7356. "idx": 239,
  7357. "alias": [],
  7358. "alternates": []
  7359. },
  7360. "Ext.data.XmlStore": {
  7361. "idx": 244,
  7362. "alias": [
  7363. "store.xml"
  7364. ],
  7365. "alternates": []
  7366. },
  7367. "Ext.data.field.Boolean": {
  7368. "idx": 150,
  7369. "alias": [
  7370. "data.field.bool",
  7371. "data.field.boolean"
  7372. ],
  7373. "alternates": []
  7374. },
  7375. "Ext.data.field.Date": {
  7376. "idx": 151,
  7377. "alias": [
  7378. "data.field.date"
  7379. ],
  7380. "alternates": []
  7381. },
  7382. "Ext.data.field.Field": {
  7383. "idx": 149,
  7384. "alias": [
  7385. "data.field.auto"
  7386. ],
  7387. "alternates": [
  7388. "Ext.data.Field"
  7389. ]
  7390. },
  7391. "Ext.data.field.Integer": {
  7392. "idx": 152,
  7393. "alias": [
  7394. "data.field.int",
  7395. "data.field.integer"
  7396. ],
  7397. "alternates": []
  7398. },
  7399. "Ext.data.field.Number": {
  7400. "idx": 153,
  7401. "alias": [
  7402. "data.field.float",
  7403. "data.field.number"
  7404. ],
  7405. "alternates": []
  7406. },
  7407. "Ext.data.field.String": {
  7408. "idx": 154,
  7409. "alias": [
  7410. "data.field.string"
  7411. ],
  7412. "alternates": []
  7413. },
  7414. "Ext.data.flash.BinaryXhr": {
  7415. "idx": 14,
  7416. "alias": [],
  7417. "alternates": []
  7418. },
  7419. "Ext.data.identifier.Generator": {
  7420. "idx": 155,
  7421. "alias": [
  7422. "data.identifier.default"
  7423. ],
  7424. "alternates": []
  7425. },
  7426. "Ext.data.identifier.Negative": {
  7427. "idx": 245,
  7428. "alias": [
  7429. "data.identifier.negative"
  7430. ],
  7431. "alternates": []
  7432. },
  7433. "Ext.data.identifier.Sequential": {
  7434. "idx": 156,
  7435. "alias": [
  7436. "data.identifier.sequential"
  7437. ],
  7438. "alternates": []
  7439. },
  7440. "Ext.data.identifier.Uuid": {
  7441. "idx": 246,
  7442. "alias": [
  7443. "data.identifier.uuid"
  7444. ],
  7445. "alternates": []
  7446. },
  7447. "Ext.data.matrix.Matrix": {
  7448. "idx": 190,
  7449. "alias": [],
  7450. "alternates": []
  7451. },
  7452. "Ext.data.matrix.Side": {
  7453. "idx": 189,
  7454. "alias": [],
  7455. "alternates": []
  7456. },
  7457. "Ext.data.matrix.Slice": {
  7458. "idx": 188,
  7459. "alias": [],
  7460. "alternates": []
  7461. },
  7462. "Ext.data.operation.Create": {
  7463. "idx": 143,
  7464. "alias": [
  7465. "data.operation.create"
  7466. ],
  7467. "alternates": []
  7468. },
  7469. "Ext.data.operation.Destroy": {
  7470. "idx": 144,
  7471. "alias": [
  7472. "data.operation.destroy"
  7473. ],
  7474. "alternates": []
  7475. },
  7476. "Ext.data.operation.Operation": {
  7477. "idx": 142,
  7478. "alias": [],
  7479. "alternates": [
  7480. "Ext.data.Operation"
  7481. ]
  7482. },
  7483. "Ext.data.operation.Read": {
  7484. "idx": 145,
  7485. "alias": [
  7486. "data.operation.read"
  7487. ],
  7488. "alternates": []
  7489. },
  7490. "Ext.data.operation.Update": {
  7491. "idx": 146,
  7492. "alias": [
  7493. "data.operation.update"
  7494. ],
  7495. "alternates": []
  7496. },
  7497. "Ext.data.proxy.Ajax": {
  7498. "idx": 169,
  7499. "alias": [
  7500. "proxy.ajax"
  7501. ],
  7502. "alternates": [
  7503. "Ext.data.HttpProxy",
  7504. "Ext.data.AjaxProxy"
  7505. ]
  7506. },
  7507. "Ext.data.proxy.Client": {
  7508. "idx": 162,
  7509. "alias": [],
  7510. "alternates": [
  7511. "Ext.data.ClientProxy"
  7512. ]
  7513. },
  7514. "Ext.data.proxy.Direct": {
  7515. "idx": 225,
  7516. "alias": [
  7517. "proxy.direct"
  7518. ],
  7519. "alternates": [
  7520. "Ext.data.DirectProxy"
  7521. ]
  7522. },
  7523. "Ext.data.proxy.JsonP": {
  7524. "idx": 228,
  7525. "alias": [
  7526. "proxy.jsonp",
  7527. "proxy.scripttag"
  7528. ],
  7529. "alternates": [
  7530. "Ext.data.ScriptTagProxy"
  7531. ]
  7532. },
  7533. "Ext.data.proxy.LocalStorage": {
  7534. "idx": 248,
  7535. "alias": [
  7536. "proxy.localstorage"
  7537. ],
  7538. "alternates": [
  7539. "Ext.data.LocalStorageProxy"
  7540. ]
  7541. },
  7542. "Ext.data.proxy.Memory": {
  7543. "idx": 163,
  7544. "alias": [
  7545. "proxy.memory"
  7546. ],
  7547. "alternates": [
  7548. "Ext.data.MemoryProxy"
  7549. ]
  7550. },
  7551. "Ext.data.proxy.Proxy": {
  7552. "idx": 161,
  7553. "alias": [
  7554. "proxy.proxy"
  7555. ],
  7556. "alternates": [
  7557. "Ext.data.DataProxy",
  7558. "Ext.data.Proxy"
  7559. ]
  7560. },
  7561. "Ext.data.proxy.Rest": {
  7562. "idx": 249,
  7563. "alias": [
  7564. "proxy.rest"
  7565. ],
  7566. "alternates": [
  7567. "Ext.data.RestProxy"
  7568. ]
  7569. },
  7570. "Ext.data.proxy.Server": {
  7571. "idx": 168,
  7572. "alias": [
  7573. "proxy.server"
  7574. ],
  7575. "alternates": [
  7576. "Ext.data.ServerProxy"
  7577. ]
  7578. },
  7579. "Ext.data.proxy.SessionStorage": {
  7580. "idx": 250,
  7581. "alias": [
  7582. "proxy.sessionstorage"
  7583. ],
  7584. "alternates": [
  7585. "Ext.data.SessionStorageProxy"
  7586. ]
  7587. },
  7588. "Ext.data.proxy.WebStorage": {
  7589. "idx": 247,
  7590. "alias": [],
  7591. "alternates": [
  7592. "Ext.data.WebStorageProxy"
  7593. ]
  7594. },
  7595. "Ext.data.reader.Array": {
  7596. "idx": 176,
  7597. "alias": [
  7598. "reader.array"
  7599. ],
  7600. "alternates": [
  7601. "Ext.data.ArrayReader"
  7602. ]
  7603. },
  7604. "Ext.data.reader.Json": {
  7605. "idx": 170,
  7606. "alias": [
  7607. "reader.json"
  7608. ],
  7609. "alternates": [
  7610. "Ext.data.JsonReader"
  7611. ]
  7612. },
  7613. "Ext.data.reader.Reader": {
  7614. "idx": 159,
  7615. "alias": [
  7616. "reader.base"
  7617. ],
  7618. "alternates": [
  7619. "Ext.data.Reader",
  7620. "Ext.data.DataReader"
  7621. ]
  7622. },
  7623. "Ext.data.reader.Xml": {
  7624. "idx": 242,
  7625. "alias": [
  7626. "reader.xml"
  7627. ],
  7628. "alternates": [
  7629. "Ext.data.XmlReader"
  7630. ]
  7631. },
  7632. "Ext.data.request.Ajax": {
  7633. "idx": 15,
  7634. "alias": [
  7635. "request.ajax"
  7636. ],
  7637. "alternates": []
  7638. },
  7639. "Ext.data.request.Base": {
  7640. "idx": 13,
  7641. "alias": [],
  7642. "alternates": []
  7643. },
  7644. "Ext.data.request.Form": {
  7645. "idx": 16,
  7646. "alias": [
  7647. "request.form"
  7648. ],
  7649. "alternates": []
  7650. },
  7651. "Ext.data.schema.Association": {
  7652. "idx": 132,
  7653. "alias": [],
  7654. "alternates": []
  7655. },
  7656. "Ext.data.schema.ManyToMany": {
  7657. "idx": 135,
  7658. "alias": [],
  7659. "alternates": []
  7660. },
  7661. "Ext.data.schema.ManyToOne": {
  7662. "idx": 134,
  7663. "alias": [],
  7664. "alternates": []
  7665. },
  7666. "Ext.data.schema.Namer": {
  7667. "idx": 137,
  7668. "alias": [
  7669. "namer.default"
  7670. ],
  7671. "alternates": []
  7672. },
  7673. "Ext.data.schema.OneToOne": {
  7674. "idx": 133,
  7675. "alias": [],
  7676. "alternates": []
  7677. },
  7678. "Ext.data.schema.Role": {
  7679. "idx": 131,
  7680. "alias": [],
  7681. "alternates": []
  7682. },
  7683. "Ext.data.schema.Schema": {
  7684. "idx": 138,
  7685. "alias": [
  7686. "schema.default"
  7687. ],
  7688. "alternates": []
  7689. },
  7690. "Ext.data.session.BatchVisitor": {
  7691. "idx": 193,
  7692. "alias": [],
  7693. "alternates": []
  7694. },
  7695. "Ext.data.session.ChangesVisitor": {
  7696. "idx": 191,
  7697. "alias": [],
  7698. "alternates": []
  7699. },
  7700. "Ext.data.session.ChildChangesVisitor": {
  7701. "idx": 192,
  7702. "alias": [],
  7703. "alternates": []
  7704. },
  7705. "Ext.data.summary.Average": {
  7706. "idx": 257,
  7707. "alias": [
  7708. "data.summary.average"
  7709. ],
  7710. "alternates": []
  7711. },
  7712. "Ext.data.summary.Base": {
  7713. "idx": 255,
  7714. "alias": [
  7715. "data.summary.base"
  7716. ],
  7717. "alternates": []
  7718. },
  7719. "Ext.data.summary.Count": {
  7720. "idx": 258,
  7721. "alias": [
  7722. "data.summary.count"
  7723. ],
  7724. "alternates": []
  7725. },
  7726. "Ext.data.summary.Max": {
  7727. "idx": 259,
  7728. "alias": [
  7729. "data.summary.max"
  7730. ],
  7731. "alternates": []
  7732. },
  7733. "Ext.data.summary.Min": {
  7734. "idx": 260,
  7735. "alias": [
  7736. "data.summary.min"
  7737. ],
  7738. "alternates": []
  7739. },
  7740. "Ext.data.summary.Sum": {
  7741. "idx": 256,
  7742. "alias": [
  7743. "data.summary.sum"
  7744. ],
  7745. "alternates": []
  7746. },
  7747. "Ext.data.validator.AbstractDate": {
  7748. "idx": 261,
  7749. "alias": [],
  7750. "alternates": []
  7751. },
  7752. "Ext.data.validator.Bound": {
  7753. "idx": 262,
  7754. "alias": [
  7755. "data.validator.bound"
  7756. ],
  7757. "alternates": []
  7758. },
  7759. "Ext.data.validator.CIDRv4": {
  7760. "idx": 264,
  7761. "alias": [
  7762. "data.validator.cidrv4"
  7763. ],
  7764. "alternates": []
  7765. },
  7766. "Ext.data.validator.CIDRv6": {
  7767. "idx": 265,
  7768. "alias": [
  7769. "data.validator.cidrv6"
  7770. ],
  7771. "alternates": []
  7772. },
  7773. "Ext.data.validator.Currency": {
  7774. "idx": 267,
  7775. "alias": [
  7776. "data.validator.currency"
  7777. ],
  7778. "alternates": []
  7779. },
  7780. "Ext.data.validator.CurrencyUS": {
  7781. "idx": 268,
  7782. "alias": [
  7783. "data.validator.currency-us"
  7784. ],
  7785. "alternates": []
  7786. },
  7787. "Ext.data.validator.Date": {
  7788. "idx": 269,
  7789. "alias": [
  7790. "data.validator.date"
  7791. ],
  7792. "alternates": []
  7793. },
  7794. "Ext.data.validator.DateTime": {
  7795. "idx": 270,
  7796. "alias": [
  7797. "data.validator.datetime"
  7798. ],
  7799. "alternates": []
  7800. },
  7801. "Ext.data.validator.Email": {
  7802. "idx": 271,
  7803. "alias": [
  7804. "data.validator.email"
  7805. ],
  7806. "alternates": []
  7807. },
  7808. "Ext.data.validator.Exclusion": {
  7809. "idx": 273,
  7810. "alias": [
  7811. "data.validator.exclusion"
  7812. ],
  7813. "alternates": []
  7814. },
  7815. "Ext.data.validator.Format": {
  7816. "idx": 263,
  7817. "alias": [
  7818. "data.validator.format"
  7819. ],
  7820. "alternates": []
  7821. },
  7822. "Ext.data.validator.IPAddress": {
  7823. "idx": 274,
  7824. "alias": [
  7825. "data.validator.ipaddress"
  7826. ],
  7827. "alternates": []
  7828. },
  7829. "Ext.data.validator.Inclusion": {
  7830. "idx": 275,
  7831. "alias": [
  7832. "data.validator.inclusion"
  7833. ],
  7834. "alternates": []
  7835. },
  7836. "Ext.data.validator.Length": {
  7837. "idx": 276,
  7838. "alias": [
  7839. "data.validator.length"
  7840. ],
  7841. "alternates": []
  7842. },
  7843. "Ext.data.validator.List": {
  7844. "idx": 272,
  7845. "alias": [
  7846. "data.validator.list"
  7847. ],
  7848. "alternates": []
  7849. },
  7850. "Ext.data.validator.NotNull": {
  7851. "idx": 278,
  7852. "alias": [
  7853. "data.validator.notnull"
  7854. ],
  7855. "alternates": []
  7856. },
  7857. "Ext.data.validator.Number": {
  7858. "idx": 266,
  7859. "alias": [
  7860. "data.validator.number"
  7861. ],
  7862. "alternates": []
  7863. },
  7864. "Ext.data.validator.Phone": {
  7865. "idx": 279,
  7866. "alias": [
  7867. "data.validator.phone"
  7868. ],
  7869. "alternates": []
  7870. },
  7871. "Ext.data.validator.Presence": {
  7872. "idx": 277,
  7873. "alias": [
  7874. "data.validator.presence"
  7875. ],
  7876. "alternates": []
  7877. },
  7878. "Ext.data.validator.Range": {
  7879. "idx": 280,
  7880. "alias": [
  7881. "data.validator.range"
  7882. ],
  7883. "alternates": []
  7884. },
  7885. "Ext.data.validator.Time": {
  7886. "idx": 281,
  7887. "alias": [
  7888. "data.validator.time"
  7889. ],
  7890. "alternates": []
  7891. },
  7892. "Ext.data.validator.Url": {
  7893. "idx": 282,
  7894. "alias": [
  7895. "data.validator.url"
  7896. ],
  7897. "alternates": []
  7898. },
  7899. "Ext.data.validator.Validator": {
  7900. "idx": 148,
  7901. "alias": [
  7902. "data.validator.base"
  7903. ],
  7904. "alternates": []
  7905. },
  7906. "Ext.data.virtual.Group": {
  7907. "idx": 283,
  7908. "alias": [],
  7909. "alternates": []
  7910. },
  7911. "Ext.data.virtual.Page": {
  7912. "idx": 284,
  7913. "alias": [],
  7914. "alternates": []
  7915. },
  7916. "Ext.data.virtual.PageMap": {
  7917. "idx": 285,
  7918. "alias": [],
  7919. "alternates": []
  7920. },
  7921. "Ext.data.virtual.Range": {
  7922. "idx": 286,
  7923. "alias": [],
  7924. "alternates": []
  7925. },
  7926. "Ext.data.virtual.Store": {
  7927. "idx": 287,
  7928. "alias": [
  7929. "store.virtual"
  7930. ],
  7931. "alternates": []
  7932. },
  7933. "Ext.data.writer.Json": {
  7934. "idx": 171,
  7935. "alias": [
  7936. "writer.json"
  7937. ],
  7938. "alternates": [
  7939. "Ext.data.JsonWriter"
  7940. ]
  7941. },
  7942. "Ext.data.writer.Writer": {
  7943. "idx": 160,
  7944. "alias": [
  7945. "writer.base"
  7946. ],
  7947. "alternates": [
  7948. "Ext.data.DataWriter",
  7949. "Ext.data.Writer"
  7950. ]
  7951. },
  7952. "Ext.data.writer.Xml": {
  7953. "idx": 243,
  7954. "alias": [
  7955. "writer.xml"
  7956. ],
  7957. "alternates": [
  7958. "Ext.data.XmlWriter"
  7959. ]
  7960. },
  7961. "Ext.dd.DD": {
  7962. "idx": 437,
  7963. "alias": [],
  7964. "alternates": []
  7965. },
  7966. "Ext.dd.DDProxy": {
  7967. "idx": 438,
  7968. "alias": [],
  7969. "alternates": []
  7970. },
  7971. "Ext.dd.DDTarget": {
  7972. "idx": 462,
  7973. "alias": [],
  7974. "alternates": []
  7975. },
  7976. "Ext.dd.DragDrop": {
  7977. "idx": 436,
  7978. "alias": [],
  7979. "alternates": []
  7980. },
  7981. "Ext.dd.DragDropManager": {
  7982. "idx": 430,
  7983. "alias": [],
  7984. "alternates": [
  7985. "Ext.dd.DragDropMgr",
  7986. "Ext.dd.DDM"
  7987. ]
  7988. },
  7989. "Ext.dd.DragSource": {
  7990. "idx": 440,
  7991. "alias": [],
  7992. "alternates": []
  7993. },
  7994. "Ext.dd.DragTracker": {
  7995. "idx": 457,
  7996. "alias": [],
  7997. "alternates": []
  7998. },
  7999. "Ext.dd.DragZone": {
  8000. "idx": 468,
  8001. "alias": [],
  8002. "alternates": []
  8003. },
  8004. "Ext.dd.DropTarget": {
  8005. "idx": 464,
  8006. "alias": [],
  8007. "alternates": []
  8008. },
  8009. "Ext.dd.DropZone": {
  8010. "idx": 470,
  8011. "alias": [],
  8012. "alternates": []
  8013. },
  8014. "Ext.dd.Registry": {
  8015. "idx": 469,
  8016. "alias": [],
  8017. "alternates": []
  8018. },
  8019. "Ext.dd.ScrollManager": {
  8020. "idx": 463,
  8021. "alias": [],
  8022. "alternates": []
  8023. },
  8024. "Ext.dd.StatusProxy": {
  8025. "idx": 439,
  8026. "alias": [],
  8027. "alternates": []
  8028. },
  8029. "Ext.direct.Event": {
  8030. "idx": 288,
  8031. "alias": [
  8032. "direct.event"
  8033. ],
  8034. "alternates": []
  8035. },
  8036. "Ext.direct.ExceptionEvent": {
  8037. "idx": 290,
  8038. "alias": [
  8039. "direct.exception"
  8040. ],
  8041. "alternates": []
  8042. },
  8043. "Ext.direct.JsonProvider": {
  8044. "idx": 291,
  8045. "alias": [
  8046. "direct.jsonprovider"
  8047. ],
  8048. "alternates": []
  8049. },
  8050. "Ext.direct.Manager": {
  8051. "idx": 220,
  8052. "alias": [],
  8053. "alternates": []
  8054. },
  8055. "Ext.direct.PollingProvider": {
  8056. "idx": 292,
  8057. "alias": [
  8058. "direct.pollingprovider"
  8059. ],
  8060. "alternates": []
  8061. },
  8062. "Ext.direct.Provider": {
  8063. "idx": 221,
  8064. "alias": [
  8065. "direct.provider"
  8066. ],
  8067. "alternates": []
  8068. },
  8069. "Ext.direct.RemotingEvent": {
  8070. "idx": 289,
  8071. "alias": [
  8072. "direct.rpc"
  8073. ],
  8074. "alternates": []
  8075. },
  8076. "Ext.direct.RemotingMethod": {
  8077. "idx": 293,
  8078. "alias": [],
  8079. "alternates": []
  8080. },
  8081. "Ext.direct.RemotingProvider": {
  8082. "idx": 295,
  8083. "alias": [
  8084. "direct.remotingprovider"
  8085. ],
  8086. "alternates": []
  8087. },
  8088. "Ext.direct.Transaction": {
  8089. "idx": 294,
  8090. "alias": [
  8091. "direct.transaction"
  8092. ],
  8093. "alternates": []
  8094. },
  8095. "Ext.dom.ButtonElement": {
  8096. "idx": 416,
  8097. "alias": [],
  8098. "alternates": []
  8099. },
  8100. "Ext.dom.CompositeElement": {
  8101. "idx": 99,
  8102. "alias": [],
  8103. "alternates": [
  8104. "Ext.CompositeElement"
  8105. ]
  8106. },
  8107. "Ext.dom.CompositeElementLite": {
  8108. "idx": 75,
  8109. "alias": [],
  8110. "alternates": [
  8111. "Ext.CompositeElementLite"
  8112. ]
  8113. },
  8114. "Ext.dom.Element": {
  8115. "idx": 49,
  8116. "alias": [],
  8117. "alternates": [
  8118. "Ext.Element"
  8119. ]
  8120. },
  8121. "Ext.dom.ElementEvent": {
  8122. "idx": 31,
  8123. "alias": [],
  8124. "alternates": []
  8125. },
  8126. "Ext.dom.Fly": {
  8127. "idx": 74,
  8128. "alias": [],
  8129. "alternates": [
  8130. "Ext.dom.Element.Fly"
  8131. ]
  8132. },
  8133. "Ext.dom.GarbageCollector": {
  8134. "idx": 296,
  8135. "alias": [],
  8136. "alternates": []
  8137. },
  8138. "Ext.dom.Helper": {
  8139. "idx": 240,
  8140. "alias": [],
  8141. "alternates": [
  8142. "Ext.DomHelper",
  8143. "Ext.core.DomHelper"
  8144. ]
  8145. },
  8146. "Ext.dom.Layer": {
  8147. "idx": 471,
  8148. "alias": [],
  8149. "alternates": [
  8150. "Ext.Layer"
  8151. ]
  8152. },
  8153. "Ext.dom.Query": {
  8154. "idx": 241,
  8155. "alias": [],
  8156. "alternates": [
  8157. "Ext.core.DomQuery",
  8158. "Ext.DomQuery"
  8159. ]
  8160. },
  8161. "Ext.dom.Shadow": {
  8162. "idx": 29,
  8163. "alias": [],
  8164. "alternates": [
  8165. "Ext.Shadow"
  8166. ]
  8167. },
  8168. "Ext.dom.Shim": {
  8169. "idx": 30,
  8170. "alias": [],
  8171. "alternates": []
  8172. },
  8173. "Ext.dom.TouchAction": {
  8174. "idx": 297,
  8175. "alias": [],
  8176. "alternates": []
  8177. },
  8178. "Ext.dom.Underlay": {
  8179. "idx": 28,
  8180. "alias": [],
  8181. "alternates": []
  8182. },
  8183. "Ext.dom.UnderlayPool": {
  8184. "idx": 27,
  8185. "alias": [],
  8186. "alternates": []
  8187. },
  8188. "Ext.drag.Constraint": {
  8189. "idx": 298,
  8190. "alias": [
  8191. "drag.constraint.base"
  8192. ],
  8193. "alternates": []
  8194. },
  8195. "Ext.drag.Info": {
  8196. "idx": 299,
  8197. "alias": [],
  8198. "alternates": []
  8199. },
  8200. "Ext.drag.Item": {
  8201. "idx": 300,
  8202. "alias": [],
  8203. "alternates": []
  8204. },
  8205. "Ext.drag.Manager": {
  8206. "idx": 301,
  8207. "alias": [],
  8208. "alternates": []
  8209. },
  8210. "Ext.drag.Source": {
  8211. "idx": 302,
  8212. "alias": [],
  8213. "alternates": []
  8214. },
  8215. "Ext.drag.Target": {
  8216. "idx": 303,
  8217. "alias": [],
  8218. "alternates": []
  8219. },
  8220. "Ext.drag.proxy.None": {
  8221. "idx": 304,
  8222. "alias": [
  8223. "drag.proxy.none"
  8224. ],
  8225. "alternates": []
  8226. },
  8227. "Ext.drag.proxy.Original": {
  8228. "idx": 305,
  8229. "alias": [
  8230. "drag.proxy.original"
  8231. ],
  8232. "alternates": []
  8233. },
  8234. "Ext.drag.proxy.Placeholder": {
  8235. "idx": 306,
  8236. "alias": [
  8237. "drag.proxy.placeholder"
  8238. ],
  8239. "alternates": []
  8240. },
  8241. "Ext.event.Event": {
  8242. "idx": 36,
  8243. "alias": [],
  8244. "alternates": [
  8245. "Ext.EventObjectImpl"
  8246. ]
  8247. },
  8248. "Ext.event.gesture.DoubleTap": {
  8249. "idx": 309,
  8250. "alias": [],
  8251. "alternates": []
  8252. },
  8253. "Ext.event.gesture.Drag": {
  8254. "idx": 310,
  8255. "alias": [],
  8256. "alternates": []
  8257. },
  8258. "Ext.event.gesture.EdgeSwipe": {
  8259. "idx": 312,
  8260. "alias": [],
  8261. "alternates": []
  8262. },
  8263. "Ext.event.gesture.LongPress": {
  8264. "idx": 313,
  8265. "alias": [],
  8266. "alternates": []
  8267. },
  8268. "Ext.event.gesture.MultiTouch": {
  8269. "idx": 314,
  8270. "alias": [],
  8271. "alternates": []
  8272. },
  8273. "Ext.event.gesture.Pinch": {
  8274. "idx": 315,
  8275. "alias": [],
  8276. "alternates": []
  8277. },
  8278. "Ext.event.gesture.Recognizer": {
  8279. "idx": 307,
  8280. "alias": [],
  8281. "alternates": []
  8282. },
  8283. "Ext.event.gesture.Rotate": {
  8284. "idx": 316,
  8285. "alias": [],
  8286. "alternates": []
  8287. },
  8288. "Ext.event.gesture.SingleTouch": {
  8289. "idx": 308,
  8290. "alias": [],
  8291. "alternates": []
  8292. },
  8293. "Ext.event.gesture.Swipe": {
  8294. "idx": 311,
  8295. "alias": [],
  8296. "alternates": []
  8297. },
  8298. "Ext.event.gesture.Tap": {
  8299. "idx": 317,
  8300. "alias": [],
  8301. "alternates": []
  8302. },
  8303. "Ext.event.publisher.Dom": {
  8304. "idx": 37,
  8305. "alias": [],
  8306. "alternates": []
  8307. },
  8308. "Ext.event.publisher.ElementPaint": {
  8309. "idx": 48,
  8310. "alias": [],
  8311. "alternates": []
  8312. },
  8313. "Ext.event.publisher.ElementSize": {
  8314. "idx": 44,
  8315. "alias": [],
  8316. "alternates": []
  8317. },
  8318. "Ext.event.publisher.Focus": {
  8319. "idx": 318,
  8320. "alias": [],
  8321. "alternates": []
  8322. },
  8323. "Ext.event.publisher.Gesture": {
  8324. "idx": 38,
  8325. "alias": [],
  8326. "alternates": []
  8327. },
  8328. "Ext.event.publisher.MouseEnterLeave": {
  8329. "idx": 473,
  8330. "alias": [],
  8331. "alternates": []
  8332. },
  8333. "Ext.event.publisher.Publisher": {
  8334. "idx": 32,
  8335. "alias": [],
  8336. "alternates": []
  8337. },
  8338. "Ext.field.InputMask": {
  8339. "idx": 319,
  8340. "alias": [],
  8341. "alternates": []
  8342. },
  8343. "Ext.flash.Component": {
  8344. "idx": 474,
  8345. "alias": [
  8346. "widget.flash"
  8347. ],
  8348. "alternates": [
  8349. "Ext.FlashComponent"
  8350. ]
  8351. },
  8352. "Ext.form.Basic": {
  8353. "idx": 490,
  8354. "alias": [],
  8355. "alternates": [
  8356. "Ext.form.BasicForm"
  8357. ]
  8358. },
  8359. "Ext.form.CheckboxGroup": {
  8360. "idx": 497,
  8361. "alias": [
  8362. "widget.checkboxgroup"
  8363. ],
  8364. "alternates": []
  8365. },
  8366. "Ext.form.CheckboxManager": {
  8367. "idx": 495,
  8368. "alias": [],
  8369. "alternates": []
  8370. },
  8371. "Ext.form.FieldAncestor": {
  8372. "idx": 491,
  8373. "alias": [],
  8374. "alternates": []
  8375. },
  8376. "Ext.form.FieldContainer": {
  8377. "idx": 493,
  8378. "alias": [
  8379. "widget.fieldcontainer"
  8380. ],
  8381. "alternates": []
  8382. },
  8383. "Ext.form.FieldSet": {
  8384. "idx": 498,
  8385. "alias": [
  8386. "widget.fieldset"
  8387. ],
  8388. "alternates": []
  8389. },
  8390. "Ext.form.Label": {
  8391. "idx": 499,
  8392. "alias": [
  8393. "widget.label"
  8394. ],
  8395. "alternates": []
  8396. },
  8397. "Ext.form.Labelable": {
  8398. "idx": 481,
  8399. "alias": [],
  8400. "alternates": []
  8401. },
  8402. "Ext.form.Panel": {
  8403. "idx": 500,
  8404. "alias": [
  8405. "widget.form"
  8406. ],
  8407. "alternates": [
  8408. "Ext.FormPanel",
  8409. "Ext.form.FormPanel"
  8410. ]
  8411. },
  8412. "Ext.form.RadioGroup": {
  8413. "idx": 503,
  8414. "alias": [
  8415. "widget.radiogroup"
  8416. ],
  8417. "alternates": []
  8418. },
  8419. "Ext.form.RadioManager": {
  8420. "idx": 501,
  8421. "alias": [],
  8422. "alternates": []
  8423. },
  8424. "Ext.form.action.Action": {
  8425. "idx": 475,
  8426. "alias": [],
  8427. "alternates": [
  8428. "Ext.form.Action"
  8429. ]
  8430. },
  8431. "Ext.form.action.DirectAction": {
  8432. "idx": 504,
  8433. "alias": [],
  8434. "alternates": []
  8435. },
  8436. "Ext.form.action.DirectLoad": {
  8437. "idx": 505,
  8438. "alias": [
  8439. "formaction.directload"
  8440. ],
  8441. "alternates": [
  8442. "Ext.form.Action.DirectLoad"
  8443. ]
  8444. },
  8445. "Ext.form.action.DirectSubmit": {
  8446. "idx": 506,
  8447. "alias": [
  8448. "formaction.directsubmit"
  8449. ],
  8450. "alternates": [
  8451. "Ext.form.Action.DirectSubmit"
  8452. ]
  8453. },
  8454. "Ext.form.action.Load": {
  8455. "idx": 476,
  8456. "alias": [
  8457. "formaction.load"
  8458. ],
  8459. "alternates": [
  8460. "Ext.form.Action.Load"
  8461. ]
  8462. },
  8463. "Ext.form.action.StandardSubmit": {
  8464. "idx": 478,
  8465. "alias": [
  8466. "formaction.standardsubmit"
  8467. ],
  8468. "alternates": []
  8469. },
  8470. "Ext.form.action.Submit": {
  8471. "idx": 477,
  8472. "alias": [
  8473. "formaction.submit"
  8474. ],
  8475. "alternates": [
  8476. "Ext.form.Action.Submit"
  8477. ]
  8478. },
  8479. "Ext.form.field.Base": {
  8480. "idx": 483,
  8481. "alias": [
  8482. "widget.field"
  8483. ],
  8484. "alternates": [
  8485. "Ext.form.Field",
  8486. "Ext.form.BaseField"
  8487. ]
  8488. },
  8489. "Ext.form.field.Checkbox": {
  8490. "idx": 496,
  8491. "alias": [
  8492. "widget.checkbox",
  8493. "widget.checkboxfield"
  8494. ],
  8495. "alternates": [
  8496. "Ext.form.Checkbox"
  8497. ]
  8498. },
  8499. "Ext.form.field.ComboBox": {
  8500. "idx": 522,
  8501. "alias": [
  8502. "widget.combo",
  8503. "widget.combobox"
  8504. ],
  8505. "alternates": [
  8506. "Ext.form.ComboBox"
  8507. ]
  8508. },
  8509. "Ext.form.field.Date": {
  8510. "idx": 525,
  8511. "alias": [
  8512. "widget.datefield"
  8513. ],
  8514. "alternates": [
  8515. "Ext.form.DateField",
  8516. "Ext.form.Date"
  8517. ]
  8518. },
  8519. "Ext.form.field.Display": {
  8520. "idx": 526,
  8521. "alias": [
  8522. "widget.displayfield"
  8523. ],
  8524. "alternates": [
  8525. "Ext.form.DisplayField",
  8526. "Ext.form.Display"
  8527. ]
  8528. },
  8529. "Ext.form.field.Field": {
  8530. "idx": 482,
  8531. "alias": [],
  8532. "alternates": []
  8533. },
  8534. "Ext.form.field.File": {
  8535. "idx": 529,
  8536. "alias": [
  8537. "widget.filefield",
  8538. "widget.fileuploadfield"
  8539. ],
  8540. "alternates": [
  8541. "Ext.form.FileUploadField",
  8542. "Ext.ux.form.FileUploadField",
  8543. "Ext.form.File"
  8544. ]
  8545. },
  8546. "Ext.form.field.FileButton": {
  8547. "idx": 527,
  8548. "alias": [
  8549. "widget.filebutton"
  8550. ],
  8551. "alternates": []
  8552. },
  8553. "Ext.form.field.Hidden": {
  8554. "idx": 530,
  8555. "alias": [
  8556. "widget.hidden",
  8557. "widget.hiddenfield"
  8558. ],
  8559. "alternates": [
  8560. "Ext.form.Hidden"
  8561. ]
  8562. },
  8563. "Ext.form.field.HtmlEditor": {
  8564. "idx": 539,
  8565. "alias": [
  8566. "widget.htmleditor"
  8567. ],
  8568. "alternates": [
  8569. "Ext.form.HtmlEditor"
  8570. ]
  8571. },
  8572. "Ext.form.field.Number": {
  8573. "idx": 519,
  8574. "alias": [
  8575. "widget.numberfield"
  8576. ],
  8577. "alternates": [
  8578. "Ext.form.NumberField",
  8579. "Ext.form.Number"
  8580. ]
  8581. },
  8582. "Ext.form.field.Picker": {
  8583. "idx": 507,
  8584. "alias": [
  8585. "widget.pickerfield"
  8586. ],
  8587. "alternates": [
  8588. "Ext.form.Picker"
  8589. ]
  8590. },
  8591. "Ext.form.field.Radio": {
  8592. "idx": 502,
  8593. "alias": [
  8594. "widget.radio",
  8595. "widget.radiofield"
  8596. ],
  8597. "alternates": [
  8598. "Ext.form.Radio"
  8599. ]
  8600. },
  8601. "Ext.form.field.Spinner": {
  8602. "idx": 518,
  8603. "alias": [
  8604. "widget.spinnerfield"
  8605. ],
  8606. "alternates": [
  8607. "Ext.form.Spinner"
  8608. ]
  8609. },
  8610. "Ext.form.field.Tag": {
  8611. "idx": 541,
  8612. "alias": [
  8613. "widget.tagfield"
  8614. ],
  8615. "alternates": []
  8616. },
  8617. "Ext.form.field.Text": {
  8618. "idx": 487,
  8619. "alias": [
  8620. "widget.textfield"
  8621. ],
  8622. "alternates": [
  8623. "Ext.form.TextField",
  8624. "Ext.form.Text"
  8625. ]
  8626. },
  8627. "Ext.form.field.TextArea": {
  8628. "idx": 488,
  8629. "alias": [
  8630. "widget.textarea",
  8631. "widget.textareafield"
  8632. ],
  8633. "alternates": [
  8634. "Ext.form.TextArea"
  8635. ]
  8636. },
  8637. "Ext.form.field.Time": {
  8638. "idx": 543,
  8639. "alias": [
  8640. "widget.timefield"
  8641. ],
  8642. "alternates": [
  8643. "Ext.form.TimeField",
  8644. "Ext.form.Time"
  8645. ]
  8646. },
  8647. "Ext.form.field.Trigger": {
  8648. "idx": 544,
  8649. "alias": [
  8650. "widget.trigger",
  8651. "widget.triggerfield"
  8652. ],
  8653. "alternates": [
  8654. "Ext.form.TriggerField",
  8655. "Ext.form.TwinTriggerField",
  8656. "Ext.form.Trigger"
  8657. ]
  8658. },
  8659. "Ext.form.field.VTypes": {
  8660. "idx": 485,
  8661. "alias": [],
  8662. "alternates": [
  8663. "Ext.form.VTypes"
  8664. ]
  8665. },
  8666. "Ext.form.trigger.Component": {
  8667. "idx": 528,
  8668. "alias": [
  8669. "trigger.component"
  8670. ],
  8671. "alternates": []
  8672. },
  8673. "Ext.form.trigger.Spinner": {
  8674. "idx": 517,
  8675. "alias": [
  8676. "trigger.spinner"
  8677. ],
  8678. "alternates": []
  8679. },
  8680. "Ext.form.trigger.Trigger": {
  8681. "idx": 486,
  8682. "alias": [
  8683. "trigger.trigger"
  8684. ],
  8685. "alternates": []
  8686. },
  8687. "Ext.fx.Anim": {
  8688. "idx": 72,
  8689. "alias": [],
  8690. "alternates": []
  8691. },
  8692. "Ext.fx.Animation": {
  8693. "idx": 329,
  8694. "alias": [],
  8695. "alternates": []
  8696. },
  8697. "Ext.fx.Animator": {
  8698. "idx": 67,
  8699. "alias": [],
  8700. "alternates": []
  8701. },
  8702. "Ext.fx.CubicBezier": {
  8703. "idx": 68,
  8704. "alias": [],
  8705. "alternates": []
  8706. },
  8707. "Ext.fx.DrawPath": {
  8708. "idx": 70,
  8709. "alias": [],
  8710. "alternates": []
  8711. },
  8712. "Ext.fx.Easing": {
  8713. "idx": 69,
  8714. "alias": [],
  8715. "alternates": []
  8716. },
  8717. "Ext.fx.Manager": {
  8718. "idx": 66,
  8719. "alias": [],
  8720. "alternates": []
  8721. },
  8722. "Ext.fx.PropertyHandler": {
  8723. "idx": 71,
  8724. "alias": [],
  8725. "alternates": []
  8726. },
  8727. "Ext.fx.Queue": {
  8728. "idx": 65,
  8729. "alias": [],
  8730. "alternates": []
  8731. },
  8732. "Ext.fx.Runner": {
  8733. "idx": 332,
  8734. "alias": [],
  8735. "alternates": []
  8736. },
  8737. "Ext.fx.State": {
  8738. "idx": 320,
  8739. "alias": [],
  8740. "alternates": []
  8741. },
  8742. "Ext.fx.animation.Abstract": {
  8743. "idx": 321,
  8744. "alias": [],
  8745. "alternates": []
  8746. },
  8747. "Ext.fx.animation.Cube": {
  8748. "idx": 333,
  8749. "alias": [
  8750. "animation.cube"
  8751. ],
  8752. "alternates": []
  8753. },
  8754. "Ext.fx.animation.Fade": {
  8755. "idx": 324,
  8756. "alias": [
  8757. "animation.fade",
  8758. "animation.fadeIn"
  8759. ],
  8760. "alternates": [
  8761. "Ext.fx.animation.FadeIn"
  8762. ]
  8763. },
  8764. "Ext.fx.animation.FadeOut": {
  8765. "idx": 325,
  8766. "alias": [
  8767. "animation.fadeOut"
  8768. ],
  8769. "alternates": []
  8770. },
  8771. "Ext.fx.animation.Flip": {
  8772. "idx": 326,
  8773. "alias": [
  8774. "animation.flip"
  8775. ],
  8776. "alternates": []
  8777. },
  8778. "Ext.fx.animation.Pop": {
  8779. "idx": 327,
  8780. "alias": [
  8781. "animation.pop",
  8782. "animation.popIn"
  8783. ],
  8784. "alternates": [
  8785. "Ext.fx.animation.PopIn"
  8786. ]
  8787. },
  8788. "Ext.fx.animation.PopOut": {
  8789. "idx": 328,
  8790. "alias": [
  8791. "animation.popOut"
  8792. ],
  8793. "alternates": []
  8794. },
  8795. "Ext.fx.animation.Slide": {
  8796. "idx": 322,
  8797. "alias": [
  8798. "animation.slide",
  8799. "animation.slideIn"
  8800. ],
  8801. "alternates": [
  8802. "Ext.fx.animation.SlideIn"
  8803. ]
  8804. },
  8805. "Ext.fx.animation.SlideOut": {
  8806. "idx": 323,
  8807. "alias": [
  8808. "animation.slideOut"
  8809. ],
  8810. "alternates": []
  8811. },
  8812. "Ext.fx.animation.Wipe": {
  8813. "idx": 334,
  8814. "alias": [],
  8815. "alternates": [
  8816. "Ext.fx.animation.WipeIn"
  8817. ]
  8818. },
  8819. "Ext.fx.animation.WipeOut": {
  8820. "idx": 335,
  8821. "alias": [],
  8822. "alternates": []
  8823. },
  8824. "Ext.fx.easing.Abstract": {
  8825. "idx": 102,
  8826. "alias": [],
  8827. "alternates": []
  8828. },
  8829. "Ext.fx.easing.Bounce": {
  8830. "idx": 336,
  8831. "alias": [],
  8832. "alternates": []
  8833. },
  8834. "Ext.fx.easing.BoundMomentum": {
  8835. "idx": 338,
  8836. "alias": [],
  8837. "alternates": []
  8838. },
  8839. "Ext.fx.easing.EaseIn": {
  8840. "idx": 339,
  8841. "alias": [
  8842. "easing.ease-in"
  8843. ],
  8844. "alternates": []
  8845. },
  8846. "Ext.fx.easing.EaseOut": {
  8847. "idx": 340,
  8848. "alias": [
  8849. "easing.ease-out"
  8850. ],
  8851. "alternates": []
  8852. },
  8853. "Ext.fx.easing.Easing": {
  8854. "idx": 341,
  8855. "alias": [],
  8856. "alternates": []
  8857. },
  8858. "Ext.fx.easing.Linear": {
  8859. "idx": 103,
  8860. "alias": [
  8861. "easing.linear"
  8862. ],
  8863. "alternates": []
  8864. },
  8865. "Ext.fx.easing.Momentum": {
  8866. "idx": 337,
  8867. "alias": [],
  8868. "alternates": []
  8869. },
  8870. "Ext.fx.runner.Css": {
  8871. "idx": 330,
  8872. "alias": [],
  8873. "alternates": []
  8874. },
  8875. "Ext.fx.runner.CssAnimation": {
  8876. "idx": 342,
  8877. "alias": [],
  8878. "alternates": []
  8879. },
  8880. "Ext.fx.runner.CssTransition": {
  8881. "idx": 331,
  8882. "alias": [],
  8883. "alternates": [
  8884. "Ext.Animator"
  8885. ]
  8886. },
  8887. "Ext.fx.target.Component": {
  8888. "idx": 64,
  8889. "alias": [],
  8890. "alternates": []
  8891. },
  8892. "Ext.fx.target.CompositeElement": {
  8893. "idx": 60,
  8894. "alias": [],
  8895. "alternates": []
  8896. },
  8897. "Ext.fx.target.CompositeElementCSS": {
  8898. "idx": 61,
  8899. "alias": [],
  8900. "alternates": []
  8901. },
  8902. "Ext.fx.target.CompositeSprite": {
  8903. "idx": 63,
  8904. "alias": [],
  8905. "alternates": []
  8906. },
  8907. "Ext.fx.target.Element": {
  8908. "idx": 58,
  8909. "alias": [],
  8910. "alternates": []
  8911. },
  8912. "Ext.fx.target.ElementCSS": {
  8913. "idx": 59,
  8914. "alias": [],
  8915. "alternates": []
  8916. },
  8917. "Ext.fx.target.Sprite": {
  8918. "idx": 62,
  8919. "alias": [],
  8920. "alternates": []
  8921. },
  8922. "Ext.fx.target.Target": {
  8923. "idx": 57,
  8924. "alias": [],
  8925. "alternates": []
  8926. },
  8927. "Ext.grid.CellContext": {
  8928. "idx": 545,
  8929. "alias": [],
  8930. "alternates": []
  8931. },
  8932. "Ext.grid.CellEditor": {
  8933. "idx": 546,
  8934. "alias": [
  8935. "widget.celleditor"
  8936. ],
  8937. "alternates": []
  8938. },
  8939. "Ext.grid.ColumnComponentLayout": {
  8940. "idx": 547,
  8941. "alias": [
  8942. "layout.columncomponent"
  8943. ],
  8944. "alternates": []
  8945. },
  8946. "Ext.grid.ColumnLayout": {
  8947. "idx": 550,
  8948. "alias": [
  8949. "layout.gridcolumn"
  8950. ],
  8951. "alternates": []
  8952. },
  8953. "Ext.grid.ColumnManager": {
  8954. "idx": 551,
  8955. "alias": [],
  8956. "alternates": [
  8957. "Ext.grid.ColumnModel"
  8958. ]
  8959. },
  8960. "Ext.grid.NavigationModel": {
  8961. "idx": 552,
  8962. "alias": [
  8963. "view.navigation.grid"
  8964. ],
  8965. "alternates": []
  8966. },
  8967. "Ext.grid.Panel": {
  8968. "idx": 558,
  8969. "alias": [
  8970. "widget.grid",
  8971. "widget.gridpanel"
  8972. ],
  8973. "alternates": [
  8974. "Ext.list.ListView",
  8975. "Ext.ListView",
  8976. "Ext.grid.GridPanel"
  8977. ]
  8978. },
  8979. "Ext.grid.RowContext": {
  8980. "idx": 559,
  8981. "alias": [],
  8982. "alternates": []
  8983. },
  8984. "Ext.grid.RowEditor": {
  8985. "idx": 561,
  8986. "alias": [
  8987. "widget.roweditor"
  8988. ],
  8989. "alternates": []
  8990. },
  8991. "Ext.grid.RowEditorButtons": {
  8992. "idx": 560,
  8993. "alias": [
  8994. "widget.roweditorbuttons"
  8995. ],
  8996. "alternates": []
  8997. },
  8998. "Ext.grid.Scroller": {
  8999. "idx": 562,
  9000. "alias": [],
  9001. "alternates": []
  9002. },
  9003. "Ext.grid.ViewDropZone": {
  9004. "idx": 564,
  9005. "alias": [],
  9006. "alternates": []
  9007. },
  9008. "Ext.grid.column.Action": {
  9009. "idx": 572,
  9010. "alias": [
  9011. "widget.actioncolumn"
  9012. ],
  9013. "alternates": [
  9014. "Ext.grid.ActionColumn"
  9015. ]
  9016. },
  9017. "Ext.grid.column.ActionProxy": {
  9018. "idx": 571,
  9019. "alias": [],
  9020. "alternates": []
  9021. },
  9022. "Ext.grid.column.Boolean": {
  9023. "idx": 573,
  9024. "alias": [
  9025. "widget.booleancolumn"
  9026. ],
  9027. "alternates": [
  9028. "Ext.grid.BooleanColumn"
  9029. ]
  9030. },
  9031. "Ext.grid.column.Check": {
  9032. "idx": 574,
  9033. "alias": [
  9034. "widget.checkcolumn"
  9035. ],
  9036. "alternates": [
  9037. "Ext.ux.CheckColumn",
  9038. "Ext.grid.column.CheckColumn"
  9039. ]
  9040. },
  9041. "Ext.grid.column.Column": {
  9042. "idx": 570,
  9043. "alias": [
  9044. "widget.gridcolumn"
  9045. ],
  9046. "alternates": [
  9047. "Ext.grid.Column"
  9048. ]
  9049. },
  9050. "Ext.grid.column.Date": {
  9051. "idx": 575,
  9052. "alias": [
  9053. "widget.datecolumn"
  9054. ],
  9055. "alternates": [
  9056. "Ext.grid.DateColumn"
  9057. ]
  9058. },
  9059. "Ext.grid.column.Number": {
  9060. "idx": 576,
  9061. "alias": [
  9062. "widget.numbercolumn"
  9063. ],
  9064. "alternates": [
  9065. "Ext.grid.NumberColumn"
  9066. ]
  9067. },
  9068. "Ext.grid.column.RowNumberer": {
  9069. "idx": 577,
  9070. "alias": [
  9071. "widget.rownumberer"
  9072. ],
  9073. "alternates": [
  9074. "Ext.grid.RowNumberer"
  9075. ]
  9076. },
  9077. "Ext.grid.column.Template": {
  9078. "idx": 578,
  9079. "alias": [
  9080. "widget.templatecolumn"
  9081. ],
  9082. "alternates": [
  9083. "Ext.grid.TemplateColumn"
  9084. ]
  9085. },
  9086. "Ext.grid.column.Widget": {
  9087. "idx": 579,
  9088. "alias": [
  9089. "widget.widgetcolumn"
  9090. ],
  9091. "alternates": []
  9092. },
  9093. "Ext.grid.feature.AbstractSummary": {
  9094. "idx": 581,
  9095. "alias": [
  9096. "feature.abstractsummary"
  9097. ],
  9098. "alternates": []
  9099. },
  9100. "Ext.grid.feature.Feature": {
  9101. "idx": 580,
  9102. "alias": [
  9103. "feature.feature"
  9104. ],
  9105. "alternates": []
  9106. },
  9107. "Ext.grid.feature.GroupStore": {
  9108. "idx": 582,
  9109. "alias": [],
  9110. "alternates": []
  9111. },
  9112. "Ext.grid.feature.Grouping": {
  9113. "idx": 583,
  9114. "alias": [
  9115. "feature.grouping"
  9116. ],
  9117. "alternates": []
  9118. },
  9119. "Ext.grid.feature.GroupingSummary": {
  9120. "idx": 584,
  9121. "alias": [
  9122. "feature.groupingsummary"
  9123. ],
  9124. "alternates": []
  9125. },
  9126. "Ext.grid.feature.RowBody": {
  9127. "idx": 585,
  9128. "alias": [
  9129. "feature.rowbody"
  9130. ],
  9131. "alternates": []
  9132. },
  9133. "Ext.grid.feature.Summary": {
  9134. "idx": 586,
  9135. "alias": [
  9136. "feature.summary"
  9137. ],
  9138. "alternates": []
  9139. },
  9140. "Ext.grid.filters.Filters": {
  9141. "idx": 599,
  9142. "alias": [
  9143. "plugin.gridfilters"
  9144. ],
  9145. "alternates": []
  9146. },
  9147. "Ext.grid.filters.filter.Base": {
  9148. "idx": 591,
  9149. "alias": [],
  9150. "alternates": []
  9151. },
  9152. "Ext.grid.filters.filter.Boolean": {
  9153. "idx": 593,
  9154. "alias": [
  9155. "grid.filter.boolean"
  9156. ],
  9157. "alternates": []
  9158. },
  9159. "Ext.grid.filters.filter.Date": {
  9160. "idx": 595,
  9161. "alias": [
  9162. "grid.filter.date"
  9163. ],
  9164. "alternates": []
  9165. },
  9166. "Ext.grid.filters.filter.List": {
  9167. "idx": 596,
  9168. "alias": [
  9169. "grid.filter.list"
  9170. ],
  9171. "alternates": []
  9172. },
  9173. "Ext.grid.filters.filter.Number": {
  9174. "idx": 597,
  9175. "alias": [
  9176. "grid.filter.number",
  9177. "grid.filter.numeric"
  9178. ],
  9179. "alternates": []
  9180. },
  9181. "Ext.grid.filters.filter.SingleFilter": {
  9182. "idx": 592,
  9183. "alias": [],
  9184. "alternates": []
  9185. },
  9186. "Ext.grid.filters.filter.String": {
  9187. "idx": 598,
  9188. "alias": [
  9189. "grid.filter.string"
  9190. ],
  9191. "alternates": []
  9192. },
  9193. "Ext.grid.filters.filter.TriFilter": {
  9194. "idx": 594,
  9195. "alias": [],
  9196. "alternates": []
  9197. },
  9198. "Ext.grid.header.Container": {
  9199. "idx": 569,
  9200. "alias": [
  9201. "widget.headercontainer"
  9202. ],
  9203. "alternates": []
  9204. },
  9205. "Ext.grid.header.DragZone": {
  9206. "idx": 566,
  9207. "alias": [],
  9208. "alternates": []
  9209. },
  9210. "Ext.grid.header.DropZone": {
  9211. "idx": 567,
  9212. "alias": [],
  9213. "alternates": []
  9214. },
  9215. "Ext.grid.locking.HeaderContainer": {
  9216. "idx": 600,
  9217. "alias": [],
  9218. "alternates": []
  9219. },
  9220. "Ext.grid.locking.Lockable": {
  9221. "idx": 603,
  9222. "alias": [],
  9223. "alternates": [
  9224. "Ext.grid.Lockable"
  9225. ]
  9226. },
  9227. "Ext.grid.locking.RowSynchronizer": {
  9228. "idx": 554,
  9229. "alias": [],
  9230. "alternates": []
  9231. },
  9232. "Ext.grid.locking.View": {
  9233. "idx": 601,
  9234. "alias": [],
  9235. "alternates": [
  9236. "Ext.grid.LockingView"
  9237. ]
  9238. },
  9239. "Ext.grid.plugin.BufferedRenderer": {
  9240. "idx": 604,
  9241. "alias": [
  9242. "plugin.bufferedrenderer"
  9243. ],
  9244. "alternates": []
  9245. },
  9246. "Ext.grid.plugin.CellEditing": {
  9247. "idx": 606,
  9248. "alias": [
  9249. "plugin.cellediting"
  9250. ],
  9251. "alternates": []
  9252. },
  9253. "Ext.grid.plugin.Clipboard": {
  9254. "idx": 607,
  9255. "alias": [
  9256. "plugin.clipboard"
  9257. ],
  9258. "alternates": []
  9259. },
  9260. "Ext.grid.plugin.DragDrop": {
  9261. "idx": 608,
  9262. "alias": [
  9263. "plugin.gridviewdragdrop"
  9264. ],
  9265. "alternates": []
  9266. },
  9267. "Ext.grid.plugin.Editing": {
  9268. "idx": 605,
  9269. "alias": [
  9270. "editing.editing"
  9271. ],
  9272. "alternates": []
  9273. },
  9274. "Ext.grid.plugin.HeaderReorderer": {
  9275. "idx": 568,
  9276. "alias": [
  9277. "plugin.gridheaderreorderer"
  9278. ],
  9279. "alternates": []
  9280. },
  9281. "Ext.grid.plugin.HeaderResizer": {
  9282. "idx": 565,
  9283. "alias": [
  9284. "plugin.gridheaderresizer"
  9285. ],
  9286. "alternates": []
  9287. },
  9288. "Ext.grid.plugin.RowEditing": {
  9289. "idx": 609,
  9290. "alias": [
  9291. "plugin.rowediting"
  9292. ],
  9293. "alternates": []
  9294. },
  9295. "Ext.grid.plugin.RowExpander": {
  9296. "idx": 610,
  9297. "alias": [
  9298. "plugin.rowexpander"
  9299. ],
  9300. "alternates": []
  9301. },
  9302. "Ext.grid.plugin.RowWidget": {
  9303. "idx": 611,
  9304. "alias": [
  9305. "plugin.rowwidget"
  9306. ],
  9307. "alternates": []
  9308. },
  9309. "Ext.grid.property.Grid": {
  9310. "idx": 612,
  9311. "alias": [
  9312. "widget.propertygrid"
  9313. ],
  9314. "alternates": [
  9315. "Ext.grid.PropertyGrid"
  9316. ]
  9317. },
  9318. "Ext.grid.property.HeaderContainer": {
  9319. "idx": 613,
  9320. "alias": [],
  9321. "alternates": [
  9322. "Ext.grid.PropertyColumnModel"
  9323. ]
  9324. },
  9325. "Ext.grid.property.Property": {
  9326. "idx": 614,
  9327. "alias": [],
  9328. "alternates": [
  9329. "Ext.PropGridProperty"
  9330. ]
  9331. },
  9332. "Ext.grid.property.Reader": {
  9333. "idx": 615,
  9334. "alias": [],
  9335. "alternates": []
  9336. },
  9337. "Ext.grid.property.Store": {
  9338. "idx": 616,
  9339. "alias": [],
  9340. "alternates": [
  9341. "Ext.grid.PropertyStore"
  9342. ]
  9343. },
  9344. "Ext.grid.selection.Cells": {
  9345. "idx": 618,
  9346. "alias": [],
  9347. "alternates": []
  9348. },
  9349. "Ext.grid.selection.Columns": {
  9350. "idx": 619,
  9351. "alias": [],
  9352. "alternates": []
  9353. },
  9354. "Ext.grid.selection.Replicator": {
  9355. "idx": 620,
  9356. "alias": [
  9357. "plugin.selectionreplicator"
  9358. ],
  9359. "alternates": []
  9360. },
  9361. "Ext.grid.selection.Rows": {
  9362. "idx": 621,
  9363. "alias": [],
  9364. "alternates": []
  9365. },
  9366. "Ext.grid.selection.Selection": {
  9367. "idx": 617,
  9368. "alias": [],
  9369. "alternates": []
  9370. },
  9371. "Ext.grid.selection.SelectionExtender": {
  9372. "idx": 622,
  9373. "alias": [],
  9374. "alternates": []
  9375. },
  9376. "Ext.grid.selection.SpreadsheetModel": {
  9377. "idx": 623,
  9378. "alias": [
  9379. "selection.spreadsheet"
  9380. ],
  9381. "alternates": []
  9382. },
  9383. "Ext.layout.Context": {
  9384. "idx": 626,
  9385. "alias": [],
  9386. "alternates": []
  9387. },
  9388. "Ext.layout.ContextItem": {
  9389. "idx": 625,
  9390. "alias": [],
  9391. "alternates": []
  9392. },
  9393. "Ext.layout.Layout": {
  9394. "idx": 400,
  9395. "alias": [],
  9396. "alternates": []
  9397. },
  9398. "Ext.layout.SizeModel": {
  9399. "idx": 399,
  9400. "alias": [],
  9401. "alternates": []
  9402. },
  9403. "Ext.layout.component.Auto": {
  9404. "idx": 413,
  9405. "alias": [
  9406. "layout.autocomponent"
  9407. ],
  9408. "alternates": []
  9409. },
  9410. "Ext.layout.component.Body": {
  9411. "idx": 628,
  9412. "alias": [
  9413. "layout.body"
  9414. ],
  9415. "alternates": []
  9416. },
  9417. "Ext.layout.component.BoundList": {
  9418. "idx": 514,
  9419. "alias": [
  9420. "layout.boundlist"
  9421. ],
  9422. "alternates": []
  9423. },
  9424. "Ext.layout.component.Component": {
  9425. "idx": 412,
  9426. "alias": [],
  9427. "alternates": []
  9428. },
  9429. "Ext.layout.component.Dock": {
  9430. "idx": 443,
  9431. "alias": [
  9432. "layout.dock"
  9433. ],
  9434. "alternates": [
  9435. "Ext.layout.component.AbstractDock"
  9436. ]
  9437. },
  9438. "Ext.layout.component.FieldSet": {
  9439. "idx": 629,
  9440. "alias": [
  9441. "layout.fieldset"
  9442. ],
  9443. "alternates": []
  9444. },
  9445. "Ext.layout.component.ProgressBar": {
  9446. "idx": 414,
  9447. "alias": [
  9448. "layout.progressbar"
  9449. ],
  9450. "alternates": []
  9451. },
  9452. "Ext.layout.component.field.FieldContainer": {
  9453. "idx": 492,
  9454. "alias": [
  9455. "layout.fieldcontainer"
  9456. ],
  9457. "alternates": []
  9458. },
  9459. "Ext.layout.component.field.HtmlEditor": {
  9460. "idx": 536,
  9461. "alias": [
  9462. "layout.htmleditor"
  9463. ],
  9464. "alternates": []
  9465. },
  9466. "Ext.layout.component.field.Text": {
  9467. "idx": 484,
  9468. "alias": [
  9469. "layout.textfield"
  9470. ],
  9471. "alternates": []
  9472. },
  9473. "Ext.layout.container.Absolute": {
  9474. "idx": 630,
  9475. "alias": [
  9476. "layout.absolute"
  9477. ],
  9478. "alternates": [
  9479. "Ext.layout.AbsoluteLayout"
  9480. ]
  9481. },
  9482. "Ext.layout.container.Accordion": {
  9483. "idx": 631,
  9484. "alias": [
  9485. "layout.accordion"
  9486. ],
  9487. "alternates": [
  9488. "Ext.layout.AccordionLayout"
  9489. ]
  9490. },
  9491. "Ext.layout.container.Anchor": {
  9492. "idx": 453,
  9493. "alias": [
  9494. "layout.anchor"
  9495. ],
  9496. "alternates": [
  9497. "Ext.layout.AnchorLayout"
  9498. ]
  9499. },
  9500. "Ext.layout.container.Auto": {
  9501. "idx": 402,
  9502. "alias": [
  9503. "layout.auto",
  9504. "layout.autocontainer"
  9505. ],
  9506. "alternates": []
  9507. },
  9508. "Ext.layout.container.Border": {
  9509. "idx": 633,
  9510. "alias": [
  9511. "layout.border"
  9512. ],
  9513. "alternates": [
  9514. "Ext.layout.BorderLayout"
  9515. ]
  9516. },
  9517. "Ext.layout.container.Box": {
  9518. "idx": 432,
  9519. "alias": [
  9520. "layout.box"
  9521. ],
  9522. "alternates": [
  9523. "Ext.layout.BoxLayout"
  9524. ]
  9525. },
  9526. "Ext.layout.container.Card": {
  9527. "idx": 634,
  9528. "alias": [
  9529. "layout.card"
  9530. ],
  9531. "alternates": [
  9532. "Ext.layout.CardLayout"
  9533. ]
  9534. },
  9535. "Ext.layout.container.Center": {
  9536. "idx": 635,
  9537. "alias": [
  9538. "layout.center",
  9539. "layout.ux.center"
  9540. ],
  9541. "alternates": [
  9542. "Ext.ux.layout.Center"
  9543. ]
  9544. },
  9545. "Ext.layout.container.CheckboxGroup": {
  9546. "idx": 494,
  9547. "alias": [
  9548. "layout.checkboxgroup"
  9549. ],
  9550. "alternates": []
  9551. },
  9552. "Ext.layout.container.Column": {
  9553. "idx": 456,
  9554. "alias": [
  9555. "layout.column"
  9556. ],
  9557. "alternates": [
  9558. "Ext.layout.ColumnLayout"
  9559. ]
  9560. },
  9561. "Ext.layout.container.ColumnSplitter": {
  9562. "idx": 460,
  9563. "alias": [
  9564. "widget.columnsplitter"
  9565. ],
  9566. "alternates": []
  9567. },
  9568. "Ext.layout.container.ColumnSplitterTracker": {
  9569. "idx": 459,
  9570. "alias": [],
  9571. "alternates": []
  9572. },
  9573. "Ext.layout.container.Container": {
  9574. "idx": 401,
  9575. "alias": [
  9576. "layout.container"
  9577. ],
  9578. "alternates": [
  9579. "Ext.layout.ContainerLayout"
  9580. ]
  9581. },
  9582. "Ext.layout.container.Dashboard": {
  9583. "idx": 461,
  9584. "alias": [
  9585. "layout.dashboard"
  9586. ],
  9587. "alternates": []
  9588. },
  9589. "Ext.layout.container.Editor": {
  9590. "idx": 405,
  9591. "alias": [
  9592. "layout.editor"
  9593. ],
  9594. "alternates": []
  9595. },
  9596. "Ext.layout.container.Fit": {
  9597. "idx": 548,
  9598. "alias": [
  9599. "layout.fit"
  9600. ],
  9601. "alternates": [
  9602. "Ext.layout.FitLayout",
  9603. "Ext.layout.Fit"
  9604. ]
  9605. },
  9606. "Ext.layout.container.Form": {
  9607. "idx": 636,
  9608. "alias": [
  9609. "layout.form"
  9610. ],
  9611. "alternates": [
  9612. "Ext.layout.FormLayout"
  9613. ]
  9614. },
  9615. "Ext.layout.container.HBox": {
  9616. "idx": 433,
  9617. "alias": [
  9618. "layout.hbox"
  9619. ],
  9620. "alternates": [
  9621. "Ext.layout.HBoxLayout"
  9622. ]
  9623. },
  9624. "Ext.layout.container.SegmentedButton": {
  9625. "idx": 422,
  9626. "alias": [
  9627. "layout.segmentedbutton"
  9628. ],
  9629. "alternates": []
  9630. },
  9631. "Ext.layout.container.Table": {
  9632. "idx": 447,
  9633. "alias": [
  9634. "layout.table"
  9635. ],
  9636. "alternates": [
  9637. "Ext.layout.TableLayout"
  9638. ]
  9639. },
  9640. "Ext.layout.container.VBox": {
  9641. "idx": 434,
  9642. "alias": [
  9643. "layout.vbox"
  9644. ],
  9645. "alternates": [
  9646. "Ext.layout.VBoxLayout"
  9647. ]
  9648. },
  9649. "Ext.layout.container.border.Region": {
  9650. "idx": 115,
  9651. "alias": [],
  9652. "alternates": []
  9653. },
  9654. "Ext.layout.container.boxOverflow.Menu": {
  9655. "idx": 538,
  9656. "alias": [
  9657. "box.overflow.Menu",
  9658. "box.overflow.menu"
  9659. ],
  9660. "alternates": [
  9661. "Ext.layout.boxOverflow.Menu"
  9662. ]
  9663. },
  9664. "Ext.layout.container.boxOverflow.None": {
  9665. "idx": 428,
  9666. "alias": [
  9667. "box.overflow.None",
  9668. "box.overflow.none"
  9669. ],
  9670. "alternates": [
  9671. "Ext.layout.boxOverflow.None"
  9672. ]
  9673. },
  9674. "Ext.layout.container.boxOverflow.Scroller": {
  9675. "idx": 429,
  9676. "alias": [
  9677. "box.overflow.Scroller",
  9678. "box.overflow.scroller"
  9679. ],
  9680. "alternates": [
  9681. "Ext.layout.boxOverflow.Scroller"
  9682. ]
  9683. },
  9684. "Ext.list.AbstractTreeItem": {
  9685. "idx": 343,
  9686. "alias": [],
  9687. "alternates": []
  9688. },
  9689. "Ext.list.RootTreeItem": {
  9690. "idx": 344,
  9691. "alias": [],
  9692. "alternates": []
  9693. },
  9694. "Ext.list.Tree": {
  9695. "idx": 347,
  9696. "alias": [
  9697. "widget.treelist"
  9698. ],
  9699. "alternates": []
  9700. },
  9701. "Ext.list.TreeItem": {
  9702. "idx": 346,
  9703. "alias": [
  9704. "widget.treelistitem"
  9705. ],
  9706. "alternates": []
  9707. },
  9708. "Ext.menu.Bar": {
  9709. "idx": 637,
  9710. "alias": [
  9711. "widget.menubar"
  9712. ],
  9713. "alternates": []
  9714. },
  9715. "Ext.menu.CheckItem": {
  9716. "idx": 588,
  9717. "alias": [
  9718. "widget.menucheckitem"
  9719. ],
  9720. "alternates": []
  9721. },
  9722. "Ext.menu.ColorPicker": {
  9723. "idx": 638,
  9724. "alias": [
  9725. "widget.colormenu"
  9726. ],
  9727. "alternates": []
  9728. },
  9729. "Ext.menu.DatePicker": {
  9730. "idx": 639,
  9731. "alias": [
  9732. "widget.datemenu"
  9733. ],
  9734. "alternates": []
  9735. },
  9736. "Ext.menu.Item": {
  9737. "idx": 587,
  9738. "alias": [
  9739. "widget.menuitem"
  9740. ],
  9741. "alternates": [
  9742. "Ext.menu.TextItem"
  9743. ]
  9744. },
  9745. "Ext.menu.Manager": {
  9746. "idx": 418,
  9747. "alias": [],
  9748. "alternates": [
  9749. "Ext.menu.MenuMgr"
  9750. ]
  9751. },
  9752. "Ext.menu.Menu": {
  9753. "idx": 590,
  9754. "alias": [
  9755. "widget.menu"
  9756. ],
  9757. "alternates": []
  9758. },
  9759. "Ext.menu.Separator": {
  9760. "idx": 589,
  9761. "alias": [
  9762. "widget.menuseparator"
  9763. ],
  9764. "alternates": []
  9765. },
  9766. "Ext.mixin.Accessible": {
  9767. "idx": 87,
  9768. "alias": [],
  9769. "alternates": []
  9770. },
  9771. "Ext.mixin.Bindable": {
  9772. "idx": 81,
  9773. "alias": [],
  9774. "alternates": []
  9775. },
  9776. "Ext.mixin.Bufferable": {
  9777. "idx": 20,
  9778. "alias": [],
  9779. "alternates": []
  9780. },
  9781. "Ext.mixin.ComponentDelegation": {
  9782. "idx": 82,
  9783. "alias": [],
  9784. "alternates": []
  9785. },
  9786. "Ext.mixin.ConfigProxy": {
  9787. "idx": 348,
  9788. "alias": [],
  9789. "alternates": []
  9790. },
  9791. "Ext.mixin.ConfigState": {
  9792. "idx": 349,
  9793. "alias": [],
  9794. "alternates": []
  9795. },
  9796. "Ext.mixin.Container": {
  9797. "idx": 350,
  9798. "alias": [],
  9799. "alternates": []
  9800. },
  9801. "Ext.mixin.Dirty": {
  9802. "idx": 194,
  9803. "alias": [],
  9804. "alternates": []
  9805. },
  9806. "Ext.mixin.Factoryable": {
  9807. "idx": 12,
  9808. "alias": [],
  9809. "alternates": []
  9810. },
  9811. "Ext.mixin.Focusable": {
  9812. "idx": 86,
  9813. "alias": [],
  9814. "alternates": []
  9815. },
  9816. "Ext.mixin.FocusableContainer": {
  9817. "idx": 353,
  9818. "alias": [],
  9819. "alternates": []
  9820. },
  9821. "Ext.mixin.Hookable": {
  9822. "idx": 354,
  9823. "alias": [],
  9824. "alternates": []
  9825. },
  9826. "Ext.mixin.Identifiable": {
  9827. "idx": 3,
  9828. "alias": [],
  9829. "alternates": []
  9830. },
  9831. "Ext.mixin.Inheritable": {
  9832. "idx": 80,
  9833. "alias": [],
  9834. "alternates": []
  9835. },
  9836. "Ext.mixin.ItemRippler": {
  9837. "idx": 345,
  9838. "alias": [],
  9839. "alternates": []
  9840. },
  9841. "Ext.mixin.Keyboard": {
  9842. "idx": 85,
  9843. "alias": [],
  9844. "alternates": []
  9845. },
  9846. "Ext.mixin.Mashup": {
  9847. "idx": 355,
  9848. "alias": [],
  9849. "alternates": []
  9850. },
  9851. "Ext.mixin.Observable": {
  9852. "idx": 4,
  9853. "alias": [],
  9854. "alternates": []
  9855. },
  9856. "Ext.mixin.Pluggable": {
  9857. "idx": 84,
  9858. "alias": [],
  9859. "alternates": []
  9860. },
  9861. "Ext.mixin.Queryable": {
  9862. "idx": 233,
  9863. "alias": [],
  9864. "alternates": []
  9865. },
  9866. "Ext.mixin.Responsive": {
  9867. "idx": 356,
  9868. "alias": [],
  9869. "alternates": []
  9870. },
  9871. "Ext.mixin.Selectable": {
  9872. "idx": 357,
  9873. "alias": [],
  9874. "alternates": []
  9875. },
  9876. "Ext.mixin.StoreWatcher": {
  9877. "idx": 358,
  9878. "alias": [],
  9879. "alternates": []
  9880. },
  9881. "Ext.mixin.StyleCacher": {
  9882. "idx": 359,
  9883. "alias": [],
  9884. "alternates": []
  9885. },
  9886. "Ext.mixin.Templatable": {
  9887. "idx": 39,
  9888. "alias": [],
  9889. "alternates": []
  9890. },
  9891. "Ext.mixin.Traversable": {
  9892. "idx": 360,
  9893. "alias": [],
  9894. "alternates": []
  9895. },
  9896. "Ext.panel.Bar": {
  9897. "idx": 424,
  9898. "alias": [],
  9899. "alternates": []
  9900. },
  9901. "Ext.panel.DD": {
  9902. "idx": 442,
  9903. "alias": [],
  9904. "alternates": []
  9905. },
  9906. "Ext.panel.Header": {
  9907. "idx": 427,
  9908. "alias": [
  9909. "widget.header"
  9910. ],
  9911. "alternates": []
  9912. },
  9913. "Ext.panel.Panel": {
  9914. "idx": 446,
  9915. "alias": [
  9916. "widget.panel"
  9917. ],
  9918. "alternates": [
  9919. "Ext.Panel"
  9920. ]
  9921. },
  9922. "Ext.panel.Pinnable": {
  9923. "idx": 640,
  9924. "alias": [],
  9925. "alternates": []
  9926. },
  9927. "Ext.panel.Proxy": {
  9928. "idx": 441,
  9929. "alias": [],
  9930. "alternates": [
  9931. "Ext.dd.PanelProxy"
  9932. ]
  9933. },
  9934. "Ext.panel.Table": {
  9935. "idx": 549,
  9936. "alias": [
  9937. "widget.tablepanel"
  9938. ],
  9939. "alternates": []
  9940. },
  9941. "Ext.panel.Title": {
  9942. "idx": 425,
  9943. "alias": [
  9944. "widget.title"
  9945. ],
  9946. "alternates": []
  9947. },
  9948. "Ext.panel.Tool": {
  9949. "idx": 426,
  9950. "alias": [
  9951. "widget.tool"
  9952. ],
  9953. "alternates": []
  9954. },
  9955. "Ext.parse.Parser": {
  9956. "idx": 213,
  9957. "alias": [],
  9958. "alternates": []
  9959. },
  9960. "Ext.parse.Symbol": {
  9961. "idx": 207,
  9962. "alias": [],
  9963. "alternates": []
  9964. },
  9965. "Ext.parse.Tokenizer": {
  9966. "idx": 206,
  9967. "alias": [],
  9968. "alternates": []
  9969. },
  9970. "Ext.parse.symbol.Constant": {
  9971. "idx": 208,
  9972. "alias": [],
  9973. "alternates": []
  9974. },
  9975. "Ext.parse.symbol.Infix": {
  9976. "idx": 209,
  9977. "alias": [],
  9978. "alternates": []
  9979. },
  9980. "Ext.parse.symbol.InfixRight": {
  9981. "idx": 210,
  9982. "alias": [],
  9983. "alternates": []
  9984. },
  9985. "Ext.parse.symbol.Paren": {
  9986. "idx": 211,
  9987. "alias": [],
  9988. "alternates": []
  9989. },
  9990. "Ext.parse.symbol.Prefix": {
  9991. "idx": 212,
  9992. "alias": [],
  9993. "alternates": []
  9994. },
  9995. "Ext.perf.Accumulator": {
  9996. "idx": 361,
  9997. "alias": [],
  9998. "alternates": []
  9999. },
  10000. "Ext.perf.Monitor": {
  10001. "idx": 362,
  10002. "alias": [],
  10003. "alternates": [
  10004. "Ext.Perf"
  10005. ]
  10006. },
  10007. "Ext.picker.Color": {
  10008. "idx": 535,
  10009. "alias": [
  10010. "widget.colorpicker"
  10011. ],
  10012. "alternates": [
  10013. "Ext.ColorPalette"
  10014. ]
  10015. },
  10016. "Ext.picker.Date": {
  10017. "idx": 524,
  10018. "alias": [
  10019. "widget.datepicker"
  10020. ],
  10021. "alternates": [
  10022. "Ext.DatePicker"
  10023. ]
  10024. },
  10025. "Ext.picker.Month": {
  10026. "idx": 523,
  10027. "alias": [
  10028. "widget.monthpicker"
  10029. ],
  10030. "alternates": [
  10031. "Ext.MonthPicker"
  10032. ]
  10033. },
  10034. "Ext.picker.Time": {
  10035. "idx": 542,
  10036. "alias": [
  10037. "widget.timepicker"
  10038. ],
  10039. "alternates": []
  10040. },
  10041. "Ext.plugin.Abstract": {
  10042. "idx": 83,
  10043. "alias": [],
  10044. "alternates": [
  10045. "Ext.AbstractPlugin"
  10046. ]
  10047. },
  10048. "Ext.plugin.AbstractClipboard": {
  10049. "idx": 363,
  10050. "alias": [],
  10051. "alternates": []
  10052. },
  10053. "Ext.plugin.LazyItems": {
  10054. "idx": 641,
  10055. "alias": [
  10056. "plugin.lazyitems"
  10057. ],
  10058. "alternates": []
  10059. },
  10060. "Ext.plugin.Manager": {
  10061. "idx": 100,
  10062. "alias": [],
  10063. "alternates": [
  10064. "Ext.PluginManager",
  10065. "Ext.PluginMgr"
  10066. ]
  10067. },
  10068. "Ext.plugin.MouseEnter": {
  10069. "idx": 364,
  10070. "alias": [
  10071. "plugin.mouseenter"
  10072. ],
  10073. "alternates": []
  10074. },
  10075. "Ext.plugin.Responsive": {
  10076. "idx": 450,
  10077. "alias": [
  10078. "plugin.responsive"
  10079. ],
  10080. "alternates": []
  10081. },
  10082. "Ext.plugin.Viewport": {
  10083. "idx": 451,
  10084. "alias": [
  10085. "plugin.viewport"
  10086. ],
  10087. "alternates": []
  10088. },
  10089. "Ext.promise.Consequence": {
  10090. "idx": 7,
  10091. "alias": [],
  10092. "alternates": []
  10093. },
  10094. "Ext.promise.Deferred": {
  10095. "idx": 8,
  10096. "alias": [],
  10097. "alternates": []
  10098. },
  10099. "Ext.promise.Promise": {
  10100. "idx": 9,
  10101. "alias": [],
  10102. "alternates": []
  10103. },
  10104. "Ext.resizer.BorderSplitter": {
  10105. "idx": 632,
  10106. "alias": [
  10107. "widget.bordersplitter"
  10108. ],
  10109. "alternates": []
  10110. },
  10111. "Ext.resizer.BorderSplitterTracker": {
  10112. "idx": 642,
  10113. "alias": [],
  10114. "alternates": []
  10115. },
  10116. "Ext.resizer.Handle": {
  10117. "idx": 643,
  10118. "alias": [],
  10119. "alternates": []
  10120. },
  10121. "Ext.resizer.ResizeTracker": {
  10122. "idx": 644,
  10123. "alias": [],
  10124. "alternates": []
  10125. },
  10126. "Ext.resizer.Resizer": {
  10127. "idx": 645,
  10128. "alias": [],
  10129. "alternates": [
  10130. "Ext.Resizable"
  10131. ]
  10132. },
  10133. "Ext.resizer.Splitter": {
  10134. "idx": 431,
  10135. "alias": [
  10136. "widget.splitter"
  10137. ],
  10138. "alternates": []
  10139. },
  10140. "Ext.resizer.SplitterTracker": {
  10141. "idx": 458,
  10142. "alias": [],
  10143. "alternates": []
  10144. },
  10145. "Ext.route.Action": {
  10146. "idx": 119,
  10147. "alias": [],
  10148. "alternates": []
  10149. },
  10150. "Ext.route.Handler": {
  10151. "idx": 118,
  10152. "alias": [],
  10153. "alternates": []
  10154. },
  10155. "Ext.route.Mixin": {
  10156. "idx": 123,
  10157. "alias": [],
  10158. "alternates": []
  10159. },
  10160. "Ext.route.Route": {
  10161. "idx": 120,
  10162. "alias": [],
  10163. "alternates": []
  10164. },
  10165. "Ext.route.Router": {
  10166. "idx": 122,
  10167. "alias": [],
  10168. "alternates": []
  10169. },
  10170. "Ext.scroll.LockingScroller": {
  10171. "idx": 602,
  10172. "alias": [
  10173. "scroller.locking"
  10174. ],
  10175. "alternates": []
  10176. },
  10177. "Ext.scroll.Scroller": {
  10178. "idx": 107,
  10179. "alias": [
  10180. "scroller.scroller"
  10181. ],
  10182. "alternates": []
  10183. },
  10184. "Ext.scroll.TableScroller": {
  10185. "idx": 556,
  10186. "alias": [
  10187. "scroller.table"
  10188. ],
  10189. "alternates": []
  10190. },
  10191. "Ext.selection.CellModel": {
  10192. "idx": 646,
  10193. "alias": [
  10194. "selection.cellmodel"
  10195. ],
  10196. "alternates": []
  10197. },
  10198. "Ext.selection.CheckboxModel": {
  10199. "idx": 648,
  10200. "alias": [
  10201. "selection.checkboxmodel"
  10202. ],
  10203. "alternates": []
  10204. },
  10205. "Ext.selection.DataViewModel": {
  10206. "idx": 509,
  10207. "alias": [
  10208. "selection.dataviewmodel"
  10209. ],
  10210. "alternates": []
  10211. },
  10212. "Ext.selection.Model": {
  10213. "idx": 508,
  10214. "alias": [
  10215. "selection.abstract"
  10216. ],
  10217. "alternates": [
  10218. "Ext.AbstractSelectionModel"
  10219. ]
  10220. },
  10221. "Ext.selection.RowModel": {
  10222. "idx": 647,
  10223. "alias": [
  10224. "selection.rowmodel"
  10225. ],
  10226. "alternates": []
  10227. },
  10228. "Ext.selection.TreeModel": {
  10229. "idx": 649,
  10230. "alias": [
  10231. "selection.treemodel"
  10232. ],
  10233. "alternates": []
  10234. },
  10235. "Ext.slider.Multi": {
  10236. "idx": 652,
  10237. "alias": [
  10238. "widget.multislider"
  10239. ],
  10240. "alternates": [
  10241. "Ext.slider.MultiSlider"
  10242. ]
  10243. },
  10244. "Ext.slider.Single": {
  10245. "idx": 653,
  10246. "alias": [
  10247. "widget.slider",
  10248. "widget.sliderfield"
  10249. ],
  10250. "alternates": [
  10251. "Ext.Slider",
  10252. "Ext.form.SliderField",
  10253. "Ext.slider.SingleSlider",
  10254. "Ext.slider.Slider"
  10255. ]
  10256. },
  10257. "Ext.slider.Thumb": {
  10258. "idx": 650,
  10259. "alias": [],
  10260. "alternates": []
  10261. },
  10262. "Ext.slider.Tip": {
  10263. "idx": 651,
  10264. "alias": [
  10265. "widget.slidertip"
  10266. ],
  10267. "alternates": []
  10268. },
  10269. "Ext.slider.Widget": {
  10270. "idx": 654,
  10271. "alias": [
  10272. "widget.sliderwidget"
  10273. ],
  10274. "alternates": []
  10275. },
  10276. "Ext.sparkline.Bar": {
  10277. "idx": 373,
  10278. "alias": [
  10279. "widget.sparklinebar"
  10280. ],
  10281. "alternates": []
  10282. },
  10283. "Ext.sparkline.BarBase": {
  10284. "idx": 371,
  10285. "alias": [],
  10286. "alternates": []
  10287. },
  10288. "Ext.sparkline.Base": {
  10289. "idx": 370,
  10290. "alias": [
  10291. "widget.sparkline"
  10292. ],
  10293. "alternates": []
  10294. },
  10295. "Ext.sparkline.Box": {
  10296. "idx": 374,
  10297. "alias": [
  10298. "widget.sparklinebox"
  10299. ],
  10300. "alternates": []
  10301. },
  10302. "Ext.sparkline.Bullet": {
  10303. "idx": 375,
  10304. "alias": [
  10305. "widget.sparklinebullet"
  10306. ],
  10307. "alternates": []
  10308. },
  10309. "Ext.sparkline.CanvasBase": {
  10310. "idx": 366,
  10311. "alias": [],
  10312. "alternates": []
  10313. },
  10314. "Ext.sparkline.CanvasCanvas": {
  10315. "idx": 367,
  10316. "alias": [],
  10317. "alternates": []
  10318. },
  10319. "Ext.sparkline.Discrete": {
  10320. "idx": 376,
  10321. "alias": [
  10322. "widget.sparklinediscrete"
  10323. ],
  10324. "alternates": []
  10325. },
  10326. "Ext.sparkline.Line": {
  10327. "idx": 377,
  10328. "alias": [
  10329. "widget.sparklineline"
  10330. ],
  10331. "alternates": []
  10332. },
  10333. "Ext.sparkline.Pie": {
  10334. "idx": 378,
  10335. "alias": [
  10336. "widget.sparklinepie"
  10337. ],
  10338. "alternates": []
  10339. },
  10340. "Ext.sparkline.RangeMap": {
  10341. "idx": 372,
  10342. "alias": [],
  10343. "alternates": []
  10344. },
  10345. "Ext.sparkline.Shape": {
  10346. "idx": 365,
  10347. "alias": [],
  10348. "alternates": []
  10349. },
  10350. "Ext.sparkline.TriState": {
  10351. "idx": 379,
  10352. "alias": [
  10353. "widget.sparklinetristate"
  10354. ],
  10355. "alternates": []
  10356. },
  10357. "Ext.sparkline.VmlCanvas": {
  10358. "idx": 368,
  10359. "alias": [],
  10360. "alternates": []
  10361. },
  10362. "Ext.state.CookieProvider": {
  10363. "idx": 655,
  10364. "alias": [],
  10365. "alternates": []
  10366. },
  10367. "Ext.state.LocalStorageProvider": {
  10368. "idx": 656,
  10369. "alias": [
  10370. "state.localstorage"
  10371. ],
  10372. "alternates": []
  10373. },
  10374. "Ext.state.Manager": {
  10375. "idx": 112,
  10376. "alias": [],
  10377. "alternates": []
  10378. },
  10379. "Ext.state.Provider": {
  10380. "idx": 111,
  10381. "alias": [],
  10382. "alternates": []
  10383. },
  10384. "Ext.state.Stateful": {
  10385. "idx": 113,
  10386. "alias": [],
  10387. "alternates": []
  10388. },
  10389. "Ext.tab.Bar": {
  10390. "idx": 658,
  10391. "alias": [
  10392. "widget.tabbar"
  10393. ],
  10394. "alternates": []
  10395. },
  10396. "Ext.tab.Panel": {
  10397. "idx": 659,
  10398. "alias": [
  10399. "widget.tabpanel"
  10400. ],
  10401. "alternates": [
  10402. "Ext.TabPanel"
  10403. ]
  10404. },
  10405. "Ext.tab.Tab": {
  10406. "idx": 657,
  10407. "alias": [
  10408. "widget.tab"
  10409. ],
  10410. "alternates": []
  10411. },
  10412. "Ext.tip.QuickTip": {
  10413. "idx": 533,
  10414. "alias": [
  10415. "widget.quicktip"
  10416. ],
  10417. "alternates": [
  10418. "Ext.QuickTip"
  10419. ]
  10420. },
  10421. "Ext.tip.QuickTipManager": {
  10422. "idx": 534,
  10423. "alias": [],
  10424. "alternates": [
  10425. "Ext.QuickTips"
  10426. ]
  10427. },
  10428. "Ext.tip.Tip": {
  10429. "idx": 531,
  10430. "alias": [
  10431. "widget.tip"
  10432. ],
  10433. "alternates": [
  10434. "Ext.Tip"
  10435. ]
  10436. },
  10437. "Ext.tip.ToolTip": {
  10438. "idx": 532,
  10439. "alias": [
  10440. "widget.tooltip"
  10441. ],
  10442. "alternates": [
  10443. "Ext.ToolTip"
  10444. ]
  10445. },
  10446. "Ext.toolbar.Breadcrumb": {
  10447. "idx": 660,
  10448. "alias": [
  10449. "widget.breadcrumb"
  10450. ],
  10451. "alternates": []
  10452. },
  10453. "Ext.toolbar.Fill": {
  10454. "idx": 661,
  10455. "alias": [
  10456. "widget.tbfill"
  10457. ],
  10458. "alternates": [
  10459. "Ext.Toolbar.Fill"
  10460. ]
  10461. },
  10462. "Ext.toolbar.Item": {
  10463. "idx": 515,
  10464. "alias": [
  10465. "widget.tbitem"
  10466. ],
  10467. "alternates": [
  10468. "Ext.Toolbar.Item"
  10469. ]
  10470. },
  10471. "Ext.toolbar.Paging": {
  10472. "idx": 520,
  10473. "alias": [
  10474. "widget.pagingtoolbar"
  10475. ],
  10476. "alternates": [
  10477. "Ext.PagingToolbar"
  10478. ]
  10479. },
  10480. "Ext.toolbar.Separator": {
  10481. "idx": 537,
  10482. "alias": [
  10483. "widget.tbseparator"
  10484. ],
  10485. "alternates": [
  10486. "Ext.Toolbar.Separator"
  10487. ]
  10488. },
  10489. "Ext.toolbar.Spacer": {
  10490. "idx": 662,
  10491. "alias": [
  10492. "widget.tbspacer"
  10493. ],
  10494. "alternates": [
  10495. "Ext.Toolbar.Spacer"
  10496. ]
  10497. },
  10498. "Ext.toolbar.TextItem": {
  10499. "idx": 516,
  10500. "alias": [
  10501. "widget.tbtext"
  10502. ],
  10503. "alternates": [
  10504. "Ext.Toolbar.TextItem"
  10505. ]
  10506. },
  10507. "Ext.toolbar.Toolbar": {
  10508. "idx": 435,
  10509. "alias": [
  10510. "widget.toolbar"
  10511. ],
  10512. "alternates": [
  10513. "Ext.Toolbar"
  10514. ]
  10515. },
  10516. "Ext.tree.Column": {
  10517. "idx": 663,
  10518. "alias": [
  10519. "widget.treecolumn"
  10520. ],
  10521. "alternates": []
  10522. },
  10523. "Ext.tree.NavigationModel": {
  10524. "idx": 664,
  10525. "alias": [
  10526. "view.navigation.tree"
  10527. ],
  10528. "alternates": []
  10529. },
  10530. "Ext.tree.Panel": {
  10531. "idx": 666,
  10532. "alias": [
  10533. "widget.treepanel"
  10534. ],
  10535. "alternates": [
  10536. "Ext.tree.TreePanel",
  10537. "Ext.TreePanel"
  10538. ]
  10539. },
  10540. "Ext.tree.View": {
  10541. "idx": 665,
  10542. "alias": [
  10543. "widget.treeview"
  10544. ],
  10545. "alternates": []
  10546. },
  10547. "Ext.tree.ViewDragZone": {
  10548. "idx": 668,
  10549. "alias": [],
  10550. "alternates": []
  10551. },
  10552. "Ext.tree.ViewDropZone": {
  10553. "idx": 669,
  10554. "alias": [],
  10555. "alternates": []
  10556. },
  10557. "Ext.tree.plugin.TreeViewDragDrop": {
  10558. "idx": 670,
  10559. "alias": [
  10560. "plugin.treeviewdragdrop"
  10561. ],
  10562. "alternates": []
  10563. },
  10564. "Ext.util.AbstractMixedCollection": {
  10565. "idx": 52,
  10566. "alias": [],
  10567. "alternates": []
  10568. },
  10569. "Ext.util.Animate": {
  10570. "idx": 73,
  10571. "alias": [],
  10572. "alternates": []
  10573. },
  10574. "Ext.util.Bag": {
  10575. "idx": 185,
  10576. "alias": [],
  10577. "alternates": []
  10578. },
  10579. "Ext.util.Base64": {
  10580. "idx": 380,
  10581. "alias": [],
  10582. "alternates": []
  10583. },
  10584. "Ext.util.CSS": {
  10585. "idx": 101,
  10586. "alias": [],
  10587. "alternates": []
  10588. },
  10589. "Ext.util.CSV": {
  10590. "idx": 382,
  10591. "alias": [],
  10592. "alternates": []
  10593. },
  10594. "Ext.util.ClickRepeater": {
  10595. "idx": 383,
  10596. "alias": [],
  10597. "alternates": [
  10598. "Ext.util.TapRepeater"
  10599. ]
  10600. },
  10601. "Ext.util.Collection": {
  10602. "idx": 128,
  10603. "alias": [],
  10604. "alternates": []
  10605. },
  10606. "Ext.util.CollectionKey": {
  10607. "idx": 126,
  10608. "alias": [],
  10609. "alternates": []
  10610. },
  10611. "Ext.util.Color": {
  10612. "idx": 369,
  10613. "alias": [],
  10614. "alternates": [
  10615. "Ext.draw.Color"
  10616. ]
  10617. },
  10618. "Ext.util.ComponentDragger": {
  10619. "idx": 479,
  10620. "alias": [],
  10621. "alternates": []
  10622. },
  10623. "Ext.util.Cookies": {
  10624. "idx": 384,
  10625. "alias": [],
  10626. "alternates": []
  10627. },
  10628. "Ext.util.DelimitedValue": {
  10629. "idx": 381,
  10630. "alias": [],
  10631. "alternates": []
  10632. },
  10633. "Ext.util.ElementContainer": {
  10634. "idx": 109,
  10635. "alias": [],
  10636. "alternates": []
  10637. },
  10638. "Ext.util.Event": {
  10639. "idx": 2,
  10640. "alias": [],
  10641. "alternates": []
  10642. },
  10643. "Ext.util.Filter": {
  10644. "idx": 50,
  10645. "alias": [],
  10646. "alternates": []
  10647. },
  10648. "Ext.util.FilterCollection": {
  10649. "idx": 173,
  10650. "alias": [],
  10651. "alternates": []
  10652. },
  10653. "Ext.util.Floating": {
  10654. "idx": 108,
  10655. "alias": [],
  10656. "alternates": []
  10657. },
  10658. "Ext.util.Fly": {
  10659. "idx": 205,
  10660. "alias": [],
  10661. "alternates": []
  10662. },
  10663. "Ext.util.Format": {
  10664. "idx": 91,
  10665. "alias": [],
  10666. "alternates": []
  10667. },
  10668. "Ext.util.Group": {
  10669. "idx": 165,
  10670. "alias": [],
  10671. "alternates": []
  10672. },
  10673. "Ext.util.GroupCollection": {
  10674. "idx": 174,
  10675. "alias": [],
  10676. "alternates": []
  10677. },
  10678. "Ext.util.Grouper": {
  10679. "idx": 127,
  10680. "alias": [],
  10681. "alternates": []
  10682. },
  10683. "Ext.util.HashMap": {
  10684. "idx": 5,
  10685. "alias": [],
  10686. "alternates": []
  10687. },
  10688. "Ext.util.History": {
  10689. "idx": 121,
  10690. "alias": [],
  10691. "alternates": [
  10692. "Ext.History"
  10693. ]
  10694. },
  10695. "Ext.util.Inflector": {
  10696. "idx": 136,
  10697. "alias": [],
  10698. "alternates": []
  10699. },
  10700. "Ext.util.ItemCollection": {
  10701. "idx": 385,
  10702. "alias": [],
  10703. "alternates": [
  10704. "Ext.ItemCollection"
  10705. ]
  10706. },
  10707. "Ext.util.KeyMap": {
  10708. "idx": 351,
  10709. "alias": [],
  10710. "alternates": [
  10711. "Ext.KeyMap"
  10712. ]
  10713. },
  10714. "Ext.util.KeyNav": {
  10715. "idx": 352,
  10716. "alias": [],
  10717. "alternates": [
  10718. "Ext.KeyNav"
  10719. ]
  10720. },
  10721. "Ext.util.LocalStorage": {
  10722. "idx": 386,
  10723. "alias": [],
  10724. "alternates": []
  10725. },
  10726. "Ext.util.LruCache": {
  10727. "idx": 23,
  10728. "alias": [],
  10729. "alternates": []
  10730. },
  10731. "Ext.util.Memento": {
  10732. "idx": 444,
  10733. "alias": [],
  10734. "alternates": []
  10735. },
  10736. "Ext.util.MixedCollection": {
  10737. "idx": 55,
  10738. "alias": [],
  10739. "alternates": []
  10740. },
  10741. "Ext.util.ObjectTemplate": {
  10742. "idx": 130,
  10743. "alias": [],
  10744. "alternates": []
  10745. },
  10746. "Ext.util.Observable": {
  10747. "idx": 51,
  10748. "alias": [],
  10749. "alternates": []
  10750. },
  10751. "Ext.util.Offset": {
  10752. "idx": 33,
  10753. "alias": [],
  10754. "alternates": []
  10755. },
  10756. "Ext.util.PaintMonitor": {
  10757. "idx": 47,
  10758. "alias": [],
  10759. "alternates": []
  10760. },
  10761. "Ext.util.Point": {
  10762. "idx": 35,
  10763. "alias": [],
  10764. "alternates": []
  10765. },
  10766. "Ext.util.Positionable": {
  10767. "idx": 26,
  10768. "alias": [],
  10769. "alternates": []
  10770. },
  10771. "Ext.util.ProtoElement": {
  10772. "idx": 98,
  10773. "alias": [],
  10774. "alternates": []
  10775. },
  10776. "Ext.util.Queue": {
  10777. "idx": 624,
  10778. "alias": [],
  10779. "alternates": []
  10780. },
  10781. "Ext.util.Region": {
  10782. "idx": 34,
  10783. "alias": [],
  10784. "alternates": []
  10785. },
  10786. "Ext.util.Renderable": {
  10787. "idx": 110,
  10788. "alias": [],
  10789. "alternates": []
  10790. },
  10791. "Ext.util.Schedulable": {
  10792. "idx": 196,
  10793. "alias": [],
  10794. "alternates": []
  10795. },
  10796. "Ext.util.Scheduler": {
  10797. "idx": 186,
  10798. "alias": [],
  10799. "alternates": []
  10800. },
  10801. "Ext.util.SizeMonitor": {
  10802. "idx": 43,
  10803. "alias": [],
  10804. "alternates": []
  10805. },
  10806. "Ext.util.Sortable": {
  10807. "idx": 54,
  10808. "alias": [],
  10809. "alternates": []
  10810. },
  10811. "Ext.util.Sorter": {
  10812. "idx": 53,
  10813. "alias": [],
  10814. "alternates": []
  10815. },
  10816. "Ext.util.SorterCollection": {
  10817. "idx": 172,
  10818. "alias": [],
  10819. "alternates": []
  10820. },
  10821. "Ext.util.Spans": {
  10822. "idx": 387,
  10823. "alias": [],
  10824. "alternates": []
  10825. },
  10826. "Ext.util.StoreHolder": {
  10827. "idx": 410,
  10828. "alias": [],
  10829. "alternates": []
  10830. },
  10831. "Ext.util.TaskManager": {
  10832. "idx": 389,
  10833. "alias": [],
  10834. "alternates": [
  10835. "Ext.TaskManager"
  10836. ]
  10837. },
  10838. "Ext.util.TaskRunner": {
  10839. "idx": 56,
  10840. "alias": [],
  10841. "alternates": []
  10842. },
  10843. "Ext.util.TextMetrics": {
  10844. "idx": 390,
  10845. "alias": [],
  10846. "alternates": []
  10847. },
  10848. "Ext.util.TsvDecoder": {
  10849. "idx": 388,
  10850. "alias": [],
  10851. "alternates": [
  10852. "Ext.util.TSV"
  10853. ]
  10854. },
  10855. "Ext.util.XTemplateCompiler": {
  10856. "idx": 94,
  10857. "alias": [],
  10858. "alternates": []
  10859. },
  10860. "Ext.util.XTemplateParser": {
  10861. "idx": 93,
  10862. "alias": [],
  10863. "alternates": []
  10864. },
  10865. "Ext.util.paintmonitor.Abstract": {
  10866. "idx": 45,
  10867. "alias": [],
  10868. "alternates": []
  10869. },
  10870. "Ext.util.paintmonitor.CssAnimation": {
  10871. "idx": 46,
  10872. "alias": [],
  10873. "alternates": []
  10874. },
  10875. "Ext.util.paintmonitor.OverflowChange": {
  10876. "idx": 391,
  10877. "alias": [],
  10878. "alternates": []
  10879. },
  10880. "Ext.util.sizemonitor.Abstract": {
  10881. "idx": 41,
  10882. "alias": [],
  10883. "alternates": []
  10884. },
  10885. "Ext.util.sizemonitor.OverflowChange": {
  10886. "idx": 392,
  10887. "alias": [],
  10888. "alternates": []
  10889. },
  10890. "Ext.util.sizemonitor.Scroll": {
  10891. "idx": 42,
  10892. "alias": [],
  10893. "alternates": []
  10894. },
  10895. "Ext.util.translatable.Abstract": {
  10896. "idx": 104,
  10897. "alias": [],
  10898. "alternates": []
  10899. },
  10900. "Ext.util.translatable.CssPosition": {
  10901. "idx": 393,
  10902. "alias": [
  10903. "translatable.cssposition"
  10904. ],
  10905. "alternates": []
  10906. },
  10907. "Ext.util.translatable.CssTransform": {
  10908. "idx": 394,
  10909. "alias": [
  10910. "translatable.csstransform"
  10911. ],
  10912. "alternates": []
  10913. },
  10914. "Ext.util.translatable.Dom": {
  10915. "idx": 105,
  10916. "alias": [
  10917. "translatable.dom"
  10918. ],
  10919. "alternates": []
  10920. },
  10921. "Ext.util.translatable.ScrollParent": {
  10922. "idx": 395,
  10923. "alias": [
  10924. "translatable.scrollparent"
  10925. ],
  10926. "alternates": []
  10927. },
  10928. "Ext.util.translatable.ScrollPosition": {
  10929. "idx": 106,
  10930. "alias": [
  10931. "translatable.scrollposition"
  10932. ],
  10933. "alternates": []
  10934. },
  10935. "Ext.view.AbstractView": {
  10936. "idx": 511,
  10937. "alias": [],
  10938. "alternates": []
  10939. },
  10940. "Ext.view.BoundList": {
  10941. "idx": 521,
  10942. "alias": [
  10943. "widget.boundlist"
  10944. ],
  10945. "alternates": [
  10946. "Ext.BoundList"
  10947. ]
  10948. },
  10949. "Ext.view.BoundListKeyNav": {
  10950. "idx": 513,
  10951. "alias": [
  10952. "view.navigation.boundlist"
  10953. ],
  10954. "alternates": []
  10955. },
  10956. "Ext.view.DragZone": {
  10957. "idx": 667,
  10958. "alias": [],
  10959. "alternates": []
  10960. },
  10961. "Ext.view.DropZone": {
  10962. "idx": 563,
  10963. "alias": [],
  10964. "alternates": []
  10965. },
  10966. "Ext.view.MultiSelector": {
  10967. "idx": 672,
  10968. "alias": [
  10969. "widget.multiselector"
  10970. ],
  10971. "alternates": []
  10972. },
  10973. "Ext.view.MultiSelectorSearch": {
  10974. "idx": 671,
  10975. "alias": [
  10976. "widget.multiselector-search"
  10977. ],
  10978. "alternates": []
  10979. },
  10980. "Ext.view.NavigationModel": {
  10981. "idx": 510,
  10982. "alias": [
  10983. "view.navigation.default"
  10984. ],
  10985. "alternates": []
  10986. },
  10987. "Ext.view.NodeCache": {
  10988. "idx": 555,
  10989. "alias": [],
  10990. "alternates": []
  10991. },
  10992. "Ext.view.Table": {
  10993. "idx": 557,
  10994. "alias": [
  10995. "widget.gridview",
  10996. "widget.tableview"
  10997. ],
  10998. "alternates": [
  10999. "Ext.grid.View"
  11000. ]
  11001. },
  11002. "Ext.view.TableLayout": {
  11003. "idx": 553,
  11004. "alias": [
  11005. "layout.tableview"
  11006. ],
  11007. "alternates": []
  11008. },
  11009. "Ext.view.TagKeyNav": {
  11010. "idx": 540,
  11011. "alias": [
  11012. "view.navigation.tagfield"
  11013. ],
  11014. "alternates": []
  11015. },
  11016. "Ext.view.View": {
  11017. "idx": 512,
  11018. "alias": [
  11019. "widget.dataview"
  11020. ],
  11021. "alternates": [
  11022. "Ext.DataView"
  11023. ]
  11024. },
  11025. "Ext.window.MessageBox": {
  11026. "idx": 489,
  11027. "alias": [
  11028. "widget.messagebox"
  11029. ],
  11030. "alternates": []
  11031. },
  11032. "Ext.window.Toast": {
  11033. "idx": 673,
  11034. "alias": [
  11035. "widget.toast"
  11036. ],
  11037. "alternates": []
  11038. },
  11039. "Ext.window.Window": {
  11040. "idx": 480,
  11041. "alias": [
  11042. "widget.window"
  11043. ],
  11044. "alternates": [
  11045. "Ext.Window"
  11046. ]
  11047. }
  11048. },
  11049. "packages": {
  11050. "classic": {
  11051. "css": true,
  11052. "included": true,
  11053. "language": {
  11054. "js": {
  11055. "input": {
  11056. "version": "ES5"
  11057. }
  11058. }
  11059. },
  11060. "namespace": "Ext",
  11061. "properties": {
  11062. "skip.sass": 1,
  11063. "skip.pkg": 1,
  11064. "skip.slice": 1
  11065. },
  11066. "required": true,
  11067. "requires": [
  11068. "ext",
  11069. "core",
  11070. "classic"
  11071. ],
  11072. "version": "6.6.0"
  11073. },
  11074. "cmd": {
  11075. "version": "6.6.0.13"
  11076. },
  11077. "core": {
  11078. "css": true,
  11079. "included": true,
  11080. "properties": {
  11081. "skip.slice": 1,
  11082. "skip.style": 1,
  11083. "skip.pkg": 1,
  11084. "package.tags.classdefs": "class"
  11085. },
  11086. "required": true,
  11087. "requires": [
  11088. "ext"
  11089. ],
  11090. "version": "6.6.0"
  11091. },
  11092. "ext": {
  11093. "css": true,
  11094. "included": true,
  11095. "language": {
  11096. "js": {
  11097. "input": {
  11098. "version": "ES5"
  11099. }
  11100. }
  11101. },
  11102. "license": "dev",
  11103. "namespace": "Ext",
  11104. "properties": {
  11105. "skip.sass": 1,
  11106. "skip.slice": 1
  11107. },
  11108. "required": true,
  11109. "requires": [],
  11110. "version": "6.6.0.258"
  11111. }
  11112. },
  11113. "bootRelative": true
  11114. });
  11115. // @tag core
  11116. // @define Ext.Boot
  11117. var Ext = Ext || {};
  11118. //<editor-fold desc="Boot">
  11119. /**
  11120. * @class Ext.Boot
  11121. * @singleton
  11122. * @private
  11123. */
  11124. Ext.Boot = Ext.Boot || (function(emptyFn) {
  11125. var doc = document,
  11126. _emptyArray = [],
  11127. _config = {
  11128. /**
  11129. * @cfg {Boolean} [disableCaching=true]
  11130. * If `true` current timestamp is added to script URL's to prevent caching.
  11131. * In debug builds, adding a "cache" or "disableCacheBuster" query parameter
  11132. * to the page's URL will set this to `false`.
  11133. */
  11134. disableCaching: (/[?&](?:cache|disableCacheBuster)\b/i.test(location.search) || !(/http[s]?\:/i.test(location.href)) || /(^|[ ;])ext-cache=1/.test(doc.cookie)) ? false : true,
  11135. /**
  11136. * @cfg {String} [disableCachingParam="_dc"]
  11137. * The query parameter name for the cache buster's timestamp.
  11138. */
  11139. disableCachingParam: '_dc',
  11140. /**
  11141. * @cfg {Boolean} loadDelay
  11142. * Millisecond delay between asynchronous script injection (prevents stack
  11143. * overflow on some user agents) 'false' disables delay but potentially
  11144. * increases stack load.
  11145. */
  11146. loadDelay: false,
  11147. /**
  11148. * @cfg {Boolean} preserveScripts
  11149. * `false` to remove asynchronously loaded scripts, `true` to retain script
  11150. * element for browser debugger compatibility and improved load performance.
  11151. */
  11152. preserveScripts: true,
  11153. /**
  11154. * @cfg {String} [charset=UTF-8]
  11155. * Optional charset to specify encoding of dynamic content.
  11156. */
  11157. charset: 'UTF-8'
  11158. },
  11159. _assetConfig = {},
  11160. cssRe = /\.css(?:\?|$)/i,
  11161. resolverEl = doc.createElement('a'),
  11162. isBrowser = typeof window !== 'undefined',
  11163. _environment = {
  11164. browser: isBrowser,
  11165. node: !isBrowser && (typeof require === 'function'),
  11166. phantom: (window && (window._phantom || window.callPhantom)) || /PhantomJS/.test(window.navigator.userAgent)
  11167. },
  11168. _tags = (Ext.platformTags = {}),
  11169. // All calls to _debug are commented out to speed up old browsers a bit;
  11170. // yes that makes a difference because the cost of concatenating strings
  11171. // and passing them into _debug() adds up pretty quickly.
  11172. _debug = function(message) {},
  11173. //console.log(message);
  11174. _apply = function(object, config, defaults) {
  11175. if (defaults) {
  11176. _apply(object, defaults);
  11177. }
  11178. if (object && config && typeof config === 'object') {
  11179. for (var i in config) {
  11180. object[i] = config[i];
  11181. }
  11182. }
  11183. return object;
  11184. },
  11185. _merge = function() {
  11186. var lowerCase = false,
  11187. obj = Array.prototype.shift.call(arguments),
  11188. index, i, len, value;
  11189. if (typeof arguments[arguments.length - 1] === 'boolean') {
  11190. lowerCase = Array.prototype.pop.call(arguments);
  11191. }
  11192. len = arguments.length;
  11193. for (index = 0; index < len; index++) {
  11194. value = arguments[index];
  11195. if (typeof value === 'object') {
  11196. for (i in value) {
  11197. obj[lowerCase ? i.toLowerCase() : i] = value[i];
  11198. }
  11199. }
  11200. }
  11201. return obj;
  11202. },
  11203. _getKeys = (typeof Object.keys == 'function') ? function(object) {
  11204. if (!object) {
  11205. return [];
  11206. }
  11207. return Object.keys(object);
  11208. } : function(object) {
  11209. var keys = [],
  11210. property;
  11211. for (property in object) {
  11212. if (object.hasOwnProperty(property)) {
  11213. keys.push(property);
  11214. }
  11215. }
  11216. return keys;
  11217. },
  11218. /*
  11219. * The Boot loader class manages Request objects that contain one or
  11220. * more individual urls that need to be loaded. Requests can be performed
  11221. * synchronously or asynchronously, but will always evaluate urls in the
  11222. * order specified on the request object.
  11223. */
  11224. Boot = {
  11225. loading: 0,
  11226. loaded: 0,
  11227. apply: _apply,
  11228. env: _environment,
  11229. config: _config,
  11230. /**
  11231. * @cfg {Object} assetConfig
  11232. * A map (url->assetConfig) that contains information about assets loaded by the Microlaoder.
  11233. */
  11234. assetConfig: _assetConfig,
  11235. // Keyed by absolute URL this object holds "true" if that URL is already loaded
  11236. // or an array of callbacks to call once it loads.
  11237. scripts: {},
  11238. /*
  11239. Entry objects
  11240. 'http://foo.com/bar/baz/Thing.js': {
  11241. done: true,
  11242. el: scriptEl || linkEl,
  11243. preserve: true,
  11244. requests: [ request1, ... ]
  11245. }
  11246. */
  11247. /**
  11248. * contains the current script name being loaded
  11249. * (loadSync or sequential load only)
  11250. */
  11251. currentFile: null,
  11252. suspendedQueue: [],
  11253. currentRequest: null,
  11254. // when loadSync is called, need to cause subsequent load requests to also be loadSync,
  11255. // eg, when Ext.require(...) is called
  11256. syncMode: false,
  11257. /*
  11258. * simple helper method for debugging
  11259. */
  11260. debug: _debug,
  11261. /**
  11262. * enables / disables loading scripts via script / link elements rather
  11263. * than using ajax / eval
  11264. */
  11265. useElements: true,
  11266. listeners: [],
  11267. Request: Request,
  11268. Entry: Entry,
  11269. allowMultipleBrowsers: false,
  11270. browserNames: {
  11271. ie: 'IE',
  11272. firefox: 'Firefox',
  11273. safari: 'Safari',
  11274. chrome: 'Chrome',
  11275. opera: 'Opera',
  11276. dolfin: 'Dolfin',
  11277. edge: 'Edge',
  11278. webosbrowser: 'webOSBrowser',
  11279. chromeMobile: 'ChromeMobile',
  11280. chromeiOS: 'ChromeiOS',
  11281. silk: 'Silk',
  11282. other: 'Other'
  11283. },
  11284. osNames: {
  11285. ios: 'iOS',
  11286. android: 'Android',
  11287. windowsPhone: 'WindowsPhone',
  11288. webos: 'webOS',
  11289. blackberry: 'BlackBerry',
  11290. rimTablet: 'RIMTablet',
  11291. mac: 'MacOS',
  11292. win: 'Windows',
  11293. tizen: 'Tizen',
  11294. linux: 'Linux',
  11295. bada: 'Bada',
  11296. chromeOS: 'ChromeOS',
  11297. other: 'Other'
  11298. },
  11299. browserPrefixes: {
  11300. ie: 'MSIE ',
  11301. edge: 'Edge/',
  11302. firefox: 'Firefox/',
  11303. chrome: 'Chrome/',
  11304. safari: 'Version/',
  11305. opera: 'OPR/',
  11306. dolfin: 'Dolfin/',
  11307. webosbrowser: 'wOSBrowser/',
  11308. chromeMobile: 'CrMo/',
  11309. chromeiOS: 'CriOS/',
  11310. silk: 'Silk/'
  11311. },
  11312. // When a UA reports multiple browsers this list is used to prioritize the 'real' browser
  11313. // lower index number will win
  11314. browserPriority: [
  11315. 'edge',
  11316. 'opera',
  11317. 'dolfin',
  11318. 'webosbrowser',
  11319. 'silk',
  11320. 'chromeiOS',
  11321. 'chromeMobile',
  11322. 'ie',
  11323. 'firefox',
  11324. 'safari',
  11325. 'chrome'
  11326. ],
  11327. osPrefixes: {
  11328. tizen: '(Tizen )',
  11329. ios: 'i(?:Pad|Phone|Pod)(?:.*)CPU(?: iPhone)? OS ',
  11330. android: '(Android |HTC_|Silk/)',
  11331. // Some HTC devices ship with an OSX userAgent by default,
  11332. // so we need to add a direct check for HTC_
  11333. windowsPhone: 'Windows Phone ',
  11334. blackberry: '(?:BlackBerry|BB)(?:.*)Version/',
  11335. rimTablet: 'RIM Tablet OS ',
  11336. webos: '(?:webOS|hpwOS)/',
  11337. bada: 'Bada/',
  11338. chromeOS: 'CrOS '
  11339. },
  11340. fallbackOSPrefixes: {
  11341. windows: 'win',
  11342. mac: 'mac',
  11343. linux: 'linux'
  11344. },
  11345. devicePrefixes: {
  11346. iPhone: 'iPhone',
  11347. iPod: 'iPod',
  11348. iPad: 'iPad'
  11349. },
  11350. maxIEVersion: 12,
  11351. /**
  11352. * The default function that detects various platforms and sets tags
  11353. * in the platform map accordingly. Examples are iOS, android, tablet, etc.
  11354. * @param tags the set of tags to populate
  11355. */
  11356. detectPlatformTags: function() {
  11357. var me = this,
  11358. ua = navigator.userAgent,
  11359. isMobile = /Mobile(\/|\s)/.test(ua),
  11360. element = document.createElement('div'),
  11361. isEventSupported = function(name, tag) {
  11362. if (tag === undefined) {
  11363. tag = window;
  11364. }
  11365. var eventName = 'on' + name.toLowerCase(),
  11366. isSupported = (eventName in element);
  11367. if (!isSupported) {
  11368. if (element.setAttribute && element.removeAttribute) {
  11369. element.setAttribute(eventName, '');
  11370. isSupported = typeof element[eventName] === 'function';
  11371. if (typeof element[eventName] !== 'undefined') {
  11372. element[eventName] = undefined;
  11373. }
  11374. element.removeAttribute(eventName);
  11375. }
  11376. }
  11377. return isSupported;
  11378. },
  11379. // Browser Detection
  11380. getBrowsers = function() {
  11381. var browsers = {},
  11382. maxIEVersion, prefix, value, key, index, len, match, version, matched;
  11383. // MS Edge browser (and possibly others) can report multiple browsers in the UserAgent
  11384. // "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"
  11385. // we use this to prioritize the actual browser in this situation
  11386. len = me.browserPriority.length;
  11387. for (index = 0; index < len; index++) {
  11388. key = me.browserPriority[index];
  11389. if (!matched) {
  11390. value = me.browserPrefixes[key];
  11391. match = ua.match(new RegExp('(' + value + ')([\\w\\._]+)'));
  11392. version = match && match.length > 1 ? parseInt(match[2]) : 0;
  11393. if (version) {
  11394. matched = true;
  11395. }
  11396. } else {
  11397. version = 0;
  11398. }
  11399. browsers[key] = version;
  11400. }
  11401. //Deal with IE document mode
  11402. if (browsers.ie) {
  11403. var mode = document.documentMode;
  11404. if (mode >= 8) {
  11405. browsers.ie = mode;
  11406. }
  11407. }
  11408. // Fancy IE greater than and less then quick tags
  11409. version = browsers.ie || false;
  11410. maxIEVersion = Math.max(version, me.maxIEVersion);
  11411. for (index = 8; index <= maxIEVersion; ++index) {
  11412. prefix = 'ie' + index;
  11413. browsers[prefix + 'm'] = version ? version <= index : 0;
  11414. browsers[prefix] = version ? version === index : 0;
  11415. browsers[prefix + 'p'] = version ? version >= index : 0;
  11416. }
  11417. return browsers;
  11418. },
  11419. //OS Detection
  11420. getOperatingSystems = function() {
  11421. var systems = {},
  11422. value, key, keys, index, len, match, matched, version, activeCount;
  11423. keys = _getKeys(me.osPrefixes);
  11424. len = keys.length;
  11425. for (index = 0 , activeCount = 0; index < len; index++) {
  11426. key = keys[index];
  11427. value = me.osPrefixes[key];
  11428. match = ua.match(new RegExp('(' + value + ')([^\\s;]+)'));
  11429. matched = match ? match[1] : null;
  11430. // This is here because some HTC android devices show an OSX Snow Leopard userAgent by default.
  11431. // And the Kindle Fire doesn't have any indicator of Android as the OS in its User Agent
  11432. if (matched && (matched === 'HTC_' || matched === 'Silk/')) {
  11433. version = 2.3;
  11434. } else {
  11435. version = match && match.length > 1 ? parseFloat(match[match.length - 1]) : 0;
  11436. }
  11437. if (version) {
  11438. activeCount++;
  11439. }
  11440. systems[key] = version;
  11441. }
  11442. keys = _getKeys(me.fallbackOSPrefixes);
  11443. // If no OS could be found we resort to the fallbacks, otherwise we just
  11444. // falsify the fallbacks
  11445. len = keys.length;
  11446. for (index = 0; index < len; index++) {
  11447. key = keys[index];
  11448. // No OS was detected from osPrefixes
  11449. if (activeCount === 0) {
  11450. value = me.fallbackOSPrefixes[key];
  11451. match = ua.toLowerCase().match(new RegExp(value));
  11452. systems[key] = match ? true : 0;
  11453. } else {
  11454. systems[key] = 0;
  11455. }
  11456. }
  11457. return systems;
  11458. },
  11459. // Device Detection
  11460. getDevices = function() {
  11461. var devices = {},
  11462. value, key, keys, index, len, match;
  11463. keys = _getKeys(me.devicePrefixes);
  11464. len = keys.length;
  11465. for (index = 0; index < len; index++) {
  11466. key = keys[index];
  11467. value = me.devicePrefixes[key];
  11468. match = ua.match(new RegExp(value));
  11469. devices[key] = match ? true : 0;
  11470. }
  11471. return devices;
  11472. },
  11473. browsers = getBrowsers(),
  11474. systems = getOperatingSystems(),
  11475. devices = getDevices(),
  11476. platformParams = Boot.loadPlatformsParam();
  11477. // We apply platformParams from the query here first to allow for forced user valued
  11478. // to be used in calculation of generated tags
  11479. _merge(_tags, browsers, systems, devices, platformParams, true);
  11480. _tags.phone = !!((_tags.iphone || _tags.ipod) || (!_tags.silk && (_tags.android && (_tags.android < 3 || isMobile))) || (_tags.blackberry && isMobile) || (_tags.windowsphone));
  11481. _tags.tablet = !!(!_tags.phone && (_tags.ipad || _tags.android || _tags.silk || _tags.rimtablet || (_tags.ie10 && /; Touch/.test(ua))));
  11482. _tags.touch = // if the browser has touch events we can be reasonably sure the device has
  11483. // a touch screen
  11484. isEventSupported('touchend') || // browsers that use pointer event have maxTouchPoints > 0 if the
  11485. // device supports touch input
  11486. // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
  11487. navigator.maxTouchPoints || // IE10 uses a vendor-prefixed maxTouchPoints property
  11488. navigator.msMaxTouchPoints;
  11489. _tags.desktop = !_tags.phone && !_tags.tablet;
  11490. _tags.cordova = _tags.phonegap = !!(window.PhoneGap || window.Cordova || window.cordova);
  11491. _tags.webview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(ua);
  11492. _tags.androidstock = (_tags.android <= 4.3) && (_tags.safari || _tags.silk);
  11493. // Re-apply any query params here to allow for user override of generated tags (desktop, touch, tablet, etc)
  11494. _merge(_tags, platformParams, true);
  11495. },
  11496. /**
  11497. * Extracts user supplied platform tags from the "platformTags" query parameter
  11498. * of the form:
  11499. *
  11500. * ?platformTags=name:state,name:state,...
  11501. *
  11502. * (each tag defaults to true when state is unspecified)
  11503. *
  11504. * Example:
  11505. *
  11506. * ?platformTags=isTablet,isPhone:false,isDesktop:0,iOS:1,Safari:true, ...
  11507. *
  11508. * @returns {Object} the platform tags supplied by the query string
  11509. */
  11510. loadPlatformsParam: function() {
  11511. // Check if the ?platform parameter is set in the URL
  11512. var paramsString = window.location.search.substr(1),
  11513. paramsArray = paramsString.split("&"),
  11514. params = {},
  11515. i,
  11516. platforms = {},
  11517. tmpArray, tmplen, platform, name, enabled;
  11518. for (i = 0; i < paramsArray.length; i++) {
  11519. tmpArray = paramsArray[i].split("=");
  11520. params[tmpArray[0]] = tmpArray[1];
  11521. }
  11522. if (params.platformTags) {
  11523. tmpArray = params.platformTags.split(",");
  11524. for (tmplen = tmpArray.length , i = 0; i < tmplen; i++) {
  11525. platform = tmpArray[i].split(":");
  11526. name = platform[0];
  11527. enabled = true;
  11528. if (platform.length > 1) {
  11529. enabled = platform[1];
  11530. if (enabled === 'false' || enabled === '0') {
  11531. enabled = false;
  11532. }
  11533. }
  11534. platforms[name] = enabled;
  11535. }
  11536. }
  11537. return platforms;
  11538. },
  11539. filterPlatform: function(platform, excludes) {
  11540. platform = _emptyArray.concat(platform || _emptyArray);
  11541. excludes = _emptyArray.concat(excludes || _emptyArray);
  11542. var plen = platform.length,
  11543. elen = excludes.length,
  11544. include = (!plen && elen),
  11545. // default true if only excludes specified
  11546. i, tag;
  11547. for (i = 0; i < plen && !include; i++) {
  11548. tag = platform[i];
  11549. include = !!_tags[tag];
  11550. }
  11551. for (i = 0; i < elen && include; i++) {
  11552. tag = excludes[i];
  11553. include = !_tags[tag];
  11554. }
  11555. return include;
  11556. },
  11557. init: function() {
  11558. var scriptEls = doc.getElementsByTagName('script'),
  11559. script = scriptEls[0],
  11560. len = scriptEls.length,
  11561. re = /\/ext(\-[a-z\-]+)?\.js$/,
  11562. entry, src, state, baseUrl, key, n, origin;
  11563. // No check for script definedness because there always should be at least one
  11564. Boot.hasReadyState = ("readyState" in script);
  11565. Boot.hasAsync = ("async" in script);
  11566. Boot.hasDefer = ("defer" in script);
  11567. Boot.hasOnLoad = ("onload" in script);
  11568. // Feature detecting IE
  11569. Boot.isIE8 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && !Boot.hasOnLoad;
  11570. Boot.isIE9 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
  11571. Boot.isIE10p = Boot.hasReadyState && Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
  11572. if (Boot.isIE8) {
  11573. Boot.isIE10 = false;
  11574. Boot.isIE10m = true;
  11575. } else {
  11576. Boot.isIE10 = (new Function('/*@cc_on return @_jscript_version @*/')()) === 10;
  11577. Boot.isIE10m = Boot.isIE10 || Boot.isIE9 || Boot.isIE8;
  11578. }
  11579. // IE11 does not support conditional compilation so we detect it by exclusion
  11580. Boot.isIE11 = Boot.isIE10p && !Boot.isIE10;
  11581. // Since we are loading after other scripts, and we needed to gather them
  11582. // anyway, we track them in _scripts so we don't have to ask for them all
  11583. // repeatedly.
  11584. for (n = 0; n < len; n++) {
  11585. src = (script = scriptEls[n]).src;
  11586. if (!src) {
  11587. continue;
  11588. }
  11589. state = script.readyState || null;
  11590. // If we find a script file called "ext-*.js", then the base path is that file's base path.
  11591. if (!baseUrl && re.test(src)) {
  11592. baseUrl = src;
  11593. }
  11594. if (!Boot.scripts[key = Boot.canonicalUrl(src)]) {
  11595. // _debug("creating entry " + key + " in Boot.init");
  11596. entry = new Entry({
  11597. key: key,
  11598. url: src,
  11599. done: state === null || // non-IE
  11600. state === 'loaded' || state === 'complete',
  11601. // IE only
  11602. el: script,
  11603. prop: 'src'
  11604. });
  11605. }
  11606. }
  11607. if (!baseUrl) {
  11608. script = scriptEls[scriptEls.length - 1];
  11609. baseUrl = script.src;
  11610. }
  11611. Boot.baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1);
  11612. origin = window.location.origin || window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
  11613. Boot.origin = origin;
  11614. Boot.detectPlatformTags();
  11615. Ext.filterPlatform = Boot.filterPlatform;
  11616. },
  11617. /**
  11618. * This method returns a canonical URL for the given URL.
  11619. *
  11620. * For example, the following all produce the same canonical URL (which is the
  11621. * last one):
  11622. *
  11623. * http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js?_dc=12345
  11624. * http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js
  11625. * http://foo.com/bar/baz/zoo/derp/../jazz/../../goo/Thing.js
  11626. * http://foo.com/bar/baz/zoo/../goo/Thing.js
  11627. * http://foo.com/bar/baz/goo/Thing.js
  11628. *
  11629. * @private
  11630. */
  11631. canonicalUrl: function(url) {
  11632. // *WARNING WARNING WARNING*
  11633. // This method yields the most correct result we can get but it is EXPENSIVE!
  11634. // In ALL browsers! When called multiple times in a sequence, as if when
  11635. // we resolve dependencies for entries, it will cause garbage collection events
  11636. // and overall painful slowness. This is why we try to avoid it as much as we can.
  11637. //
  11638. // @TODO - see if we need this fallback logic
  11639. // http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue
  11640. resolverEl.href = url;
  11641. var ret = resolverEl.href,
  11642. dc = _config.disableCachingParam,
  11643. pos = dc ? ret.indexOf(dc + '=') : -1,
  11644. c, end;
  11645. // If we have a _dc query parameter we need to remove it from the canonical
  11646. // URL.
  11647. if (pos > 0 && ((c = ret.charAt(pos - 1)) === '?' || c === '&')) {
  11648. end = ret.indexOf('&', pos);
  11649. end = (end < 0) ? '' : ret.substring(end);
  11650. if (end && c === '?') {
  11651. ++pos;
  11652. // keep the '?'
  11653. end = end.substring(1);
  11654. }
  11655. // remove the '&'
  11656. ret = ret.substring(0, pos - 1) + end;
  11657. }
  11658. return ret;
  11659. },
  11660. /**
  11661. * Get the config value corresponding to the specified name. If no name is given, will return the config object
  11662. * @param {String} name The config property name
  11663. * @return {Object}
  11664. */
  11665. getConfig: function(name) {
  11666. return name ? Boot.config[name] : Boot.config;
  11667. },
  11668. /**
  11669. * Set the configuration.
  11670. * @param {Object} config The config object to override the default values.
  11671. * @return {Ext.Boot} this
  11672. */
  11673. setConfig: function(name, value) {
  11674. if (typeof name === 'string') {
  11675. Boot.config[name] = value;
  11676. } else {
  11677. for (var s in name) {
  11678. Boot.setConfig(s, name[s]);
  11679. }
  11680. }
  11681. return Boot;
  11682. },
  11683. getHead: function() {
  11684. return Boot.docHead || (Boot.docHead = doc.head || doc.getElementsByTagName('head')[0]);
  11685. },
  11686. create: function(url, key, cfg) {
  11687. var config = cfg || {};
  11688. config.url = url;
  11689. config.key = key;
  11690. return Boot.scripts[key] = new Entry(config);
  11691. },
  11692. getEntry: function(url, cfg, canonicalPath) {
  11693. var key, entry;
  11694. // Canonicalizing URLs via anchor element href yields the most correct result
  11695. // but is *extremely* resource heavy so we need to avoid it whenever possible
  11696. key = canonicalPath ? url : Boot.canonicalUrl(url);
  11697. entry = Boot.scripts[key];
  11698. if (!entry) {
  11699. entry = Boot.create(url, key, cfg);
  11700. if (canonicalPath) {
  11701. entry.canonicalPath = true;
  11702. }
  11703. }
  11704. return entry;
  11705. },
  11706. registerContent: function(url, type, content) {
  11707. var cfg = {
  11708. content: content,
  11709. loaded: true,
  11710. css: type === 'css'
  11711. };
  11712. return Boot.getEntry(url, cfg);
  11713. },
  11714. processRequest: function(request, sync) {
  11715. request.loadEntries(sync);
  11716. },
  11717. load: function(request) {
  11718. // _debug("Boot.load called");
  11719. var request = new Request(request);
  11720. if (request.sync || Boot.syncMode) {
  11721. return Boot.loadSync(request);
  11722. }
  11723. // If there is a request in progress, we must
  11724. // queue this new request to be fired when the current request completes.
  11725. if (Boot.currentRequest) {
  11726. // _debug("current active request, suspending this request");
  11727. // trigger assignment of entries now to ensure that overlapping
  11728. // entries with currently running requests will synchronize state
  11729. // with this pending one as they complete
  11730. request.getEntries();
  11731. Boot.suspendedQueue.push(request);
  11732. } else {
  11733. Boot.currentRequest = request;
  11734. Boot.processRequest(request, false);
  11735. }
  11736. return Boot;
  11737. },
  11738. loadSync: function(request) {
  11739. // _debug("Boot.loadSync called");
  11740. var request = new Request(request);
  11741. Boot.syncMode++;
  11742. Boot.processRequest(request, true);
  11743. Boot.syncMode--;
  11744. return Boot;
  11745. },
  11746. loadBasePrefix: function(request) {
  11747. request = new Request(request);
  11748. request.prependBaseUrl = true;
  11749. return Boot.load(request);
  11750. },
  11751. loadSyncBasePrefix: function(request) {
  11752. request = new Request(request);
  11753. request.prependBaseUrl = true;
  11754. return Boot.loadSync(request);
  11755. },
  11756. requestComplete: function(request) {
  11757. var next;
  11758. if (Boot.currentRequest === request) {
  11759. Boot.currentRequest = null;
  11760. while (Boot.suspendedQueue.length > 0) {
  11761. next = Boot.suspendedQueue.shift();
  11762. if (!next.done) {
  11763. // _debug("resuming suspended request");
  11764. Boot.load(next);
  11765. break;
  11766. }
  11767. }
  11768. }
  11769. if (!Boot.currentRequest && Boot.suspendedQueue.length == 0) {
  11770. Boot.fireListeners();
  11771. }
  11772. },
  11773. isLoading: function() {
  11774. return !Boot.currentRequest && Boot.suspendedQueue.length == 0;
  11775. },
  11776. fireListeners: function() {
  11777. var listener;
  11778. while (Boot.isLoading() && (listener = Boot.listeners.shift())) {
  11779. listener();
  11780. }
  11781. },
  11782. onBootReady: function(listener) {
  11783. if (!Boot.isLoading()) {
  11784. listener();
  11785. } else {
  11786. Boot.listeners.push(listener);
  11787. }
  11788. },
  11789. /**
  11790. * this is a helper function used by Ext.Loader to flush out
  11791. * 'uses' arrays for classes in some Ext versions
  11792. */
  11793. getPathsFromIndexes: function(indexMap, loadOrder) {
  11794. // In older versions indexMap was an object instead of a sparse array
  11795. if (!('length' in indexMap)) {
  11796. var indexArray = [],
  11797. index;
  11798. for (index in indexMap) {
  11799. if (!isNaN(+index)) {
  11800. indexArray[+index] = indexMap[index];
  11801. }
  11802. }
  11803. indexMap = indexArray;
  11804. }
  11805. return Request.prototype.getPathsFromIndexes(indexMap, loadOrder);
  11806. },
  11807. createLoadOrderMap: function(loadOrder) {
  11808. return Request.prototype.createLoadOrderMap(loadOrder);
  11809. },
  11810. fetch: function(url, complete, scope, async) {
  11811. async = (async === undefined) ? !!complete : async;
  11812. var xhr = new XMLHttpRequest(),
  11813. result, status, content,
  11814. exception = false,
  11815. readyStateChange = function() {
  11816. if (xhr && xhr.readyState == 4) {
  11817. status = (xhr.status === 1223) ? 204 : (xhr.status === 0 && ((self.location || {}).protocol === 'file:' || (self.location || {}).protocol === 'ionp:')) ? 200 : xhr.status;
  11818. content = xhr.responseText;
  11819. result = {
  11820. content: content,
  11821. status: status,
  11822. exception: exception
  11823. };
  11824. if (complete) {
  11825. complete.call(scope, result);
  11826. }
  11827. xhr.onreadystatechange = emptyFn;
  11828. xhr = null;
  11829. }
  11830. };
  11831. if (async) {
  11832. xhr.onreadystatechange = readyStateChange;
  11833. }
  11834. try {
  11835. // _debug("fetching " + url + " " + (async ? "async" : "sync"));
  11836. xhr.open('GET', url, async);
  11837. xhr.send(null);
  11838. } catch (err) {
  11839. exception = err;
  11840. readyStateChange();
  11841. return result;
  11842. }
  11843. if (!async) {
  11844. readyStateChange();
  11845. }
  11846. return result;
  11847. },
  11848. notifyAll: function(entry) {
  11849. entry.notifyRequests();
  11850. }
  11851. };
  11852. function Request(cfg) {
  11853. //The request class encapsulates a series of Entry objects
  11854. //and provides notification around the completion of all Entries
  11855. //in this request.
  11856. if (cfg.$isRequest) {
  11857. return cfg;
  11858. }
  11859. var cfg = cfg.url ? cfg : {
  11860. url: cfg
  11861. },
  11862. url = cfg.url,
  11863. urls = url.charAt ? [
  11864. url
  11865. ] : url,
  11866. charset = cfg.charset || Boot.config.charset;
  11867. _apply(this, cfg);
  11868. delete this.url;
  11869. this.urls = urls;
  11870. this.charset = charset;
  11871. }
  11872. Request.prototype = {
  11873. $isRequest: true,
  11874. createLoadOrderMap: function(loadOrder) {
  11875. var len = loadOrder.length,
  11876. loadOrderMap = {},
  11877. i, element;
  11878. for (i = 0; i < len; i++) {
  11879. element = loadOrder[i];
  11880. loadOrderMap[element.path] = element;
  11881. }
  11882. return loadOrderMap;
  11883. },
  11884. getLoadIndexes: function(item, indexMap, loadOrder, includeUses, skipLoaded) {
  11885. var resolved = [],
  11886. queue = [
  11887. item
  11888. ],
  11889. itemIndex = item.idx,
  11890. queue, entry, dependencies, depIndex, i, len;
  11891. if (indexMap[itemIndex]) {
  11892. // prevent cycles
  11893. return resolved;
  11894. }
  11895. // Both indexMap and resolved are sparse arrays keyed by indexes.
  11896. // This gives us a naturally sorted sequence of indexes later on
  11897. // when we need to convert them to paths.
  11898. // indexMap is the map of all indexes we have visited at least once
  11899. // per the current expandUrls() invocation, and resolved is the map
  11900. // of all dependencies for the current item that are not included
  11901. // in indexMap.
  11902. indexMap[itemIndex] = resolved[itemIndex] = true;
  11903. while (item = queue.shift()) {
  11904. // Canonicalizing URLs is expensive, we try to avoid it
  11905. if (item.canonicalPath) {
  11906. entry = Boot.getEntry(item.path, null, true);
  11907. } else {
  11908. entry = Boot.getEntry(this.prepareUrl(item.path));
  11909. }
  11910. if (!(skipLoaded && entry.done)) {
  11911. if (includeUses && item.uses && item.uses.length) {
  11912. dependencies = item.requires.concat(item.uses);
  11913. } else {
  11914. dependencies = item.requires;
  11915. }
  11916. for (i = 0 , len = dependencies.length; i < len; i++) {
  11917. depIndex = dependencies[i];
  11918. if (!indexMap[depIndex]) {
  11919. indexMap[depIndex] = resolved[depIndex] = true;
  11920. queue.push(loadOrder[depIndex]);
  11921. }
  11922. }
  11923. }
  11924. }
  11925. return resolved;
  11926. },
  11927. getPathsFromIndexes: function(indexes, loadOrder) {
  11928. var paths = [],
  11929. index, len;
  11930. // indexes is a sparse array with values being true for defined indexes
  11931. for (index = 0 , len = indexes.length; index < len; index++) {
  11932. if (indexes[index]) {
  11933. paths.push(loadOrder[index].path);
  11934. }
  11935. }
  11936. return paths;
  11937. },
  11938. expandUrl: function(url, loadOrder, loadOrderMap, indexMap, includeUses, skipLoaded) {
  11939. var item, resolved;
  11940. if (loadOrder) {
  11941. item = loadOrderMap[url];
  11942. if (item) {
  11943. resolved = this.getLoadIndexes(item, indexMap, loadOrder, includeUses, skipLoaded);
  11944. if (resolved.length) {
  11945. return this.getPathsFromIndexes(resolved, loadOrder);
  11946. }
  11947. }
  11948. }
  11949. return [
  11950. url
  11951. ];
  11952. },
  11953. expandUrls: function(urls, includeUses) {
  11954. var me = this,
  11955. loadOrder = me.loadOrder,
  11956. expanded = [],
  11957. expandMap = {},
  11958. indexMap = [],
  11959. loadOrderMap, tmpExpanded, i, len, t, tlen, tUrl;
  11960. if (typeof urls === "string") {
  11961. urls = [
  11962. urls
  11963. ];
  11964. }
  11965. if (loadOrder) {
  11966. loadOrderMap = me.loadOrderMap;
  11967. if (!loadOrderMap) {
  11968. loadOrderMap = me.loadOrderMap = me.createLoadOrderMap(loadOrder);
  11969. }
  11970. }
  11971. for (i = 0 , len = urls.length; i < len; i++) {
  11972. // We don't want to skip loaded entries (last argument === false).
  11973. // There are some overrides that get loaded before their respective classes,
  11974. // and when the class dependencies are processed we don't want to skip over
  11975. // the overrides' dependencies just because they were loaded first.
  11976. tmpExpanded = this.expandUrl(urls[i], loadOrder, loadOrderMap, indexMap, includeUses, false);
  11977. for (t = 0 , tlen = tmpExpanded.length; t < tlen; t++) {
  11978. tUrl = tmpExpanded[t];
  11979. if (!expandMap[tUrl]) {
  11980. expandMap[tUrl] = true;
  11981. expanded.push(tUrl);
  11982. }
  11983. }
  11984. }
  11985. if (expanded.length === 0) {
  11986. expanded = urls;
  11987. }
  11988. return expanded;
  11989. },
  11990. expandLoadOrder: function() {
  11991. var me = this,
  11992. urls = me.urls,
  11993. expanded;
  11994. if (!me.expanded) {
  11995. expanded = this.expandUrls(urls, true);
  11996. me.expanded = true;
  11997. } else {
  11998. expanded = urls;
  11999. }
  12000. me.urls = expanded;
  12001. // if we added some urls to the request to honor the indicated
  12002. // load order, the request needs to be sequential
  12003. if (urls.length != expanded.length) {
  12004. me.sequential = true;
  12005. }
  12006. return me;
  12007. },
  12008. getUrls: function() {
  12009. this.expandLoadOrder();
  12010. return this.urls;
  12011. },
  12012. prepareUrl: function(url) {
  12013. if (this.prependBaseUrl) {
  12014. return Boot.baseUrl + url;
  12015. }
  12016. return url;
  12017. },
  12018. getEntries: function() {
  12019. var me = this,
  12020. entries = me.entries,
  12021. loadOrderMap, item, i, entry, urls, url;
  12022. if (!entries) {
  12023. entries = [];
  12024. urls = me.getUrls();
  12025. // If we have loadOrder array then the map will be expanded by now
  12026. if (me.loadOrder) {
  12027. loadOrderMap = me.loadOrderMap;
  12028. }
  12029. for (i = 0; i < urls.length; i++) {
  12030. url = me.prepareUrl(urls[i]);
  12031. if (loadOrderMap) {
  12032. item = loadOrderMap[url];
  12033. }
  12034. entry = Boot.getEntry(url, {
  12035. buster: me.buster,
  12036. charset: me.charset
  12037. }, item && item.canonicalPath);
  12038. entry.requests.push(me);
  12039. entries.push(entry);
  12040. }
  12041. me.entries = entries;
  12042. }
  12043. return entries;
  12044. },
  12045. loadEntries: function(sync) {
  12046. var me = this,
  12047. entries = me.getEntries(),
  12048. len = entries.length,
  12049. start = me.loadStart || 0,
  12050. continueLoad, entries, entry, i;
  12051. if (sync !== undefined) {
  12052. me.sync = sync;
  12053. }
  12054. me.loaded = me.loaded || 0;
  12055. me.loading = me.loading || len;
  12056. for (i = start; i < len; i++) {
  12057. entry = entries[i];
  12058. if (!entry.loaded) {
  12059. continueLoad = entries[i].load(me.sync);
  12060. } else {
  12061. continueLoad = true;
  12062. }
  12063. if (!continueLoad) {
  12064. me.loadStart = i;
  12065. entry.onDone(function() {
  12066. me.loadEntries(sync);
  12067. });
  12068. break;
  12069. }
  12070. }
  12071. me.processLoadedEntries();
  12072. },
  12073. processLoadedEntries: function() {
  12074. var me = this,
  12075. entries = me.getEntries(),
  12076. len = entries.length,
  12077. start = me.startIndex || 0,
  12078. i, entry;
  12079. if (!me.done) {
  12080. for (i = start; i < len; i++) {
  12081. entry = entries[i];
  12082. if (!entry.loaded) {
  12083. me.startIndex = i;
  12084. return;
  12085. }
  12086. if (!entry.evaluated) {
  12087. entry.evaluate();
  12088. }
  12089. if (entry.error) {
  12090. me.error = true;
  12091. }
  12092. }
  12093. me.notify();
  12094. }
  12095. },
  12096. notify: function() {
  12097. var me = this;
  12098. if (!me.done) {
  12099. var error = me.error,
  12100. fn = me[error ? 'failure' : 'success'],
  12101. delay = ('delay' in me) ? me.delay : (error ? 1 : Boot.config.chainDelay),
  12102. scope = me.scope || me;
  12103. me.done = true;
  12104. if (fn) {
  12105. if (delay === 0 || delay > 0) {
  12106. // Free the stack (and defer the next script)
  12107. setTimeout(function() {
  12108. fn.call(scope, me);
  12109. }, delay);
  12110. } else {
  12111. fn.call(scope, me);
  12112. }
  12113. }
  12114. me.fireListeners();
  12115. Boot.requestComplete(me);
  12116. }
  12117. },
  12118. onDone: function(listener) {
  12119. var me = this,
  12120. listeners = me.listeners || (me.listeners = []);
  12121. if (me.done) {
  12122. listener(me);
  12123. } else {
  12124. listeners.push(listener);
  12125. }
  12126. },
  12127. fireListeners: function() {
  12128. var listeners = this.listeners,
  12129. listener;
  12130. if (listeners) {
  12131. // _debug("firing request listeners");
  12132. while ((listener = listeners.shift())) {
  12133. listener(this);
  12134. }
  12135. }
  12136. }
  12137. };
  12138. function Entry(cfg) {
  12139. //The Entry class is a token to manage the load and evaluation
  12140. //state of a particular url. It is used to notify all Requests
  12141. //interested in this url that the content is available.
  12142. if (cfg.$isEntry) {
  12143. return cfg;
  12144. }
  12145. // _debug("creating entry for " + cfg.url);
  12146. var charset = cfg.charset || Boot.config.charset,
  12147. manifest = Ext.manifest,
  12148. loader = manifest && manifest.loader,
  12149. cache = (cfg.cache !== undefined) ? cfg.cache : (loader && loader.cache),
  12150. buster, busterParam;
  12151. if (Boot.config.disableCaching) {
  12152. if (cache === undefined) {
  12153. cache = !Boot.config.disableCaching;
  12154. }
  12155. if (cache === false) {
  12156. buster = +new Date();
  12157. } else if (cache !== true) {
  12158. buster = cache;
  12159. }
  12160. if (buster) {
  12161. busterParam = (loader && loader.cacheParam) || Boot.config.disableCachingParam;
  12162. buster = busterParam + "=" + buster;
  12163. }
  12164. }
  12165. _apply(this, cfg);
  12166. this.charset = charset;
  12167. this.buster = buster;
  12168. this.requests = [];
  12169. }
  12170. Entry.prototype = {
  12171. $isEntry: true,
  12172. done: false,
  12173. evaluated: false,
  12174. loaded: false,
  12175. isCrossDomain: function() {
  12176. var me = this;
  12177. if (me.crossDomain === undefined) {
  12178. // _debug("checking " + me.getLoadUrl() + " for prefix " + Boot.origin);
  12179. me.crossDomain = (me.getLoadUrl().indexOf(Boot.origin) !== 0);
  12180. }
  12181. return me.crossDomain;
  12182. },
  12183. isCss: function() {
  12184. var me = this;
  12185. if (me.css === undefined) {
  12186. if (me.url) {
  12187. var assetConfig = Boot.assetConfig[me.url];
  12188. me.css = assetConfig ? assetConfig.type === "css" : cssRe.test(me.url);
  12189. } else {
  12190. me.css = false;
  12191. }
  12192. }
  12193. return this.css;
  12194. },
  12195. getElement: function(tag) {
  12196. var me = this,
  12197. el = me.el;
  12198. if (!el) {
  12199. // _debug("creating element for " + me.url);
  12200. if (me.isCss()) {
  12201. tag = tag || "link";
  12202. el = doc.createElement(tag);
  12203. if (tag == "link") {
  12204. el.rel = 'stylesheet';
  12205. me.prop = 'href';
  12206. } else {
  12207. me.prop = "textContent";
  12208. }
  12209. el.type = "text/css";
  12210. } else {
  12211. tag = tag || "script";
  12212. el = doc.createElement(tag);
  12213. el.type = 'text/javascript';
  12214. me.prop = 'src';
  12215. if (me.charset) {
  12216. el.charset = me.charset;
  12217. }
  12218. if (Boot.hasAsync) {
  12219. el.async = false;
  12220. }
  12221. }
  12222. me.el = el;
  12223. }
  12224. return el;
  12225. },
  12226. getLoadUrl: function() {
  12227. var me = this,
  12228. url;
  12229. url = me.canonicalPath ? me.url : Boot.canonicalUrl(me.url);
  12230. if (!me.loadUrl) {
  12231. me.loadUrl = !!me.buster ? (url + (url.indexOf('?') === -1 ? '?' : '&') + me.buster) : url;
  12232. }
  12233. return me.loadUrl;
  12234. },
  12235. fetch: function(req) {
  12236. var url = this.getLoadUrl(),
  12237. async = !!req.async,
  12238. complete = req.complete;
  12239. Boot.fetch(url, complete, this, async);
  12240. },
  12241. onContentLoaded: function(response) {
  12242. var me = this,
  12243. status = response.status,
  12244. content = response.content,
  12245. exception = response.exception,
  12246. url = this.getLoadUrl();
  12247. me.loaded = true;
  12248. if ((exception || status === 0) && !_environment.phantom) {
  12249. 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;
  12250. me.evaluated = true;
  12251. } else if ((status >= 200 && status < 300) || status === 304 || _environment.phantom || (status === 0 && content.length > 0)) {
  12252. me.content = content;
  12253. } else {
  12254. me.error = ("Failed loading synchronously via XHR: '" + url + "'. Please verify that the file exists. XHR status code: " + status) || true;
  12255. me.evaluated = true;
  12256. }
  12257. },
  12258. createLoadElement: function(callback) {
  12259. var me = this,
  12260. el = me.getElement();
  12261. me.preserve = true;
  12262. el.onerror = function() {
  12263. me.error = true;
  12264. if (callback) {
  12265. callback();
  12266. callback = null;
  12267. }
  12268. };
  12269. if (Boot.isIE10m) {
  12270. el.onreadystatechange = function() {
  12271. if (this.readyState === 'loaded' || this.readyState === 'complete') {
  12272. if (callback) {
  12273. callback();
  12274. callback = this.onreadystatechange = this.onerror = null;
  12275. }
  12276. }
  12277. };
  12278. } else {
  12279. el.onload = function() {
  12280. callback();
  12281. callback = this.onload = this.onerror = null;
  12282. };
  12283. }
  12284. // IE starts loading here
  12285. el[me.prop] = me.getLoadUrl();
  12286. },
  12287. onLoadElementReady: function() {
  12288. Boot.getHead().appendChild(this.getElement());
  12289. this.evaluated = true;
  12290. },
  12291. inject: function(content, asset) {
  12292. // _debug("injecting content for " + this.url);
  12293. var me = this,
  12294. head = Boot.getHead(),
  12295. url = me.url,
  12296. key = me.key,
  12297. base, el, ieMode, basePath;
  12298. if (me.isCss()) {
  12299. me.preserve = true;
  12300. basePath = key.substring(0, key.lastIndexOf("/") + 1);
  12301. base = doc.createElement('base');
  12302. base.href = basePath;
  12303. if (head.firstChild) {
  12304. head.insertBefore(base, head.firstChild);
  12305. } else {
  12306. head.appendChild(base);
  12307. }
  12308. // reset the href attribute to cuase IE to pick up the change
  12309. base.href = base.href;
  12310. if (url) {
  12311. content += "\n/*# sourceURL=" + key + " */";
  12312. }
  12313. // create element after setting base
  12314. el = me.getElement("style");
  12315. ieMode = ('styleSheet' in el);
  12316. head.appendChild(base);
  12317. if (ieMode) {
  12318. head.appendChild(el);
  12319. el.styleSheet.cssText = content;
  12320. } else {
  12321. el.textContent = content;
  12322. head.appendChild(el);
  12323. }
  12324. head.removeChild(base);
  12325. } else {
  12326. // Debugger friendly, file names are still shown even though they're
  12327. // eval'ed code. Breakpoints work on both Firebug and Chrome's Web
  12328. // Inspector.
  12329. if (url) {
  12330. content += "\n//# sourceURL=" + key;
  12331. }
  12332. Ext.globalEval(content);
  12333. }
  12334. return me;
  12335. },
  12336. loadCrossDomain: function() {
  12337. var me = this,
  12338. complete = function() {
  12339. me.el.onerror = me.el.onload = emptyFn;
  12340. me.el = null;
  12341. me.loaded = me.evaluated = me.done = true;
  12342. me.notifyRequests();
  12343. };
  12344. me.createLoadElement(function() {
  12345. complete();
  12346. });
  12347. me.evaluateLoadElement();
  12348. // at this point, we need sequential evaluation,
  12349. // which means we can't advance the load until
  12350. // this entry has fully completed
  12351. return false;
  12352. },
  12353. loadElement: function() {
  12354. var me = this,
  12355. complete = function() {
  12356. me.el.onerror = me.el.onload = emptyFn;
  12357. me.el = null;
  12358. me.loaded = me.evaluated = me.done = true;
  12359. me.notifyRequests();
  12360. };
  12361. me.createLoadElement(function() {
  12362. complete();
  12363. });
  12364. me.evaluateLoadElement();
  12365. return true;
  12366. },
  12367. loadSync: function() {
  12368. var me = this;
  12369. me.fetch({
  12370. async: false,
  12371. complete: function(response) {
  12372. me.onContentLoaded(response);
  12373. }
  12374. });
  12375. me.evaluate();
  12376. me.notifyRequests();
  12377. },
  12378. load: function(sync) {
  12379. var me = this;
  12380. if (!me.loaded) {
  12381. if (me.loading) {
  12382. // if we're calling back through load and we're loading but haven't
  12383. // yet loaded, then we should be in a sequential, cross domain
  12384. // load scenario which means we can't continue the load on the
  12385. // request until this entry has fully evaluated, which will mean
  12386. // loaded = evaluated = done = true in one step. For css files, this
  12387. // will happen immediately upon <link> element creation / insertion,
  12388. // but <script> elements will set this upon load notification
  12389. return false;
  12390. }
  12391. me.loading = true;
  12392. // for async modes, we have some options
  12393. if (!sync) {
  12394. // if cross domain, just inject the script tag and let the onload
  12395. // events drive the progression.
  12396. // IE10 also needs sequential loading because of a bug that makes it
  12397. // fire readystate event prematurely:
  12398. // https://connect.microsoft.com/IE/feedback/details/729164/ie10-dynamic-script-element-fires-loaded-readystate-prematurely
  12399. if (Boot.isIE10 || me.isCrossDomain()) {
  12400. return me.loadCrossDomain();
  12401. }
  12402. // for IE, use the readyStateChange allows us to load scripts in parallel
  12403. // but serialize the evaluation by appending the script node to the
  12404. // document
  12405. else if (!me.isCss() && Boot.hasReadyState) {
  12406. me.createLoadElement(function() {
  12407. me.loaded = true;
  12408. me.notifyRequests();
  12409. });
  12410. } else if (Boot.useElements && // older webkit, phantomjs included, won't fire load for link elements
  12411. !(me.isCss() && _environment.phantom)) {
  12412. return me.loadElement();
  12413. } else // for other browsers, just ajax the content down in parallel, and use
  12414. // globalEval to serialize evaluation
  12415. {
  12416. me.fetch({
  12417. async: !sync,
  12418. complete: function(response) {
  12419. me.onContentLoaded(response);
  12420. me.notifyRequests();
  12421. }
  12422. });
  12423. }
  12424. } else // for sync mode in js, global eval FTW. IE won't honor the comment
  12425. // paths in the debugger, so eventually we need a sync mode for IE that
  12426. // uses the readyStateChange mechanism
  12427. {
  12428. me.loadSync();
  12429. }
  12430. }
  12431. // signal that the load process can continue
  12432. return true;
  12433. },
  12434. evaluateContent: function() {
  12435. this.inject(this.content);
  12436. this.content = null;
  12437. },
  12438. evaluateLoadElement: function() {
  12439. Boot.getHead().appendChild(this.getElement());
  12440. },
  12441. evaluate: function() {
  12442. var me = this;
  12443. if (!me.evaluated) {
  12444. if (me.evaluating) {
  12445. return;
  12446. }
  12447. me.evaluating = true;
  12448. if (me.content !== undefined) {
  12449. me.evaluateContent();
  12450. } else if (!me.error) {
  12451. me.evaluateLoadElement();
  12452. }
  12453. me.evaluated = me.done = true;
  12454. me.cleanup();
  12455. }
  12456. },
  12457. cleanup: function() {
  12458. var me = this,
  12459. el = me.el,
  12460. prop;
  12461. if (!el) {
  12462. return;
  12463. }
  12464. if (!me.preserve) {
  12465. me.el = null;
  12466. el.parentNode.removeChild(el);
  12467. // Remove, since its useless now
  12468. for (prop in el) {
  12469. try {
  12470. if (prop !== me.prop) {
  12471. // If we set the src property to null IE
  12472. // will try and request a script at './null'
  12473. el[prop] = null;
  12474. }
  12475. delete el[prop];
  12476. } // and prepare for GC
  12477. catch (cleanEx) {}
  12478. }
  12479. }
  12480. //ignore
  12481. // Setting to null can cause exceptions if IE ever needs to call these
  12482. // again (like onreadystatechange). This emptyFn has nothing locked in
  12483. // closure scope so it is about as safe as null for memory leaks.
  12484. el.onload = el.onerror = el.onreadystatechange = emptyFn;
  12485. },
  12486. notifyRequests: function() {
  12487. var requests = this.requests,
  12488. len = requests.length,
  12489. i, request;
  12490. for (i = 0; i < len; i++) {
  12491. request = requests[i];
  12492. request.processLoadedEntries();
  12493. }
  12494. if (this.done) {
  12495. this.fireListeners();
  12496. }
  12497. },
  12498. onDone: function(listener) {
  12499. var me = this,
  12500. listeners = me.listeners || (me.listeners = []);
  12501. if (me.done) {
  12502. listener(me);
  12503. } else {
  12504. listeners.push(listener);
  12505. }
  12506. },
  12507. fireListeners: function() {
  12508. var listeners = this.listeners,
  12509. listener;
  12510. if (listeners && listeners.length > 0) {
  12511. // _debug("firing event listeners for url " + this.url);
  12512. while ((listener = listeners.shift())) {
  12513. listener(this);
  12514. }
  12515. }
  12516. }
  12517. };
  12518. /**
  12519. * Turns on or off the "cache buster" applied to dynamically loaded scripts. Normally
  12520. * dynamically loaded scripts have an extra query parameter appended to avoid stale
  12521. * cached scripts. This method can be used to disable this mechanism, and is primarily
  12522. * useful for testing. This is done using a cookie.
  12523. * @param {Boolean} disable True to disable the cache buster.
  12524. * @param {String} [path="/"] An optional path to scope the cookie.
  12525. */
  12526. Ext.disableCacheBuster = function(disable, path) {
  12527. var date = new Date();
  12528. date.setTime(date.getTime() + (disable ? 10 * 365 : -1) * 24 * 60 * 60 * 1000);
  12529. date = date.toGMTString();
  12530. doc.cookie = 'ext-cache=1; expires=' + date + '; path=' + (path || '/');
  12531. };
  12532. Boot.init();
  12533. return Boot;
  12534. }(// NOTE: We run the eval at global scope to protect the body of the function and allow
  12535. // compressors to still process it.
  12536. function() {}));
  12537. //(eval("/*@cc_on!@*/!1"));
  12538. /**
  12539. * This method evaluates the given code free of any local variable. This
  12540. * will be at global scope, in others it will be in a function.
  12541. * @param {String} code The code to evaluate.
  12542. * @private
  12543. * @method
  12544. * @member Ext
  12545. */
  12546. Ext.globalEval = Ext.globalEval || (this.execScript ? function(code) {
  12547. execScript(code);
  12548. } : function($$code) {
  12549. eval.call(window, $$code);
  12550. });
  12551. /*
  12552. * Only IE8 & IE/Quirks lack Function.prototype.bind so we polyfill that here.
  12553. */
  12554. if (!Function.prototype.bind) {
  12555. (function() {
  12556. var slice = Array.prototype.slice,
  12557. // To reduce overhead on call of the bound fn we have two flavors based on
  12558. // whether we have args to prepend or not:
  12559. bind = function(me) {
  12560. var args = slice.call(arguments, 1),
  12561. method = this;
  12562. if (args.length) {
  12563. return function() {
  12564. var t = arguments;
  12565. // avoid the slice/concat if the caller does not supply args
  12566. return method.apply(me, t.length ? args.concat(slice.call(t)) : args);
  12567. };
  12568. }
  12569. // this is the majority use case - just fn.bind(this) and no args
  12570. args = null;
  12571. return function() {
  12572. return method.apply(me, arguments);
  12573. };
  12574. };
  12575. Function.prototype.bind = bind;
  12576. bind.$extjs = true;
  12577. }());
  12578. }
  12579. // to detect this polyfill if one want to improve it
  12580. //</editor-fold>
  12581. Ext.setResourcePath = function(poolName, path) {
  12582. var manifest = Ext.manifest || (Ext.manifest = {}),
  12583. paths = manifest.resources || (manifest.resources = {});
  12584. if (manifest) {
  12585. if (typeof poolName !== 'string') {
  12586. Ext.apply(paths, poolName);
  12587. } else {
  12588. paths[poolName] = path;
  12589. }
  12590. manifest.resources = paths;
  12591. }
  12592. };
  12593. Ext.getResourcePath = function(path, poolName, packageName) {
  12594. if (typeof path !== 'string') {
  12595. poolName = path.pool;
  12596. packageName = path.packageName;
  12597. path = path.path;
  12598. }
  12599. var manifest = Ext.manifest,
  12600. paths = manifest && manifest.resources,
  12601. poolPath = paths[poolName],
  12602. output = [];
  12603. if (poolPath == null) {
  12604. poolPath = paths.path;
  12605. if (poolPath == null) {
  12606. poolPath = 'resources';
  12607. }
  12608. }
  12609. if (poolPath) {
  12610. output.push(poolPath);
  12611. }
  12612. if (packageName) {
  12613. output.push(packageName);
  12614. }
  12615. output.push(path);
  12616. return output.join('/');
  12617. };
  12618. // @tag core
  12619. /**
  12620. * @class Ext
  12621. *
  12622. * The Ext namespace (global object) encapsulates all classes, singletons, and
  12623. * utility methods provided by Sencha's libraries.
  12624. *
  12625. * Most user interface Components are at a lower level of nesting in the namespace,
  12626. * but many common utility functions are provided as direct properties of the Ext namespace.
  12627. *
  12628. * Also many frequently used methods from other classes are provided as shortcuts
  12629. * within the Ext namespace. For example {@link Ext#getCmp Ext.getCmp} aliases
  12630. * {@link Ext.ComponentManager#get Ext.ComponentManager.get}.
  12631. *
  12632. * Many applications are initiated with {@link Ext#application Ext.application} which is
  12633. * called once the DOM is ready. This ensures all scripts have been loaded, preventing
  12634. * dependency issues. For example:
  12635. *
  12636. * Ext.application({
  12637. * name: 'MyApp',
  12638. *
  12639. * launch: function () {
  12640. * Ext.Msg.alert(this.name, 'Ready to go!');
  12641. * }
  12642. * });
  12643. *
  12644. * <b><a href="http://www.sencha.com/products/sencha-cmd/">Sencha Cmd</a></b> is a free tool
  12645. * for helping you generate and build Ext JS (and Sencha Touch) applications. See
  12646. * `{@link Ext.app.Application Application}` for more information about creating an app.
  12647. *
  12648. * A lower-level technique that does not use the `Ext.app.Application` architecture is
  12649. * {@link Ext#onReady Ext.onReady}.
  12650. *
  12651. * You can also discuss concepts and issues with others on the
  12652. * <a href="http://www.sencha.com/forum/">Sencha Forums</a>.
  12653. *
  12654. * @singleton
  12655. */
  12656. var Ext = Ext || {};
  12657. // jshint ignore:line
  12658. // @define Ext
  12659. (function() {
  12660. var global = this,
  12661. objectPrototype = Object.prototype,
  12662. toString = objectPrototype.toString,
  12663. enumerables = [
  12664. //'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',
  12665. 'valueOf',
  12666. 'toLocaleString',
  12667. 'toString',
  12668. 'constructor'
  12669. ],
  12670. emptyFn = Ext.fireIdle = function() {},
  12671. // see GlobalEvents for true fireIdle
  12672. privateFn = function() {},
  12673. identityFn = function(o) {
  12674. return o;
  12675. },
  12676. // This is the "$previous" method of a hook function on an instance. When called, it
  12677. // calls through the class prototype by the name of the called method.
  12678. callOverrideParent = function() {
  12679. var method = callOverrideParent.caller.caller;
  12680. // skip callParent (our caller)
  12681. return method.$owner.prototype[method.$name].apply(this, arguments);
  12682. },
  12683. manifest = Ext.manifest || {},
  12684. i,
  12685. iterableRe = /\[object\s*(?:Array|Arguments|\w*Collection|\w*List|HTML\s+document\.all\s+class)\]/,
  12686. MSDateRe = /^\\?\/Date\(([-+])?(\d+)(?:[+-]\d{4})?\)\\?\/$/,
  12687. elevateArgs, elevateFn, elevateRet, elevateScope;
  12688. Ext.global = global;
  12689. Ext.$nextIid = 0;
  12690. /**
  12691. * Returns the current timestamp.
  12692. * @return {Number} Milliseconds since UNIX epoch.
  12693. * @method now
  12694. * @member Ext
  12695. */
  12696. Ext.now = Date.now || (Date.now = function() {
  12697. return +new Date();
  12698. });
  12699. /**
  12700. * Returns the current high-resolution timestamp.
  12701. * @return {Number} Milliseconds ellapsed since arbitrary epoch.
  12702. * @method ticks
  12703. * @member Ext
  12704. * @since 6.0.1
  12705. */
  12706. Ext.ticks = (global.performance && global.performance.now) ? function() {
  12707. return performance.now();
  12708. } : // jshint ignore:line
  12709. Ext.now;
  12710. Ext._startTime = Ext.ticks();
  12711. // Mark these special fn's for easy identification:
  12712. emptyFn.$nullFn = identityFn.$nullFn = emptyFn.$emptyFn = identityFn.$identityFn = privateFn.$nullFn = true;
  12713. privateFn.$privacy = 'framework';
  12714. // We also want to prevent these functions from being cleaned up on destroy
  12715. emptyFn.$noClearOnDestroy = identityFn.$noClearOnDestroy = true;
  12716. privateFn.$noClearOnDestroy = true;
  12717. // These are emptyFn's in core and are redefined only in Ext JS (we use this syntax
  12718. // so Cmd does not detect them):
  12719. Ext['suspendLayouts'] = Ext['resumeLayouts'] = emptyFn;
  12720. // jshint ignore:line
  12721. for (i in {
  12722. toString: 1
  12723. }) {
  12724. enumerables = null;
  12725. }
  12726. /**
  12727. * An array containing extra enumerables for old browsers
  12728. * @property {String[]}
  12729. */
  12730. Ext.enumerables = enumerables;
  12731. /**
  12732. * Copies all the properties of `config` to the specified `object`. There are two levels
  12733. * of defaulting supported:
  12734. *
  12735. * Ext.apply(obj, { a: 1 }, { a: 2 });
  12736. * //obj.a === 1
  12737. *
  12738. * Ext.apply(obj, { }, { a: 2 });
  12739. * //obj.a === 2
  12740. *
  12741. * Note that if recursive merging and cloning without referencing the original objects
  12742. * or arrays is needed, use {@link Ext.Object#merge} instead.
  12743. *
  12744. * @param {Object} object The receiver of the properties.
  12745. * @param {Object} config The primary source of the properties.
  12746. * @param {Object} [defaults] An object that will also be applied for default values.
  12747. * @return {Object} returns `object`.
  12748. */
  12749. Ext.apply = function(object, config, defaults) {
  12750. if (object) {
  12751. if (defaults) {
  12752. Ext.apply(object, defaults);
  12753. }
  12754. if (config && typeof config === 'object') {
  12755. var i, j, k;
  12756. for (i in config) {
  12757. object[i] = config[i];
  12758. }
  12759. if (enumerables) {
  12760. for (j = enumerables.length; j--; ) {
  12761. k = enumerables[j];
  12762. if (config.hasOwnProperty(k)) {
  12763. object[k] = config[k];
  12764. }
  12765. }
  12766. }
  12767. }
  12768. }
  12769. return object;
  12770. };
  12771. // Used by Ext.override
  12772. function addInstanceOverrides(target, owner, overrides) {
  12773. var name, value;
  12774. for (name in overrides) {
  12775. if (overrides.hasOwnProperty(name)) {
  12776. value = overrides[name];
  12777. if (typeof value === 'function') {
  12778. if (owner.$className) {
  12779. value.name = owner.$className + '#' + name;
  12780. }
  12781. value.$name = name;
  12782. value.$owner = owner;
  12783. value.$previous = target.hasOwnProperty(name) ? target[name] : // already hooked, so call previous hook
  12784. callOverrideParent;
  12785. }
  12786. // calls by name on prototype
  12787. target[name] = value;
  12788. }
  12789. }
  12790. }
  12791. Ext.buildSettings = Ext.apply({
  12792. baseCSSPrefix: 'x-'
  12793. }, Ext.buildSettings || {});
  12794. Ext.apply(Ext, {
  12795. /**
  12796. * @private
  12797. */
  12798. idSeed: 0,
  12799. /**
  12800. * @private
  12801. */
  12802. idPrefix: 'ext-',
  12803. /**
  12804. * @private
  12805. */
  12806. isRobot: false,
  12807. /**
  12808. * @property {Boolean} isSecure
  12809. * True if the page is running over SSL
  12810. * @readonly
  12811. */
  12812. isSecure: /^https/i.test(window.location.protocol),
  12813. /**
  12814. * `true` to automatically uncache orphaned Ext.Elements periodically. If set to
  12815. * `false`, the application will be required to clean up orphaned Ext.Elements and
  12816. * it's listeners as to not cause memory leakage.
  12817. */
  12818. enableGarbageCollector: false,
  12819. /**
  12820. * True to automatically purge event listeners during garbageCollection.
  12821. */
  12822. enableListenerCollection: true,
  12823. /**
  12824. * @property {String} [name='Ext']
  12825. * <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>
  12826. * <p>This is usually <code>"Ext"</code>, but if a sandboxed build of ExtJS is being used, this will be an alternative name.</p>
  12827. * <p>If code is being generated for use by <code>eval</code> or to create a <code>new Function</code>, and the global instance
  12828. * of Ext must be referenced, this is the name that should be built into the code.</p>
  12829. */
  12830. name: Ext.sandboxName || 'Ext',
  12831. /**
  12832. * @property {Function}
  12833. * A reusable empty function for use as `privates` members.
  12834. *
  12835. * Ext.define('MyClass', {
  12836. * nothing: Ext.emptyFn,
  12837. *
  12838. * privates: {
  12839. * privateNothing: Ext.privateFn
  12840. * }
  12841. * });
  12842. *
  12843. */
  12844. privateFn: privateFn,
  12845. /**
  12846. * @property {Function}
  12847. * A reusable empty function.
  12848. */
  12849. emptyFn: emptyFn,
  12850. /**
  12851. * @property {Function}
  12852. * A reusable identity function that simply returns its first argument.
  12853. */
  12854. identityFn: identityFn,
  12855. /**
  12856. * This indicate the start timestamp of current cycle.
  12857. * It is only reliable during dom-event-initiated cycles and
  12858. * {@link Ext.draw.Animator} initiated cycles.
  12859. */
  12860. frameStartTime: Ext.now(),
  12861. /**
  12862. * This object is initialized prior to loading the framework
  12863. * and contains settings and other information describing the application.
  12864. *
  12865. * For applications built using Sencha Cmd, this is produced from the `"app.json"`
  12866. * file with information extracted from all of the required packages' `"package.json"`
  12867. * files. This can be set to a string when your application is using the
  12868. * (microloader)[#/guide/microloader]. In this case, the string of "foo" will be
  12869. * requested as `"foo.json"` and the object in that JSON file will parsed and set
  12870. * as this object.
  12871. *
  12872. * @cfg {String/Ext.Manifest} manifest
  12873. * @since 5.0.0
  12874. */
  12875. manifest: manifest,
  12876. /**
  12877. * @cfg {Object} [debugConfig]
  12878. * This object is used to enable or disable debugging for classes or namespaces. The
  12879. * default instance looks like this:
  12880. *
  12881. * Ext.debugConfig = {
  12882. * hooks: {
  12883. * '*': true
  12884. * }
  12885. * };
  12886. *
  12887. * Typically applications will set this in their `"app.json"` like so:
  12888. *
  12889. * {
  12890. * "debug": {
  12891. * "hooks": {
  12892. * // Default for all namespaces:
  12893. * '*': true,
  12894. *
  12895. * // Except for Ext namespace which is disabled
  12896. * 'Ext': false,
  12897. *
  12898. * // Except for Ext.layout namespace which is enabled
  12899. * 'Ext.layout': true
  12900. * }
  12901. * }
  12902. * }
  12903. *
  12904. * Alternatively, because this property is consumed very early in the load process of
  12905. * the framework, this can be set in a `script` tag that is defined prior to loading
  12906. * the framework itself.
  12907. *
  12908. * For example, to enable debugging for the `Ext.layout` namespace only:
  12909. *
  12910. * var Ext = Ext || {};
  12911. * Ext.debugConfig = {
  12912. * hooks: {
  12913. * //...
  12914. * }
  12915. * };
  12916. *
  12917. * For any class declared, the longest matching namespace specified determines if its
  12918. * `debugHooks` will be enabled. The default setting is specified by the '*' property.
  12919. *
  12920. * **NOTE:** This option only applies to debug builds. All debugging is disabled in
  12921. * production builds.
  12922. */
  12923. debugConfig: Ext.debugConfig || manifest.debug || {
  12924. hooks: {
  12925. '*': true
  12926. }
  12927. },
  12928. /**
  12929. * @property {Boolean} [enableAria=true] This property is provided for backward
  12930. * compatibility with previous versions of Ext JS. Accessibility is always enabled
  12931. * in Ext JS 6.0+.
  12932. *
  12933. * This property is deprecated. To disable WAI-ARIA compatibility warnings,
  12934. * override `Ext.ariaWarn` function in your application startup code:
  12935. *
  12936. * Ext.application({
  12937. * launch: function() {
  12938. * Ext.ariaWarn = Ext.emptyFn;
  12939. * }
  12940. * });
  12941. *
  12942. * For stricter compatibility with WAI-ARIA requirements, replace `Ext.ariaWarn`
  12943. * with a function that will raise an error instead:
  12944. *
  12945. * Ext.application({
  12946. * launch: function() {
  12947. * Ext.ariaWarn = function(target, msg) {
  12948. * Ext.raise({
  12949. * msg: msg,
  12950. * component: target
  12951. * });
  12952. * };
  12953. * }
  12954. * });
  12955. *
  12956. * @since 6.0.0
  12957. * @deprecated 6.0.2 This property is no longer necessary, so no replacement is required.
  12958. */
  12959. enableAria: true,
  12960. startsWithHashRe: /^#/,
  12961. /**
  12962. * @property {RegExp}
  12963. * @private
  12964. * Regular expression used for validating identifiers.
  12965. */
  12966. validIdRe: /^[a-z_][a-z0-9\-_]*$/i,
  12967. /**
  12968. * @property {String} BLANK_IMAGE_URL
  12969. * URL to a 1x1 transparent gif image used by Ext to create inline icons with
  12970. * CSS background images.
  12971. */
  12972. BLANK_IMAGE_URL: 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
  12973. /**
  12974. * Converts an id (`'foo'`) into an id selector (`'#foo'`). This method is used
  12975. * internally by the framework whenever an id needs to be converted into a selector
  12976. * and is provided as a hook for those that need to escape IDs selectors since,
  12977. * as of Ext 5.0, the framework no longer escapes IDs by default.
  12978. * @private
  12979. * @param {String} id
  12980. * @return {String}
  12981. */
  12982. makeIdSelector: function(id) {
  12983. if (!Ext.validIdRe.test(id)) {
  12984. Ext.raise('Invalid id selector: "' + id + '"');
  12985. }
  12986. return '#' + id;
  12987. },
  12988. /**
  12989. * Generates unique ids. If the object/element is passes and it already has an `id`, it is unchanged.
  12990. * @param {Object} [o] The object to generate an id for.
  12991. * @param {String} [prefix=ext-gen] (optional) The `id` prefix.
  12992. * @return {String} The generated `id`.
  12993. */
  12994. id: function(o, prefix) {
  12995. if (o && o.id) {
  12996. return o.id;
  12997. }
  12998. var id = (prefix || Ext.idPrefix) + (++Ext.idSeed);
  12999. if (o) {
  13000. o.id = id;
  13001. }
  13002. return id;
  13003. },
  13004. /**
  13005. * A reusable function which returns the value of `getId()` called upon a single passed parameter.
  13006. * Useful when creating a {@link Ext.util.MixedCollection} of objects keyed by an identifier returned from a `getId` method.
  13007. */
  13008. returnId: function(o) {
  13009. return o.getId();
  13010. },
  13011. /**
  13012. * A reusable function which returns `true`.
  13013. */
  13014. returnTrue: function() {
  13015. return true;
  13016. },
  13017. /**
  13018. * A zero length string which will pass a truth test. Useful for passing to methods
  13019. * which use a truth test to reject <i>falsy</i> values where a string value must be cleared.
  13020. */
  13021. emptyString: new String(),
  13022. // jshint ignore:line
  13023. /**
  13024. * An immutable empty array if Object.freeze is supported by the browser
  13025. * @since 6.5.0
  13026. * @private
  13027. */
  13028. emptyArray: Object.freeze ? Object.freeze([]) : [],
  13029. /**
  13030. * @property {String} [baseCSSPrefix='x-']
  13031. * The base prefix to use for all `Ext` components. To configure this property, you should use the
  13032. * Ext.buildSettings object before the framework is loaded:
  13033. *
  13034. * Ext.buildSettings = {
  13035. * baseCSSPrefix : 'abc-'
  13036. * };
  13037. *
  13038. * or you can change it before any components are rendered:
  13039. *
  13040. * Ext.baseCSSPrefix = Ext.buildSettings.baseCSSPrefix = 'abc-';
  13041. *
  13042. * This will change what CSS classes components will use and you should
  13043. * then recompile the SASS changing the `$prefix` SASS variable to match.
  13044. */
  13045. baseCSSPrefix: Ext.buildSettings.baseCSSPrefix,
  13046. /**
  13047. * @property {Object} $eventNameMap
  13048. * A map of event names which contained the lower-cased versions of any mixed
  13049. * case event names.
  13050. * @private
  13051. */
  13052. $eventNameMap: {},
  13053. // Vendor-specific events do not work if lower-cased. This regex specifies event
  13054. // prefixes for names that should NOT be lower-cased by Ext.canonicalEventName()
  13055. $vendorEventRe: /^(DOMMouse|Moz.+|MS.+|webkit.+)/,
  13056. // TODO: inlinable function - SDKTOOLS-686
  13057. /**
  13058. * @private
  13059. */
  13060. canonicalEventName: function(name) {
  13061. return Ext.$eventNameMap[name] || (Ext.$eventNameMap[name] = (Ext.$vendorEventRe.test(name) ? name : name.toLowerCase()));
  13062. },
  13063. /**
  13064. * Copies all the properties of config to object if they don't already exist.
  13065. * @param {Object} object The receiver of the properties
  13066. * @param {Object} config The source of the properties
  13067. * @return {Object} returns obj
  13068. */
  13069. applyIf: function(object, config) {
  13070. if (object && config && typeof config === 'object') {
  13071. for (var property in config) {
  13072. if (object[property] === undefined) {
  13073. object[property] = config[property];
  13074. }
  13075. }
  13076. }
  13077. return object;
  13078. },
  13079. /**
  13080. * Destroys all of the given objects. If arrays are passed, the elements of these
  13081. * are destroyed recursively.
  13082. *
  13083. * What it means to "destroy" an object depends on the type of object.
  13084. *
  13085. * * `Array`: Each element of the array is destroyed recursively.
  13086. * * `Object`: Any object with a `destroy` method will have that method called.
  13087. *
  13088. * @param {Mixed...} args Any number of objects or arrays.
  13089. */
  13090. destroy: function() {
  13091. var ln = arguments.length,
  13092. i, arg;
  13093. for (i = 0; i < ln; i++) {
  13094. arg = arguments[i];
  13095. if (arg) {
  13096. if (Ext.isArray(arg)) {
  13097. this.destroy.apply(this, arg);
  13098. } else if (Ext.isFunction(arg.destroy) && !arg.destroyed) {
  13099. arg.destroy();
  13100. }
  13101. }
  13102. }
  13103. return null;
  13104. },
  13105. /**
  13106. * Destroys the specified named members of the given object using `Ext.destroy`. These
  13107. * properties will be set to `null`.
  13108. * @param {Object} object The object who's properties you wish to destroy.
  13109. * @param {String...} args One or more names of the properties to destroy and remove from the object.
  13110. */
  13111. destroyMembers: function(object) {
  13112. for (var ref, name,
  13113. i = 1,
  13114. a = arguments,
  13115. len = a.length; i < len; i++) {
  13116. ref = object[name = a[i]];
  13117. // Avoid adding the property if it does not already exist
  13118. if (ref != null) {
  13119. object[name] = Ext.destroy(ref);
  13120. }
  13121. }
  13122. },
  13123. /**
  13124. * Overrides members of the specified `target` with the given values.
  13125. *
  13126. * If the `target` is a class declared using {@link Ext#define Ext.define}, the
  13127. * `override` method of that class is called (see {@link Ext.Base#override}) given
  13128. * the `overrides`.
  13129. *
  13130. * If the `target` is a function, it is assumed to be a constructor and the contents
  13131. * of `overrides` are applied to its `prototype` using {@link Ext#apply Ext.apply}.
  13132. *
  13133. * If the `target` is an instance of a class declared using {@link Ext#define Ext.define},
  13134. * the `overrides` are applied to only that instance. In this case, methods are
  13135. * specially processed to allow them to use {@link Ext.Base#method!callParent}.
  13136. *
  13137. * var panel = new Ext.Panel({ ... });
  13138. *
  13139. * Ext.override(panel, {
  13140. * initComponent: function () {
  13141. * // extra processing...
  13142. *
  13143. * this.callParent();
  13144. * }
  13145. * });
  13146. *
  13147. * If the `target` is none of these, the `overrides` are applied to the `target`
  13148. * using {@link Ext#apply Ext.apply}.
  13149. *
  13150. * Please refer to {@link Ext#define Ext.define} and {@link Ext.Base#override} for
  13151. * further details.
  13152. *
  13153. * @param {Object} target The target to override.
  13154. * @param {Object} overrides The properties to add or replace on `target`.
  13155. * @method override
  13156. */
  13157. override: function(target, overrides) {
  13158. if (target.$isClass) {
  13159. target.override(overrides);
  13160. } else if (typeof target === 'function') {
  13161. Ext.apply(target.prototype, overrides);
  13162. } else {
  13163. var owner = target.self,
  13164. privates;
  13165. if (owner && owner.$isClass) {
  13166. // if (instance of Ext.define'd class)
  13167. privates = overrides.privates;
  13168. if (privates) {
  13169. overrides = Ext.apply({}, overrides);
  13170. delete overrides.privates;
  13171. addInstanceOverrides(target, owner, privates);
  13172. }
  13173. addInstanceOverrides(target, owner, overrides);
  13174. } else {
  13175. Ext.apply(target, overrides);
  13176. }
  13177. }
  13178. return target;
  13179. },
  13180. /**
  13181. * Returns the given value itself if it's not empty, as described in {@link Ext#isEmpty}; returns the default
  13182. * value (second argument) otherwise.
  13183. *
  13184. * @param {Object} value The value to test.
  13185. * @param {Object} defaultValue The value to return if the original value is empty.
  13186. * @param {Boolean} [allowBlank=false] `true` to allow zero length strings to qualify as non-empty.
  13187. * @return {Object} value, if non-empty, else defaultValue.
  13188. */
  13189. valueFrom: function(value, defaultValue, allowBlank) {
  13190. return Ext.isEmpty(value, allowBlank) ? defaultValue : value;
  13191. },
  13192. /**
  13193. * Returns true if the passed value is empty, false otherwise. The value is deemed to be empty if it is either:
  13194. *
  13195. * - `null`
  13196. * - `undefined`
  13197. * - a zero-length array
  13198. * - a zero-length string (Unless the `allowEmptyString` parameter is set to `true`)
  13199. *
  13200. * @param {Object} value The value to test.
  13201. * @param {Boolean} [allowEmptyString=false] `true` to allow empty strings.
  13202. * @return {Boolean}
  13203. */
  13204. isEmpty: function(value, allowEmptyString) {
  13205. return (value == null) || (!allowEmptyString ? value === '' : false) || (Ext.isArray(value) && value.length === 0);
  13206. },
  13207. /**
  13208. * Returns `true` if the passed value is a JavaScript Array, `false` otherwise.
  13209. *
  13210. * @param {Object} target The target to test.
  13211. * @return {Boolean}
  13212. * @method
  13213. */
  13214. isArray: ('isArray' in Array) ? Array.isArray : function(value) {
  13215. return toString.call(value) === '[object Array]';
  13216. },
  13217. /**
  13218. * Returns `true` if the passed value is a JavaScript Date object, `false` otherwise.
  13219. * @param {Object} obj The object to test.
  13220. * @return {Boolean}
  13221. */
  13222. isDate: function(obj) {
  13223. return toString.call(obj) === '[object Date]';
  13224. },
  13225. /**
  13226. * Returns 'true' if the passed value is a String that matches the MS Date JSON
  13227. * encoding format.
  13228. * @param {String} value The string to test.
  13229. * @return {Boolean}
  13230. */
  13231. isMSDate: function(value) {
  13232. if (!Ext.isString(value)) {
  13233. return false;
  13234. }
  13235. return MSDateRe.test(value);
  13236. },
  13237. /**
  13238. * Returns `true` if the passed value is a JavaScript Object, `false` otherwise.
  13239. * @param {Object} value The value to test.
  13240. * @return {Boolean}
  13241. * @method
  13242. */
  13243. isObject: (toString.call(null) === '[object Object]') ? function(value) {
  13244. // check ownerDocument here as well to exclude DOM nodes
  13245. return value != null && toString.call(value) === '[object Object]' && value.ownerDocument === undefined;
  13246. } : function(value) {
  13247. return toString.call(value) === '[object Object]';
  13248. },
  13249. /**
  13250. * @private
  13251. */
  13252. isSimpleObject: function(value) {
  13253. return value instanceof Object && value.constructor === Object;
  13254. },
  13255. /**
  13256. * Returns `true` if the passed value is a JavaScript 'primitive', a string, number
  13257. * or boolean.
  13258. * @param {Object} value The value to test.
  13259. * @return {Boolean}
  13260. */
  13261. isPrimitive: function(value) {
  13262. var type = typeof value;
  13263. return type === 'string' || type === 'number' || type === 'boolean';
  13264. },
  13265. /**
  13266. * Returns `true` if the passed value is a JavaScript Function, `false` otherwise.
  13267. * @param {Object} value The value to test.
  13268. * @return {Boolean}
  13269. * @method
  13270. */
  13271. isFunction: // Safari 3.x and 4.x returns 'function' for typeof <NodeList>, hence we need to fall back to using
  13272. // Object.prototype.toString (slower)
  13273. (typeof document !== 'undefined' && typeof document.getElementsByTagName('body') === 'function') ? function(value) {
  13274. return !!value && toString.call(value) === '[object Function]';
  13275. } : function(value) {
  13276. return !!value && typeof value === 'function';
  13277. },
  13278. /**
  13279. * Returns `true` if the passed value is a number. Returns `false` for non-finite numbers.
  13280. * @param {Object} value The value to test.
  13281. * @return {Boolean}
  13282. */
  13283. isNumber: function(value) {
  13284. return typeof value === 'number' && isFinite(value);
  13285. },
  13286. /**
  13287. * Validates that a value is numeric.
  13288. * @param {Object} value Examples: 1, '1', '2.34'
  13289. * @return {Boolean} True if numeric, false otherwise
  13290. */
  13291. isNumeric: function(value) {
  13292. return !isNaN(parseFloat(value)) && isFinite(value);
  13293. },
  13294. /**
  13295. * Returns `true `if the passed value is a string.
  13296. * @param {Object} value The value to test.
  13297. * @return {Boolean}
  13298. */
  13299. isString: function(value) {
  13300. return typeof value === 'string';
  13301. },
  13302. /**
  13303. * Returns `true` if the passed value is a boolean.
  13304. *
  13305. * @param {Object} value The value to test.
  13306. * @return {Boolean}
  13307. */
  13308. isBoolean: function(value) {
  13309. return typeof value === 'boolean';
  13310. },
  13311. /**
  13312. * Returns `true` if the passed value is an HTMLElement
  13313. * @param {Object} value The value to test.
  13314. * @return {Boolean}
  13315. */
  13316. isElement: function(value) {
  13317. return value ? value.nodeType === 1 : false;
  13318. },
  13319. /**
  13320. * Returns `true` if the passed value is a TextNode
  13321. * @param {Object} value The value to test.
  13322. * @return {Boolean}
  13323. */
  13324. isTextNode: function(value) {
  13325. return value ? value.nodeName === "#text" : false;
  13326. },
  13327. /**
  13328. * Returns `true` if the passed value is defined.
  13329. * @param {Object} value The value to test.
  13330. * @return {Boolean}
  13331. */
  13332. isDefined: function(value) {
  13333. return typeof value !== 'undefined';
  13334. },
  13335. /**
  13336. * Returns `true` if the passed value is iterable, that is, if elements of it are addressable using array
  13337. * notation with numeric indices, `false` otherwise.
  13338. *
  13339. * Arrays and function `arguments` objects are iterable. Also HTML collections such as `NodeList` and `HTMLCollection'
  13340. * are iterable.
  13341. *
  13342. * @param {Object} value The value to test
  13343. * @return {Boolean}
  13344. */
  13345. isIterable: function(value) {
  13346. // To be iterable, the object must have a numeric length property and must not be a string or function.
  13347. if (!value || typeof value.length !== 'number' || typeof value === 'string' || Ext.isFunction(value)) {
  13348. return false;
  13349. }
  13350. // Certain "standard" collections in IE (such as document.images) do not offer the correct
  13351. // Javascript Object interface; specifically, they lack the propertyIsEnumerable method.
  13352. // And the item property while it does exist is not typeof "function"
  13353. if (!value.propertyIsEnumerable) {
  13354. return !!value.item;
  13355. }
  13356. // If it is a regular, interrogatable JS object (not an IE ActiveX object), then...
  13357. // If it has its own property called "length", but not enumerable, it's iterable
  13358. if (value.hasOwnProperty('length') && !value.propertyIsEnumerable('length')) {
  13359. return true;
  13360. }
  13361. // Test against whitelist which includes known iterable collection types
  13362. return iterableRe.test(toString.call(value));
  13363. },
  13364. /**
  13365. * This method returns `true` if debug is enabled for the specified class. This is
  13366. * done by checking the `Ext.debugConfig.hooks` config for the closest match to the
  13367. * given `className`.
  13368. * @param {String} className The name of the class.
  13369. * @return {Boolean} `true` if debug is enabled for the specified class.
  13370. * @method
  13371. */
  13372. isDebugEnabled: function(className, defaultEnabled) {
  13373. var debugConfig = Ext.debugConfig.hooks;
  13374. if (debugConfig.hasOwnProperty(className)) {
  13375. return debugConfig[className];
  13376. }
  13377. var enabled = debugConfig['*'],
  13378. prefixLength = 0;
  13379. if (defaultEnabled !== undefined) {
  13380. enabled = defaultEnabled;
  13381. }
  13382. if (!className) {
  13383. return enabled;
  13384. }
  13385. for (var prefix in debugConfig) {
  13386. var value = debugConfig[prefix];
  13387. // if prefix=='Ext' match 'Ext.foo.Bar' but not 'Ext4.foo.Bar'
  13388. if (className.charAt(prefix.length) === '.') {
  13389. if (className.substring(0, prefix.length) === prefix) {
  13390. if (prefixLength < prefix.length) {
  13391. prefixLength = prefix.length;
  13392. enabled = value;
  13393. }
  13394. }
  13395. }
  13396. }
  13397. return enabled;
  13398. } || emptyFn,
  13399. /**
  13400. * Clone simple variables including array, {}-like objects, DOM nodes and Date without keeping the old reference.
  13401. * A reference for the object itself is returned if it's not a direct descendant of Object. For model cloning,
  13402. * see {@link Ext.data.Model#copy Model.copy}.
  13403. *
  13404. * @param {Object} item The variable to clone
  13405. * @param {Boolean} [cloneDom=true] `true` to clone DOM nodes.
  13406. * @return {Object} clone
  13407. */
  13408. clone: function(item, cloneDom) {
  13409. if (item == null) {
  13410. return item;
  13411. }
  13412. // DOM nodes
  13413. // TODO proxy this to Ext.Element.clone to handle automatic id attribute changing
  13414. // recursively
  13415. if (cloneDom !== false && item.nodeType && item.cloneNode) {
  13416. return item.cloneNode(true);
  13417. }
  13418. var type = toString.call(item),
  13419. i, j, k, clone, key;
  13420. // Date
  13421. if (type === '[object Date]') {
  13422. return new Date(item.getTime());
  13423. }
  13424. // Array
  13425. if (type === '[object Array]') {
  13426. i = item.length;
  13427. clone = [];
  13428. while (i--) {
  13429. clone[i] = Ext.clone(item[i], cloneDom);
  13430. }
  13431. }
  13432. // Object
  13433. else if (type === '[object Object]' && item.constructor === Object) {
  13434. clone = {};
  13435. for (key in item) {
  13436. clone[key] = Ext.clone(item[key], cloneDom);
  13437. }
  13438. if (enumerables) {
  13439. for (j = enumerables.length; j--; ) {
  13440. k = enumerables[j];
  13441. if (item.hasOwnProperty(k)) {
  13442. clone[k] = item[k];
  13443. }
  13444. }
  13445. }
  13446. }
  13447. return clone || item;
  13448. },
  13449. /**
  13450. * @private
  13451. * Generate a unique reference of Ext in the global scope, useful for sandboxing
  13452. */
  13453. getUniqueGlobalNamespace: function() {
  13454. var uniqueGlobalNamespace = this.uniqueGlobalNamespace,
  13455. i;
  13456. if (uniqueGlobalNamespace === undefined) {
  13457. i = 0;
  13458. do {
  13459. uniqueGlobalNamespace = 'ExtBox' + (++i);
  13460. } while (global[uniqueGlobalNamespace] !== undefined);
  13461. global[uniqueGlobalNamespace] = Ext;
  13462. this.uniqueGlobalNamespace = uniqueGlobalNamespace;
  13463. }
  13464. return uniqueGlobalNamespace;
  13465. },
  13466. /**
  13467. * @private
  13468. */
  13469. functionFactoryCache: {},
  13470. cacheableFunctionFactory: function() {
  13471. var me = this,
  13472. args = Array.prototype.slice.call(arguments),
  13473. cache = me.functionFactoryCache,
  13474. idx, fn, ln;
  13475. if (Ext.isSandboxed) {
  13476. ln = args.length;
  13477. if (ln > 0) {
  13478. ln--;
  13479. args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
  13480. }
  13481. }
  13482. idx = args.join('');
  13483. fn = cache[idx];
  13484. if (!fn) {
  13485. fn = Function.prototype.constructor.apply(Function.prototype, args);
  13486. cache[idx] = fn;
  13487. }
  13488. return fn;
  13489. },
  13490. functionFactory: function() {
  13491. var args = Array.prototype.slice.call(arguments),
  13492. ln;
  13493. if (Ext.isSandboxed) {
  13494. ln = args.length;
  13495. if (ln > 0) {
  13496. ln--;
  13497. args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
  13498. }
  13499. }
  13500. return Function.prototype.constructor.apply(Function.prototype, args);
  13501. },
  13502. /**
  13503. * @private
  13504. */
  13505. Logger: {
  13506. log: function(message, priority) {
  13507. if (message && global.console) {
  13508. if (!priority || !(priority in global.console)) {
  13509. priority = 'log';
  13510. }
  13511. message = '[' + priority.toUpperCase() + '] ' + message;
  13512. global.console[priority](message);
  13513. }
  13514. },
  13515. verbose: function(message) {
  13516. this.log(message, 'verbose');
  13517. },
  13518. info: function(message) {
  13519. this.log(message, 'info');
  13520. },
  13521. warn: function(message) {
  13522. this.log(message, 'warn');
  13523. },
  13524. error: function(message) {
  13525. throw new Error(message);
  13526. },
  13527. deprecate: function(message) {
  13528. this.log(message, 'warn');
  13529. }
  13530. } || {
  13531. verbose: emptyFn,
  13532. log: emptyFn,
  13533. info: emptyFn,
  13534. warn: emptyFn,
  13535. error: function(message) {
  13536. throw new Error(message);
  13537. },
  13538. deprecate: emptyFn
  13539. },
  13540. ariaWarn: function(target, msg) {
  13541. // The checks still can be disabled by setting Ext.enableAria to false;
  13542. // this is for backwards compatibility. Also make sure we're not running
  13543. // under the slicer, warnings are pointless in that case.
  13544. if (Ext.enableAria && !Ext.slicer) {
  13545. if (!Ext.ariaWarn.first) {
  13546. Ext.ariaWarn.first = true;
  13547. Ext.log.warn("WAI-ARIA compatibility warnings can be suppressed " + "by adding the following to application startup code:");
  13548. Ext.log.warn(" Ext.ariaWarn = Ext.emptyFn;");
  13549. }
  13550. Ext.log.warn({
  13551. msg: msg,
  13552. dump: target
  13553. });
  13554. }
  13555. },
  13556. /**
  13557. * @private
  13558. */
  13559. getElementById: function(id) {
  13560. return document.getElementById(id);
  13561. },
  13562. /**
  13563. * @member Ext
  13564. * @private
  13565. */
  13566. splitAndUnescape: (function() {
  13567. var cache = {};
  13568. return function(origin, delimiter) {
  13569. if (!origin) {
  13570. return [];
  13571. } else if (!delimiter) {
  13572. return [
  13573. origin
  13574. ];
  13575. }
  13576. var replaceRe = cache[delimiter] || (cache[delimiter] = new RegExp('\\\\' + delimiter, 'g')),
  13577. result = [],
  13578. parts, part;
  13579. parts = origin.split(delimiter);
  13580. while ((part = parts.shift()) !== undefined) {
  13581. // If any of the parts ends with the delimiter that means
  13582. // the delimiter was escaped and the split was invalid. Roll back.
  13583. while (part.charAt(part.length - 1) === '\\' && parts.length > 0) {
  13584. part = part + delimiter + parts.shift();
  13585. }
  13586. // Now that we have split the parts, unescape the delimiter char
  13587. part = part.replace(replaceRe, delimiter);
  13588. result.push(part);
  13589. }
  13590. return result;
  13591. };
  13592. })(),
  13593. /**
  13594. * This is the target of the user-supplied `Ext.elevateFunction`. It wraps the
  13595. * call to a function and concludes by calling {@link Ext#fireIdle}.
  13596. * @since 6.5.1
  13597. * @private
  13598. */
  13599. doElevate: function() {
  13600. var fn = elevateFn,
  13601. args = elevateArgs,
  13602. scope = elevateScope;
  13603. // We really should never re-enter here, but we'll latch these vars just
  13604. // in case.
  13605. elevateFn = elevateArgs = elevateScope = null;
  13606. elevateRet = args ? fn.apply(scope, args) : fn.call(scope);
  13607. // Be sure to fire the idle event while elevated or its handlers will
  13608. // be running in an unprivileged context.
  13609. Ext.fireIdle();
  13610. },
  13611. /**
  13612. * Runs the given `fn` directly or using the user-provided `Ext.elevateFunction`
  13613. * (if present). After calling the `fn` the global `idle` event is fired using
  13614. * the {@link Ext#fireIdle} method.
  13615. *
  13616. * @param {Function} fn
  13617. * @param {Object} [scope]
  13618. * @param {Array} [args]
  13619. * @param {Object} [timer]
  13620. * @return {Mixed}
  13621. * @since 6.5.1
  13622. * @private
  13623. */
  13624. elevate: function(fn, scope, args, timer) {
  13625. var ret;
  13626. if (args && !args.length) {
  13627. args = null;
  13628. }
  13629. Ext._suppressIdle = false;
  13630. if (timer) {
  13631. timer.tick();
  13632. }
  13633. if (Ext.elevateFunction) {
  13634. elevateFn = fn;
  13635. elevateScope = scope;
  13636. elevateArgs = args;
  13637. // We reuse the same fn here to avoid GC pressure.
  13638. Ext.elevateFunction(Ext.doElevate);
  13639. ret = elevateRet;
  13640. elevateRet = null;
  13641. } else {
  13642. ret = args ? fn.apply(scope, args) : fn.call(scope);
  13643. Ext.fireIdle();
  13644. }
  13645. if (timer) {
  13646. timer.tock();
  13647. }
  13648. return ret;
  13649. },
  13650. Timer: {
  13651. all: {},
  13652. track: false,
  13653. captureStack: true,
  13654. created: function(kind, id, info) {
  13655. if (!Ext.Timer.track) {
  13656. return null;
  13657. }
  13658. var timer = Ext.apply({
  13659. kind: kind,
  13660. id: id,
  13661. done: false,
  13662. firing: false,
  13663. creator: Ext.Timer.captureStack ? new Error().stack : null,
  13664. tick: Ext.Timer.tick,
  13665. tock: Ext.Timer.tock
  13666. }, info);
  13667. var timers = Ext.Timer.all[kind] || (Ext.Timer.all[kind] = {});
  13668. timers[timer.id] = timer;
  13669. if (Ext.Timer.hook) {
  13670. Ext.Timer.hook(timer);
  13671. }
  13672. return timer;
  13673. },
  13674. get: function(id, kind) {
  13675. kind = kind || 'timeout';
  13676. var timers = Ext.Timer.all[kind];
  13677. return timers && timers[id] || null;
  13678. },
  13679. cancel: function(kind, id) {
  13680. var timers = Ext.Timer.all[kind];
  13681. var timer = timers && timers[id];
  13682. if (timer) {
  13683. timer.cancelled = true;
  13684. delete timers[id];
  13685. }
  13686. },
  13687. tick: function() {
  13688. if (Ext.Timer.firing) {
  13689. // One reason for Ext.Timer.firing to get stuck is exception thrown
  13690. // in timer handler. In that case the timer is never tock()ed
  13691. // and will be left hanging. Just clean it up.
  13692. Ext.log.error('Previous timer state not cleaned up properly: ' + Ext.Timer.firing.creator);
  13693. }
  13694. if (this.kind !== 'interval') {
  13695. this.done = true;
  13696. delete Ext.Timer.all[this.kind][this.id];
  13697. }
  13698. this.firing = true;
  13699. Ext.Timer.firing = this;
  13700. },
  13701. tock: function() {
  13702. this.firing = false;
  13703. if (Ext.Timer.firing === this) {
  13704. Ext.Timer.firing = null;
  13705. }
  13706. }
  13707. },
  13708. /**
  13709. * @private
  13710. */
  13711. getExpando: function(target, id) {
  13712. var expandos = target.$expandos;
  13713. return expandos && expandos[id] || null;
  13714. },
  13715. /**
  13716. * @private
  13717. */
  13718. setExpando: function(target, id, value) {
  13719. var expandos = target.$expandos;
  13720. if (value !== undefined) {
  13721. (expandos || (target.$expandos = {}))[id] = value;
  13722. } else if (expandos) {
  13723. delete expandos[id];
  13724. }
  13725. }
  13726. });
  13727. // Ext.apply(Ext
  13728. Ext.returnTrue.$nullFn = Ext.returnId.$nullFn = true;
  13729. }());
  13730. // @override Ext
  13731. // This file is order extremely early (typically right after Ext.js) due to the
  13732. // above Cmd directive. This ensures that the "modern" and "classic" platform tags
  13733. // are properly set up as soon as possible.
  13734. Ext.platformTags.modern = !(Ext.platformTags.classic = Ext.isClassic = true);
  13735. /**
  13736. * A helper class for the native JavaScript Error object that adds a few useful capabilities for handling
  13737. * errors in an application. When you use Ext.Error to {@link #raise} an error from within any class that
  13738. * uses the Class System, the Error class can automatically add the source class and method from which
  13739. * the error was raised. It also includes logic to automatically log the error to the console, if available,
  13740. * with additional metadata about the error. In all cases, the error will always be thrown at the end so that
  13741. * execution will halt.
  13742. *
  13743. * Ext.Error also offers a global error {@link #handle handling} method that can be overridden in order to
  13744. * handle application-wide errors in a single spot. You can optionally {@link #ignore} errors altogether,
  13745. * although in a real application it's usually a better idea to override the handling function and perform
  13746. * logging or some other method of reporting the errors in a way that is meaningful to the application.
  13747. *
  13748. * At its simplest you can simply raise an error as a simple string from within any code:
  13749. *
  13750. * Example usage:
  13751. *
  13752. * Ext.raise('Something bad happened!');
  13753. *
  13754. * If raised from plain JavaScript code, the error will be logged to the console (if available) and the message
  13755. * displayed. In most cases however you'll be raising errors from within a class, and it may often be useful to add
  13756. * additional metadata about the error being raised. The {@link #raise} method can also take a config object.
  13757. * In this form the `msg` attribute becomes the error description, and any other data added to the config gets
  13758. * added to the error object and, if the console is available, logged to the console for inspection.
  13759. *
  13760. * Example usage:
  13761. *
  13762. * Ext.define('Ext.Foo', {
  13763. * doSomething: function(option){
  13764. * if (someCondition === false) {
  13765. * Ext.raise({
  13766. * msg: 'You cannot do that!',
  13767. * option: option, // whatever was passed into the method
  13768. * 'error code': 100 // other arbitrary info
  13769. * });
  13770. * }
  13771. * }
  13772. * });
  13773. *
  13774. * If a console is available (that supports the `console.dir` function) you'll see console output like:
  13775. *
  13776. * An error was raised with the following data:
  13777. * option: Object { foo: "bar"}
  13778. * foo: "bar"
  13779. * error code: 100
  13780. * msg: "You cannot do that!"
  13781. * sourceClass: "Ext.Foo"
  13782. * sourceMethod: "doSomething"
  13783. *
  13784. * uncaught exception: You cannot do that!
  13785. *
  13786. * As you can see, the error will report exactly where it was raised and will include as much information as the
  13787. * raising code can usefully provide.
  13788. *
  13789. * If you want to handle all application errors globally you can simply override the static {@link #handle} method
  13790. * and provide whatever handling logic you need. If the method returns true then the error is considered handled
  13791. * and will not be thrown to the browser. If anything but true is returned then the error will be thrown normally.
  13792. *
  13793. * Example usage:
  13794. *
  13795. * Ext.Error.handle = function(err) {
  13796. * if (err.someProperty == 'NotReallyAnError') {
  13797. * // maybe log something to the application here if applicable
  13798. * return true;
  13799. * }
  13800. * // any non-true return value (including none) will cause the error to be thrown
  13801. * }
  13802. *
  13803. * @class Ext.Error
  13804. */
  13805. (function() {
  13806. // @define Ext.lang.Error
  13807. // @define Ext.Error
  13808. // @require Ext
  13809. function toString() {
  13810. var me = this,
  13811. cls = me.sourceClass,
  13812. method = me.sourceMethod,
  13813. msg = me.msg;
  13814. if (method) {
  13815. if (msg) {
  13816. method += '(): ';
  13817. method += msg;
  13818. } else {
  13819. method += '()';
  13820. }
  13821. }
  13822. if (cls) {
  13823. method = method ? (cls + '.' + method) : cls;
  13824. }
  13825. return method || msg || '';
  13826. }
  13827. Ext.Error = function(config) {
  13828. if (Ext.isString(config)) {
  13829. config = {
  13830. msg: config
  13831. };
  13832. }
  13833. var error = new Error();
  13834. Ext.apply(error, config);
  13835. error.message = error.message || error.msg;
  13836. // 'message' is standard ('msg' is non-standard)
  13837. // note: the above does not work in old WebKit (me.message is readonly) (Safari 4)
  13838. error.toString = toString;
  13839. return error;
  13840. };
  13841. Ext.apply(Ext.Error, {
  13842. /**
  13843. * @property {Boolean} ignore
  13844. * Static flag that can be used to globally disable error reporting to the browser if set to true
  13845. * (defaults to false). Note that if you ignore Ext errors it's likely that some other code may fail
  13846. * and throw a native JavaScript error thereafter, so use with caution. In most cases it will probably
  13847. * be preferable to supply a custom error {@link #handle handling} function instead.
  13848. *
  13849. * Example usage:
  13850. *
  13851. * Ext.Error.ignore = true;
  13852. *
  13853. * @static
  13854. */
  13855. ignore: false,
  13856. /**
  13857. * This method is called internally by {@link Ext#raise}. Application code should
  13858. * call {@link Ext#raise} instead of calling this method directly.
  13859. *
  13860. * @static
  13861. * @deprecated 6.0.0 Use {@link Ext#raise} instead.
  13862. */
  13863. raise: function(err) {
  13864. err = err || {};
  13865. if (Ext.isString(err)) {
  13866. err = {
  13867. msg: err
  13868. };
  13869. }
  13870. var me = this,
  13871. method = me.raise.caller,
  13872. msg, name;
  13873. if (method === Ext.raise) {
  13874. method = method.caller;
  13875. }
  13876. if (method) {
  13877. if (!err.sourceMethod && (name = method.$name)) {
  13878. err.sourceMethod = name;
  13879. }
  13880. if (!err.sourceClass && (name = method.$owner) && (name = name.$className)) {
  13881. err.sourceClass = name;
  13882. }
  13883. }
  13884. if (me.handle(err) !== true) {
  13885. msg = toString.call(err);
  13886. Ext.log({
  13887. msg: msg,
  13888. level: 'error',
  13889. dump: err,
  13890. stack: true
  13891. });
  13892. throw new Ext.Error(err);
  13893. }
  13894. },
  13895. /**
  13896. * Globally handle any Ext errors that may be raised, optionally providing custom logic to
  13897. * handle different errors individually. Return true from the function to bypass throwing the
  13898. * error to the browser, otherwise the error will be thrown and execution will halt.
  13899. *
  13900. * Example usage:
  13901. *
  13902. * Ext.Error.handle = function(err) {
  13903. * if (err.someProperty == 'NotReallyAnError') {
  13904. * // maybe log something to the application here if applicable
  13905. * return true;
  13906. * }
  13907. * // any non-true return value (including none) will cause the error to be thrown
  13908. * }
  13909. *
  13910. * @param {Object} err The error being raised. It will contain any attributes that were originally
  13911. * raised with it, plus properties about the method and class from which the error originated
  13912. * (if raised from a class that uses the Class System).
  13913. * @static
  13914. */
  13915. handle: function() {
  13916. return this.ignore;
  13917. }
  13918. });
  13919. })();
  13920. /**
  13921. * Create a function that will throw an error if called (in debug mode) with a message that
  13922. * indicates the method has been removed.
  13923. * @param {String} suggestion Optional text to include in the message (a workaround perhaps).
  13924. * @return {Function} The generated function.
  13925. * @private
  13926. */
  13927. Ext.deprecated = function(suggestion) {
  13928. if (!suggestion) {
  13929. suggestion = '';
  13930. }
  13931. function fail() {
  13932. Ext.raise('The method "' + fail.$owner.$className + '.' + fail.$name + '" has been removed. ' + suggestion);
  13933. }
  13934. return fail;
  13935. return Ext.emptyFn;
  13936. };
  13937. /**
  13938. * Raise an error that can include additional data and supports automatic console logging
  13939. * if available. You can pass a string error message or an object with the `msg` attribute
  13940. * which will be used as the error message. The object can contain any other name-value
  13941. * attributes (or objects) to be logged along with the error.
  13942. *
  13943. * Note that after displaying the error message a JavaScript error will ultimately be
  13944. * thrown so that execution will halt.
  13945. *
  13946. * Example usage:
  13947. *
  13948. * Ext.raise('A simple string error message');
  13949. *
  13950. * // or...
  13951. *
  13952. * Ext.define('Ext.Foo', {
  13953. * doSomething: function(option){
  13954. * if (someCondition === false) {
  13955. * Ext.raise({
  13956. * msg: 'You cannot do that!',
  13957. * option: option, // whatever was passed into the method
  13958. * code: 100 // other arbitrary info
  13959. * });
  13960. * }
  13961. * }
  13962. * });
  13963. *
  13964. * @param {String/Object} err The error message string, or an object containing the
  13965. * attribute "msg" that will be used as the error message. Any other data included in the
  13966. * object will also be logged to the browser console, if available.
  13967. * @method raise
  13968. * @member Ext
  13969. */
  13970. Ext.raise = function() {
  13971. Ext.Error.raise.apply(Ext.Error, arguments);
  13972. };
  13973. /*
  13974. * This mechanism is used to notify the user of the first error encountered on the page. In
  13975. * most cases errors go unobserved especially on IE. This mechanism pushes this information
  13976. * to the status bar so that users don't miss it.
  13977. */
  13978. (function(skipNotify) {
  13979. if (skipNotify || typeof window === 'undefined') {
  13980. return;
  13981. }
  13982. // build system or some such environment...
  13983. var last = 0,
  13984. // This method is called to notify the user of the current error status.
  13985. notify = function() {
  13986. var cnt = Ext.log && Ext.log.counters,
  13987. n = cnt && (cnt.error + cnt.warn + cnt.info + cnt.log),
  13988. msg;
  13989. // Put log counters to the status bar (for most browsers):
  13990. if (n && last !== n) {
  13991. msg = [];
  13992. if (cnt.error) {
  13993. msg.push('Errors: ' + cnt.error);
  13994. }
  13995. if (cnt.warn) {
  13996. msg.push('Warnings: ' + cnt.warn);
  13997. }
  13998. if (cnt.info) {
  13999. msg.push('Info: ' + cnt.info);
  14000. }
  14001. if (cnt.log) {
  14002. msg.push('Log: ' + cnt.log);
  14003. }
  14004. window.status = '*** ' + msg.join(' -- ');
  14005. last = n;
  14006. }
  14007. };
  14008. // Allow unit tests to skip this when checking for dangling timers
  14009. notify.$skipTimerCheck = true;
  14010. // window.onerror sounds ideal but it prevents the built-in error dialog from doing
  14011. // its (better) thing. We deliberately use setInterval() here instead of going with
  14012. // Ext.interval() to keep it basic and simple.
  14013. setInterval(notify, 1000);
  14014. }(!!window.__UNIT_TESTING__));
  14015. /**
  14016. * @class Ext.Array
  14017. * @singleton
  14018. *
  14019. * A set of useful static methods to deal with arrays; provide missing methods for
  14020. * older browsers.
  14021. */
  14022. Ext.Array = (function() {
  14023. // @define Ext.lang.Array
  14024. // @define Ext.Array
  14025. // @require Ext
  14026. // @require Ext.lang.Error
  14027. var arrayPrototype = Array.prototype,
  14028. slice = arrayPrototype.slice,
  14029. supportsSplice = (function() {
  14030. var array = [],
  14031. lengthBefore,
  14032. j = 20;
  14033. if (!array.splice) {
  14034. return false;
  14035. }
  14036. // This detects a bug in IE8 splice method:
  14037. // see http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/6e946d03-e09f-4b22-a4dd-cd5e276bf05a/
  14038. while (j--) {
  14039. array.push("A");
  14040. }
  14041. 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");
  14042. lengthBefore = array.length;
  14043. //41
  14044. array.splice(13, 0, "XXX");
  14045. // add one element
  14046. if (lengthBefore + 1 !== array.length) {
  14047. return false;
  14048. }
  14049. // end IE8 bug
  14050. return true;
  14051. }()),
  14052. supportsIndexOf = 'indexOf' in arrayPrototype,
  14053. supportsSliceOnNodeList = true;
  14054. // Sort an array using the comparator, but if the comparator returns zero, use the objects' original indices to tiebreak
  14055. // This results in a stable sort.
  14056. function stableSort(array, userComparator) {
  14057. var len = array.length,
  14058. indices = new Array(len),
  14059. i;
  14060. // generate 0-n index map from original array
  14061. for (i = 0; i < len; i++) {
  14062. indices[i] = i;
  14063. }
  14064. // Sort indices array using a comparator which compares the original values at the two indices, and uses those indices as a tiebreaker
  14065. indices.sort(function(index1, index2) {
  14066. return userComparator(array[index1], array[index2]) || (index1 - index2);
  14067. });
  14068. // Reconsitute a sorted array using the array that the indices have been sorted into
  14069. for (i = 0; i < len; i++) {
  14070. indices[i] = array[indices[i]];
  14071. }
  14072. // Rebuild the original array
  14073. for (i = 0; i < len; i++) {
  14074. array[i] = indices[i];
  14075. }
  14076. return array;
  14077. }
  14078. try {
  14079. // IE 6 - 8 will throw an error when using Array.prototype.slice on NodeList
  14080. if (typeof document !== 'undefined') {
  14081. slice.call(document.getElementsByTagName('body'));
  14082. }
  14083. } catch (e) {
  14084. supportsSliceOnNodeList = false;
  14085. }
  14086. var fixArrayIndex = function(array, index) {
  14087. return (index < 0) ? Math.max(0, array.length + index) : Math.min(array.length, index);
  14088. },
  14089. /*
  14090. Does the same work as splice, but with a slightly more convenient signature. The splice
  14091. method has bugs in IE8, so this is the implementation we use on that platform.
  14092. The rippling of items in the array can be tricky. Consider two use cases:
  14093. index=2
  14094. removeCount=2
  14095. /=====\
  14096. +---+---+---+---+---+---+---+---+
  14097. | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
  14098. +---+---+---+---+---+---+---+---+
  14099. / \/ \/ \/ \
  14100. / /\ /\ /\ \
  14101. / / \/ \/ \ +--------------------------+
  14102. / / /\ /\ +--------------------------+ \
  14103. / / / \/ +--------------------------+ \ \
  14104. / / / /+--------------------------+ \ \ \
  14105. / / / / \ \ \ \
  14106. v v v v v v v v
  14107. +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
  14108. | 0 | 1 | 4 | 5 | 6 | 7 | | 0 | 1 | a | b | c | 4 | 5 | 6 | 7 |
  14109. +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
  14110. A B \=========/
  14111. insert=[a,b,c]
  14112. In case A, it is obvious that copying of [4,5,6,7] must be left-to-right so
  14113. that we don't end up with [0,1,6,7,6,7]. In case B, we have the opposite; we
  14114. must go right-to-left or else we would end up with [0,1,a,b,c,4,4,4,4].
  14115. */
  14116. replaceSim = function(array, index, removeCount, insert) {
  14117. var add = insert ? insert.length : 0,
  14118. length = array.length,
  14119. pos = fixArrayIndex(array, index);
  14120. // we try to use Array.push when we can for efficiency...
  14121. if (pos === length) {
  14122. if (add) {
  14123. array.push.apply(array, insert);
  14124. }
  14125. } else {
  14126. var remove = Math.min(removeCount, length - pos),
  14127. tailOldPos = pos + remove,
  14128. tailNewPos = tailOldPos + add - remove,
  14129. tailCount = length - tailOldPos,
  14130. lengthAfterRemove = length - remove,
  14131. i;
  14132. if (tailNewPos < tailOldPos) {
  14133. // case A
  14134. for (i = 0; i < tailCount; ++i) {
  14135. array[tailNewPos + i] = array[tailOldPos + i];
  14136. }
  14137. } else if (tailNewPos > tailOldPos) {
  14138. // case B
  14139. for (i = tailCount; i--; ) {
  14140. array[tailNewPos + i] = array[tailOldPos + i];
  14141. }
  14142. }
  14143. // else, add == remove (nothing to do)
  14144. if (add && pos === lengthAfterRemove) {
  14145. array.length = lengthAfterRemove;
  14146. // truncate array
  14147. array.push.apply(array, insert);
  14148. } else {
  14149. array.length = lengthAfterRemove + add;
  14150. // reserves space
  14151. for (i = 0; i < add; ++i) {
  14152. array[pos + i] = insert[i];
  14153. }
  14154. }
  14155. }
  14156. return array;
  14157. },
  14158. replaceNative = function(array, index, removeCount, insert) {
  14159. if (insert && insert.length) {
  14160. // Inserting at index zero with no removing: use unshift
  14161. if (index === 0 && !removeCount) {
  14162. array.unshift.apply(array, insert);
  14163. }
  14164. // Inserting/replacing in middle of array
  14165. else if (index < array.length) {
  14166. array.splice.apply(array, [
  14167. index,
  14168. removeCount
  14169. ].concat(insert));
  14170. } else // Appending to array
  14171. {
  14172. array.push.apply(array, insert);
  14173. }
  14174. } else {
  14175. array.splice(index, removeCount);
  14176. }
  14177. return array;
  14178. },
  14179. eraseSim = function(array, index, removeCount) {
  14180. return replaceSim(array, index, removeCount);
  14181. },
  14182. eraseNative = function(array, index, removeCount) {
  14183. array.splice(index, removeCount);
  14184. return array;
  14185. },
  14186. spliceSim = function(array, index, removeCount) {
  14187. var len = arguments.length,
  14188. pos = fixArrayIndex(array, index),
  14189. removed;
  14190. if (len < 3) {
  14191. removeCount = array.length - pos;
  14192. }
  14193. removed = array.slice(index, fixArrayIndex(array, pos + removeCount));
  14194. if (len < 4) {
  14195. replaceSim(array, pos, removeCount);
  14196. } else {
  14197. replaceSim(array, pos, removeCount, slice.call(arguments, 3));
  14198. }
  14199. return removed;
  14200. },
  14201. spliceNative = function(array) {
  14202. return array.splice.apply(array, slice.call(arguments, 1));
  14203. },
  14204. erase = supportsSplice ? eraseNative : eraseSim,
  14205. replace = supportsSplice ? replaceNative : replaceSim,
  14206. splice = supportsSplice ? spliceNative : spliceSim,
  14207. // NOTE: from here on, use erase, replace or splice (not native methods)...
  14208. ExtArray = {
  14209. /**
  14210. * This method returns the index that a given item would be inserted into the
  14211. * given (sorted) `array`. Note that the given `item` may or may not be in the
  14212. * array. This method will return the index of where the item *should* be.
  14213. *
  14214. * For example:
  14215. *
  14216. * var array = [ 'A', 'D', 'G', 'K', 'O', 'R', 'X' ];
  14217. * var index = Ext.Array.binarySearch(array, 'E');
  14218. *
  14219. * console.log('index: ' + index);
  14220. * // logs "index: 2"
  14221. *
  14222. * array.splice(index, 0, 'E');
  14223. *
  14224. * console.log('array : ' + array.join(''));
  14225. * // logs "array: ADEGKORX"
  14226. *
  14227. * @param {Object[]} array The array to search.
  14228. * @param {Object} item The item that you want to insert into the `array`.
  14229. * @param {Number} [begin=0] The first index in the `array` to consider.
  14230. * @param {Number} [end=array.length] The index that marks the end of the range
  14231. * to consider. The item at this index is *not* considered.
  14232. * @param {Function} [compareFn] The comparison function that matches the sort
  14233. * order of the `array`. The default `compareFn` compares items using less-than
  14234. * and greater-than operators.
  14235. * @return {Number} The index for the given item in the given array based on
  14236. * the current sorters.
  14237. */
  14238. binarySearch: function(array, item, begin, end, compareFn) {
  14239. var length = array.length,
  14240. middle, comparison;
  14241. if (begin instanceof Function) {
  14242. compareFn = begin;
  14243. begin = 0;
  14244. end = length;
  14245. } else if (end instanceof Function) {
  14246. compareFn = end;
  14247. end = length;
  14248. } else {
  14249. if (begin === undefined) {
  14250. begin = 0;
  14251. }
  14252. if (end === undefined) {
  14253. end = length;
  14254. }
  14255. compareFn = compareFn || ExtArray.lexicalCompare;
  14256. }
  14257. --end;
  14258. while (begin <= end) {
  14259. middle = (begin + end) >> 1;
  14260. comparison = compareFn(item, array[middle]);
  14261. if (comparison >= 0) {
  14262. begin = middle + 1;
  14263. } else if (comparison < 0) {
  14264. end = middle - 1;
  14265. }
  14266. }
  14267. return begin;
  14268. },
  14269. defaultCompare: function(lhs, rhs) {
  14270. return (lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0);
  14271. },
  14272. // Default comparator to use when no comparator is specified for the sort method.
  14273. // Javascript sort does LEXICAL comparison.
  14274. lexicalCompare: function(lhs, rhs) {
  14275. lhs = String(lhs);
  14276. rhs = String(rhs);
  14277. return (lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0);
  14278. },
  14279. /**
  14280. * Iterates an array or an iterable value and invoke the given callback function for each item.
  14281. *
  14282. * var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'];
  14283. *
  14284. * Ext.Array.each(countries, function(name, index, countriesItSelf) {
  14285. * console.log(name);
  14286. * });
  14287. *
  14288. * var sum = function() {
  14289. * var sum = 0;
  14290. *
  14291. * Ext.Array.each(arguments, function(value) {
  14292. * sum += value;
  14293. * });
  14294. *
  14295. * return sum;
  14296. * };
  14297. *
  14298. * sum(1, 2, 3); // returns 6
  14299. *
  14300. * The iteration can be stopped by returning `false` from the callback function.
  14301. * Returning `undefined` (i.e `return;`) will only exit the callback function and
  14302. * proceed with the next iteration of the loop.
  14303. *
  14304. * Ext.Array.each(countries, function(name, index, countriesItSelf) {
  14305. * if (name === 'Singapore') {
  14306. * return false; // break here
  14307. * }
  14308. * });
  14309. *
  14310. * {@link Ext#each Ext.each} is alias for {@link Ext.Array#each Ext.Array.each}
  14311. *
  14312. * @param {Array/NodeList/Object} array The value to be iterated. If this
  14313. * argument is not iterable, the callback function is called once.
  14314. * @param {Function} fn The callback function. If it returns `false`, the iteration
  14315. * stops and this method returns the current `index`. Returning `undefined` (i.e
  14316. * `return;`) will only exit the callback function and proceed with the next iteration
  14317. * in the loop.
  14318. * @param {Object} fn.item The item at the current `index` in the passed `array`
  14319. * @param {Number} fn.index The current `index` within the `array`
  14320. * @param {Array} fn.allItems The `array` itself which was passed as the first argument
  14321. * @param {Boolean} fn.return Return `false` to stop iteration.
  14322. * @param {Object} [scope] The scope (`this` reference) in which the specified function is executed.
  14323. * @param {Boolean} [reverse=false] Reverse the iteration order (loop from the end to the beginning).
  14324. * @return {Boolean/Number} If all array entries were iterated, this will be `true. If
  14325. * iteration was halted early because the passed fuction returned `false`, this will
  14326. * be the index at which iteration was halted.
  14327. */
  14328. each: function(array, fn, scope, reverse) {
  14329. array = ExtArray.from(array);
  14330. var i,
  14331. ln = array.length;
  14332. if (reverse !== true) {
  14333. for (i = 0; i < ln; i++) {
  14334. if (fn.call(scope || array[i], array[i], i, array) === false) {
  14335. return i;
  14336. }
  14337. }
  14338. } else {
  14339. for (i = ln - 1; i > -1; i--) {
  14340. if (fn.call(scope || array[i], array[i], i, array) === false) {
  14341. return i;
  14342. }
  14343. }
  14344. }
  14345. return true;
  14346. },
  14347. /*
  14348. * Calculates the the insertion index of a passed object into the passed Array according
  14349. * to the passed comparator function. Note that the passed Array *MUST* already be ordered.
  14350. * @param {Object} item The item to calculate the insertion index for.
  14351. * @param {Array} The array into which the item is to be inserted.
  14352. * @param {Function} comparatorFn The comparison function. Must return -1 or 0 or 1.
  14353. * @param {Object} comparatorFn.lhs The left object to compare.
  14354. * @param {Object} comparatorFn.rhs The right object to compare.
  14355. * @param {Number} index The possible correct index to try first before a binary
  14356. * search is instigated.
  14357. */
  14358. findInsertionIndex: function(item, items, comparatorFn, index) {
  14359. var len = items.length,
  14360. beforeCheck, afterCheck;
  14361. comparatorFn = comparatorFn || ExtArray.lexicalCompare;
  14362. if (index < len) {
  14363. beforeCheck = index > 0 ? comparatorFn(items[index - 1], item) : 0;
  14364. afterCheck = index < len - 1 ? comparatorFn(item, items[index]) : 0;
  14365. if (beforeCheck < 1 && afterCheck < 1) {
  14366. return index;
  14367. }
  14368. }
  14369. return ExtArray.binarySearch(items, item, comparatorFn);
  14370. },
  14371. /**
  14372. * @method
  14373. * Iterates an array and invoke the given callback function for each item. Note that this will simply
  14374. * delegate to the native `Array.prototype.forEach` method if supported. It doesn't support stopping the
  14375. * iteration by returning `false` in the callback function like {@link Ext.Array#each}. However, performance
  14376. * could be much better in modern browsers comparing with {@link Ext.Array#each}
  14377. *
  14378. * @param {Array} array The array to iterate.
  14379. * @param {Function} fn The callback function.
  14380. * @param {Object} fn.item The item at the current `index` in the passed `array`.
  14381. * @param {Number} fn.index The current `index` within the `array`.
  14382. * @param {Array} fn.allItems The `array` itself which was passed as the first argument.
  14383. * @param {Object} scope (Optional) The execution scope (`this`) in which the
  14384. * specified function is executed.
  14385. */
  14386. forEach: ('forEach' in arrayPrototype) ? function(array, fn, scope) {
  14387. array.forEach(fn, scope);
  14388. } : function(array, fn, scope) {
  14389. for (var i = 0,
  14390. ln = array.length; i < ln; i++) {
  14391. fn.call(scope, array[i], i, array);
  14392. }
  14393. },
  14394. /**
  14395. * @method
  14396. * Get the index of the provided `item` in the given `array`, a supplement for the
  14397. * missing arrayPrototype.indexOf in Internet Explorer.
  14398. *
  14399. * @param {Array} array The array to check.
  14400. * @param {Object} item The item to find.
  14401. * @param {Number} from (Optional) The index at which to begin the search.
  14402. * @return {Number} The index of item in the array (or -1 if it is not found).
  14403. */
  14404. indexOf: supportsIndexOf ? function(array, item, from) {
  14405. // May be called with no array which causes an error.
  14406. return array ? arrayPrototype.indexOf.call(array, item, from) : -1;
  14407. } : function(array, item, from) {
  14408. var i,
  14409. length = array ? array.length : 0;
  14410. for (i = (from < 0) ? Math.max(0, length + from) : from || 0; i < length; i++) {
  14411. if (array[i] === item) {
  14412. return i;
  14413. }
  14414. }
  14415. return -1;
  14416. },
  14417. /**
  14418. * @method
  14419. * Checks whether or not the given `array` contains the specified `item`.
  14420. *
  14421. * @param {Array} array The array to check.
  14422. * @param {Object} item The item to find.
  14423. * @return {Boolean} `true` if the array contains the item, `false` otherwise.
  14424. */
  14425. contains: supportsIndexOf ? function(array, item) {
  14426. return arrayPrototype.indexOf.call(array, item) !== -1;
  14427. } : function(array, item) {
  14428. var i, ln;
  14429. for (i = 0 , ln = array.length; i < ln; i++) {
  14430. if (array[i] === item) {
  14431. return true;
  14432. }
  14433. }
  14434. return false;
  14435. },
  14436. /**
  14437. * Converts any iterable (numeric indices and a length property) into a true array.
  14438. *
  14439. * function test() {
  14440. * var args = Ext.Array.toArray(arguments),
  14441. * fromSecondToLastArgs = Ext.Array.toArray(arguments, 1);
  14442. *
  14443. * alert(args.join(' '));
  14444. * alert(fromSecondToLastArgs.join(' '));
  14445. * }
  14446. *
  14447. * test('just', 'testing', 'here'); // alerts 'just testing here';
  14448. * // alerts 'testing here';
  14449. *
  14450. * Ext.Array.toArray(document.getElementsByTagName('div')); // will convert the NodeList into an array
  14451. * Ext.Array.toArray('splitted'); // returns ['s', 'p', 'l', 'i', 't', 't', 'e', 'd']
  14452. * Ext.Array.toArray('splitted', 0, 3); // returns ['s', 'p', 'l']
  14453. *
  14454. * {@link Ext#toArray Ext.toArray} is alias for {@link Ext.Array#toArray Ext.Array.toArray}
  14455. *
  14456. * @param {Object} iterable the iterable object to be turned into a true Array.
  14457. * @param {Number} [start=0] a zero-based index that specifies the start of extraction.
  14458. * @param {Number} [end=-1] a 1-based index that specifies the end of extraction.
  14459. * @return {Array}
  14460. */
  14461. toArray: function(iterable, start, end) {
  14462. if (!iterable || !iterable.length) {
  14463. return [];
  14464. }
  14465. if (typeof iterable === 'string') {
  14466. iterable = iterable.split('');
  14467. }
  14468. if (supportsSliceOnNodeList) {
  14469. return slice.call(iterable, start || 0, end || iterable.length);
  14470. }
  14471. var array = [],
  14472. i;
  14473. start = start || 0;
  14474. end = end ? ((end < 0) ? iterable.length + end : end) : iterable.length;
  14475. for (i = start; i < end; i++) {
  14476. array.push(iterable[i]);
  14477. }
  14478. return array;
  14479. },
  14480. /**
  14481. * Plucks the value of a property from each item in the Array. Example:
  14482. *
  14483. * Ext.Array.pluck(Ext.query("p"), "className"); // [el1.className, el2.className, ..., elN.className]
  14484. *
  14485. * @param {Array/NodeList} array The Array of items to pluck the value from.
  14486. * @param {String} propertyName The property name to pluck from each element.
  14487. * @return {Array} The value from each item in the Array.
  14488. */
  14489. pluck: function(array, propertyName) {
  14490. var ret = [],
  14491. i, ln, item;
  14492. for (i = 0 , ln = array.length; i < ln; i++) {
  14493. item = array[i];
  14494. ret.push(item[propertyName]);
  14495. }
  14496. return ret;
  14497. },
  14498. /**
  14499. * @method
  14500. * Creates a new array with the results of calling a provided function on every element in this array.
  14501. *
  14502. * @param {Array} array
  14503. * @param {Function} fn Callback function for each item.
  14504. * @param {Mixed} fn.item Current item.
  14505. * @param {Number} fn.index Index of the item.
  14506. * @param {Array} fn.array The whole array that's being iterated.
  14507. * @param {Object} [scope] Callback function scope
  14508. * @return {Array} results
  14509. */
  14510. map: ('map' in arrayPrototype) ? function(array, fn, scope) {
  14511. Ext.Assert.isFunction(fn, 'Ext.Array.map must have a callback function passed as second argument.');
  14512. return array.map(fn, scope);
  14513. } : function(array, fn, scope) {
  14514. Ext.Assert.isFunction(fn, 'Ext.Array.map must have a callback function passed as second argument.');
  14515. var len = array.length,
  14516. results = new Array(len),
  14517. i;
  14518. for (i = 0; i < len; i++) {
  14519. results[i] = fn.call(scope, array[i], i, array);
  14520. }
  14521. return results;
  14522. },
  14523. /**
  14524. * @method
  14525. * Executes the specified function for each array element until the function returns a falsy value.
  14526. * If such an item is found, the function will return `false` immediately.
  14527. * Otherwise, it will return `true`.
  14528. *
  14529. * @param {Array} array
  14530. * @param {Function} fn Callback function for each item.
  14531. * @param {Mixed} fn.item Current item.
  14532. * @param {Number} fn.index Index of the item.
  14533. * @param {Array} fn.array The whole array that's being iterated.
  14534. * @param {Object} scope Callback function scope.
  14535. * @return {Boolean} `true` if no false value is returned by the callback function.
  14536. */
  14537. every: ('every' in arrayPrototype) ? function(array, fn, scope) {
  14538. Ext.Assert.isFunction(fn, 'Ext.Array.every must have a callback function passed as second argument.');
  14539. return array.every(fn, scope);
  14540. } : function(array, fn, scope) {
  14541. Ext.Assert.isFunction(fn, 'Ext.Array.every must have a callback function passed as second argument.');
  14542. var i = 0,
  14543. ln = array.length;
  14544. for (; i < ln; ++i) {
  14545. if (!fn.call(scope, array[i], i, array)) {
  14546. return false;
  14547. }
  14548. }
  14549. return true;
  14550. },
  14551. /**
  14552. * @method
  14553. * Executes the specified function for each array element until the function returns a truthy value.
  14554. * If such an item is found, the function will return `true` immediately. Otherwise, it will return `false`.
  14555. *
  14556. * @param {Array} array
  14557. * @param {Function} fn Callback function for each item.
  14558. * @param {Mixed} fn.item Current item.
  14559. * @param {Number} fn.index Index of the item.
  14560. * @param {Array} fn.array The whole array that's being iterated.
  14561. * @param {Object} scope Callback function scope.
  14562. * @return {Boolean} `true` if the callback function returns a truthy value.
  14563. */
  14564. some: ('some' in arrayPrototype) ? function(array, fn, scope) {
  14565. Ext.Assert.isFunction(fn, 'Ext.Array.some must have a callback function passed as second argument.');
  14566. return array.some(fn, scope);
  14567. } : function(array, fn, scope) {
  14568. Ext.Assert.isFunction(fn, 'Ext.Array.some must have a callback function passed as second argument.');
  14569. var i = 0,
  14570. ln = array.length;
  14571. for (; i < ln; ++i) {
  14572. if (fn.call(scope, array[i], i, array)) {
  14573. return true;
  14574. }
  14575. }
  14576. return false;
  14577. },
  14578. /**
  14579. * Shallow compares the contents of 2 arrays using strict equality.
  14580. * @param {Array} array1
  14581. * @param {Array} array2
  14582. * @return {Boolean} `true` if the arrays are equal.
  14583. */
  14584. equals: function(array1, array2) {
  14585. var len1 = array1.length,
  14586. len2 = array2.length,
  14587. i;
  14588. // Short circuit if the same array is passed twice
  14589. if (array1 === array2) {
  14590. return true;
  14591. }
  14592. if (len1 !== len2) {
  14593. return false;
  14594. }
  14595. for (i = 0; i < len1; ++i) {
  14596. if (array1[i] !== array2[i]) {
  14597. return false;
  14598. }
  14599. }
  14600. return true;
  14601. },
  14602. /**
  14603. * Filter through an array and remove empty item as defined in {@link Ext#isEmpty Ext.isEmpty}.
  14604. *
  14605. * See {@link Ext.Array#filter}
  14606. *
  14607. * @param {Array} array
  14608. * @return {Array} results
  14609. */
  14610. clean: function(array) {
  14611. var results = [],
  14612. i = 0,
  14613. ln = array.length,
  14614. item;
  14615. for (; i < ln; i++) {
  14616. item = array[i];
  14617. if (!Ext.isEmpty(item)) {
  14618. results.push(item);
  14619. }
  14620. }
  14621. return results;
  14622. },
  14623. /**
  14624. * Returns a new array with unique items.
  14625. *
  14626. * @param {Array} array
  14627. * @return {Array} results
  14628. */
  14629. unique: function(array) {
  14630. var clone = [],
  14631. i = 0,
  14632. ln = array.length,
  14633. item;
  14634. for (; i < ln; i++) {
  14635. item = array[i];
  14636. if (ExtArray.indexOf(clone, item) === -1) {
  14637. clone.push(item);
  14638. }
  14639. }
  14640. return clone;
  14641. },
  14642. /**
  14643. * @method
  14644. * Creates a new array with all of the elements of this array for which
  14645. * the provided filtering function returns a truthy value.
  14646. *
  14647. * @param {Array} array
  14648. * @param {Function} fn Callback function for each item.
  14649. * @param {Mixed} fn.item Current item.
  14650. * @param {Number} fn.index Index of the item.
  14651. * @param {Array} fn.array The whole array that's being iterated.
  14652. * @param {Object} scope Callback function scope.
  14653. * @return {Array} results
  14654. */
  14655. filter: ('filter' in arrayPrototype) ? function(array, fn, scope) {
  14656. Ext.Assert.isFunction(fn, 'Ext.Array.filter must have a filter function passed as second argument.');
  14657. return array.filter(fn, scope);
  14658. } : function(array, fn, scope) {
  14659. Ext.Assert.isFunction(fn, 'Ext.Array.filter must have a filter function passed as second argument.');
  14660. var results = [],
  14661. i = 0,
  14662. ln = array.length;
  14663. for (; i < ln; i++) {
  14664. if (fn.call(scope, array[i], i, array)) {
  14665. results.push(array[i]);
  14666. }
  14667. }
  14668. return results;
  14669. },
  14670. /**
  14671. * Returns the first item in the array which elicits a truthy return value from the
  14672. * passed selection function.
  14673. * @param {Array} array The array to search
  14674. * @param {Function} fn The selection function to execute for each item.
  14675. * @param {Mixed} fn.item The array item.
  14676. * @param {Number} fn.index The index of the array item.
  14677. * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the
  14678. * function is executed. Defaults to the array
  14679. * @return {Object} The first item in the array which returned true from the selection
  14680. * function, or null if none was found.
  14681. */
  14682. findBy: function(array, fn, scope) {
  14683. var i = 0,
  14684. len = array.length;
  14685. for (; i < len; i++) {
  14686. if (fn.call(scope || array, array[i], i)) {
  14687. return array[i];
  14688. }
  14689. }
  14690. return null;
  14691. },
  14692. /**
  14693. * Converts a value to an array if it's not already an array; returns:
  14694. *
  14695. * - An empty array if given value is `undefined` or `null`
  14696. * - Itself if given value is already an array
  14697. * - An array copy if given value is {@link Ext#isIterable iterable} (arguments, NodeList and alike)
  14698. * - An array with one item which is the given value, otherwise
  14699. *
  14700. * @param {Object} value The value to convert to an array if it's not already is an array.
  14701. * @param {Boolean} [newReference] `true` to clone the given array and return a new reference if necessary.
  14702. * @return {Array} array
  14703. */
  14704. from: function(value, newReference) {
  14705. if (value === undefined || value === null) {
  14706. return [];
  14707. }
  14708. if (Ext.isArray(value)) {
  14709. return (newReference) ? slice.call(value) : value;
  14710. }
  14711. var type = typeof value;
  14712. // Both strings and functions will have a length property. In phantomJS, NodeList
  14713. // instances report typeof=='function' but don't have an apply method...
  14714. if (value && value.length !== undefined && type !== 'string' && (type !== 'function' || !value.apply)) {
  14715. return ExtArray.toArray(value);
  14716. }
  14717. return [
  14718. value
  14719. ];
  14720. },
  14721. /**
  14722. * Removes the specified item from the array if it exists.
  14723. *
  14724. * @param {Array} array The array.
  14725. * @param {Object} item The item to remove.
  14726. * @return {Array} The passed array.
  14727. */
  14728. remove: function(array, item) {
  14729. var index = ExtArray.indexOf(array, item);
  14730. if (index !== -1) {
  14731. erase(array, index, 1);
  14732. }
  14733. return array;
  14734. },
  14735. /**
  14736. * Removes item/s at the specified index.
  14737. *
  14738. * @param {Array} array The array.
  14739. * @param {Number} index The index of the item to be removed.
  14740. * @param {Number} [count=1] The number of items to be removed.
  14741. * @return {Array} The passed array.
  14742. */
  14743. removeAt: function(array, index, count) {
  14744. var len = array.length;
  14745. if (index >= 0 && index < len) {
  14746. count = count || 1;
  14747. count = Math.min(count, len - index);
  14748. erase(array, index, count);
  14749. }
  14750. return array;
  14751. },
  14752. /**
  14753. * Push an item into the array only if the array doesn't contain it yet.
  14754. *
  14755. * @param {Array} array The array.
  14756. * @param {Object} item The item to include.
  14757. */
  14758. include: function(array, item) {
  14759. if (!ExtArray.contains(array, item)) {
  14760. array.push(item);
  14761. }
  14762. },
  14763. /**
  14764. * Clone a flat array without referencing the previous one. Note that this is different
  14765. * from `Ext.clone` since it doesn't handle recursive cloning. It's simply a convenient, easy-to-remember method
  14766. * for `Array.prototype.slice.call(array)`.
  14767. *
  14768. * @param {Array} array The array.
  14769. * @return {Array} The clone array.
  14770. */
  14771. clone: function(array) {
  14772. return slice.call(array);
  14773. },
  14774. /**
  14775. * Merge multiple arrays into one with unique items.
  14776. *
  14777. * {@link Ext.Array#union} is alias for {@link Ext.Array#merge}
  14778. *
  14779. * @param {Array} array1
  14780. * @param {Array} array2
  14781. * @param {Array} etc
  14782. * @return {Array} merged
  14783. */
  14784. merge: function() {
  14785. var args = slice.call(arguments),
  14786. array = [],
  14787. i, ln;
  14788. for (i = 0 , ln = args.length; i < ln; i++) {
  14789. array = array.concat(args[i]);
  14790. }
  14791. return ExtArray.unique(array);
  14792. },
  14793. /**
  14794. * Merge multiple arrays into one with unique items that exist in all of the arrays.
  14795. *
  14796. * @param {Array} array1
  14797. * @param {Array} array2
  14798. * @param {Array} etc
  14799. * @return {Array} intersect
  14800. */
  14801. intersect: function() {
  14802. var intersection = [],
  14803. arrays = slice.call(arguments),
  14804. arraysLength, array, arrayLength, minArray, minArrayIndex, minArrayCandidate, minArrayLength, element, elementCandidate, elementCount, i, j, k;
  14805. if (!arrays.length) {
  14806. return intersection;
  14807. }
  14808. // Find the smallest array
  14809. arraysLength = arrays.length;
  14810. for (i = minArrayIndex = 0; i < arraysLength; i++) {
  14811. minArrayCandidate = arrays[i];
  14812. if (!minArray || minArrayCandidate.length < minArray.length) {
  14813. minArray = minArrayCandidate;
  14814. minArrayIndex = i;
  14815. }
  14816. }
  14817. minArray = ExtArray.unique(minArray);
  14818. erase(arrays, minArrayIndex, 1);
  14819. // Use the smallest unique'd array as the anchor loop. If the other array(s) do contain
  14820. // an item in the small array, we're likely to find it before reaching the end
  14821. // of the inner loop and can terminate the search early.
  14822. minArrayLength = minArray.length;
  14823. arraysLength = arrays.length;
  14824. for (i = 0; i < minArrayLength; i++) {
  14825. element = minArray[i];
  14826. elementCount = 0;
  14827. for (j = 0; j < arraysLength; j++) {
  14828. array = arrays[j];
  14829. arrayLength = array.length;
  14830. for (k = 0; k < arrayLength; k++) {
  14831. elementCandidate = array[k];
  14832. if (element === elementCandidate) {
  14833. elementCount++;
  14834. break;
  14835. }
  14836. }
  14837. }
  14838. if (elementCount === arraysLength) {
  14839. intersection.push(element);
  14840. }
  14841. }
  14842. return intersection;
  14843. },
  14844. /**
  14845. * Perform a set difference A-B by subtracting all items in array B from array A.
  14846. *
  14847. * @param {Array} arrayA
  14848. * @param {Array} arrayB
  14849. * @return {Array} difference
  14850. */
  14851. difference: function(arrayA, arrayB) {
  14852. var clone = slice.call(arrayA),
  14853. ln = clone.length,
  14854. i, j, lnB;
  14855. for (i = 0 , lnB = arrayB.length; i < lnB; i++) {
  14856. for (j = 0; j < ln; j++) {
  14857. if (clone[j] === arrayB[i]) {
  14858. erase(clone, j, 1);
  14859. j--;
  14860. ln--;
  14861. }
  14862. }
  14863. }
  14864. return clone;
  14865. },
  14866. /**
  14867. * This method applies the `reduceFn` function against an accumulator and each
  14868. * value of the `array` (from left-to-right) to reduce it to a single value.
  14869. *
  14870. * If no `initialValue` is specified, the first element of the array is used as
  14871. * the initial value. For example:
  14872. *
  14873. * function reducer (previous, value, index) {
  14874. * console.log('[' + index + ']: (' + previous + ',' + value + '}');
  14875. * return previous * 10 + value;
  14876. * }
  14877. *
  14878. * v = Ext.Array.reduce([2, 3, 4], reducer);
  14879. * console.log('v = ' + v);
  14880. *
  14881. * > [1]: (2, 3)
  14882. * > [2]: (23, 4)
  14883. * > v = 234
  14884. *
  14885. * v = Ext.Array.reduce([2, 3, 4], reducer, 1);
  14886. * console.log('v = ' + v);
  14887. *
  14888. * > [0]: (1, 2)
  14889. * > [1]: (12, 3)
  14890. * > [2]: (123, 4)
  14891. * > v = 1234
  14892. *
  14893. * @param {Array} array The array to process.
  14894. * @param {Function} reduceFn The reducing callback function.
  14895. * @param {Mixed} reduceFn.previous The previous value.
  14896. * @param {Mixed} reduceFn.value The current value.
  14897. * @param {Number} reduceFn.index The index in the array of the current `value`.
  14898. * @param {Array} reduceFn.array The array to being processed.
  14899. * @param {Mixed} [initialValue] The starting value.
  14900. * @return {Mixed} The reduced value.
  14901. * @method reduce
  14902. * @since 6.0.0
  14903. */
  14904. reduce: Array.prototype.reduce ? function(array, reduceFn, initialValue) {
  14905. if (arguments.length === 3) {
  14906. return Array.prototype.reduce.call(array, reduceFn, initialValue);
  14907. }
  14908. return Array.prototype.reduce.call(array, reduceFn);
  14909. } : function(array, reduceFn, initialValue) {
  14910. array = Object(array);
  14911. if (!Ext.isFunction(reduceFn)) {
  14912. Ext.raise('Invalid parameter: expected a function.');
  14913. }
  14914. var index = 0,
  14915. length = array.length >>> 0,
  14916. reduced = initialValue;
  14917. if (arguments.length < 3) {
  14918. while (true) {
  14919. if (index in array) {
  14920. reduced = array[index++];
  14921. break;
  14922. }
  14923. if (++index >= length) {
  14924. throw new TypeError('Reduce of empty array with no initial value');
  14925. }
  14926. }
  14927. }
  14928. for (; index < length; ++index) {
  14929. if (index in array) {
  14930. reduced = reduceFn(reduced, array[index], index, array);
  14931. }
  14932. }
  14933. return reduced;
  14934. },
  14935. /**
  14936. * Returns a shallow copy of a part of an array. This is equivalent to the native
  14937. * call `Array.prototype.slice.call(array, begin, end)`. This is often used when "array"
  14938. * is "arguments" since the arguments object does not supply a slice method but can
  14939. * be the context object to `Array.prototype.slice`.
  14940. *
  14941. * @param {Array} array The array (or arguments object).
  14942. * @param {Number} begin The index at which to begin. Negative values are offsets from
  14943. * the end of the array.
  14944. * @param {Number} end The index at which to end. The copied items do not include
  14945. * end. Negative values are offsets from the end of the array. If end is omitted,
  14946. * all items up to the end of the array are copied.
  14947. * @return {Array} The copied piece of the array.
  14948. * @method slice
  14949. */
  14950. // Note: IE8 will return [] on slice.call(x, undefined).
  14951. slice: ([
  14952. 1,
  14953. 2
  14954. ].slice(1, undefined).length ? function(array, begin, end) {
  14955. return slice.call(array, begin, end);
  14956. } : function(array, begin, end) {
  14957. // see http://jsperf.com/slice-fix
  14958. if (typeof begin === 'undefined') {
  14959. return slice.call(array);
  14960. }
  14961. if (typeof end === 'undefined') {
  14962. return slice.call(array, begin);
  14963. }
  14964. return slice.call(array, begin, end);
  14965. }),
  14966. /**
  14967. * Sorts the elements of an Array in a stable manner (equivalently keyed values do not move relative to each other).
  14968. * By default, this method sorts the elements alphabetically and ascending.
  14969. * **Note:** This method modifies the passed array, in the same manner as the
  14970. * native javascript Array.sort.
  14971. *
  14972. * @param {Array} array The array to sort.
  14973. * @param {Function} [sortFn] The comparison function.
  14974. * @param {Mixed} sortFn.a The first item to compare.
  14975. * @param {Mixed} sortFn.b The second item to compare.
  14976. * @param {Number} sortFn.return `-1` if a < b, `1` if a > b, otherwise `0`.
  14977. * @return {Array} The sorted array.
  14978. */
  14979. sort: function(array, sortFn) {
  14980. return stableSort(array, sortFn || ExtArray.lexicalCompare);
  14981. },
  14982. /**
  14983. * Recursively flattens into 1-d Array. Injects Arrays inline.
  14984. *
  14985. * @param {Array} array The array to flatten
  14986. * @return {Array} The 1-d array.
  14987. */
  14988. flatten: function(array) {
  14989. var worker = [];
  14990. function rFlatten(a) {
  14991. var i, ln, v;
  14992. for (i = 0 , ln = a.length; i < ln; i++) {
  14993. v = a[i];
  14994. if (Ext.isArray(v)) {
  14995. rFlatten(v);
  14996. } else {
  14997. worker.push(v);
  14998. }
  14999. }
  15000. return worker;
  15001. }
  15002. return rFlatten(array);
  15003. },
  15004. /**
  15005. * Returns the minimum value in the Array.
  15006. *
  15007. * @param {Array/NodeList} array The Array from which to select the minimum value.
  15008. * @param {Function} comparisonFn (optional) a function to perform the comparison which determines minimization.
  15009. * If omitted the "<" operator will be used.
  15010. * __Note:__ gt = 1; eq = 0; lt = -1
  15011. * @param {Mixed} comparisonFn.min Current minimum value.
  15012. * @param {Mixed} comparisonFn.item The value to compare with the current minimum.
  15013. * @return {Object} minValue The minimum value.
  15014. */
  15015. min: function(array, comparisonFn) {
  15016. var min = array[0],
  15017. i, ln, item;
  15018. for (i = 0 , ln = array.length; i < ln; i++) {
  15019. item = array[i];
  15020. if (comparisonFn) {
  15021. if (comparisonFn(min, item) === 1) {
  15022. min = item;
  15023. }
  15024. } else {
  15025. if (item < min) {
  15026. min = item;
  15027. }
  15028. }
  15029. }
  15030. return min;
  15031. },
  15032. /**
  15033. * Returns the maximum value in the Array.
  15034. *
  15035. * @param {Array/NodeList} array The Array from which to select the maximum value.
  15036. * @param {Function} comparisonFn (optional) a function to perform the comparison which determines maximization.
  15037. * If omitted the ">" operator will be used.
  15038. * __Note:__ gt = 1; eq = 0; lt = -1
  15039. * @param {Mixed} comparisonFn.max Current maximum value.
  15040. * @param {Mixed} comparisonFn.item The value to compare with the current maximum.
  15041. * @return {Object} maxValue The maximum value.
  15042. */
  15043. max: function(array, comparisonFn) {
  15044. var max = array[0],
  15045. i, ln, item;
  15046. for (i = 0 , ln = array.length; i < ln; i++) {
  15047. item = array[i];
  15048. if (comparisonFn) {
  15049. if (comparisonFn(max, item) === -1) {
  15050. max = item;
  15051. }
  15052. } else {
  15053. if (item > max) {
  15054. max = item;
  15055. }
  15056. }
  15057. }
  15058. return max;
  15059. },
  15060. /**
  15061. * Calculates the mean of all items in the array.
  15062. *
  15063. * @param {Array} array The Array to calculate the mean value of.
  15064. * @return {Number} The mean.
  15065. */
  15066. mean: function(array) {
  15067. return array.length > 0 ? ExtArray.sum(array) / array.length : undefined;
  15068. },
  15069. /**
  15070. * Calculates the sum of all items in the given array.
  15071. *
  15072. * @param {Array} array The Array to calculate the sum value of.
  15073. * @return {Number} The sum.
  15074. */
  15075. sum: function(array) {
  15076. var sum = 0,
  15077. i, ln, item;
  15078. for (i = 0 , ln = array.length; i < ln; i++) {
  15079. item = array[i];
  15080. sum += item;
  15081. }
  15082. return sum;
  15083. },
  15084. /**
  15085. * Creates a map (object) keyed by the elements of the given array. The values in
  15086. * the map are the index+1 of the array element. For example:
  15087. *
  15088. * var map = Ext.Array.toMap(['a','b','c']);
  15089. *
  15090. * // map = { a: 1, b: 2, c: 3 };
  15091. *
  15092. * Or a key property can be specified:
  15093. *
  15094. * var map = Ext.Array.toMap([
  15095. * { name: 'a' },
  15096. * { name: 'b' },
  15097. * { name: 'c' }
  15098. * ], 'name');
  15099. *
  15100. * // map = { a: 1, b: 2, c: 3 };
  15101. *
  15102. * Lastly, a key extractor can be provided:
  15103. *
  15104. * var map = Ext.Array.toMap([
  15105. * { name: 'a' },
  15106. * { name: 'b' },
  15107. * { name: 'c' }
  15108. * ], function (obj) { return obj.name.toUpperCase(); });
  15109. *
  15110. * // map = { A: 1, B: 2, C: 3 };
  15111. *
  15112. * @param {String/String[]} strings The strings from which to create the map.
  15113. * @param {String/Function} [getKey] Name of the object property to use
  15114. * as a key or a function to extract the key.
  15115. * @param {Object} [scope] Value of `this` inside callback specified for `getKey`.
  15116. * @return {Object} The resulting map.
  15117. */
  15118. toMap: function(strings, getKey, scope) {
  15119. if (!strings) {
  15120. return null;
  15121. }
  15122. var map = {},
  15123. i = strings.length;
  15124. if (typeof strings === 'string') {
  15125. map[strings] = 1;
  15126. } else if (!getKey) {
  15127. while (i--) {
  15128. map[strings[i]] = i + 1;
  15129. }
  15130. } else if (typeof getKey === 'string') {
  15131. while (i--) {
  15132. map[strings[i][getKey]] = i + 1;
  15133. }
  15134. } else {
  15135. while (i--) {
  15136. map[getKey.call(scope, strings[i])] = i + 1;
  15137. }
  15138. }
  15139. return map;
  15140. },
  15141. /**
  15142. * Creates a map (object) keyed by a property of elements of the given array. The values in
  15143. * the map are the array element. For example:
  15144. *
  15145. * var map = Ext.Array.toValueMap(['a','b','c']);
  15146. *
  15147. * // map = { a: 'a', b: 'b', c: 'c' };
  15148. *
  15149. * Or a key property can be specified:
  15150. *
  15151. * var map = Ext.Array.toValueMap([
  15152. * { name: 'a' },
  15153. * { name: 'b' },
  15154. * { name: 'c' }
  15155. * ], 'name');
  15156. *
  15157. * // map = { a: {name: 'a'}, b: {name: 'b'}, c: {name: 'c'} };
  15158. *
  15159. * Lastly, a key extractor can be provided:
  15160. *
  15161. * var map = Ext.Array.toValueMap([
  15162. * { name: 'a' },
  15163. * { name: 'b' },
  15164. * { name: 'c' }
  15165. * ], function (obj) { return obj.name.toUpperCase(); });
  15166. *
  15167. * // map = { A: {name: 'a'}, B: {name: 'b'}, C: {name: 'c'} };
  15168. *
  15169. * @param {Array} array The Array to create the map from.
  15170. * @param {String/Function} [getKey] Name of the object property to use
  15171. * as a key or a function to extract the key.
  15172. * @param {Object} [scope] Value of this inside callback. This parameter is only
  15173. * passed when `getKey` is a function. If `getKey` is not a function, the 3rd
  15174. * argument is `arrayify`.
  15175. * @param {Number} [arrayify] Pass `1` to create arrays for all map entries
  15176. * or `2` to create arrays for map entries that have 2 or more items with the
  15177. * same key. This only applies when `getKey` is specified. By default the map will
  15178. * hold the last entry with a given key.
  15179. * @return {Object} The resulting map.
  15180. */
  15181. toValueMap: function(array, getKey, scope, arrayify) {
  15182. var map = {},
  15183. i = array.length,
  15184. autoArray, alwaysArray, entry, fn, key, value;
  15185. if (!getKey) {
  15186. while (i--) {
  15187. value = array[i];
  15188. map[value] = value;
  15189. }
  15190. } else {
  15191. if (!(fn = (typeof getKey !== 'string'))) {
  15192. arrayify = scope;
  15193. }
  15194. alwaysArray = arrayify === 1;
  15195. autoArray = arrayify === 2;
  15196. while (i--) {
  15197. value = array[i];
  15198. key = fn ? getKey.call(scope, value) : value[getKey];
  15199. if (alwaysArray) {
  15200. if (key in map) {
  15201. map[key].push(value);
  15202. } else {
  15203. map[key] = [
  15204. value
  15205. ];
  15206. }
  15207. } else if (autoArray && (key in map)) {
  15208. if ((entry = map[key]) instanceof Array) {
  15209. entry.push(value);
  15210. } else {
  15211. map[key] = [
  15212. entry,
  15213. value
  15214. ];
  15215. }
  15216. } else {
  15217. map[key] = value;
  15218. }
  15219. }
  15220. }
  15221. return map;
  15222. },
  15223. _replaceSim: replaceSim,
  15224. // for unit testing
  15225. _spliceSim: spliceSim,
  15226. /**
  15227. * Removes items from an array. This is functionally equivalent to the splice method
  15228. * of Array, but works around bugs in IE8's splice method and does not copy the
  15229. * removed elements in order to return them (because very often they are ignored).
  15230. *
  15231. * @param {Array} array The Array on which to replace.
  15232. * @param {Number} index The index in the array at which to operate.
  15233. * @param {Number} removeCount The number of items to remove at index.
  15234. * @return {Array} The array passed.
  15235. * @method
  15236. */
  15237. erase: erase,
  15238. /**
  15239. * Inserts items in to an array.
  15240. *
  15241. * @param {Array} array The Array in which to insert.
  15242. * @param {Number} index The index in the array at which to operate.
  15243. * @param {Array} items The array of items to insert at index.
  15244. * @return {Array} The array passed.
  15245. */
  15246. insert: function(array, index, items) {
  15247. return replace(array, index, 0, items);
  15248. },
  15249. move: function(array, fromIdx, toIdx) {
  15250. if (toIdx === fromIdx) {
  15251. return;
  15252. }
  15253. var item = array[fromIdx],
  15254. incr = toIdx > fromIdx ? 1 : -1,
  15255. i;
  15256. for (i = fromIdx; i != toIdx; i += incr) {
  15257. array[i] = array[i + incr];
  15258. }
  15259. array[toIdx] = item;
  15260. },
  15261. /**
  15262. * Replaces items in an array. This is functionally equivalent to the splice method
  15263. * of Array, but works around bugs in IE8's splice method and is often more convenient
  15264. * to call because it accepts an array of items to insert rather than use a variadic
  15265. * argument list.
  15266. *
  15267. * @param {Array} array The Array on which to replace.
  15268. * @param {Number} index The index in the array at which to operate.
  15269. * @param {Number} removeCount The number of items to remove at index (can be 0).
  15270. * @param {Array} insert (optional) An array of items to insert at index.
  15271. * @return {Array} The array passed.
  15272. * @method
  15273. */
  15274. replace: replace,
  15275. /**
  15276. * Replaces items in an array. This is equivalent to the splice method of Array, but
  15277. * works around bugs in IE8's splice method. The signature is exactly the same as the
  15278. * splice method except that the array is the first argument. All arguments following
  15279. * removeCount are inserted in the array at index.
  15280. *
  15281. * @param {Array} array The Array on which to replace.
  15282. * @param {Number} index The index in the array at which to operate.
  15283. * @param {Number} removeCount The number of items to remove at index (can be 0).
  15284. * @param {Object...} elements The elements to add to the array. If you don't specify
  15285. * any elements, splice simply removes elements from the array.
  15286. * @return {Array} An array containing the removed items.
  15287. * @method
  15288. */
  15289. splice: splice,
  15290. /**
  15291. * Pushes new items onto the end of an Array.
  15292. *
  15293. * Passed parameters may be single items, or arrays of items. If an Array is found in the argument list, all its
  15294. * elements are pushed into the end of the target Array.
  15295. *
  15296. * @param {Array} target The Array onto which to push new items
  15297. * @param {Object...} elements The elements to add to the array. Each parameter may
  15298. * be an Array, in which case all the elements of that Array will be pushed into the end of the
  15299. * destination Array.
  15300. * @return {Array} An array containing all the new items push onto the end.
  15301. */
  15302. push: function(target) {
  15303. var args = arguments,
  15304. len = args.length,
  15305. i, newItem;
  15306. if (target === undefined) {
  15307. target = [];
  15308. } else if (!Ext.isArray(target)) {
  15309. target = [
  15310. target
  15311. ];
  15312. }
  15313. for (i = 1; i < len; i++) {
  15314. newItem = args[i];
  15315. Array.prototype.push[Ext.isIterable(newItem) ? 'apply' : 'call'](target, newItem);
  15316. }
  15317. return target;
  15318. },
  15319. /**
  15320. * A function used to sort an array by numeric value. By default, javascript array values
  15321. * are coerced to strings when sorting, which can be problematic when using numeric values. To
  15322. * ensure that the values are sorted numerically, this method can be passed to the sort method:
  15323. *
  15324. * Ext.Array.sort(myArray, Ext.Array.numericSortFn);
  15325. */
  15326. numericSortFn: function(a, b) {
  15327. return a - b;
  15328. }
  15329. };
  15330. /**
  15331. * @method each
  15332. * @member Ext
  15333. * @inheritdoc Ext.Array#each
  15334. */
  15335. Ext.each = ExtArray.each;
  15336. /**
  15337. * @method union
  15338. * @member Ext.Array
  15339. * @inheritdoc Ext.Array#merge
  15340. */
  15341. ExtArray.union = ExtArray.merge;
  15342. /**
  15343. * Old alias to {@link Ext.Array#min}
  15344. * @deprecated 4.0.0 Use {@link Ext.Array#min} instead
  15345. * @method min
  15346. * @member Ext
  15347. * @inheritdoc Ext.Array#min
  15348. */
  15349. Ext.min = ExtArray.min;
  15350. /**
  15351. * Old alias to {@link Ext.Array#max}
  15352. * @deprecated 4.0.0 Use {@link Ext.Array#max} instead
  15353. * @method max
  15354. * @member Ext
  15355. * @inheritdoc Ext.Array#max
  15356. */
  15357. Ext.max = ExtArray.max;
  15358. /**
  15359. * Old alias to {@link Ext.Array#sum}
  15360. * @deprecated 4.0.0 Use {@link Ext.Array#sum} instead
  15361. * @method sum
  15362. * @member Ext
  15363. * @inheritdoc Ext.Array#sum
  15364. */
  15365. Ext.sum = ExtArray.sum;
  15366. /**
  15367. * Old alias to {@link Ext.Array#mean}
  15368. * @deprecated 4.0.0 Use {@link Ext.Array#mean} instead
  15369. * @method mean
  15370. * @member Ext
  15371. * @inheritdoc Ext.Array#mean
  15372. */
  15373. Ext.mean = ExtArray.mean;
  15374. /**
  15375. * Old alias to {@link Ext.Array#flatten}
  15376. * @deprecated 4.0.0 Use {@link Ext.Array#flatten} instead
  15377. * @method flatten
  15378. * @member Ext
  15379. * @inheritdoc Ext.Array#flatten
  15380. */
  15381. Ext.flatten = ExtArray.flatten;
  15382. /**
  15383. * Old alias to {@link Ext.Array#clean}
  15384. * @deprecated 4.0.0 Use {@link Ext.Array#clean} instead
  15385. * @method clean
  15386. * @member Ext
  15387. * @inheritdoc Ext.Array#clean
  15388. */
  15389. Ext.clean = ExtArray.clean;
  15390. /**
  15391. * Old alias to {@link Ext.Array#unique}
  15392. * @deprecated 4.0.0 Use {@link Ext.Array#unique} instead
  15393. * @method unique
  15394. * @member Ext
  15395. * @inheritdoc Ext.Array#unique
  15396. */
  15397. Ext.unique = ExtArray.unique;
  15398. /**
  15399. * Old alias to {@link Ext.Array#pluck Ext.Array.pluck}
  15400. * @deprecated 4.0.0 Use {@link Ext.Array#pluck Ext.Array.pluck} instead
  15401. * @method pluck
  15402. * @member Ext
  15403. * @inheritdoc Ext.Array#pluck
  15404. */
  15405. Ext.pluck = ExtArray.pluck;
  15406. /**
  15407. * @method toArray
  15408. * @member Ext
  15409. * @inheritdoc Ext.Array#toArray
  15410. */
  15411. Ext.toArray = function() {
  15412. return ExtArray.toArray.apply(ExtArray, arguments);
  15413. };
  15414. return ExtArray;
  15415. }());
  15416. // @define Ext.lang.Assert
  15417. // @define Ext.Assert
  15418. // @require Ext.lang.Error
  15419. /**
  15420. * @class Ext.Assert
  15421. * This class provides help value testing methods useful for diagnostics. These are often
  15422. * used in `debugHooks`:
  15423. *
  15424. * Ext.define('Foo.bar.Class', {
  15425. *
  15426. * debugHooks: {
  15427. * method: function (a) {
  15428. * Ext.Assert.truthy(a, 'Expected "a" to be truthy');
  15429. * },
  15430. *
  15431. * foo: function (object) {
  15432. * Ext.Assert.isFunctionProp(object, 'doSomething');
  15433. * }
  15434. * }
  15435. * });
  15436. *
  15437. * **NOTE:** This class is entirely removed in production builds so all uses of it should
  15438. * be either in `debug` conditional comments or `debugHooks`.
  15439. *
  15440. * The following type detection methods from the `Ext` object are wrapped as assertions
  15441. * by this class:
  15442. *
  15443. * * `isEmpty`
  15444. * * `isArray`
  15445. * * `isDate`
  15446. * * `isObject`
  15447. * * `isSimpleObject`
  15448. * * `isPrimitive`
  15449. * * `isFunction`
  15450. * * `isNumber`
  15451. * * `isNumeric`
  15452. * * `isString`
  15453. * * `isBoolean`
  15454. * * `isElement`
  15455. * * `isTextNode`
  15456. * * `isDefined`
  15457. * * `isIterable`
  15458. *
  15459. * These appear both their exact name and with a "Prop" suffix for checking a property on
  15460. * an object. For example, these are almost identical:
  15461. *
  15462. * Ext.Assert.isFunction(object.foo);
  15463. *
  15464. * Ext.Assert.isFunctionProp(object, 'foo');
  15465. *
  15466. * The difference is the default error message generated is better in the second use case
  15467. * than the first.
  15468. *
  15469. * The above list are also expanded for "Not" flavors (and "Not...Prop"):
  15470. *
  15471. * * `isNotEmpty`
  15472. * * `isNotArray`
  15473. * * `isNotDate`
  15474. * * `isNotObject`
  15475. * * `isNotSimpleObject`
  15476. * * `isNotPrimitive`
  15477. * * `isNotFunction`
  15478. * * `isNotNumber`
  15479. * * `isNotNumeric`
  15480. * * `isNotString`
  15481. * * `isNotBoolean`
  15482. * * `isNotElement`
  15483. * * `isNotTextNode`
  15484. * * `isNotDefined`
  15485. * * `isNotIterable`
  15486. */
  15487. Ext.Assert = {
  15488. /**
  15489. * Checks that the first argument is falsey and throws an `Error` if it is not.
  15490. */
  15491. falsey: function(b, msg) {
  15492. if (b) {
  15493. Ext.raise(msg || ('Expected a falsey value but was ' + b));
  15494. }
  15495. },
  15496. /**
  15497. * Checks that the first argument is falsey and throws an `Error` if it is not.
  15498. */
  15499. falseyProp: function(object, property) {
  15500. Ext.Assert.truthy(object);
  15501. var b = object[property];
  15502. if (b) {
  15503. if (object.$className) {
  15504. property = object.$className + '#' + property;
  15505. }
  15506. Ext.raise('Expected a falsey value for ' + property + ' but was ' + b);
  15507. }
  15508. },
  15509. /**
  15510. * Checks that the first argument is truthy and throws an `Error` if it is not.
  15511. */
  15512. truthy: function(b, msg) {
  15513. if (!b) {
  15514. Ext.raise(msg || ('Expected a truthy value but was ' + typeof b));
  15515. }
  15516. },
  15517. /**
  15518. * Checks that the first argument is truthy and throws an `Error` if it is not.
  15519. */
  15520. truthyProp: function(object, property) {
  15521. Ext.Assert.truthy(object);
  15522. var b = object[property];
  15523. if (!b) {
  15524. if (object.$className) {
  15525. property = object.$className + '#' + property;
  15526. }
  15527. Ext.raise('Expected a truthy value for ' + property + ' but was ' + typeof b);
  15528. }
  15529. }
  15530. };
  15531. (function() {
  15532. function makeAssert(name, kind) {
  15533. var testFn = Ext[name],
  15534. def;
  15535. return function(value, msg) {
  15536. if (!testFn(value)) {
  15537. Ext.raise(msg || def || (def = 'Expected value to be ' + kind));
  15538. }
  15539. };
  15540. }
  15541. function makeAssertProp(name, kind) {
  15542. var testFn = Ext[name],
  15543. def;
  15544. return function(object, prop) {
  15545. Ext.Assert.truthy(object);
  15546. if (!testFn(object[prop])) {
  15547. Ext.raise(def || (def = 'Expected ' + (object.$className ? object.$className + '#' : '') + prop + ' to be ' + kind));
  15548. }
  15549. };
  15550. }
  15551. function makeNotAssert(name, kind) {
  15552. var testFn = Ext[name],
  15553. def;
  15554. return function(value, msg) {
  15555. if (testFn(value)) {
  15556. Ext.raise(msg || def || (def = 'Expected value to NOT be ' + kind));
  15557. }
  15558. };
  15559. }
  15560. function makeNotAssertProp(name, kind) {
  15561. var testFn = Ext[name],
  15562. def;
  15563. return function(object, prop) {
  15564. Ext.Assert.truthy(object);
  15565. if (testFn(object[prop])) {
  15566. Ext.raise(def || (def = 'Expected ' + (object.$className ? object.$className + '#' : '') + prop + ' to NOT be ' + kind));
  15567. }
  15568. };
  15569. }
  15570. for (var name in Ext) {
  15571. if (name.substring(0, 2) == "is" && Ext.isFunction(Ext[name])) {
  15572. var kind = name.substring(2);
  15573. Ext.Assert[name] = makeAssert(name, kind);
  15574. Ext.Assert[name + 'Prop'] = makeAssertProp(name, kind);
  15575. Ext.Assert['isNot' + kind] = makeNotAssert(name, kind);
  15576. Ext.Assert['isNot' + kind + 'Prop'] = makeNotAssertProp(name, kind);
  15577. }
  15578. }
  15579. }());
  15580. /**
  15581. * @class Ext.String
  15582. *
  15583. * A collection of useful static methods to deal with strings.
  15584. * @singleton
  15585. */
  15586. Ext.String = (function() {
  15587. // @define Ext.lang.String
  15588. // @define Ext.String
  15589. // @require Ext
  15590. // @require Ext.lang.Array
  15591. 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,
  15592. escapeRe = /('|\\)/g,
  15593. escapeRegexRe = /([-.*+?\^${}()|\[\]\/\\])/g,
  15594. basicTrimRe = /^\s+|\s+$/g,
  15595. whitespaceRe = /\s+/,
  15596. varReplace = /(^[^a-z]*|[^\w])/gi,
  15597. charToEntity, entityToChar, charToEntityRegex, entityToCharRegex,
  15598. htmlEncodeReplaceFn = function(match, capture) {
  15599. return charToEntity[capture];
  15600. },
  15601. htmlDecodeReplaceFn = function(match, capture) {
  15602. return (capture in entityToChar) ? entityToChar[capture] : String.fromCharCode(parseInt(capture.substr(2), 10));
  15603. },
  15604. boundsCheck = function(s, other) {
  15605. if (s === null || s === undefined || other === null || other === undefined) {
  15606. return false;
  15607. }
  15608. return other.length <= s.length;
  15609. },
  15610. fromCharCode = String.fromCharCode,
  15611. ExtString;
  15612. return ExtString = {
  15613. /**
  15614. * @method
  15615. * Creates a string created by using the specified sequence of code points.
  15616. * @param {Number...} codePoint Codepoints from which to build the string.
  15617. * @return {String} A string built from the sequence of code points passed.
  15618. */
  15619. fromCodePoint: String.fromCodePoint || function() {
  15620. var codePoint,
  15621. result = '',
  15622. codeUnits = [],
  15623. index = -1,
  15624. length = arguments.length;
  15625. while (++index < length) {
  15626. codePoint = Number(arguments[index]);
  15627. if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
  15628. codePoint < 0 || // not a valid Unicode code point
  15629. codePoint > 1114111 || // not a valid Unicode code point
  15630. Math.floor(codePoint) !== codePoint) // not an integer
  15631. {
  15632. Ext.raise('Invalid code point: ' + codePoint);
  15633. }
  15634. if (codePoint <= 65535) {
  15635. // BMP code point
  15636. codeUnits.push(codePoint);
  15637. } else {
  15638. // Astral code point; split in surrogate halves
  15639. // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  15640. codePoint -= 65536;
  15641. codeUnits.push((codePoint >> 10) + 55296, (codePoint % 1024) + 56320);
  15642. }
  15643. if (index + 1 === length) {
  15644. result += fromCharCode(codeUnits);
  15645. codeUnits.length = 0;
  15646. }
  15647. }
  15648. return result;
  15649. },
  15650. /**
  15651. * Inserts a substring into a string.
  15652. * @param {String} s The original string.
  15653. * @param {String} value The substring to insert.
  15654. * @param {Number} index The index to insert the substring. Negative indexes will insert from the end of
  15655. * the string. Example:
  15656. *
  15657. * Ext.String.insert("abcdefg", "h", -1); // abcdefhg
  15658. *
  15659. * @return {String} The value with the inserted substring
  15660. */
  15661. insert: function(s, value, index) {
  15662. if (!s) {
  15663. return value;
  15664. }
  15665. if (!value) {
  15666. return s;
  15667. }
  15668. var len = s.length;
  15669. if (!index && index !== 0) {
  15670. index = len;
  15671. }
  15672. if (index < 0) {
  15673. index *= -1;
  15674. if (index >= len) {
  15675. // negative overflow, insert at start
  15676. index = 0;
  15677. } else {
  15678. index = len - index;
  15679. }
  15680. }
  15681. if (index === 0) {
  15682. s = value + s;
  15683. } else if (index >= s.length) {
  15684. s += value;
  15685. } else {
  15686. s = s.substr(0, index) + value + s.substr(index);
  15687. }
  15688. return s;
  15689. },
  15690. /**
  15691. * Checks if a string starts with a substring
  15692. * @param {String} s The original string
  15693. * @param {String} start The substring to check
  15694. * @param {Boolean} [ignoreCase=false] True to ignore the case in the comparison
  15695. */
  15696. startsWith: function(s, start, ignoreCase) {
  15697. var result = boundsCheck(s, start);
  15698. if (result) {
  15699. if (ignoreCase) {
  15700. s = s.toLowerCase();
  15701. start = start.toLowerCase();
  15702. }
  15703. result = s.lastIndexOf(start, 0) === 0;
  15704. }
  15705. return result;
  15706. },
  15707. /**
  15708. * Checks if a string ends with a substring
  15709. * @param {String} s The original string
  15710. * @param {String} end The substring to check
  15711. * @param {Boolean} [ignoreCase=false] True to ignore the case in the comparison
  15712. */
  15713. endsWith: function(s, end, ignoreCase) {
  15714. var result = boundsCheck(s, end);
  15715. if (result) {
  15716. if (ignoreCase) {
  15717. s = s.toLowerCase();
  15718. end = end.toLowerCase();
  15719. }
  15720. result = s.indexOf(end, s.length - end.length) !== -1;
  15721. }
  15722. return result;
  15723. },
  15724. /**
  15725. * Converts a string of characters into a legal, parse-able JavaScript `var` name as long as the passed
  15726. * string contains at least one alphabetic character. Non alphanumeric characters, and *leading* non alphabetic
  15727. * characters will be removed.
  15728. * @param {String} s A string to be converted into a `var` name.
  15729. * @return {String} A legal JavaScript `var` name.
  15730. */
  15731. createVarName: function(s) {
  15732. return s.replace(varReplace, '');
  15733. },
  15734. /**
  15735. * Convert certain characters (&, <, >, ', and ") to their HTML character equivalents for literal display in web pages.
  15736. * @param {String} value The string to encode.
  15737. * @return {String} The encoded text.
  15738. * @method
  15739. */
  15740. htmlEncode: function(value) {
  15741. return (!value) ? value : String(value).replace(charToEntityRegex, htmlEncodeReplaceFn);
  15742. },
  15743. /**
  15744. * Convert certain characters (&, <, >, ', and ") from their HTML character equivalents.
  15745. * @param {String} value The string to decode.
  15746. * @return {String} The decoded text.
  15747. * @method
  15748. */
  15749. htmlDecode: function(value) {
  15750. return (!value) ? value : String(value).replace(entityToCharRegex, htmlDecodeReplaceFn);
  15751. },
  15752. /**
  15753. * Checks if a string has values needing to be html encoded.
  15754. * @private
  15755. * @param {String} s The string to test
  15756. * @return {Boolean} `true` if the string contains HTML characters
  15757. */
  15758. hasHtmlCharacters: function(s) {
  15759. return charToEntityRegex.test(s);
  15760. },
  15761. /**
  15762. * Adds a set of character entity definitions to the set used by
  15763. * {@link Ext.String#htmlEncode} and {@link Ext.String#htmlDecode}.
  15764. *
  15765. * This object should be keyed by the entity name sequence,
  15766. * with the value being the textual representation of the entity.
  15767. *
  15768. * Ext.String.addCharacterEntities({
  15769. * '&amp;Uuml;':'Ü',
  15770. * '&amp;ccedil;':'ç',
  15771. * '&amp;ntilde;':'ñ',
  15772. * '&amp;egrave;':'è'
  15773. * });
  15774. * var s = Ext.String.htmlEncode("A string with entities: èÜçñ");
  15775. *
  15776. * __Note:__ the values of the character entities defined on this object are expected
  15777. * to be single character values. As such, the actual values represented by the
  15778. * characters are sensitive to the character encoding of the JavaScript source
  15779. * file when defined in string literal form. Script tags referencing server
  15780. * resources with character entities must ensure that the 'charset' attribute
  15781. * of the script node is consistent with the actual character encoding of the
  15782. * server resource.
  15783. *
  15784. * The set of character entities may be reset back to the default state by using
  15785. * the {@link Ext.String#resetCharacterEntities} method
  15786. *
  15787. * @param {Object} newEntities The set of character entities to add to the current
  15788. * definitions.
  15789. */
  15790. addCharacterEntities: function(newEntities) {
  15791. var charKeys = [],
  15792. entityKeys = [],
  15793. key, echar;
  15794. for (key in newEntities) {
  15795. echar = newEntities[key];
  15796. entityToChar[key] = echar;
  15797. charToEntity[echar] = key;
  15798. charKeys.push(echar);
  15799. entityKeys.push(key);
  15800. }
  15801. charToEntityRegex = new RegExp('(' + charKeys.join('|') + ')', 'g');
  15802. entityToCharRegex = new RegExp('(' + entityKeys.join('|') + '|&#[0-9]{1,5};' + ')', 'g');
  15803. },
  15804. /**
  15805. * Resets the set of character entity definitions used by
  15806. * {@link Ext.String#htmlEncode} and {@link Ext.String#htmlDecode} back to the
  15807. * default state.
  15808. */
  15809. resetCharacterEntities: function() {
  15810. charToEntity = {};
  15811. entityToChar = {};
  15812. // add the default set
  15813. this.addCharacterEntities({
  15814. '&amp;': '&',
  15815. '&gt;': '>',
  15816. '&lt;': '<',
  15817. '&quot;': '"',
  15818. '&#39;': "'"
  15819. });
  15820. },
  15821. /**
  15822. * Appends content to the query string of a URL, handling logic for whether to place
  15823. * a question mark or ampersand.
  15824. * @param {String} url The URL to append to.
  15825. * @param {String} string The content to append to the URL.
  15826. * @return {String} The resulting URL
  15827. */
  15828. urlAppend: function(url, string) {
  15829. if (!Ext.isEmpty(string)) {
  15830. return url + (url.indexOf('?') === -1 ? '?' : '&') + string;
  15831. }
  15832. return url;
  15833. },
  15834. /**
  15835. * Trims whitespace from either end of a string, leaving spaces within the string intact. Example:
  15836. *
  15837. * var s = ' foo bar ';
  15838. * alert('-' + s + '-'); //alerts "- foo bar -"
  15839. * alert('-' + Ext.String.trim(s) + '-'); //alerts "-foo bar-"
  15840. *
  15841. * @param {String} string The string to trim.
  15842. * @return {String} The trimmed string.
  15843. */
  15844. trim: function(string) {
  15845. if (string) {
  15846. string = string.replace(trimRegex, "");
  15847. }
  15848. return string || '';
  15849. },
  15850. /**
  15851. * Capitalize the first letter of the given string.
  15852. * @param {String} string
  15853. * @return {String}
  15854. */
  15855. capitalize: function(string) {
  15856. if (string) {
  15857. string = string.charAt(0).toUpperCase() + string.substr(1);
  15858. }
  15859. return string || '';
  15860. },
  15861. /**
  15862. * Uncapitalize the first letter of a given string.
  15863. * @param {String} string
  15864. * @return {String}
  15865. */
  15866. uncapitalize: function(string) {
  15867. if (string) {
  15868. string = string.charAt(0).toLowerCase() + string.substr(1);
  15869. }
  15870. return string || '';
  15871. },
  15872. /**
  15873. * Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length.
  15874. * @param {String} value The string to truncate.
  15875. * @param {Number} length The maximum length to allow before truncating.
  15876. * @param {Boolean} [word=false] `true` to try to find a common word break.
  15877. * @return {String} The converted text.
  15878. */
  15879. ellipsis: function(value, length, word) {
  15880. if (value && value.length > length) {
  15881. if (word) {
  15882. var vs = value.substr(0, length - 2),
  15883. index = Math.max(vs.lastIndexOf(' '), vs.lastIndexOf('.'), vs.lastIndexOf('!'), vs.lastIndexOf('?'));
  15884. if (index !== -1 && index >= (length - 15)) {
  15885. return vs.substr(0, index) + "...";
  15886. }
  15887. }
  15888. return value.substr(0, length - 3) + "...";
  15889. }
  15890. return value;
  15891. },
  15892. /**
  15893. * Escapes the passed string for use in a regular expression.
  15894. * @param {String} string The string to escape.
  15895. * @return {String} The escaped string.
  15896. */
  15897. escapeRegex: function(string) {
  15898. return string.replace(escapeRegexRe, "\\$1");
  15899. },
  15900. /**
  15901. * Creates a `RegExp` given a string `value` and optional flags. For example, the
  15902. * following two regular expressions are equivalent.
  15903. *
  15904. * var regex1 = Ext.String.createRegex('hello');
  15905. *
  15906. * var regex2 = /^hello$/i;
  15907. *
  15908. * The following two regular expressions are also equivalent:
  15909. *
  15910. * var regex1 = Ext.String.createRegex('world', false, false, false);
  15911. *
  15912. * var regex2 = /world/;
  15913. *
  15914. * @param {String/RegExp} value The String to convert to a `RegExp`.
  15915. * @param {Boolean} [startsWith=true] Pass `false` to allow a match to start
  15916. * anywhere in the string. By default the `value` will match only at the start
  15917. * of the string.
  15918. * @param {Boolean} [endsWith=true] Pass `false` to allow the match to end before
  15919. * the end of the string. By default the `value` will match only at the end of the
  15920. * string.
  15921. * @param {Boolean} [ignoreCase=true] Pass `false` to make the `RegExp` case
  15922. * sensitive (removes the 'i' flag).
  15923. * @since 5.0.0
  15924. * @return {RegExp}
  15925. */
  15926. createRegex: function(value, startsWith, endsWith, ignoreCase) {
  15927. var ret = value;
  15928. if (value != null && !value.exec) {
  15929. // not a regex
  15930. ret = ExtString.escapeRegex(String(value));
  15931. if (startsWith !== false) {
  15932. ret = '^' + ret;
  15933. }
  15934. if (endsWith !== false) {
  15935. ret += '$';
  15936. }
  15937. ret = new RegExp(ret, (ignoreCase !== false) ? 'i' : '');
  15938. }
  15939. return ret;
  15940. },
  15941. /**
  15942. * Escapes the passed string for ' and \.
  15943. * @param {String} string The string to escape.
  15944. * @return {String} The escaped string.
  15945. */
  15946. escape: function(string) {
  15947. return string.replace(escapeRe, "\\$1");
  15948. },
  15949. /**
  15950. * Utility function that allows you to easily switch a string between two alternating values. The passed value
  15951. * is compared to the current string, and if they are equal, the other value that was passed in is returned. If
  15952. * they are already different, the first value passed in is returned. Note that this method returns the new value
  15953. * but does not change the current string.
  15954. *
  15955. * // alternate sort directions
  15956. * sort = Ext.String.toggle(sort, 'ASC', 'DESC');
  15957. *
  15958. * // instead of conditional logic:
  15959. * sort = (sort === 'ASC' ? 'DESC' : 'ASC');
  15960. *
  15961. * @param {String} string The current string.
  15962. * @param {String} value The value to compare to the current string.
  15963. * @param {String} other The new value to use if the string already equals the first value passed in.
  15964. * @return {String} The new value.
  15965. */
  15966. toggle: function(string, value, other) {
  15967. return string === value ? other : value;
  15968. },
  15969. /**
  15970. * Pads the left side of a string with a specified character. This is especially useful
  15971. * for normalizing number and date strings. Example usage:
  15972. *
  15973. * var s = Ext.String.leftPad('123', 5, '0');
  15974. * // s now contains the string: '00123'
  15975. *
  15976. * @param {String} string The original string.
  15977. * @param {Number} size The total length of the output string.
  15978. * @param {String} [character=' '] (optional) The character with which to pad the original string.
  15979. * @return {String} The padded string.
  15980. */
  15981. leftPad: function(string, size, character) {
  15982. var result = String(string);
  15983. character = character || " ";
  15984. while (result.length < size) {
  15985. result = character + result;
  15986. }
  15987. return result;
  15988. },
  15989. /**
  15990. * Returns a string with a specified number of repetitions a given string pattern.
  15991. * The pattern be separated by a different string.
  15992. *
  15993. * var s = Ext.String.repeat('---', 4); // = '------------'
  15994. * var t = Ext.String.repeat('--', 3, '/'); // = '--/--/--'
  15995. *
  15996. * @param {String} pattern The pattern to repeat.
  15997. * @param {Number} count The number of times to repeat the pattern (may be 0).
  15998. * @param {String} sep An option string to separate each pattern.
  15999. */
  16000. repeat: function(pattern, count, sep) {
  16001. if (count < 1) {
  16002. count = 0;
  16003. }
  16004. for (var buf = [],
  16005. i = count; i--; ) {
  16006. buf.push(pattern);
  16007. }
  16008. return buf.join(sep || '');
  16009. },
  16010. /**
  16011. * Splits a string of space separated words into an array, trimming as needed. If the
  16012. * words are already an array, it is returned.
  16013. *
  16014. * @param {String/Array} words
  16015. */
  16016. splitWords: function(words) {
  16017. if (words && typeof words == 'string') {
  16018. return words.replace(basicTrimRe, '').split(whitespaceRe);
  16019. }
  16020. return words || [];
  16021. }
  16022. };
  16023. }());
  16024. // initialize the default encode / decode entities
  16025. Ext.String.resetCharacterEntities();
  16026. /**
  16027. * @method htmlEncode
  16028. * @member Ext
  16029. * @inheritdoc Ext.String#htmlEncode
  16030. */
  16031. Ext.htmlEncode = Ext.String.htmlEncode;
  16032. /**
  16033. * @method htmlDecode
  16034. * @member Ext
  16035. * @inheritdoc Ext.String#htmlDecode
  16036. */
  16037. Ext.htmlDecode = Ext.String.htmlDecode;
  16038. /**
  16039. * @method urlAppend
  16040. * @member Ext
  16041. * @inheritdoc Ext.String#urlAppend
  16042. */
  16043. Ext.urlAppend = Ext.String.urlAppend;
  16044. /**
  16045. * @class Ext.Date
  16046. * This class defines some basic methods for handling dates.
  16047. *
  16048. * The date parsing and formatting syntax contains a subset of
  16049. * [PHP's `date()` function](http://www.php.net/date), and the formats that are
  16050. * supported will provide results equivalent to their PHP versions.
  16051. *
  16052. * The following is a list of all currently supported formats:
  16053. *
  16054. * Format Description Example returned values
  16055. * ------ ----------------------------------------------------------------------- -----------------------
  16056. * d Day of the month, 2 digits with leading zeros 01 to 31
  16057. * D A short textual representation of the day of the week Mon to Sun
  16058. * j Day of the month without leading zeros 1 to 31
  16059. * l A full textual representation of the day of the week Sunday to Saturday
  16060. * N ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday)
  16061. * S English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j
  16062. * w Numeric representation of the day of the week 0 (for Sunday) to 6 (for Saturday)
  16063. * z The day of the year (starting from 0) 0 to 364 (365 in leap years)
  16064. * W ISO-8601 week number of year, weeks starting on Monday 01 to 53
  16065. * F A full textual representation of a month, such as January or March January to December
  16066. * m Numeric representation of a month, with leading zeros 01 to 12
  16067. * M A short textual representation of a month Jan to Dec
  16068. * n Numeric representation of a month, without leading zeros 1 to 12
  16069. * t Number of days in the given month 28 to 31
  16070. * L Whether it&#39;s a leap year 1 if it is a leap year, 0 otherwise.
  16071. * o ISO-8601 year number (identical to (Y), but if the ISO week number (W) Examples: 1998 or 2004
  16072. * belongs to the previous or next year, that year is used instead)
  16073. * Y A full numeric representation of a year, 4 digits Examples: 1999 or 2003
  16074. * y A two digit representation of a year Examples: 99 or 03
  16075. * a Lowercase Ante meridiem and Post meridiem am or pm
  16076. * A Uppercase Ante meridiem and Post meridiem AM or PM
  16077. * g 12-hour format of an hour without leading zeros 1 to 12
  16078. * G 24-hour format of an hour without leading zeros 0 to 23
  16079. * h 12-hour format of an hour with leading zeros 01 to 12
  16080. * H 24-hour format of an hour with leading zeros 00 to 23
  16081. * i Minutes, with leading zeros 00 to 59
  16082. * s Seconds, with leading zeros 00 to 59
  16083. * u Decimal fraction of a second Examples:
  16084. * (minimum 1 digit, arbitrary number of digits allowed) 001 (i.e. 0.001s) or
  16085. * 100 (i.e. 0.100s) or
  16086. * 999 (i.e. 0.999s) or
  16087. * 999876543210 (i.e. 0.999876543210s)
  16088. * O Difference to Greenwich time (GMT) in hours and minutes Example: +1030
  16089. * P Difference to Greenwich time (GMT) with colon between hours and minutes Example: -08:00
  16090. * T Timezone abbreviation of the machine running the code Examples: EST, MDT, PDT ...
  16091. * Z Timezone offset in seconds (negative if west of UTC, positive if east) -43200 to 50400
  16092. * c ISO 8601 date represented as the local time with an offset to UTC appended.
  16093. * Notes: Examples:
  16094. * 1) If unspecified, the month / day defaults to the current month / day, 1991 or
  16095. * the time defaults to midnight, while the timezone defaults to the 1992-10 or
  16096. * browser's timezone. If a time is specified, it must include both hours 1993-09-20 or
  16097. * and minutes. The "T" delimiter, seconds, milliseconds and timezone 1994-08-19T16:20+01:00 or
  16098. * are optional. 1995-07-18T17:21:28-02:00 or
  16099. * 2) The decimal fraction of a second, if specified, must contain at 1996-06-17T18:22:29.98765+03:00 or
  16100. * least 1 digit (there is no limit to the maximum number 1997-05-16T19:23:30,12345-0400 or
  16101. * of digits allowed), and may be delimited by either a '.' or a ',' 1998-04-15T20:24:31.2468Z or
  16102. * Refer to the examples on the right for the various levels of 1999-03-14T20:24:32Z or
  16103. * date-time granularity which are supported, or see 2000-02-13T21:25:33
  16104. * http://www.w3.org/TR/NOTE-datetime for more info. 2001-01-12 22:26:34
  16105. * C An ISO date string as implemented by the native Date object's 1962-06-17T09:21:34.125Z
  16106. * [Date.toISOString](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
  16107. * method. This outputs the numeric part with *UTC* hour and minute
  16108. * values, and indicates this by appending the `'Z'` timezone
  16109. * identifier.
  16110. * U Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) 1193432466 or -2138434463
  16111. * MS Microsoft AJAX serialized dates \/Date(1238606590509)\/ (i.e. UTC milliseconds since epoch) or
  16112. * \/Date(1238606590509+0800)\/
  16113. * time A javascript millisecond timestamp 1350024476440
  16114. * timestamp A UNIX timestamp (same as U) 1350024866
  16115. *
  16116. * Example usage (note that you must escape format specifiers with '\\' to render them as character literals):
  16117. *
  16118. * // Sample date:
  16119. * // 'Wed Jan 10 2007 15:05:01 GMT-0600 (Central Standard Time)'
  16120. *
  16121. * var dt = new Date('1/10/2007 03:05:01 PM GMT-0600');
  16122. * console.log(Ext.Date.format(dt, 'Y-m-d')); // 2007-01-10
  16123. * console.log(Ext.Date.format(dt, 'F j, Y, g:i a')); // January 10, 2007, 3:05 pm
  16124. * 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
  16125. *
  16126. * Here are some standard date/time patterns that you might find helpful. They
  16127. * are not part of the source of Ext.Date, but to use them you can simply copy this
  16128. * block of code into any script that is included after Ext.Date and they will also become
  16129. * globally available on the Date object. Feel free to add or remove patterns as needed in your code.
  16130. *
  16131. * Ext.Date.patterns = {
  16132. * ISO8601Long:"Y-m-d H:i:s",
  16133. * ISO8601Short:"Y-m-d",
  16134. * ShortDate: "n/j/Y",
  16135. * LongDate: "l, F d, Y",
  16136. * FullDateTime: "l, F d, Y g:i:s A",
  16137. * MonthDay: "F d",
  16138. * ShortTime: "g:i A",
  16139. * LongTime: "g:i:s A",
  16140. * SortableDateTime: "Y-m-d\\TH:i:s",
  16141. * UniversalSortableDateTime: "Y-m-d H:i:sO",
  16142. * YearMonth: "F, Y"
  16143. * };
  16144. *
  16145. * Example usage:
  16146. *
  16147. * var dt = new Date();
  16148. * console.log(Ext.Date.format(dt, Ext.Date.patterns.ShortDate));
  16149. *
  16150. * Developer-written, custom formats may be used by supplying both a formatting and a parsing function
  16151. * which perform to specialized requirements. The functions are stored in {@link #parseFunctions} and {@link #formatFunctions}.
  16152. * @singleton
  16153. */
  16154. Ext.Date = (function() {
  16155. // @define Ext.lang.Date
  16156. // @define Ext.Date
  16157. // @require Ext
  16158. // @require Ext.lang.String
  16159. var utilDate,
  16160. nativeDate = Date,
  16161. stripEscapeRe = /(\\.)/g,
  16162. hourInfoRe = /([gGhHisucUOPZ]|MS)/,
  16163. dateInfoRe = /([djzmnYycU]|MS)/,
  16164. slashRe = /\\/gi,
  16165. numberTokenRe = /\{(\d+)\}/g,
  16166. MSFormatRe = new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/'),
  16167. pad = Ext.String.leftPad,
  16168. monthInfo = {
  16169. F: true,
  16170. m: true,
  16171. M: true,
  16172. n: true
  16173. },
  16174. yearInfo = {
  16175. o: true,
  16176. Y: true,
  16177. y: true
  16178. },
  16179. // Most of the date-formatting functions below are the excellent work of Baron Schwartz.
  16180. // (see http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/)
  16181. // They generate precompiled functions from format patterns instead of parsing and
  16182. // processing each pattern every time a date is formatted.
  16183. code = [
  16184. // date calculations (note: the code below creates a dependency on Ext.Number.from())
  16185. "var me = this, dt, y, m, d, h, i, s, ms, o, O, z, zz, u, v, W, year, jan4, week1monday, daysInMonth, dayMatched,",
  16186. "def = me.defaults,",
  16187. "from = Ext.Number.from,",
  16188. "results = String(input).match(me.parseRegexes[{0}]);",
  16189. // either null, or an array of matched strings
  16190. "if(results){",
  16191. "{1}",
  16192. "if(u != null){",
  16193. // i.e. unix time is defined
  16194. "v = new Date(u * 1000);",
  16195. // give top priority to UNIX time
  16196. "}else{",
  16197. // create Date object representing midnight of the current day;
  16198. // this will provide us with our date defaults
  16199. // (note: clearTime() handles Daylight Saving Time automatically)
  16200. "dt = me.clearTime(new Date);",
  16201. "y = from(y, from(def.y, dt.getFullYear()));",
  16202. "m = from(m, from(def.m - 1, dt.getMonth()));",
  16203. "dayMatched = d !== undefined;",
  16204. "d = from(d, from(def.d, dt.getDate()));",
  16205. // Attempt to validate the day. Since it defaults to today, it may go out
  16206. // of range, for example parsing m/Y where the value is 02/2000 on the 31st of May.
  16207. // It will attempt to parse 2000/02/31, which will overflow to March and end up
  16208. // returning 03/2000. We only do this when we default the day. If an invalid day value
  16209. // was set to be parsed by the user, continue on and either let it overflow or return null
  16210. // depending on the strict value. This will be in line with the normal Date behaviour.
  16211. "if (!dayMatched) {",
  16212. "dt.setDate(1);",
  16213. "dt.setMonth(m);",
  16214. "dt.setFullYear(y);",
  16215. "daysInMonth = me.getDaysInMonth(dt);",
  16216. "if (d > daysInMonth) {",
  16217. "d = daysInMonth;",
  16218. "}",
  16219. "}",
  16220. "h = from(h, from(def.h, dt.getHours()));",
  16221. "i = from(i, from(def.i, dt.getMinutes()));",
  16222. "s = from(s, from(def.s, dt.getSeconds()));",
  16223. "ms = from(ms, from(def.ms, dt.getMilliseconds()));",
  16224. "if(z >= 0 && y >= 0){",
  16225. // both the year and zero-based day of year are defined and >= 0.
  16226. // these 2 values alone provide sufficient info to create a full date object
  16227. // create Date object representing January 1st for the given year
  16228. // handle years < 100 appropriately
  16229. "v = me.add(new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);",
  16230. // then add day of year, checking for Date "rollover" if necessary
  16231. "v = !strict? v : (strict === true && (z <= 364 || (me.isLeapYear(v) && z <= 365))? me.add(v, me.DAY, z) : null);",
  16232. "}else if(strict === true && !me.isValid(y, m + 1, d, h, i, s, ms)){",
  16233. // check for Date "rollover"
  16234. "v = null;",
  16235. // invalid date, so return null
  16236. "}else{",
  16237. "if (W) {",
  16238. // support ISO-8601
  16239. // http://en.wikipedia.org/wiki/ISO_week_date
  16240. //
  16241. // Mutually equivalent definitions for week 01 are:
  16242. // a. the week starting with the Monday which is nearest in time to 1 January
  16243. // b. the week with 4 January in it
  16244. // ... there are many others ...
  16245. //
  16246. // We'll use letter b above to determine the first week of the year.
  16247. //
  16248. // So, first get a Date object for January 4th of whatever calendar year is desired.
  16249. //
  16250. // Then, the first Monday of the year can easily be determined by (operating on this Date):
  16251. // 1. Getting the day of the week.
  16252. // 2. Subtracting that by one.
  16253. // 3. Multiplying that by 86400000 (one day in ms).
  16254. // 4. Subtracting this number of days (in ms) from the January 4 date (represented in ms).
  16255. //
  16256. // Example #1 ...
  16257. //
  16258. // January 2012
  16259. // Su Mo Tu We Th Fr Sa
  16260. // 1 2 3 4 5 6 7
  16261. // 8 9 10 11 12 13 14
  16262. // 15 16 17 18 19 20 21
  16263. // 22 23 24 25 26 27 28
  16264. // 29 30 31
  16265. //
  16266. // 1. January 4th is a Wednesday.
  16267. // 2. Its day number is 3.
  16268. // 3. Simply substract 2 days from Wednesday.
  16269. // 4. The first week of the year begins on Monday, January 2. Simple!
  16270. //
  16271. // Example #2 ...
  16272. // January 1992
  16273. // Su Mo Tu We Th Fr Sa
  16274. // 1 2 3 4
  16275. // 5 6 7 8 9 10 11
  16276. // 12 13 14 15 16 17 18
  16277. // 19 20 21 22 23 24 25
  16278. // 26 27 28 29 30 31
  16279. //
  16280. // 1. January 4th is a Saturday.
  16281. // 2. Its day number is 6.
  16282. // 3. Simply subtract 5 days from Saturday.
  16283. // 4. The first week of the year begins on Monday, December 30. Simple!
  16284. //
  16285. // v = Ext.Date.clearTime(new Date(week1monday.getTime() + ((W - 1) * 604800000 + 43200000)));
  16286. // (This is essentially doing the same thing as above but for the week rather than the day)
  16287. "year = y || (new Date()).getFullYear();",
  16288. "jan4 = new Date(year, 0, 4, 0, 0, 0);",
  16289. "d = jan4.getDay();",
  16290. // If the 1st is a Thursday, then the 4th will be a Sunday, so we need the appropriate
  16291. // day number here, which is why we use the day === checks.
  16292. "week1monday = new Date(jan4.getTime() - ((d === 0 ? 6 : d - 1) * 86400000));",
  16293. // The reason for adding 43200000 (12 hours) is to avoid any complication with daylight saving
  16294. // switch overs. For example, if the clock is rolled back, an hour will repeat, so adding 7 days
  16295. // will leave us 1 hour short (Sun <date> 23:00:00). By setting is to 12:00, subtraction
  16296. // or addition of an hour won't make any difference.
  16297. "v = Ext.Date.clearTime(new Date(week1monday.getTime() + ((W - 1) * 604800000 + 43200000)));",
  16298. "} else {",
  16299. // plain old Date object
  16300. // handle years < 100 properly
  16301. "v = me.add(new Date(y < 100 ? 100 : y, m, d, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);",
  16302. "}",
  16303. "}",
  16304. "}",
  16305. "}",
  16306. "if(v){",
  16307. // favor UTC offset over GMT offset
  16308. "if(zz != null){",
  16309. // reset to UTC, then add offset
  16310. "v = me.add(v, me.SECOND, -v.getTimezoneOffset() * 60 - zz);",
  16311. "}else if(o){",
  16312. // reset to GMT, then add offset
  16313. "v = me.add(v, me.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));",
  16314. "}",
  16315. "}",
  16316. "return (v != null) ? v : null;"
  16317. ].join('\n');
  16318. // Polyfill Date's toISOString instance method where not implemented.
  16319. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
  16320. // TODO: Remove this when IE8 retires.
  16321. if (!Date.prototype.toISOString) {
  16322. Date.prototype.toISOString = function() {
  16323. var me = this;
  16324. 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';
  16325. };
  16326. }
  16327. /**
  16328. * @method xf
  16329. * @private
  16330. * @param format
  16331. * Create private copy of Ext JS's `Ext.util.Format.format()` method
  16332. * + to remove unnecessary dependency
  16333. * + to resolve namespace conflict with MS-Ajax's implementation
  16334. */
  16335. function xf(format) {
  16336. var args = Array.prototype.slice.call(arguments, 1);
  16337. return format.replace(numberTokenRe, function(m, i) {
  16338. return args[i];
  16339. });
  16340. }
  16341. utilDate = {
  16342. /** @ignore */
  16343. now: nativeDate.now,
  16344. // always available due to polyfill in Ext.js
  16345. /**
  16346. * @private
  16347. */
  16348. toString: function(date) {
  16349. if (!date) {
  16350. date = new nativeDate();
  16351. }
  16352. 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');
  16353. },
  16354. /**
  16355. * Returns the number of milliseconds between two dates.
  16356. * @param {Date} dateA The first date.
  16357. * @param {Date} [dateB=new Date()] (optional) The second date.
  16358. * @return {Number} The difference in milliseconds
  16359. */
  16360. getElapsed: function(dateA, dateB) {
  16361. return Math.abs(dateA - (dateB || utilDate.now()));
  16362. },
  16363. /**
  16364. * Global flag which determines if strict date parsing should be used.
  16365. * Strict date parsing will not roll-over invalid dates, which is the
  16366. * default behavior of JavaScript Date objects.
  16367. * (see {@link #parse} for more information)
  16368. * @type Boolean
  16369. */
  16370. useStrict: false,
  16371. /**
  16372. * @private
  16373. */
  16374. formatCodeToRegex: function(character, currentGroup) {
  16375. // Note: currentGroup - position in regex result array (see notes for Ext.Date.parseCodes below)
  16376. var p = utilDate.parseCodes[character];
  16377. if (p) {
  16378. p = typeof p === 'function' ? p() : p;
  16379. utilDate.parseCodes[character] = p;
  16380. }
  16381. // reassign function result to prevent repeated execution
  16382. return p ? Ext.applyIf({
  16383. c: p.c ? xf(p.c, currentGroup || "{0}") : p.c
  16384. }, p) : {
  16385. g: 0,
  16386. c: null,
  16387. s: Ext.String.escapeRegex(character)
  16388. };
  16389. },
  16390. // treat unrecognized characters as literals
  16391. /**
  16392. * An object hash in which each property is a date parsing function. The property name is the
  16393. * format string which that function parses.
  16394. *
  16395. * This object is automatically populated with date parsing functions as
  16396. * date formats are requested for Ext standard formatting strings.
  16397. *
  16398. * Custom parsing functions may be inserted into this object, keyed by a name which from then on
  16399. * may be used as a format string to {@link #parse}.
  16400. *
  16401. * Example:
  16402. *
  16403. * Ext.Date.parseFunctions['x-date-format'] = myDateParser;
  16404. *
  16405. * A parsing function should return a Date object, and is passed the following parameters:
  16406. *
  16407. * - `date`: {@link String} - The date string to parse.
  16408. * - `strict`: {@link Boolean} - `true` to validate date strings while parsing
  16409. * (i.e. prevent JavaScript Date "rollover"). __The default must be `false`.__
  16410. * Invalid date strings should return `null` when parsed.
  16411. *
  16412. * To enable Dates to also be _formatted_ according to that format, a corresponding
  16413. * formatting function must be placed into the {@link #formatFunctions} property.
  16414. * @property parseFunctions
  16415. * @type Object
  16416. */
  16417. parseFunctions: {
  16418. "MS": function(input, strict) {
  16419. // note: the timezone offset is ignored since the MS Ajax server sends
  16420. // a UTC milliseconds-since-Unix-epoch value (negative values are allowed)
  16421. var r = (input || '').match(MSFormatRe);
  16422. return r ? new nativeDate(((r[1] || '') + r[2]) * 1) : null;
  16423. },
  16424. "time": function(input, strict) {
  16425. var num = parseInt(input, 10);
  16426. if (num || num === 0) {
  16427. return new nativeDate(num);
  16428. }
  16429. return null;
  16430. },
  16431. "timestamp": function(input, strict) {
  16432. var num = parseInt(input, 10);
  16433. if (num || num === 0) {
  16434. return new nativeDate(num * 1000);
  16435. }
  16436. return null;
  16437. }
  16438. },
  16439. parseRegexes: [],
  16440. /**
  16441. * An object hash in which each property is a date formatting function. The property name is the
  16442. * format string which corresponds to the produced formatted date string.
  16443. *
  16444. * This object is automatically populated with date formatting functions as
  16445. * date formats are requested for Ext standard formatting strings.
  16446. *
  16447. * Custom formatting functions may be inserted into this object, keyed by a name which from then on
  16448. * may be used as a format string to {@link #format}.
  16449. *
  16450. * Example:
  16451. *
  16452. * Ext.Date.formatFunctions['x-date-format'] = myDateFormatter;
  16453. *
  16454. * A formatting function should return a string representation of the Date object which
  16455. * is the scope (this) of the function.
  16456. *
  16457. * To enable date strings to also be _parsed_ according to that format, a corresponding
  16458. * parsing function must be placed into the {@link #parseFunctions} property.
  16459. * @property formatFunctions
  16460. * @type Object
  16461. */
  16462. formatFunctions: {
  16463. "MS": function() {
  16464. // UTC milliseconds since Unix epoch (MS-AJAX serialized date format (MRSF))
  16465. return '\\/Date(' + this.getTime() + ')\\/';
  16466. },
  16467. "time": function() {
  16468. return this.getTime().toString();
  16469. },
  16470. "timestamp": function() {
  16471. return utilDate.format(this, 'U');
  16472. }
  16473. },
  16474. y2kYear: 50,
  16475. /**
  16476. * Date interval constant.
  16477. * @type String
  16478. */
  16479. MILLI: "ms",
  16480. /**
  16481. * Date interval constant.
  16482. * @type String
  16483. */
  16484. SECOND: "s",
  16485. /**
  16486. * Date interval constant.
  16487. * @type String
  16488. */
  16489. MINUTE: "mi",
  16490. /** Date interval constant.
  16491. * @type String
  16492. */
  16493. HOUR: "h",
  16494. /**
  16495. * Date interval constant.
  16496. * @type String
  16497. */
  16498. DAY: "d",
  16499. /**
  16500. * Date interval constant.
  16501. * @type String
  16502. */
  16503. MONTH: "mo",
  16504. /**
  16505. * Date interval constant.
  16506. * @type String
  16507. */
  16508. YEAR: "y",
  16509. /**
  16510. * The number of days in a week.
  16511. * @type Number
  16512. */
  16513. DAYS_IN_WEEK: 7,
  16514. /**
  16515. * The number of months in a year.
  16516. * @type Number
  16517. */
  16518. MONTHS_IN_YEAR: 12,
  16519. /**
  16520. * The maximum number of days in a month.
  16521. * @type {Number}
  16522. */
  16523. MAX_DAYS_IN_MONTH: 31,
  16524. SUNDAY: 0,
  16525. MONDAY: 1,
  16526. TUESDAY: 2,
  16527. WEDNESDAY: 3,
  16528. THURSDAY: 4,
  16529. FRIDAY: 5,
  16530. SATURDAY: 6,
  16531. /**
  16532. * An object hash containing default date values used during date parsing.
  16533. *
  16534. * The following properties are available:
  16535. *
  16536. * - `y`: {@link Number} - The default year value. Defaults to `undefined`.
  16537. * - `m`: {@link Number} - The default 1-based month value. Defaults to `undefined`.
  16538. * - `d`: {@link Number} - The default day value. Defaults to `undefined`.
  16539. * - `h`: {@link Number} - The default hour value. Defaults to `undefined`.
  16540. * - `i`: {@link Number} - The default minute value. Defaults to `undefined`.
  16541. * - `s`: {@link Number} - The default second value. Defaults to `undefined`.
  16542. * - `ms`: {@link Number} - The default millisecond value. Defaults to `undefined`.
  16543. *
  16544. * Override these properties to customize the default date values used by the {@link #parse} method.
  16545. *
  16546. * __Note:__ In countries which experience Daylight Saving Time (i.e. DST), the `h`, `i`, `s`
  16547. * and `ms` properties may coincide with the exact time in which DST takes effect.
  16548. * It is the responsibility of the developer to account for this.
  16549. *
  16550. * Example Usage:
  16551. *
  16552. * // set default day value to the first day of the month
  16553. * Ext.Date.defaults.d = 1;
  16554. *
  16555. * // parse a February date string containing only year and month values.
  16556. * // setting the default day value to 1 prevents weird date rollover issues
  16557. * // when attempting to parse the following date string on, for example, March 31st 2009.
  16558. * Ext.Date.parse('2009-02', 'Y-m'); // returns a Date object representing February 1st 2009.
  16559. *
  16560. * @property defaults
  16561. * @type Object
  16562. */
  16563. defaults: {},
  16564. /**
  16565. * @property {String[]} dayNames
  16566. * An array of textual day names.
  16567. * Override these values for international dates.
  16568. *
  16569. * Example:
  16570. *
  16571. * Ext.Date.dayNames = [
  16572. * 'SundayInYourLang',
  16573. * 'MondayInYourLang'
  16574. * // ...
  16575. * ];
  16576. * @locale
  16577. */
  16578. dayNames: [
  16579. "Sunday",
  16580. "Monday",
  16581. "Tuesday",
  16582. "Wednesday",
  16583. "Thursday",
  16584. "Friday",
  16585. "Saturday"
  16586. ],
  16587. /**
  16588. * @property {String[]} monthNames
  16589. * An array of textual month names.
  16590. * Override these values for international dates.
  16591. *
  16592. * Example:
  16593. *
  16594. * Ext.Date.monthNames = [
  16595. * 'JanInYourLang',
  16596. * 'FebInYourLang'
  16597. * // ...
  16598. * ];
  16599. * @locale
  16600. */
  16601. monthNames: [
  16602. "January",
  16603. "February",
  16604. "March",
  16605. "April",
  16606. "May",
  16607. "June",
  16608. "July",
  16609. "August",
  16610. "September",
  16611. "October",
  16612. "November",
  16613. "December"
  16614. ],
  16615. /**
  16616. * @property {Object} monthNumbers
  16617. * An object hash of zero-based JavaScript month numbers (with short month names as keys).
  16618. *
  16619. * __Note:__ keys are case-sensitive.
  16620. *
  16621. * Override these values for international dates.
  16622. *
  16623. * Example:
  16624. *
  16625. * Ext.Date.monthNumbers = {
  16626. * 'LongJanNameInYourLang': 0,
  16627. * 'ShortJanNameInYourLang':0,
  16628. * 'LongFebNameInYourLang':1,
  16629. * 'ShortFebNameInYourLang':1
  16630. * // ...
  16631. * };
  16632. * @locale
  16633. */
  16634. monthNumbers: {
  16635. January: 0,
  16636. Jan: 0,
  16637. February: 1,
  16638. Feb: 1,
  16639. March: 2,
  16640. Mar: 2,
  16641. April: 3,
  16642. Apr: 3,
  16643. May: 4,
  16644. June: 5,
  16645. Jun: 5,
  16646. July: 6,
  16647. Jul: 6,
  16648. August: 7,
  16649. Aug: 7,
  16650. September: 8,
  16651. Sep: 8,
  16652. October: 9,
  16653. Oct: 9,
  16654. November: 10,
  16655. Nov: 10,
  16656. December: 11,
  16657. Dec: 11
  16658. },
  16659. /**
  16660. * @property {String} defaultFormat
  16661. * The date format string that the {@link Ext.util.Format#dateRenderer}
  16662. * and {@link Ext.util.Format#date} functions use. See {@link Ext.Date} for details.
  16663. *
  16664. * This may be overridden in a locale file.
  16665. * @locale
  16666. */
  16667. defaultFormat: 'm/d/Y',
  16668. /**
  16669. * @property {String} defaultTimeFormat
  16670. * The default time format.
  16671. *
  16672. * This may be overridden in a locale file.
  16673. * @locale
  16674. */
  16675. defaultTimeFormat: 'h:i A',
  16676. /**
  16677. * @property {Number} firstDayOfWeek
  16678. * The day on which the week starts. `0` being Sunday, through `6` being Saturday.
  16679. *
  16680. * This may be overridden in a locale file.
  16681. * @locale
  16682. */
  16683. firstDayOfWeek: 0,
  16684. /**
  16685. * @property {Number[]} weekendDays
  16686. * The days on which weekend falls. `0` being Sunday, through `6` being Saturday.
  16687. *
  16688. * This may be overridden in a locale file.
  16689. * @locale
  16690. */
  16691. weekendDays: [
  16692. 0,
  16693. 6
  16694. ],
  16695. /**
  16696. * Get the short month name for the given month number.
  16697. * Override this function for international dates.
  16698. * @param {Number} month A zero-based JavaScript month number.
  16699. * @return {String} The short month name.
  16700. * @locale
  16701. */
  16702. getShortMonthName: function(month) {
  16703. return utilDate.monthNames[month].substring(0, 3);
  16704. },
  16705. /**
  16706. * Get the short day name for the given day number.
  16707. * Override this function for international dates.
  16708. * @param {Number} day A zero-based JavaScript day number.
  16709. * @return {String} The short day name.
  16710. * @locale
  16711. */
  16712. getShortDayName: function(day) {
  16713. return utilDate.dayNames[day].substring(0, 3);
  16714. },
  16715. /**
  16716. * Get the zero-based JavaScript month number for the given short/full month name.
  16717. * Override this function for international dates.
  16718. * @param {String} name The short/full month name.
  16719. * @return {Number} The zero-based JavaScript month number.
  16720. * @locale
  16721. */
  16722. getMonthNumber: function(name) {
  16723. // handle camel casing for English month names (since the keys for the Ext.Date.monthNumbers hash are case sensitive)
  16724. return utilDate.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
  16725. },
  16726. /**
  16727. * Checks if the specified format contains hour information
  16728. * @param {String} format The format to check
  16729. * @return {Boolean} True if the format contains hour information
  16730. * @method
  16731. */
  16732. formatContainsHourInfo: function(format) {
  16733. return hourInfoRe.test(format.replace(stripEscapeRe, ''));
  16734. },
  16735. /**
  16736. * Checks if the specified format contains information about
  16737. * anything other than the time.
  16738. * @param {String} format The format to check
  16739. * @return {Boolean} True if the format contains information about
  16740. * date/day information.
  16741. * @method
  16742. */
  16743. formatContainsDateInfo: function(format) {
  16744. return dateInfoRe.test(format.replace(stripEscapeRe, ''));
  16745. },
  16746. /**
  16747. * @private
  16748. * Checks if the specified format contains only month information.
  16749. *
  16750. * @param {String} format Format to check
  16751. *
  16752. * @return {Boolean}
  16753. */
  16754. isMonthFormat: function(format) {
  16755. return !!monthInfo[format];
  16756. },
  16757. /**
  16758. * @private
  16759. * Checks if the specified format contains only year information.
  16760. *
  16761. * @param {String} format Format to check.
  16762. *
  16763. * @return {Boolean}
  16764. */
  16765. isYearFormat: function(format) {
  16766. return !!yearInfo[format];
  16767. },
  16768. /**
  16769. * Removes all escaping for a date format string. In date formats,
  16770. * using a '\' can be used to escape special characters.
  16771. * @param {String} format The format to unescape
  16772. * @return {String} The unescaped format
  16773. * @method
  16774. */
  16775. unescapeFormat: function(format) {
  16776. // Escape the format, since \ can be used to escape special
  16777. // characters in a date format. For example, in a Spanish
  16778. // locale the format may be: 'd \\de F \\de Y'
  16779. return format.replace(slashRe, '');
  16780. },
  16781. /**
  16782. * The base format-code to formatting-function hashmap used by the {@link #format} method.
  16783. * Formatting functions are strings (or functions which return strings) which
  16784. * will return the appropriate value when evaluated in the context of the Date object
  16785. * from which the {@link #format} method is called.
  16786. * Add to / override these mappings for custom date formatting.
  16787. *
  16788. * __Note:__ `Ext.Date.format()` treats characters as literals if an appropriate mapping cannot be found.
  16789. *
  16790. * Example:
  16791. *
  16792. * Ext.Date.formatCodes.x = "Ext.util.Format.leftPad(this.getDate(), 2, '0')";
  16793. * console.log(Ext.Date.format(new Date(), 'X'); // returns the current day of the month
  16794. * @type Object
  16795. */
  16796. formatCodes: {
  16797. d: "Ext.String.leftPad(m.getDate(), 2, '0')",
  16798. D: "Ext.Date.getShortDayName(m.getDay())",
  16799. // get localized short day name
  16800. j: "m.getDate()",
  16801. l: "Ext.Date.dayNames[m.getDay()]",
  16802. N: "(m.getDay() ? m.getDay() : 7)",
  16803. S: "Ext.Date.getSuffix(m)",
  16804. w: "m.getDay()",
  16805. z: "Ext.Date.getDayOfYear(m)",
  16806. W: "Ext.String.leftPad(Ext.Date.getWeekOfYear(m), 2, '0')",
  16807. F: "Ext.Date.monthNames[m.getMonth()]",
  16808. m: "Ext.String.leftPad(m.getMonth() + 1, 2, '0')",
  16809. M: "Ext.Date.getShortMonthName(m.getMonth())",
  16810. // get localized short month name
  16811. n: "(m.getMonth() + 1)",
  16812. t: "Ext.Date.getDaysInMonth(m)",
  16813. L: "(Ext.Date.isLeapYear(m) ? 1 : 0)",
  16814. o: "(m.getFullYear() + (Ext.Date.getWeekOfYear(m) == 1 && m.getMonth() > 0 ? +1 : (Ext.Date.getWeekOfYear(m) >= 52 && m.getMonth() < 11 ? -1 : 0)))",
  16815. Y: "Ext.String.leftPad(m.getFullYear(), 4, '0')",
  16816. y: "('' + m.getFullYear()).substring(2, 4)",
  16817. a: "(m.getHours() < 12 ? 'am' : 'pm')",
  16818. A: "(m.getHours() < 12 ? 'AM' : 'PM')",
  16819. g: "((m.getHours() % 12) ? m.getHours() % 12 : 12)",
  16820. G: "m.getHours()",
  16821. h: "Ext.String.leftPad((m.getHours() % 12) ? m.getHours() % 12 : 12, 2, '0')",
  16822. H: "Ext.String.leftPad(m.getHours(), 2, '0')",
  16823. i: "Ext.String.leftPad(m.getMinutes(), 2, '0')",
  16824. s: "Ext.String.leftPad(m.getSeconds(), 2, '0')",
  16825. u: "Ext.String.leftPad(m.getMilliseconds(), 3, '0')",
  16826. O: "Ext.Date.getGMTOffset(m)",
  16827. P: "Ext.Date.getGMTOffset(m, true)",
  16828. T: "Ext.Date.getTimezone(m)",
  16829. Z: "(m.getTimezoneOffset() * -60)",
  16830. c: function() {
  16831. // ISO-8601 -- GMT format
  16832. var c = "Y-m-dTH:i:sP",
  16833. code = [],
  16834. i,
  16835. l = c.length,
  16836. e;
  16837. for (i = 0; i < l; ++i) {
  16838. e = c.charAt(i);
  16839. code.push(e === "T" ? "'T'" : utilDate.getFormatCode(e));
  16840. }
  16841. // treat T as a character literal
  16842. return code.join(" + ");
  16843. },
  16844. C: function() {
  16845. // ISO-1601 -- browser format. UTC numerics with the 'Z' TZ id.
  16846. return 'm.toISOString()';
  16847. },
  16848. U: "Math.round(m.getTime() / 1000)"
  16849. },
  16850. /**
  16851. * Checks if the passed Date parameters will cause a JavaScript Date "rollover".
  16852. * @param {Number} year 4-digit year.
  16853. * @param {Number} month 1-based month-of-year.
  16854. * @param {Number} day Day of month.
  16855. * @param {Number} hour (optional) Hour.
  16856. * @param {Number} minute (optional) Minute.
  16857. * @param {Number} second (optional) Second.
  16858. * @param {Number} millisecond (optional) Millisecond.
  16859. * @return {Boolean} `true` if the passed parameters do not cause a Date "rollover", `false` otherwise.
  16860. */
  16861. isValid: function(year, month, day, hour, minute, second, millisecond) {
  16862. // setup defaults
  16863. hour = hour || 0;
  16864. minute = minute || 0;
  16865. second = second || 0;
  16866. millisecond = millisecond || 0;
  16867. // Special handling for year < 100
  16868. var dt = utilDate.add(new nativeDate(year < 100 ? 100 : year, month - 1, day, hour, minute, second, millisecond), utilDate.YEAR, year < 100 ? year - 100 : 0);
  16869. return year === dt.getFullYear() && month === dt.getMonth() + 1 && day === dt.getDate() && hour === dt.getHours() && minute === dt.getMinutes() && second === dt.getSeconds() && millisecond === dt.getMilliseconds();
  16870. },
  16871. /**
  16872. * Parses the passed string using the specified date format.
  16873. * Note that this function expects normal calendar dates, meaning that months are 1-based (i.e. 1 = January).
  16874. * The {@link #defaults} hash will be used for any date value (i.e. year, month, day, hour, minute, second or millisecond)
  16875. * which cannot be found in the passed string. If a corresponding default date value has not been specified in the {@link #defaults} hash,
  16876. * the current date's year, month, day or DST-adjusted zero-hour time value will be used instead.
  16877. * Keep in mind that the input date string must precisely match the specified format string
  16878. * in order for the parse operation to be successful (failed parse operations return a
  16879. * `null` value).
  16880. *
  16881. * Example:
  16882. *
  16883. * //dt = Fri May 25 2007 (current date)
  16884. * var dt = new Date();
  16885. *
  16886. * //dt = Thu May 25 2006 (today&#39;s month/day in 2006)
  16887. * dt = Ext.Date.parse("2006", "Y");
  16888. *
  16889. * //dt = Sun Jan 15 2006 (all date parts specified)
  16890. * dt = Ext.Date.parse("2006-01-15", "Y-m-d");
  16891. *
  16892. * //dt = Sun Jan 15 2006 15:20:01
  16893. * dt = Ext.Date.parse("2006-01-15 3:20:01 PM", "Y-m-d g:i:s A");
  16894. *
  16895. * // attempt to parse Sun Feb 29 2006 03:20:01 in strict mode
  16896. * dt = Ext.Date.parse("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null
  16897. *
  16898. * @param {String} input The raw date string.
  16899. * @param {String} format The expected date string format.
  16900. * @param {Boolean} [strict=false] (optional) `true` to validate date strings while parsing (i.e. prevents JavaScript Date "rollover").
  16901. * Invalid date strings will return `null` when parsed.
  16902. * @return {Date/null} The parsed Date, or `null` if an invalid date string.
  16903. */
  16904. parse: function(input, format, strict) {
  16905. var p = utilDate.parseFunctions;
  16906. if (p[format] == null) {
  16907. utilDate.createParser(format);
  16908. }
  16909. return p[format].call(utilDate, input, Ext.isDefined(strict) ? strict : utilDate.useStrict);
  16910. },
  16911. // Backwards compat
  16912. parseDate: function(input, format, strict) {
  16913. return utilDate.parse(input, format, strict);
  16914. },
  16915. /**
  16916. * @private
  16917. */
  16918. getFormatCode: function(character) {
  16919. var f = utilDate.formatCodes[character];
  16920. if (f) {
  16921. f = typeof f === 'function' ? f() : f;
  16922. utilDate.formatCodes[character] = f;
  16923. }
  16924. // reassign function result to prevent repeated execution
  16925. // note: unknown characters are treated as literals
  16926. return f || ("'" + Ext.String.escape(character) + "'");
  16927. },
  16928. /**
  16929. * @private
  16930. */
  16931. createFormat: function(format) {
  16932. var code = [],
  16933. special = false,
  16934. ch = '',
  16935. i;
  16936. for (i = 0; i < format.length; ++i) {
  16937. ch = format.charAt(i);
  16938. if (!special && ch === "\\") {
  16939. special = true;
  16940. } else if (special) {
  16941. special = false;
  16942. code.push("'" + Ext.String.escape(ch) + "'");
  16943. } else {
  16944. if (ch === '\n') {
  16945. code.push("'\\n'");
  16946. } else {
  16947. code.push(utilDate.getFormatCode(ch));
  16948. }
  16949. }
  16950. }
  16951. utilDate.formatFunctions[format] = Ext.functionFactory("var m=this;return " + code.join('+'));
  16952. },
  16953. /**
  16954. * @private
  16955. */
  16956. createParser: function(format) {
  16957. var regexNum = utilDate.parseRegexes.length,
  16958. currentGroup = 1,
  16959. calc = [],
  16960. regex = [],
  16961. special = false,
  16962. ch = "",
  16963. i = 0,
  16964. len = format.length,
  16965. atEnd = [],
  16966. obj;
  16967. for (; i < len; ++i) {
  16968. ch = format.charAt(i);
  16969. if (!special && ch === "\\") {
  16970. special = true;
  16971. } else if (special) {
  16972. special = false;
  16973. regex.push(Ext.String.escape(ch));
  16974. } else {
  16975. obj = utilDate.formatCodeToRegex(ch, currentGroup);
  16976. currentGroup += obj.g;
  16977. regex.push(obj.s);
  16978. if (obj.g && obj.c) {
  16979. if (obj.calcAtEnd) {
  16980. atEnd.push(obj.c);
  16981. } else {
  16982. calc.push(obj.c);
  16983. }
  16984. }
  16985. }
  16986. }
  16987. calc = calc.concat(atEnd);
  16988. utilDate.parseRegexes[regexNum] = new RegExp("^" + regex.join('') + "$", 'i');
  16989. utilDate.parseFunctions[format] = Ext.functionFactory("input", "strict", xf(code, regexNum, calc.join('')));
  16990. },
  16991. /**
  16992. * @private
  16993. */
  16994. parseCodes: {
  16995. // Notes:
  16996. // g = {Number} calculation group (0 or 1. only group 1 contributes to
  16997. // date calculations.)
  16998. // c = {String} calculation method (required for group 1. null for group 0.
  16999. // {0} = currentGroup - position in regex result array)
  17000. // s = {String} regex pattern. all matches are stored in results[], and are
  17001. // accessible by the calculation mapped to 'c'
  17002. d: {
  17003. g: 1,
  17004. c: "d = parseInt(results[{0}], 10);\n",
  17005. s: "(3[0-1]|[1-2][0-9]|0[1-9])"
  17006. },
  17007. // day of month with leading zeroes (01 - 31)
  17008. j: {
  17009. g: 1,
  17010. c: "d = parseInt(results[{0}], 10);\n",
  17011. s: "(3[0-1]|[1-2][0-9]|[1-9])"
  17012. },
  17013. // day of month without leading zeroes (1 - 31)
  17014. D: function() {
  17015. for (var a = [],
  17016. i = 0; i < 7; a.push(utilDate.getShortDayName(i)) , ++i){}
  17017. // get localised short day names
  17018. return {
  17019. g: 0,
  17020. c: null,
  17021. s: "(?:" + a.join("|") + ")"
  17022. };
  17023. },
  17024. l: function() {
  17025. return {
  17026. g: 0,
  17027. c: null,
  17028. s: "(?:" + utilDate.dayNames.join("|") + ")"
  17029. };
  17030. },
  17031. N: {
  17032. g: 0,
  17033. c: null,
  17034. s: "[1-7]"
  17035. },
  17036. // ISO-8601 day number (1 (monday) - 7 (sunday))
  17037. //<locale type="object" property="parseCodes">
  17038. S: {
  17039. g: 0,
  17040. c: null,
  17041. s: "(?:st|nd|rd|th)"
  17042. },
  17043. //</locale>
  17044. w: {
  17045. g: 0,
  17046. c: null,
  17047. s: "[0-6]"
  17048. },
  17049. // JavaScript day number (0 (sunday) - 6 (saturday))
  17050. z: {
  17051. g: 1,
  17052. c: "z = parseInt(results[{0}], 10);\n",
  17053. s: "(\\d{1,3})"
  17054. },
  17055. // day of the year (0 - 364 (365 in leap years))
  17056. W: {
  17057. g: 1,
  17058. c: "W = parseInt(results[{0}], 10);\n",
  17059. s: "(\\d{2})"
  17060. },
  17061. // ISO-8601 week number (with leading zero)
  17062. F: function() {
  17063. return {
  17064. g: 1,
  17065. c: "m = parseInt(me.getMonthNumber(results[{0}]), 10);\n",
  17066. // get localised month number
  17067. s: "(" + utilDate.monthNames.join("|") + ")"
  17068. };
  17069. },
  17070. M: function() {
  17071. for (var a = [],
  17072. i = 0; i < 12; a.push(utilDate.getShortMonthName(i)) , ++i){}
  17073. // get localised short month names
  17074. return Ext.applyIf({
  17075. s: "(" + a.join("|") + ")"
  17076. }, utilDate.formatCodeToRegex("F"));
  17077. },
  17078. m: {
  17079. g: 1,
  17080. c: "m = parseInt(results[{0}], 10) - 1;\n",
  17081. s: "(1[0-2]|0[1-9])"
  17082. },
  17083. // month number with leading zeros (01 - 12)
  17084. n: {
  17085. g: 1,
  17086. c: "m = parseInt(results[{0}], 10) - 1;\n",
  17087. s: "(1[0-2]|[1-9])"
  17088. },
  17089. // month number without leading zeros (1 - 12)
  17090. t: {
  17091. g: 0,
  17092. c: null,
  17093. s: "(?:\\d{2})"
  17094. },
  17095. // no. of days in the month (28 - 31)
  17096. L: {
  17097. g: 0,
  17098. c: null,
  17099. s: "(?:1|0)"
  17100. },
  17101. o: {
  17102. g: 1,
  17103. c: "y = parseInt(results[{0}], 10);\n",
  17104. s: "(\\d{4})"
  17105. },
  17106. // ISO-8601 year number (with leading zero)
  17107. Y: {
  17108. g: 1,
  17109. c: "y = parseInt(results[{0}], 10);\n",
  17110. s: "(\\d{4})"
  17111. },
  17112. // 4-digit year
  17113. y: {
  17114. g: 1,
  17115. c: "var ty = parseInt(results[{0}], 10);\n" + "y = ty > me.y2kYear ? 1900 + ty : 2000 + ty;\n",
  17116. // 2-digit year
  17117. s: "(\\d{2})"
  17118. },
  17119. // In the am/pm parsing routines, we allow both upper and lower case
  17120. // even though it doesn't exactly match the spec. It gives much more flexibility
  17121. // in being able to specify case insensitive regexes.
  17122. //<locale type="object" property="parseCodes">
  17123. a: {
  17124. g: 1,
  17125. c: "if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n" + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
  17126. s: "(am|pm|AM|PM)",
  17127. calcAtEnd: true
  17128. },
  17129. //</locale>
  17130. //<locale type="object" property="parseCodes">
  17131. A: {
  17132. g: 1,
  17133. c: "if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n" + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
  17134. s: "(AM|PM|am|pm)",
  17135. calcAtEnd: true
  17136. },
  17137. //</locale>
  17138. g: {
  17139. g: 1,
  17140. c: "h = parseInt(results[{0}], 10);\n",
  17141. s: "(1[0-2]|[1-9])"
  17142. },
  17143. // 12-hr format of an hour without leading zeroes (1 - 12)
  17144. G: {
  17145. g: 1,
  17146. c: "h = parseInt(results[{0}], 10);\n",
  17147. s: "(2[0-3]|1[0-9]|[0-9])"
  17148. },
  17149. // 24-hr format of an hour without leading zeroes (0 - 23)
  17150. h: {
  17151. g: 1,
  17152. c: "h = parseInt(results[{0}], 10);\n",
  17153. s: "(1[0-2]|0[1-9])"
  17154. },
  17155. // 12-hr format of an hour with leading zeroes (01 - 12)
  17156. H: {
  17157. g: 1,
  17158. c: "h = parseInt(results[{0}], 10);\n",
  17159. s: "(2[0-3]|[0-1][0-9])"
  17160. },
  17161. // 24-hr format of an hour with leading zeroes (00 - 23)
  17162. i: {
  17163. g: 1,
  17164. c: "i = parseInt(results[{0}], 10);\n",
  17165. s: "([0-5][0-9])"
  17166. },
  17167. // minutes with leading zeros (00 - 59)
  17168. s: {
  17169. g: 1,
  17170. c: "s = parseInt(results[{0}], 10);\n",
  17171. s: "([0-5][0-9])"
  17172. },
  17173. // seconds with leading zeros (00 - 59)
  17174. u: {
  17175. g: 1,
  17176. c: "ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",
  17177. s: "(\\d+)"
  17178. },
  17179. // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
  17180. O: {
  17181. g: 1,
  17182. c: [
  17183. "o = results[{0}];",
  17184. "var sn = o.substring(0,1),",
  17185. // get + / - sign
  17186. "hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),",
  17187. // get hours (performs minutes-to-hour conversion also, just in case)
  17188. "mn = o.substring(3,5) % 60;",
  17189. // get minutes
  17190. "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"
  17191. ].// -12hrs <= GMT offset <= 14hrs
  17192. join("\n"),
  17193. s: "([+-]\\d{4})"
  17194. },
  17195. // GMT offset in hrs and mins
  17196. P: {
  17197. g: 1,
  17198. c: [
  17199. "o = results[{0}];",
  17200. "var sn = o.substring(0,1),",
  17201. // get + / - sign
  17202. "hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),",
  17203. // get hours (performs minutes-to-hour conversion also, just in case)
  17204. "mn = o.substring(4,6) % 60;",
  17205. // get minutes
  17206. "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"
  17207. ].// -12hrs <= GMT offset <= 14hrs
  17208. join("\n"),
  17209. s: "([+-]\\d{2}:\\d{2})"
  17210. },
  17211. // GMT offset in hrs and mins (with colon separator)
  17212. T: {
  17213. g: 0,
  17214. c: null,
  17215. s: "[A-Z]{1,5}"
  17216. },
  17217. // timezone abbrev. may be between 1 - 5 chars
  17218. Z: {
  17219. g: 1,
  17220. c: "zz = results[{0}] * 1;\n" + // -43200 <= UTC offset <= 50400
  17221. "zz = (-43200 <= zz && zz <= 50400)? zz : null;\n",
  17222. s: "([+-]?\\d{1,5})"
  17223. },
  17224. // leading '+' sign is optional for UTC offset
  17225. c: function() {
  17226. var calc = [],
  17227. arr = [
  17228. utilDate.formatCodeToRegex("Y", 1),
  17229. // year
  17230. utilDate.formatCodeToRegex("m", 2),
  17231. // month
  17232. utilDate.formatCodeToRegex("d", 3),
  17233. // day
  17234. utilDate.formatCodeToRegex("H", 4),
  17235. // hour
  17236. utilDate.formatCodeToRegex("i", 5),
  17237. // minute
  17238. utilDate.formatCodeToRegex("s", 6),
  17239. // second
  17240. {
  17241. c: "ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"
  17242. },
  17243. // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
  17244. {
  17245. c: [
  17246. // 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
  17247. "if(results[8]) {",
  17248. // timezone specified
  17249. "if(results[8] == 'Z'){",
  17250. "zz = 0;",
  17251. // UTC
  17252. "}else if (results[8].indexOf(':') > -1){",
  17253. utilDate.formatCodeToRegex("P", 8).c,
  17254. // timezone offset with colon separator
  17255. "}else{",
  17256. utilDate.formatCodeToRegex("O", 8).c,
  17257. // timezone offset without colon separator
  17258. "}",
  17259. "}"
  17260. ].join('\n')
  17261. }
  17262. ],
  17263. i, l;
  17264. for (i = 0 , l = arr.length; i < l; ++i) {
  17265. calc.push(arr[i].c);
  17266. }
  17267. return {
  17268. g: 1,
  17269. c: calc.join(""),
  17270. s: [
  17271. arr[0].s,
  17272. // year (required)
  17273. "(?:",
  17274. "-",
  17275. arr[1].s,
  17276. // month (optional)
  17277. "(?:",
  17278. "-",
  17279. arr[2].s,
  17280. // day (optional)
  17281. "(?:",
  17282. "(?:T| )?",
  17283. // time delimiter -- either a "T" or a single blank space
  17284. arr[3].s,
  17285. ":",
  17286. arr[4].s,
  17287. // hour AND minute, delimited by a single colon (optional). MUST be preceded by either a "T" or a single blank space
  17288. "(?::",
  17289. arr[5].s,
  17290. ")?",
  17291. // seconds (optional)
  17292. "(?:(?:\\.|,)(\\d+))?",
  17293. // decimal fraction of a second (e.g. ",12345" or ".98765") (optional)
  17294. "(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",
  17295. // "Z" (UTC) or "-0530" (UTC offset without colon delimiter) or "+08:00" (UTC offset with colon delimiter) (optional)
  17296. ")?",
  17297. ")?",
  17298. ")?"
  17299. ].join("")
  17300. };
  17301. },
  17302. U: {
  17303. g: 1,
  17304. c: "u = parseInt(results[{0}], 10);\n",
  17305. s: "(-?\\d+)"
  17306. }
  17307. },
  17308. // leading minus sign indicates seconds before UNIX epoch
  17309. //Old Ext.Date prototype methods.
  17310. /**
  17311. * @private
  17312. */
  17313. dateFormat: function(date, format) {
  17314. return utilDate.format(date, format);
  17315. },
  17316. /**
  17317. * Compares if two dates are equal by comparing their values.
  17318. * @param {Date} date1
  17319. * @param {Date} date2
  17320. * @return {Boolean} `true` if the date values are equal
  17321. */
  17322. isEqual: function(date1, date2) {
  17323. // check we have 2 date objects
  17324. if (date1 && date2) {
  17325. return (date1.getTime() === date2.getTime());
  17326. }
  17327. // one or both isn't a date, only equal if both are falsey
  17328. return !(date1 || date2);
  17329. },
  17330. /**
  17331. * Formats a date given the supplied format string.
  17332. * @param {Date} date The date to format
  17333. * @param {String} format The format string
  17334. * @return {String} The formatted date or an empty string if date parameter is not a JavaScript Date object
  17335. */
  17336. format: function(date, format) {
  17337. var formatFunctions = utilDate.formatFunctions;
  17338. if (!Ext.isDate(date)) {
  17339. return '';
  17340. }
  17341. if (formatFunctions[format] == null) {
  17342. utilDate.createFormat(format);
  17343. }
  17344. return formatFunctions[format].call(date) + '';
  17345. },
  17346. /**
  17347. * Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
  17348. *
  17349. * __Note:__ The date string returned by the JavaScript Date object's `toString()` method varies
  17350. * between browsers (e.g. FF vs IE) and system region settings (e.g. IE in Asia vs IE in America).
  17351. * For a given date string e.g. "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)",
  17352. * `getTimezone()` first tries to get the timezone abbreviation from between a pair of parentheses
  17353. * (which may or may not be present), failing which it proceeds to get the timezone abbreviation
  17354. * from the GMT offset portion of the date string.
  17355. *
  17356. * var dt = new Date('9/17/2011');
  17357. * console.log(Ext.Date.getTimezone(dt));
  17358. *
  17359. * @param {Date} date The date
  17360. * @return {String} The abbreviated timezone name (e.g. 'CST', 'PDT', 'EDT', 'MPST' ...).
  17361. */
  17362. getTimezone: function(date) {
  17363. // the following list shows the differences between date strings from different browsers on a WinXP SP2 machine from an Asian locale:
  17364. //
  17365. // Opera : "Thu, 25 Oct 2007 22:53:45 GMT+0800" -- shortest (weirdest) date string of the lot
  17366. // 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)
  17367. // FF : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone
  17368. // IE : "Thu Oct 25 22:54:35 UTC+0800 2007" -- (Asian system setting) look for 3-4 letter timezone abbrev
  17369. // IE : "Thu Oct 25 17:06:37 PDT 2007" -- (American system setting) look for 3-4 letter timezone abbrev
  17370. //
  17371. // this crazy regex attempts to guess the correct timezone abbreviation despite these differences.
  17372. // step 1: (?:\((.*)\) -- find timezone in parentheses
  17373. // 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
  17374. // step 3: remove all non uppercase characters found in step 1 and 2
  17375. return date.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,5})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/, "$1$2").replace(/[^A-Z]/g, "");
  17376. },
  17377. /**
  17378. * Get the offset from GMT of the current date (equivalent to the format specifier 'O').
  17379. *
  17380. * var dt = new Date('9/17/2011');
  17381. * console.log(Ext.Date.getGMTOffset(dt));
  17382. *
  17383. * @param {Date} date The date
  17384. * @param {Boolean} [colon=false] `true` to separate the hours and minutes with a colon.
  17385. * @return {String} The 4-character offset string prefixed with + or - (e.g. '-0600').
  17386. */
  17387. getGMTOffset: function(date, colon) {
  17388. var offset = date.getTimezoneOffset();
  17389. return (offset > 0 ? "-" : "+") + Ext.String.leftPad(Math.floor(Math.abs(offset) / 60), 2, "0") + (colon ? ":" : "") + Ext.String.leftPad(Math.abs(offset % 60), 2, "0");
  17390. },
  17391. /**
  17392. * Get the numeric day number of the year, adjusted for leap year.
  17393. *
  17394. * var dt = new Date('9/17/2011');
  17395. * console.log(Ext.Date.getDayOfYear(dt)); // 259
  17396. *
  17397. * @param {Date} date The date
  17398. * @return {Number} 0 to 364 (365 in leap years).
  17399. */
  17400. getDayOfYear: function(date) {
  17401. var num = 0,
  17402. d = utilDate.clone(date),
  17403. m = date.getMonth(),
  17404. i;
  17405. for (i = 0 , d.setDate(1) , d.setMonth(0); i < m; d.setMonth(++i)) {
  17406. num += utilDate.getDaysInMonth(d);
  17407. }
  17408. return num + date.getDate() - 1;
  17409. },
  17410. /**
  17411. * Get the numeric ISO-8601 week number of the year.
  17412. * (equivalent to the format specifier 'W', but without a leading zero).
  17413. *
  17414. * var dt = new Date('9/17/2011');
  17415. * console.log(Ext.Date.getWeekOfYear(dt)); // 37
  17416. *
  17417. * @param {Date} date The date.
  17418. * @return {Number} 1 to 53.
  17419. * @method
  17420. */
  17421. getWeekOfYear: (function() {
  17422. // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm
  17423. var ms1d = 86400000,
  17424. // milliseconds in a day
  17425. ms7d = 7 * ms1d;
  17426. // milliseconds in a week
  17427. return function(date) {
  17428. // return a closure so constants get calculated only once
  17429. var DC3 = nativeDate.UTC(date.getFullYear(), date.getMonth(), date.getDate() + 3) / ms1d,
  17430. // an Absolute Day Number
  17431. AWN = Math.floor(DC3 / 7),
  17432. // an Absolute Week Number
  17433. Wyr = new nativeDate(AWN * ms7d).getUTCFullYear();
  17434. return AWN - Math.floor(nativeDate.UTC(Wyr, 0, 7) / ms7d) + 1;
  17435. };
  17436. }()),
  17437. /**
  17438. * Checks if the current date falls within a leap year.
  17439. *
  17440. * var dt = new Date('1/10/2011');
  17441. * console.log(Ext.Date.isLeapYear(dt)); // false
  17442. *
  17443. * @param {Date} date The date
  17444. * @return {Boolean} `true` if the current date falls within a leap year, `false` otherwise.
  17445. */
  17446. isLeapYear: function(date) {
  17447. var year = date.getFullYear();
  17448. return !!((year & 3) === 0 && (year % 100 || (year % 400 === 0 && year)));
  17449. },
  17450. /**
  17451. * Get the first day of the current month, adjusted for leap year. The returned value
  17452. * is the numeric day index within the week (0-6) which can be used in conjunction with
  17453. * the {@link #monthNames} array to retrieve the textual day name.
  17454. *
  17455. * var dt = new Date('1/10/2007'),
  17456. * firstDay = Ext.Date.getFirstDayOfMonth(dt);
  17457. *
  17458. * console.log(Ext.Date.dayNames[firstDay]); // output: 'Monday'
  17459. *
  17460. * @param {Date} date The date
  17461. * @return {Number} The day number (0-6).
  17462. */
  17463. getFirstDayOfMonth: function(date) {
  17464. var day = (date.getDay() - (date.getDate() - 1)) % 7;
  17465. return (day < 0) ? (day + 7) : day;
  17466. },
  17467. /**
  17468. * Get the last day of the current month, adjusted for leap year. The returned value
  17469. * is the numeric day index within the week (0-6) which can be used in conjunction with
  17470. * the {@link #monthNames} array to retrieve the textual day name.
  17471. *
  17472. * var dt = new Date('1/10/2007'),
  17473. * lastDay = Ext.Date.getLastDayOfMonth(dt);
  17474. *
  17475. * console.log(Ext.Date.dayNames[lastDay]); // output: 'Wednesday'
  17476. *
  17477. * @param {Date} date The date
  17478. * @return {Number} The day number (0-6).
  17479. */
  17480. getLastDayOfMonth: function(date) {
  17481. return utilDate.getLastDateOfMonth(date).getDay();
  17482. },
  17483. /**
  17484. * Get the date of the first day of the month in which this date resides.
  17485. * @param {Date} date The date
  17486. * @return {Date}
  17487. */
  17488. getFirstDateOfMonth: function(date) {
  17489. return new nativeDate(date.getFullYear(), date.getMonth(), 1);
  17490. },
  17491. /**
  17492. * Get the date of the last day of the month in which this date resides.
  17493. * @param {Date} date The date
  17494. * @return {Date}
  17495. */
  17496. getLastDateOfMonth: function(date) {
  17497. return new nativeDate(date.getFullYear(), date.getMonth(), utilDate.getDaysInMonth(date));
  17498. },
  17499. /**
  17500. * Get the number of days in the current month, adjusted for leap year.
  17501. * @param {Date} date The date
  17502. * @return {Number} The number of days in the month.
  17503. * @method
  17504. */
  17505. getDaysInMonth: (function() {
  17506. var daysInMonth = [
  17507. 31,
  17508. 28,
  17509. 31,
  17510. 30,
  17511. 31,
  17512. 30,
  17513. 31,
  17514. 31,
  17515. 30,
  17516. 31,
  17517. 30,
  17518. 31
  17519. ];
  17520. return function(date) {
  17521. // return a closure for efficiency
  17522. var m = date.getMonth();
  17523. return m === 1 && utilDate.isLeapYear(date) ? 29 : daysInMonth[m];
  17524. };
  17525. }()),
  17526. /**
  17527. * Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').
  17528. * @param {Date} date The date
  17529. * @return {String} 'st, 'nd', 'rd' or 'th'.
  17530. * @locale
  17531. */
  17532. getSuffix: function(date) {
  17533. switch (date.getDate()) {
  17534. case 1:
  17535. case 21:
  17536. case 31:
  17537. return "st";
  17538. case 2:
  17539. case 22:
  17540. return "nd";
  17541. case 3:
  17542. case 23:
  17543. return "rd";
  17544. default:
  17545. return "th";
  17546. }
  17547. },
  17548. /**
  17549. * Creates and returns a new Date instance with the exact same date value as the called instance.
  17550. * Dates are copied and passed by reference, so if a copied date variable is modified later, the original
  17551. * variable will also be changed. When the intention is to create a new variable that will not
  17552. * modify the original instance, you should create a clone.
  17553. *
  17554. * Example of correctly cloning a date:
  17555. *
  17556. * //wrong way:
  17557. * var orig = new Date('10/1/2006');
  17558. * var copy = orig;
  17559. * copy.setDate(5);
  17560. * console.log(orig); // returns 'Thu Oct 05 2006'!
  17561. *
  17562. * //correct way:
  17563. * var orig = new Date('10/1/2006'),
  17564. * copy = Ext.Date.clone(orig);
  17565. * copy.setDate(5);
  17566. * console.log(orig); // returns 'Thu Oct 01 2006'
  17567. *
  17568. * @param {Date} date The date.
  17569. * @return {Date} The new Date instance.
  17570. */
  17571. clone: function(date) {
  17572. return new nativeDate(date.getTime());
  17573. },
  17574. /**
  17575. * Checks if the current date is affected by Daylight Saving Time (DST).
  17576. * @param {Date} date The date
  17577. * @return {Boolean} `true` if the current date is affected by DST.
  17578. */
  17579. isDST: function(date) {
  17580. // adapted from http://sencha.com/forum/showthread.php?p=247172#post247172
  17581. // courtesy of @geoffrey.mcgill
  17582. return new nativeDate(date.getFullYear(), 0, 1).getTimezoneOffset() !== date.getTimezoneOffset();
  17583. },
  17584. /**
  17585. * Attempts to clear all time information from this Date by setting the time to midnight of the same day,
  17586. * automatically adjusting for Daylight Saving Time (DST) where applicable.
  17587. *
  17588. * __Note:__ DST timezone information for the browser's host operating system is assumed to be up-to-date.
  17589. * @param {Date} date The date
  17590. * @param {Boolean} [clone=false] `true` to create a clone of this date, clear the time and return it.
  17591. * @return {Date} this or the clone.
  17592. */
  17593. clearTime: function(date, clone) {
  17594. // handles invalid dates preventing the browser from crashing.
  17595. if (isNaN(date.getTime())) {
  17596. return date;
  17597. }
  17598. if (clone) {
  17599. return utilDate.clearTime(utilDate.clone(date));
  17600. }
  17601. // get current date before clearing time
  17602. var d = date.getDate(),
  17603. hr, c;
  17604. // clear time
  17605. date.setHours(0);
  17606. date.setMinutes(0);
  17607. date.setSeconds(0);
  17608. date.setMilliseconds(0);
  17609. if (date.getDate() !== d) {
  17610. // account for DST (i.e. day of month changed when setting hour = 0)
  17611. // note: DST adjustments are assumed to occur in multiples of 1 hour (this is almost always the case)
  17612. // refer to http://www.timeanddate.com/time/aboutdst.html for the (rare) exceptions to this rule
  17613. // increment hour until cloned date == current date
  17614. for (hr = 1 , c = utilDate.add(date, utilDate.HOUR, hr); c.getDate() !== d; hr++ , c = utilDate.add(date, utilDate.HOUR, hr)){}
  17615. date.setDate(d);
  17616. date.setHours(c.getHours());
  17617. }
  17618. return date;
  17619. },
  17620. /**
  17621. * Provides a convenient method for performing basic date arithmetic. This method
  17622. * does not modify the Date instance being called - it creates and returns
  17623. * a new Date instance containing the resulting date value.
  17624. *
  17625. * Examples:
  17626. *
  17627. * // Basic usage:
  17628. * var dt = Ext.Date.add(new Date('10/29/2006'), Ext.Date.DAY, 5);
  17629. * console.log(dt); // returns 'Fri Nov 03 2006 00:00:00'
  17630. *
  17631. * // Negative values will be subtracted:
  17632. * var dt2 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, -5);
  17633. * console.log(dt2); // returns 'Tue Sep 26 2006 00:00:00'
  17634. *
  17635. * // Decimal values can be used:
  17636. * var dt3 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, 1.25);
  17637. * console.log(dt3); // returns 'Mon Oct 02 2006 06:00:00'
  17638. *
  17639. * @param {Date} date The date to modify
  17640. * @param {String} interval A valid date interval enum value.
  17641. * @param {Number} value The amount to add to the current date.
  17642. * @param {Boolean} [preventDstAdjust=false] `true` to prevent adjustments when crossing
  17643. * daylight savings boundaries.
  17644. * @return {Date} The new Date instance.
  17645. */
  17646. add: function(date, interval, value, preventDstAdjust) {
  17647. var d = utilDate.clone(date),
  17648. base = 0,
  17649. day, decimalValue;
  17650. if (!interval || value === 0) {
  17651. return d;
  17652. }
  17653. decimalValue = value - parseInt(value, 10);
  17654. value = parseInt(value, 10);
  17655. if (value) {
  17656. switch (interval.toLowerCase()) {
  17657. // See EXTJSIV-7418. We use setTime() here to deal with issues related to
  17658. // the switchover that occurs when changing to daylight savings and vice
  17659. // versa. setTime() handles this correctly where setHour/Minute/Second/Millisecond
  17660. // do not. Let's assume the DST change occurs at 2am and we're incrementing using add
  17661. // for 15 minutes at time. When entering DST, we should see:
  17662. // 01:30am
  17663. // 01:45am
  17664. // 03:00am // skip 2am because the hour does not exist
  17665. // ...
  17666. // Similarly, leaving DST, we should see:
  17667. // 01:30am
  17668. // 01:45am
  17669. // 01:00am // repeat 1am because that's the change over
  17670. // 01:30am
  17671. // 01:45am
  17672. // 02:00am
  17673. // ....
  17674. //
  17675. case utilDate.MILLI:
  17676. if (preventDstAdjust) {
  17677. d.setMilliseconds(d.getMilliseconds() + value);
  17678. } else {
  17679. d.setTime(d.getTime() + value);
  17680. };
  17681. break;
  17682. case utilDate.SECOND:
  17683. if (preventDstAdjust) {
  17684. d.setSeconds(d.getSeconds() + value);
  17685. } else {
  17686. d.setTime(d.getTime() + value * 1000);
  17687. };
  17688. break;
  17689. case utilDate.MINUTE:
  17690. if (preventDstAdjust) {
  17691. d.setMinutes(d.getMinutes() + value);
  17692. } else {
  17693. d.setTime(d.getTime() + value * 60 * 1000);
  17694. };
  17695. break;
  17696. case utilDate.HOUR:
  17697. if (preventDstAdjust) {
  17698. d.setHours(d.getHours() + value);
  17699. } else {
  17700. d.setTime(d.getTime() + value * 60 * 60 * 1000);
  17701. };
  17702. break;
  17703. case utilDate.DAY:
  17704. if (preventDstAdjust) {
  17705. d.setDate(d.getDate() + value);
  17706. } else {
  17707. d.setTime(d.getTime() + value * 24 * 60 * 60 * 1000);
  17708. };
  17709. break;
  17710. case utilDate.MONTH:
  17711. day = date.getDate();
  17712. if (day > 28) {
  17713. day = Math.min(day, utilDate.getLastDateOfMonth(utilDate.add(utilDate.getFirstDateOfMonth(date), utilDate.MONTH, value)).getDate());
  17714. };
  17715. d.setDate(day);
  17716. d.setMonth(date.getMonth() + value);
  17717. break;
  17718. case utilDate.YEAR:
  17719. day = date.getDate();
  17720. if (day > 28) {
  17721. day = Math.min(day, utilDate.getLastDateOfMonth(utilDate.add(utilDate.getFirstDateOfMonth(date), utilDate.YEAR, value)).getDate());
  17722. };
  17723. d.setDate(day);
  17724. d.setFullYear(date.getFullYear() + value);
  17725. break;
  17726. }
  17727. }
  17728. if (decimalValue) {
  17729. switch (interval.toLowerCase()) {
  17730. case utilDate.MILLI:
  17731. base = 1;
  17732. break;
  17733. case utilDate.SECOND:
  17734. base = 1000;
  17735. break;
  17736. case utilDate.MINUTE:
  17737. base = 1000 * 60;
  17738. break;
  17739. case utilDate.HOUR:
  17740. base = 1000 * 60 * 60;
  17741. break;
  17742. case utilDate.DAY:
  17743. base = 1000 * 60 * 60 * 24;
  17744. break;
  17745. case utilDate.MONTH:
  17746. day = utilDate.getDaysInMonth(d);
  17747. base = 1000 * 60 * 60 * 24 * day;
  17748. break;
  17749. case utilDate.YEAR:
  17750. day = (utilDate.isLeapYear(d) ? 366 : 365);
  17751. base = 1000 * 60 * 60 * 24 * day;
  17752. break;
  17753. }
  17754. if (base) {
  17755. d.setTime(d.getTime() + base * decimalValue);
  17756. }
  17757. }
  17758. return d;
  17759. },
  17760. /**
  17761. * Provides a convenient method for performing basic date arithmetic. This method
  17762. * does not modify the Date instance being called - it creates and returns
  17763. * a new Date instance containing the resulting date value.
  17764. *
  17765. * Examples:
  17766. *
  17767. * // Basic usage:
  17768. * var dt = Ext.Date.subtract(new Date('10/29/2006'), Ext.Date.DAY, 5);
  17769. * console.log(dt); // returns 'Tue Oct 24 2006 00:00:00'
  17770. *
  17771. * // Negative values will be added:
  17772. * var dt2 = Ext.Date.subtract(new Date('10/1/2006'), Ext.Date.DAY, -5);
  17773. * console.log(dt2); // returns 'Fri Oct 6 2006 00:00:00'
  17774. *
  17775. * // Decimal values can be used:
  17776. * var dt3 = Ext.Date.subtract(new Date('10/1/2006'), Ext.Date.DAY, 1.25);
  17777. * console.log(dt3); // returns 'Fri Sep 29 2006 06:00:00'
  17778. *
  17779. * @param {Date} date The date to modify
  17780. * @param {String} interval A valid date interval enum value.
  17781. * @param {Number} value The amount to subtract from the current date.
  17782. * @param {Boolean} [preventDstAdjust=false] `true` to prevent adjustments when crossing
  17783. * daylight savings boundaries.
  17784. * @return {Date} The new Date instance.
  17785. */
  17786. subtract: function(date, interval, value, preventDstAdjust) {
  17787. return utilDate.add(date, interval, -value, preventDstAdjust);
  17788. },
  17789. /**
  17790. * Checks if a date falls on or between the given start and end dates.
  17791. * @param {Date} date The date to check
  17792. * @param {Date} start Start date
  17793. * @param {Date} end End date
  17794. * @return {Boolean} `true` if this date falls on or between the given start and end dates.
  17795. */
  17796. between: function(date, start, end) {
  17797. var t = date.getTime();
  17798. return start.getTime() <= t && t <= end.getTime();
  17799. },
  17800. /**
  17801. * Checks if the date is a weekend day. Uses {@link #weekendDays}.
  17802. * @param {Date} date The date.
  17803. * @return {Boolean} `true` if the day falls on a weekend.
  17804. *
  17805. * @since 6.2.0
  17806. */
  17807. isWeekend: function(date) {
  17808. return Ext.Array.indexOf(this.weekendDays, date.getDay()) > -1;
  17809. },
  17810. /**
  17811. * Converts the passed UTC date into a local date.
  17812. * For example, if the passed date is:
  17813. * `Wed Jun 01 2016 00:10:00 GMT+1000 (AUS Eastern Standard Time)`, then
  17814. * the returned date will be `Wed Jun 01 2016 00:00:00 GMT+1000 (AUS Eastern Standard Time)`.
  17815. * @param {Date} d The date to convert.
  17816. * @return {Date} The date as a local. Does not modify the passed date.
  17817. *
  17818. * @since 6.2.0
  17819. */
  17820. utcToLocal: function(d) {
  17821. return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
  17822. },
  17823. /**
  17824. * Converts the passed local date into a UTC date.
  17825. * For example, if the passed date is:
  17826. * `Wed Jun 01 2016 00:00:00 GMT+1000 (AUS Eastern Standard Time)`, then
  17827. * the returned date will be `Wed Jun 01 2016 10:00:00 GMT+1000 (AUS Eastern Standard Time)`.
  17828. * @param {Date} d The date to convert.
  17829. * @return {Date} The date as UTC. Does not modify the passed date.
  17830. *
  17831. * @since 6.2.0
  17832. */
  17833. localToUtc: function(d) {
  17834. return utilDate.utc(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
  17835. },
  17836. /**
  17837. * Create a UTC date.
  17838. * @param {Number} year The year.
  17839. * @param {Number} month The month.
  17840. * @param {Number} day The day.
  17841. * @param {Number} [hour=0] The hour.
  17842. * @param {Number} [min=0] The minutes.
  17843. * @param {Number} [s=0] The seconds.
  17844. * @param {Number} [ms=0] The milliseconds.
  17845. * @return {Date} The UTC date.
  17846. *
  17847. * @since 6.2.0
  17848. */
  17849. utc: function(year, month, day, hour, min, s, ms) {
  17850. return new Date(Date.UTC(year, month, day, hour || 0, min || 0, s || 0, ms || 0));
  17851. },
  17852. //Maintains compatibility with old static and prototype window.Date methods.
  17853. compat: function() {
  17854. var p,
  17855. statics = [
  17856. 'useStrict',
  17857. 'formatCodeToRegex',
  17858. 'parseFunctions',
  17859. 'parseRegexes',
  17860. 'formatFunctions',
  17861. 'y2kYear',
  17862. 'MILLI',
  17863. 'SECOND',
  17864. 'MINUTE',
  17865. 'HOUR',
  17866. 'DAY',
  17867. 'MONTH',
  17868. 'YEAR',
  17869. 'defaults',
  17870. 'dayNames',
  17871. 'monthNames',
  17872. 'monthNumbers',
  17873. 'getShortMonthName',
  17874. 'getShortDayName',
  17875. 'getMonthNumber',
  17876. 'formatCodes',
  17877. 'isValid',
  17878. 'parseDate',
  17879. 'getFormatCode',
  17880. 'createFormat',
  17881. 'createParser',
  17882. 'parseCodes'
  17883. ],
  17884. proto = [
  17885. 'dateFormat',
  17886. 'format',
  17887. 'getTimezone',
  17888. 'getGMTOffset',
  17889. 'getDayOfYear',
  17890. 'getWeekOfYear',
  17891. 'isLeapYear',
  17892. 'getFirstDayOfMonth',
  17893. 'getLastDayOfMonth',
  17894. 'getDaysInMonth',
  17895. 'getSuffix',
  17896. 'clone',
  17897. 'isDST',
  17898. 'clearTime',
  17899. 'add',
  17900. 'between'
  17901. ],
  17902. sLen = statics.length,
  17903. pLen = proto.length,
  17904. stat, prot, s;
  17905. //Append statics
  17906. for (s = 0; s < sLen; s++) {
  17907. stat = statics[s];
  17908. nativeDate[stat] = utilDate[stat];
  17909. }
  17910. //Append to prototype
  17911. for (p = 0; p < pLen; p++) {
  17912. prot = proto[p];
  17913. nativeDate.prototype[prot] = function() {
  17914. var args = Array.prototype.slice.call(arguments);
  17915. args.unshift(this);
  17916. return utilDate[prot].apply(utilDate, args);
  17917. };
  17918. }
  17919. },
  17920. /**
  17921. * Calculate how many units are there between two time.
  17922. * @param {Date} min The first time.
  17923. * @param {Date} max The second time.
  17924. * @param {String} unit The unit. This unit is compatible with the date interval constants.
  17925. * @return {Number} The maximum number n of units that min + n * unit <= max.
  17926. */
  17927. diff: function(min, max, unit) {
  17928. var est,
  17929. diff = +max - min;
  17930. switch (unit) {
  17931. case utilDate.MILLI:
  17932. return diff;
  17933. case utilDate.SECOND:
  17934. return Math.floor(diff / 1000);
  17935. case utilDate.MINUTE:
  17936. return Math.floor(diff / 60000);
  17937. case utilDate.HOUR:
  17938. return Math.floor(diff / 3600000);
  17939. case utilDate.DAY:
  17940. return Math.floor(diff / 86400000);
  17941. case 'w':
  17942. return Math.floor(diff / 604800000);
  17943. case utilDate.MONTH:
  17944. est = (max.getFullYear() * 12 + max.getMonth()) - (min.getFullYear() * 12 + min.getMonth());
  17945. if (utilDate.add(min, unit, est) > max) {
  17946. return est - 1;
  17947. };
  17948. return est;
  17949. case utilDate.YEAR:
  17950. est = max.getFullYear() - min.getFullYear();
  17951. if (utilDate.add(min, unit, est) > max) {
  17952. return est - 1;
  17953. } else {
  17954. return est;
  17955. };
  17956. }
  17957. },
  17958. /**
  17959. * Align the date to `unit`.
  17960. * @param {Date} date The date to be aligned.
  17961. * @param {String} unit The unit. This unit is compatible with the date interval constants.
  17962. * @param {Number} step
  17963. * @return {Date} The aligned date.
  17964. */
  17965. align: function(date, unit, step) {
  17966. var num = new nativeDate(+date);
  17967. switch (unit.toLowerCase()) {
  17968. case utilDate.MILLI:
  17969. return num;
  17970. case utilDate.SECOND:
  17971. num.setUTCSeconds(num.getUTCSeconds() - num.getUTCSeconds() % step);
  17972. num.setUTCMilliseconds(0);
  17973. return num;
  17974. case utilDate.MINUTE:
  17975. num.setUTCMinutes(num.getUTCMinutes() - num.getUTCMinutes() % step);
  17976. num.setUTCSeconds(0);
  17977. num.setUTCMilliseconds(0);
  17978. return num;
  17979. case utilDate.HOUR:
  17980. num.setUTCHours(num.getUTCHours() - num.getUTCHours() % step);
  17981. num.setUTCMinutes(0);
  17982. num.setUTCSeconds(0);
  17983. num.setUTCMilliseconds(0);
  17984. return num;
  17985. case utilDate.DAY:
  17986. if (step === 7 || step === 14) {
  17987. num.setUTCDate(num.getUTCDate() - num.getUTCDay() + 1);
  17988. };
  17989. num.setUTCHours(0);
  17990. num.setUTCMinutes(0);
  17991. num.setUTCSeconds(0);
  17992. num.setUTCMilliseconds(0);
  17993. return num;
  17994. case utilDate.MONTH:
  17995. num.setUTCMonth(num.getUTCMonth() - (num.getUTCMonth() - 1) % step, 1);
  17996. num.setUTCHours(0);
  17997. num.setUTCMinutes(0);
  17998. num.setUTCSeconds(0);
  17999. num.setUTCMilliseconds(0);
  18000. return num;
  18001. case utilDate.YEAR:
  18002. num.setUTCFullYear(num.getUTCFullYear() - num.getUTCFullYear() % step, 1, 1);
  18003. num.setUTCHours(0);
  18004. num.setUTCMinutes(0);
  18005. num.setUTCSeconds(0);
  18006. num.setUTCMilliseconds(0);
  18007. return date;
  18008. }
  18009. }
  18010. };
  18011. utilDate.parseCodes.C = utilDate.parseCodes.c;
  18012. return utilDate;
  18013. }());
  18014. /**
  18015. * @class Ext.Function
  18016. *
  18017. * A collection of useful static methods to deal with function callbacks.
  18018. * @singleton
  18019. */
  18020. Ext.Function = (function() {
  18021. // @define Ext.lang.Function
  18022. // @define Ext.Function
  18023. // @require Ext
  18024. // @require Ext.lang.Array
  18025. var lastTime = 0,
  18026. animFrameId,
  18027. animFrameHandlers = [],
  18028. animFrameNoArgs = [],
  18029. idSource = 0,
  18030. animFrameMap = {},
  18031. slice = Array.prototype.slice,
  18032. win = window,
  18033. global = Ext.global,
  18034. // We disable setImmediate in unit tests because it derails internal Jasmine queue
  18035. hasImmediate = !Ext.disableImmediate && !!(global.setImmediate && global.clearImmediate),
  18036. requestAnimFrame = win.requestAnimationFrame || win.webkitRequestAnimationFrame || win.mozRequestAnimationFrame || win.oRequestAnimationFrame || function(callback) {
  18037. var currTime = Ext.now(),
  18038. timeToCall = Math.max(0, 16 - (currTime - lastTime)),
  18039. timerFn = function() {
  18040. callback(currTime + timeToCall);
  18041. },
  18042. id;
  18043. timerFn.$origFn = callback.$origFn || callback;
  18044. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18045. id = win.setTimeout(timerFn, timeToCall);
  18046. lastTime = currTime + timeToCall;
  18047. return id;
  18048. },
  18049. fireHandlers = function() {
  18050. var len = animFrameHandlers.length,
  18051. id, i, handler;
  18052. animFrameId = null;
  18053. var timer;
  18054. // Fire all animation frame handlers in one go
  18055. for (i = 0; i < len; i++) {
  18056. handler = animFrameHandlers[i];
  18057. id = handler[3];
  18058. // Check if this timer has been canceled; its map entry is going to be removed
  18059. if (animFrameMap[id]) {
  18060. delete animFrameMap[id];
  18061. timer = Ext.Timer.get(id, 'raf');
  18062. if (timer) {
  18063. timer.tick();
  18064. }
  18065. handler[0].apply(handler[1] || global, handler[2] || animFrameNoArgs);
  18066. if (timer) {
  18067. timer.tock();
  18068. }
  18069. }
  18070. }
  18071. // Clear all fired animation frame handlers, don't forget that new handlers
  18072. // could have been created in user handler functions called in the loop above
  18073. animFrameHandlers = animFrameHandlers.slice(len);
  18074. },
  18075. fireElevatedHandlers = function() {
  18076. Ext.elevate(fireHandlers);
  18077. },
  18078. ExtFunction = {
  18079. /**
  18080. * A very commonly used method throughout the framework. It acts as a wrapper around another method
  18081. * which originally accepts 2 arguments for `name` and `value`.
  18082. * The wrapped function then allows "flexible" value setting of either:
  18083. *
  18084. * - `name` and `value` as 2 arguments
  18085. * - one single object argument with multiple key - value pairs
  18086. *
  18087. * For example:
  18088. *
  18089. * var setValue = Ext.Function.flexSetter(function(name, value) {
  18090. * this[name] = value;
  18091. * });
  18092. *
  18093. * // Afterwards
  18094. * // Setting a single name - value
  18095. * setValue('name1', 'value1');
  18096. *
  18097. * // Settings multiple name - value pairs
  18098. * setValue({
  18099. * name1: 'value1',
  18100. * name2: 'value2',
  18101. * name3: 'value3'
  18102. * });
  18103. *
  18104. * @param {Function} setter The single value setter method.
  18105. * @param {String} setter.name The name of the value being set.
  18106. * @param {Object} setter.value The value being set.
  18107. * @return {Function}
  18108. */
  18109. flexSetter: function(setter) {
  18110. return function(name, value) {
  18111. var k, i;
  18112. if (name !== null) {
  18113. if (typeof name !== 'string') {
  18114. for (k in name) {
  18115. if (name.hasOwnProperty(k)) {
  18116. setter.call(this, k, name[k]);
  18117. }
  18118. }
  18119. if (Ext.enumerables) {
  18120. for (i = Ext.enumerables.length; i--; ) {
  18121. k = Ext.enumerables[i];
  18122. if (name.hasOwnProperty(k)) {
  18123. setter.call(this, k, name[k]);
  18124. }
  18125. }
  18126. }
  18127. } else {
  18128. setter.call(this, name, value);
  18129. }
  18130. }
  18131. return this;
  18132. };
  18133. },
  18134. /**
  18135. * Create a new function from the provided `fn`, change `this` to the provided scope,
  18136. * optionally overrides arguments for the call. Defaults to the arguments passed by
  18137. * the caller.
  18138. *
  18139. * {@link Ext#bind Ext.bind} is alias for {@link Ext.Function#bind Ext.Function.bind}
  18140. *
  18141. * **NOTE:** This method is similar to the native `bind()` method. The major difference
  18142. * is in the way the parameters are passed. This method expects an array of parameters,
  18143. * and if supplied, it does not automatically pass forward parameters from the bound
  18144. * function:
  18145. *
  18146. * function foo (a, b, c) {
  18147. * console.log(a, b, c);
  18148. * }
  18149. *
  18150. * var nativeFn = foo.bind(this, 1, 2);
  18151. * var extFn = Ext.Function.bind(foo, this, [1, 2]);
  18152. *
  18153. * nativeFn(3); // 1, 2, 3
  18154. * extFn(3); // 1, 2, undefined
  18155. *
  18156. * This method is unavailable natively on IE8 and IE/Quirks but Ext JS provides a
  18157. * "polyfill" to emulate the important features of the standard `bind` method. In
  18158. * particular, the polyfill only provides binding of "this" and optional arguments.
  18159. *
  18160. * @param {Function} fn The function to delegate.
  18161. * @param {Object} [scope] The scope (`this` reference) in which the function
  18162. * is executed.
  18163. * **If omitted, defaults to the global environment object (usually the browser `window`).**
  18164. * @param {Array} [args] Overrides arguments for the call. (Defaults to
  18165. * the arguments passed by the caller).
  18166. * @param {Boolean/Number} [appendArgs] if `true` the `args` are appended to the
  18167. * arguments passed to the returned wrapper (by default these arguments are ignored).
  18168. * If a number then the `args` are inserted at the specified position.
  18169. * @return {Function} The bound wrapper function.
  18170. */
  18171. bind: function(fn, scope, args, appendArgs) {
  18172. // Function.prototype.bind is polyfilled in IE8, otherwise native
  18173. if (arguments.length <= 2) {
  18174. return fn.bind(scope);
  18175. }
  18176. var method = fn;
  18177. return function() {
  18178. var callArgs = args || arguments;
  18179. if (appendArgs === true) {
  18180. callArgs = slice.call(arguments, 0);
  18181. callArgs = callArgs.concat(args);
  18182. } else if (typeof appendArgs === 'number') {
  18183. callArgs = slice.call(arguments, 0);
  18184. // copy arguments first
  18185. Ext.Array.insert(callArgs, appendArgs, args);
  18186. }
  18187. return method.apply(scope || global, callArgs);
  18188. };
  18189. },
  18190. /**
  18191. * Captures the given parameters for a later call to `Ext.callback`. This binding is
  18192. * most useful for resolving scopes for example to an `Ext.app.ViewController`.
  18193. *
  18194. * The arguments match that of `Ext.callback` except for the `args` which, if provided
  18195. * to this method, are prepended to any arguments supplied by the eventual caller of
  18196. * the returned function.
  18197. *
  18198. * @return {Function} A function that, when called, uses `Ext.callback` to call the
  18199. * captured `callback`.
  18200. * @since 5.0.0
  18201. */
  18202. bindCallback: function(callback, scope, args, delay, caller) {
  18203. return function() {
  18204. var a = slice.call(arguments);
  18205. return Ext.callback(callback, scope, args ? args.concat(a) : a, delay, caller);
  18206. };
  18207. },
  18208. /**
  18209. * Create a new function from the provided `fn`, the arguments of which are pre-set to `args`.
  18210. * New arguments passed to the newly created callback when it's invoked are appended after the pre-set ones.
  18211. * This is especially useful when creating callbacks.
  18212. *
  18213. * For example:
  18214. *
  18215. * var originalFunction = function(){
  18216. * alert(Ext.Array.from(arguments).join(' '));
  18217. * };
  18218. *
  18219. * var callback = Ext.Function.pass(originalFunction, ['Hello', 'World']);
  18220. *
  18221. * callback(); // alerts 'Hello World'
  18222. * callback('by Me'); // alerts 'Hello World by Me'
  18223. *
  18224. * {@link Ext#pass Ext.pass} is alias for {@link Ext.Function#pass Ext.Function.pass}
  18225. *
  18226. * @param {Function} fn The original function.
  18227. * @param {Array} args The arguments to pass to new callback.
  18228. * @param {Object} scope (optional) The scope (`this` reference) in which the function is executed.
  18229. * @return {Function} The new callback function.
  18230. */
  18231. pass: function(fn, args, scope) {
  18232. if (!Ext.isArray(args)) {
  18233. if (Ext.isIterable(args)) {
  18234. args = Ext.Array.clone(args);
  18235. } else {
  18236. args = args !== undefined ? [
  18237. args
  18238. ] : [];
  18239. }
  18240. }
  18241. return function() {
  18242. var fnArgs = args.slice();
  18243. fnArgs.push.apply(fnArgs, arguments);
  18244. return fn.apply(scope || this, fnArgs);
  18245. };
  18246. },
  18247. /**
  18248. * Create an alias to the provided method property with name `methodName` of `object`.
  18249. * Note that the execution scope will still be bound to the provided `object` itself.
  18250. *
  18251. * @param {Object/Function} object
  18252. * @param {String} methodName
  18253. * @return {Function} aliasFn
  18254. */
  18255. alias: function(object, methodName) {
  18256. return function() {
  18257. return object[methodName].apply(object, arguments);
  18258. };
  18259. },
  18260. /**
  18261. * Create a "clone" of the provided method. The returned method will call the given
  18262. * method passing along all arguments and the "this" pointer and return its result.
  18263. *
  18264. * @param {Function} method
  18265. * @return {Function} cloneFn
  18266. */
  18267. clone: function(method) {
  18268. var newMethod, prop;
  18269. newMethod = function() {
  18270. return method.apply(this, arguments);
  18271. };
  18272. for (prop in method) {
  18273. if (method.hasOwnProperty(prop)) {
  18274. newMethod[prop] = method[prop];
  18275. }
  18276. }
  18277. return newMethod;
  18278. },
  18279. /**
  18280. * Creates an interceptor function. The passed function is called before the original one. If it returns false,
  18281. * the original one is not called. The resulting function returns the results of the original function.
  18282. * The passed function is called with the parameters of the original function. Example usage:
  18283. *
  18284. * var sayHi = function(name){
  18285. * alert('Hi, ' + name);
  18286. * };
  18287. *
  18288. * sayHi('Fred'); // alerts "Hi, Fred"
  18289. *
  18290. * // create a new function that validates input without
  18291. * // directly modifying the original function:
  18292. * var sayHiToFriend = Ext.Function.createInterceptor(sayHi, function(name){
  18293. * return name === 'Brian';
  18294. * });
  18295. *
  18296. * sayHiToFriend('Fred'); // no alert
  18297. * sayHiToFriend('Brian'); // alerts "Hi, Brian"
  18298. *
  18299. * @param {Function} origFn The original function.
  18300. * @param {Function} newFn The function to call before the original.
  18301. * @param {Object} [scope] The scope (`this` reference) in which the passed function is executed.
  18302. * **If omitted, defaults to the scope in which the original function is called or the browser window.**
  18303. * @param {Object} [returnValue=null] The value to return if the passed function return `false`.
  18304. * @return {Function} The new function.
  18305. */
  18306. createInterceptor: function(origFn, newFn, scope, returnValue) {
  18307. if (!Ext.isFunction(newFn)) {
  18308. return origFn;
  18309. } else {
  18310. returnValue = Ext.isDefined(returnValue) ? returnValue : null;
  18311. return function() {
  18312. var me = this,
  18313. args = arguments;
  18314. return (newFn.apply(scope || me || global, args) !== false) ? origFn.apply(me || global, args) : returnValue;
  18315. };
  18316. }
  18317. },
  18318. /**
  18319. * Creates a delegate (callback) which, when called, executes after a specific delay.
  18320. *
  18321. * @param {Function} fn The function which will be called on a delay when the returned function is called.
  18322. * Optionally, a replacement (or additional) argument list may be specified.
  18323. * @param {Number} delay The number of milliseconds to defer execution by whenever called.
  18324. * @param {Object} scope (optional) The scope (`this` reference) used by the function at execution time.
  18325. * @param {Array} args (optional) Override arguments for the call. (Defaults to the arguments passed by the caller)
  18326. * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding,
  18327. * if a number the args are inserted at the specified position.
  18328. * @return {Function} A function which, when called, executes the original function after the specified delay.
  18329. */
  18330. createDelayed: function(fn, delay, scope, args, appendArgs) {
  18331. var boundFn = fn;
  18332. if (scope || args) {
  18333. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  18334. }
  18335. return function() {
  18336. var me = this,
  18337. args = slice.call(arguments),
  18338. timerFn, timerId;
  18339. var timer;
  18340. timerFn = function() {
  18341. Ext.elevate(boundFn, me, args, timer);
  18342. };
  18343. timerId = setTimeout(timerFn, delay);
  18344. timerFn.$origFn = fn.$origFn || fn;
  18345. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18346. timer = Ext.Timer.created('timeout', timerId, {
  18347. type: 'createDelayed',
  18348. fn: fn,
  18349. timerFn: timerFn
  18350. });
  18351. };
  18352. },
  18353. /**
  18354. * Calls function `fn` after the number of milliseconds specified, optionally with
  18355. * a specific `scope` (`this` pointer).
  18356. *
  18357. * Example usage:
  18358. *
  18359. * var sayHi = function (name) {
  18360. * alert('Hi, ' + name);
  18361. * }
  18362. *
  18363. * // executes immediately:
  18364. * sayHi('Fred');
  18365. *
  18366. * // executes after 2 seconds:
  18367. * Ext.defer(sayHi, 2000, this, ['Fred']);
  18368. *
  18369. * The following syntax is useful for scheduling anonymous functions:
  18370. *
  18371. * Ext.defer(function () {
  18372. * alert('Anonymous');
  18373. * }, 100);
  18374. *
  18375. * NOTE: The `Ext.Function.defer()` method is an alias for `Ext.defer()`.
  18376. *
  18377. * @param {Function} fn The function to defer.
  18378. * @param {Number} millis The number of milliseconds for the `setTimeout` call
  18379. * (if less than or equal to 0 the function is executed immediately).
  18380. * @param {Object} scope (optional) The scope (`this` reference) in which the function is executed.
  18381. * **If omitted, defaults to the browser window.**
  18382. * @param {Array} [args] Overrides arguments for the call. Defaults to the arguments passed by the caller.
  18383. * @param {Boolean/Number} [appendArgs=false] If `true` args are appended to call args instead of overriding,
  18384. * or, if a number, then the args are inserted at the specified position.
  18385. * @return {Number} The timeout id that can be used with `Ext.undefer`.
  18386. */
  18387. defer: function(fn, millis, scope, args, appendArgs) {
  18388. var timerId = 0,
  18389. timerFn, boundFn;
  18390. var timer;
  18391. if (!scope && !args && !appendArgs) {
  18392. boundFn = fn;
  18393. } else {
  18394. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  18395. }
  18396. if (millis > 0) {
  18397. timerFn = function() {
  18398. Ext.elevate(boundFn, null, null, timer);
  18399. };
  18400. timerId = setTimeout(timerFn, millis);
  18401. timerFn.$origFn = fn.$origFn || fn;
  18402. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18403. timer = Ext.Timer.created('timeout', timerId, {
  18404. type: 'defer',
  18405. fn: fn,
  18406. timerFn: timerFn
  18407. });
  18408. } else {
  18409. boundFn();
  18410. }
  18411. return timerId;
  18412. },
  18413. /**
  18414. * Calls the function `fn` repeatedly at a given interval, optionally with a
  18415. * specific `scope` (`this` pointer).
  18416. *
  18417. * var sayHi = function (name) {
  18418. * console.log('Hi, ' + name);
  18419. * }
  18420. *
  18421. * // executes every 2 seconds:
  18422. * var timerId = Ext.interval(sayHi, 2000, this, ['Fred']);
  18423. *
  18424. * The timer is stopped by:
  18425. *
  18426. * Ext.uninterval(timerId);
  18427. *
  18428. * NOTE: The `Ext.Function.interval()` method is an alias for `Ext.interval()`.
  18429. *
  18430. * @param {Function} fn The function to defer.
  18431. * @param {Number} millis The number of milliseconds for the `setInterval` call
  18432. * @param {Object} scope (optional) The scope (`this` reference) in which the function is executed.
  18433. * **If omitted, defaults to the browser window.**
  18434. * @param {Array} [args] Overrides arguments for the call. Defaults to the arguments passed by the caller.
  18435. * @param {Boolean/Number} [appendArgs=false] If `true` args are appended to call args instead of overriding,
  18436. * or, if a number, then the args are inserted at the specified position.
  18437. * @return {Number} The interval id that can be used with `Ext.uninterval`.
  18438. */
  18439. interval: function(fn, millis, scope, args, appendArgs) {
  18440. var timerFn, timerId, boundFn;
  18441. var timer;
  18442. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  18443. timerFn = function() {
  18444. Ext.elevate(boundFn, null, null, timer);
  18445. };
  18446. timerId = setInterval(timerFn, millis);
  18447. timerFn.$origFn = boundFn.$origFn || fn;
  18448. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18449. timer = Ext.Timer.created('interval', timerId, {
  18450. type: 'interval',
  18451. fn: fn,
  18452. timerFn: timerFn
  18453. });
  18454. return timerId;
  18455. },
  18456. /**
  18457. * Create a combined function call sequence of the original function + the passed function.
  18458. * The resulting function returns the results of the original function.
  18459. * The passed function is called with the parameters of the original function. Example usage:
  18460. *
  18461. * var sayHi = function(name){
  18462. * alert('Hi, ' + name);
  18463. * };
  18464. *
  18465. * sayHi('Fred'); // alerts "Hi, Fred"
  18466. *
  18467. * var sayGoodbye = Ext.Function.createSequence(sayHi, function(name){
  18468. * alert('Bye, ' + name);
  18469. * });
  18470. *
  18471. * sayGoodbye('Fred'); // both alerts show
  18472. *
  18473. * @param {Function} originalFn The original function.
  18474. * @param {Function} newFn The function to sequence.
  18475. * @param {Object} [scope] The scope (`this` reference) in which the passed function is executed.
  18476. * If omitted, defaults to the scope in which the original function is called or the
  18477. * default global environment object (usually the browser window).
  18478. * @return {Function} The new function.
  18479. */
  18480. createSequence: function(originalFn, newFn, scope) {
  18481. if (!newFn) {
  18482. return originalFn;
  18483. } else {
  18484. return function() {
  18485. var result = originalFn.apply(this, arguments);
  18486. newFn.apply(scope || this, arguments);
  18487. return result;
  18488. };
  18489. }
  18490. },
  18491. /**
  18492. * Creates a delegate function, optionally with a bound scope which, when called, buffers
  18493. * the execution of the passed function for the configured number of milliseconds.
  18494. * If called again within that period, the impending invocation will be canceled, and the
  18495. * timeout period will begin again.
  18496. *
  18497. * @param {Function} fn The function to invoke on a buffered timer.
  18498. * @param {Number} buffer The number of milliseconds by which to buffer the invocation of the
  18499. * function.
  18500. * @param {Object} [scope] The scope (`this` reference) in which.
  18501. * the passed function is executed. If omitted, defaults to the scope specified by the caller.
  18502. * @param {Array} [args] Override arguments for the call. Defaults to the arguments
  18503. * passed by the caller.
  18504. * @return {Function} A function which invokes the passed function after buffering for the specified time.
  18505. */
  18506. createBuffered: function(fn, buffer, scope, args) {
  18507. var timerId,
  18508. result = function() {
  18509. var callArgs = args || slice.call(arguments, 0),
  18510. me = scope || this,
  18511. timerFn;
  18512. var timer;
  18513. if (timerId) {
  18514. Ext.undefer(timerId);
  18515. }
  18516. timerFn = function() {
  18517. Ext.elevate(fn, me, callArgs, timer);
  18518. };
  18519. result.timer = timerId = setTimeout(timerFn, buffer);
  18520. timerFn.$origFn = fn.$origFn || fn;
  18521. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18522. timer = Ext.Timer.created('timeout', timerId, {
  18523. type: 'createBuffered',
  18524. fn: fn,
  18525. timerFn: timerFn
  18526. });
  18527. };
  18528. return result;
  18529. },
  18530. /**
  18531. * Creates a wrapped function that, when invoked, defers execution until the next
  18532. * animation frame
  18533. * @private
  18534. * @param {Function} fn The function to call.
  18535. * @param {Object} [scope] The scope (`this` reference) in which the function is executed. Defaults to the window object.
  18536. * @param {Array} [args] The argument list to pass to the function.
  18537. * @param {Number} [queueStrategy=3] A bit flag that indicates how multiple calls to
  18538. * the returned function within the same animation frame should be handled.
  18539. *
  18540. * - 1: All calls will be queued - FIFO order
  18541. * - 2: Only the first call will be queued
  18542. * - 3: The last call will replace all previous calls
  18543. *
  18544. * @return {Function}
  18545. */
  18546. createAnimationFrame: function(fn, scope, args, queueStrategy) {
  18547. var boundFn, timerId;
  18548. queueStrategy = queueStrategy || 3;
  18549. boundFn = function() {
  18550. var timerFn,
  18551. callArgs = args || slice.call(arguments, 0);
  18552. scope = scope || this;
  18553. if (queueStrategy === 3 && timerId) {
  18554. ExtFunction.cancelAnimationFrame(timerId);
  18555. }
  18556. if ((queueStrategy & 1) || !timerId) {
  18557. timerFn = function() {
  18558. timerId = boundFn.timerId = null;
  18559. fn.apply(scope, callArgs);
  18560. };
  18561. timerFn.$origFn = fn.$origFn || fn;
  18562. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18563. timerId = boundFn.timerId = ExtFunction.requestAnimationFrame(timerFn);
  18564. }
  18565. };
  18566. return boundFn;
  18567. },
  18568. /**
  18569. * @private
  18570. * Schedules the passed function to be called on the next animation frame.
  18571. * @param {Function} fn The function to call.
  18572. * @param {Object} [scope] The scope (`this` reference) in which the function is executed. Defaults to the window object.
  18573. * @param {Mixed[]} [args] The argument list to pass to the function.
  18574. *
  18575. * @return {Number} Timer id for the new animation frame to use when canceling it.
  18576. */
  18577. requestAnimationFrame: function(fn, scope, args) {
  18578. var id = ++idSource,
  18579. // Ids start at 1
  18580. handler = slice.call(arguments, 0);
  18581. handler[3] = id;
  18582. animFrameMap[id] = 1;
  18583. // A flag to indicate that the timer exists
  18584. Ext.Timer.created('raf', id, {
  18585. type: 'raf',
  18586. fn: fn
  18587. });
  18588. // We might be in fireHandlers at this moment but this new entry will not
  18589. // be executed until the next frame
  18590. animFrameHandlers.push(handler);
  18591. if (!animFrameId) {
  18592. animFrameId = requestAnimFrame(fireElevatedHandlers);
  18593. }
  18594. return id;
  18595. },
  18596. cancelAnimationFrame: function(id) {
  18597. // Don't remove any handlers from animFrameHandlers array, because
  18598. // the might be in use at the moment (when cancelAnimationFrame is called).
  18599. // Just remove the handler id from the map so it will not be executed
  18600. delete animFrameMap[id];
  18601. Ext.Timer.cancel('raf', id);
  18602. },
  18603. /**
  18604. * Creates a throttled version of the passed function which, when called repeatedly and
  18605. * rapidly, invokes the passed function only after a certain interval has elapsed since the
  18606. * previous invocation.
  18607. *
  18608. * This is useful for wrapping functions which may be called repeatedly, such as
  18609. * a handler of a mouse move event when the processing is expensive.
  18610. *
  18611. * @param {Function} fn The function to execute at a regular time interval.
  18612. * @param {Number} interval The interval in milliseconds on which the passed function is executed.
  18613. * @param {Object} [scope] The scope (`this` reference) in which
  18614. * the passed function is executed. If omitted, defaults to the scope specified by the caller.
  18615. * @return {Function} A function which invokes the passed function at the specified interval.
  18616. */
  18617. createThrottled: function(fn, interval, scope) {
  18618. var lastCallTime = 0,
  18619. elapsed, lastArgs, timerId,
  18620. execute = function() {
  18621. fn.apply(scope, lastArgs);
  18622. lastCallTime = Ext.now();
  18623. lastArgs = timerId = null;
  18624. };
  18625. execute.$origFn = fn.$origFn || fn;
  18626. execute.$skipTimerCheck = execute.$origFn.$skipTimerCheck;
  18627. return function() {
  18628. // Use scope of last call unless the creator specified a scope
  18629. if (!scope) {
  18630. scope = this;
  18631. }
  18632. elapsed = Ext.now() - lastCallTime;
  18633. lastArgs = Ext.Array.slice(arguments);
  18634. // If this is the first invocation, or the throttle interval has been reached, clear any
  18635. // pending invocation, and call the target function now.
  18636. if (elapsed >= interval) {
  18637. Ext.undefer(timerId);
  18638. execute();
  18639. }
  18640. // Throttle interval has not yet been reached. Only set the timer to fire if not already set.
  18641. else if (!timerId) {
  18642. timerId = Ext.defer(execute, interval - elapsed);
  18643. }
  18644. };
  18645. },
  18646. /**
  18647. * Wraps the passed function in a barrier function which will call the passed function after the passed number of invocations.
  18648. * @param {Number} count The number of invocations which will result in the calling of the passed function.
  18649. * @param {Function} fn The function to call after the required number of invocations.
  18650. * @param {Object} scope The scope (`this` reference) in which the function will be called.
  18651. */
  18652. createBarrier: function(count, fn, scope) {
  18653. var barrierFn = function() {
  18654. if (!--count) {
  18655. fn.apply(scope, arguments);
  18656. }
  18657. };
  18658. barrierFn.$origFn = fn.$origFn || fn;
  18659. barrierFn.$skipTimerCheck = barrierFn.$origFn.$skipTimerCheck;
  18660. return barrierFn;
  18661. },
  18662. /**
  18663. * Adds behavior to an existing method that is executed before the
  18664. * original behavior of the function. For example:
  18665. *
  18666. * var soup = {
  18667. * contents: [],
  18668. * add: function(ingredient) {
  18669. * this.contents.push(ingredient);
  18670. * }
  18671. * };
  18672. * Ext.Function.interceptBefore(soup, "add", function(ingredient){
  18673. * if (!this.contents.length && ingredient !== "water") {
  18674. * // Always add water to start with
  18675. * this.contents.push("water");
  18676. * }
  18677. * });
  18678. * soup.add("onions");
  18679. * soup.add("salt");
  18680. * soup.contents; // will contain: water, onions, salt
  18681. *
  18682. * @param {Object} object The target object
  18683. * @param {String} methodName Name of the method to override
  18684. * @param {Function} fn Function with the new behavior. It will
  18685. * be called with the same arguments as the original method. The
  18686. * return value of this function will be the return value of the
  18687. * new method.
  18688. * @param {Object} [scope] The scope to execute the interceptor function. Defaults to the object.
  18689. * @return {Function} The new function just created.
  18690. */
  18691. interceptBefore: function(object, methodName, fn, scope) {
  18692. var method = object[methodName] || Ext.emptyFn;
  18693. return (object[methodName] = function() {
  18694. var ret = fn.apply(scope || this, arguments);
  18695. method.apply(this, arguments);
  18696. return ret;
  18697. });
  18698. },
  18699. /**
  18700. * Adds behavior to an existing method that is executed after the
  18701. * original behavior of the function. For example:
  18702. *
  18703. * var soup = {
  18704. * contents: [],
  18705. * add: function(ingredient) {
  18706. * this.contents.push(ingredient);
  18707. * }
  18708. * };
  18709. * Ext.Function.interceptAfter(soup, "add", function(ingredient){
  18710. * // Always add a bit of extra salt
  18711. * this.contents.push("salt");
  18712. * });
  18713. * soup.add("water");
  18714. * soup.add("onions");
  18715. * soup.contents; // will contain: water, salt, onions, salt
  18716. *
  18717. * @param {Object} object The target object
  18718. * @param {String} methodName Name of the method to override
  18719. * @param {Function} fn Function with the new behavior. It will
  18720. * be called with the same arguments as the original method. The
  18721. * return value of this function will be the return value of the
  18722. * new method.
  18723. * @param {Object} [scope] The scope to execute the interceptor function. Defaults to the object.
  18724. * @return {Function} The new function just created.
  18725. */
  18726. interceptAfter: function(object, methodName, fn, scope) {
  18727. var method = object[methodName] || Ext.emptyFn;
  18728. return (object[methodName] = function() {
  18729. method.apply(this, arguments);
  18730. return fn.apply(scope || this, arguments);
  18731. });
  18732. },
  18733. interceptAfterOnce: function(object, methodName, fn, scope) {
  18734. var origMethod = object[methodName],
  18735. newMethod;
  18736. newMethod = function() {
  18737. var ret;
  18738. if (origMethod) {
  18739. origMethod.apply(this, arguments);
  18740. }
  18741. ret = fn.apply(scope || this, arguments);
  18742. object[methodName] = origMethod;
  18743. object = methodName = fn = scope = origMethod = newMethod = null;
  18744. return ret;
  18745. };
  18746. object[methodName] = newMethod;
  18747. return newMethod;
  18748. },
  18749. makeCallback: function(callback, scope) {
  18750. if (!scope[callback]) {
  18751. if (scope.$className) {
  18752. Ext.raise('No method "' + callback + '" on ' + scope.$className);
  18753. }
  18754. Ext.raise('No method "' + callback + '"');
  18755. }
  18756. return function() {
  18757. return scope[callback].apply(scope, arguments);
  18758. };
  18759. },
  18760. /**
  18761. * Returns a wrapper function that caches the return value for previously
  18762. * processed function argument(s).
  18763. *
  18764. * For example:
  18765. *
  18766. * function factorial (value) {
  18767. * var ret = value;
  18768. *
  18769. * while (--value > 1) {
  18770. * ret *= value;
  18771. * }
  18772. *
  18773. * return ret;
  18774. * }
  18775. *
  18776. * Each call to `factorial` will loop and multiply to produce the answer. Using
  18777. * this function we can wrap the above and cache its answers:
  18778. *
  18779. * factorial = Ext.Function.memoize(factorial);
  18780. *
  18781. * The returned function operates in the same manner as before, but results are
  18782. * stored in a cache to avoid calling the wrapped function when given the same
  18783. * arguments.
  18784. *
  18785. * var x = factorial(20); // first time; call real factorial()
  18786. * var y = factorial(20); // second time; return value from first call
  18787. *
  18788. * To support multi-argument methods, you will need to provide a `hashFn`.
  18789. *
  18790. * function permutation (n, k) {
  18791. * return factorial(n) / factorial(n - k);
  18792. * }
  18793. *
  18794. * permutation = Ext.Function.memoize(permutation, null, function (n, k) {
  18795. * n + '-' + k;
  18796. * });
  18797. *
  18798. * In this case, the `memoize` of `factorial` is sufficient optimization, but the
  18799. * example is simply to illustrate how to generate a unique key for an expensive,
  18800. * multi-argument method.
  18801. *
  18802. * **IMPORTANT**: This cache is unbounded so be cautious of memory leaks if the
  18803. * `memoize`d function is kept indefinitely or is given an unbounded set of
  18804. * possible arguments.
  18805. *
  18806. * @param {Function} fn Function to wrap.
  18807. * @param {Object} scope Optional scope in which to execute the wrapped function.
  18808. * @param {Function} hashFn Optional function used to compute a hash key for
  18809. * storing the result, based on the arguments to the original function.
  18810. * @return {Function} The caching wrapper function.
  18811. * @since 6.0.0
  18812. */
  18813. memoize: function(fn, scope, hashFn) {
  18814. var memo = {},
  18815. isFunc = hashFn && Ext.isFunction(hashFn);
  18816. return function(value) {
  18817. var key = isFunc ? hashFn.apply(scope, arguments) : value;
  18818. if (!(key in memo)) {
  18819. memo[key] = fn.apply(scope, arguments);
  18820. }
  18821. return memo[key];
  18822. };
  18823. },
  18824. _stripCommentRe: /(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(\/\/.*)/g,
  18825. toCode: function(fn) {
  18826. var s = fn ? fn.toString() : '';
  18827. s = s.replace(ExtFunction._stripCommentRe, '');
  18828. return s;
  18829. },
  18830. // This is useful for unit testing so we can force handlers which have been deferred
  18831. // to the next animation frame to run immediately
  18832. fireElevatedHandlers: function() {
  18833. fireElevatedHandlers();
  18834. }
  18835. };
  18836. // ExtFunction
  18837. /**
  18838. * @member Ext
  18839. * @method asap
  18840. * Schedules the specified callback function to be executed on the next turn of the
  18841. * event loop. Where available, this method uses the browser's `setImmediate` API. If
  18842. * not available, this method substitutes `setTimeout(0)`. Though not a perfect
  18843. * replacement for `setImmediate` it is sufficient for many use cases.
  18844. *
  18845. * For more details see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate).
  18846. *
  18847. * @param {Function} fn Callback function.
  18848. * @param {Object} [scope] The scope for the callback (`this` pointer).
  18849. * @param {Mixed[]} [parameters] Additional parameters to pass to `fn`.
  18850. * @return {Number} A cancellation id for `{@link Ext#unasap}`.
  18851. */
  18852. Ext.asap = hasImmediate ? function(fn, scope, parameters) {
  18853. var boundFn = fn,
  18854. timerFn, timerId;
  18855. var timer;
  18856. if (scope != null || parameters != null) {
  18857. boundFn = ExtFunction.bind(fn, scope, parameters);
  18858. }
  18859. timerFn = function() {
  18860. Ext.elevate(boundFn, null, null, timer);
  18861. };
  18862. timerId = setImmediate(timerFn);
  18863. timerFn.$origFn = fn.$origFn || fn;
  18864. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18865. timer = Ext.Timer.created('asap', timerId, {
  18866. type: 'asap',
  18867. fn: fn,
  18868. timerFn: timerFn
  18869. });
  18870. return timerId;
  18871. } : function(fn, scope, parameters) {
  18872. var boundFn = fn,
  18873. timerFn, timerId;
  18874. var timer;
  18875. if (scope != null || parameters != null) {
  18876. boundFn = ExtFunction.bind(fn, scope, parameters);
  18877. }
  18878. timerFn = function() {
  18879. Ext.elevate(boundFn, null, null, timer);
  18880. };
  18881. timerId = setTimeout(timerFn, 0, true);
  18882. timerFn.$origFn = fn.$origFn || fn;
  18883. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18884. timer = Ext.Timer.created('timeout', timerId, {
  18885. type: 'asap',
  18886. fn: fn,
  18887. timerFn: timerFn
  18888. });
  18889. return timerId;
  18890. };
  18891. /**
  18892. * @member Ext
  18893. * @method unasap
  18894. * Cancels a previously scheduled call to `{@link Ext#asap}`.
  18895. *
  18896. * var timerId = Ext.asap(me.method, me);
  18897. * ...
  18898. *
  18899. * if (nevermind) {
  18900. * Ext.unasap(timerId);
  18901. * }
  18902. *
  18903. * This method always returns `null` to enable simple cleanup:
  18904. *
  18905. * timerId = Ext.unasap(timerId); // safe even if !timerId
  18906. *
  18907. * @param {Number} id The id returned by `{@link Ext#asap}`.
  18908. * @return {Object} Always returns `null`.
  18909. */
  18910. Ext.unasap = hasImmediate ? function(id) {
  18911. if (id) {
  18912. clearImmediate(id);
  18913. Ext.Timer.cancel('asap', id);
  18914. }
  18915. return null;
  18916. } : function(id) {
  18917. return Ext.undefer(id);
  18918. };
  18919. /**
  18920. * @member Ext
  18921. * @method asapCancel
  18922. * Cancels a previously scheduled call to `{@link Ext#asap}`.
  18923. * @param {Number} id The id returned by `{@link Ext#asap}`.
  18924. * @deprecated 6.5.1 Use `Ext.unasap` instead.
  18925. */
  18926. Ext.asapCancel = function(id) {
  18927. return Ext.unasap(id);
  18928. };
  18929. /**
  18930. * @method defer
  18931. * @member Ext
  18932. * @inheritdoc Ext.Function#defer
  18933. */
  18934. Ext.defer = ExtFunction.defer;
  18935. /**
  18936. * @member Ext
  18937. * @method undefer
  18938. * Cancels a previously scheduled call to `{@link Ext#defer}`.
  18939. *
  18940. * var timerId = Ext.defer(me.method, me);
  18941. * ...
  18942. *
  18943. * if (nevermind) {
  18944. * Ext.undefer(timerId);
  18945. * }
  18946. *
  18947. * This method always returns `null` to enable simple cleanup:
  18948. *
  18949. * timerId = Ext.undefer(timerId); // safe even if !timerId
  18950. *
  18951. * @param {Number} id The id returned by `{@link Ext#defer}`.
  18952. */
  18953. Ext.undefer = function(id) {
  18954. if (id) {
  18955. clearTimeout(id);
  18956. Ext.Timer.cancel('timeout', id);
  18957. }
  18958. return null;
  18959. };
  18960. /**
  18961. * @method interval
  18962. * @member Ext
  18963. * @inheritdoc Ext.Function#interval
  18964. */
  18965. Ext.interval = ExtFunction.interval;
  18966. /**
  18967. * @member Ext
  18968. * @method uninterval
  18969. * Cancels a previously scheduled call to `{@link Ext#interval}`.
  18970. *
  18971. * var timerId = Ext.interval(me.method, me);
  18972. * ...
  18973. *
  18974. * if (nevermind) {
  18975. * Ext.uninterval(timerId);
  18976. * }
  18977. *
  18978. * This method always returns `null` to enable simple cleanup:
  18979. *
  18980. * timerId = Ext.uninterval(timerId); // safe even if !timerId
  18981. *
  18982. * @param {Number} id The id returned by `{@link Ext#interval}`.
  18983. */
  18984. Ext.uninterval = function(id) {
  18985. if (id) {
  18986. clearInterval(id);
  18987. Ext.Timer.cancel('interval', id);
  18988. }
  18989. return null;
  18990. };
  18991. /**
  18992. * @method pass
  18993. * @member Ext
  18994. * @inheritdoc Ext.Function#pass
  18995. */
  18996. Ext.pass = ExtFunction.pass;
  18997. /**
  18998. * @method bind
  18999. * @member Ext
  19000. * @inheritdoc Ext.Function#bind
  19001. */
  19002. Ext.bind = ExtFunction.bind;
  19003. Ext.raf = function() {
  19004. return ExtFunction.requestAnimationFrame.apply(ExtFunction, arguments);
  19005. };
  19006. Ext.unraf = function(id) {
  19007. ExtFunction.cancelAnimationFrame(id);
  19008. };
  19009. return ExtFunction;
  19010. })();
  19011. /**
  19012. * @class Ext.Number
  19013. *
  19014. * A collection of useful static methods to deal with numbers
  19015. * @singleton
  19016. */
  19017. Ext.Number = (new function() {
  19018. // jshint ignore:line
  19019. // @define Ext.lang.Number
  19020. // @define Ext.Number
  19021. // @require Ext
  19022. var ExtNumber = this,
  19023. isToFixedBroken = (0.9).toFixed() !== '1',
  19024. math = Math,
  19025. ClipDefault = {
  19026. count: false,
  19027. inclusive: false,
  19028. wrap: true
  19029. };
  19030. // polyfill
  19031. Number.MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -(math.pow(2, 53) - 1);
  19032. Number.MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || math.pow(2, 53) - 1;
  19033. Ext.apply(ExtNumber, {
  19034. MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,
  19035. MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,
  19036. // No good way to allow "9." w/o allowing "." alone but we use isNaN to reject that
  19037. floatRe: /^[-+]?(?:\d+|\d*\.\d*)(?:[Ee][+-]?\d+)?$/,
  19038. intRe: /^[-+]?\d+(?:[Ee]\+?\d+)?$/,
  19039. Clip: {
  19040. DEFAULT: ClipDefault,
  19041. COUNT: Ext.applyIf({
  19042. count: true
  19043. }, ClipDefault),
  19044. INCLUSIVE: Ext.applyIf({
  19045. inclusive: true
  19046. }, ClipDefault),
  19047. NOWRAP: Ext.applyIf({
  19048. wrap: false
  19049. }, ClipDefault)
  19050. },
  19051. /**
  19052. * Strictly parses the given value and returns the value as a number or `null` if
  19053. * the value is not a number or contains non-numeric pieces.
  19054. * @param {String} value
  19055. * @return {Number}
  19056. * @since 6.5.1
  19057. */
  19058. parseFloat: function(value) {
  19059. if (value === undefined) {
  19060. value = null;
  19061. }
  19062. if (value !== null && typeof value !== 'number') {
  19063. value = String(value);
  19064. value = ExtNumber.floatRe.test(value) ? +value : null;
  19065. if (isNaN(value)) {
  19066. value = null;
  19067. }
  19068. }
  19069. return value;
  19070. },
  19071. /**
  19072. * Strictly parses the given value and returns the value as a number or `null` if
  19073. * the value is not an integer number or contains non-integer pieces.
  19074. * @param {String} value
  19075. * @return {Number}
  19076. * @since 6.5.1
  19077. */
  19078. parseInt: function(value) {
  19079. if (value === undefined) {
  19080. value = null;
  19081. }
  19082. if (typeof value === 'number') {
  19083. value = Math.floor(value);
  19084. } else if (value !== null) {
  19085. value = String(value);
  19086. value = ExtNumber.intRe.test(value) ? +value : null;
  19087. }
  19088. return value;
  19089. },
  19090. binarySearch: function(array, value, begin, end) {
  19091. if (begin === undefined) {
  19092. begin = 0;
  19093. }
  19094. if (end === undefined) {
  19095. end = array.length;
  19096. }
  19097. --end;
  19098. var middle, midVal;
  19099. while (begin <= end) {
  19100. middle = (begin + end) >>> 1;
  19101. // unsigned right shift = Math.floor(x/2)
  19102. midVal = array[middle];
  19103. if (value === midVal) {
  19104. return middle;
  19105. }
  19106. if (midVal < value) {
  19107. begin = middle + 1;
  19108. } else {
  19109. end = middle - 1;
  19110. }
  19111. }
  19112. return begin;
  19113. },
  19114. bisectTuples: function(array, value, index, begin, end) {
  19115. if (begin === undefined) {
  19116. begin = 0;
  19117. }
  19118. if (end === undefined) {
  19119. end = array.length;
  19120. }
  19121. --end;
  19122. var middle, midVal;
  19123. while (begin <= end) {
  19124. middle = (begin + end) >>> 1;
  19125. // unsigned right shift = Math.floor(x/2)
  19126. midVal = array[middle][index];
  19127. if (value === midVal) {
  19128. return middle;
  19129. }
  19130. if (midVal < value) {
  19131. begin = middle + 1;
  19132. } else {
  19133. end = middle - 1;
  19134. }
  19135. }
  19136. return begin;
  19137. },
  19138. /**
  19139. * Coerces a given index into a valid index given a `length`.
  19140. *
  19141. * Negative indexes are interpreted starting at the end of the collection. That is,
  19142. * a value of -1 indicates the last item, or equivalent to `length - 1`.
  19143. *
  19144. * When handling methods that take "begin" and "end" arguments like most array or
  19145. * string methods, this method can be used like so:
  19146. *
  19147. * function foo (array, begin, end) {
  19148. * var range = Ext.Number.clipIndices(array.length, [begin, end]);
  19149. *
  19150. * begin = range[0];
  19151. * end = range[1];
  19152. *
  19153. * // 0 <= begin <= end <= array.length
  19154. *
  19155. * var length = end - begin;
  19156. * }
  19157. *
  19158. * For example:
  19159. *
  19160. * +---+---+---+---+---+---+---+---+
  19161. * | | | | | | | | | length = 8
  19162. * +---+---+---+---+---+---+---+---+
  19163. * 0 1 2 3 4 5 6 7
  19164. * -8 -7 -6 -5 -4 -3 -2 -1
  19165. *
  19166. * console.log(Ext.Number.clipIndices(8, [3, 10]); // logs "[3, 8]"
  19167. * console.log(Ext.Number.clipIndices(8, [-5]); // logs "[3, 8]"
  19168. * console.log(Ext.Number.clipIndices(8, []);
  19169. * console.log(Ext.Number.clipIndices(8, []);
  19170. *
  19171. * @param {Number} length
  19172. * @param {Number[]} indices
  19173. * @param {Object} [options] An object with different option flags.
  19174. * @param {Boolean} [options.count=false] The second number in `indices` is the
  19175. * count not and an index.
  19176. * @param {Boolean} [options.inclusive=false] The second number in `indices` is
  19177. * "inclusive" meaning that the item should be considered in the range. Normally,
  19178. * the second number is considered the first item outside the range or as an
  19179. * "exclusive" bound.
  19180. * @param {Boolean} [options.wrap=true] Wraps negative numbers backwards from the
  19181. * end of the array. Passing `false` simply clips negative index values at 0.
  19182. * @return {Number[]} The normalized `[begin, end]` array where `end` is now
  19183. * exclusive such that `length = end - begin`. Both values are between 0 and the
  19184. * given `length` and `end` will not be less-than `begin`.
  19185. */
  19186. clipIndices: function(length, indices, options) {
  19187. options = options || ClipDefault;
  19188. var defaultValue = 0,
  19189. // default value for "begin"
  19190. wrap = options.wrap,
  19191. begin, end, i;
  19192. indices = indices || [];
  19193. for (i = 0; i < 2; ++i) {
  19194. // names are off on first pass but used this way so things make sense
  19195. // following the loop..
  19196. begin = end;
  19197. // pick up and keep the result from the first loop
  19198. end = indices[i];
  19199. if (end == null) {
  19200. end = defaultValue;
  19201. } else if (i && options.count) {
  19202. end += begin;
  19203. // this is the length not "end" so convert to "end"
  19204. end = (end > length) ? length : end;
  19205. } else {
  19206. if (wrap) {
  19207. end = (end < 0) ? (length + end) : end;
  19208. }
  19209. if (i && options.inclusive) {
  19210. ++end;
  19211. }
  19212. end = (end < 0) ? 0 : ((end > length) ? length : end);
  19213. }
  19214. defaultValue = length;
  19215. }
  19216. // default value for "end"
  19217. // after loop:
  19218. // 0 <= begin <= length (calculated from indices[0])
  19219. // 0 <= end <= length (calculated from indices[1])
  19220. indices[0] = begin;
  19221. indices[1] = (end < begin) ? begin : end;
  19222. return indices;
  19223. },
  19224. /**
  19225. * Checks whether or not the passed number is within a desired range. If the number is already within the
  19226. * range it is returned, otherwise the min or max value is returned depending on which side of the range is
  19227. * exceeded. Note that this method returns the constrained value but does not change the current number.
  19228. * @param {Number} number The number to check
  19229. * @param {Number} min The minimum number in the range
  19230. * @param {Number} max The maximum number in the range
  19231. * @return {Number} The constrained value if outside the range, otherwise the current value
  19232. */
  19233. constrain: function(number, min, max) {
  19234. var x = parseFloat(number);
  19235. // (x < Nan) || (x < undefined) == false
  19236. // same for (x > NaN) || (x > undefined)
  19237. // sadly this is not true of null - (1 > null)
  19238. if (min === null) {
  19239. min = number;
  19240. }
  19241. if (max === null) {
  19242. max = number;
  19243. }
  19244. // Watch out for NaN in Chrome 18
  19245. // V8bug: http://code.google.com/p/v8/issues/detail?id=2056
  19246. // Operators are faster than Math.min/max. See http://jsperf.com/number-constrain
  19247. return (x < min) ? min : ((x > max) ? max : x);
  19248. },
  19249. /**
  19250. * Snaps the passed number between stopping points based upon a passed increment value.
  19251. *
  19252. * The difference between this and {@link #snapInRange} is that {@link #snapInRange} uses the minValue
  19253. * when calculating snap points:
  19254. *
  19255. * r = Ext.Number.snap(56, 2, 55, 65); // Returns 56 - snap points are zero based
  19256. *
  19257. * r = Ext.Number.snapInRange(56, 2, 55, 65); // Returns 57 - snap points are based from minValue
  19258. *
  19259. * @param {Number} value The unsnapped value.
  19260. * @param {Number} increment The increment by which the value must move.
  19261. * @param {Number} minValue The minimum value to which the returned value must be constrained. Overrides the increment.
  19262. * @param {Number} maxValue The maximum value to which the returned value must be constrained. Overrides the increment.
  19263. * @return {Number} The value of the nearest snap target.
  19264. */
  19265. snap: function(value, increment, minValue, maxValue) {
  19266. var m;
  19267. // If no value passed, or minValue was passed and value is less than minValue (anything < undefined is false)
  19268. // Then use the minValue (or zero if the value was undefined)
  19269. if (value === undefined || value < minValue) {
  19270. return minValue || 0;
  19271. }
  19272. if (increment) {
  19273. m = value % increment;
  19274. if (m !== 0) {
  19275. value -= m;
  19276. if (m * 2 >= increment) {
  19277. value += increment;
  19278. } else if (m * 2 < -increment) {
  19279. value -= increment;
  19280. }
  19281. }
  19282. }
  19283. return ExtNumber.constrain(value, minValue, maxValue);
  19284. },
  19285. /**
  19286. * Snaps the passed number between stopping points based upon a passed increment value.
  19287. *
  19288. * The difference between this and {@link #snap} is that {@link #snap} does not use the minValue
  19289. * when calculating snap points:
  19290. *
  19291. * r = Ext.Number.snap(56, 2, 55, 65); // Returns 56 - snap points are zero based
  19292. *
  19293. * r = Ext.Number.snapInRange(56, 2, 55, 65); // Returns 57 - snap points are based from minValue
  19294. *
  19295. * @param {Number} value The unsnapped value.
  19296. * @param {Number} increment The increment by which the value must move.
  19297. * @param {Number} [minValue=0] The minimum value to which the returned value must be constrained.
  19298. * @param {Number} [maxValue=Infinity] The maximum value to which the returned value must be constrained.
  19299. * @return {Number} The value of the nearest snap target.
  19300. */
  19301. snapInRange: function(value, increment, minValue, maxValue) {
  19302. var tween;
  19303. // default minValue to zero
  19304. minValue = (minValue || 0);
  19305. // If value is undefined, or less than minValue, use minValue
  19306. if (value === undefined || value < minValue) {
  19307. return minValue;
  19308. }
  19309. // Calculate how many snap points from the minValue the passed value is.
  19310. if (increment && (tween = ((value - minValue) % increment))) {
  19311. value -= tween;
  19312. tween *= 2;
  19313. if (tween >= increment) {
  19314. value += increment;
  19315. }
  19316. }
  19317. // If constraining within a maximum, ensure the maximum is on a snap point
  19318. if (maxValue !== undefined) {
  19319. if (value > (maxValue = ExtNumber.snapInRange(maxValue, increment, minValue))) {
  19320. value = maxValue;
  19321. }
  19322. }
  19323. return value;
  19324. },
  19325. /**
  19326. * Round a number to the nearest interval.
  19327. * @param {Number} value The value to round.
  19328. * @param {Number} interval The interval to round to.
  19329. * @return {Number} The rounded value.
  19330. *
  19331. * @since 6.2.0
  19332. */
  19333. roundToNearest: function(value, interval) {
  19334. interval = interval || 1;
  19335. return interval * math.round(value / interval);
  19336. },
  19337. /**
  19338. * Rounds a number to the specified precision.
  19339. * @param value
  19340. * @param precision
  19341. * @return {number}
  19342. */
  19343. roundToPrecision: function(value, precision) {
  19344. var factor = math.pow(10, precision || 1);
  19345. return math.round(value * factor) / factor;
  19346. },
  19347. /**
  19348. * Truncates a number to the specified precision,
  19349. * without rounding.
  19350. * @param value
  19351. * @param precision
  19352. * @return {number}
  19353. * @since 6.5.1
  19354. */
  19355. truncateToPrecision: function(value, precision) {
  19356. var factor = math.pow(10, precision || 1);
  19357. return parseInt(value * factor, 10) / factor;
  19358. },
  19359. /**
  19360. * Returns the sign of the given number. See also MDN for Math.sign documentation
  19361. * for the standard method this method emulates.
  19362. * @param {Number} x The number.
  19363. * @return {Number} The sign of the number `x`, indicating whether the number is
  19364. * positive (1), negative (-1) or zero (0).
  19365. * @method sign
  19366. */
  19367. sign: math.sign || function(x) {
  19368. x = +x;
  19369. // force to a Number
  19370. if (x === 0 || isNaN(x)) {
  19371. return x;
  19372. }
  19373. return (x > 0) ? 1 : -1;
  19374. },
  19375. /**
  19376. * Returns the base 10 logarithm of a number.
  19377. * This will use Math.log10, if available (ES6).
  19378. * @param {Number} x The number.
  19379. * @return {Number} Base 10 logarithm of the number 'x'.
  19380. * @method log10
  19381. */
  19382. log10: math.log10 || function(x) {
  19383. return math.log(x) * math.LOG10E;
  19384. },
  19385. /**
  19386. * Determines if two numbers `n1` and `n2` are equal within a given
  19387. * margin of precision `epsilon`.
  19388. * @param {Number} n1 First number.
  19389. * @param {Number} n2 Second number.
  19390. * @param {Number} epsilon Margin of precision.
  19391. * @return {Boolean} `true`, if numbers are equal. `false` otherwise.
  19392. */
  19393. isEqual: function(n1, n2, epsilon) {
  19394. if (!(typeof n1 === 'number' && typeof n2 === 'number' && typeof epsilon === 'number')) {
  19395. Ext.raise("All parameters should be valid numbers.");
  19396. }
  19397. return math.abs(n1 - n2) < epsilon;
  19398. },
  19399. /**
  19400. * Determines if the value passed is a number and also finite.
  19401. * This a Polyfill version of Number.isFinite(),differently than
  19402. * the isFinite() function, this method doesn't convert the parameter to a number.
  19403. * @param {Number} value Number to be tested.
  19404. * @return {Boolean} `true`, if the parameter is a number and finite, `false` otherwise.
  19405. * @since 6.2
  19406. */
  19407. isFinite: Number.isFinite || function(value) {
  19408. return typeof value === 'number' && isFinite(value);
  19409. },
  19410. isInteger: Number.isInteger || function(value) {
  19411. // Add zero get a valid result in a special case where the value is a number string.
  19412. // E.g. '10' + 0 is '100'.
  19413. return ~~(value + 0) === value;
  19414. },
  19415. /**
  19416. * @method
  19417. * Formats a number using fixed-point notation
  19418. * @param {Number} value The number to format
  19419. * @param {Number} precision The number of digits to show after the decimal point
  19420. */
  19421. toFixed: isToFixedBroken ? function(value, precision) {
  19422. precision = precision || 0;
  19423. var pow = math.pow(10, precision);
  19424. return (math.round(value * pow) / pow).toFixed(precision);
  19425. } : function(value, precision) {
  19426. return value.toFixed(precision);
  19427. },
  19428. /**
  19429. * Validate that a value is numeric and convert it to a number if necessary. Returns the specified default value if
  19430. * it is not.
  19431. Ext.Number.from('1.23', 1); // returns 1.23
  19432. Ext.Number.from('abc', 1); // returns 1
  19433. * @param {Object} value
  19434. * @param {Number} defaultValue The value to return if the original value is non-numeric
  19435. * @return {Number} value, if numeric, defaultValue otherwise
  19436. */
  19437. from: function(value, defaultValue) {
  19438. if (isFinite(value)) {
  19439. value = parseFloat(value);
  19440. }
  19441. return !isNaN(value) ? value : defaultValue;
  19442. },
  19443. /**
  19444. * Returns a random integer between the specified range (inclusive)
  19445. * @param {Number} from Lowest value to return.
  19446. * @param {Number} to Highest value to return.
  19447. * @return {Number} A random integer within the specified range.
  19448. */
  19449. randomInt: function(from, to) {
  19450. return math.floor(math.random() * (to - from + 1) + from);
  19451. },
  19452. /**
  19453. * Corrects floating point numbers that overflow to a non-precise
  19454. * value because of their floating nature, for example `0.1 + 0.2`
  19455. * @param {Number} n The number
  19456. * @return {Number} The correctly rounded number
  19457. */
  19458. correctFloat: function(n) {
  19459. // This is to correct the type of errors where 2 floats end with
  19460. // a long string of decimals, eg 0.1 + 0.2. When they overflow in this
  19461. // manner, they usually go to 15-16 decimals, so we cut it off at 14.
  19462. return parseFloat(n.toPrecision(14));
  19463. }
  19464. });
  19465. /**
  19466. * @deprecated 4.0.0 Please use {@link Ext.Number#from} instead.
  19467. * @member Ext
  19468. * @method num
  19469. * @inheritdoc Ext.Number#from
  19470. */
  19471. Ext.num = function() {
  19472. return ExtNumber.from.apply(this, arguments);
  19473. };
  19474. }());
  19475. /**
  19476. * @class Ext.Object
  19477. *
  19478. * A collection of useful static methods to deal with objects.
  19479. *
  19480. * @singleton
  19481. */
  19482. (function() {
  19483. // The "constructor" for chain:
  19484. var TemplateClass = function() {},
  19485. queryRe = /^\?/,
  19486. keyRe = /(\[):?([^\]]*)\]/g,
  19487. nameRe = /^([^\[]+)/,
  19488. plusRe = /\+/g,
  19489. ExtObject = Ext.Object = {
  19490. // @define Ext.lang.Object
  19491. // @define Ext.Object
  19492. // @require Ext
  19493. // @require Ext.lang.Date
  19494. /**
  19495. * @method
  19496. * Returns a new object with the given object as the prototype chain. This method is
  19497. * designed to mimic the ECMA standard `Object.create` method and is assigned to that
  19498. * function when it is available.
  19499. *
  19500. * **NOTE** This method does not support the property definitions capability of the
  19501. * `Object.create` method. Only the first argument is supported.
  19502. *
  19503. * @param {Object} object The prototype chain for the new object.
  19504. */
  19505. chain: Object.create || function(object) {
  19506. TemplateClass.prototype = object;
  19507. var result = new TemplateClass();
  19508. TemplateClass.prototype = null;
  19509. return result;
  19510. },
  19511. /**
  19512. * This method removes all keys from the given object.
  19513. * @param {Object} object The object from which to remove all keys.
  19514. * @return {Object} The given object.
  19515. */
  19516. clear: function(object) {
  19517. // Safe to delete during iteration
  19518. for (var key in object) {
  19519. delete object[key];
  19520. }
  19521. return object;
  19522. },
  19523. /**
  19524. * Freezes the given object making it immutable. This operation is by default shallow
  19525. * and does not effect objects referenced by the given object.
  19526. *
  19527. * @method
  19528. * @param {Object} obj The object to freeze.
  19529. * @param {Boolean} [deep=false] Pass `true` to freeze sub-objects recursively.
  19530. * @return {Object} The given object `obj`.
  19531. */
  19532. freeze: Object.freeze ? function(obj, deep) {
  19533. if (obj && typeof obj === 'object' && !Object.isFrozen(obj)) {
  19534. Object.freeze(obj);
  19535. if (deep) {
  19536. for (var name in obj) {
  19537. ExtObject.freeze(obj[name], deep);
  19538. }
  19539. }
  19540. }
  19541. return obj;
  19542. } : Ext.identityFn,
  19543. /**
  19544. * Converts a `name` - `value` pair to an array of objects with support for nested structures. Useful to construct
  19545. * query strings. For example:
  19546. *
  19547. * var objects = Ext.Object.toQueryObjects('hobbies', ['reading', 'cooking', 'swimming']);
  19548. *
  19549. * // objects then equals:
  19550. * [
  19551. * { name: 'hobbies', value: 'reading' },
  19552. * { name: 'hobbies', value: 'cooking' },
  19553. * { name: 'hobbies', value: 'swimming' },
  19554. * ];
  19555. *
  19556. * var objects = Ext.Object.toQueryObjects('dateOfBirth', {
  19557. * day: 3,
  19558. * month: 8,
  19559. * year: 1987,
  19560. * extra: {
  19561. * hour: 4
  19562. * minute: 30
  19563. * }
  19564. * }, true); // Recursive
  19565. *
  19566. * // objects then equals:
  19567. * [
  19568. * { name: 'dateOfBirth[day]', value: 3 },
  19569. * { name: 'dateOfBirth[month]', value: 8 },
  19570. * { name: 'dateOfBirth[year]', value: 1987 },
  19571. * { name: 'dateOfBirth[extra][hour]', value: 4 },
  19572. * { name: 'dateOfBirth[extra][minute]', value: 30 },
  19573. * ];
  19574. *
  19575. * @param {String} name
  19576. * @param {Object/Array} value
  19577. * @param {Boolean} [recursive=false] True to traverse object recursively
  19578. * @return {Object[]}
  19579. */
  19580. toQueryObjects: function(name, value, recursive) {
  19581. var self = ExtObject.toQueryObjects,
  19582. objects = [],
  19583. i, ln;
  19584. if (Ext.isArray(value)) {
  19585. for (i = 0 , ln = value.length; i < ln; i++) {
  19586. if (recursive) {
  19587. objects = objects.concat(self(name + '[' + i + ']', value[i], true));
  19588. } else {
  19589. objects.push({
  19590. name: name,
  19591. value: value[i]
  19592. });
  19593. }
  19594. }
  19595. } else if (Ext.isObject(value)) {
  19596. for (i in value) {
  19597. if (value.hasOwnProperty(i)) {
  19598. if (recursive) {
  19599. objects = objects.concat(self(name + '[' + i + ']', value[i], true));
  19600. } else {
  19601. objects.push({
  19602. name: name,
  19603. value: value[i]
  19604. });
  19605. }
  19606. }
  19607. }
  19608. } else {
  19609. objects.push({
  19610. name: name,
  19611. value: value
  19612. });
  19613. }
  19614. return objects;
  19615. },
  19616. /**
  19617. * Takes an object and converts it to an encoded query string.
  19618. *
  19619. * Non-recursive:
  19620. *
  19621. * Ext.Object.toQueryString({foo: 1, bar: 2}); // returns "foo=1&bar=2"
  19622. * Ext.Object.toQueryString({foo: null, bar: 2}); // returns "foo=&bar=2"
  19623. * Ext.Object.toQueryString({'some price': '$300'}); // returns "some%20price=%24300"
  19624. * Ext.Object.toQueryString({date: new Date(2011, 0, 1)}); // returns "date=%222011-01-01T00%3A00%3A00%22"
  19625. * Ext.Object.toQueryString({colors: ['red', 'green', 'blue']}); // returns "colors=red&colors=green&colors=blue"
  19626. *
  19627. * Recursive:
  19628. *
  19629. * Ext.Object.toQueryString({
  19630. * username: 'Jacky',
  19631. * dateOfBirth: {
  19632. * day: 1,
  19633. * month: 2,
  19634. * year: 1911
  19635. * },
  19636. * hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
  19637. * }, true); // returns the following string (broken down and url-decoded for ease of reading purpose):
  19638. * // username=Jacky
  19639. * // &dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911
  19640. * // &hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&hobbies[3][0]=nested&hobbies[3][1]=stuff
  19641. *
  19642. * @param {Object} object The object to encode
  19643. * @param {Boolean} [recursive=false] Whether or not to interpret the object in recursive format.
  19644. * (PHP / Ruby on Rails servers and similar).
  19645. * @return {String} queryString
  19646. */
  19647. toQueryString: function(object, recursive) {
  19648. var paramObjects = [],
  19649. params = [],
  19650. i, j, ln, paramObject, value;
  19651. for (i in object) {
  19652. if (object.hasOwnProperty(i)) {
  19653. paramObjects = paramObjects.concat(ExtObject.toQueryObjects(i, object[i], recursive));
  19654. }
  19655. }
  19656. for (j = 0 , ln = paramObjects.length; j < ln; j++) {
  19657. paramObject = paramObjects[j];
  19658. value = paramObject.value;
  19659. if (Ext.isEmpty(value)) {
  19660. value = '';
  19661. } else if (Ext.isDate(value)) {
  19662. value = Ext.Date.toString(value);
  19663. }
  19664. params.push(encodeURIComponent(paramObject.name) + '=' + encodeURIComponent(String(value)));
  19665. }
  19666. return params.join('&');
  19667. },
  19668. /**
  19669. * Converts a query string back into an object.
  19670. *
  19671. * Non-recursive:
  19672. *
  19673. * Ext.Object.fromQueryString("foo=1&bar=2"); // returns {foo: '1', bar: '2'}
  19674. * Ext.Object.fromQueryString("foo=&bar=2"); // returns {foo: '', bar: '2'}
  19675. * Ext.Object.fromQueryString("some%20price=%24300"); // returns {'some price': '$300'}
  19676. * Ext.Object.fromQueryString("colors=red&colors=green&colors=blue"); // returns {colors: ['red', 'green', 'blue']}
  19677. *
  19678. * Recursive:
  19679. *
  19680. * Ext.Object.fromQueryString(
  19681. * "username=Jacky&"+
  19682. * "dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911&"+
  19683. * "hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&"+
  19684. * "hobbies[3][0]=nested&hobbies[3][1]=stuff", true);
  19685. *
  19686. * // returns
  19687. * {
  19688. * username: 'Jacky',
  19689. * dateOfBirth: {
  19690. * day: '1',
  19691. * month: '2',
  19692. * year: '1911'
  19693. * },
  19694. * hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
  19695. * }
  19696. *
  19697. * @param {String} queryString The query string to decode
  19698. * @param {Boolean} [recursive=false] Whether or not to recursively decode the string. This format is supported by
  19699. * PHP / Ruby on Rails servers and similar.
  19700. * @return {Object}
  19701. */
  19702. fromQueryString: function(queryString, recursive) {
  19703. var parts = queryString.replace(queryRe, '').split('&'),
  19704. object = {},
  19705. temp, components, name, value, i, ln, part, j, subLn, matchedKeys, matchedName, keys, key, nextKey;
  19706. for (i = 0 , ln = parts.length; i < ln; i++) {
  19707. part = parts[i];
  19708. if (part.length > 0) {
  19709. components = part.split('=');
  19710. name = components[0];
  19711. name = name.replace(plusRe, '%20');
  19712. name = decodeURIComponent(name);
  19713. value = components[1];
  19714. if (value !== undefined) {
  19715. value = value.replace(plusRe, '%20');
  19716. value = decodeURIComponent(value);
  19717. } else {
  19718. value = '';
  19719. }
  19720. if (!recursive) {
  19721. if (object.hasOwnProperty(name)) {
  19722. if (!Ext.isArray(object[name])) {
  19723. object[name] = [
  19724. object[name]
  19725. ];
  19726. }
  19727. object[name].push(value);
  19728. } else {
  19729. object[name] = value;
  19730. }
  19731. } else {
  19732. matchedKeys = name.match(keyRe);
  19733. matchedName = name.match(nameRe);
  19734. if (!matchedName) {
  19735. throw new Error('[Ext.Object.fromQueryString] Malformed query string given, failed parsing name from "' + part + '"');
  19736. }
  19737. name = matchedName[0];
  19738. keys = [];
  19739. if (matchedKeys === null) {
  19740. object[name] = value;
  19741. continue;
  19742. }
  19743. for (j = 0 , subLn = matchedKeys.length; j < subLn; j++) {
  19744. key = matchedKeys[j];
  19745. key = (key.length === 2) ? '' : key.substring(1, key.length - 1);
  19746. keys.push(key);
  19747. }
  19748. keys.unshift(name);
  19749. temp = object;
  19750. for (j = 0 , subLn = keys.length; j < subLn; j++) {
  19751. key = keys[j];
  19752. if (j === subLn - 1) {
  19753. if (Ext.isArray(temp) && key === '') {
  19754. temp.push(value);
  19755. } else {
  19756. temp[key] = value;
  19757. }
  19758. } else {
  19759. if (temp[key] === undefined || typeof temp[key] === 'string') {
  19760. nextKey = keys[j + 1];
  19761. temp[key] = (Ext.isNumeric(nextKey) || nextKey === '') ? [] : {};
  19762. }
  19763. temp = temp[key];
  19764. }
  19765. }
  19766. }
  19767. }
  19768. }
  19769. return object;
  19770. },
  19771. /**
  19772. * Iterates through an object and invokes the given callback function for each iteration.
  19773. * The iteration can be stopped by returning `false` in the callback function. For example:
  19774. *
  19775. * var person = {
  19776. * name: 'Jacky'
  19777. * hairColor: 'black'
  19778. * loves: ['food', 'sleeping', 'wife']
  19779. * };
  19780. *
  19781. * Ext.Object.each(person, function(key, value, myself) {
  19782. * console.log(key + ":" + value);
  19783. *
  19784. * if (key === 'hairColor') {
  19785. * return false; // stop the iteration
  19786. * }
  19787. * });
  19788. *
  19789. * @param {Object} object The object to iterate
  19790. * @param {Function} fn The callback function.
  19791. * @param {String} fn.key
  19792. * @param {Object} fn.value
  19793. * @param {Object} fn.object The object itself
  19794. * @param {Object} [scope] The execution scope (`this`) of the callback function
  19795. */
  19796. each: function(object, fn, scope) {
  19797. var enumerables = Ext.enumerables,
  19798. i, property;
  19799. if (object) {
  19800. scope = scope || object;
  19801. for (property in object) {
  19802. if (object.hasOwnProperty(property)) {
  19803. if (fn.call(scope, property, object[property], object) === false) {
  19804. return;
  19805. }
  19806. }
  19807. }
  19808. if (enumerables) {
  19809. for (i = enumerables.length; i--; ) {
  19810. if (object.hasOwnProperty(property = enumerables[i])) {
  19811. if (fn.call(scope, property, object[property], object) === false) {
  19812. return;
  19813. }
  19814. }
  19815. }
  19816. }
  19817. }
  19818. },
  19819. /**
  19820. * Iterates through an object and invokes the given callback function for each iteration.
  19821. * The iteration can be stopped by returning `false` in the callback function. For example:
  19822. *
  19823. * var items = {
  19824. * 1: 'Hello',
  19825. * 2: 'World'
  19826. * };
  19827. *
  19828. * Ext.Object.eachValue(items, function (value) {
  19829. * console.log("Value: " + value);
  19830. * });
  19831. *
  19832. * This will log 'Hello' and 'World' in no particular order. This method is useful
  19833. * in cases where the keys are not important to the processing, just the values.
  19834. *
  19835. * @param {Object} object The object to iterate
  19836. * @param {Function} fn The callback function.
  19837. * @param {Object} fn.value The value of
  19838. * @param {Object} [scope] The execution scope (`this`) of the callback function
  19839. */
  19840. eachValue: function(object, fn, scope) {
  19841. var enumerables = Ext.enumerables,
  19842. i, property;
  19843. scope = scope || object;
  19844. for (property in object) {
  19845. if (object.hasOwnProperty(property)) {
  19846. if (fn.call(scope, object[property]) === false) {
  19847. return;
  19848. }
  19849. }
  19850. }
  19851. if (enumerables) {
  19852. for (i = enumerables.length; i--; ) {
  19853. if (object.hasOwnProperty(property = enumerables[i])) {
  19854. if (fn.call(scope, object[property]) === false) {
  19855. return;
  19856. }
  19857. }
  19858. }
  19859. }
  19860. },
  19861. /**
  19862. * Merges any number of objects recursively without referencing them or their children.
  19863. * Note: It will reference arrays if they are only present in one of the objects being merged.
  19864. *
  19865. * var extjs = {
  19866. * companyName: 'Ext JS',
  19867. * products: ['Ext JS', 'Ext GWT', 'Ext Designer'],
  19868. * isSuperCool: true,
  19869. * office: {
  19870. * size: 2000,
  19871. * location: 'Palo Alto',
  19872. * isFun: true
  19873. * }
  19874. * };
  19875. *
  19876. * var newStuff = {
  19877. * companyName: 'Sencha Inc.',
  19878. * products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
  19879. * office: {
  19880. * size: 40000,
  19881. * location: 'Redwood City'
  19882. * }
  19883. * };
  19884. *
  19885. * var sencha = Ext.Object.merge(extjs, newStuff);
  19886. *
  19887. * // extjs and sencha then equals to
  19888. * {
  19889. * companyName: 'Sencha Inc.',
  19890. * products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
  19891. * isSuperCool: true,
  19892. * office: {
  19893. * size: 40000,
  19894. * location: 'Redwood City',
  19895. * isFun: true
  19896. * }
  19897. * }
  19898. *
  19899. * @param {Object} destination The object into which all subsequent objects are merged.
  19900. * @param {Object...} object Any number of objects to merge into the destination.
  19901. * @return {Object} merged The destination object with all passed objects merged in.
  19902. */
  19903. merge: function(destination) {
  19904. var i = 1,
  19905. args = arguments,
  19906. ln = args.length,
  19907. mergeFn = ExtObject.merge,
  19908. cloneFn = Ext.clone,
  19909. object, key, value, sourceKey;
  19910. for (; i < ln; i++) {
  19911. object = args[i];
  19912. for (key in object) {
  19913. value = object[key];
  19914. if (value && value.constructor === Object) {
  19915. sourceKey = destination[key];
  19916. if (sourceKey && sourceKey.constructor === Object) {
  19917. mergeFn(sourceKey, value);
  19918. } else {
  19919. destination[key] = cloneFn(value);
  19920. }
  19921. } else {
  19922. destination[key] = value;
  19923. }
  19924. }
  19925. }
  19926. return destination;
  19927. },
  19928. /**
  19929. * @private
  19930. * @param destination
  19931. */
  19932. mergeIf: function(destination) {
  19933. var i = 1,
  19934. ln = arguments.length,
  19935. cloneFn = Ext.clone,
  19936. object, key, value;
  19937. for (; i < ln; i++) {
  19938. object = arguments[i];
  19939. for (key in object) {
  19940. if (!(key in destination)) {
  19941. value = object[key];
  19942. if (value && value.constructor === Object) {
  19943. destination[key] = cloneFn(value);
  19944. } else {
  19945. destination[key] = value;
  19946. }
  19947. }
  19948. }
  19949. }
  19950. return destination;
  19951. },
  19952. /**
  19953. * Returns all keys of the given object as an array.
  19954. *
  19955. * @param {Object} object
  19956. * @return {String[]} An array of keys from the object or any of its prototypes.
  19957. * @method
  19958. */
  19959. getAllKeys: function(object) {
  19960. var keys = [],
  19961. property;
  19962. for (property in object) {
  19963. keys.push(property);
  19964. }
  19965. return keys;
  19966. },
  19967. /**
  19968. * Returns the first matching key corresponding to the given value.
  19969. * If no matching value is found, null is returned.
  19970. *
  19971. * var person = {
  19972. * name: 'Jacky',
  19973. * loves: 'food'
  19974. * };
  19975. *
  19976. * alert(Ext.Object.getKey(person, 'food')); // alerts 'loves'
  19977. *
  19978. * @param {Object} object
  19979. * @param {Object} value The value to find
  19980. */
  19981. getKey: function(object, value) {
  19982. for (var property in object) {
  19983. if (object.hasOwnProperty(property) && object[property] === value) {
  19984. return property;
  19985. }
  19986. }
  19987. return null;
  19988. },
  19989. /**
  19990. * Gets all values of the given object as an array.
  19991. *
  19992. * var values = Ext.Object.getValues({
  19993. * name: 'Jacky',
  19994. * loves: 'food'
  19995. * }); // ['Jacky', 'food']
  19996. *
  19997. * @param {Object} object
  19998. * @return {Array} An array of values from the object
  19999. */
  20000. getValues: function(object) {
  20001. var values = [],
  20002. property;
  20003. for (property in object) {
  20004. if (object.hasOwnProperty(property)) {
  20005. values.push(object[property]);
  20006. }
  20007. }
  20008. return values;
  20009. },
  20010. /**
  20011. * Returns the `hasOwnProperty` keys of the given object as an array.
  20012. *
  20013. * var values = Ext.Object.getKeys({
  20014. * name: 'Jacky',
  20015. * loves: 'food'
  20016. * }); // ['name', 'loves']
  20017. *
  20018. * @param {Object} object
  20019. * @return {String[]} An array of keys from the object
  20020. * @method
  20021. */
  20022. getKeys: (typeof Object.keys == 'function') ? function(object) {
  20023. if (!object) {
  20024. return [];
  20025. }
  20026. return Object.keys(object);
  20027. } : function(object) {
  20028. var keys = [],
  20029. property;
  20030. for (property in object) {
  20031. if (object.hasOwnProperty(property)) {
  20032. keys.push(property);
  20033. }
  20034. }
  20035. return keys;
  20036. },
  20037. /**
  20038. * Gets the total number of this object's own properties
  20039. *
  20040. * var size = Ext.Object.getSize({
  20041. * name: 'Jacky',
  20042. * loves: 'food'
  20043. * }); // size equals 2
  20044. *
  20045. * @param {Object} object
  20046. * @return {Number} size
  20047. */
  20048. getSize: function(object) {
  20049. var size = 0,
  20050. property;
  20051. for (property in object) {
  20052. if (object.hasOwnProperty(property)) {
  20053. size++;
  20054. }
  20055. }
  20056. return size;
  20057. },
  20058. /**
  20059. * Checks if there are any properties on this object.
  20060. * @param {Object} object
  20061. * @return {Boolean} `true` if there no properties on the object.
  20062. */
  20063. isEmpty: function(object) {
  20064. for (var key in object) {
  20065. if (object.hasOwnProperty(key)) {
  20066. return false;
  20067. }
  20068. }
  20069. return true;
  20070. },
  20071. /**
  20072. * @method
  20073. * Shallow compares the contents of 2 objects using strict equality. Objects are
  20074. * considered equal if they both have the same set of properties and the
  20075. * value for those properties equals the other in the corresponding object.
  20076. *
  20077. * // Returns true
  20078. * Ext.Object.equals({
  20079. * foo: 1,
  20080. * bar: 2
  20081. * }, {
  20082. * foo: 1,
  20083. * bar: 2
  20084. * });
  20085. *
  20086. * @param {Object} object1
  20087. * @param {Object} object2
  20088. * @return {Boolean} `true` if the objects are equal.
  20089. */
  20090. equals: (function() {
  20091. var check = function(o1, o2) {
  20092. var key;
  20093. for (key in o1) {
  20094. if (o1.hasOwnProperty(key)) {
  20095. if (o1[key] !== o2[key]) {
  20096. return false;
  20097. }
  20098. }
  20099. }
  20100. return true;
  20101. };
  20102. return function(object1, object2) {
  20103. // Short circuit if the same object is passed twice
  20104. if (object1 === object2) {
  20105. return true;
  20106. }
  20107. if (object1 && object2) {
  20108. // Do the second check because we could have extra keys in
  20109. // object2 that don't exist in object1.
  20110. return check(object1, object2) && check(object2, object1);
  20111. } else if (!object1 && !object2) {
  20112. return object1 === object2;
  20113. } else {
  20114. return false;
  20115. }
  20116. };
  20117. })(),
  20118. /**
  20119. * @private
  20120. */
  20121. fork: function(obj) {
  20122. var ret, key, value;
  20123. if (obj && obj.constructor === Object) {
  20124. ret = ExtObject.chain(obj);
  20125. for (key in obj) {
  20126. value = obj[key];
  20127. if (value) {
  20128. if (value.constructor === Object) {
  20129. ret[key] = ExtObject.fork(value);
  20130. } else if (value instanceof Array) {
  20131. ret[key] = Ext.Array.clone(value);
  20132. }
  20133. }
  20134. }
  20135. } else {
  20136. ret = obj;
  20137. }
  20138. return ret;
  20139. },
  20140. defineProperty: ('defineProperty' in Object) ? Object.defineProperty : function(object, name, descriptor) {
  20141. if (!Object.prototype.__defineGetter__) {
  20142. return;
  20143. }
  20144. if (descriptor.get) {
  20145. object.__defineGetter__(name, descriptor.get);
  20146. }
  20147. if (descriptor.set) {
  20148. object.__defineSetter__(name, descriptor.set);
  20149. }
  20150. },
  20151. /**
  20152. * @private
  20153. */
  20154. classify: function(object) {
  20155. var prototype = object,
  20156. objectProperties = [],
  20157. propertyClassesMap = {},
  20158. objectClass = function() {
  20159. var i = 0,
  20160. ln = objectProperties.length,
  20161. property;
  20162. for (; i < ln; i++) {
  20163. property = objectProperties[i];
  20164. this[property] = new propertyClassesMap[property]();
  20165. }
  20166. },
  20167. key, value;
  20168. for (key in object) {
  20169. if (object.hasOwnProperty(key)) {
  20170. value = object[key];
  20171. if (value && value.constructor === Object) {
  20172. objectProperties.push(key);
  20173. propertyClassesMap[key] = ExtObject.classify(value);
  20174. }
  20175. }
  20176. }
  20177. objectClass.prototype = prototype;
  20178. return objectClass;
  20179. }
  20180. };
  20181. /**
  20182. * A convenient alias method for {@link Ext.Object#merge}.
  20183. *
  20184. * @member Ext
  20185. * @method merge
  20186. * @inheritdoc Ext.Object#merge
  20187. */
  20188. Ext.merge = Ext.Object.merge;
  20189. /**
  20190. * @private
  20191. * @member Ext
  20192. */
  20193. Ext.mergeIf = Ext.Object.mergeIf;
  20194. }());
  20195. /*
  20196. * This file contains miscellaneous utility methods that depends on various helper classes
  20197. * like `Ext.Array` and `Ext.Date`. Historically these methods were defined in Ext.js or
  20198. * Ext-more.js but that creates circular dependencies so they were consolidated here.
  20199. */
  20200. Ext.apply(Ext, {
  20201. // @define Ext.Util
  20202. // @require Ext
  20203. // @require Ext.lang.*
  20204. // shortcut for the special named scopes for listener scope resolution
  20205. _namedScopes: {
  20206. 'this': {
  20207. isThis: 1
  20208. },
  20209. controller: {
  20210. isController: 1
  20211. },
  20212. owner: {
  20213. isOwner: 1
  20214. },
  20215. // these two are private, used to indicate that listeners were declared on the
  20216. // class body with either an unspecified scope, or scope:'controller'
  20217. self: {
  20218. isSelf: 1
  20219. },
  20220. 'self.controller': {
  20221. isSelf: 1,
  20222. isController: 1
  20223. }
  20224. },
  20225. escapeId: (function() {
  20226. var validIdRe = /^[a-zA-Z_][a-zA-Z0-9_\-]*$/i,
  20227. escapeRx = /([\W]{1})/g,
  20228. leadingNumRx = /^(\d)/g,
  20229. escapeFn = function(match, capture) {
  20230. return "\\" + capture;
  20231. },
  20232. numEscapeFn = function(match, capture) {
  20233. return '\\00' + capture.charCodeAt(0).toString(16) + ' ';
  20234. };
  20235. return function(id) {
  20236. return validIdRe.test(id) ? id : // replace the number portion last to keep the trailing ' '
  20237. // from being escaped
  20238. id.replace(escapeRx, escapeFn).replace(leadingNumRx, numEscapeFn);
  20239. };
  20240. }()),
  20241. /**
  20242. * @method callback
  20243. * @member Ext
  20244. * Execute a callback function in a particular scope. If `callback` argument is a
  20245. * function reference, that is called. If it is a string, the string is assumed to
  20246. * be the name of a method on the given `scope`. If no function is passed the call
  20247. * is ignored.
  20248. *
  20249. * For example, these calls are equivalent:
  20250. *
  20251. * var myFunc = this.myFunc;
  20252. *
  20253. * Ext.callback('myFunc', this, [arg1, arg2]);
  20254. * Ext.callback(myFunc, this, [arg1, arg2]);
  20255. *
  20256. * Ext.isFunction(myFunc) && this.myFunc(arg1, arg2);
  20257. *
  20258. * @param {Function/String} callback The callback function to execute or the name of
  20259. * the callback method on the provided `scope`.
  20260. * @param {Object} [scope] The scope in which `callback` should be invoked. If `callback`
  20261. * is a string this object provides the method by that name. If this is `null` then
  20262. * the `caller` is used to resolve the scope to a `ViewController` or the proper
  20263. * `defaultListenerScope`.
  20264. * @param {Array} [args] The arguments to pass to the function.
  20265. * @param {Number} [delay] Pass a number to delay the call by a number of milliseconds.
  20266. * @param {Object} [caller] The object calling the callback. This is used to resolve
  20267. * named methods when no explicit `scope` is provided.
  20268. * @param {Object} [defaultScope=caller] The default scope to return if none is found.
  20269. * @return The value returned by the callback or `undefined` (if there is a `delay`
  20270. * or if the `callback` is not a function).
  20271. */
  20272. callback: function(callback, scope, args, delay, caller, defaultScope) {
  20273. if (!callback) {
  20274. return;
  20275. }
  20276. var namedScope = (scope in Ext._namedScopes);
  20277. if (callback.charAt) {
  20278. // if (isString(fn))
  20279. // Custom components cannot often use declarative method resolution when
  20280. // they need to allow the user to supply declarative method names that can
  20281. // reach the user's controller. The "up" callback syntax can help with that:
  20282. //
  20283. // xtype: 'button',
  20284. // handler: 'up.onFoo',
  20285. //
  20286. // When Ext.callback('up.onFoo',..., button) is called, we can perform a
  20287. // "button.up('[onFoo]')" search for the handler. Thus we have a declarative
  20288. // way to dispatch such handlers that will work even if the user can supply
  20289. // such handlers.
  20290. //
  20291. if (callback[2] === '.') {
  20292. // callback = 'up.foo'
  20293. if (callback.substr(0, 2) !== 'up') {
  20294. Ext.raise('Invalid callback method name "' + callback + '"');
  20295. }
  20296. if (scope) {
  20297. Ext.raise('Callback "up" syntax is incompatible with scopes');
  20298. }
  20299. if (!caller || !Ext.isFunction(caller.up)) {
  20300. Ext.raise('Callback "up" syntax requires a caller with "up" method');
  20301. }
  20302. callback = callback.substr(3);
  20303. // A good bit cheaper then caller.up('[' + callback + ']')
  20304. for (scope = caller.up(); scope && !scope[callback]; scope = scope.up()) {}
  20305. // empty
  20306. if (!scope || !Ext.isFunction(scope[callback])) {
  20307. Ext.raise('No such method "' + callback + '" found up() from ' + scope.getId ? scope.getId() : scope.id);
  20308. }
  20309. } else if ((!scope || namedScope) && caller) {
  20310. scope = caller.resolveListenerScope(namedScope ? scope : defaultScope);
  20311. }
  20312. if (!scope || !Ext.isObject(scope)) {
  20313. Ext.raise('Named method "' + callback + '" requires a scope object');
  20314. }
  20315. if (!Ext.isFunction(scope[callback])) {
  20316. Ext.raise('No method named "' + callback + '" on ' + (scope.$className || 'scope object'));
  20317. }
  20318. callback = scope[callback];
  20319. } else if (namedScope) {
  20320. scope = defaultScope || caller;
  20321. } else if (!scope) {
  20322. scope = caller;
  20323. }
  20324. var ret;
  20325. if (callback && Ext.isFunction(callback)) {
  20326. scope = scope || Ext.global;
  20327. if (delay) {
  20328. Ext.defer(callback, delay, scope, args);
  20329. } else {
  20330. ret = args ? callback.apply(scope, args) : callback.call(scope);
  20331. }
  20332. }
  20333. return ret;
  20334. },
  20335. /**
  20336. * @method coerce
  20337. * @member Ext
  20338. * Coerces the first value if possible so that it is comparable to the second value.
  20339. *
  20340. * Coercion only works between the basic atomic data types String, Boolean, Number, Date, null and undefined.
  20341. *
  20342. * Numbers and numeric strings are coerced to Dates using the value as the millisecond era value.
  20343. *
  20344. * Strings are coerced to Dates by parsing using the {@link Ext.Date#defaultFormat defaultFormat}.
  20345. *
  20346. * For example
  20347. *
  20348. * Ext.coerce('false', true);
  20349. *
  20350. * returns the boolean value `false` because the second parameter is of type `Boolean`.
  20351. *
  20352. * @param {Mixed} from The value to coerce
  20353. * @param {Mixed} to The value it must be compared against
  20354. * @return The coerced value.
  20355. */
  20356. coerce: function(from, to) {
  20357. var fromType = Ext.typeOf(from),
  20358. toType = Ext.typeOf(to),
  20359. isString = typeof from === 'string';
  20360. if (fromType !== toType) {
  20361. switch (toType) {
  20362. case 'string':
  20363. return String(from);
  20364. case 'number':
  20365. return Number(from);
  20366. case 'boolean':
  20367. // See http://ecma262-5.com/ELS5_HTML.htm#Section_11.9.3 as to why '0'.
  20368. // TL;DR => ('0' == 0), so if given string '0', we must return boolean false.
  20369. return isString && (!from || from === 'false' || from === '0') ? false : Boolean(from);
  20370. case 'null':
  20371. return isString && (!from || from === 'null') ? null : false;
  20372. case 'undefined':
  20373. return isString && (!from || from === 'undefined') ? undefined : false;
  20374. case 'date':
  20375. return isString && isNaN(from) ? Ext.Date.parse(from, Ext.Date.defaultFormat) : Date(Number(from));
  20376. }
  20377. }
  20378. return from;
  20379. },
  20380. /**
  20381. * @method copyTo
  20382. * @member Ext
  20383. * Copies a set of named properties fom the source object to the destination object.
  20384. *
  20385. * Example:
  20386. *
  20387. * var foo = { a: 1, b: 2, c: 3 };
  20388. *
  20389. * var bar = Ext.copyTo({}, foo, 'a,c');
  20390. * // bar = { a: 1, c: 3 };
  20391. *
  20392. * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
  20393. *
  20394. * @param {Object} dest The destination object.
  20395. * @param {Object} source The source object.
  20396. * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
  20397. * of property names to copy.
  20398. * @param {Boolean} [usePrototypeKeys=false] Pass `true` to copy keys off of the
  20399. * prototype as well as the instance.
  20400. * @return {Object} The `dest` object.
  20401. * @deprecated 6.0.1 Use {@link Ext#copy Ext.copy} instead. This old method
  20402. * would copy the named preoperties even if they did not exist in the source which
  20403. * could produce `undefined` values in the destination.
  20404. */
  20405. copyTo: function(dest, source, names, usePrototypeKeys) {
  20406. if (typeof names === 'string') {
  20407. names = names.split(Ext.propertyNameSplitRe);
  20408. }
  20409. for (var name,
  20410. i = 0,
  20411. n = names ? names.length : 0; i < n; i++) {
  20412. name = names[i];
  20413. if (usePrototypeKeys || source.hasOwnProperty(name)) {
  20414. dest[name] = source[name];
  20415. }
  20416. }
  20417. return dest;
  20418. },
  20419. /**
  20420. * @method copy
  20421. * @member Ext
  20422. * Copies a set of named properties fom the source object to the destination object.
  20423. *
  20424. * Example:
  20425. *
  20426. * var foo = { a: 1, b: 2, c: 3 };
  20427. *
  20428. * var bar = Ext.copy({}, foo, 'a,c');
  20429. * // bar = { a: 1, c: 3 };
  20430. *
  20431. * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
  20432. *
  20433. * @param {Object} dest The destination object.
  20434. * @param {Object} source The source object.
  20435. * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
  20436. * of property names to copy.
  20437. * @param {Boolean} [usePrototypeKeys=false] Pass `true` to copy keys off of the
  20438. * prototype as well as the instance.
  20439. * @return {Object} The `dest` object.
  20440. */
  20441. copy: function(dest, source, names, usePrototypeKeys) {
  20442. if (typeof names === 'string') {
  20443. names = names.split(Ext.propertyNameSplitRe);
  20444. }
  20445. for (var name,
  20446. i = 0,
  20447. n = names ? names.length : 0; i < n; i++) {
  20448. name = names[i];
  20449. // Only copy a property if the source actually *has* that property.
  20450. // If we are including prototype properties, then ensure that a property of
  20451. // that name can be found *somewhere* in the prototype chain (otherwise we'd be copying undefined in which may break things)
  20452. if (source.hasOwnProperty(name) || (usePrototypeKeys && name in source)) {
  20453. dest[name] = source[name];
  20454. }
  20455. }
  20456. return dest;
  20457. },
  20458. propertyNameSplitRe: /[,;\s]+/,
  20459. /**
  20460. * @method copyToIf
  20461. * @member Ext
  20462. * Copies a set of named properties fom the source object to the destination object
  20463. * if the destination object does not already have them.
  20464. *
  20465. * Example:
  20466. *
  20467. * var foo = { a: 1, b: 2, c: 3 };
  20468. *
  20469. * var bar = Ext.copyToIf({ a:42 }, foo, 'a,c');
  20470. * // bar = { a: 42, c: 3 };
  20471. *
  20472. * @param {Object} destination The destination object.
  20473. * @param {Object} source The source object.
  20474. * @param {String/String[]} names Either an Array of property names, or a single string
  20475. * with a list of property names separated by ",", ";" or spaces.
  20476. * @return {Object} The `dest` object.
  20477. * @deprecated 6.0.1 Use {@link Ext#copyIf Ext.copyIf} instead. This old method
  20478. * would copy the named preoperties even if they did not exist in the source which
  20479. * could produce `undefined` values in the destination.
  20480. */
  20481. copyToIf: function(destination, source, names) {
  20482. if (typeof names === 'string') {
  20483. names = names.split(Ext.propertyNameSplitRe);
  20484. }
  20485. for (var name,
  20486. i = 0,
  20487. n = names ? names.length : 0; i < n; i++) {
  20488. name = names[i];
  20489. if (destination[name] === undefined) {
  20490. destination[name] = source[name];
  20491. }
  20492. }
  20493. return destination;
  20494. },
  20495. /**
  20496. * @method copyIf
  20497. * @member Ext
  20498. * Copies a set of named properties fom the source object to the destination object
  20499. * if the destination object does not already have them.
  20500. *
  20501. * Example:
  20502. *
  20503. * var foo = { a: 1, b: 2, c: 3 };
  20504. *
  20505. * var bar = Ext.copyIf({ a:42 }, foo, 'a,c');
  20506. * // bar = { a: 42, c: 3 };
  20507. *
  20508. * @param {Object} destination The destination object.
  20509. * @param {Object} source The source object.
  20510. * @param {String/String[]} names Either an Array of property names, or a single string
  20511. * with a list of property names separated by ",", ";" or spaces.
  20512. * @return {Object} The `dest` object.
  20513. */
  20514. copyIf: function(destination, source, names) {
  20515. if (typeof names === 'string') {
  20516. names = names.split(Ext.propertyNameSplitRe);
  20517. }
  20518. for (var name,
  20519. i = 0,
  20520. n = names ? names.length : 0; i < n; i++) {
  20521. name = names[i];
  20522. // Only copy a property if the destination has no property by that name
  20523. if (!(name in destination) && (name in source)) {
  20524. destination[name] = source[name];
  20525. }
  20526. }
  20527. return destination;
  20528. },
  20529. /**
  20530. * @method extend
  20531. * @member Ext
  20532. * This method deprecated. Use {@link Ext#define Ext.define} instead.
  20533. * @param {Function} superclass
  20534. * @param {Object} overrides
  20535. * @return {Function} The subclass constructor from the <tt>overrides</tt> parameter, or a generated one if not provided.
  20536. * @deprecated 4.0.0 Use {@link Ext#define Ext.define} instead
  20537. */
  20538. extend: (function() {
  20539. // inline overrides
  20540. var objectConstructor = Object.prototype.constructor,
  20541. inlineOverrides = function(o) {
  20542. var m;
  20543. for (m in o) {
  20544. if (!o.hasOwnProperty(m)) {
  20545. continue;
  20546. }
  20547. this[m] = o[m];
  20548. }
  20549. };
  20550. return function(subclass, superclass, overrides) {
  20551. // First we check if the user passed in just the superClass with overrides
  20552. if (Ext.isObject(superclass)) {
  20553. overrides = superclass;
  20554. superclass = subclass;
  20555. subclass = overrides.constructor !== objectConstructor ? overrides.constructor : function() {
  20556. superclass.apply(this, arguments);
  20557. };
  20558. }
  20559. if (!superclass) {
  20560. Ext.raise({
  20561. sourceClass: 'Ext',
  20562. sourceMethod: 'extend',
  20563. msg: 'Attempting to extend from a class which has not been loaded on the page.'
  20564. });
  20565. }
  20566. // We create a new temporary class
  20567. var F = function() {},
  20568. subclassProto,
  20569. superclassProto = superclass.prototype;
  20570. F.prototype = superclassProto;
  20571. subclassProto = subclass.prototype = new F();
  20572. subclassProto.constructor = subclass;
  20573. subclass.superclass = superclassProto;
  20574. if (superclassProto.constructor === objectConstructor) {
  20575. superclassProto.constructor = superclass;
  20576. }
  20577. subclass.override = function(overrides) {
  20578. Ext.override(subclass, overrides);
  20579. };
  20580. subclassProto.override = inlineOverrides;
  20581. subclassProto.proto = subclassProto;
  20582. subclass.override(overrides);
  20583. subclass.extend = function(o) {
  20584. return Ext.extend(subclass, o);
  20585. };
  20586. return subclass;
  20587. };
  20588. }()),
  20589. /**
  20590. * Indicates if the page is currently running in online or offline mode, according
  20591. * to the `navigator.onLine` property.
  20592. * @return {Boolean} `true` if the page is currently running in an online mode.
  20593. *
  20594. * @since 6.2.1
  20595. */
  20596. isOnline: function() {
  20597. return Ext.global.navigator.onLine;
  20598. },
  20599. /**
  20600. * @method iterate
  20601. * @member Ext
  20602. * Iterates either an array or an object. This method delegates to
  20603. * {@link Ext.Array#each Ext.Array.each} if the given value is iterable, and {@link Ext.Object#each Ext.Object.each} otherwise.
  20604. *
  20605. * @param {Object/Array} object The object or array to be iterated.
  20606. * @param {Function} fn The function to be called for each iteration. See and {@link Ext.Array#each Ext.Array.each} and
  20607. * {@link Ext.Object#each Ext.Object.each} for detailed lists of arguments passed to this function depending on the given object
  20608. * type that is being iterated.
  20609. * @param {Object} [scope] The scope (`this` reference) in which the specified function is executed.
  20610. * Defaults to the object being iterated itself.
  20611. */
  20612. iterate: function(object, fn, scope) {
  20613. if (Ext.isEmpty(object)) {
  20614. return;
  20615. }
  20616. if (scope === undefined) {
  20617. scope = object;
  20618. }
  20619. if (Ext.isIterable(object)) {
  20620. Ext.Array.each.call(Ext.Array, object, fn, scope);
  20621. } else {
  20622. Ext.Object.each.call(Ext.Object, object, fn, scope);
  20623. }
  20624. },
  20625. _resourcePoolRe: /^[<]([^<>@:]*)(?:[@]([^<>@:]+))?[>](.+)$/,
  20626. /**
  20627. * Resolves a resource URL that may contain a resource pool identifier token at the
  20628. * front. The tokens are formatted as HTML tags "&lt;poolName@packageName&gt;" followed
  20629. * by a normal relative path. This token is only processed if present at the first
  20630. * character of the given string.
  20631. *
  20632. * These tokens are parsed and the pieces are then passed to the
  20633. * {@link Ext#getResourcePath} method.
  20634. *
  20635. * For example:
  20636. *
  20637. * [{
  20638. * xtype: 'image',
  20639. * src: '<shared>images/foo.png'
  20640. * },{
  20641. * xtype: 'image',
  20642. * src: '<@package>images/foo.png'
  20643. * },{
  20644. * xtype: 'image',
  20645. * src: '<shared@package>images/foo.png'
  20646. * }]
  20647. *
  20648. * In the above example, "shared" is the name of a Sencha Cmd resource pool and
  20649. * "package" is the name of a Sencha Cmd package.
  20650. * @member Ext
  20651. * @param {String} url The URL that may contain a resource pool token at the front.
  20652. * @return {String}
  20653. * @since 6.0.1
  20654. */
  20655. resolveResource: function(url) {
  20656. var ret = url,
  20657. m;
  20658. if (url && url.charAt(0) === '<') {
  20659. m = Ext._resourcePoolRe.exec(url);
  20660. if (m) {
  20661. ret = Ext.getResourcePath(m[3], m[1], m[2]);
  20662. }
  20663. }
  20664. return ret;
  20665. },
  20666. /**
  20667. *
  20668. * @member Ext
  20669. * @method urlEncode
  20670. * @inheritdoc Ext.Object#toQueryString
  20671. * @deprecated 4.0.0 Use {@link Ext.Object#toQueryString} instead
  20672. */
  20673. urlEncode: function() {
  20674. var args = Ext.Array.from(arguments),
  20675. prefix = '';
  20676. // Support for the old `pre` argument
  20677. if (Ext.isString(args[1])) {
  20678. prefix = args[1] + '&';
  20679. args[1] = false;
  20680. }
  20681. return prefix + Ext.Object.toQueryString.apply(Ext.Object, args);
  20682. },
  20683. /**
  20684. * Alias for {@link Ext.Object#fromQueryString}.
  20685. *
  20686. * @member Ext
  20687. * @method urlDecode
  20688. * @inheritdoc Ext.Object#fromQueryString
  20689. * @deprecated 4.0.0 Use {@link Ext.Object#fromQueryString} instead
  20690. */
  20691. urlDecode: function() {
  20692. return Ext.Object.fromQueryString.apply(Ext.Object, arguments);
  20693. },
  20694. /**
  20695. * @method getScrollbarSize
  20696. * @member Ext
  20697. * Returns the size of the browser scrollbars. This can differ depending on
  20698. * operating system settings, such as the theme or font size.
  20699. * @param {Boolean} [force] true to force a recalculation of the value.
  20700. * @return {Object} An object containing scrollbar sizes.
  20701. * @return {Number} return.width The width of the vertical scrollbar.
  20702. * @return {Number} return.height The height of the horizontal scrollbar.
  20703. */
  20704. getScrollbarSize: function(force) {
  20705. if (!Ext.isDomReady) {
  20706. Ext.raise("getScrollbarSize called before DomReady");
  20707. }
  20708. var scrollbarSize = Ext._scrollbarSize;
  20709. if (force || !scrollbarSize) {
  20710. var db = document.body,
  20711. div = document.createElement('div'),
  20712. h, w;
  20713. div.style.width = div.style.height = '100px';
  20714. div.style.overflow = 'scroll';
  20715. div.style.position = 'absolute';
  20716. db.appendChild(div);
  20717. // now we can measure the div...
  20718. // at least in iE9 the div is not 100px - the scrollbar size is removed!
  20719. Ext._scrollbarSize = scrollbarSize = {
  20720. width: w = div.offsetWidth - div.clientWidth,
  20721. height: h = div.offsetHeight - div.clientHeight
  20722. };
  20723. scrollbarSize.reservedWidth = w ? 'calc(100% - ' + w + 'px)' : '';
  20724. scrollbarSize.reservedHeight = h ? 'calc(100% - ' + h + 'px)' : '';
  20725. db.removeChild(div);
  20726. }
  20727. return scrollbarSize;
  20728. },
  20729. /**
  20730. * @method typeOf
  20731. * @member Ext
  20732. * Returns the type of the given variable in string format. List of possible values are:
  20733. *
  20734. * - `undefined`: If the given value is `undefined`
  20735. * - `null`: If the given value is `null`
  20736. * - `string`: If the given value is a string
  20737. * - `number`: If the given value is a number
  20738. * - `boolean`: If the given value is a boolean value
  20739. * - `date`: If the given value is a `Date` object
  20740. * - `function`: If the given value is a function reference
  20741. * - `object`: If the given value is an object
  20742. * - `array`: If the given value is an array
  20743. * - `regexp`: If the given value is a regular expression
  20744. * - `element`: If the given value is a DOM Element
  20745. * - `textnode`: If the given value is a DOM text node and contains something other than whitespace
  20746. * - `whitespace`: If the given value is a DOM text node and contains only whitespace
  20747. *
  20748. * @param {Object} value
  20749. * @return {String}
  20750. */
  20751. typeOf: (function() {
  20752. var nonWhitespaceRe = /\S/,
  20753. toString = Object.prototype.toString,
  20754. typeofTypes = {
  20755. number: 1,
  20756. string: 1,
  20757. 'boolean': 1,
  20758. 'undefined': 1
  20759. },
  20760. toStringTypes = {
  20761. '[object Array]': 'array',
  20762. '[object Date]': 'date',
  20763. '[object Boolean]': 'boolean',
  20764. '[object Number]': 'number',
  20765. '[object RegExp]': 'regexp'
  20766. };
  20767. return function(value) {
  20768. if (value === null) {
  20769. return 'null';
  20770. }
  20771. var type = typeof value,
  20772. ret, typeToString;
  20773. if (typeofTypes[type]) {
  20774. return type;
  20775. }
  20776. ret = toStringTypes[typeToString = toString.call(value)];
  20777. if (ret) {
  20778. return ret;
  20779. }
  20780. if (type === 'function') {
  20781. return 'function';
  20782. }
  20783. if (type === 'object') {
  20784. if (value.nodeType !== undefined) {
  20785. if (value.nodeType === 3) {
  20786. return nonWhitespaceRe.test(value.nodeValue) ? 'textnode' : 'whitespace';
  20787. } else {
  20788. return 'element';
  20789. }
  20790. }
  20791. return 'object';
  20792. }
  20793. Ext.raise({
  20794. sourceClass: 'Ext',
  20795. sourceMethod: 'typeOf',
  20796. msg: 'Failed to determine the type of "' + value + '".'
  20797. });
  20798. return typeToString;
  20799. };
  20800. }()),
  20801. /**
  20802. * A global factory method to instantiate a class from a config object. For example,
  20803. * these two calls are equivalent:
  20804. *
  20805. * Ext.factory({ text: 'My Button' }, 'Ext.Button');
  20806. * Ext.create('Ext.Button', { text: 'My Button' });
  20807. *
  20808. * If an existing instance is also specified, it will be updated with the supplied config object. This is useful
  20809. * if you need to either create or update an object, depending on if an instance already exists. For example:
  20810. *
  20811. * var button;
  20812. * button = Ext.factory({ text: 'New Button' }, 'Ext.Button', button); // Button created
  20813. * button = Ext.factory({ text: 'Updated Button' }, 'Ext.Button', button); // Button updated
  20814. *
  20815. * @param {Object} config The config object to instantiate or update an instance with.
  20816. * @param {String} [classReference] The class to instantiate from (if there is a default).
  20817. * @param {Object} [instance] The instance to update.
  20818. * @param [aliasNamespace]
  20819. * @member Ext
  20820. * @deprecated 6.5.0 Use the {@link Ext.Factory#method!update update} method of the
  20821. * associated factory instead.
  20822. */
  20823. factory: function(config, classReference, instance, aliasNamespace) {
  20824. var manager = Ext.ClassManager,
  20825. newInstance;
  20826. // If config is falsy or a valid instance, destroy the current instance
  20827. // (if it exists) and replace with the new one
  20828. if (!config || config.isInstance) {
  20829. if (instance && instance !== config) {
  20830. instance.destroy();
  20831. }
  20832. return config;
  20833. }
  20834. if (aliasNamespace) {
  20835. // If config is a string value, treat it as an alias
  20836. if (typeof config === 'string') {
  20837. return manager.instantiateByAlias(aliasNamespace + '.' + config);
  20838. }
  20839. // Same if 'type' is given in config
  20840. else if (Ext.isObject(config) && 'type' in config) {
  20841. return manager.instantiateByAlias(aliasNamespace + '.' + config.type, config);
  20842. }
  20843. }
  20844. if (config === true) {
  20845. if (!instance && !classReference) {
  20846. Ext.raise('[Ext.factory] Cannot determine type of class to create');
  20847. }
  20848. return instance || Ext.create(classReference);
  20849. }
  20850. if (!Ext.isObject(config)) {
  20851. Ext.raise("Invalid config, must be a valid config object");
  20852. }
  20853. if ('xtype' in config) {
  20854. newInstance = manager.instantiateByAlias('widget.' + config.xtype, config);
  20855. } else if ('xclass' in config) {
  20856. newInstance = Ext.create(config.xclass, config);
  20857. }
  20858. if (newInstance) {
  20859. if (instance) {
  20860. instance.destroy();
  20861. }
  20862. return newInstance;
  20863. }
  20864. if (instance) {
  20865. return instance.setConfig(config);
  20866. }
  20867. return Ext.create(classReference, config);
  20868. },
  20869. /**
  20870. * This method converts an object containing config objects keyed by `itemId` into
  20871. * an array of config objects.
  20872. *
  20873. * @param {Object} items An object containing config objects keyed by `itemId`.
  20874. * @param {String} [defaultProperty="xtype"] The property to set for string items.
  20875. * @param functionProperty
  20876. * @return {Object[]}
  20877. * @member Ext
  20878. * @since 6.5.0
  20879. * @private
  20880. */
  20881. convertKeyedItems: function(items, defaultProperty, functionProperty) {
  20882. if (items && !items.isInstance && Ext.isObject(items)) {
  20883. var obj = items,
  20884. item, itemId, value;
  20885. items = [];
  20886. // See if obj looks like a single thing
  20887. if (obj.xtype || obj.xclass || obj.itemId || obj.id) {
  20888. items.push(obj);
  20889. } else {
  20890. for (itemId in obj) {
  20891. item = obj[itemId];
  20892. if (item) {
  20893. if (item === true) {
  20894. item = {};
  20895. } else if (typeof item === 'function') {
  20896. if (!functionProperty) {
  20897. Ext.raise('Function not expected here');
  20898. }
  20899. value = item;
  20900. item = {};
  20901. item[functionProperty] = value;
  20902. } else if (typeof item === 'string') {
  20903. value = item;
  20904. item = {};
  20905. item[defaultProperty || 'xtype'] = value;
  20906. } else {
  20907. item = Ext.apply({}, item);
  20908. }
  20909. item.itemId = itemId;
  20910. items.push(item);
  20911. }
  20912. }
  20913. }
  20914. }
  20915. return items;
  20916. },
  20917. /**
  20918. * Comparison function for sorting an array of objects in ascending order of `weight`.
  20919. * @param {Object} lhs
  20920. * @param {Object} rhs
  20921. * @return {Number}
  20922. * @member Ext
  20923. * @private
  20924. * @since 6.5.0
  20925. */
  20926. weightSortFn: function(lhs, rhs) {
  20927. return (lhs.weight || 0) - (rhs.weight || 0);
  20928. },
  20929. /**
  20930. * Concatenate 2 arrays. If either argument is `null` or `undefined` then it's not
  20931. * concatenated.
  20932. *
  20933. * @param {Object/Object[]} a
  20934. * @param {Object/Object[]} b
  20935. * @return {Object[]}
  20936. * @member Ext
  20937. * @private
  20938. * @since 6.5.1
  20939. */
  20940. concat: function(a, b) {
  20941. var noB = b == null,
  20942. E = Ext.emptyArray;
  20943. return (a == null) ? (noB ? a : E.concat(b)) : (noB ? E.concat(a) : E.concat(a, b));
  20944. },
  20945. /**
  20946. * @method log
  20947. * @member Ext
  20948. * Logs a message. If a console is present it will be used. On Opera, the method
  20949. * "opera.postError" is called. In other cases, the message is logged to an array
  20950. * "Ext.log.out". An attached debugger can watch this array and view the log. The
  20951. * log buffer is limited to a maximum of "Ext.log.max" entries (defaults to 250).
  20952. *
  20953. * If additional parameters are passed, they are joined and appended to the message.
  20954. * A technique for tracing entry and exit of a function is this:
  20955. *
  20956. * function foo () {
  20957. * Ext.log({ indent: 1 }, '>> foo');
  20958. *
  20959. * // log statements in here or methods called from here will be indented
  20960. * // by one step
  20961. *
  20962. * Ext.log({ outdent: 1 }, '<< foo');
  20963. * }
  20964. *
  20965. * This method does nothing in a release build.
  20966. *
  20967. * @param {String/Object} [options] The message to log or an options object with any
  20968. * of the following properties:
  20969. *
  20970. * - `msg`: The message to log (required).
  20971. * - `level`: One of: "error", "warn", "info" or "log" (the default is "log").
  20972. * - `dump`: An object to dump to the log as part of the message.
  20973. * - `stack`: True to include a stack trace in the log.
  20974. * - `indent`: Cause subsequent log statements to be indented one step.
  20975. * - `outdent`: Cause this and following statements to be one step less indented.
  20976. *
  20977. * @param {String...} [message] The message to log (required unless specified in
  20978. * options object).
  20979. */
  20980. log: (function() {
  20981. /*
  20982. * Iterate through an object to dump its content into a string.
  20983. * For example:
  20984. * {
  20985. * style: {
  20986. * lineWidth: 1
  20987. * },
  20988. * label: {},
  20989. * marker: {
  20990. * strokeStyle: "#555",
  20991. * radius: 3,
  20992. * size: 3
  20993. * },
  20994. * subStyle: {
  20995. * fillStyle: [
  20996. * 0: "#133987",
  20997. * 1: "#1c55ca",
  20998. * 2: "#4d7fe6"
  20999. * ]
  21000. * },
  21001. * markerSubStyle: {}
  21002. * }
  21003. *
  21004. * @param {Object} object The object to iterate
  21005. * @param {Number} [level] Current level of identation (and recursion). Default is 0.
  21006. * @param {Number} [maxLevel] Maximum level of recursion. Default is 3.
  21007. * @param {Boolean} [withFunctions] Include functions in the output.
  21008. * @return {String} The string with the contents of the object
  21009. */
  21010. var primitiveRe = /string|number|boolean/;
  21011. function dumpObject(object, level, maxLevel, withFunctions) {
  21012. var member, type, value, name, prefix, suffix,
  21013. members = [];
  21014. if (Ext.isArray(object)) {
  21015. prefix = '[';
  21016. suffix = ']';
  21017. } else if (Ext.isObject(object)) {
  21018. prefix = '{';
  21019. suffix = '}';
  21020. }
  21021. if (!maxLevel) {
  21022. maxLevel = 3;
  21023. }
  21024. if (level > maxLevel) {
  21025. return prefix + '...' + suffix;
  21026. }
  21027. level = level || 1;
  21028. var spacer = (new Array(level)).join(' ');
  21029. // Cannot use Ext.encode since it can recurse endlessly
  21030. for (name in object) {
  21031. if (object.hasOwnProperty(name)) {
  21032. value = object[name];
  21033. type = typeof value;
  21034. if (type === 'function') {
  21035. if (!withFunctions) {
  21036. continue;
  21037. }
  21038. member = type;
  21039. } else if (type === 'undefined') {
  21040. member = type;
  21041. } else if (value === null || primitiveRe.test(type) || Ext.isDate(value)) {
  21042. member = Ext.encode(value);
  21043. } else if (Ext.isArray(value)) {
  21044. member = dumpObject(value, level + 1, maxLevel, withFunctions);
  21045. } else if (Ext.isObject(value)) {
  21046. member = dumpObject(value, level + 1, maxLevel, withFunctions);
  21047. } else {
  21048. member = type;
  21049. }
  21050. members.push(spacer + name + ': ' + member);
  21051. }
  21052. }
  21053. // or Ext.encode(name)
  21054. if (members.length) {
  21055. return prefix + '\n ' + members.join(',\n ') + '\n' + spacer + suffix;
  21056. }
  21057. return prefix + suffix;
  21058. }
  21059. function log(message) {
  21060. var options, dump,
  21061. con = Ext.global.console,
  21062. level = 'log',
  21063. indent = log.indent || 0,
  21064. prefix, stack, fn, out, max;
  21065. log.indent = indent;
  21066. if (typeof message !== 'string') {
  21067. options = message;
  21068. message = options.msg || '';
  21069. level = options.level || level;
  21070. dump = options.dump;
  21071. stack = options.stack;
  21072. prefix = options.prefix;
  21073. fn = options.fn;
  21074. if (options.indent) {
  21075. ++log.indent;
  21076. } else if (options.outdent) {
  21077. log.indent = indent = Math.max(indent - 1, 0);
  21078. }
  21079. if (dump && !(con && con.dir)) {
  21080. message += dumpObject(dump);
  21081. dump = null;
  21082. }
  21083. }
  21084. if (arguments.length > 1) {
  21085. message += Array.prototype.slice.call(arguments, 1).join('');
  21086. }
  21087. if (prefix) {
  21088. message = prefix + ' - ' + message;
  21089. }
  21090. message = indent ? Ext.String.repeat(' ', log.indentSize * indent) + message : message;
  21091. // w/o console, all messages are equal, so munge the level into the message:
  21092. if (level !== 'log') {
  21093. message = '[' + level.charAt(0).toUpperCase() + '] ' + message;
  21094. }
  21095. if (fn) {
  21096. message += '\nCaller: ' + fn.toString();
  21097. }
  21098. // Not obvious, but 'console' comes and goes when Firebug is turned on/off, so
  21099. // an early test may fail either direction if Firebug is toggled.
  21100. //
  21101. if (con) {
  21102. // if (Firebug-like console)
  21103. if (con[level]) {
  21104. con[level](message);
  21105. } else {
  21106. con.log(message);
  21107. }
  21108. if (dump) {
  21109. con.dir(dump);
  21110. }
  21111. if (stack && con.trace) {
  21112. // Firebug's console.error() includes a trace already...
  21113. if (!con.firebug || level !== 'error') {
  21114. con.trace();
  21115. }
  21116. }
  21117. } else if (Ext.isOpera) {
  21118. opera.postError(message);
  21119. } else // jshint ignore:line
  21120. {
  21121. out = log.out;
  21122. max = log.max;
  21123. if (out.length >= max) {
  21124. // this formula allows out.max to change (via debugger), where the
  21125. // more obvious "max/4" would not quite be the same
  21126. Ext.Array.erase(out, 0, out.length - 3 * Math.floor(max / 4));
  21127. }
  21128. // keep newest 75%
  21129. out.push(message);
  21130. }
  21131. // Mostly informational, but the Ext.Error notifier uses them:
  21132. ++log.count;
  21133. ++log.counters[level];
  21134. }
  21135. function logx(level, args) {
  21136. if (typeof args[0] === 'string') {
  21137. args.unshift({});
  21138. }
  21139. args[0].level = level;
  21140. log.apply(this, args);
  21141. }
  21142. log.error = function() {
  21143. logx('error', Array.prototype.slice.call(arguments));
  21144. };
  21145. log.info = function() {
  21146. logx('info', Array.prototype.slice.call(arguments));
  21147. };
  21148. log.warn = function() {
  21149. logx('warn', Array.prototype.slice.call(arguments));
  21150. };
  21151. log.count = 0;
  21152. log.counters = {
  21153. error: 0,
  21154. warn: 0,
  21155. info: 0,
  21156. log: 0
  21157. };
  21158. log.indentSize = 2;
  21159. log.out = [];
  21160. log.max = 750;
  21161. return log;
  21162. }()) || (function() {
  21163. var nullLog = function() {};
  21164. nullLog.info = nullLog.warn = nullLog.error = Ext.emptyFn;
  21165. return nullLog;
  21166. }())
  21167. });
  21168. /**
  21169. * @class Ext.Version
  21170. *
  21171. * A utility class that wraps around a version number string and provides convenient methods
  21172. * to perform comparisons. A version number is expressed in the following general format:
  21173. *
  21174. * major[.minor[.patch[.build[release]]]]
  21175. *
  21176. * The `Version` instance holds various readonly properties that contain the digested form
  21177. * of the version string. The numeric componnets of `major`, `minor`, `patch` and `build`
  21178. * as well as the textual suffix called `release`.
  21179. *
  21180. * Not depicted in the above syntax are three possible prefixes used to control partial
  21181. * matching. These are '^' (the default), '>' and '~'. These are discussed below.
  21182. *
  21183. * Examples:
  21184. *
  21185. * var version = new Ext.Version('1.0.2beta'); // or maybe "1.0" or "1.2.3.4RC"
  21186. * console.log("Version is " + version); // Version is 1.0.2beta
  21187. *
  21188. * console.log(version.getMajor()); // 1
  21189. * console.log(version.getMinor()); // 0
  21190. * console.log(version.getPatch()); // 2
  21191. * console.log(version.getBuild()); // 0
  21192. * console.log(version.getRelease()); // beta
  21193. *
  21194. * The understood values of `release` are assigned numberic equivalents for the sake of
  21195. * comparsion. The order of these from smallest to largest is as follows:
  21196. *
  21197. * * `"dev"`
  21198. * * `"alpha"` or `"a"`
  21199. * * `"beta"` or `"b"`
  21200. * * `"RC"` or `"rc"`
  21201. * * `"#"`
  21202. * * `"pl"` or `"p"`
  21203. *
  21204. * Any other (unrecognized) suffix is consider greater than any of these.
  21205. *
  21206. * ## Comparisons
  21207. * There are two forms of comparison that are commonly needed: full and partial. Full
  21208. * comparison is simpler and is also the default.
  21209. *
  21210. * Example:
  21211. *
  21212. * var version = new Ext.Version('1.0.2beta');
  21213. *
  21214. * console.log(version.isGreaterThan('1.0.1')); // True
  21215. * console.log(version.isGreaterThan('1.0.2alpha')); // True
  21216. * console.log(version.isGreaterThan('1.0.2RC')); // False
  21217. * console.log(version.isGreaterThan('1.0.2')); // False
  21218. * console.log(version.isLessThan('1.0.2')); // True
  21219. *
  21220. * console.log(version.match(1.0)); // True (using a Number)
  21221. * console.log(version.match('1.0.2')); // True (using a String)
  21222. *
  21223. * These comparisons are ultimately implemented by {@link Ext.Version#compareTo compareTo}
  21224. * which returns -1, 0 or 1 depending on whether the `Version' instance is less than, equal
  21225. * to, or greater than the given "other" version.
  21226. *
  21227. * For example:
  21228. *
  21229. * var n = version.compareTo('1.0.1'); // == 1 (because 1.0.2beta > 1.0.1)
  21230. *
  21231. * n = version.compareTo('1.1'); // == -1
  21232. * n = version.compareTo(version); // == 0
  21233. *
  21234. * ### Partial Comparisons
  21235. * By default, unspecified version number fields are filled with 0. In other words, the
  21236. * version number fields are 0-padded on the right or a "lower bound". This produces the
  21237. * most commonly used forms of comparsion:
  21238. *
  21239. * var ver = new Version('4.2');
  21240. *
  21241. * n = ver.compareTo('4.2.1'); // == -1 (4.2 promotes to 4.2.0 and is less than 4.2.1)
  21242. *
  21243. * There are two other ways to interpret comparisons of versions of different length. The
  21244. * first of these is to change the padding on the right to be a large number (scuh as
  21245. * Infinity) instead of 0. This has the effect of making the version an upper bound. For
  21246. * example:
  21247. *
  21248. * var ver = new Version('^4.2'); // NOTE: the '^' prefix used
  21249. *
  21250. * n = ver.compareTo('4.3'); // == -1 (less than 4.3)
  21251. *
  21252. * n = ver.compareTo('4.2'); // == 1 (greater than all 4.2's)
  21253. * n = ver.compareTo('4.2.1'); // == 1
  21254. * n = ver.compareTo('4.2.9'); // == 1
  21255. *
  21256. * The second way to interpret this comparison is to ignore the extra digits, making the
  21257. * match a prefix match. For example:
  21258. *
  21259. * var ver = new Version('~4.2'); // NOTE: the '~' prefix used
  21260. *
  21261. * n = ver.compareTo('4.3'); // == -1
  21262. *
  21263. * n = ver.compareTo('4.2'); // == 0
  21264. * n = ver.compareTo('4.2.1'); // == 0
  21265. *
  21266. * This final form can be useful when version numbers contain more components than are
  21267. * important for certain comparisons. For example, the full version of Ext JS 4.2.1 is
  21268. * "4.2.1.883" where 883 is the `build` number.
  21269. *
  21270. * This is how to create a "partial" `Version` and compare versions to it:
  21271. *
  21272. * var version421ish = new Version('~4.2.1');
  21273. *
  21274. * n = version421ish.compareTo('4.2.1.883'); // == 0
  21275. * n = version421ish.compareTo('4.2.1.2'); // == 0
  21276. * n = version421ish.compareTo('4.2.1'); // == 0
  21277. *
  21278. * n = version421ish.compareTo('4.2'); // == 1
  21279. *
  21280. * In the above example, '4.2.1.2' compares as equal to '4.2.1' because digits beyond the
  21281. * given "4.2.1" are ignored. However, '4.2' is less than the '4.2.1' prefix; its missing
  21282. * digit is filled with 0.
  21283. */
  21284. (function() {
  21285. // @define Ext.Version
  21286. // @require Ext.String
  21287. var // used by checkVersion to avoid temp arrays:
  21288. checkVerTemp = [
  21289. ''
  21290. ],
  21291. endOfVersionRe = /([^\d\.])/,
  21292. notDigitsRe = /[^\d]/g,
  21293. plusMinusRe = /[\-+]/g,
  21294. stripRe = /\s/g,
  21295. underscoreRe = /_/g,
  21296. toolkitNames = {
  21297. classic: 1,
  21298. modern: 1
  21299. },
  21300. Version;
  21301. Ext.Version = Version = function(version, defaultMode) {
  21302. var me = this,
  21303. padModes = me.padModes,
  21304. ch, i, pad, parts, release, releaseStartIndex, ver;
  21305. if (version.isVersion) {
  21306. version = version.version;
  21307. }
  21308. me.version = ver = String(version).toLowerCase().replace(underscoreRe, '.').replace(plusMinusRe, '');
  21309. ch = ver.charAt(0);
  21310. if (ch in padModes) {
  21311. ver = ver.substring(1);
  21312. pad = padModes[ch];
  21313. } else {
  21314. pad = defaultMode ? padModes[defaultMode] : 0;
  21315. }
  21316. // careful - NaN is falsey!
  21317. me.pad = pad;
  21318. releaseStartIndex = ver.search(endOfVersionRe);
  21319. me.shortVersion = ver;
  21320. if (releaseStartIndex !== -1) {
  21321. me.release = release = ver.substr(releaseStartIndex, version.length);
  21322. me.shortVersion = ver.substr(0, releaseStartIndex);
  21323. release = Version.releaseValueMap[release] || release;
  21324. }
  21325. me.releaseValue = release || pad;
  21326. me.shortVersion = me.shortVersion.replace(notDigitsRe, '');
  21327. /**
  21328. * @property {Number[]} parts
  21329. * The split array of version number components found in the version string.
  21330. * For example, for "1.2.3", this would be `[1, 2, 3]`.
  21331. * @readonly
  21332. * @private
  21333. */
  21334. me.parts = parts = ver.split('.');
  21335. for (i = parts.length; i--; ) {
  21336. parts[i] = parseInt(parts[i], 10);
  21337. }
  21338. if (pad === Infinity) {
  21339. // have to add this to the end to create an upper bound:
  21340. parts.push(pad);
  21341. }
  21342. /**
  21343. * @property {Number} major
  21344. * The first numeric part of the version number string.
  21345. * @readonly
  21346. */
  21347. me.major = parts[0] || pad;
  21348. /**
  21349. * @property {Number} [minor]
  21350. * The second numeric part of the version number string.
  21351. * @readonly
  21352. */
  21353. me.minor = parts[1] || pad;
  21354. /**
  21355. * @property {Number} [patch]
  21356. * The third numeric part of the version number string.
  21357. * @readonly
  21358. */
  21359. me.patch = parts[2] || pad;
  21360. /**
  21361. * @property {Number} [build]
  21362. * The fourth numeric part of the version number string.
  21363. * @readonly
  21364. */
  21365. me.build = parts[3] || pad;
  21366. return me;
  21367. };
  21368. Version.prototype = {
  21369. isVersion: true,
  21370. padModes: {
  21371. '~': NaN,
  21372. '^': Infinity
  21373. },
  21374. /**
  21375. * @property {String} [release=""]
  21376. * The release level. The following values are understood:
  21377. *
  21378. * * `"dev"`
  21379. * * `"alpha"` or `"a"`
  21380. * * `"beta"` or `"b"`
  21381. * * `"RC"` or `"rc"`
  21382. * * `"#"`
  21383. * * `"pl"` or `"p"`
  21384. * @readonly
  21385. */
  21386. release: '',
  21387. /**
  21388. * Compares this version instance to the specified `other` version.
  21389. *
  21390. * @param {String/Number/Ext.Version} other The other version to which to compare.
  21391. * @return {Number} -1 if this version is less than the target version, 1 if this
  21392. * version is greater, and 0 if they are equal.
  21393. */
  21394. compareTo: function(other) {
  21395. // "lhs" == "left-hand-side"
  21396. // "rhs" == "right-hand-side"
  21397. var me = this,
  21398. lhsPad = me.pad,
  21399. lhsParts = me.parts,
  21400. lhsLength = lhsParts.length,
  21401. rhsVersion = other.isVersion ? other : new Version(other),
  21402. rhsPad = rhsVersion.pad,
  21403. rhsParts = rhsVersion.parts,
  21404. rhsLength = rhsParts.length,
  21405. length = Math.max(lhsLength, rhsLength),
  21406. i, lhs, rhs;
  21407. for (i = 0; i < length; i++) {
  21408. lhs = (i < lhsLength) ? lhsParts[i] : lhsPad;
  21409. rhs = (i < rhsLength) ? rhsParts[i] : rhsPad;
  21410. // When one or both of the values are NaN these tests produce false
  21411. // and we end up treating NaN as equal to anything.
  21412. if (lhs < rhs) {
  21413. return -1;
  21414. }
  21415. if (lhs > rhs) {
  21416. return 1;
  21417. }
  21418. }
  21419. // same comments about NaN apply here...
  21420. lhs = me.releaseValue;
  21421. rhs = rhsVersion.releaseValue;
  21422. if (lhs < rhs) {
  21423. return -1;
  21424. }
  21425. if (lhs > rhs) {
  21426. return 1;
  21427. }
  21428. return 0;
  21429. },
  21430. /**
  21431. * Override the native `toString` method
  21432. * @private
  21433. * @return {String} version
  21434. */
  21435. toString: function() {
  21436. return this.version;
  21437. },
  21438. /**
  21439. * Override the native `valueOf` method
  21440. * @private
  21441. * @return {String} version
  21442. */
  21443. valueOf: function() {
  21444. return this.version;
  21445. },
  21446. /**
  21447. * Returns the major component value.
  21448. * @return {Number}
  21449. */
  21450. getMajor: function() {
  21451. return this.major;
  21452. },
  21453. /**
  21454. * Returns the minor component value.
  21455. * @return {Number}
  21456. */
  21457. getMinor: function() {
  21458. return this.minor;
  21459. },
  21460. /**
  21461. * Returns the patch component value.
  21462. * @return {Number}
  21463. */
  21464. getPatch: function() {
  21465. return this.patch;
  21466. },
  21467. /**
  21468. * Returns the build component value.
  21469. * @return {Number}
  21470. */
  21471. getBuild: function() {
  21472. return this.build;
  21473. },
  21474. /**
  21475. * Returns the release component text (e.g., "beta").
  21476. * @return {String}
  21477. */
  21478. getRelease: function() {
  21479. return this.release;
  21480. },
  21481. /**
  21482. * Returns the release component value for comparison purposes.
  21483. * @return {Number/String}
  21484. */
  21485. getReleaseValue: function() {
  21486. return this.releaseValue;
  21487. },
  21488. /**
  21489. * Returns whether this version if greater than the supplied argument
  21490. * @param {String/Number} target The version to compare with
  21491. * @return {Boolean} `true` if this version if greater than the target, `false` otherwise
  21492. */
  21493. isGreaterThan: function(target) {
  21494. return this.compareTo(target) > 0;
  21495. },
  21496. /**
  21497. * Returns whether this version if greater than or equal to the supplied argument
  21498. * @param {String/Number} target The version to compare with
  21499. * @return {Boolean} `true` if this version if greater than or equal to the target, `false` otherwise
  21500. */
  21501. isGreaterThanOrEqual: function(target) {
  21502. return this.compareTo(target) >= 0;
  21503. },
  21504. /**
  21505. * Returns whether this version if smaller than the supplied argument
  21506. * @param {String/Number} target The version to compare with
  21507. * @return {Boolean} `true` if this version if smaller than the target, `false` otherwise
  21508. */
  21509. isLessThan: function(target) {
  21510. return this.compareTo(target) < 0;
  21511. },
  21512. /**
  21513. * Returns whether this version if less than or equal to the supplied argument
  21514. * @param {String/Number} target The version to compare with
  21515. * @return {Boolean} `true` if this version if less than or equal to the target, `false` otherwise
  21516. */
  21517. isLessThanOrEqual: function(target) {
  21518. return this.compareTo(target) <= 0;
  21519. },
  21520. /**
  21521. * Returns whether this version equals to the supplied argument
  21522. * @param {String/Number} target The version to compare with
  21523. * @return {Boolean} `true` if this version equals to the target, `false` otherwise
  21524. */
  21525. equals: function(target) {
  21526. return this.compareTo(target) === 0;
  21527. },
  21528. /**
  21529. * Returns whether this version matches the supplied argument. Example:
  21530. *
  21531. * var version = new Ext.Version('1.0.2beta');
  21532. * console.log(version.match(1)); // true
  21533. * console.log(version.match(1.0)); // true
  21534. * console.log(version.match('1.0.2')); // true
  21535. * console.log(version.match('1.0.2RC')); // false
  21536. *
  21537. * @param {String/Number} target The version to compare with
  21538. * @return {Boolean} `true` if this version matches the target, `false` otherwise
  21539. */
  21540. match: function(target) {
  21541. target = String(target);
  21542. return this.version.substr(0, target.length) === target;
  21543. },
  21544. /**
  21545. * Returns this format: [major, minor, patch, build, release]. Useful for comparison.
  21546. * @return {Number[]}
  21547. */
  21548. toArray: function() {
  21549. var me = this;
  21550. return [
  21551. me.getMajor(),
  21552. me.getMinor(),
  21553. me.getPatch(),
  21554. me.getBuild(),
  21555. me.getRelease()
  21556. ];
  21557. },
  21558. /**
  21559. * Returns shortVersion version without dots and release
  21560. * @return {String}
  21561. */
  21562. getShortVersion: function() {
  21563. return this.shortVersion;
  21564. },
  21565. /**
  21566. * Convenient alias to {@link Ext.Version#isGreaterThan isGreaterThan}
  21567. * @param {String/Number/Ext.Version} target
  21568. * @return {Boolean}
  21569. */
  21570. gt: function(target) {
  21571. return this.compareTo(target) > 0;
  21572. },
  21573. /**
  21574. * Convenient alias to {@link Ext.Version#isLessThan isLessThan}
  21575. * @param {String/Number/Ext.Version} target
  21576. * @return {Boolean}
  21577. */
  21578. lt: function(target) {
  21579. return this.compareTo(target) < 0;
  21580. },
  21581. /**
  21582. * Convenient alias to {@link Ext.Version#isGreaterThanOrEqual isGreaterThanOrEqual}
  21583. * @param {String/Number/Ext.Version} target
  21584. * @return {Boolean}
  21585. */
  21586. gtEq: function(target) {
  21587. return this.compareTo(target) >= 0;
  21588. },
  21589. /**
  21590. * Convenient alias to {@link Ext.Version#isLessThanOrEqual isLessThanOrEqual}
  21591. * @param {String/Number/Ext.Version} target
  21592. * @return {Boolean}
  21593. */
  21594. ltEq: function(target) {
  21595. return this.compareTo(target) <= 0;
  21596. }
  21597. };
  21598. Ext.apply(Version, {
  21599. aliases: {
  21600. from: {
  21601. extjs: 'ext',
  21602. core: 'core',
  21603. touch: 'modern'
  21604. },
  21605. to: {
  21606. ext: [
  21607. 'extjs'
  21608. ],
  21609. 'core': [
  21610. 'core'
  21611. ],
  21612. modern: [
  21613. 'touch'
  21614. ]
  21615. }
  21616. },
  21617. /**
  21618. * @private
  21619. */
  21620. releaseValueMap: {
  21621. dev: -6,
  21622. alpha: -5,
  21623. a: -5,
  21624. beta: -4,
  21625. b: -4,
  21626. rc: -3,
  21627. '#': -2,
  21628. p: -1,
  21629. pl: -1
  21630. },
  21631. /**
  21632. * Converts a version component to a comparable value
  21633. *
  21634. * @static
  21635. * @param {Object} value The value to convert
  21636. * @return {Object}
  21637. */
  21638. getComponentValue: function(value) {
  21639. return !value ? 0 : (isNaN(value) ? this.releaseValueMap[value] || value : parseInt(value, 10));
  21640. },
  21641. /**
  21642. * Compare 2 specified versions by ensuring the first parameter is a `Version`
  21643. * instance and then calling the `compareTo` method.
  21644. *
  21645. * @static
  21646. * @param {String} current The current version to compare to
  21647. * @param {String} target The target version to compare to
  21648. * @return {Number} Returns -1 if the current version is smaller than the target version, 1 if greater, and 0 if they're equivalent
  21649. */
  21650. compare: function(current, target) {
  21651. var ver = current.isVersion ? current : new Version(current);
  21652. return ver.compareTo(target);
  21653. },
  21654. set: function(collection, packageName, version) {
  21655. var aliases = Version.aliases.to[packageName],
  21656. ver = version.isVersion ? version : new Version(version),
  21657. i;
  21658. collection[packageName] = ver;
  21659. if (aliases) {
  21660. for (i = aliases.length; i-- > 0; ) {
  21661. collection[aliases[i]] = ver;
  21662. }
  21663. }
  21664. return ver;
  21665. }
  21666. });
  21667. /**
  21668. * @class Ext
  21669. */
  21670. Ext.apply(Ext, {
  21671. /**
  21672. * @private
  21673. */
  21674. compatVersions: {},
  21675. /**
  21676. * @private
  21677. *
  21678. * Object containing version information for all packages utilized by your
  21679. * application.
  21680. *
  21681. * For a public getter, please see `Ext.getVersion()`.
  21682. */
  21683. versions: {},
  21684. /**
  21685. * @private
  21686. */
  21687. lastRegisteredVersion: null,
  21688. /**
  21689. * Get the compatibility level (a version number) for the given package name. If
  21690. * none has been registered with `Ext.setCompatVersion` then `Ext.getVersion` is
  21691. * used to get the current version.
  21692. *
  21693. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  21694. * @since 5.0.0
  21695. * @private
  21696. */
  21697. getCompatVersion: function(packageName) {
  21698. var versions = Ext.compatVersions,
  21699. compat;
  21700. if (!packageName) {
  21701. compat = versions.ext || versions.touch || versions.core;
  21702. } else {
  21703. compat = versions[Version.aliases.from[packageName] || packageName];
  21704. }
  21705. return compat || Ext.getVersion(packageName);
  21706. },
  21707. /**
  21708. * Set the compatibility level (a version number) for the given package name.
  21709. *
  21710. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  21711. * @param {String/Ext.Version} version The version, e.g. '4.2'.
  21712. * @since 5.0.0
  21713. * @private
  21714. */
  21715. setCompatVersion: function(packageName, version) {
  21716. Version.set(Ext.compatVersions, packageName, version);
  21717. },
  21718. /**
  21719. * Set version number for the given package name.
  21720. *
  21721. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  21722. * @param {String/Ext.Version} version The version, e.g. '1.2.3alpha', '2.4.0-dev'.
  21723. * @return {Ext}
  21724. */
  21725. setVersion: function(packageName, version) {
  21726. if (packageName in toolkitNames) {
  21727. Ext.toolkit = packageName;
  21728. }
  21729. Ext.lastRegisteredVersion = Version.set(Ext.versions, packageName, version);
  21730. return this;
  21731. },
  21732. /**
  21733. * Get the version number of the supplied package name; will return the version of
  21734. * the framework.
  21735. *
  21736. * @param {String} [packageName] The package name, e.g., 'core', 'touch', 'ext'.
  21737. * @return {Ext.Version} The version.
  21738. */
  21739. getVersion: function(packageName) {
  21740. var versions = Ext.versions;
  21741. if (!packageName) {
  21742. return versions.ext || versions.touch || versions.core;
  21743. }
  21744. return versions[Version.aliases.from[packageName] || packageName];
  21745. },
  21746. /**
  21747. * This method checks the registered package versions against the provided version
  21748. * `specs`. A `spec` is either a string or an object indicating a boolean operator.
  21749. * This method accepts either form or an array of these as the first argument. The
  21750. * second argument applies only when the first is an array and indicates whether
  21751. * all `specs` must match or just one.
  21752. *
  21753. * ## Package Version Specifications
  21754. * The string form of a `spec` is used to indicate a version or range of versions
  21755. * for a particular package. This form of `spec` consists of three (3) parts:
  21756. *
  21757. * * Package name followed by "@". If not provided, the framework is assumed.
  21758. * * Minimum version.
  21759. * * Maximum version.
  21760. *
  21761. * At least one version number must be provided. If both minimum and maximum are
  21762. * provided, these must be separated by a "-".
  21763. *
  21764. * Some examples of package version specifications:
  21765. *
  21766. * 4.2.2 (exactly version 4.2.2 of the framework)
  21767. * 4.2.2+ (version 4.2.2 or higher of the framework)
  21768. * 4.2.2- (version 4.2.2 or higher of the framework)
  21769. * 4.2.1 - 4.2.3 (versions from 4.2.1 up to 4.2.3 of the framework)
  21770. * - 4.2.2 (any version up to version 4.2.1 of the framework)
  21771. *
  21772. * foo@1.0 (exactly version 1.0 of package "foo")
  21773. * foo@1.0-1.3 (versions 1.0 up to 1.3 of package "foo")
  21774. *
  21775. * **NOTE:** This syntax is the same as that used in Sencha Cmd's package
  21776. * requirements declarations.
  21777. *
  21778. * ## Boolean Operator Specifications
  21779. * Instead of a string, an object can be used to describe a boolean operation to
  21780. * perform on one or more `specs`. The operator is either **`and`** or **`or`**
  21781. * and can contain an optional **`not`**.
  21782. *
  21783. * For example:
  21784. *
  21785. * {
  21786. * not: true, // negates boolean result
  21787. * and: [
  21788. * '4.2.2',
  21789. * 'foo@1.0.1 - 2.0.1'
  21790. * ]
  21791. * }
  21792. *
  21793. * Each element of the array can in turn be a string or object spec. In other
  21794. * words, the value is passed to this method (recursively) as the first argument
  21795. * so these two calls are equivalent:
  21796. *
  21797. * Ext.checkVersion({
  21798. * not: true, // negates boolean result
  21799. * and: [
  21800. * '4.2.2',
  21801. * 'foo@1.0.1 - 2.0.1'
  21802. * ]
  21803. * });
  21804. *
  21805. * !Ext.checkVersion([
  21806. * '4.2.2',
  21807. * 'foo@1.0.1 - 2.0.1'
  21808. * ], true);
  21809. *
  21810. * ## Examples
  21811. *
  21812. * // A specific framework version
  21813. * Ext.checkVersion('4.2.2');
  21814. *
  21815. * // A range of framework versions:
  21816. * Ext.checkVersion('4.2.1-4.2.3');
  21817. *
  21818. * // A specific version of a package:
  21819. * Ext.checkVersion('foo@1.0.1');
  21820. *
  21821. * // A single spec that requires both a framework version and package
  21822. * // version range to match:
  21823. * Ext.checkVersion({
  21824. * and: [
  21825. * '4.2.2',
  21826. * 'foo@1.0.1-1.0.2'
  21827. * ]
  21828. * });
  21829. *
  21830. * // These checks can be nested:
  21831. * Ext.checkVersion({
  21832. * and: [
  21833. * '4.2.2', // exactly version 4.2.2 of the framework *AND*
  21834. * {
  21835. * // either (or both) of these package specs:
  21836. * or: [
  21837. * 'foo@1.0.1-1.0.2',
  21838. * 'bar@3.0+'
  21839. * ]
  21840. * }
  21841. * ]
  21842. * });
  21843. *
  21844. * ## Version Comparisons
  21845. * Version comparsions are assumed to be "prefix" based. That is to say, `"foo@1.2"`
  21846. * matches any version of "foo" that has a major version 1 and a minor version of 2.
  21847. *
  21848. * This also applies to ranges. For example `"foo@1.2-2.2"` matches all versions
  21849. * of "foo" from 1.2 up to 2.2 regardless of the specific patch and build.
  21850. *
  21851. * ## Use in Overrides
  21852. * This methods primary use is in support of conditional overrides on an
  21853. * `Ext.define` declaration.
  21854. *
  21855. * @param {String/Array/Object} specs A version specification string, an object
  21856. * containing `or` or `and` with a value that is equivalent to `specs` or an array
  21857. * of either of these.
  21858. * @param {Boolean} [matchAll=false] Pass `true` to require all specs to match.
  21859. * @return {Boolean} True if `specs` matches the registered package versions.
  21860. */
  21861. checkVersion: function(specs, matchAll) {
  21862. var isArray = Ext.isArray(specs),
  21863. aliases = Version.aliases.from,
  21864. compat = isArray ? specs : checkVerTemp,
  21865. length = compat.length,
  21866. versions = Ext.versions,
  21867. frameworkVer = versions.ext || versions.touch,
  21868. i, index, matches, minVer, maxVer, packageName, spec, range, ver;
  21869. if (!isArray) {
  21870. checkVerTemp[0] = specs;
  21871. }
  21872. for (i = 0; i < length; ++i) {
  21873. if (!Ext.isString(spec = compat[i])) {
  21874. matches = Ext.checkVersion(spec.and || spec.or, !spec.or);
  21875. if (spec.not) {
  21876. matches = !matches;
  21877. }
  21878. } else {
  21879. if (spec.indexOf(' ') >= 0) {
  21880. spec = spec.replace(stripRe, '');
  21881. }
  21882. // For "name@..." syntax, we need to find the package by the given name
  21883. // as a registered package.
  21884. index = spec.indexOf('@');
  21885. if (index < 0) {
  21886. range = spec;
  21887. ver = frameworkVer;
  21888. } else {
  21889. packageName = spec.substring(0, index);
  21890. if (!(ver = versions[aliases[packageName] || packageName])) {
  21891. // The package is not registered, so if we must matchAll then
  21892. // we are done - FAIL:
  21893. if (matchAll) {
  21894. return false;
  21895. }
  21896. // Otherwise this spec is not a match so we can move on to the
  21897. // next...
  21898. continue;
  21899. }
  21900. range = spec.substring(index + 1);
  21901. }
  21902. // Now look for a version, version range or partial range:
  21903. index = range.indexOf('-');
  21904. if (index < 0) {
  21905. // just a version or "1.0+"
  21906. if (range.charAt(index = range.length - 1) === '+') {
  21907. minVer = range.substring(0, index);
  21908. maxVer = null;
  21909. } else {
  21910. minVer = maxVer = range;
  21911. }
  21912. } else if (index > 0) {
  21913. // a range like "1.0-1.5" or "1.0-"
  21914. minVer = range.substring(0, index);
  21915. maxVer = range.substring(index + 1);
  21916. } else // may be empty
  21917. {
  21918. // an upper limit like "-1.5"
  21919. minVer = null;
  21920. maxVer = range.substring(index + 1);
  21921. }
  21922. matches = true;
  21923. if (minVer) {
  21924. minVer = new Version(minVer, '~');
  21925. // prefix matching
  21926. matches = minVer.ltEq(ver);
  21927. }
  21928. if (matches && maxVer) {
  21929. maxVer = new Version(maxVer, '~');
  21930. // prefix matching
  21931. matches = maxVer.gtEq(ver);
  21932. }
  21933. }
  21934. // string spec
  21935. if (matches) {
  21936. // spec matched and we are looking for any match, so we are GO!
  21937. if (!matchAll) {
  21938. return true;
  21939. }
  21940. } else if (matchAll) {
  21941. // spec does not match the registered package version
  21942. return false;
  21943. }
  21944. }
  21945. // In the loop above, for matchAll we return FALSE on mismatch, so getting
  21946. // here with matchAll means we had no mismatches. On the other hand, if we
  21947. // are !matchAll, we return TRUE on match and so we get here only if we found
  21948. // no matches.
  21949. return !!matchAll;
  21950. },
  21951. /**
  21952. * Create a closure for deprecated code.
  21953. *
  21954. * // This means Ext.oldMethod is only supported in 4.0.0beta and older.
  21955. * // If Ext.getVersion('extjs') returns a version that is later than '4.0.0beta', for example '4.0.0RC',
  21956. * // the closure will not be invoked
  21957. * Ext.deprecate('extjs', '4.0.0beta', function() {
  21958. * Ext.oldMethod = Ext.newMethod;
  21959. *
  21960. * ...
  21961. * });
  21962. *
  21963. * @param {String} packageName The package name
  21964. * @param {String} since The last version before it's deprecated
  21965. * @param {Function} closure The callback function to be executed with the specified version is less than the current version
  21966. * @param {Object} scope The execution scope (`this`) if the closure
  21967. * @private
  21968. */
  21969. deprecate: function(packageName, since, closure, scope) {
  21970. if (Version.compare(Ext.getVersion(packageName), since) < 1) {
  21971. closure.call(scope);
  21972. }
  21973. }
  21974. });
  21975. }());
  21976. // End Versioning
  21977. // load the cmd-5 style app manifest metadata now, if available...
  21978. (function(manifest) {
  21979. var packages = (manifest && manifest.packages) || {},
  21980. compat = manifest && manifest.compatibility,
  21981. name, pkg;
  21982. for (name in packages) {
  21983. pkg = packages[name];
  21984. if (pkg && pkg.version) {
  21985. Ext.setVersion(name, pkg.version);
  21986. }
  21987. }
  21988. if (compat) {
  21989. if (Ext.isString(compat)) {
  21990. Ext.setCompatVersion('core', compat);
  21991. } else {
  21992. for (name in compat) {
  21993. Ext.setCompatVersion(name, compat[name]);
  21994. }
  21995. }
  21996. }
  21997. if (!packages.ext && !packages.touch) {
  21998. Ext.setVersion('ext', '6.6.0.258');
  21999. Ext.setVersion('core', '6.6.0.258');
  22000. }
  22001. })(Ext.manifest);
  22002. /**
  22003. * @class Ext.Config
  22004. * This class manages a config property. Instances of this type are created and cached as
  22005. * classes declare their config properties. One instance of this class is created per
  22006. * config property name.
  22007. *
  22008. * Ext.define('MyClass', {
  22009. * config: {
  22010. * foo: 42
  22011. * }
  22012. * });
  22013. *
  22014. * This uses the cached `Ext.Config` instance for the "foo" property.
  22015. *
  22016. * When config properties apply options to config properties a prototype chained object is
  22017. * created from the cached instance. For example:
  22018. *
  22019. * Ext.define('MyClass', {
  22020. * config: {
  22021. * foo: {
  22022. * $value: 42,
  22023. * lazy: true
  22024. * }
  22025. * }
  22026. * });
  22027. *
  22028. * This creates a prototype chain to the cached "foo" instance of `Ext.Config` and applies
  22029. * the `lazy` option to that new instance. This chained instance is then kept by the
  22030. * `Ext.Configurator` for that class.
  22031. * @private
  22032. */
  22033. Ext.Config = function(name) {
  22034. // @define Ext.class.Config
  22035. // @define Ext.Config
  22036. var me = this,
  22037. capitalizedName = name.charAt(0).toUpperCase() + name.substr(1);
  22038. /**
  22039. * @property {String} name
  22040. * The name of this config property.
  22041. * @readonly
  22042. * @private
  22043. * @since 5.0.0
  22044. */
  22045. me.name = name;
  22046. /**
  22047. * @property {Object} names
  22048. * This object holds the cached names used to lookup properties or methods for this
  22049. * config property. The properties of this object are explained in the context of an
  22050. * example property named "foo".
  22051. *
  22052. * @property {String} names.internal The default backing property ("_foo").
  22053. *
  22054. * @property {String} names.initializing The property that is `true` when the config
  22055. * is being initialized ("isFooInitializing").
  22056. *
  22057. * @property {String} names.apply The name of the applier method ("applyFoo").
  22058. *
  22059. * @property {String} names.update The name of the updater method ("updateFoo").
  22060. *
  22061. * @property {String} names.get The name of the getter method ("getFoo").
  22062. *
  22063. * @property {String} names.set The name of the setter method ("setFoo").
  22064. *
  22065. * @property {String} names.initGet The name of the initializing getter ("initGetFoo").
  22066. *
  22067. * @property {String} names.changeEvent The name of the change event ("foochange").
  22068. *
  22069. * @readonly
  22070. * @private
  22071. * @since 5.0.0
  22072. */
  22073. me.names = {
  22074. internal: '_' + name,
  22075. initializing: 'is' + capitalizedName + 'Initializing',
  22076. apply: 'apply' + capitalizedName,
  22077. update: 'update' + capitalizedName,
  22078. get: 'get' + capitalizedName,
  22079. set: 'set' + capitalizedName,
  22080. initGet: 'initGet' + capitalizedName,
  22081. changeEvent: name.toLowerCase() + 'change'
  22082. };
  22083. // This allows folks to prototype chain on top of these objects and yet still cache
  22084. // generated methods at the bottom of the chain.
  22085. me.root = me;
  22086. };
  22087. Ext.Config.map = {};
  22088. Ext.Config.get = function(name) {
  22089. var map = Ext.Config.map,
  22090. ret = map[name] || (map[name] = new Ext.Config(name));
  22091. return ret;
  22092. };
  22093. Ext.Config.prototype = {
  22094. self: Ext.Config,
  22095. isConfig: true,
  22096. /**
  22097. * @cfg {Boolean} [cached=false]
  22098. * When set as `true` the config property will be stored on the class prototype once
  22099. * the first instance has had a chance to process the default value.
  22100. * @private
  22101. * @since 5.0.0
  22102. */
  22103. /**
  22104. * @cfg {Boolean} [lazy=false]
  22105. * When set as `true` the config property will not be immediately initialized during
  22106. * the `initConfig` call.
  22107. * @private
  22108. * @since 5.0.0
  22109. */
  22110. /**
  22111. * @cfg {Boolean} [evented=false]
  22112. * When set as `true` the config property will be treated as a {@link Ext.Evented Evented Config}.
  22113. * @private
  22114. * @since 6.0.0
  22115. */
  22116. /**
  22117. * @cfg {Function} [merge]
  22118. * This function if supplied will be called as classes or instances provide values
  22119. * that need to be combined with inherited values. The function should return the
  22120. * value that will be the config value. Further calls may receive such returned
  22121. * values as `oldValue`.
  22122. *
  22123. * @cfg {Mixed} merge.newValue The new value to merge with the old.
  22124. *
  22125. * @cfg {Mixed} merge.oldValue The current value prior to `newValue` being merged.
  22126. *
  22127. * @cfg {Mixed} merge.target The class or instance to which the merged config value
  22128. * will be applied.
  22129. *
  22130. * @cfg {Ext.Class} merge.mixinClass The mixin providing the `newValue` or `null` if
  22131. * the `newValue` is not being provided by a mixin.
  22132. */
  22133. getGetter: function() {
  22134. return this.getter || (this.root.getter = this.makeGetter());
  22135. },
  22136. getInitGetter: function() {
  22137. return this.initGetter || (this.root.initGetter = this.makeInitGetter());
  22138. },
  22139. getSetter: function() {
  22140. return this.setter || (this.root.setter = this.makeSetter());
  22141. },
  22142. getEventedSetter: function() {
  22143. return this.eventedSetter || (this.root.eventedSetter = this.makeEventedSetter());
  22144. },
  22145. /**
  22146. * Returns the name of the property that stores this config on the given instance or
  22147. * class prototype.
  22148. * @param {Object} target
  22149. * @return {String}
  22150. */
  22151. getInternalName: function(target) {
  22152. return target.$configPrefixed ? this.names.internal : this.name;
  22153. },
  22154. mergeNew: function(newValue, oldValue, target, mixinClass) {
  22155. var ret, key;
  22156. if (!oldValue) {
  22157. ret = newValue;
  22158. } else if (!newValue) {
  22159. ret = oldValue;
  22160. } else {
  22161. ret = Ext.Object.chain(oldValue);
  22162. for (key in newValue) {
  22163. if (!mixinClass || !(key in ret)) {
  22164. ret[key] = newValue[key];
  22165. }
  22166. }
  22167. }
  22168. return ret;
  22169. },
  22170. /**
  22171. * Merges the `newValue` and the `oldValue` assuming that these are basically objects
  22172. * the represent sets. For example something like:
  22173. *
  22174. * {
  22175. * foo: true,
  22176. * bar: true
  22177. * }
  22178. *
  22179. * The merge process converts arrays like the following into the above:
  22180. *
  22181. * [ 'foo', 'bar' ]
  22182. *
  22183. * @param {String/String[]/Object} newValue
  22184. * @param {Object} oldValue
  22185. * @param {Boolean} [preserveExisting=false]
  22186. * @return {Object}
  22187. * @private
  22188. * @since 5.0.0
  22189. */
  22190. mergeSets: function(newValue, oldValue, preserveExisting) {
  22191. var ret = oldValue ? Ext.Object.chain(oldValue) : {},
  22192. i, val;
  22193. if (newValue instanceof Array) {
  22194. for (i = newValue.length; i--; ) {
  22195. val = newValue[i];
  22196. if (!preserveExisting || !(val in ret)) {
  22197. ret[val] = true;
  22198. }
  22199. }
  22200. } else if (newValue) {
  22201. if (newValue.constructor === Object) {
  22202. for (i in newValue) {
  22203. val = newValue[i];
  22204. if (!preserveExisting || !(i in ret)) {
  22205. ret[i] = val;
  22206. }
  22207. }
  22208. } else if (!preserveExisting || !(newValue in ret)) {
  22209. ret[newValue] = true;
  22210. }
  22211. }
  22212. return ret;
  22213. },
  22214. //--------------------------------------------------
  22215. // Factories
  22216. makeGetter: function() {
  22217. var name = this.name,
  22218. prefixedName = this.names.internal;
  22219. return function() {
  22220. var internalName = this.$configPrefixed ? prefixedName : name;
  22221. return this[internalName];
  22222. };
  22223. },
  22224. makeInitGetter: function() {
  22225. var name = this.name,
  22226. names = this.names,
  22227. setName = names.set,
  22228. getName = names.get,
  22229. initializingName = names.initializing;
  22230. return function() {
  22231. var me = this;
  22232. me[initializingName] = true;
  22233. // Remove the initGetter from the instance now that the value has been set.
  22234. delete me[getName];
  22235. me[setName](me.config[name]);
  22236. delete me[initializingName];
  22237. return me[getName].apply(me, arguments);
  22238. };
  22239. },
  22240. makeSetter: function() {
  22241. var name = this.name,
  22242. names = this.names,
  22243. prefixedName = names.internal,
  22244. getName = names.get,
  22245. applyName = names.apply,
  22246. updateName = names.update,
  22247. setter;
  22248. // http://jsperf.com/method-call-apply-or-direct
  22249. // http://jsperf.com/method-detect-invoke
  22250. setter = function(value) {
  22251. var me = this,
  22252. internalName = me.$configPrefixed ? prefixedName : name,
  22253. oldValue = me[internalName];
  22254. // Remove the initGetter from the instance now that the value has been set.
  22255. delete me[getName];
  22256. if (!me[applyName] || (value = me[applyName](value, oldValue)) !== undefined) {
  22257. // The old value might have been changed at this point
  22258. // (after the apply call chain) so it should be read again
  22259. if (value !== (oldValue = me[internalName])) {
  22260. me[internalName] = value;
  22261. if (me[updateName]) {
  22262. me[updateName](value, oldValue);
  22263. }
  22264. }
  22265. }
  22266. return me;
  22267. };
  22268. setter.$isDefault = true;
  22269. return setter;
  22270. },
  22271. makeEventedSetter: function() {
  22272. var name = this.name,
  22273. names = this.names,
  22274. prefixedName = names.internal,
  22275. getName = names.get,
  22276. applyName = names.apply,
  22277. updateName = names.update,
  22278. changeEventName = names.changeEvent,
  22279. updateFn = function(me, value, oldValue, internalName) {
  22280. me[internalName] = value;
  22281. if (me[updateName]) {
  22282. me[updateName](value, oldValue);
  22283. }
  22284. },
  22285. setter;
  22286. // http://jsperf.com/method-call-apply-or-direct
  22287. // http://jsperf.com/method-detect-invoke
  22288. setter = function(value) {
  22289. var me = this,
  22290. internalName = me.$configPrefixed ? prefixedName : name,
  22291. oldValue = me[internalName];
  22292. // Remove the initGetter from the instance now that the value has been set.
  22293. delete me[getName];
  22294. if (!me[applyName] || (value = me[applyName](value, oldValue)) !== undefined) {
  22295. // The old value might have been changed at this point
  22296. // (after the apply call chain) so it should be read again
  22297. if (value !== (oldValue = me[internalName])) {
  22298. if (me.isConfiguring) {
  22299. me[internalName] = value;
  22300. if (me[updateName]) {
  22301. me[updateName](value, oldValue);
  22302. }
  22303. } else {
  22304. me.fireEventedAction(changeEventName, [
  22305. me,
  22306. value,
  22307. oldValue
  22308. ], updateFn, me, [
  22309. me,
  22310. value,
  22311. oldValue,
  22312. internalName
  22313. ]);
  22314. }
  22315. }
  22316. }
  22317. return me;
  22318. };
  22319. setter.$isDefault = true;
  22320. return setter;
  22321. }
  22322. };
  22323. /**
  22324. * @class Ext.Configurator
  22325. * This class manages the config properties for a class.
  22326. * @private
  22327. */
  22328. (function() {
  22329. // see end of file (and please don't indent the whole file)
  22330. var ExtConfig = Ext.Config,
  22331. configPropMap = ExtConfig.map,
  22332. ExtObject = Ext.Object;
  22333. Ext.Configurator = function(cls) {
  22334. // @define Ext.class.Configurator
  22335. // @define Ext.Configurator
  22336. // @require Ext.Config
  22337. var me = this,
  22338. prototype = cls.prototype,
  22339. superCfg = cls.superclass ? cls.superclass.self.$config : null;
  22340. /**
  22341. * @property {Ext.Class} cls The class to which this instance is associated.
  22342. * @private
  22343. * @readonly
  22344. */
  22345. me.cls = cls;
  22346. /**
  22347. * The super class `Configurator` instance or `null` if there is no super class.
  22348. *
  22349. * @property {Ext.Configurator} superCfg
  22350. * @private
  22351. * @readonly
  22352. */
  22353. me.superCfg = superCfg;
  22354. if (superCfg) {
  22355. /**
  22356. * This object holds an `Ext.Config` value for each config property keyed by name.
  22357. * This object has as its prototype object the `configs` of its super class.
  22358. *
  22359. * This map is maintained as each property is added via the `add` method.
  22360. *
  22361. * @property {Object} configs
  22362. * @private
  22363. * @readonly
  22364. */
  22365. me.configs = ExtObject.chain(superCfg.configs);
  22366. /**
  22367. * This object holds a bool value for each cachedConfig property keyed by name.
  22368. *
  22369. * This map is maintained as each property is added via the `add` method.
  22370. *
  22371. * @property {Object} cachedConfigs
  22372. * @private
  22373. * @readonly
  22374. */
  22375. me.cachedConfigs = ExtObject.chain(superCfg.cachedConfigs);
  22376. /**
  22377. * This object holds a `Number` for each config property keyed by name. This object has
  22378. * as its prototype object the `initMap` of its super class. The value of each property
  22379. * has the following meaning:
  22380. *
  22381. * * `0` - initial value is `null` and requires no processing.
  22382. * * `1` - initial value must be set on each instance.
  22383. * * `2` - initial value can be cached on the prototype by the first instance.
  22384. *
  22385. * Any `null` values will either never be added to this map or (if added by a base
  22386. * class and set to `null` by a derived class) will cause the entry to be 0.
  22387. *
  22388. * This map is maintained as each property is added via the `add` method.
  22389. *
  22390. * @property {Object} initMap
  22391. * @private
  22392. * @readonly
  22393. */
  22394. me.initMap = ExtObject.chain(superCfg.initMap);
  22395. /**
  22396. * This object holds the default value for each config property keyed by name. This
  22397. * object has as its prototype object the `values` of its super class.
  22398. *
  22399. * This map is maintained as each property is added via the `add` method.
  22400. *
  22401. * @property {Object} values
  22402. * @private
  22403. * @readonly
  22404. */
  22405. me.values = ExtObject.chain(superCfg.values);
  22406. me.needsFork = superCfg.needsFork;
  22407. // The reason this feature is debug only is that we would have to create this
  22408. // map for all classes because deprecations could be added to bases after the
  22409. // derived class had created its Configurator.
  22410. me.deprecations = ExtObject.chain(superCfg.deprecations);
  22411. } else {
  22412. me.configs = {};
  22413. me.cachedConfigs = {};
  22414. me.initMap = {};
  22415. me.values = {};
  22416. me.deprecations = {};
  22417. }
  22418. prototype.config = prototype.defaultConfig = me.values;
  22419. cls.$config = me;
  22420. };
  22421. Ext.Configurator.prototype = {
  22422. self: Ext.Configurator,
  22423. needsFork: false,
  22424. /**
  22425. * This array holds the properties that need to be set on new instances.
  22426. *
  22427. * This array is populated when the first instance is passed to `configure` (basically
  22428. * when the first instance is created). The entries in `initMap` are iterated to find
  22429. * those configs needing per-instance processing.
  22430. *
  22431. * @property {Ext.Config[]} initList
  22432. * @private
  22433. */
  22434. initList: null,
  22435. /**
  22436. * This method adds new config properties. This is called for classes when they are
  22437. * declared, then for any mixins that class may define and finally for any overrides
  22438. * defined that target the class.
  22439. *
  22440. * @param {Object} config The config object containing the new config properties.
  22441. * @param {Ext.Class} [mixinClass] The mixin class if the configs are from a mixin.
  22442. * @private
  22443. */
  22444. add: function(config, mixinClass) {
  22445. var me = this,
  22446. Cls = me.cls,
  22447. configs = me.configs,
  22448. cachedConfigs = me.cachedConfigs,
  22449. initMap = me.initMap,
  22450. prototype = Cls.prototype,
  22451. mixinConfigs = mixinClass && mixinClass.$config.configs,
  22452. values = me.values,
  22453. isObject, meta, isCached, merge, cfg, currentValue, name, names, s, value;
  22454. for (name in config) {
  22455. value = config[name];
  22456. isObject = value && value.constructor === Object;
  22457. meta = isObject && '$value' in value ? value : null;
  22458. isCached = false;
  22459. if (meta) {
  22460. isCached = !!meta.cached;
  22461. value = meta.$value;
  22462. isObject = value && value.constructor === Object;
  22463. }
  22464. merge = meta && meta.merge;
  22465. cfg = configs[name];
  22466. if (cfg) {
  22467. // Only proceed with a mixin if we have a custom merge.
  22468. if (mixinClass) {
  22469. merge = cfg.merge;
  22470. if (!merge) {
  22471. continue;
  22472. }
  22473. // Don't want the mixin meta modifying our own
  22474. meta = null;
  22475. } else {
  22476. merge = merge || cfg.merge;
  22477. }
  22478. // This means that we've already declared this as a config in a superclass
  22479. // Let's not allow us to change it here.
  22480. if (!mixinClass && isCached && !cachedConfigs[name]) {
  22481. Ext.raise('Redefining config as cached: ' + name + ' in class: ' + Cls.$className);
  22482. }
  22483. // There is already a value for this config and we are not allowed to
  22484. // modify it. So, if it is an object and the new value is also an object,
  22485. // the result is a merge so we have to merge both on to a new object.
  22486. currentValue = values[name];
  22487. if (merge) {
  22488. value = merge.call(cfg, value, currentValue, Cls, mixinClass);
  22489. } else if (isObject) {
  22490. if (currentValue && currentValue.constructor === Object) {
  22491. // We favor moving the cost of an "extra" copy here because this
  22492. // is likely to be a rare thing two object values for the same
  22493. // property. The alternative would be to clone the initial value
  22494. // to make it safely modifiable even though it is likely to never
  22495. // need to be modified.
  22496. value = ExtObject.merge({}, currentValue, value);
  22497. }
  22498. }
  22499. } else // else "currentValue" is a primitive so "value" can just replace it
  22500. // else "value" is a primitive and it can just replace currentValue
  22501. {
  22502. // This is a new property value, so add it to the various maps "as is".
  22503. // In the majority of cases this value will not be overridden or need to
  22504. // be forked.
  22505. if (mixinConfigs) {
  22506. // Since this is a config from a mixin, we don't want to apply its
  22507. // meta-ness because it already has. Instead we want to use its cfg
  22508. // instance:
  22509. cfg = mixinConfigs[name];
  22510. meta = null;
  22511. } else {
  22512. cfg = ExtConfig.get(name);
  22513. }
  22514. configs[name] = cfg;
  22515. if (cfg.cached || isCached) {
  22516. cachedConfigs[name] = true;
  22517. }
  22518. // Ensure that the new config has a getter and setter. Because this method
  22519. // is called during class creation as the "config" (or "cachedConfig") is
  22520. // being processed, the user's methods will not be on the prototype yet.
  22521. //
  22522. // This has the following trade-offs:
  22523. //
  22524. // - Custom getters are rare so there is minimal waste generated by them.
  22525. //
  22526. // - Custom setters are more common but, by putting the default setter on
  22527. // the prototype prior to addMembers, when the user methods are added
  22528. // callParent can be used to call the generated setter. This is almost
  22529. // certainly desirable as the setter has some very important semantics
  22530. // that a custom setter would probably want to preserve by just adding
  22531. // logic before and/or after the callParent.
  22532. //
  22533. // - By not adding these to the class body we avoid all the "is function"
  22534. // tests that get applied to each class member thereby streamlining the
  22535. // downstream class creation process.
  22536. //
  22537. // We still check for getter and/or setter but primarily for reasons of
  22538. // backwards compatibility and "just in case" someone relied on inherited
  22539. // getter/setter even though the base did not have the property listed as
  22540. // a "config" (obscure case certainly).
  22541. //
  22542. names = cfg.names;
  22543. if (!prototype[s = names.get]) {
  22544. prototype[s] = cfg.getter || cfg.getGetter();
  22545. }
  22546. if (!prototype[s = names.set]) {
  22547. prototype[s] = (meta && meta.evented) ? (cfg.eventedSetter || cfg.getEventedSetter()) : (cfg.setter || cfg.getSetter());
  22548. }
  22549. }
  22550. if (meta) {
  22551. if (cfg.owner !== Cls) {
  22552. configs[name] = cfg = Ext.Object.chain(cfg);
  22553. cfg.owner = Cls;
  22554. }
  22555. Ext.apply(cfg, meta);
  22556. delete cfg.$value;
  22557. }
  22558. // Fork checks all the default values to see if they are arrays or objects
  22559. // Do this to save us from doing it on each run
  22560. if (!me.needsFork && value && (value.constructor === Object || value instanceof Array)) {
  22561. me.needsFork = true;
  22562. }
  22563. // If the value is non-null, we need to initialize it.
  22564. if (value !== null) {
  22565. initMap[name] = true;
  22566. } else {
  22567. if (prototype.$configPrefixed) {
  22568. prototype[configs[name].names.internal] = null;
  22569. } else {
  22570. prototype[configs[name].name] = null;
  22571. }
  22572. if (name in initMap) {
  22573. // Only set this to false if we already have it in the map, otherwise, just leave it out!
  22574. initMap[name] = false;
  22575. }
  22576. }
  22577. values[name] = value;
  22578. }
  22579. },
  22580. addDeprecations: function(configs) {
  22581. var me = this,
  22582. deprecations = me.deprecations,
  22583. className = (me.cls.$className || '') + '#',
  22584. message, newName, oldName;
  22585. for (oldName in configs) {
  22586. newName = configs[oldName];
  22587. // configs: {
  22588. // dead: null,
  22589. //
  22590. // renamed: 'newName',
  22591. //
  22592. // removed: {
  22593. // message: 'This config was replaced by pixie dust'
  22594. // }
  22595. // }
  22596. if (!newName) {
  22597. message = 'This config has been removed.';
  22598. } else if (!(message = newName.message)) {
  22599. message = 'This config has been renamed to "' + newName + '"';
  22600. }
  22601. deprecations[oldName] = className + oldName + ': ' + message;
  22602. }
  22603. },
  22604. /**
  22605. * This method configures the given `instance` using the specified `instanceConfig`.
  22606. * The given `instance` should have been created by this object's `cls`.
  22607. *
  22608. * @param {Object} instance The instance to configure.
  22609. * @param {Object} instanceConfig The configuration properties to apply to `instance`.
  22610. * @private
  22611. */
  22612. configure: function(instance, instanceConfig) {
  22613. var me = this,
  22614. configs = me.configs,
  22615. deprecations = me.deprecations,
  22616. initMap = me.initMap,
  22617. initListMap = me.initListMap,
  22618. initList = me.initList,
  22619. prototype = me.cls.prototype,
  22620. values = me.values,
  22621. remaining = 0,
  22622. firstInstance = !initList,
  22623. cachedInitList, cfg, getter, i, internalName, ln, names, name, value, isCached, valuesKey, field;
  22624. values = me.needsFork ? ExtObject.fork(values) : ExtObject.chain(values);
  22625. // Let apply/update methods know that the initConfig is currently running.
  22626. instance.isConfiguring = true;
  22627. if (firstInstance) {
  22628. // When called to configure the first instance of the class to which we are
  22629. // bound we take a bit to plan for instance 2+.
  22630. me.initList = initList = [];
  22631. me.initListMap = initListMap = {};
  22632. instance.isFirstInstance = true;
  22633. for (name in initMap) {
  22634. cfg = configs[name];
  22635. isCached = cfg.cached;
  22636. if (initMap[name]) {
  22637. names = cfg.names;
  22638. value = values[name];
  22639. if (!prototype[names.set].$isDefault || prototype[names.apply] || prototype[names.update] || typeof value === 'object') {
  22640. if (isCached) {
  22641. // This is a cachedConfig, so it needs to be initialized with
  22642. // the default value and placed on the prototype... but the
  22643. // instanceConfig may have a different value so the value may
  22644. // need resetting. We have to defer the call to the setter so
  22645. // that all of the initGetters are set up first.
  22646. (cachedInitList || (cachedInitList = [])).push(cfg);
  22647. } else {
  22648. // Remember this config so that all instances (including this
  22649. // one) can invoke the setter to properly initialize it.
  22650. initList.push(cfg);
  22651. initListMap[name] = true;
  22652. }
  22653. // Point all getters to the initGetters. By doing this here we
  22654. // avoid creating initGetters for configs that don't need them
  22655. // and we can easily pick up the cached fn to save the call.
  22656. instance[names.get] = cfg.initGetter || cfg.getInitGetter();
  22657. } else {
  22658. // Non-object configs w/o custom setter, applier or updater can
  22659. // be simply stored on the prototype.
  22660. prototype[cfg.getInternalName(prototype)] = value;
  22661. }
  22662. } else if (isCached) {
  22663. prototype[cfg.getInternalName(prototype)] = undefined;
  22664. }
  22665. }
  22666. }
  22667. // TODO - we need to combine the cached loop with the instanceConfig loop to
  22668. // avoid duplication of init getter setups (for correctness if a cached cfg
  22669. // calls on a non-cached cfg)
  22670. ln = cachedInitList && cachedInitList.length;
  22671. if (ln) {
  22672. // This is only ever done on the first instance we configure. Any config in
  22673. // cachedInitList has to be set to the default value to allow any side-effects
  22674. // or transformations to occur. The resulting values can then be elevated to
  22675. // the prototype and this property need not be initialized on each instance.
  22676. for (i = 0; i < ln; ++i) {
  22677. internalName = cachedInitList[i].getInternalName(prototype);
  22678. // Since these are cached configs the base class will potentially have put
  22679. // its cached values on the prototype so we need to hide these while we
  22680. // run the inits for our cached configs.
  22681. instance[internalName] = null;
  22682. }
  22683. for (i = 0; i < ln; ++i) {
  22684. names = (cfg = cachedInitList[i]).names;
  22685. getter = names.get;
  22686. if (instance.hasOwnProperty(getter)) {
  22687. instance[names.set](values[cfg.name]);
  22688. delete instance[getter];
  22689. }
  22690. }
  22691. for (i = 0; i < ln; ++i) {
  22692. internalName = cachedInitList[i].getInternalName(prototype);
  22693. prototype[internalName] = instance[internalName];
  22694. delete instance[internalName];
  22695. }
  22696. }
  22697. // The cachedConfigs have all been set to the default values including any of
  22698. // those that may have been triggered by their getter.
  22699. // If the instanceConfig has a platformConfig in it, we need to merge the active
  22700. // rules of that object to make the actual instanceConfig.
  22701. if (instanceConfig && instanceConfig.platformConfig) {
  22702. instanceConfig = me.resolvePlatformConfig(instance, instanceConfig);
  22703. }
  22704. if (firstInstance) {
  22705. // Allow the class to do things once the cachedConfig has been processed.
  22706. // We need to call this method always when the first instance is configured
  22707. // whether or not it actually has cached configs
  22708. if (instance.afterCachedConfig && !instance.afterCachedConfig.$nullFn) {
  22709. instance.afterCachedConfig(instanceConfig);
  22710. }
  22711. }
  22712. // Now that the cachedConfigs have been processed we can apply the instanceConfig
  22713. // and hide the "configs" on the prototype. This will serve as the source for any
  22714. // configs that need to initialize from their initial getter call.
  22715. // IMPORTANT: "this.hasOwnProperty('config')" is how a config applier/updater can
  22716. // tell it is processing the cached config value vs an instance config value.
  22717. instance.config = values;
  22718. // There are 2 possibilities here:
  22719. // 1) If it's the first time in this function, we may have had cachedConfigs running.
  22720. // these configs may have called the getters for any of the normal getters, which
  22721. // means the initial getters have been clobbered on the instance and won't be able
  22722. // to be called below when we iterate over the initList. As such, we need to
  22723. // reinitialize them here, even though we've done it up above.
  22724. //
  22725. // 2) If this the second time in this function, the cachedConfigs won't be processed,
  22726. // so we don't need to worry about them clobbering config values. However, since
  22727. // we've already done all our setup, we won't enter into the block that sets the
  22728. // initGetter, so we need to do it here anyway.
  22729. //
  22730. // Also note, that lazy configs will appear in the initList because we need
  22731. // to spin up the initGetter.
  22732. for (i = 0 , ln = initList.length; i < ln; ++i) {
  22733. cfg = initList[i];
  22734. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  22735. }
  22736. // Give the class a chance to transform the configs.
  22737. if (instance.transformInstanceConfig) {
  22738. instanceConfig = instance.transformInstanceConfig(instanceConfig);
  22739. }
  22740. // Important: We are looping here twice on purpose. This first loop serves 2 purposes:
  22741. //
  22742. // 1) Ensure the values collection is fully populated before we call any setters. Since
  22743. // a setter may have an updater/applier, it could potentially call another getter() to grab
  22744. // the value for some other property, so this ensures they are all set on the config object.
  22745. //
  22746. // 2) Ensure that the initGetter is set as the getter for any config that doesn't appear in
  22747. // the initList. We need to ensure that the initGetter is pushed on for everything that we will
  22748. // be setting during init time.
  22749. //
  22750. // The merging in this loop cannot be completed by Ext.merge(), since we do NOT want to merge
  22751. // non-strict values, they should always just be assigned across without modification.
  22752. if (instanceConfig) {
  22753. for (name in instanceConfig) {
  22754. value = instanceConfig[name];
  22755. cfg = configs[name];
  22756. if (deprecations[name]) {
  22757. Ext.log.warn(deprecations[name]);
  22758. if (!cfg) {
  22759. // If there is a Config for this, perhaps the class is emulating
  22760. // the old config... If there is not a Config we don't want to
  22761. // proceed and put the property on the instance. That will likely
  22762. // hide the bug during development.
  22763. continue;
  22764. }
  22765. }
  22766. if (!cfg) {
  22767. field = instance.self.prototype[name];
  22768. if (instance.$configStrict && (typeof field === 'function') && !field.$nullFn) {
  22769. // In strict mode you cannot override functions
  22770. Ext.raise('Cannot override method ' + name + ' on ' + instance.$className + ' instance.');
  22771. }
  22772. // Not all "configs" use the config system so in this case simply put
  22773. // the value on the instance:
  22774. instance[name] = value;
  22775. } else {
  22776. // However we still need to create the initial value that needs
  22777. // to be used. We also need to spin up the initGetter.
  22778. if (!cfg.lazy) {
  22779. ++remaining;
  22780. }
  22781. if (!initListMap[name]) {
  22782. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  22783. }
  22784. if (cfg.merge) {
  22785. value = cfg.merge(value, values[name], instance);
  22786. } else if (value && value.constructor === Object) {
  22787. valuesKey = values[name];
  22788. if (valuesKey && valuesKey.constructor === Object) {
  22789. value = ExtObject.merge(values[name], value);
  22790. } else {
  22791. value = Ext.clone(value, false);
  22792. }
  22793. }
  22794. }
  22795. values[name] = value;
  22796. }
  22797. }
  22798. // Give the class a chance to hook in prior to initializing the configs.
  22799. if (instance.beforeInitConfig && !instance.beforeInitConfig.$nullFn) {
  22800. if (instance.beforeInitConfig(instanceConfig) === false) {
  22801. return;
  22802. }
  22803. }
  22804. if (instanceConfig) {
  22805. for (name in instanceConfig) {
  22806. if (!remaining) {
  22807. // For classes that have few proper Config properties, this saves us
  22808. // from making the full 2 passes over the instanceConfig.
  22809. break;
  22810. }
  22811. // We can ignore deprecated configs here because we warned about them
  22812. // above. Further, since we only process proper Config's here we would
  22813. // not be skipping them anyway.
  22814. cfg = configs[name];
  22815. if (cfg && !cfg.lazy) {
  22816. --remaining;
  22817. // A proper "config" property so call the setter to set the value.
  22818. names = cfg.names;
  22819. getter = names.get;
  22820. // At this point the initGetter may have already been called and
  22821. // cleared if the getter was called from the applier or updater of a
  22822. // previously processed instance config. checking if the instance has
  22823. // its own getter ensures the setter does not get called twice.
  22824. if (instance.hasOwnProperty(getter)) {
  22825. instance[names.set](values[name]);
  22826. // The generated setter will remove the initGetter from the instance
  22827. // but the user may have provided their own setter so we have to do
  22828. // this here as well:
  22829. delete instance[names.get];
  22830. }
  22831. }
  22832. }
  22833. }
  22834. // Process configs declared on the class that need per-instance initialization.
  22835. for (i = 0 , ln = initList.length; i < ln; ++i) {
  22836. cfg = initList[i];
  22837. names = cfg.names;
  22838. getter = names.get;
  22839. if (!cfg.lazy && instance.hasOwnProperty(getter)) {
  22840. // Since the instance still hasOwn the getter, that means we've set an initGetter
  22841. // and it hasn't been cleared by calling any setter. Since we've never set the value
  22842. // because it wasn't passed in the instance, we go and set it here, taking the value
  22843. // from our definition config and passing it through finally clear off the getter.
  22844. instance[names.set](values[cfg.name]);
  22845. delete instance[getter];
  22846. }
  22847. }
  22848. // Expose the value from the prototype chain (false):
  22849. delete instance.isConfiguring;
  22850. },
  22851. getCurrentConfig: function(instance) {
  22852. var defaultConfig = instance.defaultConfig,
  22853. config = {},
  22854. name;
  22855. for (name in defaultConfig) {
  22856. config[name] = instance[configPropMap[name].names.get]();
  22857. }
  22858. return config;
  22859. },
  22860. /**
  22861. * Merges the values of a config object onto a base config.
  22862. * @param {Ext.Base} instance
  22863. * @param {Object} baseConfig
  22864. * @param {Object} config
  22865. * @return {Object} the merged config
  22866. * @private
  22867. */
  22868. merge: function(instance, baseConfig, config) {
  22869. // Although this is a "private" method. It is used by Sencha Architect and so
  22870. // its api should remain stable.
  22871. var configs = this.configs,
  22872. name, value, baseValue, cfg;
  22873. for (name in config) {
  22874. value = config[name];
  22875. cfg = configs[name];
  22876. if (cfg) {
  22877. if (cfg.merge) {
  22878. value = cfg.merge(value, baseConfig[name], instance);
  22879. } else if (value && value.constructor === Object) {
  22880. baseValue = baseConfig[name];
  22881. if (baseValue && baseValue.constructor === Object) {
  22882. value = Ext.Object.merge(baseValue, value);
  22883. } else {
  22884. value = Ext.clone(value, false);
  22885. }
  22886. }
  22887. }
  22888. baseConfig[name] = value;
  22889. }
  22890. return baseConfig;
  22891. },
  22892. /**
  22893. * @private
  22894. */
  22895. reconfigure: function(instance, instanceConfig, options) {
  22896. var currentConfig = instance.config,
  22897. configList = [],
  22898. strict = instance.$configStrict && !(options && options.strict === false),
  22899. configs = this.configs,
  22900. defaults = options && options.defaults,
  22901. cfg, getter, i, len, name, names, prop;
  22902. for (name in instanceConfig) {
  22903. cfg = configs[name];
  22904. if (defaults && instance.hasOwnProperty(cfg && instance.$configPrefixed ? cfg.names.internal : name)) {
  22905. continue;
  22906. }
  22907. currentConfig[name] = instanceConfig[name];
  22908. if (this.deprecations[name]) {
  22909. // See similar logic doc in configure() method.
  22910. Ext.log.warn(this.deprecations[name]);
  22911. if (!cfg) {
  22912. continue;
  22913. }
  22914. }
  22915. if (cfg) {
  22916. // To ensure that configs being set here get processed in the proper order
  22917. // we must give them init getters just in case they depend upon each other
  22918. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  22919. } else {
  22920. // Check for existence of the property on the prototype before proceeding.
  22921. // If present on the prototype, and if the property is a function we
  22922. // do not allow it to be overridden by a property in the config object
  22923. // in strict mode (unless the function on the prototype is a emptyFn or
  22924. // identityFn). Note that we always check the prototype, not the instance
  22925. // because calling setConfig a second time should have the same results -
  22926. // the first call may have set a function on the instance.
  22927. prop = instance.self.prototype[name];
  22928. if (strict) {
  22929. if ((typeof prop === 'function') && !prop.$nullFn) {
  22930. Ext.Error.raise("Cannot override method " + name + " on " + instance.$className + " instance.");
  22931. continue;
  22932. } else {
  22933. if (name !== 'type') {
  22934. Ext.log.warn('No such config "' + name + '" for class ' + instance.$className);
  22935. }
  22936. }
  22937. }
  22938. }
  22939. configList.push(name);
  22940. }
  22941. for (i = 0 , len = configList.length; i < len; i++) {
  22942. name = configList[i];
  22943. cfg = configs[name];
  22944. if (cfg) {
  22945. names = cfg.names;
  22946. getter = names.get;
  22947. if (instance.hasOwnProperty(getter)) {
  22948. // Since the instance still hasOwn the getter, that means we've set an initGetter
  22949. // and it hasn't been cleared by calling any setter. Since we've never set the value
  22950. // because it wasn't passed in the instance, we go and set it here, taking the value
  22951. // from our definition config and passing it through finally clear off the getter.
  22952. instance[names.set](instanceConfig[name]);
  22953. delete instance[getter];
  22954. }
  22955. } else {
  22956. cfg = configPropMap[name] || Ext.Config.get(name);
  22957. names = cfg.names;
  22958. if (instance[names.set]) {
  22959. instance[names.set](instanceConfig[name]);
  22960. } else {
  22961. // apply non-config props directly to the instance
  22962. instance[name] = instanceConfig[name];
  22963. }
  22964. }
  22965. }
  22966. },
  22967. /**
  22968. * This method accepts an instance config object containing a `platformConfig`
  22969. * property and merges the appropriate rules from that sub-object with the root object
  22970. * to create the final config object that should be used. This is method called by
  22971. * `{@link #configure}` when it receives an `instanceConfig` containing a
  22972. * `platformConfig` property.
  22973. *
  22974. * @param {Ext.Base} instance
  22975. * @param {Object} instanceConfig The instance config parameter.
  22976. * @return {Object} The new instance config object with platformConfig results applied.
  22977. * @private
  22978. * @since 5.1.0
  22979. */
  22980. resolvePlatformConfig: function(instance, instanceConfig) {
  22981. var platformConfig = instanceConfig && instanceConfig.platformConfig,
  22982. ret = instanceConfig,
  22983. i, keys, n;
  22984. if (platformConfig) {
  22985. keys = Ext.getPlatformConfigKeys(platformConfig);
  22986. n = keys.length;
  22987. if (n) {
  22988. ret = Ext.merge({}, ret);
  22989. // this deep copies sub-objects
  22990. for (i = 0 , n = keys.length; i < n; ++i) {
  22991. this.merge(instance, ret, platformConfig[keys[i]]);
  22992. }
  22993. }
  22994. }
  22995. return ret;
  22996. }
  22997. };
  22998. }());
  22999. // prototype
  23000. // closure on whole file
  23001. // @tag class
  23002. /**
  23003. * @class Ext.Base
  23004. *
  23005. * The root of all classes created with {@link Ext#define}.
  23006. *
  23007. * Ext.Base is the building block of all Ext classes. All classes in Ext inherit from Ext.Base.
  23008. * All prototype and static members of this class are inherited by all other classes.
  23009. */
  23010. Ext.Base = (function(flexSetter) {
  23011. // @define Ext.Base
  23012. // @require Ext.Util
  23013. // @require Ext.Version
  23014. // @require Ext.Configurator
  23015. // @uses Ext.ClassManager
  23016. var noArgs = [],
  23017. baseStaticMember,
  23018. baseStaticMembers = [],
  23019. makeDeprecatedMethod = function(oldName, newName, msg) {
  23020. var message = '"' + oldName + '" is deprecated.';
  23021. if (msg) {
  23022. message += ' ' + msg;
  23023. } else if (newName) {
  23024. message += ' Please use "' + newName + '" instead.';
  23025. }
  23026. return function() {
  23027. Ext.raise(message);
  23028. };
  23029. },
  23030. addDeprecatedProperty = function(object, oldName, newName, message) {
  23031. if (!message) {
  23032. message = '"' + oldName + '" is deprecated.';
  23033. }
  23034. if (newName) {
  23035. message += ' Please use "' + newName + '" instead.';
  23036. }
  23037. if (message) {
  23038. Ext.Object.defineProperty(object, oldName, {
  23039. get: function() {
  23040. Ext.raise(message);
  23041. },
  23042. set: function(value) {
  23043. Ext.raise(message);
  23044. },
  23045. configurable: true
  23046. });
  23047. }
  23048. },
  23049. makeAliasFn = function(name) {
  23050. return function() {
  23051. return this[name].apply(this, arguments);
  23052. };
  23053. },
  23054. Version = Ext.Version,
  23055. leadingDigitRe = /^\d/,
  23056. oneMember = {},
  23057. aliasOneMember = {},
  23058. Base = function() {},
  23059. BasePrototype = Base.prototype,
  23060. Reaper;
  23061. Ext.Reaper = Reaper = {
  23062. delay: 100,
  23063. queue: [],
  23064. timer: null,
  23065. add: function(obj) {
  23066. if (!Reaper.timer) {
  23067. Reaper.timer = Ext.defer(Reaper.tick, Reaper.delay);
  23068. }
  23069. Reaper.queue.push(obj);
  23070. },
  23071. flush: function() {
  23072. if (Reaper.timer) {
  23073. Ext.undefer(Reaper.timer);
  23074. Reaper.timer = null;
  23075. }
  23076. var queue = Reaper.queue,
  23077. n = queue.length,
  23078. i, obj;
  23079. Reaper.queue = [];
  23080. for (i = 0; i < n; ++i) {
  23081. obj = queue[i];
  23082. if (obj && obj.$reap) {
  23083. obj.$reap();
  23084. }
  23085. }
  23086. },
  23087. tick: function() {
  23088. Reaper.timer = null;
  23089. Reaper.flush();
  23090. }
  23091. };
  23092. // These static properties will be copied to every newly created class with {@link Ext#define}
  23093. Ext.apply(Base, {
  23094. $className: 'Ext.Base',
  23095. $isClass: true,
  23096. /**
  23097. * Create a new instance of this Class.
  23098. *
  23099. * Ext.define('My.cool.Class', {
  23100. * ...
  23101. * });
  23102. *
  23103. * My.cool.Class.create({
  23104. * someConfig: true
  23105. * });
  23106. *
  23107. * All parameters are passed to the constructor of the class.
  23108. *
  23109. * @return {Object} the created instance.
  23110. * @static
  23111. * @inheritable
  23112. */
  23113. create: function() {
  23114. return Ext.create.apply(Ext, [
  23115. this
  23116. ].concat(Array.prototype.slice.call(arguments, 0)));
  23117. },
  23118. /**
  23119. * This method applies a versioned, deprecation declaration to this class. This
  23120. * is typically called by the `deprecated` config.
  23121. * @private
  23122. */
  23123. addDeprecations: function(deprecations) {
  23124. var me = this,
  23125. all = [],
  23126. compatVersion = Ext.getCompatVersion(deprecations.name),
  23127. configurator = me.getConfigurator(),
  23128. displayName = (me.$className || '') + '#',
  23129. deprecate, versionSpec, index, message, target, enabled, existing, fn, names, oldName, newName, member, statics, version;
  23130. for (versionSpec in deprecations) {
  23131. if (leadingDigitRe.test(versionSpec)) {
  23132. version = new Ext.Version(versionSpec);
  23133. version.deprecations = deprecations[versionSpec];
  23134. all.push(version);
  23135. }
  23136. }
  23137. all.sort(Version.compare);
  23138. for (index = all.length; index--; ) {
  23139. deprecate = (version = all[index]).deprecations;
  23140. target = me.prototype;
  23141. statics = deprecate.statics;
  23142. // If user specifies, say 4.2 compatibility and we have a 5.0 deprecation
  23143. // then that block needs to be "enabled" to "revert" to behaviors prior
  23144. // to 5.0. By default, compatVersion === currentVersion, so there are no
  23145. // enabled blocks. In dev mode we still want to visit all the blocks and
  23146. // possibly add shims to detect use of deprecated methods, but in a build
  23147. // (if the deprecated block remains somehow) we just break the loop.
  23148. enabled = compatVersion && compatVersion.lt(version);
  23149. if (!enabled) {} else if (!enabled) {
  23150. // we won't get here in dev mode when !enabled
  23151. break;
  23152. }
  23153. while (deprecate) {
  23154. names = deprecate.methods;
  23155. if (names) {
  23156. for (oldName in names) {
  23157. member = names[oldName];
  23158. fn = null;
  23159. if (!member) {
  23160. /*
  23161. * Something like:
  23162. *
  23163. * '5.1': {
  23164. * methods: {
  23165. * removedMethod: null
  23166. * }
  23167. * }
  23168. *
  23169. * Since there is no recovering the method, we always put
  23170. * on a shim to catch abuse.
  23171. */
  23172. // The class should not already have a method by the oldName
  23173. Ext.Assert.isNotDefinedProp(target, oldName);
  23174. fn = makeDeprecatedMethod(displayName + oldName);
  23175. } else if (Ext.isString(member)) {
  23176. /*
  23177. * Something like:
  23178. *
  23179. * '5.1': {
  23180. * methods: {
  23181. * oldName: 'newName'
  23182. * }
  23183. * }
  23184. *
  23185. * If this block is enabled, we just put an alias in place.
  23186. * Otherwise we need to inject a
  23187. */
  23188. // The class should not already have a method by the oldName
  23189. Ext.Assert.isNotDefinedProp(target, oldName);
  23190. Ext.Assert.isDefinedProp(target, member);
  23191. if (enabled) {
  23192. // This call to the real method name must be late
  23193. // bound if it is to pick up overrides and such.
  23194. fn = makeAliasFn(member);
  23195. } else {
  23196. fn = makeDeprecatedMethod(displayName + oldName, member);
  23197. }
  23198. } else {
  23199. /*
  23200. * Something like:
  23201. *
  23202. * '5.1': {
  23203. * methods: {
  23204. * foo: function () { ... }
  23205. * }
  23206. * }
  23207. *
  23208. * Or this:
  23209. *
  23210. * '5.1': {
  23211. * methods: {
  23212. * foo: {
  23213. * fn: function () { ... },
  23214. * message: 'Please use "bar" instead.'
  23215. * }
  23216. * }
  23217. * }
  23218. *
  23219. * Or just this:
  23220. *
  23221. * '5.1': {
  23222. * methods: {
  23223. * foo: {
  23224. * message: 'Use something else instead.'
  23225. * }
  23226. * }
  23227. * }
  23228. *
  23229. * If this block is enabled, and "foo" is an existing
  23230. * method, than we apply the given method as an override.
  23231. * If "foo" is not existing, we simply add the method.
  23232. *
  23233. * If the block is not enabled and there is no existing
  23234. * method by that name, than we add a shim to prevent
  23235. * abuse.
  23236. */
  23237. message = '';
  23238. if (member.message || member.fn) {
  23239. message = member.message;
  23240. member = member.fn;
  23241. }
  23242. existing = target.hasOwnProperty(oldName) && target[oldName];
  23243. if (enabled && member) {
  23244. member.$owner = me;
  23245. member.$name = oldName;
  23246. member.name = displayName + oldName;
  23247. if (existing) {
  23248. member.$previous = existing;
  23249. }
  23250. fn = member;
  23251. } else if (!existing) {
  23252. fn = makeDeprecatedMethod(displayName + oldName, null, message);
  23253. }
  23254. }
  23255. if (fn) {
  23256. target[oldName] = fn;
  23257. }
  23258. }
  23259. }
  23260. // for oldName
  23261. //-------------------------------------
  23262. // Debug only
  23263. names = deprecate.configs;
  23264. if (names) {
  23265. //
  23266. // '6.0': {
  23267. // configs: {
  23268. // dead: null,
  23269. //
  23270. // renamed: 'newName',
  23271. //
  23272. // removed: {
  23273. // message: 'This config was replaced by pixie dust'
  23274. // }
  23275. // }
  23276. // }
  23277. //
  23278. configurator.addDeprecations(names);
  23279. }
  23280. names = deprecate.properties;
  23281. if (names && !enabled) {
  23282. // For properties about the only thing we can do is (on Good
  23283. // Browsers), add warning shims for accessing them. So if the
  23284. // block is enabled, we don't want those.
  23285. for (oldName in names) {
  23286. newName = names[oldName];
  23287. if (Ext.isString(newName)) {
  23288. addDeprecatedProperty(target, displayName + oldName, newName);
  23289. } else if (newName && newName.message) {
  23290. addDeprecatedProperty(target, displayName + oldName, null, newName.message);
  23291. } else {
  23292. addDeprecatedProperty(target, displayName + oldName);
  23293. }
  23294. }
  23295. }
  23296. //-------------------------------------
  23297. // reset to handle statics and apply them to the class
  23298. deprecate = statics;
  23299. statics = null;
  23300. target = me;
  23301. }
  23302. }
  23303. },
  23304. /**
  23305. * @private
  23306. * @static
  23307. * @inheritable
  23308. * @param parentClass
  23309. */
  23310. extend: function(parentClass) {
  23311. var me = this,
  23312. parentPrototype = parentClass.prototype,
  23313. prototype, name, statics;
  23314. prototype = me.prototype = Ext.Object.chain(parentPrototype);
  23315. prototype.self = me;
  23316. me.superclass = prototype.superclass = parentPrototype;
  23317. if (!parentClass.$isClass) {
  23318. for (name in BasePrototype) {
  23319. if (name in prototype) {
  23320. prototype[name] = BasePrototype[name];
  23321. }
  23322. }
  23323. }
  23324. // Statics inheritance
  23325. statics = parentPrototype.$inheritableStatics;
  23326. if (statics) {
  23327. for (name in statics) {
  23328. if (!me.hasOwnProperty(name)) {
  23329. me[name] = parentClass[name];
  23330. }
  23331. }
  23332. }
  23333. if (parentClass.$onExtended) {
  23334. me.$onExtended = parentClass.$onExtended.slice();
  23335. }
  23336. me.getConfigurator();
  23337. },
  23338. /**
  23339. * @private
  23340. * @static
  23341. * @inheritable
  23342. */
  23343. $onExtended: [],
  23344. /**
  23345. * @private
  23346. * @static
  23347. * @inheritable
  23348. */
  23349. triggerExtended: function() {
  23350. Ext.classSystemMonitor && Ext.classSystemMonitor(this, 'Ext.Base#triggerExtended', arguments);
  23351. var callbacks = this.$onExtended,
  23352. ln = callbacks.length,
  23353. i, callback;
  23354. if (ln > 0) {
  23355. for (i = 0; i < ln; i++) {
  23356. callback = callbacks[i];
  23357. callback.fn.apply(callback.scope || this, arguments);
  23358. }
  23359. }
  23360. },
  23361. /**
  23362. * @private
  23363. * @static
  23364. * @inheritable
  23365. */
  23366. onExtended: function(fn, scope) {
  23367. this.$onExtended.push({
  23368. fn: fn,
  23369. scope: scope
  23370. });
  23371. return this;
  23372. },
  23373. /**
  23374. * Add / override static properties of this class.
  23375. *
  23376. * Ext.define('My.cool.Class', {
  23377. * ...
  23378. * });
  23379. *
  23380. * My.cool.Class.addStatics({
  23381. * someProperty: 'someValue', // My.cool.Class.someProperty = 'someValue'
  23382. * method1: function() { ... }, // My.cool.Class.method1 = function() { ... };
  23383. * method2: function() { ... } // My.cool.Class.method2 = function() { ... };
  23384. * });
  23385. *
  23386. * @param {Object} members
  23387. * @return {Ext.Base} this
  23388. * @static
  23389. * @inheritable
  23390. */
  23391. addStatics: function(members) {
  23392. this.addMembers(members, true);
  23393. return this;
  23394. },
  23395. /**
  23396. * @private
  23397. * @static
  23398. * @inheritable
  23399. * @param {Object} members
  23400. */
  23401. addInheritableStatics: function(members) {
  23402. var me = this,
  23403. proto = me.prototype,
  23404. inheritableStatics = me.$inheritableStatics,
  23405. name, member, current;
  23406. if (!inheritableStatics) {
  23407. inheritableStatics = Ext.apply({}, proto.$inheritableStatics);
  23408. me.$inheritableStatics = proto.$inheritableStatics = inheritableStatics;
  23409. }
  23410. var className = Ext.getClassName(me) + '.';
  23411. for (name in members) {
  23412. if (members.hasOwnProperty(name)) {
  23413. member = members[name];
  23414. current = me[name];
  23415. if (typeof member == 'function') {
  23416. member.name = className + name;
  23417. }
  23418. if (typeof current === 'function' && !current.$isClass && !current.$nullFn) {
  23419. member.$previous = current;
  23420. }
  23421. me[name] = member;
  23422. inheritableStatics[name] = true;
  23423. }
  23424. }
  23425. return me;
  23426. },
  23427. /**
  23428. * Add methods / properties to the prototype of this class.
  23429. *
  23430. * Ext.define('My.awesome.Cat', {
  23431. * constructor: function() {
  23432. * ...
  23433. * }
  23434. * });
  23435. *
  23436. * My.awesome.Cat.addMembers({
  23437. * meow: function() {
  23438. * alert('Meowww...');
  23439. * }
  23440. * });
  23441. *
  23442. * var kitty = new My.awesome.Cat();
  23443. * kitty.meow();
  23444. *
  23445. * @param {Object} members The members to add to this class.
  23446. * @param {Boolean} [isStatic=false] Pass `true` if the members are static.
  23447. * @param {Boolean} [privacy=false] Pass `true` if the members are private. This
  23448. * only has meaning in debug mode and only for methods.
  23449. * @static
  23450. * @inheritable
  23451. */
  23452. addMembers: function(members, isStatic, privacy) {
  23453. var me = this,
  23454. // this class
  23455. cloneFunction = Ext.Function.clone,
  23456. target = isStatic ? me : me.prototype,
  23457. defaultConfig = !isStatic && target.defaultConfig,
  23458. enumerables = Ext.enumerables,
  23459. privates = members.privates,
  23460. configs, i, ln, member, name, subPrivacy, privateStatics;
  23461. var displayName = (me.$className || '') + '#';
  23462. if (privates) {
  23463. // This won't run for normal class private members but will pick up all
  23464. // others (statics, overrides, etc).
  23465. delete members.privates;
  23466. if (!isStatic) {
  23467. privateStatics = privates.statics;
  23468. delete privates.statics;
  23469. }
  23470. subPrivacy = privates.privacy || privacy || 'framework';
  23471. me.addMembers(privates, isStatic, subPrivacy);
  23472. if (privateStatics) {
  23473. me.addMembers(privateStatics, true, subPrivacy);
  23474. }
  23475. }
  23476. for (name in members) {
  23477. if (members.hasOwnProperty(name)) {
  23478. member = members[name];
  23479. if (privacy === true) {
  23480. privacy = 'framework';
  23481. }
  23482. if (member && member.$nullFn && privacy !== member.$privacy) {
  23483. Ext.raise('Cannot use stock function for private method ' + (me.$className ? me.$className + '#' : '') + name);
  23484. }
  23485. if (typeof member === 'function' && !member.$isClass && !member.$nullFn) {
  23486. if (member.$owner) {
  23487. member = cloneFunction(member);
  23488. }
  23489. if (target.hasOwnProperty(name)) {
  23490. member.$previous = target[name];
  23491. }
  23492. // This information is needed by callParent() and callSuper() as
  23493. // well as statics() and even Ext.fly().
  23494. member.$owner = me;
  23495. member.$name = name;
  23496. member.name = displayName + name;
  23497. var existing = target[name];
  23498. if (privacy) {
  23499. member.$privacy = privacy;
  23500. // The general idea here is that an existing, non-private
  23501. // method can be marked private. This is because the other
  23502. // way is strictly forbidden (private method going public)
  23503. // so if a method is in that gray area it can only be made
  23504. // private in doc form which allows a derived class to make
  23505. // it public.
  23506. if (existing && existing.$privacy && existing.$privacy !== privacy) {
  23507. Ext.privacyViolation(me, existing, member, isStatic);
  23508. }
  23509. } else if (existing && existing.$privacy) {
  23510. Ext.privacyViolation(me, existing, member, isStatic);
  23511. }
  23512. }
  23513. // The last part of the check here resolves a conflict if we have the same property
  23514. // declared as both a config and a member on the class so that the config wins.
  23515. else if (defaultConfig && (name in defaultConfig) && !target.config.hasOwnProperty(name)) {
  23516. // This is a config property so it must be added to the configs
  23517. // collection not just smashed on the prototype...
  23518. (configs || (configs = {}))[name] = member;
  23519. continue;
  23520. }
  23521. target[name] = member;
  23522. }
  23523. }
  23524. if (configs) {
  23525. // Add any configs found in the normal members arena:
  23526. me.addConfig(configs);
  23527. }
  23528. if (enumerables) {
  23529. for (i = 0 , ln = enumerables.length; i < ln; ++i) {
  23530. if (members.hasOwnProperty(name = enumerables[i])) {
  23531. member = members[name];
  23532. // The enumerables are all functions...
  23533. if (member && !member.$nullFn) {
  23534. if (member.$owner) {
  23535. member = cloneFunction(member);
  23536. }
  23537. member.$owner = me;
  23538. member.$name = name;
  23539. member.name = displayName + name;
  23540. if (target.hasOwnProperty(name)) {
  23541. member.$previous = target[name];
  23542. }
  23543. }
  23544. target[name] = member;
  23545. }
  23546. }
  23547. }
  23548. return this;
  23549. },
  23550. /**
  23551. * @private
  23552. * @static
  23553. * @inheritable
  23554. * @param name
  23555. * @param member
  23556. */
  23557. addMember: function(name, member) {
  23558. oneMember[name] = member;
  23559. this.addMembers(oneMember);
  23560. delete oneMember[name];
  23561. return this;
  23562. },
  23563. /**
  23564. * Borrow another class' members to the prototype of this class.
  23565. *
  23566. * Ext.define('Bank', {
  23567. * money: '$$$',
  23568. * printMoney: function() {
  23569. * alert('$$$$$$$');
  23570. * }
  23571. * });
  23572. *
  23573. * Ext.define('Thief', {
  23574. * ...
  23575. * });
  23576. *
  23577. * Thief.borrow(Bank, ['money', 'printMoney']);
  23578. *
  23579. * var steve = new Thief();
  23580. *
  23581. * alert(steve.money); // alerts '$$$'
  23582. * steve.printMoney(); // alerts '$$$$$$$'
  23583. *
  23584. * @param {Ext.Base} fromClass The class to borrow members from
  23585. * @param {Array/String} members The names of the members to borrow
  23586. * @return {Ext.Base} this
  23587. * @static
  23588. * @inheritable
  23589. * @private
  23590. */
  23591. borrow: function(fromClass, members) {
  23592. Ext.classSystemMonitor && Ext.classSystemMonitor(this, 'Ext.Base#borrow', arguments);
  23593. var prototype = fromClass.prototype,
  23594. membersObj = {},
  23595. i, ln, name;
  23596. members = Ext.Array.from(members);
  23597. for (i = 0 , ln = members.length; i < ln; i++) {
  23598. name = members[i];
  23599. membersObj[name] = prototype[name];
  23600. }
  23601. return this.addMembers(membersObj);
  23602. },
  23603. /**
  23604. * Override members of this class. Overridden methods can be invoked via
  23605. * {@link Ext.Base#method!callParent}.
  23606. *
  23607. * Ext.define('My.Cat', {
  23608. * constructor: function() {
  23609. * alert("I'm a cat!");
  23610. * }
  23611. * });
  23612. *
  23613. * My.Cat.override({
  23614. * constructor: function() {
  23615. * alert("I'm going to be a cat!");
  23616. *
  23617. * this.callParent(arguments);
  23618. *
  23619. * alert("Meeeeoooowwww");
  23620. * }
  23621. * });
  23622. *
  23623. * var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
  23624. * // alerts "I'm a cat!"
  23625. * // alerts "Meeeeoooowwww"
  23626. *
  23627. * Direct use of this method should be rare. Use {@link Ext#define Ext.define}
  23628. * instead:
  23629. *
  23630. * Ext.define('My.CatOverride', {
  23631. * override: 'My.Cat',
  23632. * constructor: function() {
  23633. * alert("I'm going to be a cat!");
  23634. *
  23635. * this.callParent(arguments);
  23636. *
  23637. * alert("Meeeeoooowwww");
  23638. * }
  23639. * });
  23640. *
  23641. * The above accomplishes the same result but can be managed by the {@link Ext.Loader}
  23642. * which can properly order the override and its target class and the build process
  23643. * can determine whether the override is needed based on the required state of the
  23644. * target class (My.Cat).
  23645. *
  23646. * @param {Object} members The properties to add to this class. This should be
  23647. * specified as an object literal containing one or more properties.
  23648. * @return {Ext.Base} this class
  23649. * @static
  23650. * @inheritable
  23651. */
  23652. override: function(members) {
  23653. var me = this,
  23654. statics = members.statics,
  23655. inheritableStatics = members.inheritableStatics,
  23656. config = members.config,
  23657. mixins = members.mixins,
  23658. cachedConfig = members.cachedConfig;
  23659. if (statics || inheritableStatics || config) {
  23660. members = Ext.apply({}, members);
  23661. }
  23662. if (statics) {
  23663. me.addMembers(statics, true);
  23664. delete members.statics;
  23665. }
  23666. if (inheritableStatics) {
  23667. me.addInheritableStatics(inheritableStatics);
  23668. delete members.inheritableStatics;
  23669. }
  23670. if (members.platformConfig) {
  23671. me.addPlatformConfig(members);
  23672. }
  23673. if (config) {
  23674. me.addConfig(config);
  23675. delete members.config;
  23676. }
  23677. if (cachedConfig) {
  23678. me.addCachedConfig(cachedConfig);
  23679. delete members.cachedConfig;
  23680. }
  23681. delete members.mixins;
  23682. me.addMembers(members);
  23683. if (mixins) {
  23684. me.mixin(mixins);
  23685. }
  23686. return me;
  23687. },
  23688. addPlatformConfig: function(data) {
  23689. var me = this,
  23690. prototype = me.prototype,
  23691. platformConfigs = data.platformConfig,
  23692. added, classConfigs, configs, configurator, keys, name, value, i, ln;
  23693. delete prototype.platformConfig;
  23694. if (platformConfigs instanceof Array) {
  23695. throw new Error('platformConfigs must be specified as an object.');
  23696. }
  23697. configurator = me.getConfigurator();
  23698. classConfigs = configurator.configs;
  23699. // Get the keys shortest to longest (ish).
  23700. keys = Ext.getPlatformConfigKeys(platformConfigs);
  23701. // To leverage the Configurator#add method, we want to generate potentially
  23702. // two objects to pass in: "added" and "hoisted". For any properties in an
  23703. // active platformConfig rule that set proper Configs in the base class, we
  23704. // need to put them in "added". If instead of the proper Config coming from
  23705. // a base class, it comes from this class's config block, we still need to
  23706. // put that config in "added" but we also need move the class-level config
  23707. // out of "config" and into "hoisted".
  23708. //
  23709. // This will ensure that the config defined at the class level is added to
  23710. // the Configurator first.
  23711. for (i = 0 , ln = keys.length; i < ln; ++i) {
  23712. configs = platformConfigs[keys[i]];
  23713. added = null;
  23714. for (name in configs) {
  23715. value = configs[name];
  23716. // We have a few possibilities for each config name:
  23717. if (name in classConfigs) {
  23718. // It is a proper Config defined by a base class.
  23719. (added || (added = {}))[name] = value;
  23720. } else {
  23721. // It is just a property to put on the prototype.
  23722. prototype[name] = value;
  23723. }
  23724. }
  23725. if (added) {
  23726. configurator.add(added);
  23727. }
  23728. }
  23729. },
  23730. /**
  23731. * @protected
  23732. * @static
  23733. * @inheritable
  23734. */
  23735. callParent: function(args) {
  23736. var method;
  23737. // This code is intentionally inlined for the least amount of debugger stepping
  23738. return (method = this.callParent.caller) && (method.$previous || ((method = method.$owner ? method : method.caller) && method.$owner.superclass.self[method.$name])).apply(this, args || noArgs);
  23739. },
  23740. /**
  23741. * @protected
  23742. * @static
  23743. * @inheritable
  23744. */
  23745. callSuper: function(args) {
  23746. var method;
  23747. // This code is intentionally inlined for the least amount of debugger stepping
  23748. return (method = this.callSuper.caller) && ((method = method.$owner ? method : method.caller) && method.$owner.superclass.self[method.$name]).apply(this, args || noArgs);
  23749. },
  23750. /**
  23751. * Used internally by the mixins pre-processor
  23752. * @private
  23753. * @static
  23754. * @inheritable
  23755. */
  23756. mixin: function(name, mixinClass) {
  23757. var me = this,
  23758. mixin, prototype, key, statics, i, ln, mixinName, mixinValue, mixins, mixinStatics, staticName;
  23759. if (typeof name !== 'string') {
  23760. mixins = name;
  23761. if (mixins instanceof Array) {
  23762. for (i = 0 , ln = mixins.length; i < ln; i++) {
  23763. mixin = mixins[i];
  23764. me.mixin(mixin.prototype.mixinId || mixin.$className, mixin);
  23765. }
  23766. } else {
  23767. // Not a string or array - process the object form:
  23768. // mixins: {
  23769. // foo: ...
  23770. // }
  23771. for (mixinName in mixins) {
  23772. me.mixin(mixinName, mixins[mixinName]);
  23773. }
  23774. }
  23775. return;
  23776. }
  23777. mixin = mixinClass.prototype;
  23778. prototype = me.prototype;
  23779. if (mixin.onClassMixedIn) {
  23780. mixin.onClassMixedIn.call(mixinClass, me);
  23781. }
  23782. if (!prototype.hasOwnProperty('mixins')) {
  23783. if ('mixins' in prototype) {
  23784. prototype.mixins = Ext.Object.chain(prototype.mixins);
  23785. } else {
  23786. prototype.mixins = {};
  23787. }
  23788. }
  23789. for (key in mixin) {
  23790. mixinValue = mixin[key];
  23791. if (key === 'mixins') {
  23792. // if 2 superclasses (e.g. a base class and a mixin) of this class both
  23793. // have a mixin with the same id, the first one wins, that is to say,
  23794. // the first mixin's methods to be applied to the prototype will not
  23795. // be overwritten by the second one. Since this is the case we also
  23796. // want to make sure we use the first mixin's prototype as the mixin
  23797. // reference, hence the "applyIf" below. A real world example of this
  23798. // is Ext.Widget which mixes in Ext.mixin.Observable. Ext.Widget can
  23799. // be mixed into subclasses of Ext.Component, which mixes in
  23800. // Ext.util.Observable. In this example, since the first "observable"
  23801. // mixin's methods win, we also want its reference to be preserved.
  23802. Ext.applyIf(prototype.mixins, mixinValue);
  23803. } else if (!(key === 'mixinId' || key === 'config' || key === '$inheritableStatics') && (prototype[key] === undefined)) {
  23804. prototype[key] = mixinValue;
  23805. }
  23806. }
  23807. // Mixin statics inheritance
  23808. statics = mixin.$inheritableStatics;
  23809. if (statics) {
  23810. mixinStatics = {};
  23811. for (staticName in statics) {
  23812. if (!me.hasOwnProperty(staticName)) {
  23813. mixinStatics[staticName] = mixinClass[staticName];
  23814. }
  23815. }
  23816. me.addInheritableStatics(mixinStatics);
  23817. }
  23818. if ('config' in mixin) {
  23819. me.addConfig(mixin.config, mixinClass);
  23820. }
  23821. prototype.mixins[name] = mixin;
  23822. if (mixin.afterClassMixedIn) {
  23823. mixin.afterClassMixedIn.call(mixinClass, me);
  23824. }
  23825. return me;
  23826. },
  23827. /**
  23828. * Adds new config properties to this class. This is called for classes when they
  23829. * are declared, then for any mixins that class may define and finally for any
  23830. * overrides defined that target the class.
  23831. *
  23832. * @param {Object} config
  23833. * @param {Ext.Class} [mixinClass] The mixin class if the configs are from a mixin.
  23834. * @private
  23835. * @static
  23836. * @inheritable
  23837. */
  23838. addConfig: function(config, mixinClass) {
  23839. var cfg = this.$config || this.getConfigurator();
  23840. cfg.add(config, mixinClass);
  23841. },
  23842. addCachedConfig: function(config, isMixin) {
  23843. var cached = {},
  23844. key;
  23845. for (key in config) {
  23846. cached[key] = {
  23847. cached: true,
  23848. $value: config[key]
  23849. };
  23850. }
  23851. this.addConfig(cached, isMixin);
  23852. },
  23853. /**
  23854. * Returns the `Ext.Configurator` for this class.
  23855. *
  23856. * @return {Ext.Configurator}
  23857. * @private
  23858. * @static
  23859. * @inheritable
  23860. */
  23861. getConfigurator: function() {
  23862. // the Ext.Configurator ctor will set $config so micro-opt out fn call:
  23863. return this.$config || new Ext.Configurator(this);
  23864. },
  23865. /**
  23866. * Get the current class' name in string format.
  23867. *
  23868. * Ext.define('My.cool.Class', {
  23869. * constructor: function() {
  23870. * alert(this.self.getName()); // alerts 'My.cool.Class'
  23871. * }
  23872. * });
  23873. *
  23874. * My.cool.Class.getName(); // 'My.cool.Class'
  23875. *
  23876. * @return {String} className
  23877. * @static
  23878. * @inheritable
  23879. */
  23880. getName: function() {
  23881. return Ext.getClassName(this);
  23882. },
  23883. /**
  23884. * Create aliases for existing prototype methods. Example:
  23885. *
  23886. * Ext.define('My.cool.Class', {
  23887. * method1: function() { ... },
  23888. * method2: function() { ... }
  23889. * });
  23890. *
  23891. * var test = new My.cool.Class();
  23892. *
  23893. * My.cool.Class.createAlias({
  23894. * method3: 'method1',
  23895. * method4: 'method2'
  23896. * });
  23897. *
  23898. * test.method3(); // test.method1()
  23899. *
  23900. * My.cool.Class.createAlias('method5', 'method3');
  23901. *
  23902. * test.method5(); // test.method3() -> test.method1()
  23903. *
  23904. * @param {String/Object} alias The new method name, or an object to set multiple aliases. See
  23905. * {@link Ext.Function#flexSetter flexSetter}
  23906. * @param {String/Object} origin The original method name
  23907. * @static
  23908. * @inheritable
  23909. * @method
  23910. */
  23911. createAlias: flexSetter(function(alias, origin) {
  23912. aliasOneMember[alias] = function() {
  23913. return this[origin].apply(this, arguments);
  23914. };
  23915. this.override(aliasOneMember);
  23916. delete aliasOneMember[alias];
  23917. })
  23918. });
  23919. // Capture the set of static members on Ext.Base that we want to copy to all
  23920. // derived classes. This array is used by Ext.Class as well as the optimizer.
  23921. for (baseStaticMember in Base) {
  23922. if (Base.hasOwnProperty(baseStaticMember)) {
  23923. baseStaticMembers.push(baseStaticMember);
  23924. }
  23925. }
  23926. Base.$staticMembers = baseStaticMembers;
  23927. Base.getConfigurator();
  23928. // lazily create now so as not capture in $staticMembers
  23929. Base.addMembers({
  23930. /** @private */
  23931. $className: 'Ext.Base',
  23932. /**
  23933. * @property {Boolean} isInstance
  23934. * This value is `true` and is used to identify plain objects from instances of
  23935. * a defined class.
  23936. * @protected
  23937. * @readonly
  23938. */
  23939. isInstance: true,
  23940. /**
  23941. * @property {Boolean} [$configPrefixed]
  23942. * The value `true` causes `config` values to be stored on instances using a
  23943. * property name prefixed with an underscore ("_") character. A value of `false`
  23944. * stores `config` values as properties using their exact name (no prefix).
  23945. * @private
  23946. * @since 5.0.0
  23947. */
  23948. $configPrefixed: true,
  23949. /**
  23950. * @property {Boolean} [$configStrict]
  23951. * The value `true` instructs the `initConfig` method to only honor values for
  23952. * properties declared in the `config` block of a class. When `false`, properties
  23953. * that are not declared in a `config` block will be placed on the instance.
  23954. * @private
  23955. * @since 5.0.0
  23956. */
  23957. $configStrict: true,
  23958. /**
  23959. * @property {Boolean} isConfiguring
  23960. * This property is set to `true` during the call to `initConfig`.
  23961. * @protected
  23962. * @readonly
  23963. * @since 5.0.0
  23964. */
  23965. isConfiguring: false,
  23966. /**
  23967. * @property {Boolean} isFirstInstance
  23968. * This property is set to `true` if this instance is the first of its class.
  23969. * @protected
  23970. * @readonly
  23971. * @since 5.0.0
  23972. */
  23973. isFirstInstance: false,
  23974. /**
  23975. * @property {Boolean} destroyed
  23976. * This property is set to `true` after the `destroy` method is called.
  23977. * @protected
  23978. */
  23979. destroyed: false,
  23980. /**
  23981. * @property {Boolean/"async"} [clearPropertiesOnDestroy=true]
  23982. * Setting this property to `false` will prevent nulling object references
  23983. * on a Class instance after destruction. Setting this to `"async"` will delay
  23984. * the clearing for approx 50ms.
  23985. * @protected
  23986. * @since 6.2.0
  23987. */
  23988. clearPropertiesOnDestroy: true,
  23989. /**
  23990. * @property {Boolean} [clearPrototypeOnDestroy=false]
  23991. * Setting this property to `true` will result in setting the object's
  23992. * prototype to `null` after the destruction sequence is fully completed.
  23993. * After that, most attempts at calling methods on the object instance
  23994. * will result in "method not defined" exception. This can be very helpful
  23995. * with tracking down otherwise hard to find bugs like runaway Ajax requests,
  23996. * timed functions not cleared on destruction, etc.
  23997. *
  23998. * Note that this option can only work in browsers that support `Object.setPrototypeOf`
  23999. * method, and is only available in debugging mode.
  24000. * @private
  24001. * @since 6.2.0
  24002. */
  24003. clearPrototypeOnDestroy: false,
  24004. /**
  24005. * Get the reference to the class from which this object was instantiated. Note that unlike {@link Ext.Base#self},
  24006. * `this.statics()` is scope-independent and it always returns the class from which it was called, regardless of what
  24007. * `this` points to during run-time
  24008. *
  24009. * Ext.define('My.Cat', {
  24010. * statics: {
  24011. * totalCreated: 0,
  24012. * speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
  24013. * },
  24014. *
  24015. * constructor: function() {
  24016. * var statics = this.statics();
  24017. *
  24018. * alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to
  24019. * // equivalent to: My.Cat.speciesName
  24020. *
  24021. * alert(this.self.speciesName); // dependent on 'this'
  24022. *
  24023. * statics.totalCreated++;
  24024. * },
  24025. *
  24026. * clone: function() {
  24027. * var cloned = new this.self(); // dependent on 'this'
  24028. *
  24029. * cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName
  24030. *
  24031. * return cloned;
  24032. * }
  24033. * });
  24034. *
  24035. *
  24036. * Ext.define('My.SnowLeopard', {
  24037. * extend: 'My.Cat',
  24038. *
  24039. * statics: {
  24040. * speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'
  24041. * },
  24042. *
  24043. * constructor: function() {
  24044. * this.callParent();
  24045. * }
  24046. * });
  24047. *
  24048. * var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat'
  24049. *
  24050. * var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'
  24051. *
  24052. * var clone = snowLeopard.clone();
  24053. * alert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'
  24054. * alert(clone.groupName); // alerts 'Cat'
  24055. *
  24056. * alert(My.Cat.totalCreated); // alerts 3
  24057. *
  24058. * @protected
  24059. * @return {Ext.Class}
  24060. */
  24061. statics: function() {
  24062. var method = this.statics.caller,
  24063. self = this.self;
  24064. if (!method) {
  24065. return self;
  24066. }
  24067. return method.$owner;
  24068. },
  24069. /**
  24070. * Call the "parent" method of the current method. That is the method previously
  24071. * overridden by derivation or by an override (see {@link Ext#define}).
  24072. *
  24073. * Ext.define('My.Base', {
  24074. * constructor: function (x) {
  24075. * this.x = x;
  24076. * },
  24077. *
  24078. * statics: {
  24079. * method: function (x) {
  24080. * return x;
  24081. * }
  24082. * }
  24083. * });
  24084. *
  24085. * Ext.define('My.Derived', {
  24086. * extend: 'My.Base',
  24087. *
  24088. * constructor: function () {
  24089. * this.callParent([21]);
  24090. * }
  24091. * });
  24092. *
  24093. * var obj = new My.Derived();
  24094. *
  24095. * alert(obj.x); // alerts 21
  24096. *
  24097. * This can be used with an override as follows:
  24098. *
  24099. * Ext.define('My.DerivedOverride', {
  24100. * override: 'My.Derived',
  24101. *
  24102. * constructor: function (x) {
  24103. * this.callParent([x*2]); // calls original My.Derived constructor
  24104. * }
  24105. * });
  24106. *
  24107. * var obj = new My.Derived();
  24108. *
  24109. * alert(obj.x); // now alerts 42
  24110. *
  24111. * This also works with static and private methods.
  24112. *
  24113. * Ext.define('My.Derived2', {
  24114. * extend: 'My.Base',
  24115. *
  24116. * // privates: {
  24117. * statics: {
  24118. * method: function (x) {
  24119. * return this.callParent([x*2]); // calls My.Base.method
  24120. * }
  24121. * }
  24122. * });
  24123. *
  24124. * alert(My.Base.method(10)); // alerts 10
  24125. * alert(My.Derived2.method(10)); // alerts 20
  24126. *
  24127. * Lastly, it also works with overridden static methods.
  24128. *
  24129. * Ext.define('My.Derived2Override', {
  24130. * override: 'My.Derived2',
  24131. *
  24132. * // privates: {
  24133. * statics: {
  24134. * method: function (x) {
  24135. * return this.callParent([x*2]); // calls My.Derived2.method
  24136. * }
  24137. * }
  24138. * });
  24139. *
  24140. * alert(My.Derived2.method(10); // now alerts 40
  24141. *
  24142. * To override a method and replace it and also call the superclass method, use
  24143. * {@link #method-callSuper}. This is often done to patch a method to fix a bug.
  24144. *
  24145. * @protected
  24146. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  24147. * from the current method, for example: `this.callParent(arguments)`
  24148. * @return {Object} Returns the result of calling the parent method
  24149. */
  24150. callParent: function(args) {
  24151. // NOTE: this code is deliberately as few expressions (and no function calls)
  24152. // as possible so that a debugger can skip over this noise with the minimum number
  24153. // of steps. Basically, just hit Step Into until you are where you really wanted
  24154. // to be.
  24155. var method,
  24156. superMethod = (method = this.callParent.caller) && (method.$previous || ((method = method.$owner ? method : method.caller) && method.$owner.superclass[method.$name]));
  24157. if (!superMethod) {
  24158. method = this.callParent.caller;
  24159. var parentClass, methodName;
  24160. if (!method.$owner) {
  24161. if (!method.caller) {
  24162. throw new Error("Attempting to call a protected method from the public scope, which is not allowed");
  24163. }
  24164. method = method.caller;
  24165. }
  24166. parentClass = method.$owner.superclass;
  24167. methodName = method.$name;
  24168. if (!(methodName in parentClass)) {
  24169. throw new Error("this.callParent() was called but there's no such method (" + methodName + ") found in the parent class (" + (Ext.getClassName(parentClass) || 'Object') + ")");
  24170. }
  24171. }
  24172. return superMethod.apply(this, args || noArgs);
  24173. },
  24174. /**
  24175. * This method is used by an **override** to call the superclass method but
  24176. * bypass any overridden method. This is often done to "patch" a method that
  24177. * contains a bug but for whatever reason cannot be fixed directly.
  24178. *
  24179. * Consider:
  24180. *
  24181. * Ext.define('Ext.some.Class', {
  24182. * method: function () {
  24183. * console.log('Good');
  24184. * }
  24185. * });
  24186. *
  24187. * Ext.define('Ext.some.DerivedClass', {
  24188. * extend: 'Ext.some.Class',
  24189. *
  24190. * method: function () {
  24191. * console.log('Bad');
  24192. *
  24193. * // ... logic but with a bug ...
  24194. *
  24195. * this.callParent();
  24196. * }
  24197. * });
  24198. *
  24199. * To patch the bug in `Ext.some.DerivedClass.method`, the typical solution is to create an
  24200. * override:
  24201. *
  24202. * Ext.define('App.patches.DerivedClass', {
  24203. * override: 'Ext.some.DerivedClass',
  24204. *
  24205. * method: function () {
  24206. * console.log('Fixed');
  24207. *
  24208. * // ... logic but with bug fixed ...
  24209. *
  24210. * this.callSuper();
  24211. * }
  24212. * });
  24213. *
  24214. * The patch method cannot use {@link #method-callParent} to call the superclass
  24215. * `method` since that would call the overridden method containing the bug. In
  24216. * other words, the above patch would only produce "Fixed" then "Good" in the
  24217. * console log, whereas, using `callParent` would produce "Fixed" then "Bad"
  24218. * then "Good".
  24219. *
  24220. * @protected
  24221. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  24222. * from the current method, for example: `this.callSuper(arguments)`
  24223. * @return {Object} Returns the result of calling the superclass method
  24224. */
  24225. callSuper: function(args) {
  24226. // NOTE: this code is deliberately as few expressions (and no function calls)
  24227. // as possible so that a debugger can skip over this noise with the minimum number
  24228. // of steps. Basically, just hit Step Into until you are where you really wanted
  24229. // to be.
  24230. var method,
  24231. superMethod = (method = this.callSuper.caller) && ((method = method.$owner ? method : method.caller) && method.$owner.superclass[method.$name]);
  24232. if (!superMethod) {
  24233. method = this.callSuper.caller;
  24234. var parentClass, methodName;
  24235. if (!method.$owner) {
  24236. if (!method.caller) {
  24237. throw new Error("Attempting to call a protected method from the public scope, which is not allowed");
  24238. }
  24239. method = method.caller;
  24240. }
  24241. parentClass = method.$owner.superclass;
  24242. methodName = method.$name;
  24243. if (!(methodName in parentClass)) {
  24244. throw new Error("this.callSuper() was called but there's no such method (" + methodName + ") found in the parent class (" + (Ext.getClassName(parentClass) || 'Object') + ")");
  24245. }
  24246. }
  24247. return superMethod.apply(this, args || noArgs);
  24248. },
  24249. /**
  24250. * @property {Ext.Class} self
  24251. *
  24252. * Get the reference to the current class from which this object was instantiated. Unlike {@link Ext.Base#statics},
  24253. * `this.self` is scope-dependent and it's meant to be used for dynamic inheritance. See {@link Ext.Base#statics}
  24254. * for a detailed comparison
  24255. *
  24256. * Ext.define('My.Cat', {
  24257. * statics: {
  24258. * speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
  24259. * },
  24260. *
  24261. * constructor: function() {
  24262. * alert(this.self.speciesName); // dependent on 'this'
  24263. * },
  24264. *
  24265. * clone: function() {
  24266. * return new this.self();
  24267. * }
  24268. * });
  24269. *
  24270. *
  24271. * Ext.define('My.SnowLeopard', {
  24272. * extend: 'My.Cat',
  24273. * statics: {
  24274. * speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'
  24275. * }
  24276. * });
  24277. *
  24278. * var cat = new My.Cat(); // alerts 'Cat'
  24279. * var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard'
  24280. *
  24281. * var clone = snowLeopard.clone();
  24282. * alert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'
  24283. *
  24284. * @protected
  24285. */
  24286. self: Base,
  24287. // Default constructor, simply returns `this`
  24288. constructor: function() {
  24289. return this;
  24290. },
  24291. /**
  24292. * Initialize configuration for this class. a typical example:
  24293. *
  24294. * Ext.define('My.awesome.Class', {
  24295. * // The default config
  24296. * config: {
  24297. * name: 'Awesome',
  24298. * isAwesome: true
  24299. * },
  24300. *
  24301. * constructor: function(config) {
  24302. * this.initConfig(config);
  24303. * }
  24304. * });
  24305. *
  24306. * var awesome = new My.awesome.Class({
  24307. * name: 'Super Awesome'
  24308. * });
  24309. *
  24310. * alert(awesome.getName()); // 'Super Awesome'
  24311. *
  24312. * @protected
  24313. * @param {Object} instanceConfig
  24314. * @return {Ext.Base} this
  24315. * @chainable
  24316. */
  24317. initConfig: function(instanceConfig) {
  24318. var me = this,
  24319. cfg = me.self.getConfigurator();
  24320. me.initConfig = Ext.emptyFn;
  24321. // ignore subsequent calls to initConfig
  24322. me.initialConfig = instanceConfig || {};
  24323. cfg.configure(me, instanceConfig);
  24324. return me;
  24325. },
  24326. beforeInitConfig: Ext.emptyFn,
  24327. /**
  24328. * Returns a specified config property value. If the name parameter is not passed,
  24329. * all current configuration options will be returned as key value pairs.
  24330. * @param {String} [name] The name of the config property to get.
  24331. * @param {Boolean} [peek=false] `true` to peek at the raw value without calling the getter.
  24332. * @param {Boolean} [ifInitialized=false] `true` to only return the initialized property value,
  24333. * not the raw config value, and *not* to trigger initialization. Returns `undefined` if the
  24334. * property has not yet been initialized.
  24335. * @return {Object} The config property value.
  24336. */
  24337. getConfig: function(name, peek, ifInitialized) {
  24338. var me = this,
  24339. ret, cfg, propName;
  24340. if (name) {
  24341. cfg = me.self.$config.configs[name];
  24342. if (cfg) {
  24343. propName = me.$configPrefixed ? cfg.names.internal : name;
  24344. // They only want the fully initialized value, not the initial config,
  24345. // but only if it's already present on this instance.
  24346. // They don't want to trigger the initGetter.
  24347. // This form is used by Bindable#updatePublishes to initially publish
  24348. // the properties it's being asked make publishable.
  24349. if (ifInitialized) {
  24350. ret = me.hasOwnProperty(propName) ? me[propName] : null;
  24351. } else if (peek) {
  24352. // Attempt to return the instantiated property on this instance first.
  24353. // Only return the config object if it has not yet been pulled through
  24354. // the applier into the instance.
  24355. ret = me.hasOwnProperty(propName) ? me[propName] : me.config[name];
  24356. } else {
  24357. ret = me[cfg.names.get]();
  24358. }
  24359. } else {
  24360. ret = me[name];
  24361. }
  24362. } else {
  24363. ret = me.getCurrentConfig();
  24364. }
  24365. return ret;
  24366. },
  24367. /**
  24368. * Destroys member properties by name.
  24369. *
  24370. * If a property name is the name of a *config*, the getter is *not* invoked, so
  24371. * if the config has not been initialized, nothing will be done.
  24372. *
  24373. * The property will be destroyed, and the corrected name (if the property is a *config*
  24374. * and config names are prefixed) will set to `null` in this object's dictionary.
  24375. *
  24376. * @param {String...} args One or more names of the properties to destroy and remove from the object.
  24377. */
  24378. destroyMembers: function() {
  24379. var me = this,
  24380. configs = me.self.$config.configs,
  24381. len = arguments.length,
  24382. cfg, name, value, i;
  24383. for (i = 0; i < len; i++) {
  24384. name = arguments[i];
  24385. cfg = configs[name];
  24386. name = cfg && me.$configPrefixed ? cfg.names.internal : name;
  24387. value = me.hasOwnProperty(name) && me[name];
  24388. if (value) {
  24389. Ext.destroy(value);
  24390. me[name] = null;
  24391. }
  24392. }
  24393. },
  24394. freezeConfig: function(name) {
  24395. var me = this,
  24396. config = Ext.Config.get(name),
  24397. names = config.names,
  24398. value = me[names.get]();
  24399. me[names.set] = function(v) {
  24400. if (v !== value) {
  24401. Ext.raise('Cannot change frozen config "' + name + '"');
  24402. }
  24403. return me;
  24404. };
  24405. if (!Ext.isIE8) {
  24406. Object.defineProperty(me, me.$configPrefixed ? names.internal : name, {
  24407. get: function() {
  24408. return value;
  24409. },
  24410. set: function(v) {
  24411. if (v !== value) {
  24412. Ext.raise('Cannot change frozen config "' + name + '"');
  24413. }
  24414. }
  24415. });
  24416. }
  24417. },
  24418. /**
  24419. * Sets a single/multiple configuration options.
  24420. * @param {String/Object} name The name of the property to set, or a set of key value pairs to set.
  24421. * @param {Object} [value] The value to set for the name parameter.
  24422. * @param {Object} [options] (private)
  24423. * @return {Ext.Base} this
  24424. */
  24425. setConfig: function(name, value, options) {
  24426. // options can have the following properties:
  24427. // - defaults `true` to only set the config(s) that have not been already set on
  24428. // this instance.
  24429. // - strict `false` to apply properties to the instance that are not configs,
  24430. // and do not have setters.
  24431. var me = this,
  24432. configurator, config, prop;
  24433. if (name) {
  24434. configurator = me.self.getConfigurator();
  24435. if (typeof name === 'string') {
  24436. config = configurator.configs[name];
  24437. if (!config) {
  24438. if (me.$configStrict) {
  24439. prop = me.self.prototype[name];
  24440. if ((typeof prop === 'function') && !prop.$nullFn) {
  24441. Ext.Error.raise("Cannot override method " + name + " on " + me.$className + " instance.");
  24442. return me;
  24443. } else {
  24444. if (name !== 'type') {
  24445. Ext.log.warn('No such config "' + name + '" for class ' + me.$className);
  24446. }
  24447. }
  24448. }
  24449. config = Ext.Config.map[name] || Ext.Config.get(name);
  24450. }
  24451. if (me[config.names.set]) {
  24452. me[config.names.set](value);
  24453. } else {
  24454. // apply non-config props directly to the instance
  24455. me[name] = value;
  24456. }
  24457. } else {
  24458. // This should not have "options ||" except that it shipped in that
  24459. // broken state, so we use it if present for compat.
  24460. configurator.reconfigure(me, name, options || value);
  24461. }
  24462. }
  24463. return me;
  24464. },
  24465. /**
  24466. * @private
  24467. */
  24468. getCurrentConfig: function() {
  24469. var cfg = this.self.getConfigurator();
  24470. return cfg.getCurrentConfig(this);
  24471. },
  24472. /**
  24473. * @param {String} name
  24474. * @private
  24475. */
  24476. hasConfig: function(name) {
  24477. return name in this.defaultConfig;
  24478. },
  24479. /**
  24480. * Returns the initial configuration passed to the constructor when
  24481. * instantiating this class.
  24482. *
  24483. * Given this example Ext.button.Button definition and instance:
  24484. *
  24485. * Ext.define('MyApp.view.Button', {
  24486. * extend: 'Ext.button.Button',
  24487. * xtype: 'mybutton',
  24488. *
  24489. * scale: 'large',
  24490. * enableToggle: true
  24491. * });
  24492. *
  24493. * var btn = Ext.create({
  24494. * xtype: 'mybutton',
  24495. * renderTo: Ext.getBody(),
  24496. * text: 'Test Button'
  24497. * });
  24498. *
  24499. * Calling `btn.getInitialConfig()` would return an object including the config
  24500. * options passed to the `create` method:
  24501. *
  24502. * xtype: 'mybutton',
  24503. * renderTo: // The document body itself
  24504. * text: 'Test Button'
  24505. *
  24506. * Calling `btn.getInitialConfig('text')`returns **'Test Button'**.
  24507. *
  24508. * @param {String} [name] Name of the config option to return.
  24509. * @return {Object/Mixed} The full config object or a single config value
  24510. * when `name` parameter specified.
  24511. */
  24512. getInitialConfig: function(name) {
  24513. var config = this.config;
  24514. if (!name) {
  24515. return config;
  24516. }
  24517. return config[name];
  24518. },
  24519. $links: null,
  24520. /**
  24521. * Adds a "destroyable" object to an internal list of objects that will be destroyed
  24522. * when this instance is destroyed (via `{@link #method!destroy}`).
  24523. * @param {String} name
  24524. * @param {Object} value
  24525. * @return {Object} The `value` passed.
  24526. * @private
  24527. */
  24528. link: function(name, value) {
  24529. var me = this,
  24530. links = me.$links || (me.$links = {});
  24531. links[name] = true;
  24532. me[name] = value;
  24533. return value;
  24534. },
  24535. /**
  24536. * Destroys a given set of `{@link #link linked}` objects. This is only needed if
  24537. * the linked object is being destroyed before this instance.
  24538. * @param {String[]} names The names of the linked objects to destroy.
  24539. * @return {Ext.Base} this
  24540. * @private
  24541. */
  24542. unlink: function(names) {
  24543. var me = this,
  24544. i, ln, link, value;
  24545. if (!Ext.isArray(names)) {
  24546. Ext.raise('Invalid argument - expected array of strings');
  24547. }
  24548. for (i = 0 , ln = names.length; i < ln; i++) {
  24549. link = names[i];
  24550. value = me[link];
  24551. if (value) {
  24552. if (value.isInstance && !value.destroyed) {
  24553. value.destroy();
  24554. } else if (value.parentNode && 'nodeType' in value) {
  24555. value.parentNode.removeChild(value);
  24556. }
  24557. }
  24558. me[link] = null;
  24559. }
  24560. return me;
  24561. },
  24562. $reap: function() {
  24563. var me = this,
  24564. protectedProps = me.$noClearOnDestroy,
  24565. props, prop, value, type, i, len;
  24566. // This only returns own keys which is *much* faster than iterating
  24567. // over the whole prototype chain and calling hasOwnProperty()
  24568. props = Ext.Object.getKeys(me);
  24569. for (i = 0 , len = props.length; i < len; i++) {
  24570. prop = props[i];
  24571. if (!protectedProps || !protectedProps[prop]) {
  24572. value = me[prop];
  24573. type = typeof value;
  24574. // Object may retain references to other objects. Functions can do too
  24575. // if they are closures, and most of the *own* function properties
  24576. // are closures indeed. We skip Ext.emptyFn and the like though,
  24577. // they're mostly harmless.
  24578. if (type === 'object' || (type === 'function' && !value.$noClearOnDestroy)) {
  24579. me[prop] = null;
  24580. }
  24581. }
  24582. }
  24583. me.$nulled = true;
  24584. // We also want to make sure no methods are called on the destroyed object,
  24585. // because that may lead to accessing nulled properties and resulting exceptions.
  24586. if (Object.setPrototypeOf) {
  24587. if (me.clearPrototypeOnDestroy && !me.$vetoClearingPrototypeOnDestroy) {
  24588. props = me.$preservePrototypeProperties;
  24589. if (props) {
  24590. for (i = 0 , len = props.length; i < len; i++) {
  24591. prop = props[i];
  24592. if (!me.hasOwnProperty(prop)) {
  24593. me[prop] = me[prop];
  24594. }
  24595. }
  24596. }
  24597. Object.setPrototypeOf(me, null);
  24598. }
  24599. }
  24600. },
  24601. /**
  24602. * This method is called to cleanup an object and its resources. After calling
  24603. * this method, the object should not be used any further in any way, including
  24604. * access to its methods and properties.
  24605. *
  24606. * To prevent potential memory leaks, all object references will be nulled
  24607. * at the end of destruction sequence, unless {@link #clearPropertiesOnDestroy}
  24608. * is set to `false`.
  24609. */
  24610. destroy: function() {
  24611. var me = this,
  24612. links = me.$links,
  24613. clearPropertiesOnDestroy = me.clearPropertiesOnDestroy;
  24614. if (links) {
  24615. me.$links = null;
  24616. me.unlink(Ext.Object.getKeys(links));
  24617. }
  24618. me.destroy = Ext.emptyFn;
  24619. // isDestroyed added for compat reasons
  24620. me.isDestroyed = me.destroyed = true;
  24621. // By this time the destruction is complete. Now we can make sure
  24622. // no objects are retained by the husk of this ex-Instance.
  24623. if (clearPropertiesOnDestroy === true) {
  24624. // Observable mixin will call destroyObservable that will reap the properties.
  24625. if (!me.isObservable) {
  24626. me.$reap();
  24627. }
  24628. } else if (clearPropertiesOnDestroy) {
  24629. if (clearPropertiesOnDestroy !== 'async') {
  24630. Ext.raise('Invalid value for clearPropertiesOnDestroy');
  24631. }
  24632. Reaper.add(me);
  24633. }
  24634. }
  24635. });
  24636. /**
  24637. * @method callOverridden
  24638. * Call the original method that was previously overridden with {@link Ext.Base#override}
  24639. *
  24640. * Ext.define('My.Cat', {
  24641. * constructor: function() {
  24642. * alert("I'm a cat!");
  24643. * }
  24644. * });
  24645. *
  24646. * My.Cat.override({
  24647. * constructor: function() {
  24648. * alert("I'm going to be a cat!");
  24649. *
  24650. * this.callOverridden();
  24651. *
  24652. * alert("Meeeeoooowwww");
  24653. * }
  24654. * });
  24655. *
  24656. * var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
  24657. * // alerts "I'm a cat!"
  24658. * // alerts "Meeeeoooowwww"
  24659. *
  24660. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  24661. * from the current method, for example: `this.callOverridden(arguments)`
  24662. * @return {Object} Returns the result of calling the overridden method
  24663. * @deprecated 4.1.0 Use {@link #method-callParent} instead.
  24664. * @protected
  24665. */
  24666. BasePrototype.callOverridden = BasePrototype.callParent;
  24667. Ext.privacyViolation = function(cls, existing, member, isStatic) {
  24668. var name = member.$name,
  24669. conflictCls = existing.$owner && existing.$owner.$className,
  24670. s = isStatic ? 'static ' : '',
  24671. msg = member.$privacy ? 'Private ' + s + member.$privacy + ' method "' + name + '"' : 'Public ' + s + 'method "' + name + '"';
  24672. if (cls.$className) {
  24673. msg = cls.$className + ': ' + msg;
  24674. }
  24675. if (!existing.$privacy) {
  24676. msg += conflictCls ? ' hides public method inherited from ' + conflictCls : ' hides inherited public method.';
  24677. } else {
  24678. msg += conflictCls ? ' conflicts with private ' + existing.$privacy + ' method declared by ' + conflictCls : ' conflicts with inherited private ' + existing.$privacy + ' method.';
  24679. }
  24680. var compat = Ext.getCompatVersion();
  24681. var ver = Ext.getVersion();
  24682. // When compatibility is enabled, log problems instead of throwing errors.
  24683. if (ver && compat && compat.lt(ver)) {
  24684. Ext.log.error(msg);
  24685. } else {
  24686. Ext.raise(msg);
  24687. }
  24688. };
  24689. Ext.Reaper.tick.$skipTimerCheck = true;
  24690. return Base;
  24691. }(Ext.Function.flexSetter));
  24692. /**
  24693. * This class manages a double-linked list. It provides an absolutely minimal container
  24694. * interface.
  24695. *
  24696. * @class Ext.util.LRU
  24697. * @private
  24698. * @since 6.5.0
  24699. */
  24700. (function(LRU, prototype) {
  24701. // @define Ext.util.LRU
  24702. // NOTE: We have to implement this class old-school because it is used by the
  24703. // platformConfig class processor (so Ext.define is not yet ready for action).
  24704. (Ext.util || (Ext.util = {})).LRU = LRU = function(config) {
  24705. var me = this,
  24706. head;
  24707. if (config) {
  24708. Ext.apply(me, config);
  24709. }
  24710. // Give all entries the same object shape.
  24711. me.head = head = {
  24712. id: (me.seed = 0),
  24713. key: null,
  24714. value: null
  24715. };
  24716. /**
  24717. * @property {Object} map
  24718. * The items in the list indexed by their `key`.
  24719. * @readonly
  24720. */
  24721. me.map = {};
  24722. head.next = head.prev = head;
  24723. };
  24724. LRU.prototype = prototype = {
  24725. /**
  24726. * @property {Number} count
  24727. * The number of items in this list.
  24728. * @readonly
  24729. */
  24730. count: 0,
  24731. /**
  24732. * Adds an item to the list with the specified `key`. Items are added at the
  24733. * front (MRU) of the list.
  24734. * @param {String} key
  24735. * @param {Object} value
  24736. */
  24737. add: function(key, value) {
  24738. var me = this,
  24739. map = me.map,
  24740. entry = map[key];
  24741. if (entry) {
  24742. me.unlink(entry);
  24743. --me.count;
  24744. }
  24745. map[key] = entry = {
  24746. id: ++me.seed,
  24747. key: key,
  24748. value: value
  24749. };
  24750. me.link(entry);
  24751. ++me.count;
  24752. return entry;
  24753. },
  24754. /**
  24755. * Removes all items from this list optionally calling a function for each
  24756. * remove item.
  24757. * @param {Function} [fn] A function to call for each removed item.
  24758. * @param {Object} fn.key The key of the removed item.
  24759. * @param {Object} fn.value The removed item.
  24760. * @param {Object} [scope] The `this` pointer for `fn`.
  24761. */
  24762. clear: function(fn, scope) {
  24763. var me = this,
  24764. head = me.head,
  24765. entry = head.next;
  24766. head.next = head.prev = head;
  24767. me.count = 0;
  24768. if (fn && !fn.$nullFn) {
  24769. for (; entry !== head; entry = entry.next) {
  24770. fn.call(scope || me, entry.key, entry.value);
  24771. }
  24772. }
  24773. },
  24774. /**
  24775. * Calls the given function `fn` for each item in the list. The items will be
  24776. * passed to `fn` from most-to-least recently added or touched.
  24777. * @param {Function} fn The function to call for each cache item.
  24778. * @param {String} fn.key The key for the item.
  24779. * @param {Object} fn.value The item.
  24780. * @param {Object} [scope] The `this` pointer to use for `fn`.
  24781. */
  24782. each: function(fn, scope) {
  24783. scope = scope || this;
  24784. for (var head = this.head,
  24785. ent = head.next; ent !== head; ent = ent.next) {
  24786. if (fn.call(scope, ent.key, ent.value)) {
  24787. break;
  24788. }
  24789. }
  24790. },
  24791. /**
  24792. * Removes the item at the end (LRU) of the list. Optionally the item can be passed
  24793. * to a callback function. If the list is empty, no callback is made and this
  24794. * method will return `undefined`.
  24795. * @param {Function} fn The function to call for the removed item.
  24796. * @param {Object} fn.key The key of the removed item.
  24797. * @param {Object} fn.value The removed item.
  24798. * @param {Object} [scope] The `this` pointer to use for `fn`.
  24799. * @return {Object} The removed item.
  24800. */
  24801. prune: function(fn, scope) {
  24802. var me = this,
  24803. entry = me.head.prev,
  24804. ret;
  24805. if (me.count) {
  24806. ret = entry.value;
  24807. me.unlink(entry);
  24808. --me.count;
  24809. if (fn) {
  24810. fn.call(scope || me, entry.key, ret);
  24811. }
  24812. }
  24813. return ret;
  24814. },
  24815. /**
  24816. * Removes an item from the list given its key.
  24817. * @param {String} key The key of the item to remove.
  24818. * @return {Object} The removed item or `undefined` if the key was not found.
  24819. */
  24820. remove: function(key) {
  24821. var me = this,
  24822. map = me.map,
  24823. entry = map[key],
  24824. value;
  24825. if (entry) {
  24826. me.unlink(entry);
  24827. value = entry.value;
  24828. delete map[key];
  24829. --me.count;
  24830. }
  24831. return value;
  24832. },
  24833. /**
  24834. * Moves the item with the given key to the front (MRU) of the list.
  24835. * @param {String} key The key of the item to move to the front.
  24836. */
  24837. touch: function(key) {
  24838. var me = this,
  24839. head = me.head,
  24840. entry = me.map[key];
  24841. if (entry && entry.prev !== head) {
  24842. // The entry is not at the front, so remove it and insert it at the front
  24843. // (to make it the MRU - Most Recently Used).
  24844. me.unlink(entry);
  24845. me.link(entry);
  24846. }
  24847. },
  24848. /**
  24849. * Reduces the length of the list to be no more than the specified `size`, removing
  24850. * items from the end of the list as necessary. Optionally each removed item can
  24851. * be passed to a callback `fn`.
  24852. * @param {Number} size The number of items in the list
  24853. * @param {Function} [fn] A function to call for each removed item.
  24854. * @param {Object} fn.key The key of the removed item.
  24855. * @param {Object} fn.value The removed item.
  24856. * @param {Object} [scope] The `this` pointer for `fn`.
  24857. */
  24858. trim: function(size, fn, scope) {
  24859. while (this.count > size) {
  24860. this.prune(fn, scope);
  24861. }
  24862. },
  24863. //-------------------------------------------------------------------------
  24864. // Internals
  24865. /**
  24866. * Inserts the given entry at the front (MRU) end of the entry list.
  24867. * @param {Object} entry The cache item entry.
  24868. * @private
  24869. */
  24870. link: function(entry) {
  24871. var head = this.head,
  24872. first = head.next;
  24873. entry.next = first;
  24874. entry.prev = head;
  24875. head.next = entry;
  24876. first.prev = entry;
  24877. },
  24878. /**
  24879. * Removes the given entry from the entry list.
  24880. * @param {Object} entry The cache item entry.
  24881. * @private
  24882. */
  24883. unlink: function(entry) {
  24884. var next = entry.next,
  24885. prev = entry.prev;
  24886. prev.next = next;
  24887. next.prev = prev;
  24888. }
  24889. };
  24890. prototype.destroy = function() {
  24891. this.clear.apply(this, arguments);
  24892. };
  24893. }());
  24894. /**
  24895. * This class is used to manage simple, LRU caches. It provides an absolutely minimal
  24896. * container interface. It is created like this:
  24897. *
  24898. * this.itemCache = new Ext.util.Cache({
  24899. * miss: function (key) {
  24900. * return new CacheItem(key);
  24901. * }
  24902. * });
  24903. *
  24904. * The `{@link #miss}` abstract method must be implemented by either a derived class or
  24905. * at the instance level as shown above.
  24906. *
  24907. * Once the cache exists and it can handle cache misses, the cache is used like so:
  24908. *
  24909. * var item = this.itemCache.get(key);
  24910. *
  24911. * The `key` is some value that uniquely identifies the cached item.
  24912. *
  24913. * In some cases, creating the cache item may require more than just the lookup key. In
  24914. * that case, any extra arguments passed to `get` will be passed to `miss`.
  24915. *
  24916. * this.otherCache = new Ext.util.Cache({
  24917. * miss: function (key, extra) {
  24918. * return new CacheItem(key, extra);
  24919. * }
  24920. * });
  24921. *
  24922. * var item = this.otherCache.get(key, extra);
  24923. *
  24924. * To process items as they are removed, you can provide an `{@link #evict}` method. The
  24925. * stock method is `Ext.emptyFn` and so does nothing.
  24926. *
  24927. * For example:
  24928. *
  24929. * this.itemCache = new Ext.util.Cache({
  24930. * miss: function (key) {
  24931. * return new CacheItem(key);
  24932. * },
  24933. *
  24934. * evict: function (key, cacheItem) {
  24935. * cacheItem.destroy();
  24936. * }
  24937. * });
  24938. *
  24939. * @class Ext.util.Cache
  24940. * @private
  24941. * @since 5.1.0
  24942. */
  24943. (function(LRU, fn, Cache) {
  24944. // @require Ext.util.LRU
  24945. // @define Ext.util.Cache
  24946. // NOTE: We have to implement this class old-school because it is used by the
  24947. // platformConfig class processor (so Ext.define is not yet ready for action).
  24948. Ext.util.Cache = Cache = function(config) {
  24949. LRU.call(this, config);
  24950. };
  24951. fn.prototype = LRU.prototype;
  24952. Cache.prototype = Ext.apply(new fn(), {
  24953. /**
  24954. * @cfg {Number} maxSize The maximum size the cache is allowed to grow to before
  24955. * further additions cause removal of the least recently used entry.
  24956. */
  24957. maxSize: 100,
  24958. /**
  24959. * This method is called by `{@link #get}` when the key is not found in the cache.
  24960. * The implementation of this method should create the (expensive) value and return
  24961. * it. Whatever arguments were passed to `{@link #get}` will be passed on to this
  24962. * method.
  24963. *
  24964. * @param {String} key The cache lookup key for the item.
  24965. * @param {Object...} args Any other arguments originally passed to `{@link #get}`.
  24966. * @method miss
  24967. * @abstract
  24968. * @protected
  24969. */
  24970. /**
  24971. * Removes all items from this cache.
  24972. */
  24973. clear: function() {
  24974. LRU.prototype.clear.call(this, this.evict);
  24975. },
  24976. /**
  24977. * Finds an item in this cache and returns its value. If the item is present, it is
  24978. * shuffled into the MRU (most-recently-used) position as necessary. If the item is
  24979. * missing, the `{@link #miss}` method is called to create the item.
  24980. *
  24981. * @param {String} key The cache key of the item.
  24982. * @param {Object...} args Arguments for the `miss` method should it be needed.
  24983. * @return {Object} The cached object.
  24984. */
  24985. get: function(key) {
  24986. var me = this,
  24987. entry = me.map[key],
  24988. value;
  24989. if (entry) {
  24990. value = entry.value;
  24991. me.touch(key);
  24992. } else {
  24993. value = me.miss.apply(me, arguments);
  24994. me.add(key, value);
  24995. me.trim(me.maxSize, me.evict);
  24996. }
  24997. return value;
  24998. },
  24999. //-------------------------------------------------------------------------
  25000. // Internals
  25001. /**
  25002. * This method is called internally from `{@link #get}` when the cache is full and
  25003. * the least-recently-used (LRU) item has been removed.
  25004. *
  25005. * @param {String} key The cache lookup key for the item being removed.
  25006. * @param {Object} value The cache value (returned by `{@link #miss}`) for the item
  25007. * being removed.
  25008. * @method evict
  25009. * @template
  25010. * @protected
  25011. */
  25012. evict: Ext.emptyFn
  25013. });
  25014. }(Ext.util.LRU, function() {}));
  25015. /**
  25016. * @class Ext.Class
  25017. *
  25018. * This is a low level factory that is used by {@link Ext#define Ext.define} and should not be used
  25019. * directly in application code.
  25020. *
  25021. * The configs of this class are intended to be used in `Ext.define` calls to describe the class you
  25022. * are declaring. For example:
  25023. *
  25024. * Ext.define('App.util.Thing', {
  25025. * extend: 'App.util.Other',
  25026. *
  25027. * alias: 'util.thing',
  25028. *
  25029. * config: {
  25030. * foo: 42
  25031. * }
  25032. * });
  25033. *
  25034. * Ext.Class is the factory and **not** the superclass of everything. For the base class that **all**
  25035. * classes inherit from, see {@link Ext.Base}.
  25036. */
  25037. (function() {
  25038. // @tag class
  25039. // @define Ext.Class
  25040. // @require Ext.Base
  25041. // @require Ext.Util
  25042. // @require Ext.util.Cache
  25043. var ExtClass,
  25044. Base = Ext.Base,
  25045. baseStaticMembers = Base.$staticMembers,
  25046. ruleKeySortFn = function(a, b) {
  25047. // longest to shortest, by text if names are equal
  25048. return (a.length - b.length) || ((a < b) ? -1 : ((a > b) ? 1 : 0));
  25049. };
  25050. // Creates a constructor that has nothing extra in its scope chain.
  25051. function makeCtor(className) {
  25052. function constructor() {
  25053. // Opera has some problems returning from a constructor when Dragonfly isn't running. The || null seems to
  25054. // be sufficient to stop it misbehaving. Known to be required against 10.53, 11.51 and 11.61.
  25055. return this.constructor.apply(this, arguments) || null;
  25056. }
  25057. if (className) {
  25058. constructor.name = className;
  25059. }
  25060. return constructor;
  25061. }
  25062. /**
  25063. * @method constructor
  25064. * Create a new anonymous class.
  25065. *
  25066. * @param Class
  25067. * @param {Object} data An object represent the properties of this class
  25068. * @param {Function} onCreated Optional, the callback function to be executed when this class is fully created.
  25069. * Note that the creation process can be asynchronous depending on the pre-processors used.
  25070. *
  25071. * @return {Ext.Base} The newly created class
  25072. */
  25073. Ext.Class = ExtClass = function(Class, data, onCreated) {
  25074. if (typeof Class != 'function') {
  25075. onCreated = data;
  25076. data = Class;
  25077. Class = null;
  25078. }
  25079. if (!data) {
  25080. data = {};
  25081. }
  25082. Class = ExtClass.create(Class, data);
  25083. ExtClass.process(Class, data, onCreated);
  25084. return Class;
  25085. };
  25086. Ext.apply(ExtClass, {
  25087. makeCtor: makeCtor,
  25088. /**
  25089. * @private
  25090. */
  25091. onBeforeCreated: function(Class, data, hooks) {
  25092. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, '>> Ext.Class#onBeforeCreated', arguments);
  25093. Class.addMembers(data);
  25094. hooks.onCreated.call(Class, Class);
  25095. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, '<< Ext.Class#onBeforeCreated', arguments);
  25096. },
  25097. /**
  25098. * @private
  25099. */
  25100. create: function(Class, data) {
  25101. var i = baseStaticMembers.length,
  25102. name;
  25103. if (!Class) {
  25104. Class = makeCtor(data.$className);
  25105. }
  25106. while (i--) {
  25107. name = baseStaticMembers[i];
  25108. Class[name] = Base[name];
  25109. }
  25110. return Class;
  25111. },
  25112. /**
  25113. * @private
  25114. */
  25115. process: function(Class, data, onCreated) {
  25116. var preprocessorStack = data.preprocessors || ExtClass.defaultPreprocessors,
  25117. registeredPreprocessors = this.preprocessors,
  25118. hooks = {
  25119. onBeforeCreated: this.onBeforeCreated
  25120. },
  25121. preprocessors = [],
  25122. preprocessor, preprocessorsProperties, i, ln, j, subLn, preprocessorProperty;
  25123. delete data.preprocessors;
  25124. Class._classHooks = hooks;
  25125. for (i = 0 , ln = preprocessorStack.length; i < ln; i++) {
  25126. preprocessor = preprocessorStack[i];
  25127. if (typeof preprocessor == 'string') {
  25128. preprocessor = registeredPreprocessors[preprocessor];
  25129. preprocessorsProperties = preprocessor.properties;
  25130. if (preprocessorsProperties === true) {
  25131. preprocessors.push(preprocessor.fn);
  25132. } else if (preprocessorsProperties) {
  25133. for (j = 0 , subLn = preprocessorsProperties.length; j < subLn; j++) {
  25134. preprocessorProperty = preprocessorsProperties[j];
  25135. if (data.hasOwnProperty(preprocessorProperty)) {
  25136. preprocessors.push(preprocessor.fn);
  25137. break;
  25138. }
  25139. }
  25140. }
  25141. } else {
  25142. preprocessors.push(preprocessor);
  25143. }
  25144. }
  25145. hooks.onCreated = onCreated ? onCreated : Ext.emptyFn;
  25146. hooks.preprocessors = preprocessors;
  25147. this.doProcess(Class, data, hooks);
  25148. },
  25149. doProcess: function(Class, data, hooks) {
  25150. var me = this,
  25151. preprocessors = hooks.preprocessors,
  25152. preprocessor = preprocessors.shift(),
  25153. doProcess = me.doProcess;
  25154. for (; preprocessor; preprocessor = preprocessors.shift()) {
  25155. // Returning false signifies an asynchronous preprocessor - it will call doProcess when we can continue
  25156. if (preprocessor.call(me, Class, data, hooks, doProcess) === false) {
  25157. return;
  25158. }
  25159. }
  25160. hooks.onBeforeCreated.apply(me, arguments);
  25161. },
  25162. /**
  25163. * @private
  25164. * */
  25165. preprocessors: {},
  25166. /**
  25167. * Register a new pre-processor to be used during the class creation process
  25168. *
  25169. * @param {String} name The pre-processor's name
  25170. * @param {Function} fn The callback function to be executed. Typical format:
  25171. *
  25172. * function(cls, data, fn) {
  25173. * // Your code here
  25174. *
  25175. * // Execute this when the processing is finished.
  25176. * // Asynchronous processing is perfectly ok
  25177. * if (fn) {
  25178. * fn.call(this, cls, data);
  25179. * }
  25180. * });
  25181. *
  25182. * @param {Function} fn.cls The created class
  25183. * @param {Object} fn.data The set of properties passed in {@link Ext.Class} constructor
  25184. * @param {Function} fn.fn The callback function that **must** to be executed when this
  25185. * pre-processor finishes, regardless of whether the processing is synchronous or asynchronous.
  25186. * @param properties
  25187. * @param position
  25188. * @param relativeTo
  25189. * @return {Ext.Class} this
  25190. * @private
  25191. * @static
  25192. */
  25193. registerPreprocessor: function(name, fn, properties, position, relativeTo) {
  25194. if (!position) {
  25195. position = 'last';
  25196. }
  25197. if (!properties) {
  25198. properties = [
  25199. name
  25200. ];
  25201. }
  25202. this.preprocessors[name] = {
  25203. name: name,
  25204. properties: properties || false,
  25205. fn: fn
  25206. };
  25207. this.setDefaultPreprocessorPosition(name, position, relativeTo);
  25208. return this;
  25209. },
  25210. /**
  25211. * Retrieve a pre-processor callback function by its name, which has been registered before
  25212. *
  25213. * @param {String} name
  25214. * @return {Function} preprocessor
  25215. * @private
  25216. * @static
  25217. */
  25218. getPreprocessor: function(name) {
  25219. return this.preprocessors[name];
  25220. },
  25221. /**
  25222. * @private
  25223. */
  25224. getPreprocessors: function() {
  25225. return this.preprocessors;
  25226. },
  25227. /**
  25228. * @private
  25229. */
  25230. defaultPreprocessors: [],
  25231. /**
  25232. * Retrieve the array stack of default pre-processors
  25233. * @return {Function[]} defaultPreprocessors
  25234. * @private
  25235. * @static
  25236. */
  25237. getDefaultPreprocessors: function() {
  25238. return this.defaultPreprocessors;
  25239. },
  25240. /**
  25241. * Set the default array stack of default pre-processors
  25242. *
  25243. * @private
  25244. * @param {Array} preprocessors
  25245. * @return {Ext.Class} this
  25246. * @static
  25247. */
  25248. setDefaultPreprocessors: function(preprocessors) {
  25249. this.defaultPreprocessors = Ext.Array.from(preprocessors);
  25250. return this;
  25251. },
  25252. /**
  25253. * Insert this pre-processor at a specific position in the stack, optionally relative to
  25254. * any existing pre-processor. For example:
  25255. *
  25256. * Ext.Class.registerPreprocessor('debug', function(cls, data, fn) {
  25257. * // Your code here
  25258. *
  25259. * if (fn) {
  25260. * fn.call(this, cls, data);
  25261. * }
  25262. * }).setDefaultPreprocessorPosition('debug', 'last');
  25263. *
  25264. * @private
  25265. * @param {String} name The pre-processor name. Note that it needs to be registered with
  25266. * {@link Ext.Class#registerPreprocessor registerPreprocessor} before this
  25267. * @param {String} offset The insertion position. Four possible values are:
  25268. * 'first', 'last', or: 'before', 'after' (relative to the name provided in the third argument)
  25269. * @param {String} relativeName
  25270. * @return {Ext.Class} this
  25271. * @static
  25272. */
  25273. setDefaultPreprocessorPosition: function(name, offset, relativeName) {
  25274. var defaultPreprocessors = this.defaultPreprocessors,
  25275. index;
  25276. if (typeof offset == 'string') {
  25277. if (offset === 'first') {
  25278. defaultPreprocessors.unshift(name);
  25279. return this;
  25280. } else if (offset === 'last') {
  25281. defaultPreprocessors.push(name);
  25282. return this;
  25283. }
  25284. offset = (offset === 'after') ? 1 : -1;
  25285. }
  25286. index = Ext.Array.indexOf(defaultPreprocessors, relativeName);
  25287. if (index !== -1) {
  25288. Ext.Array.splice(defaultPreprocessors, Math.max(0, index + offset), 0, name);
  25289. }
  25290. return this;
  25291. }
  25292. });
  25293. /**
  25294. * @cfg {String} extend
  25295. * The parent class that this class extends. For example:
  25296. *
  25297. * Ext.define('Person', {
  25298. * say: function(text) { alert(text); }
  25299. * });
  25300. *
  25301. * Ext.define('Developer', {
  25302. * extend: 'Person',
  25303. * say: function(text) { this.callParent(["print "+text]); }
  25304. * });
  25305. */
  25306. ExtClass.registerPreprocessor('extend', function(Class, data, hooks) {
  25307. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#extendPreProcessor', arguments);
  25308. var Base = Ext.Base,
  25309. basePrototype = Base.prototype,
  25310. extend = data.extend,
  25311. Parent, parentPrototype, i;
  25312. delete data.extend;
  25313. if (extend && extend !== Object) {
  25314. Parent = extend;
  25315. } else {
  25316. Parent = Base;
  25317. }
  25318. parentPrototype = Parent.prototype;
  25319. if (!Parent.$isClass) {
  25320. for (i in basePrototype) {
  25321. if (!parentPrototype[i]) {
  25322. parentPrototype[i] = basePrototype[i];
  25323. }
  25324. }
  25325. }
  25326. Class.extend(Parent);
  25327. Class.triggerExtended.apply(Class, arguments);
  25328. /**
  25329. * @cfg {Object} eventedConfig
  25330. * Config options defined within `eventedConfig` will auto-generate the setter /
  25331. * getter methods (see {@link #cfg-config config} for more information on
  25332. * auto-generated getter / setter methods). Additionally, when an
  25333. * `eventedConfig` is set it will also fire a before{cfg}change and {cfg}change
  25334. * event when the value of the eventedConfig is changed from its originally
  25335. * defined value.
  25336. *
  25337. * **Note:** When creating a custom class you'll need to extend Ext.Evented
  25338. *
  25339. * Example custom class:
  25340. *
  25341. * Ext.define('MyApp.util.Test', {
  25342. * extend: 'Ext.Evented',
  25343. *
  25344. * eventedConfig: {
  25345. * foo: null
  25346. * }
  25347. * });
  25348. *
  25349. * In this example, the `foo` config will initially be null. Changing it via
  25350. * `setFoo` will fire the `beforefoochange` event. The call to the setter can be
  25351. * halted by returning `false` from a listener on the **before** event.
  25352. *
  25353. * var test = Ext.create('MyApp.util.Test', {
  25354. * listeners: {
  25355. * beforefoochange: function (instance, newValue, oldValue) {
  25356. * return newValue !== 'bar';
  25357. * },
  25358. * foochange: function (instance, newValue, oldValue) {
  25359. * console.log('foo changed to:', newValue);
  25360. * }
  25361. * }
  25362. * });
  25363. *
  25364. * test.setFoo('bar');
  25365. *
  25366. * The `before` event handler can be used to validate changes to `foo`.
  25367. * Returning `false` will prevent the setter from changing the value of the
  25368. * config. In the previous example the `beforefoochange` handler returns false
  25369. * so `foo` will not be updated and `foochange` will not be fired.
  25370. *
  25371. * test.setFoo('baz');
  25372. *
  25373. * Setting `foo` to 'baz' will not be prevented by the `before` handler. Foo
  25374. * will be set to the value: 'baz' and the `foochange` event will be fired.
  25375. */
  25376. if (data.onClassExtended) {
  25377. Class.onExtended(data.onClassExtended, Class);
  25378. delete data.onClassExtended;
  25379. }
  25380. }, true);
  25381. // true to always run this preprocessor even w/o "extend" keyword
  25382. /**
  25383. * @cfg {Object} privates
  25384. * The `privates` config is a list of methods intended to be used internally by the
  25385. * framework. Methods are placed in a `privates` block to prevent developers from
  25386. * accidentally overriding framework methods in custom classes.
  25387. *
  25388. * Ext.define('Computer', {
  25389. * privates: {
  25390. * runFactory: function(brand) {
  25391. * // internal only processing of brand passed to factory
  25392. * this.factory(brand);
  25393. * }
  25394. * },
  25395. *
  25396. * factory: function (brand) {}
  25397. * });
  25398. *
  25399. * In order to override a method from a `privates` block, the overridden method must
  25400. * also be placed in a `privates` block within the override class.
  25401. *
  25402. * Ext.define('Override.Computer', {
  25403. * override: 'Computer',
  25404. * privates: {
  25405. * runFactory: function() {
  25406. * // overriding logic
  25407. * }
  25408. * }
  25409. * });
  25410. */
  25411. ExtClass.registerPreprocessor('privates', function(Class, data) {
  25412. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#privatePreprocessor', arguments);
  25413. var privates = data.privates,
  25414. statics = privates.statics,
  25415. privacy = privates.privacy || true;
  25416. delete data.privates;
  25417. delete privates.statics;
  25418. // We have to add this preprocessor so that private getters/setters are picked up
  25419. // by the config system. This also catches duplication in the public part of the
  25420. // class since it is an error to override a private method with a public one.
  25421. Class.addMembers(privates, false, privacy);
  25422. if (statics) {
  25423. Class.addMembers(statics, true, privacy);
  25424. }
  25425. });
  25426. /**
  25427. * @cfg {Object} statics
  25428. * List of static methods for this class. For example:
  25429. *
  25430. * Ext.define('Computer', {
  25431. * statics: {
  25432. * factory: function(brand) {
  25433. * // 'this' in static methods refer to the class itself
  25434. * return new this(brand);
  25435. * }
  25436. * },
  25437. *
  25438. * constructor: function() { ... }
  25439. * });
  25440. *
  25441. * var dellComputer = Computer.factory('Dell');
  25442. */
  25443. ExtClass.registerPreprocessor('statics', function(Class, data) {
  25444. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#staticsPreprocessor', arguments);
  25445. Class.addStatics(data.statics);
  25446. delete data.statics;
  25447. });
  25448. /**
  25449. * @cfg {Object} inheritableStatics
  25450. * List of inheritable static methods for this class.
  25451. * Otherwise just like {@link #statics} but subclasses inherit these methods.
  25452. */
  25453. ExtClass.registerPreprocessor('inheritableStatics', function(Class, data) {
  25454. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#inheritableStaticsPreprocessor', arguments);
  25455. Class.addInheritableStatics(data.inheritableStatics);
  25456. delete data.inheritableStatics;
  25457. });
  25458. Ext.createRuleFn = function(code) {
  25459. return new Function('$c', 'with($c) { try { return (' + code + '); } catch(e) { return false;}}');
  25460. };
  25461. Ext.expressionCache = new Ext.util.Cache({
  25462. miss: Ext.createRuleFn
  25463. });
  25464. Ext.ruleKeySortFn = ruleKeySortFn;
  25465. Ext.getPlatformConfigKeys = function(platformConfig) {
  25466. var ret = [],
  25467. platform, rule;
  25468. for (platform in platformConfig) {
  25469. rule = Ext.expressionCache.get(platform);
  25470. if (rule(Ext.platformTags)) {
  25471. ret.push(platform);
  25472. }
  25473. }
  25474. ret.sort(ruleKeySortFn);
  25475. return ret;
  25476. };
  25477. /**
  25478. * @cfg {Object} config
  25479. *
  25480. * List of configuration options with their default values.
  25481. *
  25482. * __Note:__ You need to make sure {@link Ext.Base#initConfig} is called from your constructor if you are defining
  25483. * your own class or singleton, unless you are extending a Component. Otherwise the generated getter and setter
  25484. * methods will not be initialized.
  25485. *
  25486. * Each config item will have its own setter and getter method automatically generated inside the class prototype
  25487. * during class creation time, if the class does not have those methods explicitly defined.
  25488. *
  25489. * As an example, let's convert the name property of a Person class to be a config item, then add extra age and
  25490. * gender items.
  25491. *
  25492. * Ext.define('My.sample.Person', {
  25493. * config: {
  25494. * name: 'Mr. Unknown',
  25495. * age: 0,
  25496. * gender: 'Male'
  25497. * },
  25498. *
  25499. * constructor: function(config) {
  25500. * this.initConfig(config);
  25501. *
  25502. * return this;
  25503. * }
  25504. *
  25505. * // ...
  25506. * });
  25507. *
  25508. * Within the class, this.name still has the default value of "Mr. Unknown". However, it's now publicly accessible
  25509. * without sacrificing encapsulation, via setter and getter methods.
  25510. *
  25511. * var jacky = new My.sample.Person({
  25512. * name: "Jacky",
  25513. * age: 35
  25514. * });
  25515. *
  25516. * alert(jacky.getAge()); // alerts 35
  25517. * alert(jacky.getGender()); // alerts "Male"
  25518. *
  25519. * jacky.setName("Mr. Nguyen");
  25520. * alert(jacky.getName()); // alerts "Mr. Nguyen"
  25521. *
  25522. * Notice that we changed the class constructor to invoke this.initConfig() and pass in the provided config object.
  25523. * Two key things happened:
  25524. *
  25525. * - The provided config object when the class is instantiated is recursively merged with the default config object.
  25526. * - All corresponding setter methods are called with the merged values.
  25527. *
  25528. * Beside storing the given values, throughout the frameworks, setters generally have two key responsibilities:
  25529. *
  25530. * - Filtering / validation / transformation of the given value before it's actually stored within the instance.
  25531. * - Notification (such as firing events) / post-processing after the value has been set, or changed from a
  25532. * previous value.
  25533. *
  25534. * By standardize this common pattern, the default generated setters provide two extra template methods that you
  25535. * can put your own custom logic into, i.e: an "applyFoo" and "updateFoo" method for a "foo" config item, which are
  25536. * executed before and after the value is actually set, respectively. Back to the example class, let's validate that
  25537. * age must be a valid positive number, and fire an 'agechange' if the value is modified.
  25538. *
  25539. * Ext.define('My.sample.Person', {
  25540. * config: {
  25541. * // ...
  25542. * },
  25543. *
  25544. * constructor: {
  25545. * // ...
  25546. * },
  25547. *
  25548. * applyAge: function(age) {
  25549. * if (typeof age !== 'number' || age < 0) {
  25550. * console.warn("Invalid age, must be a positive number");
  25551. * return;
  25552. * }
  25553. *
  25554. * return age;
  25555. * },
  25556. *
  25557. * updateAge: function(newAge, oldAge) {
  25558. * // age has changed from "oldAge" to "newAge"
  25559. * this.fireEvent('agechange', this, newAge, oldAge);
  25560. * }
  25561. *
  25562. * // ...
  25563. * });
  25564. *
  25565. * var jacky = new My.sample.Person({
  25566. * name: "Jacky",
  25567. * age: 'invalid'
  25568. * });
  25569. *
  25570. * alert(jacky.getAge()); // alerts 0
  25571. *
  25572. * alert(jacky.setAge(-100)); // alerts 0
  25573. * alert(jacky.getAge()); // alerts 0
  25574. *
  25575. * alert(jacky.setAge(35)); // alerts 0
  25576. * alert(jacky.getAge()); // alerts 35
  25577. *
  25578. * In other words, when leveraging the config feature, you mostly never need to define setter and getter methods
  25579. * explicitly. Instead, "apply*" and "update*" methods should be implemented where necessary. Your code will be
  25580. * consistent throughout and only contain the minimal logic that you actually care about.
  25581. *
  25582. * When it comes to inheritance, the default config of the parent class is automatically, recursively merged with
  25583. * the child's default config. The same applies for mixins.
  25584. */
  25585. ExtClass.registerPreprocessor('config', function(Class, data) {
  25586. // Need to copy to the prototype here because that happens after preprocessors
  25587. if (data.hasOwnProperty('$configPrefixed')) {
  25588. Class.prototype.$configPrefixed = data.$configPrefixed;
  25589. }
  25590. Class.addConfig(data.config);
  25591. // We need to remove this or it will be applied by addMembers and smash the
  25592. // "config" placed on the prototype by Configurator (which includes *all* configs
  25593. // such as cachedConfigs).
  25594. delete data.config;
  25595. });
  25596. /**
  25597. * @cfg {Object} cachedConfig
  25598. *
  25599. * This configuration works in a very similar manner to the {@link #config} option.
  25600. * The difference is that the configurations are only ever processed when the first instance
  25601. * of that class is created. The processed value is then stored on the class prototype and
  25602. * will not be processed on subsequent instances of the class. Getters/setters will be generated
  25603. * in exactly the same way as {@link #config}.
  25604. *
  25605. * This option is useful for expensive objects that can be shared across class instances.
  25606. * The class itself ensures that the creation only occurs once.
  25607. */
  25608. ExtClass.registerPreprocessor('cachedConfig', function(Class, data) {
  25609. // Need to copy to the prototype here because that happens after preprocessors
  25610. if (data.hasOwnProperty('$configPrefixed')) {
  25611. Class.prototype.$configPrefixed = data.$configPrefixed;
  25612. }
  25613. Class.addCachedConfig(data.cachedConfig);
  25614. // Remove this so it won't be placed on the prototype.
  25615. delete data.cachedConfig;
  25616. });
  25617. /**
  25618. * @cfg {String[]/Object} mixins
  25619. * List of classes to mix into this class. For example:
  25620. *
  25621. * Ext.define('CanSing', {
  25622. * sing: function() {
  25623. * alert("For he's a jolly good fellow...")
  25624. * }
  25625. * });
  25626. *
  25627. * Ext.define('Musician', {
  25628. * mixins: ['CanSing']
  25629. * })
  25630. *
  25631. * In this case the Musician class will get a `sing` method from CanSing mixin.
  25632. *
  25633. * But what if the Musician already has a `sing` method? Or you want to mix
  25634. * in two classes, both of which define `sing`? In such a cases it's good
  25635. * to define mixins as an object, where you assign a name to each mixin:
  25636. *
  25637. * Ext.define('Musician', {
  25638. * mixins: {
  25639. * canSing: 'CanSing'
  25640. * },
  25641. *
  25642. * sing: function() {
  25643. * // delegate singing operation to mixin
  25644. * this.mixins.canSing.sing.call(this);
  25645. * }
  25646. * })
  25647. *
  25648. * In this case the `sing` method of Musician will overwrite the
  25649. * mixed in `sing` method. But you can access the original mixed in method
  25650. * through special `mixins` property.
  25651. */
  25652. ExtClass.registerPreprocessor('mixins', function(Class, data, hooks) {
  25653. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#mixinsPreprocessor', arguments);
  25654. var mixins = data.mixins,
  25655. onCreated = hooks.onCreated;
  25656. delete data.mixins;
  25657. hooks.onCreated = function() {
  25658. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#mixinsPreprocessor#beforeCreated', arguments);
  25659. // Put back the original onCreated before processing mixins. This allows a
  25660. // mixin to hook onCreated by access Class._classHooks.
  25661. hooks.onCreated = onCreated;
  25662. Class.mixin(mixins);
  25663. // We must go back to hooks.onCreated here because it may have changed during
  25664. // calls to onClassMixedIn.
  25665. return hooks.onCreated.apply(this, arguments);
  25666. };
  25667. });
  25668. // Backwards compatible
  25669. Ext.extend = function(Class, Parent, members) {
  25670. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#extend-backwards-compatible', arguments);
  25671. if (arguments.length === 2 && Ext.isObject(Parent)) {
  25672. members = Parent;
  25673. Parent = Class;
  25674. Class = null;
  25675. }
  25676. var cls;
  25677. if (!Parent) {
  25678. throw new Error("[Ext.extend] Attempting to extend from a class which has not been loaded on the page.");
  25679. }
  25680. members.extend = Parent;
  25681. members.preprocessors = [
  25682. 'extend',
  25683. 'statics',
  25684. 'inheritableStatics',
  25685. 'mixins',
  25686. 'config'
  25687. ];
  25688. if (Class) {
  25689. cls = new ExtClass(Class, members);
  25690. // The 'constructor' is given as 'Class' but also needs to be on prototype
  25691. cls.prototype.constructor = Class;
  25692. } else {
  25693. cls = new ExtClass(members);
  25694. }
  25695. cls.prototype.override = function(o) {
  25696. for (var m in o) {
  25697. if (o.hasOwnProperty(m)) {
  25698. this[m] = o[m];
  25699. }
  25700. }
  25701. };
  25702. return cls;
  25703. };
  25704. }());
  25705. /**
  25706. * This object contains properties that describe the current device or platform. These
  25707. * values can be used in `{@link Ext.Class#platformConfig platformConfig}` as well as
  25708. * `{@link Ext.mixin.Responsive#responsiveConfig responsiveConfig}` statements.
  25709. *
  25710. * This object can be modified to include tags that are useful for the application. To
  25711. * add custom properties, it is advisable to use a sub-object. For example:
  25712. *
  25713. * Ext.platformTags.app = {
  25714. * mobile: true
  25715. * };
  25716. *
  25717. * @property {Object} platformTags
  25718. * @property {Boolean} platformTags.phone
  25719. * @property {Boolean} platformTags.tablet
  25720. * @property {Boolean} platformTags.desktop
  25721. * @property {Boolean} platformTags.touch Indicates touch inputs are available.
  25722. * @property {Boolean} platformTags.safari
  25723. * @property {Boolean} platformTags.chrome
  25724. * @property {Boolean} platformTags.windows
  25725. * @property {Boolean} platformTags.firefox
  25726. * @property {Boolean} platformTags.ios True for iPad, iPhone and iPod.
  25727. * @property {Boolean} platformTags.android
  25728. * @property {Boolean} platformTags.blackberry
  25729. * @property {Boolean} platformTags.tizen
  25730. * @member Ext
  25731. */
  25732. // @tag class
  25733. /**
  25734. * @class Ext.Inventory
  25735. * @private
  25736. */
  25737. Ext.Inventory = function() {
  25738. // @define Ext.Script
  25739. // @define Ext.Inventory
  25740. // @require Ext.Function
  25741. var me = this;
  25742. me.names = [];
  25743. me.paths = {};
  25744. me.alternateToName = {};
  25745. me.aliasToName = {};
  25746. me.nameToAliases = {};
  25747. me.nameToAlternates = {};
  25748. me.nameToPrefix = {};
  25749. };
  25750. Ext.Inventory.prototype = {
  25751. _array1: [
  25752. 0
  25753. ],
  25754. prefixes: null,
  25755. dotRe: /\./g,
  25756. wildcardRe: /\*/g,
  25757. addAlias: function(className, alias, update) {
  25758. return this.addMapping(className, alias, this.aliasToName, this.nameToAliases, update);
  25759. },
  25760. addAlternate: function(className, alternate) {
  25761. return this.addMapping(className, alternate, this.alternateToName, this.nameToAlternates);
  25762. },
  25763. addMapping: function(className, alternate, toName, nameTo, update) {
  25764. var name = className.$className || className,
  25765. mappings = name,
  25766. array = this._array1,
  25767. a, aliases, cls, i, length, nameMapping;
  25768. if (Ext.isString(name)) {
  25769. mappings = {};
  25770. mappings[name] = alternate;
  25771. }
  25772. for (cls in mappings) {
  25773. aliases = mappings[cls];
  25774. if (Ext.isString(aliases)) {
  25775. array[0] = aliases;
  25776. aliases = array;
  25777. }
  25778. length = aliases.length;
  25779. nameMapping = nameTo[cls] || (nameTo[cls] = []);
  25780. for (i = 0; i < length; ++i) {
  25781. if (!(a = aliases[i])) {
  25782. continue;
  25783. }
  25784. if (toName[a] !== cls) {
  25785. if (!update && toName[a] && ('Ext.Gadget' !== a)) {
  25786. Ext.log.warn("Overriding existing mapping: '" + a + "' From '" + toName[a] + "' to '" + cls + "'. Is this intentional?");
  25787. }
  25788. toName[a] = cls;
  25789. nameMapping.push(a);
  25790. }
  25791. }
  25792. }
  25793. },
  25794. /**
  25795. * Get the aliases of a class by the class name
  25796. *
  25797. * @param {String} name
  25798. * @return {Array} aliases
  25799. */
  25800. getAliasesByName: function(name) {
  25801. return this.nameToAliases[name] || null;
  25802. },
  25803. getAlternatesByName: function(name) {
  25804. return this.nameToAlternates[name] || null;
  25805. },
  25806. /**
  25807. * Get the name of a class by its alias.
  25808. *
  25809. * @param {String} alias
  25810. * @return {String} className
  25811. */
  25812. getNameByAlias: function(alias) {
  25813. return this.aliasToName[alias] || '';
  25814. },
  25815. /**
  25816. * Get the name of a class by its alternate name.
  25817. *
  25818. * @param {String} alternate
  25819. * @return {String} className
  25820. */
  25821. getNameByAlternate: function(alternate) {
  25822. return this.alternateToName[alternate] || '';
  25823. },
  25824. /**
  25825. * Converts a string expression to an array of matching class names. An expression can
  25826. * either refers to class aliases or class names. Expressions support wildcards:
  25827. *
  25828. * // returns ['Ext.window.Window']
  25829. * var window = Ext.ClassManager.getNamesByExpression('widget.window');
  25830. *
  25831. * // returns ['widget.panel', 'widget.window', ...]
  25832. * var allWidgets = Ext.ClassManager.getNamesByExpression('widget.*');
  25833. *
  25834. * // returns ['Ext.data.Store', 'Ext.data.ArrayProxy', ...]
  25835. * var allData = Ext.ClassManager.getNamesByExpression('Ext.data.*');
  25836. *
  25837. * @param {String/String[]} expression
  25838. * @param {Object} [exclude=null] An object keyed by class name containing classes to
  25839. * exclude from the returned classes. This must be provided if `accumulate` is set to
  25840. * `true`.
  25841. * @param {Boolean} [accumulate=false] Pass `true` to add matching classes to the
  25842. * specified `exclude` object.
  25843. * @return {String[]} An array of class names.
  25844. */
  25845. getNamesByExpression: function(expression, exclude, accumulate) {
  25846. var me = this,
  25847. aliasToName = me.aliasToName,
  25848. alternateToName = me.alternateToName,
  25849. nameToAliases = me.nameToAliases,
  25850. nameToAlternates = me.nameToAlternates,
  25851. map = accumulate ? exclude : {},
  25852. names = [],
  25853. expressions = Ext.isString(expression) ? [
  25854. expression
  25855. ] : expression,
  25856. length = expressions.length,
  25857. wildcardRe = me.wildcardRe,
  25858. expr, i, list, match, n, name, regex;
  25859. for (i = 0; i < length; ++i) {
  25860. if ((expr = expressions[i]).indexOf('*') < 0) {
  25861. // No wildcard
  25862. if (!(name = aliasToName[expr])) {
  25863. if (!(name = alternateToName[expr])) {
  25864. name = expr;
  25865. }
  25866. }
  25867. if (!(name in map) && !(exclude && (name in exclude))) {
  25868. map[name] = 1;
  25869. names.push(name);
  25870. }
  25871. } else {
  25872. regex = new RegExp('^' + expr.replace(wildcardRe, '(.*?)') + '$');
  25873. for (name in nameToAliases) {
  25874. if (!(name in map) && !(exclude && (name in exclude))) {
  25875. if (!(match = regex.test(name))) {
  25876. n = (list = nameToAliases[name]).length;
  25877. while (!match && n-- > 0) {
  25878. match = regex.test(list[n]);
  25879. }
  25880. list = nameToAlternates[name];
  25881. if (list && !match) {
  25882. n = list.length;
  25883. while (!match && n-- > 0) {
  25884. match = regex.test(list[n]);
  25885. }
  25886. }
  25887. }
  25888. if (match) {
  25889. map[name] = 1;
  25890. names.push(name);
  25891. }
  25892. }
  25893. }
  25894. }
  25895. }
  25896. return names;
  25897. },
  25898. getPath: function(className) {
  25899. var me = this,
  25900. paths = me.paths,
  25901. ret = '',
  25902. prefix;
  25903. if (className in paths) {
  25904. ret = paths[className];
  25905. } else {
  25906. prefix = me.nameToPrefix[className] || (me.nameToPrefix[className] = me.getPrefix(className));
  25907. if (prefix) {
  25908. className = className.substring(prefix.length + 1);
  25909. ret = paths[prefix];
  25910. if (ret) {
  25911. ret += '/';
  25912. }
  25913. }
  25914. ret += className.replace(me.dotRe, '/') + '.js';
  25915. }
  25916. return ret;
  25917. },
  25918. getPrefix: function(className) {
  25919. if (className in this.paths) {
  25920. return className;
  25921. } else if (className in this.nameToPrefix) {
  25922. return this.nameToPrefix[className];
  25923. }
  25924. var prefixes = this.getPrefixes(),
  25925. length = className.length,
  25926. items, currChar, currSubstr, prefix, j, jlen;
  25927. // Walk the prefixes backwards so we consider the longest ones first.
  25928. // Prefixes are kept in a sparse array grouped by length so we don't have to
  25929. // iterate over all of them, just the ones we need.
  25930. while (length-- > 0) {
  25931. items = prefixes[length];
  25932. if (items) {
  25933. currChar = className.charAt(length);
  25934. if (currChar !== '.') {
  25935. continue;
  25936. }
  25937. currSubstr = className.substring(0, length);
  25938. for (j = 0 , jlen = items.length; j < jlen; j++) {
  25939. prefix = items[j];
  25940. if (prefix === className.substring(0, length)) {
  25941. return prefix;
  25942. }
  25943. }
  25944. }
  25945. }
  25946. return '';
  25947. },
  25948. getPrefixes: function() {
  25949. var me = this,
  25950. prefixes = me.prefixes,
  25951. names, name, nameLength, items, i, len;
  25952. if (!prefixes) {
  25953. names = me.names.slice(0);
  25954. me.prefixes = prefixes = [];
  25955. for (i = 0 , len = names.length; i < len; i++) {
  25956. name = names[i];
  25957. nameLength = name.length;
  25958. items = prefixes[nameLength] || (prefixes[nameLength] = []);
  25959. items.push(name);
  25960. }
  25961. }
  25962. return prefixes;
  25963. },
  25964. removeName: function(name) {
  25965. var me = this,
  25966. aliasToName = me.aliasToName,
  25967. alternateToName = me.alternateToName,
  25968. nameToAliases = me.nameToAliases,
  25969. nameToAlternates = me.nameToAlternates,
  25970. aliases = nameToAliases[name],
  25971. alternates = nameToAlternates[name],
  25972. i, a;
  25973. delete nameToAliases[name];
  25974. delete nameToAlternates[name];
  25975. delete me.nameToPrefix[name];
  25976. if (aliases) {
  25977. for (i = aliases.length; i--; ) {
  25978. // Aliases can be reassigned so if this class is the current mapping of
  25979. // the alias, remove it. Since there is no chain to restore what was
  25980. // removed this is not perfect.
  25981. if (name === aliasToName[a = aliases[i]]) {
  25982. delete aliasToName[a];
  25983. }
  25984. }
  25985. }
  25986. if (alternates) {
  25987. for (i = alternates.length; i--; ) {
  25988. // Like aliases, alternate class names can also be remapped.
  25989. if (name === alternateToName[a = alternates[i]]) {
  25990. delete alternateToName[a];
  25991. }
  25992. }
  25993. }
  25994. },
  25995. resolveName: function(name) {
  25996. var me = this,
  25997. trueName;
  25998. // If the name has a registered alias, it is a true className (not an alternate)
  25999. // so we can stop now.
  26000. if (!(name in me.nameToAliases)) {
  26001. // The name is not a known class name, so check to see if it is a known alias:
  26002. if (!(trueName = me.aliasToName[name])) {
  26003. // The name does not correspond to a known alias, so check if it is a known
  26004. // alternateClassName:
  26005. trueName = me.alternateToName[name];
  26006. }
  26007. }
  26008. return trueName || name;
  26009. },
  26010. /**
  26011. * This method returns a selector object that produces a selection of classes and
  26012. * delivers them to the desired `receiver`.
  26013. *
  26014. * The returned selector object has the same methods as the given `receiver` object
  26015. * but these methods on the selector accept a first argument that expects a pattern
  26016. * or array of patterns. The actual method on the `receiver` will be called with an
  26017. * array of classes that match these patterns but with any patterns passed to an
  26018. * `exclude` call removed.
  26019. *
  26020. * For example:
  26021. *
  26022. * var sel = inventory.select({
  26023. * require: function (classes) {
  26024. * console.log('Classes: ' + classes.join(','));
  26025. * }
  26026. * });
  26027. *
  26028. * sel.exclude('Ext.chart.*').exclude('Ext.draw.*').require('*');
  26029. *
  26030. * // Logs all classes except those in the Ext.chart and Ext.draw namespaces.
  26031. *
  26032. * @param {Object} receiver
  26033. * @param {Object} [scope] Optional scope to use when calling `receiver` methods.
  26034. * @return {Object} An object with the same methods as `receiver` plus `exclude`.
  26035. */
  26036. select: function(receiver, scope) {
  26037. var me = this,
  26038. excludes = {},
  26039. ret = {
  26040. excludes: excludes,
  26041. exclude: function() {
  26042. me.getNamesByExpression(arguments[0], excludes, true);
  26043. return this;
  26044. }
  26045. },
  26046. name;
  26047. for (name in receiver) {
  26048. ret[name] = me.selectMethod(excludes, receiver[name], scope || receiver);
  26049. }
  26050. return ret;
  26051. },
  26052. selectMethod: function(excludes, fn, scope) {
  26053. var me = this;
  26054. return function(include) {
  26055. var args = Ext.Array.slice(arguments, 1);
  26056. args.unshift(me.getNamesByExpression(include, excludes));
  26057. return fn.apply(scope, args);
  26058. };
  26059. },
  26060. /**
  26061. * Sets the path of a namespace.
  26062. * For Example:
  26063. *
  26064. * inventory.setPath('Ext', '.');
  26065. * inventory.setPath({
  26066. * Ext: '.'
  26067. * });
  26068. *
  26069. * @param {String/Object} name The name of a single mapping or an object of mappings.
  26070. * @param {String} [path] If `name` is a String, then this is the path for that name.
  26071. * Otherwise this parameter is ignored.
  26072. * @return {Ext.Inventory} this
  26073. * @method
  26074. */
  26075. setPath: Ext.Function.flexSetter(function(name, path) {
  26076. var me = this;
  26077. me.paths[name] = path;
  26078. me.names.push(name);
  26079. me.prefixes = null;
  26080. me.nameToPrefix = {};
  26081. return me;
  26082. })
  26083. };
  26084. // @tag class
  26085. /**
  26086. * @class Ext.ClassManager
  26087. *
  26088. * Ext.ClassManager manages all classes and handles mapping from string class name to
  26089. * actual class objects throughout the whole framework. It is not generally accessed directly, rather through
  26090. * these convenient shorthands:
  26091. *
  26092. * - {@link Ext#define Ext.define}
  26093. * - {@link Ext#method!create Ext.create}
  26094. * - {@link Ext#widget Ext.widget}
  26095. * - {@link Ext#getClass Ext.getClass}
  26096. * - {@link Ext#getClassName Ext.getClassName}
  26097. *
  26098. * # Basic syntax:
  26099. *
  26100. * Ext.define(className, properties);
  26101. *
  26102. * in which `properties` is an object represent a collection of properties that apply to the class. See
  26103. * {@link Ext.ClassManager#method!create} for more detailed instructions.
  26104. *
  26105. * Ext.define('Person', {
  26106. * name: 'Unknown',
  26107. *
  26108. * constructor: function(name) {
  26109. * if (name) {
  26110. * this.name = name;
  26111. * }
  26112. * },
  26113. *
  26114. * eat: function(foodType) {
  26115. * alert("I'm eating: " + foodType);
  26116. *
  26117. * return this;
  26118. * }
  26119. * });
  26120. *
  26121. * var aaron = new Person("Aaron");
  26122. * aaron.eat("Sandwich"); // alert("I'm eating: Sandwich");
  26123. *
  26124. * Ext.Class has a powerful set of extensible {@link Ext.Class#registerPreprocessor pre-processors} which takes care of
  26125. * everything related to class creation, including but not limited to inheritance, mixins, configuration, statics, etc.
  26126. *
  26127. * # Inheritance:
  26128. *
  26129. * Ext.define('Developer', {
  26130. * extend: 'Person',
  26131. *
  26132. * constructor: function(name, isGeek) {
  26133. * this.isGeek = isGeek;
  26134. *
  26135. * // Apply a method from the parent class' prototype
  26136. * this.callParent([name]);
  26137. * },
  26138. *
  26139. * code: function(language) {
  26140. * alert("I'm coding in: " + language);
  26141. *
  26142. * this.eat("Bugs");
  26143. *
  26144. * return this;
  26145. * }
  26146. * });
  26147. *
  26148. * var jacky = new Developer("Jacky", true);
  26149. * jacky.code("JavaScript"); // alert("I'm coding in: JavaScript");
  26150. * // alert("I'm eating: Bugs");
  26151. *
  26152. * See {@link Ext.Base#method!callParent} for more details on calling superclass' methods
  26153. *
  26154. * # Mixins:
  26155. *
  26156. * Ext.define('CanPlayGuitar', {
  26157. * playGuitar: function() {
  26158. * alert("F#...G...D...A");
  26159. * }
  26160. * });
  26161. *
  26162. * Ext.define('CanComposeSongs', {
  26163. * composeSongs: function() { ... }
  26164. * });
  26165. *
  26166. * Ext.define('CanSing', {
  26167. * sing: function() {
  26168. * alert("For he's a jolly good fellow...")
  26169. * }
  26170. * });
  26171. *
  26172. * Ext.define('Musician', {
  26173. * extend: 'Person',
  26174. *
  26175. * mixins: {
  26176. * canPlayGuitar: 'CanPlayGuitar',
  26177. * canComposeSongs: 'CanComposeSongs',
  26178. * canSing: 'CanSing'
  26179. * }
  26180. * })
  26181. *
  26182. * Ext.define('CoolPerson', {
  26183. * extend: 'Person',
  26184. *
  26185. * mixins: {
  26186. * canPlayGuitar: 'CanPlayGuitar',
  26187. * canSing: 'CanSing'
  26188. * },
  26189. *
  26190. * sing: function() {
  26191. * alert("Ahem....");
  26192. *
  26193. * this.mixins.canSing.sing.call(this);
  26194. *
  26195. * alert("[Playing guitar at the same time...]");
  26196. *
  26197. * this.playGuitar();
  26198. * }
  26199. * });
  26200. *
  26201. * var me = new CoolPerson("Jacky");
  26202. *
  26203. * me.sing(); // alert("Ahem...");
  26204. * // alert("For he's a jolly good fellow...");
  26205. * // alert("[Playing guitar at the same time...]");
  26206. * // alert("F#...G...D...A");
  26207. *
  26208. * # Config:
  26209. *
  26210. * Ext.define('SmartPhone', {
  26211. * config: {
  26212. * hasTouchScreen: false,
  26213. * operatingSystem: 'Other',
  26214. * price: 500
  26215. * },
  26216. *
  26217. * isExpensive: false,
  26218. *
  26219. * constructor: function(config) {
  26220. * this.initConfig(config);
  26221. * },
  26222. *
  26223. * applyPrice: function(price) {
  26224. * this.isExpensive = (price > 500);
  26225. *
  26226. * return price;
  26227. * },
  26228. *
  26229. * applyOperatingSystem: function(operatingSystem) {
  26230. * if (!(/^(iOS|Android|BlackBerry)$/i).test(operatingSystem)) {
  26231. * return 'Other';
  26232. * }
  26233. *
  26234. * return operatingSystem;
  26235. * }
  26236. * });
  26237. *
  26238. * var iPhone = new SmartPhone({
  26239. * hasTouchScreen: true,
  26240. * operatingSystem: 'iOS'
  26241. * });
  26242. *
  26243. * iPhone.getPrice(); // 500;
  26244. * iPhone.getOperatingSystem(); // 'iOS'
  26245. * iPhone.getHasTouchScreen(); // true;
  26246. *
  26247. * iPhone.isExpensive; // false;
  26248. * iPhone.setPrice(600);
  26249. * iPhone.getPrice(); // 600
  26250. * iPhone.isExpensive; // true;
  26251. *
  26252. * iPhone.setOperatingSystem('AlienOS');
  26253. * iPhone.getOperatingSystem(); // 'Other'
  26254. *
  26255. * # Statics:
  26256. *
  26257. * Ext.define('Computer', {
  26258. * statics: {
  26259. * factory: function(brand) {
  26260. * // 'this' in static methods refer to the class itself
  26261. * return new this(brand);
  26262. * }
  26263. * },
  26264. *
  26265. * constructor: function() { ... }
  26266. * });
  26267. *
  26268. * var dellComputer = Computer.factory('Dell');
  26269. *
  26270. * Also see {@link Ext.Base#statics} and {@link Ext.Base#self} for more details on accessing
  26271. * static properties within class methods
  26272. *
  26273. * @singleton
  26274. */
  26275. Ext.ClassManager = (function(Class, alias, arraySlice, arrayFrom, global) {
  26276. // @define Ext.ClassManager
  26277. // @require Ext.Inventory
  26278. // @require Ext.Class
  26279. // @require Ext.Function
  26280. // @require Ext.Array
  26281. var makeCtor = Ext.Class.makeCtor,
  26282. nameLookupStack = [],
  26283. namespaceCache = {
  26284. Ext: {
  26285. name: 'Ext',
  26286. value: Ext
  26287. }
  26288. },
  26289. // specially added for sandbox (Ext === global.Ext6)
  26290. /*
  26291. 'Ext.grid': {
  26292. name: 'grid',
  26293. parent: namespaceCache['Ext']
  26294. },
  26295. 'Ext.grid.Panel': {
  26296. name: 'Panel',
  26297. parent: namespaceCache['Ext.grid']
  26298. },
  26299. ...
  26300. Also,
  26301. 'MyApp': {
  26302. name: 'MyApp',
  26303. value: MyApp
  26304. }
  26305. */
  26306. Manager = Ext.apply(new Ext.Inventory(), {
  26307. /**
  26308. * @property {Object} classes
  26309. * All classes which were defined through the ClassManager. Keys are the
  26310. * name of the classes and the values are references to the classes.
  26311. * @private
  26312. */
  26313. classes: {},
  26314. classCount: 0,
  26315. classState: {},
  26316. /*
  26317. * 'Ext.foo.Bar': <state enum>
  26318. *
  26319. * 10 = Ext.define called
  26320. * 20 = Ext.define/override called
  26321. * 30 = Manager.existCache[<name>] == true for define
  26322. * 40 = Manager.existCache[<name>] == true for define/override
  26323. * 50 = Manager.isCreated(<name>) == true for define
  26324. * 60 = Manager.isCreated(<name>) == true for define/override
  26325. *
  26326. */
  26327. /**
  26328. * @private
  26329. */
  26330. existCache: {},
  26331. /** @private */
  26332. instantiators: [],
  26333. /**
  26334. * Checks if a class has already been created.
  26335. *
  26336. * @param {String} className
  26337. * @return {Boolean} exist
  26338. */
  26339. isCreated: function(className) {
  26340. if (typeof className !== 'string' || className.length < 1) {
  26341. throw new Error("[Ext.ClassManager] Invalid classname, must be a string and must not be empty");
  26342. }
  26343. if (Manager.classes[className] || Manager.existCache[className]) {
  26344. return true;
  26345. }
  26346. if (!Manager.lookupName(className, false)) {
  26347. return false;
  26348. }
  26349. Manager.triggerCreated(className);
  26350. return true;
  26351. },
  26352. /**
  26353. * @private
  26354. */
  26355. createdListeners: [],
  26356. /**
  26357. * @private
  26358. */
  26359. nameCreatedListeners: {},
  26360. /**
  26361. * @private
  26362. */
  26363. existsListeners: [],
  26364. /**
  26365. * @private
  26366. */
  26367. nameExistsListeners: {},
  26368. /**
  26369. * @private
  26370. */
  26371. overrideMap: {},
  26372. /**
  26373. * @private
  26374. */
  26375. triggerCreated: function(className, state) {
  26376. Manager.existCache[className] = state || 1;
  26377. Manager.classState[className] += 40;
  26378. Manager.notify(className, Manager.createdListeners, Manager.nameCreatedListeners);
  26379. },
  26380. /**
  26381. * @private
  26382. */
  26383. onCreated: function(fn, scope, className) {
  26384. Manager.addListener(fn, scope, className, Manager.createdListeners, Manager.nameCreatedListeners);
  26385. },
  26386. /**
  26387. * @private
  26388. */
  26389. notify: function(className, listeners, nameListeners) {
  26390. var alternateNames = Manager.getAlternatesByName(className),
  26391. names = [
  26392. className
  26393. ],
  26394. i, ln, j, subLn, listener, name;
  26395. for (i = 0 , ln = listeners.length; i < ln; i++) {
  26396. listener = listeners[i];
  26397. listener.fn.call(listener.scope, className);
  26398. }
  26399. while (names) {
  26400. for (i = 0 , ln = names.length; i < ln; i++) {
  26401. name = names[i];
  26402. listeners = nameListeners[name];
  26403. if (listeners) {
  26404. for (j = 0 , subLn = listeners.length; j < subLn; j++) {
  26405. listener = listeners[j];
  26406. listener.fn.call(listener.scope, name);
  26407. }
  26408. delete nameListeners[name];
  26409. }
  26410. }
  26411. names = alternateNames;
  26412. // for 2nd pass (if needed)
  26413. alternateNames = null;
  26414. }
  26415. },
  26416. // no 3rd pass
  26417. /**
  26418. * @private
  26419. */
  26420. addListener: function(fn, scope, className, listeners, nameListeners) {
  26421. if (Ext.isArray(className)) {
  26422. fn = Ext.Function.createBarrier(className.length, fn, scope);
  26423. for (i = 0; i < className.length; i++) {
  26424. this.addListener(fn, null, className[i], listeners, nameListeners);
  26425. }
  26426. return;
  26427. }
  26428. var i,
  26429. listener = {
  26430. fn: fn,
  26431. scope: scope
  26432. };
  26433. if (className) {
  26434. if (this.isCreated(className)) {
  26435. fn.call(scope, className);
  26436. return;
  26437. }
  26438. if (!nameListeners[className]) {
  26439. nameListeners[className] = [];
  26440. }
  26441. nameListeners[className].push(listener);
  26442. } else {
  26443. listeners.push(listener);
  26444. }
  26445. },
  26446. /**
  26447. * Supports namespace rewriting.
  26448. * @private
  26449. */
  26450. $namespaceCache: namespaceCache,
  26451. /**
  26452. * See `{@link Ext#addRootNamespaces Ext.addRootNamespaces}`.
  26453. * @since 6.0.0
  26454. * @private
  26455. */
  26456. addRootNamespaces: function(namespaces) {
  26457. for (var name in namespaces) {
  26458. namespaceCache[name] = {
  26459. name: name,
  26460. value: namespaces[name]
  26461. };
  26462. }
  26463. },
  26464. /**
  26465. * Clears the namespace lookup cache. After application launch, this cache can
  26466. * often contain several hundred entries that are unlikely to be needed again.
  26467. * These will be rebuilt as needed, so it is harmless to clear this cache even
  26468. * if its results will be used again.
  26469. * @since 6.0.0
  26470. * @private
  26471. */
  26472. clearNamespaceCache: function() {
  26473. nameLookupStack.length = 0;
  26474. for (var name in namespaceCache) {
  26475. if (!namespaceCache[name].value) {
  26476. delete namespaceCache[name];
  26477. }
  26478. }
  26479. },
  26480. /**
  26481. * Return the namespace cache entry for the given a class name or namespace (e.g.,
  26482. * "Ext.grid.Panel").
  26483. *
  26484. * @param {String} namespace The namespace or class name to lookup.
  26485. * @return {Object} The cache entry.
  26486. * @return {String} return.name The leaf name ("Panel" for "Ext.grid.Panel").
  26487. * @return {Object} return.parent The entry of the parent namespace (i.e., "Ext.grid").
  26488. * @return {Object} return.value The namespace object. This is only set for
  26489. * top-level namespace entries to support renaming them for sandboxing ("Ext6" vs
  26490. * "Ext").
  26491. * @since 6.0.0
  26492. * @private
  26493. */
  26494. getNamespaceEntry: function(namespace) {
  26495. if (typeof namespace !== 'string') {
  26496. return namespace;
  26497. }
  26498. // assume we've been given an entry object
  26499. var entry = namespaceCache[namespace],
  26500. i;
  26501. if (!entry) {
  26502. i = namespace.lastIndexOf('.');
  26503. if (i < 0) {
  26504. entry = {
  26505. name: namespace
  26506. };
  26507. } else {
  26508. entry = {
  26509. name: namespace.substring(i + 1),
  26510. parent: Manager.getNamespaceEntry(namespace.substring(0, i))
  26511. };
  26512. }
  26513. namespaceCache[namespace] = entry;
  26514. }
  26515. return entry;
  26516. },
  26517. /**
  26518. * Return the value of the given "dot path" name. This supports remapping (for use
  26519. * in sandbox builds) as well as auto-creating of namespaces.
  26520. *
  26521. * @param {String} namespace The name of the namespace or class.
  26522. * @param {Boolean} [autoCreate] Pass `true` to create objects for undefined names.
  26523. * @return {Object} The object that is the namespace or class name.
  26524. * @since 6.0.0
  26525. * @private
  26526. */
  26527. lookupName: function(namespace, autoCreate) {
  26528. var entry = Manager.getNamespaceEntry(namespace),
  26529. scope = Ext.global,
  26530. i = 0,
  26531. e, parent;
  26532. // Put entries on the stack in reverse order: [ 'Panel', 'grid', 'Ext' ]
  26533. for (e = entry; e; e = e.parent) {
  26534. // since we process only what we add to the array, and that always
  26535. // starts at index=0, we don't need to clean up the array (that would
  26536. // just encourage the GC to do something pointless).
  26537. nameLookupStack[i++] = e;
  26538. }
  26539. while (scope && i-- > 0) {
  26540. // We'll process entries in top-down order ('Ext', 'grid' then 'Panel').
  26541. e = nameLookupStack[i];
  26542. parent = scope;
  26543. scope = e.value || scope[e.name];
  26544. if (!scope && autoCreate) {
  26545. parent[e.name] = scope = {};
  26546. }
  26547. }
  26548. return scope;
  26549. },
  26550. /**
  26551. * Creates a namespace and assign the `value` to the created object.
  26552. *
  26553. * Ext.ClassManager.setNamespace('MyCompany.pkg.Example', someObject);
  26554. *
  26555. * alert(MyCompany.pkg.Example === someObject); // alerts true
  26556. *
  26557. * @param {String} namespace
  26558. * @param {Object} value
  26559. */
  26560. setNamespace: function(namespace, value) {
  26561. var entry = Manager.getNamespaceEntry(namespace),
  26562. scope = Ext.global;
  26563. if (entry.parent) {
  26564. scope = Manager.lookupName(entry.parent, true);
  26565. }
  26566. scope[entry.name] = value;
  26567. return value;
  26568. },
  26569. /**
  26570. * Changes the mapping of an `xtype` to map to the specified component class.
  26571. * @param {String/Ext.Class} cls The class or class name to which `xtype` is mapped.
  26572. * @param {String} xtype The `xtype` to map or redefine as `cls`.
  26573. * @since 6.0.1
  26574. * @private
  26575. */
  26576. setXType: function(cls, xtype) {
  26577. var className = cls.$className,
  26578. C = className ? cls : Manager.get(className = cls),
  26579. proto = C.prototype,
  26580. xtypes = proto.xtypes,
  26581. xtypesChain = proto.xtypesChain,
  26582. xtypesMap = proto.xtypesMap;
  26583. if (!proto.hasOwnProperty('xtypes')) {
  26584. proto.xtypes = xtypes = [];
  26585. proto.xtypesChain = xtypesChain = xtypesChain ? xtypesChain.slice(0) : [];
  26586. proto.xtypesMap = xtypesMap = Ext.apply({}, xtypesMap);
  26587. }
  26588. Manager.addAlias(className, 'widget.' + xtype, true);
  26589. xtypes.push(xtype);
  26590. xtypesChain.push(xtype);
  26591. xtypesMap[xtype] = true;
  26592. },
  26593. //TODO consider updating derived class xtypesChain / xtypesMap
  26594. /**
  26595. * Sets a name reference to a class.
  26596. *
  26597. * @param {String} name
  26598. * @param {Object} value
  26599. * @return {Ext.ClassManager} this
  26600. */
  26601. set: function(name, value) {
  26602. var targetName = Manager.getName(value);
  26603. Manager.classes[name] = Manager.setNamespace(name, value);
  26604. Manager.classCount++;
  26605. if (targetName && targetName !== name) {
  26606. Manager.addAlternate(targetName, name);
  26607. }
  26608. return Manager;
  26609. },
  26610. /**
  26611. * Retrieve a class by its name.
  26612. *
  26613. * @param {String} name
  26614. * @return {Ext.Class} class
  26615. */
  26616. get: function(name) {
  26617. return Manager.classes[name] || Manager.lookupName(name, false);
  26618. },
  26619. /**
  26620. * Adds a batch of class name to alias mappings.
  26621. * @param {Object} aliases The set of mappings of the form.
  26622. * className : [values...]
  26623. */
  26624. addNameAliasMappings: function(aliases) {
  26625. Manager.addAlias(aliases);
  26626. },
  26627. /**
  26628. *
  26629. * @param {Object} alternates The set of mappings of the form
  26630. * className : [values...]
  26631. */
  26632. addNameAlternateMappings: function(alternates) {
  26633. Manager.addAlternate(alternates);
  26634. },
  26635. /**
  26636. * Get a reference to the class by its alias.
  26637. *
  26638. * @param {String} alias
  26639. * @return {Ext.Class} class
  26640. */
  26641. getByAlias: function(alias) {
  26642. return Manager.get(Manager.getNameByAlias(alias));
  26643. },
  26644. /**
  26645. * Get a component class name from a config object.
  26646. * @param {Object} config The config object.
  26647. * @param {String} [aliasPrefix] A prefix to use when getting
  26648. * a class name by alias.
  26649. * @return {Ext.Class} The class.
  26650. *
  26651. * @private
  26652. */
  26653. getByConfig: function(config, aliasPrefix) {
  26654. var xclass = config.xclass,
  26655. name;
  26656. if (xclass) {
  26657. name = xclass;
  26658. } else {
  26659. name = config.xtype;
  26660. if (name) {
  26661. aliasPrefix = 'widget.';
  26662. } else {
  26663. name = config.type;
  26664. }
  26665. name = Manager.getNameByAlias(aliasPrefix + name);
  26666. }
  26667. return Manager.get(name);
  26668. },
  26669. /**
  26670. * Get the name of the class by its reference or its instance. This is
  26671. * usually invoked by the shorthand {@link Ext#getClassName}.
  26672. *
  26673. * Ext.ClassManager.getName(Ext.Action); // returns "Ext.Action"
  26674. *
  26675. * @param {Ext.Class/Object} object
  26676. * @return {String} className
  26677. */
  26678. getName: function(object) {
  26679. return object && object.$className || '';
  26680. },
  26681. /**
  26682. * Get the class of the provided object; returns null if it's not an instance
  26683. * of any class created with Ext.define. This is usually invoked by the
  26684. * shorthand {@link Ext#getClass}.
  26685. *
  26686. * var component = new Ext.Component();
  26687. *
  26688. * Ext.getClass(component); // returns Ext.Component
  26689. *
  26690. * @param {Object} object
  26691. * @return {Ext.Class} class
  26692. */
  26693. getClass: function(object) {
  26694. return object && object.self || null;
  26695. },
  26696. /**
  26697. * Defines a class.
  26698. * @deprecated 4.1 Use {@link Ext#define} instead.
  26699. * @private
  26700. */
  26701. create: function(className, data, createdFn) {
  26702. if (className != null && typeof className !== 'string') {
  26703. throw new Error("[Ext.define] Invalid class name '" + className + "' specified, must be a non-empty string");
  26704. }
  26705. var ctor = makeCtor(className);
  26706. if (typeof data === 'function') {
  26707. data = data(ctor);
  26708. }
  26709. if (className) {
  26710. if (Manager.classes[className]) {
  26711. Ext.log.warn("[Ext.define] Duplicate class name '" + className + "' specified, must be a non-empty string");
  26712. }
  26713. ctor.name = className;
  26714. }
  26715. data.$className = className;
  26716. return new Class(ctor, data, function() {
  26717. var postprocessorStack = data.postprocessors || Manager.defaultPostprocessors,
  26718. registeredPostprocessors = Manager.postprocessors,
  26719. postprocessors = [],
  26720. postprocessor, i, ln, j, subLn, postprocessorProperties, postprocessorProperty;
  26721. delete data.postprocessors;
  26722. for (i = 0 , ln = postprocessorStack.length; i < ln; i++) {
  26723. postprocessor = postprocessorStack[i];
  26724. if (typeof postprocessor === 'string') {
  26725. postprocessor = registeredPostprocessors[postprocessor];
  26726. postprocessorProperties = postprocessor.properties;
  26727. if (postprocessorProperties === true) {
  26728. postprocessors.push(postprocessor.fn);
  26729. } else if (postprocessorProperties) {
  26730. for (j = 0 , subLn = postprocessorProperties.length; j < subLn; j++) {
  26731. postprocessorProperty = postprocessorProperties[j];
  26732. if (data.hasOwnProperty(postprocessorProperty)) {
  26733. postprocessors.push(postprocessor.fn);
  26734. break;
  26735. }
  26736. }
  26737. }
  26738. } else {
  26739. postprocessors.push(postprocessor);
  26740. }
  26741. }
  26742. data.postprocessors = postprocessors;
  26743. data.createdFn = createdFn;
  26744. Manager.processCreate(className, this, data);
  26745. });
  26746. },
  26747. processCreate: function(className, cls, clsData) {
  26748. var me = this,
  26749. postprocessor = clsData.postprocessors.shift(),
  26750. createdFn = clsData.createdFn;
  26751. if (!postprocessor) {
  26752. Ext.classSystemMonitor && Ext.classSystemMonitor(className, 'Ext.ClassManager#classCreated', arguments);
  26753. if (className) {
  26754. me.set(className, cls);
  26755. }
  26756. delete cls._classHooks;
  26757. if (createdFn) {
  26758. createdFn.call(cls, cls);
  26759. }
  26760. if (className) {
  26761. me.triggerCreated(className);
  26762. }
  26763. return;
  26764. }
  26765. if (postprocessor.call(me, className, cls, clsData, me.processCreate) !== false) {
  26766. me.processCreate(className, cls, clsData);
  26767. }
  26768. },
  26769. createOverride: function(className, data, createdFn) {
  26770. var me = this,
  26771. overriddenClassName = data.override,
  26772. requires = data.requires,
  26773. uses = data.uses,
  26774. mixins = data.mixins,
  26775. mixinsIsArray,
  26776. compat = 1,
  26777. // default if 'compatibility' is not specified
  26778. dependenciesLoaded,
  26779. classReady = function() {
  26780. var cls, dependencies, i, key, temp;
  26781. if (!dependenciesLoaded) {
  26782. dependencies = requires ? requires.slice(0) : [];
  26783. if (mixins) {
  26784. if (!(mixinsIsArray = mixins instanceof Array)) {
  26785. for (key in mixins) {
  26786. if (Ext.isString(cls = mixins[key])) {
  26787. dependencies.push(cls);
  26788. }
  26789. }
  26790. } else {
  26791. for (i = 0 , temp = mixins.length; i < temp; ++i) {
  26792. if (Ext.isString(cls = mixins[i])) {
  26793. dependencies.push(cls);
  26794. }
  26795. }
  26796. }
  26797. }
  26798. dependenciesLoaded = true;
  26799. if (dependencies.length) {
  26800. // Since the override is going to be used (its target class is
  26801. // now created), we need to fetch the required classes for the
  26802. // override and call us back once they are loaded:
  26803. Ext.require(dependencies, classReady);
  26804. return;
  26805. }
  26806. }
  26807. // else we have no dependencies, so proceed
  26808. // transform mixin class names into class references, This
  26809. // loop can handle both the array and object forms of
  26810. // mixin definitions
  26811. if (mixinsIsArray) {
  26812. for (i = 0 , temp = mixins.length; i < temp; ++i) {
  26813. if (Ext.isString(cls = mixins[i])) {
  26814. mixins[i] = Ext.ClassManager.get(cls);
  26815. }
  26816. }
  26817. } else if (mixins) {
  26818. for (key in mixins) {
  26819. if (Ext.isString(cls = mixins[key])) {
  26820. mixins[key] = Ext.ClassManager.get(cls);
  26821. }
  26822. }
  26823. }
  26824. // The target class and the required classes for this override are
  26825. // ready, so we can apply the override now:
  26826. cls = overriddenClassName.$isClass ? overriddenClassName : me.get(overriddenClassName);
  26827. // We don't want to apply these:
  26828. delete data.override;
  26829. delete data.compatibility;
  26830. delete data.requires;
  26831. delete data.uses;
  26832. Ext.override(cls, data);
  26833. // This pushes the overriding file itself into Ext.Loader.history
  26834. // Hence if the target class never exists, the overriding file will
  26835. // never be included in the build.
  26836. Ext.Loader.history.push(className);
  26837. if (uses) {
  26838. // This "hides" from the Cmd auto-dependency scanner since
  26839. // the reference is circular (Loader requires us).
  26840. Ext['Loader'].addUsedClasses(uses);
  26841. }
  26842. // get these classes too!
  26843. if (createdFn) {
  26844. createdFn.call(cls, cls);
  26845. }
  26846. };
  26847. // last but not least!
  26848. if (className) {
  26849. Manager.overrideMap[className] = true;
  26850. }
  26851. // If specified, parse strings as versions, but otherwise treat as a
  26852. // boolean (maybe "compatibility: Ext.isIE8" or something).
  26853. //
  26854. if ('compatibility' in data) {
  26855. compat = data.compatibility;
  26856. if (!compat) {
  26857. // Cast '', null, undefined, 0 to false.
  26858. compat = false;
  26859. } else if (typeof compat === 'number') {
  26860. // By virtue of the condition above we must be a nonzero number.
  26861. compat = true;
  26862. } else if (typeof compat !== 'boolean') {
  26863. compat = Ext.checkVersion(compat);
  26864. }
  26865. }
  26866. if (compat) {
  26867. // override the target class right after it's created
  26868. if (overriddenClassName.$isClass) {
  26869. classReady();
  26870. } else {
  26871. me.onCreated(classReady, me, overriddenClassName);
  26872. }
  26873. }
  26874. me.triggerCreated(className, 2);
  26875. return me;
  26876. },
  26877. /**
  26878. * Instantiate a class by its alias. This is usually invoked by the
  26879. * shorthand {@link Ext#createByAlias}.
  26880. *
  26881. * If {@link Ext.Loader} is {@link Ext.Loader#setConfig enabled} and the class
  26882. * has not been defined yet, it will attempt to load the class via synchronous
  26883. * loading.
  26884. *
  26885. * var window = Ext.createByAlias('widget.window', { width: 600, height: 800 });
  26886. *
  26887. * @param {String} alias
  26888. * @param {Object...} args Additional arguments after the alias will be passed to the
  26889. * class constructor.
  26890. * @return {Object} instance
  26891. */
  26892. instantiateByAlias: function() {
  26893. var alias = arguments[0],
  26894. args = arraySlice.call(arguments),
  26895. className = this.getNameByAlias(alias);
  26896. if (!className) {
  26897. throw new Error("[Ext.createByAlias] Unrecognized alias: " + alias);
  26898. }
  26899. args[0] = className;
  26900. return Ext.create.apply(Ext, args);
  26901. },
  26902. /**
  26903. * Instantiate a class by either full name, alias or alternate name
  26904. * @param {String} name
  26905. * @param {Mixed} args Additional arguments after the name will be passed to the class' constructor.
  26906. * @return {Object} instance
  26907. * @deprecated 5.0 Use Ext.create() instead.
  26908. */
  26909. instantiate: function() {
  26910. Ext.log.warn('Ext.ClassManager.instantiate() is deprecated. Use Ext.create() instead.');
  26911. return Ext.create.apply(Ext, arguments);
  26912. },
  26913. /**
  26914. * @private
  26915. * @param name
  26916. * @param args
  26917. */
  26918. dynInstantiate: function(name, args) {
  26919. args = arrayFrom(args, true);
  26920. args.unshift(name);
  26921. return Ext.create.apply(Ext, args);
  26922. },
  26923. /**
  26924. * @private
  26925. * @param length
  26926. */
  26927. getInstantiator: function(length) {
  26928. var instantiators = this.instantiators,
  26929. instantiator, i, args;
  26930. instantiator = instantiators[length];
  26931. if (!instantiator) {
  26932. i = length;
  26933. args = [];
  26934. for (i = 0; i < length; i++) {
  26935. args.push('a[' + i + ']');
  26936. }
  26937. instantiator = instantiators[length] = new Function('c', 'a', 'return new c(' + args.join(',') + ')');
  26938. instantiator.name = "Ext.create" + length;
  26939. }
  26940. return instantiator;
  26941. },
  26942. /**
  26943. * @private
  26944. */
  26945. postprocessors: {},
  26946. /**
  26947. * @private
  26948. */
  26949. defaultPostprocessors: [],
  26950. /**
  26951. * Register a post-processor function.
  26952. *
  26953. * @param {String} name
  26954. * @param {Function} fn
  26955. * @param {String/String[]} properties
  26956. * @param {String} position
  26957. * @param {String} relativeTo
  26958. * @private
  26959. */
  26960. registerPostprocessor: function(name, fn, properties, position, relativeTo) {
  26961. if (!position) {
  26962. position = 'last';
  26963. }
  26964. if (!properties) {
  26965. properties = [
  26966. name
  26967. ];
  26968. }
  26969. this.postprocessors[name] = {
  26970. name: name,
  26971. properties: properties || false,
  26972. fn: fn
  26973. };
  26974. this.setDefaultPostprocessorPosition(name, position, relativeTo);
  26975. return this;
  26976. },
  26977. /**
  26978. * Set the default post processors array stack which are applied to every class.
  26979. *
  26980. * @private
  26981. * @param {String/Array} postprocessors The name of a registered post processor or an array of registered names.
  26982. * @return {Ext.ClassManager} this
  26983. */
  26984. setDefaultPostprocessors: function(postprocessors) {
  26985. this.defaultPostprocessors = arrayFrom(postprocessors);
  26986. return this;
  26987. },
  26988. /**
  26989. * Insert this post-processor at a specific position in the stack, optionally relative to
  26990. * any existing post-processor
  26991. *
  26992. * @private
  26993. * @param {String} name The post-processor name. Note that it needs to be registered with
  26994. * {@link Ext.ClassManager#registerPostprocessor} before this
  26995. * @param {String} offset The insertion position. Four possible values are:
  26996. * 'first', 'last', or: 'before', 'after' (relative to the name provided in the third argument)
  26997. * @param {String} relativeName
  26998. * @return {Ext.ClassManager} this
  26999. */
  27000. setDefaultPostprocessorPosition: function(name, offset, relativeName) {
  27001. var defaultPostprocessors = this.defaultPostprocessors,
  27002. index;
  27003. if (typeof offset === 'string') {
  27004. if (offset === 'first') {
  27005. defaultPostprocessors.unshift(name);
  27006. return this;
  27007. } else if (offset === 'last') {
  27008. defaultPostprocessors.push(name);
  27009. return this;
  27010. }
  27011. offset = (offset === 'after') ? 1 : -1;
  27012. }
  27013. index = Ext.Array.indexOf(defaultPostprocessors, relativeName);
  27014. if (index !== -1) {
  27015. Ext.Array.splice(defaultPostprocessors, Math.max(0, index + offset), 0, name);
  27016. }
  27017. return this;
  27018. }
  27019. });
  27020. /**
  27021. * @cfg xtype
  27022. * @member Ext.Class
  27023. * @inheritdoc Ext.Component#cfg-xtype
  27024. */
  27025. /**
  27026. * @cfg {String} override
  27027. * @member Ext.Class
  27028. * Overrides members of the specified `target` class.
  27029. *
  27030. * **NOTE:** the overridden class must have been defined using
  27031. * {@link Ext#define Ext.define} in order to use the `override` config.
  27032. *
  27033. * Methods defined on the overriding class will not automatically call the methods of
  27034. * the same name in the ancestor class chain. To call the parent's method of the
  27035. * same name you must call {@link Ext.Base#method!callParent callParent}. To skip the
  27036. * method of the overridden class and call its parent you will instead call
  27037. * {@link Ext.Base#method!callSuper callSuper}.
  27038. *
  27039. * See {@link Ext#define Ext.define} for additional usage examples.
  27040. */
  27041. /**
  27042. * @cfg {Object} platformConfig
  27043. * Allows setting config values for a class based on specific platforms. The value
  27044. * of this config is an object whose properties are "rules" and whose values are
  27045. * objects containing config values.
  27046. *
  27047. * For example:
  27048. *
  27049. * Ext.define('App.view.Foo', {
  27050. * extend: 'Ext.panel.Panel',
  27051. *
  27052. * platformConfig: {
  27053. * desktop: {
  27054. * title: 'Some Rather Descriptive Title'
  27055. * },
  27056. *
  27057. * '!desktop': {
  27058. * title: 'Short Title'
  27059. * }
  27060. * }
  27061. * });
  27062. *
  27063. * In the above, "desktop" and "!desktop" are (mutually exclusive) rules. Whichever
  27064. * evaluates to `true` will have its configs applied to the class. In this case, only
  27065. * the "title" property, but the object can contain any number of config properties.
  27066. * In this case, the `platformConfig` is evaluated as part of the class and there is
  27067. * no cost for each instance created.
  27068. *
  27069. * The rules are evaluated expressions in the context of the platform tags contained
  27070. * in `{@link Ext#platformTags Ext.platformTags}`. Any properties of that object are
  27071. * implicitly usable (as shown above).
  27072. *
  27073. * If a `platformConfig` specifies a config value, it will replace any values declared
  27074. * on the class itself.
  27075. *
  27076. * Use of `platformConfig` on instances is handled by the config system when classes
  27077. * call `{@link Ext.Base#initConfig initConfig}`. For example:
  27078. *
  27079. * Ext.create({
  27080. * xtype: 'panel',
  27081. *
  27082. * platformConfig: {
  27083. * desktop: {
  27084. * title: 'Some Rather Descriptive Title'
  27085. * },
  27086. *
  27087. * '!desktop': {
  27088. * title: 'Short Title'
  27089. * }
  27090. * }
  27091. * });
  27092. *
  27093. * The following is equivalent to the above:
  27094. *
  27095. * if (Ext.platformTags.desktop) {
  27096. * Ext.create({
  27097. * xtype: 'panel',
  27098. * title: 'Some Rather Descriptive Title'
  27099. * });
  27100. * } else {
  27101. * Ext.create({
  27102. * xtype: 'panel',
  27103. * title: 'Short Title'
  27104. * });
  27105. * }
  27106. *
  27107. * To adjust configs based on dynamic conditions, see `{@link Ext.mixin.Responsive}`.
  27108. */
  27109. Manager.registerPostprocessor('platformConfig', function(name, Class, data) {
  27110. Class.addPlatformConfig(data);
  27111. });
  27112. /**
  27113. * @cfg {String/String[]} alias
  27114. * @member Ext.Class
  27115. * List of short aliases for class names. An alias consists of a namespace and a name
  27116. * concatenated by a period as &#60;namespace&#62;.&#60;name&#62;
  27117. *
  27118. * - **namespace** - The namespace describes what kind of alias this is and must be
  27119. * all lowercase.
  27120. * - **name** - The name of the alias which allows the lazy-instantiation via the
  27121. * alias. The name shouldn't contain any periods.
  27122. *
  27123. * A list of namespaces and the usages are:
  27124. *
  27125. * - **feature** - {@link Ext.grid.Panel Grid} features
  27126. * - **plugin** - Plugins
  27127. * - **store** - {@link Ext.data.Store}
  27128. * - **widget** - Components
  27129. *
  27130. * Most useful for defining xtypes for widgets:
  27131. *
  27132. * Ext.define('MyApp.CoolPanel', {
  27133. * extend: 'Ext.panel.Panel',
  27134. * alias: ['widget.coolpanel'],
  27135. * title: 'Yeah!'
  27136. * });
  27137. *
  27138. * // Using Ext.create
  27139. * Ext.create('widget.coolpanel');
  27140. *
  27141. * // Using the shorthand for defining widgets by xtype
  27142. * Ext.widget('panel', {
  27143. * items: [
  27144. * {xtype: 'coolpanel', html: 'Foo'},
  27145. * {xtype: 'coolpanel', html: 'Bar'}
  27146. * ]
  27147. * });
  27148. */
  27149. Manager.registerPostprocessor('alias', function(name, cls, data) {
  27150. Ext.classSystemMonitor && Ext.classSystemMonitor(name, 'Ext.ClassManager#aliasPostProcessor', arguments);
  27151. var aliases = Ext.Array.from(data.alias),
  27152. i, ln;
  27153. for (i = 0 , ln = aliases.length; i < ln; i++) {
  27154. alias = aliases[i];
  27155. this.addAlias(cls, alias);
  27156. }
  27157. }, [
  27158. 'xtype',
  27159. 'alias'
  27160. ]);
  27161. /**
  27162. * @cfg {Boolean} singleton
  27163. * @member Ext.Class
  27164. * When set to true, the class will be instantiated as singleton. For example:
  27165. *
  27166. * Ext.define('Logger', {
  27167. * singleton: true,
  27168. * log: function(msg) {
  27169. * console.log(msg);
  27170. * }
  27171. * });
  27172. *
  27173. * Logger.log('Hello');
  27174. */
  27175. Manager.registerPostprocessor('singleton', function(name, cls, data, fn) {
  27176. Ext.classSystemMonitor && Ext.classSystemMonitor(name, 'Ext.ClassManager#singletonPostProcessor', arguments);
  27177. if (data.singleton) {
  27178. fn.call(this, name, new cls(), data);
  27179. } else {
  27180. return true;
  27181. }
  27182. return false;
  27183. });
  27184. /**
  27185. * @cfg {String/String[]} alternateClassName
  27186. * @member Ext.Class
  27187. * Defines alternate names for this class. For example:
  27188. *
  27189. * Ext.define('Developer', {
  27190. * alternateClassName: ['Coder', 'Hacker'],
  27191. * code: function(msg) {
  27192. * alert('Typing... ' + msg);
  27193. * }
  27194. * });
  27195. *
  27196. * var joe = Ext.create('Developer');
  27197. * joe.code('stackoverflow');
  27198. *
  27199. * var rms = Ext.create('Hacker');
  27200. * rms.code('hack hack');
  27201. */
  27202. Manager.registerPostprocessor('alternateClassName', function(name, cls, data) {
  27203. Ext.classSystemMonitor && Ext.classSystemMonitor(name, 'Ext.ClassManager#alternateClassNamePostprocessor', arguments);
  27204. var alternates = data.alternateClassName,
  27205. i, ln, alternate;
  27206. if (!(alternates instanceof Array)) {
  27207. alternates = [
  27208. alternates
  27209. ];
  27210. }
  27211. for (i = 0 , ln = alternates.length; i < ln; i++) {
  27212. alternate = alternates[i];
  27213. if (typeof alternate !== 'string') {
  27214. throw new Error("[Ext.define] Invalid alternate of: '" + alternate + "' for class: '" + name + "'; must be a valid string");
  27215. }
  27216. this.set(alternate, cls);
  27217. }
  27218. });
  27219. /**
  27220. * @cfg {Object} debugHooks
  27221. * A collection of diagnostic methods to decorate the real methods of the class. These
  27222. * methods are applied as an `override` if this class has debug enabled as defined by
  27223. * `Ext.isDebugEnabled`.
  27224. *
  27225. * These will be automatically removed by the Sencha Cmd compiler for production builds.
  27226. *
  27227. * Example usage:
  27228. *
  27229. * Ext.define('Foo.bar.Class', {
  27230. * foo: function (a, b, c) {
  27231. * ...
  27232. * },
  27233. *
  27234. * bar: function (a, b) {
  27235. * ...
  27236. * return 42;
  27237. * },
  27238. *
  27239. * debugHooks: {
  27240. * foo: function (a, b, c) {
  27241. * // check arguments...
  27242. * return this.callParent(arguments);
  27243. * }
  27244. * }
  27245. * });
  27246. *
  27247. * If you specify a `$enabled` property in the `debugHooks` object that will be used
  27248. * as the default enabled state for the hooks. If the `{@link Ext#manifest}` contains
  27249. * a `debug` object of if `{@link Ext#debugConfig}` is specified, the `$enabled` flag
  27250. * will override its "*" value.
  27251. */
  27252. Manager.registerPostprocessor('debugHooks', function(name, Class, data) {
  27253. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#debugHooks', arguments);
  27254. if (Ext.isDebugEnabled(Class.$className, data.debugHooks.$enabled)) {
  27255. delete data.debugHooks.$enabled;
  27256. Ext.override(Class, data.debugHooks);
  27257. }
  27258. // may already have an instance here in the case of singleton
  27259. var target = Class.isInstance ? Class.self : Class;
  27260. delete target.prototype.debugHooks;
  27261. });
  27262. /**
  27263. * @cfg {Object} deprecated
  27264. * The object given has properties that describe the versions at which the deprecations
  27265. * apply.
  27266. *
  27267. * The purpose of the `deprecated` declaration is to enable development mode to give
  27268. * suitable error messages when deprecated methods or properties are used. Methods can
  27269. * always be injected to provide this feedback, but properties can only be handled on
  27270. * some browsers (those that support `Object.defineProperty`).
  27271. *
  27272. * In some cases, deprecated methods can be restored to their previous behavior or
  27273. * added back if they have been removed.
  27274. *
  27275. * The structure of a `deprecated` declaration is this:
  27276. *
  27277. * Ext.define('Foo.bar.Class', {
  27278. * ...
  27279. *
  27280. * deprecated: {
  27281. * // Optional package name - default is the framework (ext or touch)
  27282. * name: 'foobar',
  27283. *
  27284. * '5.0': {
  27285. * methods: {
  27286. * // Throws: '"removedMethod" is deprecated.'
  27287. * removedMethod: null,
  27288. *
  27289. * // Throws: '"oldMethod" is deprecated. Please use "newMethod" instead.'
  27290. * oldMethod: 'newMethod',
  27291. *
  27292. * // When this block is enabled, this method is applied as an
  27293. * // override. Otherwise you get same as "removeMethod".
  27294. * method: function () {
  27295. * // Do what v5 "method" did. If "method" exists in newer
  27296. * // versions callParent can call it. If 5.1 has "method"
  27297. * // then it would be next in line, otherwise 5.2 and last
  27298. * // would be the current class.
  27299. * },
  27300. *
  27301. * moreHelpful: {
  27302. * message: 'Something helpful to do instead.',
  27303. * fn: function () {
  27304. * // The v5 "moreHelpful" method to use when enabled.
  27305. * }
  27306. * }
  27307. * },
  27308. * properties: {
  27309. * // Throws: '"removedProp" is deprecated.'
  27310. * removedProp: null,
  27311. *
  27312. * // Throws: '"oldProp" is deprecated. Please use "newProp" instead.'
  27313. * oldProp: 'newProp',
  27314. *
  27315. * helpful: {
  27316. * message: 'Something helpful message about what to do.'
  27317. * }
  27318. * ...
  27319. * },
  27320. * statics: {
  27321. * methods: {
  27322. * ...
  27323. * },
  27324. * properties: {
  27325. * ...
  27326. * },
  27327. * }
  27328. * },
  27329. *
  27330. * '5.1': {
  27331. * ...
  27332. * },
  27333. *
  27334. * '5.2': {
  27335. * ...
  27336. * }
  27337. * }
  27338. * });
  27339. *
  27340. * The primary content of `deprecated` are the version number keys. These indicate
  27341. * a version number where methods or properties were deprecated. These versions are
  27342. * compared to the version reported by `Ext.getCompatVersion` to determine the action
  27343. * to take for each "block".
  27344. *
  27345. * When the compatibility version is set to a value less than a version number key,
  27346. * that block is said to be "enabled". For example, if a method was deprecated in
  27347. * version 5.0 but the desired compatibility level is 4.2 then the block is used to
  27348. * patch methods and (to some degree) restore pre-5.0 compatibility.
  27349. *
  27350. * When multiple active blocks have the same method name, each method is applied as
  27351. * an override in reverse order of version. In the above example, if a method appears
  27352. * in the "5.0", "5.1" and "5.2" blocks then the "5.2" method is applied as an override
  27353. * first, followed by the "5.1" method and finally the "5.0" method. This means that
  27354. * the `callParent` from the "5.0" method calls the "5.1" method which calls the
  27355. * "5.2" method which can (if applicable) call the current version.
  27356. */
  27357. Manager.registerPostprocessor('deprecated', function(name, Class, data) {
  27358. Ext.classSystemMonitor && Ext.classSystemMonitor(Class, 'Ext.Class#deprecated', arguments);
  27359. // may already have an instance here in the case of singleton
  27360. var target = Class.isInstance ? Class.self : Class;
  27361. target.addDeprecations(data.deprecated);
  27362. delete target.prototype.deprecated;
  27363. });
  27364. Ext.apply(Ext, {
  27365. /**
  27366. * Instantiate a class by either full name, alias or alternate name.
  27367. *
  27368. * If {@link Ext.Loader} is {@link Ext.Loader#setConfig enabled} and the class has
  27369. * not been defined yet, it will attempt to load the class via synchronous loading.
  27370. *
  27371. * For example, all these three lines return the same result:
  27372. *
  27373. * // xtype
  27374. * var window = Ext.create({
  27375. * xtype: 'window',
  27376. * width: 600,
  27377. * height: 800,
  27378. * ...
  27379. * });
  27380. *
  27381. * // alias
  27382. * var window = Ext.create('widget.window', {
  27383. * width: 600,
  27384. * height: 800,
  27385. * ...
  27386. * });
  27387. *
  27388. * // alternate name
  27389. * var window = Ext.create('Ext.Window', {
  27390. * width: 600,
  27391. * height: 800,
  27392. * ...
  27393. * });
  27394. *
  27395. * // full class name
  27396. * var window = Ext.create('Ext.window.Window', {
  27397. * width: 600,
  27398. * height: 800,
  27399. * ...
  27400. * });
  27401. *
  27402. * // single object with xclass property:
  27403. * var window = Ext.create({
  27404. * xclass: 'Ext.window.Window', // any valid value for 'name' (above)
  27405. * width: 600,
  27406. * height: 800,
  27407. * ...
  27408. * });
  27409. *
  27410. * @param {String} [name] The class name or alias. Can be specified as `xclass`
  27411. * property if only one object parameter is specified.
  27412. * @param {Object...} [args] Additional arguments after the name will be passed to
  27413. * the class' constructor.
  27414. * @return {Object} instance
  27415. * @member Ext
  27416. * @method create
  27417. */
  27418. create: function() {
  27419. var name = arguments[0],
  27420. nameType = typeof name,
  27421. args = arraySlice.call(arguments, 1),
  27422. cls;
  27423. if (nameType === 'function') {
  27424. cls = name;
  27425. } else {
  27426. if (nameType !== 'string' && args.length === 0) {
  27427. args = [
  27428. name
  27429. ];
  27430. if (!(name = name.xclass)) {
  27431. name = args[0].xtype;
  27432. if (name) {
  27433. name = 'widget.' + name;
  27434. }
  27435. }
  27436. }
  27437. if (typeof name !== 'string' || name.length < 1) {
  27438. throw new Error("[Ext.create] Invalid class name or alias '" + name + "' specified, must be a non-empty string");
  27439. }
  27440. name = Manager.resolveName(name);
  27441. cls = Manager.get(name);
  27442. }
  27443. // Still not existing at this point, try to load it via synchronous mode as the last resort
  27444. if (!cls) {
  27445. Ext.log.warn("[Ext.Loader] Synchronously loading '" + name + "'; consider adding " + "Ext.require('" + name + "') above Ext.onReady");
  27446. Ext.syncRequire(name);
  27447. cls = Manager.get(name);
  27448. }
  27449. if (!cls) {
  27450. throw new Error("[Ext.create] Unrecognized class name / alias: " + name);
  27451. }
  27452. if (typeof cls !== 'function') {
  27453. throw new Error("[Ext.create] Singleton '" + name + "' cannot be instantiated.");
  27454. }
  27455. return Manager.getInstantiator(args.length)(cls, args);
  27456. },
  27457. /**
  27458. * Convenient shorthand to create a widget by its xtype or a config object.
  27459. *
  27460. * var button = Ext.widget('button'); // Equivalent to Ext.create('widget.button');
  27461. *
  27462. * var panel = Ext.widget('panel', { // Equivalent to Ext.create('widget.panel')
  27463. * title: 'Panel'
  27464. * });
  27465. *
  27466. * var grid = Ext.widget({
  27467. * xtype: 'grid',
  27468. * ...
  27469. * });
  27470. *
  27471. * If a {@link Ext.Component component} instance is passed, it is simply returned.
  27472. *
  27473. * @member Ext
  27474. * @param {String} [name] The xtype of the widget to create.
  27475. * @param {Object} [config] The configuration object for the widget constructor.
  27476. * @return {Object} The widget instance
  27477. */
  27478. widget: function(name, config) {
  27479. // forms:
  27480. // 1: (xtype)
  27481. // 2: (xtype, config)
  27482. // 3: (config)
  27483. // 4: (xtype, component)
  27484. // 5: (component)
  27485. //
  27486. var xtype = name,
  27487. alias, className, T;
  27488. if (typeof xtype !== 'string') {
  27489. // if (form 3 or 5)
  27490. // first arg is config or component
  27491. config = name;
  27492. // arguments[0]
  27493. xtype = config.xtype;
  27494. className = config.xclass;
  27495. } else {
  27496. config = config || {};
  27497. }
  27498. if (config.isComponent) {
  27499. return config;
  27500. }
  27501. if (!className) {
  27502. alias = 'widget.' + xtype;
  27503. className = Manager.getNameByAlias(alias);
  27504. }
  27505. // this is needed to support demand loading of the class
  27506. if (className) {
  27507. T = Manager.get(className);
  27508. }
  27509. if (!T) {
  27510. return Ext.create(className || alias, config);
  27511. }
  27512. return new T(config);
  27513. },
  27514. /**
  27515. * @method createByAlias
  27516. * @inheritdoc Ext.ClassManager#method-instantiateByAlias
  27517. * @member Ext
  27518. */
  27519. createByAlias: alias(Manager, 'instantiateByAlias'),
  27520. /**
  27521. * Defines a class or override. A basic class is defined like this:
  27522. *
  27523. * Ext.define('My.awesome.Class', {
  27524. * someProperty: 'something',
  27525. *
  27526. * someMethod: function(s) {
  27527. * alert(s + this.someProperty);
  27528. * }
  27529. *
  27530. * ...
  27531. * });
  27532. *
  27533. * var obj = new My.awesome.Class();
  27534. *
  27535. * obj.someMethod('Say '); // alerts 'Say something'
  27536. *
  27537. * To create an anonymous class, pass `null` for the `className`:
  27538. *
  27539. * Ext.define(null, {
  27540. * constructor: function () {
  27541. * // ...
  27542. * }
  27543. * });
  27544. *
  27545. * In some cases, it is helpful to create a nested scope to contain some private
  27546. * properties. The best way to do this is to pass a function instead of an object
  27547. * as the second parameter. This function will be called to produce the class
  27548. * body:
  27549. *
  27550. * Ext.define('MyApp.foo.Bar', function () {
  27551. * var id = 0;
  27552. *
  27553. * return {
  27554. * nextId: function () {
  27555. * return ++id;
  27556. * }
  27557. * };
  27558. * });
  27559. *
  27560. * _Note_ that when using override, the above syntax will not override successfully, because
  27561. * the passed function would need to be executed first to determine whether or not the result
  27562. * is an override or defining a new object. As such, an alternative syntax that immediately
  27563. * invokes the function can be used:
  27564. *
  27565. * Ext.define('MyApp.override.BaseOverride', function () {
  27566. * var counter = 0;
  27567. *
  27568. * return {
  27569. * override: 'Ext.Component',
  27570. * logId: function () {
  27571. * console.log(++counter, this.id);
  27572. * }
  27573. * };
  27574. * }());
  27575. *
  27576. *
  27577. * When using this form of `Ext.define`, the function is passed a reference to its
  27578. * class. This can be used as an efficient way to access any static properties you
  27579. * may have:
  27580. *
  27581. * Ext.define('MyApp.foo.Bar', function (Bar) {
  27582. * return {
  27583. * statics: {
  27584. * staticMethod: function () {
  27585. * // ...
  27586. * }
  27587. * },
  27588. *
  27589. * method: function () {
  27590. * return Bar.staticMethod();
  27591. * }
  27592. * };
  27593. * });
  27594. *
  27595. * To define an override, include the `override` property. The content of an
  27596. * override is aggregated with the specified class in order to extend or modify
  27597. * that class. This can be as simple as setting default property values or it can
  27598. * extend and/or replace methods. This can also extend the statics of the class.
  27599. *
  27600. * One use for an override is to break a large class into manageable pieces.
  27601. *
  27602. * // File: /src/app/Panel.js
  27603. *
  27604. * Ext.define('My.app.Panel', {
  27605. * extend: 'Ext.panel.Panel',
  27606. * requires: [
  27607. * 'My.app.PanelPart2',
  27608. * 'My.app.PanelPart3'
  27609. * ]
  27610. *
  27611. * constructor: function (config) {
  27612. * this.callParent(arguments); // calls Ext.panel.Panel's constructor
  27613. * //...
  27614. * },
  27615. *
  27616. * statics: {
  27617. * method: function () {
  27618. * return 'abc';
  27619. * }
  27620. * }
  27621. * });
  27622. *
  27623. * // File: /src/app/PanelPart2.js
  27624. * Ext.define('My.app.PanelPart2', {
  27625. * override: 'My.app.Panel',
  27626. *
  27627. * constructor: function (config) {
  27628. * this.callParent(arguments); // calls My.app.Panel's constructor
  27629. * //...
  27630. * }
  27631. * });
  27632. *
  27633. * Another use of overrides is to provide optional parts of classes that can be
  27634. * independently required. In this case, the class may even be unaware of the
  27635. * override altogether.
  27636. *
  27637. * Ext.define('My.ux.CoolTip', {
  27638. * override: 'Ext.tip.ToolTip',
  27639. *
  27640. * constructor: function (config) {
  27641. * this.callParent(arguments); // calls Ext.tip.ToolTip's constructor
  27642. * //...
  27643. * }
  27644. * });
  27645. *
  27646. * The above override can now be required as normal.
  27647. *
  27648. * Ext.define('My.app.App', {
  27649. * requires: [
  27650. * 'My.ux.CoolTip'
  27651. * ]
  27652. * });
  27653. *
  27654. * Overrides can also contain statics, inheritableStatics, or privates:
  27655. *
  27656. * Ext.define('My.app.BarMod', {
  27657. * override: 'Ext.foo.Bar',
  27658. *
  27659. * statics: {
  27660. * method: function (x) {
  27661. * return this.callParent([x * 2]); // call Ext.foo.Bar.method
  27662. * }
  27663. * }
  27664. * });
  27665. *
  27666. * Starting in version 4.2.2, overrides can declare their `compatibility` based
  27667. * on the framework version or on versions of other packages. For details on the
  27668. * syntax and options for these checks, see `Ext.checkVersion`.
  27669. *
  27670. * The simplest use case is to test framework version for compatibility:
  27671. *
  27672. * Ext.define('App.overrides.grid.Panel', {
  27673. * override: 'Ext.grid.Panel',
  27674. *
  27675. * compatibility: '4.2.2', // only if framework version is 4.2.2
  27676. *
  27677. * //...
  27678. * });
  27679. *
  27680. * An array is treated as an OR, so if any specs match, the override is
  27681. * compatible.
  27682. *
  27683. * Ext.define('App.overrides.some.Thing', {
  27684. * override: 'Foo.some.Thing',
  27685. *
  27686. * compatibility: [
  27687. * '4.2.2',
  27688. * 'foo@1.0.1-1.0.2'
  27689. * ],
  27690. *
  27691. * //...
  27692. * });
  27693. *
  27694. * To require that all specifications match, an object can be provided:
  27695. *
  27696. * Ext.define('App.overrides.some.Thing', {
  27697. * override: 'Foo.some.Thing',
  27698. *
  27699. * compatibility: {
  27700. * and: [
  27701. * '4.2.2',
  27702. * 'foo@1.0.1-1.0.2'
  27703. * ]
  27704. * },
  27705. *
  27706. * //...
  27707. * });
  27708. *
  27709. * Because the object form is just a recursive check, these can be nested:
  27710. *
  27711. * Ext.define('App.overrides.some.Thing', {
  27712. * override: 'Foo.some.Thing',
  27713. *
  27714. * compatibility: {
  27715. * and: [
  27716. * '4.2.2', // exactly version 4.2.2 of the framework *AND*
  27717. * {
  27718. * // either (or both) of these package specs:
  27719. * or: [
  27720. * 'foo@1.0.1-1.0.2',
  27721. * 'bar@3.0+'
  27722. * ]
  27723. * }
  27724. * ]
  27725. * },
  27726. *
  27727. * //...
  27728. * });
  27729. *
  27730. * IMPORTANT: An override is only included in a build if the class it overrides is
  27731. * required. Otherwise, the override, like the target class, is not included. In
  27732. * Sencha Cmd v4, the `compatibility` declaration can likewise be used to remove
  27733. * incompatible overrides from a build.
  27734. *
  27735. * @param {String} className The class name to create in string dot-namespaced format, for example:
  27736. * 'My.very.awesome.Class', 'FeedViewer.plugin.CoolPager'
  27737. * It is highly recommended to follow this simple convention:
  27738. * - The root and the class name are 'CamelCased'
  27739. * - Everything else is lower-cased
  27740. * Pass `null` to create an anonymous class.
  27741. * @param {Object} data The key - value pairs of properties to apply to this class. Property names can be of any valid
  27742. * strings, except those in the reserved listed below:
  27743. *
  27744. * - {@link Ext.Class#cfg-alias alias}
  27745. * - {@link Ext.Class#cfg-alternateClassName alternateClassName}
  27746. * - {@link Ext.Class#cfg-cachedConfig cachedConfig}
  27747. * - {@link Ext.Class#cfg-config config}
  27748. * - {@link Ext.Class#cfg-extend extend}
  27749. * - {@link Ext.Class#cfg-inheritableStatics inheritableStatics}
  27750. * - {@link Ext.Class#cfg-mixins mixins}
  27751. * - {@link Ext.Class#cfg-override override}
  27752. * - {@link Ext.Class#cfg-platformConfig platformConfig}
  27753. * - {@link Ext.Class#cfg-privates privates}
  27754. * - {@link Ext.Class#cfg-requires requires}
  27755. * - `self`
  27756. * - {@link Ext.Class#cfg-singleton singleton}
  27757. * - {@link Ext.Class#cfg-statics statics}
  27758. * - {@link Ext.Class#cfg-uses uses}
  27759. * - {@link Ext.Class#cfg-xtype xtype} (for {@link Ext.Component Components} only)
  27760. *
  27761. * @param {Function} [createdFn] Callback to execute after the class is created, the execution scope of which
  27762. * (`this`) will be the newly created class itself.
  27763. * @return {Ext.Base}
  27764. * @member Ext
  27765. */
  27766. define: function(className, data, createdFn) {
  27767. Ext.classSystemMonitor && Ext.classSystemMonitor(className, 'ClassManager#define', arguments);
  27768. if (data.override) {
  27769. Manager.classState[className] = 20;
  27770. return Manager.createOverride.apply(Manager, arguments);
  27771. }
  27772. Manager.classState[className] = 10;
  27773. return Manager.create.apply(Manager, arguments);
  27774. },
  27775. /**
  27776. * Undefines a class defined using the #define method. Typically used
  27777. * for unit testing where setting up and tearing down a class multiple
  27778. * times is required. For example:
  27779. *
  27780. * // define a class
  27781. * Ext.define('Foo', {
  27782. * ...
  27783. * });
  27784. *
  27785. * // run test
  27786. *
  27787. * // undefine the class
  27788. * Ext.undefine('Foo');
  27789. * @param {String} className The class name to undefine in string dot-namespaced format.
  27790. * @private
  27791. */
  27792. undefine: function(className) {
  27793. Ext.classSystemMonitor && Ext.classSystemMonitor(className, 'Ext.ClassManager#undefine', arguments);
  27794. var classes = Manager.classes;
  27795. if (classes[className]) {
  27796. Manager.classCount--;
  27797. }
  27798. delete classes[className];
  27799. delete Manager.existCache[className];
  27800. delete Manager.classState[className];
  27801. Manager.removeName(className);
  27802. // Indiscriminately clear all factory caches here. It might be slightly inefficient however undefine
  27803. // is typically only called during unit testing.
  27804. Ext.Factory.clearCaches();
  27805. var entry = Manager.getNamespaceEntry(className),
  27806. scope = entry.parent ? Manager.lookupName(entry.parent, false) : Ext.global,
  27807. entryName;
  27808. if (scope) {
  27809. entryName = entry.name;
  27810. // Old IE blows up on attempt to delete window property
  27811. try {
  27812. delete scope[entryName];
  27813. } catch (e) {
  27814. scope[entryName] = undefined;
  27815. }
  27816. }
  27817. // We need to know entry name in unit tests
  27818. return entryName;
  27819. },
  27820. /**
  27821. * @method getClassName
  27822. * @inheritdoc Ext.ClassManager#method-getName
  27823. * @member Ext
  27824. */
  27825. getClassName: alias(Manager, 'getName'),
  27826. /**
  27827. * Returns the displayName property or className or object. When all else fails, returns "Anonymous".
  27828. * @param {Object} object
  27829. * @return {String}
  27830. */
  27831. getDisplayName: function(object) {
  27832. if (object) {
  27833. if (object.displayName) {
  27834. return object.displayName;
  27835. }
  27836. if (object.$name && object.$class) {
  27837. return Ext.getClassName(object.$class) + '#' + object.$name;
  27838. }
  27839. if (object.$className) {
  27840. return object.$className;
  27841. }
  27842. }
  27843. return 'Anonymous';
  27844. },
  27845. /**
  27846. * @method getClass
  27847. * @inheritdoc Ext.ClassManager#method-getClass
  27848. * @member Ext
  27849. */
  27850. getClass: alias(Manager, 'getClass'),
  27851. /**
  27852. * Creates namespaces to be used for scoping variables and classes so that they are not global.
  27853. * Specifying the last node of a namespace implicitly creates all other nodes. Usage:
  27854. *
  27855. * Ext.namespace('Company', 'Company.data');
  27856. *
  27857. * // equivalent and preferable to the above syntax
  27858. * Ext.ns('Company.data');
  27859. *
  27860. * Company.Widget = function() { ... };
  27861. *
  27862. * Company.data.CustomStore = function(config) { ... };
  27863. *
  27864. * @param {String...} namespaces
  27865. * @return {Object} The (last) namespace object created.
  27866. * @member Ext
  27867. * @method namespace
  27868. */
  27869. namespace: function() {
  27870. var root = global,
  27871. i;
  27872. for (i = arguments.length; i-- > 0; ) {
  27873. root = Manager.lookupName(arguments[i], true);
  27874. }
  27875. return root;
  27876. }
  27877. });
  27878. /**
  27879. * This function registers top-level (root) namespaces. This is needed for "sandbox"
  27880. * builds.
  27881. *
  27882. * Ext.addRootNamespaces({
  27883. * MyApp: MyApp,
  27884. * Common: Common
  27885. * });
  27886. *
  27887. * In the above example, `MyApp` and `Common` are top-level namespaces that happen
  27888. * to also be included in the sandbox closure. Something like this:
  27889. *
  27890. * (function(Ext) {
  27891. *
  27892. * Ext.sandboxName = 'Ext6';
  27893. * Ext.isSandboxed = true;
  27894. * Ext.buildSettings = { baseCSSPrefix: "x6-", scopeResetCSS: true };
  27895. *
  27896. * var MyApp = MyApp || {};
  27897. * Ext.addRootNamespaces({ MyApp: MyApp );
  27898. *
  27899. * ... normal app.js goes here ...
  27900. *
  27901. * })(this.Ext6 || (this.Ext6 = {}));
  27902. *
  27903. * The sandbox wrapper around the normally built `app.js` content has to take care
  27904. * of introducing top-level namespaces as well as call this method.
  27905. *
  27906. * @param {Object} namespaces
  27907. * @method addRootNamespaces
  27908. * @member Ext
  27909. * @since 6.0.0
  27910. * @private
  27911. */
  27912. Ext.addRootNamespaces = Manager.addRootNamespaces;
  27913. /**
  27914. * Old name for {@link Ext#widget}.
  27915. * @deprecated 5.0 Use {@link Ext#widget} instead.
  27916. * @method createWidget
  27917. * @member Ext
  27918. * @private
  27919. */
  27920. Ext.createWidget = Ext.widget;
  27921. /**
  27922. * @method ns
  27923. * Convenient alias for {@link Ext#namespace Ext.namespace}.
  27924. * @inheritdoc Ext#method-namespace
  27925. * @member Ext
  27926. */
  27927. Ext.ns = Ext.namespace;
  27928. Class.registerPreprocessor('className', function(cls, data) {
  27929. if ('$className' in data) {
  27930. cls.$className = data.$className;
  27931. cls.displayName = cls.$className;
  27932. }
  27933. Ext.classSystemMonitor && Ext.classSystemMonitor(cls, 'Ext.ClassManager#classNamePreprocessor', arguments);
  27934. }, true, 'first');
  27935. Class.registerPreprocessor('alias', function(cls, data) {
  27936. Ext.classSystemMonitor && Ext.classSystemMonitor(cls, 'Ext.ClassManager#aliasPreprocessor', arguments);
  27937. var prototype = cls.prototype,
  27938. xtypes = arrayFrom(data.xtype),
  27939. aliases = arrayFrom(data.alias),
  27940. widgetPrefix = 'widget.',
  27941. widgetPrefixLength = widgetPrefix.length,
  27942. xtypesChain = Array.prototype.slice.call(prototype.xtypesChain || []),
  27943. xtypesMap = Ext.merge({}, prototype.xtypesMap || {}),
  27944. i, ln, alias, xtype;
  27945. for (i = 0 , ln = aliases.length; i < ln; i++) {
  27946. alias = aliases[i];
  27947. if (typeof alias !== 'string' || alias.length < 1) {
  27948. throw new Error("[Ext.define] Invalid alias of: '" + alias + "' for class: '" + name + "'; must be a valid string");
  27949. }
  27950. if (alias.substring(0, widgetPrefixLength) === widgetPrefix) {
  27951. xtype = alias.substring(widgetPrefixLength);
  27952. Ext.Array.include(xtypes, xtype);
  27953. }
  27954. }
  27955. cls.xtype = data.xtype = xtypes[0];
  27956. data.xtypes = xtypes;
  27957. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  27958. xtype = xtypes[i];
  27959. if (!xtypesMap[xtype]) {
  27960. xtypesMap[xtype] = true;
  27961. xtypesChain.push(xtype);
  27962. }
  27963. }
  27964. data.xtypesChain = xtypesChain;
  27965. data.xtypesMap = xtypesMap;
  27966. // Class is already extended at this point
  27967. Ext.Function.interceptAfterOnce(cls, 'onClassCreated', function() {
  27968. var cls = this,
  27969. prototype = cls.prototype,
  27970. mixins = prototype.mixins,
  27971. key, mixin;
  27972. Ext.classSystemMonitor && Ext.classSystemMonitor(cls, 'Ext.ClassManager#aliasPreprocessor#afterClassCreated', arguments);
  27973. for (key in mixins) {
  27974. if (mixins.hasOwnProperty(key)) {
  27975. mixin = mixins[key];
  27976. xtypes = mixin.xtypes;
  27977. if (xtypes) {
  27978. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  27979. xtype = xtypes[i];
  27980. if (!xtypesMap[xtype]) {
  27981. xtypesMap[xtype] = true;
  27982. xtypesChain.push(xtype);
  27983. }
  27984. }
  27985. }
  27986. }
  27987. }
  27988. });
  27989. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  27990. xtype = xtypes[i];
  27991. if (typeof xtype !== 'string' || xtype.length < 1) {
  27992. throw new Error("[Ext.define] Invalid xtype of: '" + xtype + "' for class: '" + name + "'; must be a valid non-empty string");
  27993. }
  27994. Ext.Array.include(aliases, widgetPrefix + xtype);
  27995. }
  27996. data.alias = aliases;
  27997. }, [
  27998. 'xtype',
  27999. 'alias'
  28000. ]);
  28001. // load the cmd-5 style app manifest metadata now, if available...
  28002. if (Ext.manifest) {
  28003. var manifest = Ext.manifest,
  28004. classes = manifest.classes,
  28005. paths = manifest.paths,
  28006. aliases = {},
  28007. alternates = {},
  28008. className, obj, name, path, baseUrl;
  28009. if (paths) {
  28010. // if the manifest paths were calculated as relative to the
  28011. // bootstrap file, then we need to prepend Boot.baseUrl to the
  28012. // paths before processing
  28013. if (manifest.bootRelative) {
  28014. baseUrl = Ext.Boot.baseUrl;
  28015. for (path in paths) {
  28016. if (paths.hasOwnProperty(path)) {
  28017. paths[path] = baseUrl + paths[path];
  28018. }
  28019. }
  28020. }
  28021. Manager.setPath(paths);
  28022. }
  28023. if (classes) {
  28024. for (className in classes) {
  28025. alternates[className] = [];
  28026. aliases[className] = [];
  28027. obj = classes[className];
  28028. if (obj.alias) {
  28029. aliases[className] = obj.alias;
  28030. }
  28031. if (obj.alternates) {
  28032. alternates[className] = obj.alternates;
  28033. }
  28034. }
  28035. }
  28036. Manager.addAlias(aliases);
  28037. Manager.addAlternate(alternates);
  28038. }
  28039. return Manager;
  28040. }(Ext.Class, Ext.Function.alias, Array.prototype.slice, Ext.Array.from, Ext.global));
  28041. /**
  28042. * @class Ext.env.Browser
  28043. * Provides information about browser.
  28044. *
  28045. * Should not be manually instantiated unless for unit-testing.
  28046. * Access the global instance stored in {@link Ext.browser} instead.
  28047. * @private
  28048. */
  28049. (Ext.env || (Ext.env = {})).Browser = function(userAgent, publish) {
  28050. // @define Ext.env.Browser
  28051. // @define Ext.browser
  28052. // @require Ext.Object
  28053. // @require Ext.Version
  28054. var me = this,
  28055. browserPrefixes = Ext.Boot.browserPrefixes,
  28056. browserNames = Ext.Boot.browserNames,
  28057. enginePrefixes = me.enginePrefixes,
  28058. engineNames = me.engineNames,
  28059. browserMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(browserPrefixes).join(')|(?:') + '))([\\w\\._]+)')),
  28060. engineMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(enginePrefixes).join(')|(?:') + '))([\\w\\._]+)')),
  28061. browserName = browserNames.other,
  28062. engineName = engineNames.other,
  28063. browserVersion = '',
  28064. engineVersion = '',
  28065. majorVer = '',
  28066. isWebView = false,
  28067. edgeRE = /(Edge\/)([\w.]+)/,
  28068. ripple = '',
  28069. i, prefix, name;
  28070. /**
  28071. * @property {String}
  28072. * Browser User Agent string.
  28073. */
  28074. me.userAgent = userAgent;
  28075. /**
  28076. * A "hybrid" property, can be either accessed as a method call, for example:
  28077. *
  28078. * if (Ext.browser.is('IE')) {
  28079. * // ...
  28080. * }
  28081. *
  28082. * Or as an object with Boolean properties, for example:
  28083. *
  28084. * if (Ext.browser.is.IE) {
  28085. * // ...
  28086. * }
  28087. *
  28088. * Versions can be conveniently checked as well. For example:
  28089. *
  28090. * if (Ext.browser.is.IE10) {
  28091. * // Equivalent to (Ext.browser.is.IE && Ext.browser.version.equals(10))
  28092. * }
  28093. *
  28094. * __Note:__ Only {@link Ext.Version#getMajor major component} and {@link Ext.Version#getShortVersion simplified}
  28095. * value of the version are available via direct property checking.
  28096. *
  28097. * Supported values are:
  28098. *
  28099. * - IE
  28100. * - Firefox
  28101. * - Safari
  28102. * - Chrome
  28103. * - Opera
  28104. * - WebKit
  28105. * - Gecko
  28106. * - Presto
  28107. * - Trident
  28108. * - WebView
  28109. * - Other
  28110. *
  28111. * @param {String} name The OS name to check.
  28112. * @return {Boolean}
  28113. */
  28114. this.is = function(name) {
  28115. // Since this function reference also acts as a map, we do not want it to be
  28116. // shared between instances, so it is defined here, not on the prototype.
  28117. return !!this.is[name];
  28118. };
  28119. // Edge has a userAgent with All browsers so we manage it separately
  28120. // "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"
  28121. if (/Edge\//.test(userAgent)) {
  28122. browserMatch = userAgent.match(edgeRE);
  28123. engineMatch = userAgent.match(edgeRE);
  28124. }
  28125. if (browserMatch) {
  28126. browserName = browserNames[Ext.Object.getKey(browserPrefixes, browserMatch[1])];
  28127. if (browserName === 'Safari' && /^Opera/.test(userAgent)) {
  28128. // Prevent Opera 12 and earlier from being incorrectly reported as Safari
  28129. browserName = 'Opera';
  28130. }
  28131. browserVersion = new Ext.Version(browserMatch[2]);
  28132. }
  28133. if (engineMatch) {
  28134. engineName = engineNames[Ext.Object.getKey(enginePrefixes, engineMatch[1])];
  28135. engineVersion = new Ext.Version(engineMatch[2]);
  28136. }
  28137. if (engineName === 'Trident' && browserName !== 'IE') {
  28138. browserName = 'IE';
  28139. var version = userAgent.match(/.*rv:(\d+.\d+)/);
  28140. if (version && version.length) {
  28141. version = version[1];
  28142. browserVersion = new Ext.Version(version);
  28143. }
  28144. }
  28145. if (browserName && browserVersion) {
  28146. Ext.setVersion(browserName, browserVersion);
  28147. }
  28148. /**
  28149. * @property chromeVersion
  28150. * The current version of Chrome (0 if the browser is not Chrome).
  28151. * @readonly
  28152. * @type Number
  28153. * @member Ext
  28154. */
  28155. /**
  28156. * @property firefoxVersion
  28157. * The current version of Firefox (0 if the browser is not Firefox).
  28158. * @readonly
  28159. * @type Number
  28160. * @member Ext
  28161. */
  28162. /**
  28163. * @property ieVersion
  28164. * The current version of IE (0 if the browser is not IE). This does not account
  28165. * for the documentMode of the current page, which is factored into {@link #isIE8},
  28166. * and {@link #isIE9}. Thus this is not always true:
  28167. *
  28168. * Ext.isIE8 == (Ext.ieVersion == 8)
  28169. *
  28170. * @readonly
  28171. * @type Number
  28172. * @member Ext
  28173. */
  28174. /**
  28175. * @property isChrome
  28176. * True if the detected browser is Chrome.
  28177. * @readonly
  28178. * @type Boolean
  28179. * @member Ext
  28180. */
  28181. /**
  28182. * @property isGecko
  28183. * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
  28184. * @readonly
  28185. * @type Boolean
  28186. * @member Ext
  28187. */
  28188. /**
  28189. * @property isIE
  28190. * True if the detected browser is Internet Explorer.
  28191. * @readonly
  28192. * @type Boolean
  28193. * @member Ext
  28194. */
  28195. /**
  28196. * @property isIE8
  28197. * True if the detected browser is Internet Explorer 8.x.
  28198. * @readonly
  28199. * @type Boolean
  28200. * @member Ext
  28201. */
  28202. /**
  28203. * @property isIE8m
  28204. * True if the detected browser is Internet Explorer 8.x or lower.
  28205. * @readonly
  28206. * @type Boolean
  28207. * @member Ext
  28208. */
  28209. /**
  28210. * @property isIE8p
  28211. * True if the detected browser is Internet Explorer 8.x or higher.
  28212. * @readonly
  28213. * @type Boolean
  28214. * @member Ext
  28215. */
  28216. /**
  28217. * @property isIE9
  28218. * True if the detected browser is Internet Explorer 9.x.
  28219. * @readonly
  28220. * @type Boolean
  28221. * @member Ext
  28222. */
  28223. /**
  28224. * @property isIE9m
  28225. * True if the detected browser is Internet Explorer 9.x or lower.
  28226. * @readonly
  28227. * @type Boolean
  28228. * @member Ext
  28229. */
  28230. /**
  28231. * @property isIE9p
  28232. * True if the detected browser is Internet Explorer 9.x or higher.
  28233. * @readonly
  28234. * @type Boolean
  28235. * @member Ext
  28236. */
  28237. /**
  28238. * @property isIE10
  28239. * True if the detected browser is Internet Explorer 10.x.
  28240. * @readonly
  28241. * @type Boolean
  28242. * @member Ext
  28243. */
  28244. /**
  28245. * @property isIE10m
  28246. * True if the detected browser is Internet Explorer 10.x or lower.
  28247. * @readonly
  28248. * @type Boolean
  28249. * @member Ext
  28250. */
  28251. /**
  28252. * @property isIE10p
  28253. * True if the detected browser is Internet Explorer 10.x or higher.
  28254. * @readonly
  28255. * @type Boolean
  28256. * @member Ext
  28257. */
  28258. /**
  28259. * @property isIE11
  28260. * True if the detected browser is Internet Explorer 11.x.
  28261. * @readonly
  28262. * @type Boolean
  28263. * @member Ext
  28264. */
  28265. /**
  28266. * @property isIE11m
  28267. * True if the detected browser is Internet Explorer 11.x or lower.
  28268. * @readonly
  28269. * @type Boolean
  28270. * @member Ext
  28271. */
  28272. /**
  28273. * @property isIE11p
  28274. * True if the detected browser is Internet Explorer 11.x or higher.
  28275. * @readonly
  28276. * @type Boolean
  28277. * @member Ext
  28278. */
  28279. /**
  28280. * @property isEdge
  28281. * True if the detected browser is Edge.
  28282. * @readonly
  28283. * @type Boolean
  28284. * @member Ext
  28285. */
  28286. /**
  28287. * @property isLinux
  28288. * True if the detected platform is Linux.
  28289. * @readonly
  28290. * @type Boolean
  28291. * @member Ext
  28292. */
  28293. /**
  28294. * @property isMac
  28295. * True if the detected platform is Mac OS.
  28296. * @readonly
  28297. * @type Boolean
  28298. * @member Ext
  28299. */
  28300. /**
  28301. * @property isOpera
  28302. * True if the detected browser is Opera.
  28303. * @readonly
  28304. * @type Boolean
  28305. * @member Ext
  28306. */
  28307. /**
  28308. * @property isSafari
  28309. * True if the detected browser is Safari.
  28310. * @readonly
  28311. * @type Boolean
  28312. * @member Ext
  28313. */
  28314. /**
  28315. * @property isWebKit
  28316. * True if the detected browser uses WebKit.
  28317. * @readonly
  28318. * @type Boolean
  28319. * @member Ext
  28320. */
  28321. /**
  28322. * @property isWindows
  28323. * True if the detected platform is Windows.
  28324. * @readonly
  28325. * @type Boolean
  28326. * @member Ext
  28327. */
  28328. /**
  28329. * @property operaVersion
  28330. * The current version of Opera (0 if the browser is not Opera).
  28331. * @readonly
  28332. * @type Number
  28333. * @member Ext
  28334. */
  28335. /**
  28336. * @property safariVersion
  28337. * The current version of Safari (0 if the browser is not Safari).
  28338. * @readonly
  28339. * @type Number
  28340. * @member Ext
  28341. */
  28342. /**
  28343. * @property webKitVersion
  28344. * The current version of WebKit (0 if the browser does not use WebKit).
  28345. * @readonly
  28346. * @type Number
  28347. * @member Ext
  28348. */
  28349. // Facebook changes the userAgent when you view a website within their iOS app. For some reason, the strip out information
  28350. // about the browser, so we have to detect that and fake it...
  28351. if (userAgent.match(/FB/) && browserName === 'Other') {
  28352. browserName = browserNames.safari;
  28353. engineName = engineNames.webkit;
  28354. }
  28355. // Detect chrome first as Chrome in Android 8.0 introduced OPR in the user agent
  28356. else if (userAgent.match(/Android.*Chrome/g)) {
  28357. browserName = 'ChromeMobile';
  28358. } else {
  28359. browserMatch = userAgent.match(/OPR\/(\d+.\d+)/);
  28360. if (browserMatch) {
  28361. browserName = 'Opera';
  28362. browserVersion = new Ext.Version(browserMatch[1]);
  28363. }
  28364. }
  28365. Ext.apply(this, {
  28366. engineName: engineName,
  28367. engineVersion: engineVersion,
  28368. name: browserName,
  28369. version: browserVersion
  28370. });
  28371. this.setFlag(browserName, true, publish);
  28372. // e.g., Ext.isIE
  28373. if (browserVersion) {
  28374. majorVer = browserVersion.getMajor() || '';
  28375. if (me.is.IE) {
  28376. majorVer = document.documentMode || parseInt(majorVer, 10);
  28377. for (i = 7; i <= 11; ++i) {
  28378. prefix = 'isIE' + i;
  28379. Ext[prefix] = majorVer === i;
  28380. Ext[prefix + 'm'] = majorVer <= i;
  28381. Ext[prefix + 'p'] = majorVer >= i;
  28382. }
  28383. }
  28384. if (me.is.Opera && parseInt(majorVer, 10) <= 12) {
  28385. Ext.isOpera12m = true;
  28386. }
  28387. Ext.chromeVersion = Ext.isChrome ? majorVer : 0;
  28388. Ext.firefoxVersion = Ext.isFirefox ? majorVer : 0;
  28389. Ext.ieVersion = Ext.isIE ? majorVer : 0;
  28390. Ext.operaVersion = Ext.isOpera ? majorVer : 0;
  28391. Ext.safariVersion = Ext.isSafari ? majorVer : 0;
  28392. Ext.webKitVersion = Ext.isWebKit ? majorVer : 0;
  28393. this.setFlag(browserName + majorVer, true, publish);
  28394. // Ext.isIE10
  28395. this.setFlag(browserName + browserVersion.getShortVersion());
  28396. }
  28397. for (i in browserNames) {
  28398. if (browserNames.hasOwnProperty(i)) {
  28399. name = browserNames[i];
  28400. this.setFlag(name, browserName === name);
  28401. }
  28402. }
  28403. this.setFlag(name);
  28404. if (engineVersion) {
  28405. this.setFlag(engineName + (engineVersion.getMajor() || ''));
  28406. this.setFlag(engineName + engineVersion.getShortVersion());
  28407. }
  28408. for (i in engineNames) {
  28409. if (engineNames.hasOwnProperty(i)) {
  28410. name = engineNames[i];
  28411. this.setFlag(name, engineName === name, publish);
  28412. }
  28413. }
  28414. this.setFlag('Standalone', !!navigator.standalone);
  28415. // Cross domain access could throw an error
  28416. try {
  28417. ripple = window.top.ripple;
  28418. } catch (e) {}
  28419. // Do nothing, can't access cross frame so leave it empty
  28420. this.setFlag('Ripple', !!document.getElementById("tinyhippos-injected") && !Ext.isEmpty(ripple));
  28421. this.setFlag('WebWorks', !!window.blackberry);
  28422. if (window.PhoneGap !== undefined || window.Cordova !== undefined || window.cordova !== undefined) {
  28423. isWebView = true;
  28424. this.setFlag('PhoneGap');
  28425. this.setFlag('Cordova');
  28426. }
  28427. // Check if running in UIWebView
  28428. if (/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(userAgent)) {
  28429. isWebView = true;
  28430. }
  28431. // Flag to check if it we are in the WebView
  28432. this.setFlag('WebView', isWebView);
  28433. /**
  28434. * @property {Boolean}
  28435. * `true` if browser is using strict mode.
  28436. */
  28437. this.isStrict = Ext.isStrict = document.compatMode === "CSS1Compat";
  28438. /**
  28439. * @property {Boolean}
  28440. * `true` if page is running over SSL.
  28441. */
  28442. this.isSecure = Ext.isSecure;
  28443. // IE10Quirks, Chrome26Strict, etc.
  28444. this.identity = browserName + majorVer + (this.isStrict ? 'Strict' : 'Quirks');
  28445. };
  28446. Ext.env.Browser.prototype = {
  28447. constructor: Ext.env.Browser,
  28448. engineNames: {
  28449. edge: 'Edge',
  28450. webkit: 'WebKit',
  28451. gecko: 'Gecko',
  28452. presto: 'Presto',
  28453. trident: 'Trident',
  28454. other: 'Other'
  28455. },
  28456. enginePrefixes: {
  28457. edge: 'Edge/',
  28458. webkit: 'AppleWebKit/',
  28459. gecko: 'Gecko/',
  28460. presto: 'Presto/',
  28461. trident: 'Trident/'
  28462. },
  28463. styleDashPrefixes: {
  28464. WebKit: '-webkit-',
  28465. Gecko: '-moz-',
  28466. Trident: '-ms-',
  28467. Presto: '-o-',
  28468. Other: ''
  28469. },
  28470. stylePrefixes: {
  28471. WebKit: 'Webkit',
  28472. Gecko: 'Moz',
  28473. Trident: 'ms',
  28474. Presto: 'O',
  28475. Other: ''
  28476. },
  28477. propertyPrefixes: {
  28478. WebKit: 'webkit',
  28479. Gecko: 'moz',
  28480. Trident: 'ms',
  28481. Presto: 'o',
  28482. Other: ''
  28483. },
  28484. // scope: Ext.env.Browser.prototype
  28485. /**
  28486. * The full name of the current browser.
  28487. * Possible values are:
  28488. *
  28489. * - IE
  28490. * - Firefox
  28491. * - Safari
  28492. * - Chrome
  28493. * - Opera
  28494. * - Other
  28495. * @type String
  28496. * @readonly
  28497. */
  28498. name: null,
  28499. /**
  28500. * Refer to {@link Ext.Version}.
  28501. * @type Ext.Version
  28502. * @readonly
  28503. */
  28504. version: null,
  28505. /**
  28506. * The full name of the current browser's engine.
  28507. * Possible values are:
  28508. *
  28509. * - WebKit
  28510. * - Gecko
  28511. * - Presto
  28512. * - Trident
  28513. * - Other
  28514. * @type String
  28515. * @readonly
  28516. */
  28517. engineName: null,
  28518. /**
  28519. * Refer to {@link Ext.Version}.
  28520. * @type Ext.Version
  28521. * @readonly
  28522. */
  28523. engineVersion: null,
  28524. setFlag: function(name, value, publish) {
  28525. if (value === undefined) {
  28526. value = true;
  28527. }
  28528. this.is[name] = value;
  28529. this.is[name.toLowerCase()] = value;
  28530. if (publish) {
  28531. Ext['is' + name] = value;
  28532. }
  28533. return this;
  28534. },
  28535. getStyleDashPrefix: function() {
  28536. return this.styleDashPrefixes[this.engineName];
  28537. },
  28538. getStylePrefix: function() {
  28539. return this.stylePrefixes[this.engineName];
  28540. },
  28541. getVendorProperyName: function(name) {
  28542. var prefix = this.propertyPrefixes[this.engineName];
  28543. if (prefix.length > 0) {
  28544. return prefix + Ext.String.capitalize(name);
  28545. }
  28546. return name;
  28547. }
  28548. };
  28549. /**
  28550. * @class Ext.browser
  28551. * @extends Ext.env.Browser
  28552. * @singleton
  28553. * Provides useful information about the current browser.
  28554. *
  28555. * Example:
  28556. *
  28557. * if (Ext.browser.is.IE) {
  28558. * // IE specific code here
  28559. * }
  28560. *
  28561. * if (Ext.browser.is.WebKit) {
  28562. * // WebKit specific code here
  28563. * }
  28564. *
  28565. * console.log("Version " + Ext.browser.version);
  28566. *
  28567. * For a full list of supported values, refer to {@link #is} property/method.
  28568. *
  28569. */
  28570. (function(userAgent) {
  28571. Ext.browser = new Ext.env.Browser(userAgent, true);
  28572. Ext.userAgent = userAgent.toLowerCase();
  28573. /**
  28574. * @property {String} SSL_SECURE_URL
  28575. * URL to a blank file used by Ext when in secure mode for iframe src and onReady src
  28576. * to prevent the IE insecure content warning (`'about:blank'`, except for IE
  28577. * in secure mode, which is `'javascript:""'`).
  28578. * @member Ext
  28579. */
  28580. Ext.SSL_SECURE_URL = Ext.isSecure && Ext.isIE ? 'javascript:\'\'' : 'about:blank';
  28581. }(// jshint ignore:line
  28582. Ext.global.navigator.userAgent));
  28583. /**
  28584. * @class Ext.env.OS
  28585. *
  28586. * Provides information about operating system environment.
  28587. *
  28588. * Should not be manually instantiated unless for unit-testing.
  28589. * Access the global instance stored in {@link Ext.os} instead.
  28590. * @private
  28591. */
  28592. Ext.env.OS = function(userAgent, platform, browserScope) {
  28593. // @define Ext.env.OS
  28594. // @define Ext.os
  28595. // @require Ext.Version
  28596. // @require Ext.env.Browser
  28597. var me = this,
  28598. names = Ext.Boot.osNames,
  28599. prefixes = Ext.Boot.osPrefixes,
  28600. name,
  28601. version = '',
  28602. is = me.is,
  28603. i, prefix, match, item, match1;
  28604. browserScope = browserScope || Ext.browser;
  28605. for (i in prefixes) {
  28606. if (prefixes.hasOwnProperty(i)) {
  28607. prefix = prefixes[i];
  28608. match = userAgent.match(new RegExp('(?:' + prefix + ')([^\\s;]+)'));
  28609. if (match) {
  28610. name = names[i];
  28611. match1 = match[1];
  28612. // This is here because some HTC android devices show an OSX Snow Leopard userAgent by default.
  28613. // And the Kindle Fire doesn't have any indicator of Android as the OS in its User Agent
  28614. if (match1 && match1 === "HTC_") {
  28615. version = new Ext.Version("2.3");
  28616. } else if (match1 && match1 === "Silk/") {
  28617. version = new Ext.Version("2.3");
  28618. } else {
  28619. version = new Ext.Version(match[match.length - 1]);
  28620. }
  28621. break;
  28622. }
  28623. }
  28624. }
  28625. if (!name) {
  28626. name = names[(userAgent.toLowerCase().match(/mac|win|linux/) || [
  28627. 'other'
  28628. ])[0]];
  28629. version = new Ext.Version('');
  28630. }
  28631. this.name = name;
  28632. this.version = version;
  28633. // This is added as a workaround for Chrome iPad emulation mode
  28634. // it will report the platform of the machine (MacIntel, Win32, etc) instead
  28635. // of an emulated platform
  28636. if (userAgent.match(/ipad/i)) {
  28637. platform = 'iPad';
  28638. }
  28639. if (platform) {
  28640. this.setFlag(platform.replace(/ simulator$/i, ''));
  28641. }
  28642. this.setFlag(name);
  28643. if (version) {
  28644. this.setFlag(name + (version.getMajor() || ''));
  28645. this.setFlag(name + version.getShortVersion());
  28646. }
  28647. for (i in names) {
  28648. if (names.hasOwnProperty(i)) {
  28649. item = names[i];
  28650. if (!is.hasOwnProperty(name)) {
  28651. this.setFlag(item, (name === item));
  28652. }
  28653. }
  28654. }
  28655. // Detect if the device is the iPhone 5.
  28656. if (this.name === "iOS" && window.screen.height === 568) {
  28657. this.setFlag('iPhone5');
  28658. }
  28659. if (browserScope.is.Safari || browserScope.is.Silk) {
  28660. // Ext.browser.version.shortVersion == 501 is for debugging off device
  28661. if (this.is.Android2 || this.is.Android3 || browserScope.version.shortVersion === 501) {
  28662. browserScope.setFlag("AndroidStock");
  28663. }
  28664. if (this.is.Android4) {
  28665. browserScope.setFlag("AndroidStock");
  28666. browserScope.setFlag("AndroidStock4");
  28667. }
  28668. }
  28669. };
  28670. Ext.env.OS.prototype = {
  28671. constructor: Ext.env.OS,
  28672. /**
  28673. * A "hybrid" property, can be either accessed as a method call, i.e:
  28674. *
  28675. * if (Ext.os.is('Android')) {
  28676. * // ...
  28677. * }
  28678. *
  28679. * or as an object with boolean properties, i.e:
  28680. *
  28681. * if (Ext.os.is.Android) {
  28682. * // ...
  28683. * }
  28684. *
  28685. * Versions can be conveniently checked as well. For example:
  28686. *
  28687. * if (Ext.os.is.Android2) {
  28688. * // Equivalent to (Ext.os.is.Android && Ext.os.version.equals(2))
  28689. * }
  28690. *
  28691. * if (Ext.os.is.iOS32) {
  28692. * // Equivalent to (Ext.os.is.iOS && Ext.os.version.equals(3.2))
  28693. * }
  28694. *
  28695. * Note that only {@link Ext.Version#getMajor major component} and {@link Ext.Version#getShortVersion simplified}
  28696. * value of the version are available via direct property checking. Supported values are:
  28697. *
  28698. * - iOS
  28699. * - iPad
  28700. * - iPhone
  28701. * - iPhone5 (also true for 4in iPods).
  28702. * - iPod
  28703. * - Android
  28704. * - WebOS
  28705. * - BlackBerry
  28706. * - Bada
  28707. * - MacOS
  28708. * - Windows
  28709. * - Linux
  28710. * - Other
  28711. * @member Ext.os
  28712. * @param {String} name The OS name to check.
  28713. * @return {Boolean}
  28714. */
  28715. is: function(name) {
  28716. return !!this[name];
  28717. },
  28718. /**
  28719. * @property {String} [name=null]
  28720. * @readonly
  28721. * @member Ext.os
  28722. * The full name of the current operating system. Possible values are:
  28723. *
  28724. * - iOS
  28725. * - Android
  28726. * - WebOS
  28727. * - BlackBerry,
  28728. * - MacOS
  28729. * - Windows
  28730. * - Linux
  28731. * - Other
  28732. */
  28733. name: null,
  28734. /**
  28735. * @property {Ext.Version} [version=null]
  28736. * Refer to {@link Ext.Version}
  28737. * @member Ext.os
  28738. * @readonly
  28739. */
  28740. version: null,
  28741. setFlag: function(name, value) {
  28742. if (value === undefined) {
  28743. value = true;
  28744. }
  28745. if (this.flags) {
  28746. this.flags[name] = value;
  28747. }
  28748. this.is[name] = value;
  28749. this.is[name.toLowerCase()] = value;
  28750. return this;
  28751. }
  28752. };
  28753. (function() {
  28754. var navigation = Ext.global.navigator,
  28755. userAgent = navigation.userAgent,
  28756. OS = Ext.env.OS,
  28757. is = (Ext.is || (Ext.is = {})),
  28758. osEnv, osName, deviceType;
  28759. OS.prototype.flags = is;
  28760. /**
  28761. * @class Ext.os
  28762. * @extends Ext.env.OS
  28763. * @singleton
  28764. * Provides useful information about the current operating system environment.
  28765. *
  28766. * Example:
  28767. *
  28768. * if (Ext.os.is.Windows) {
  28769. * // Windows specific code here
  28770. * }
  28771. *
  28772. * if (Ext.os.is.iOS) {
  28773. * // iPad, iPod, iPhone, etc.
  28774. * }
  28775. *
  28776. * console.log("Version " + Ext.os.version);
  28777. *
  28778. * For a full list of supported values, refer to the {@link #is} property/method.
  28779. *
  28780. */
  28781. Ext.os = osEnv = new OS(userAgent, navigation.platform);
  28782. osName = osEnv.name;
  28783. // A couple compatible flavors:
  28784. Ext['is' + osName] = true;
  28785. // e.g., Ext.isWindows
  28786. Ext.isMac = is.Mac = is.MacOS;
  28787. Ext.isApple = Ext.isMac || Ext.isiOS;
  28788. var search = window.location.search.match(/deviceType=(Tablet|Phone)/),
  28789. nativeDeviceType = window.deviceType;
  28790. // Override deviceType by adding a get variable of deviceType. NEEDED FOR DOCS APP.
  28791. // E.g: example/kitchen-sink.html?deviceType=Phone
  28792. if (search && search[1]) {
  28793. deviceType = search[1];
  28794. } else if (nativeDeviceType === 'iPhone') {
  28795. deviceType = 'Phone';
  28796. } else if (nativeDeviceType === 'iPad') {
  28797. deviceType = 'Tablet';
  28798. } else {
  28799. if (!osEnv.is.Android && !osEnv.is.iOS && !osEnv.is.WindowsPhone && /Windows|Linux|MacOS|ChromeOS/.test(osName)) {
  28800. deviceType = 'Desktop';
  28801. // always set it to false when you are on a desktop not using Ripple Emulation
  28802. Ext.browser.is.WebView = !!Ext.browser.is.Ripple;
  28803. } else if (osEnv.is.iPad || osEnv.is.RIMTablet || osEnv.is.Android3 || Ext.browser.is.Silk || (osEnv.is.Android && userAgent.search(/mobile/i) === -1)) {
  28804. deviceType = 'Tablet';
  28805. } else {
  28806. deviceType = 'Phone';
  28807. }
  28808. }
  28809. /**
  28810. * @property {String} deviceType
  28811. * The generic type of the current device.
  28812. *
  28813. * Possible values:
  28814. *
  28815. * - Phone
  28816. * - Tablet
  28817. * - Desktop
  28818. *
  28819. * For testing purposes the deviceType can be overridden by adding
  28820. * a deviceType parameter to the URL of the page, like so:
  28821. *
  28822. * http://localhost/mypage.html?deviceType=Tablet
  28823. *
  28824. * @member Ext.os
  28825. */
  28826. osEnv.setFlag(deviceType, true);
  28827. osEnv.deviceType = deviceType;
  28828. delete OS.prototype.flags;
  28829. }());
  28830. /**
  28831. * @class Ext.feature
  28832. * @singleton
  28833. *
  28834. * A simple class to verify if a browser feature exists or not on the current device.
  28835. *
  28836. * if (Ext.feature.has.Canvas) {
  28837. * // do some cool things with canvas here
  28838. * }
  28839. *
  28840. * See the {@link #has} property/method for details of the features that can be detected.
  28841. *
  28842. */
  28843. Ext.feature = {
  28844. // @define Ext.env.Feature
  28845. // @define Ext.feature
  28846. // @define Ext.supports
  28847. // @require Ext.String
  28848. // @require Ext.env.Browser
  28849. // @require Ext.env.OS
  28850. /**
  28851. * @method has
  28852. * @member Ext.feature
  28853. * Verifies if a browser feature exists or not on the current device.
  28854. *
  28855. * A "hybrid" property, can be either accessed as a method call, i.e:
  28856. *
  28857. * if (Ext.feature.has('Canvas')) {
  28858. * // ...
  28859. * }
  28860. *
  28861. * or as an object with boolean properties, i.e:
  28862. *
  28863. * if (Ext.feature.has.Canvas) {
  28864. * // ...
  28865. * }
  28866. *
  28867. * For possible properties/parameter values see `Ext.supports`.
  28868. *
  28869. * @param {String} name The feature name to check.
  28870. * @return {Boolean}
  28871. */
  28872. has: function(name) {
  28873. return !!this.has[name];
  28874. },
  28875. testElements: {},
  28876. getTestElement: function(tag, createNew) {
  28877. if (tag === undefined) {
  28878. tag = 'div';
  28879. } else if (typeof tag !== 'string') {
  28880. return tag;
  28881. }
  28882. if (createNew) {
  28883. return document.createElement(tag);
  28884. }
  28885. if (!this.testElements[tag]) {
  28886. this.testElements[tag] = document.createElement(tag);
  28887. }
  28888. return this.testElements[tag];
  28889. },
  28890. isStyleSupported: function(name, tag) {
  28891. var elementStyle = this.getTestElement(tag).style,
  28892. cName = Ext.String.capitalize(name);
  28893. if (typeof elementStyle[name] !== 'undefined' || typeof elementStyle[Ext.browser.getStylePrefix(name) + cName] !== 'undefined') {
  28894. return true;
  28895. }
  28896. return false;
  28897. },
  28898. isStyleSupportedWithoutPrefix: function(name, tag) {
  28899. var elementStyle = this.getTestElement(tag).style;
  28900. if (typeof elementStyle[name] !== 'undefined') {
  28901. return true;
  28902. }
  28903. return false;
  28904. },
  28905. isEventSupported: function(name, tag) {
  28906. if (tag === undefined) {
  28907. tag = window;
  28908. }
  28909. var element = this.getTestElement(tag),
  28910. eventName = 'on' + name.toLowerCase(),
  28911. isSupported = (eventName in element);
  28912. if (!isSupported) {
  28913. if (element.setAttribute && element.removeAttribute) {
  28914. element.setAttribute(eventName, '');
  28915. isSupported = typeof element[eventName] === 'function';
  28916. if (typeof element[eventName] !== 'undefined') {
  28917. element[eventName] = undefined;
  28918. }
  28919. element.removeAttribute(eventName);
  28920. }
  28921. }
  28922. return isSupported;
  28923. },
  28924. // This is a local copy of certain logic from Element.getStyle
  28925. // to break a dependancy between the supports mechanism and Element
  28926. // use this instead of element references to check for styling info
  28927. getStyle: function(element, styleName) {
  28928. var view = element.ownerDocument.defaultView,
  28929. style = (view ? view.getComputedStyle(element, null) : element.currentStyle);
  28930. return (style || element.style)[styleName];
  28931. },
  28932. getSupportedPropertyName: function(object, name) {
  28933. var vendorName = Ext.browser.getVendorProperyName(name);
  28934. if (vendorName in object) {
  28935. return vendorName;
  28936. } else if (name in object) {
  28937. return name;
  28938. }
  28939. return null;
  28940. },
  28941. /**
  28942. * Runs feature detection routines and sets the various flags. This is called when
  28943. * the scripts loads (very early) and again at {@link Ext#onReady}. Some detections
  28944. * can be run immediately. Others that require the document body will not run until
  28945. * domready (these have the `ready` flag set).
  28946. *
  28947. * Each test is run only once, so calling this method from an onReady function is safe
  28948. * and ensures that all flags have been set.
  28949. * @private
  28950. */
  28951. detect: function(isReady) {
  28952. var me = this,
  28953. doc = document,
  28954. toRun = me.toRun || me.tests,
  28955. n = toRun.length,
  28956. div = doc.createElement('div'),
  28957. notRun = [],
  28958. supports = Ext.supports,
  28959. has = me.has,
  28960. name, names, test, vector, value;
  28961. // Only the legacy browser tests use this div so clip this out if we don't need
  28962. // to use it.
  28963. 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>';
  28964. if (isReady) {
  28965. doc.body.appendChild(div);
  28966. }
  28967. vector = me.preDetected[Ext.browser.identity] || [];
  28968. while (n--) {
  28969. test = toRun[n];
  28970. value = vector[n];
  28971. name = test.name;
  28972. names = test.names;
  28973. if (value === undefined) {
  28974. if (!isReady && test.ready) {
  28975. // test requires domready state
  28976. notRun.push(test);
  28977. continue;
  28978. }
  28979. value = test.fn.call(me, doc, div);
  28980. }
  28981. // Store test results on Ext.supports and Ext.feature.has
  28982. if (name) {
  28983. supports[name] = has[name] = value;
  28984. } else if (names) {
  28985. while (names.length) {
  28986. name = names.pop();
  28987. supports[name] = has[name] = value;
  28988. }
  28989. }
  28990. }
  28991. if (isReady) {
  28992. doc.body.removeChild(div);
  28993. }
  28994. me.toRun = notRun;
  28995. },
  28996. //</debug>
  28997. report: function() {
  28998. var values = [],
  28999. len = this.tests.length,
  29000. i;
  29001. for (i = 0; i < len; ++i) {
  29002. values.push(this.has[this.tests[i].name] ? 1 : 0);
  29003. }
  29004. Ext.log(Ext.browser.identity + ': [' + values.join(',') + ']');
  29005. },
  29006. //</debug>
  29007. preDetected: {},
  29008. // TODO
  29009. /**
  29010. * @class Ext.supports
  29011. *
  29012. * Contains information about features supported in the current environment as well
  29013. * as bugs detected.
  29014. *
  29015. * @singleton
  29016. */
  29017. tests: [
  29018. {
  29019. /**
  29020. * @property CloneNodeCopiesExpando `true` if the native DOM cloneNode method copies
  29021. * expando properties to the newly cloned node.
  29022. *
  29023. * This property is available at application boot time, before document ready.
  29024. * @type {Boolean}
  29025. */
  29026. name: 'CloneNodeCopiesExpando',
  29027. fn: function() {
  29028. var el = document.createElement('div');
  29029. el.expandoProp = {};
  29030. return el.cloneNode().expandoProp === el.expandoProp;
  29031. }
  29032. },
  29033. {
  29034. /**
  29035. * @property CSSPointerEvents `true` if document environment supports the CSS3
  29036. * pointer-events style.
  29037. *
  29038. * This property is available at application boot time, before document ready.
  29039. * @type {Boolean}
  29040. */
  29041. name: 'CSSPointerEvents',
  29042. fn: function(doc) {
  29043. return 'pointerEvents' in doc.documentElement.style;
  29044. }
  29045. },
  29046. {
  29047. /**
  29048. * @property CSS3BoxShadow `true` if document environment supports the CSS3
  29049. * box-shadow style.
  29050. *
  29051. * This property is available at application boot time, before document ready.
  29052. * @type {Boolean}
  29053. */
  29054. name: 'CSS3BoxShadow',
  29055. fn: function(doc) {
  29056. return 'boxShadow' in doc.documentElement.style || 'WebkitBoxShadow' in doc.documentElement.style || 'MozBoxShadow' in doc.documentElement.style;
  29057. }
  29058. },
  29059. {
  29060. name: 'CSS3NegationSelector',
  29061. fn: function(doc) {
  29062. try {
  29063. doc.querySelectorAll("foo:not(bar)");
  29064. } catch (e) {
  29065. return false;
  29066. }
  29067. return true;
  29068. }
  29069. },
  29070. {
  29071. /**
  29072. * @property ClassList `true` if document environment supports the HTML5
  29073. * classList API.
  29074. *
  29075. * This property is available at application boot time, before document ready.
  29076. * @type {Boolean}
  29077. */
  29078. name: 'ClassList',
  29079. fn: function(doc) {
  29080. return !!doc.documentElement.classList;
  29081. }
  29082. },
  29083. {
  29084. /**
  29085. * @property Canvas `true` if the device supports Canvas.
  29086. *
  29087. * This property is available at application boot time, before document ready.
  29088. * @type {Boolean}
  29089. */
  29090. name: 'Canvas',
  29091. fn: function() {
  29092. var element = this.getTestElement('canvas');
  29093. return !!(element && element.getContext && element.getContext('2d'));
  29094. }
  29095. },
  29096. {
  29097. /**
  29098. * @property Svg `true` if the device supports SVG.
  29099. *
  29100. * This property is available at application boot time, before document ready.
  29101. * @type {Boolean}
  29102. */
  29103. name: 'Svg',
  29104. fn: function(doc) {
  29105. return !!(doc.createElementNS && !!doc.createElementNS("http:/" + "/www.w3.org/2000/svg", "svg").createSVGRect);
  29106. }
  29107. },
  29108. {
  29109. /**
  29110. * @property Vml `true` if the device supports VML.
  29111. * @type {Boolean}
  29112. *
  29113. * This property is available at application boot time, before document ready.
  29114. */
  29115. name: 'Vml',
  29116. fn: function() {
  29117. var element = this.getTestElement(),
  29118. ret = false;
  29119. element.innerHTML = "<!--[if vml]><br><![endif]-->";
  29120. ret = (element.childNodes.length === 1);
  29121. element.innerHTML = "";
  29122. return ret;
  29123. }
  29124. },
  29125. {
  29126. /**
  29127. * @property {Boolean} Touch `true` if the browser supports touch input.
  29128. *
  29129. * This property is available at application boot time, before document ready.
  29130. */
  29131. name: 'Touch',
  29132. fn: function() {
  29133. // IE10 uses a vendor-prefixed maxTouchPoints property
  29134. var maxTouchPoints = navigator.msMaxTouchPoints || navigator.maxTouchPoints;
  29135. // if the browser has touch events we can be reasonably sure the device has
  29136. // a touch screen
  29137. // browsers that use pointer event have maxTouchPoints > 1 if the
  29138. // device supports touch input
  29139. // Chrome Desktop < 39 reports maxTouchPoints === 1 even if there is no
  29140. // touch support on the device
  29141. // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
  29142. // Chrome Desktop > 39 properly reports maxTouchPoints === 0 and
  29143. // Chrome Desktop Device Emulation mode reports maxTouchPoints === 1
  29144. if (Ext.browser.is.Chrome && Ext.browser.version.isLessThanOrEqual(39)) {
  29145. return (Ext.supports.TouchEvents && maxTouchPoints !== 1) || maxTouchPoints > 1;
  29146. } else {
  29147. return Ext.supports.TouchEvents || maxTouchPoints > 0;
  29148. }
  29149. }
  29150. },
  29151. {
  29152. /**
  29153. * @property {Boolean} PointerEvents
  29154. * @type {Boolean}
  29155. * @private
  29156. *
  29157. * `true` If the event system should use [pointer events](https://www.w3.org/TR/pointerevents/).
  29158. * Currently only set to true if the browser supports pointer events and does not
  29159. * also support touch events. Touch events are preferred since they allow run-time
  29160. * cancellation of browser default behavior such as scrolling by invoking `e.preventDefault()`
  29161. * whereas pointer events require such intentions to be declared in advance via
  29162. * CSS [touch-action](https://www.w3.org/TR/pointerevents/#h3_the-touch-action-css-property).
  29163. * This means that when pointer events are used, certain interactions are not possible
  29164. * such as long-press to drag within a scrollable element.
  29165. */
  29166. name: 'PointerEvents',
  29167. fn: function() {
  29168. return !!(window.PointerEvent && !Ext.supports.TouchEvents);
  29169. }
  29170. },
  29171. {
  29172. /**
  29173. * @property {Boolean} MSPointerEvents
  29174. * @private
  29175. */
  29176. name: 'MSPointerEvents',
  29177. fn: function() {
  29178. return Ext.isIE10;
  29179. }
  29180. },
  29181. {
  29182. /**
  29183. * @property {Boolean} TouchEvents
  29184. *
  29185. * `true` if the device supports touch events (`touchstart`, `touchmove`, `touchend`).
  29186. *
  29187. * This property is available at application boot time, before document ready.
  29188. */
  29189. name: 'TouchEvents',
  29190. fn: function() {
  29191. return this.isEventSupported('touchend');
  29192. }
  29193. },
  29194. {
  29195. /**
  29196. * @property {Boolean} TouchAction
  29197. * @private
  29198. *
  29199. * A bit flag representing which property values the browser recognizes as valid
  29200. * values of the CSS `touch-action` property.
  29201. *
  29202. * panX 1 "00000001"
  29203. * panY 2 "00000010"
  29204. * pinchZoom 4 "00000100"
  29205. * doubleTapZoom 8 "00001000"
  29206. */
  29207. name: 'TouchAction',
  29208. ready: true,
  29209. fn: function(doc, div) {
  29210. if (!window.getComputedStyle) {
  29211. return 0;
  29212. }
  29213. var values = [
  29214. 'pan-x',
  29215. 'pan-y',
  29216. 'pinch-zoom',
  29217. 'double-tap-zoom'
  29218. ],
  29219. flags = [
  29220. 1,
  29221. 2,
  29222. 4,
  29223. 8
  29224. ],
  29225. ln = values.length,
  29226. flag = 0,
  29227. i, value;
  29228. for (i = 0; i < ln; i++) {
  29229. value = values[i];
  29230. div.style.touchAction = value;
  29231. if (getComputedStyle(div).touchAction === value) {
  29232. flag |= flags[i];
  29233. }
  29234. }
  29235. return flag;
  29236. }
  29237. },
  29238. {
  29239. /**
  29240. * @property Orientation `true` if the device supports different orientations.
  29241. * @type {Boolean}
  29242. *
  29243. * This property is available at application boot time, before document ready.
  29244. */
  29245. name: 'Orientation',
  29246. fn: function() {
  29247. return ('orientation' in window) && this.isEventSupported('orientationchange');
  29248. }
  29249. },
  29250. {
  29251. /**
  29252. * @property OrientationChange `true` if the device supports the `orientationchange`
  29253. * event.
  29254. *
  29255. * This property is available at application boot time, before document ready.
  29256. * @type {Boolean}
  29257. */
  29258. name: 'OrientationChange',
  29259. fn: function() {
  29260. return this.isEventSupported('orientationchange');
  29261. }
  29262. },
  29263. {
  29264. /**
  29265. * @property DeviceMotion `true` if the device supports device motion (acceleration
  29266. * and rotation rate).
  29267. *
  29268. * This property is available at application boot time, before document ready.
  29269. * @type {Boolean}
  29270. */
  29271. name: 'DeviceMotion',
  29272. fn: function() {
  29273. return this.isEventSupported('devicemotion');
  29274. }
  29275. },
  29276. {
  29277. /**
  29278. * @property Geolocation `true` if the device supports GeoLocation.
  29279. * @type {Boolean}
  29280. *
  29281. * This property is available at application boot time, before document ready.
  29282. */
  29283. /**
  29284. * @property GeoLocation `true` if the device supports Geo-location.
  29285. * @type {Boolean}
  29286. * @deprecated 5.0.0 Use `Geolocation` instead (notice the lower-casing of 'L').
  29287. */
  29288. names: [
  29289. 'Geolocation',
  29290. 'GeoLocation'
  29291. ],
  29292. fn: function() {
  29293. return 'geolocation' in window.navigator;
  29294. }
  29295. },
  29296. {
  29297. name: 'SqlDatabase',
  29298. fn: function() {
  29299. return 'openDatabase' in window;
  29300. }
  29301. },
  29302. {
  29303. name: 'WebSockets',
  29304. fn: function() {
  29305. return 'WebSocket' in window;
  29306. }
  29307. },
  29308. {
  29309. /**
  29310. * @property Range `true` if browser support document.createRange native method.
  29311. * See https://developer.mozilla.org/en/DOM/range.
  29312. *
  29313. * This property is available at application boot time, before document ready.
  29314. * @type {Boolean}
  29315. */
  29316. name: 'Range',
  29317. fn: function() {
  29318. return !!document.createRange;
  29319. }
  29320. },
  29321. {
  29322. /**
  29323. * @property CreateContextualFragment `true` if browser support CreateContextualFragment
  29324. * range native methods.
  29325. * See https://developer.mozilla.org/en/DOM/range.createContextualFragment
  29326. *
  29327. * This property is available at application boot time, before document ready.
  29328. * @type {Boolean}
  29329. */
  29330. name: 'CreateContextualFragment',
  29331. fn: function() {
  29332. var range = !!document.createRange ? document.createRange() : false;
  29333. return range && !!range.createContextualFragment;
  29334. }
  29335. },
  29336. {
  29337. /**
  29338. * @property History `true` if the device supports HTML5 history. See
  29339. * https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history
  29340. *
  29341. * This property is available at application boot time, before document ready.
  29342. * @type {Boolean}
  29343. */
  29344. name: 'History',
  29345. fn: function() {
  29346. return ('history' in window && 'pushState' in window.history);
  29347. }
  29348. },
  29349. {
  29350. /**
  29351. * @property Css3DTransforms `true` if the device supports CSS3DTransform.
  29352. * @type {Boolean}
  29353. *
  29354. * This property is available at application boot time, before document ready.
  29355. */
  29356. name: 'Css3dTransforms',
  29357. fn: function() {
  29358. // See https://sencha.jira.com/browse/TOUCH-1544
  29359. return this.has('CssTransforms') && this.isStyleSupported('perspective');
  29360. }
  29361. },
  29362. // TODO - double check vs Ext JS flavor:
  29363. //return (typeof WebKitCSSMatrix != 'undefined' && new WebKitCSSMatrix().hasOwnProperty('m41'));
  29364. {
  29365. // Important that this goes after Css3dTransforms, since tests are run in reverse order
  29366. name: 'CssTransforms',
  29367. fn: function() {
  29368. return this.isStyleSupported('transform');
  29369. }
  29370. },
  29371. {
  29372. name: 'CssTransformNoPrefix',
  29373. fn: function() {
  29374. return this.isStyleSupportedWithoutPrefix('transform');
  29375. }
  29376. },
  29377. {
  29378. name: 'CssAnimations',
  29379. fn: function() {
  29380. return this.isStyleSupported('animationName');
  29381. }
  29382. },
  29383. {
  29384. /**
  29385. * @property Transitions `true` if the device supports CSS3 Transitions.
  29386. *
  29387. * This property is available at application boot time, before document ready.
  29388. * @type {Boolean}
  29389. */
  29390. names: [
  29391. 'CssTransitions',
  29392. 'Transitions'
  29393. ],
  29394. fn: function() {
  29395. return this.isStyleSupported('transitionProperty');
  29396. }
  29397. },
  29398. {
  29399. /**
  29400. * @property Audio `true` if the device supports the HTML5 `audio` tag.
  29401. *
  29402. * This property is available at application boot time, before document ready.
  29403. * @type {Boolean}
  29404. */
  29405. /**
  29406. * @property AudioTag `true` if the device supports the HTML5 `audio` tag.
  29407. * @type {Boolean}
  29408. * @deprecated 5.0.0 Use `Audio` instead.
  29409. */
  29410. names: [
  29411. 'Audio',
  29412. 'AudioTag'
  29413. ],
  29414. fn: function() {
  29415. return !!this.getTestElement('audio').canPlayType;
  29416. }
  29417. },
  29418. {
  29419. /**
  29420. * @property Video `true` if the device supports the HTML5 `video` tag.
  29421. *
  29422. * This property is available at application boot time, before document ready.
  29423. * @type {Boolean}
  29424. */
  29425. name: 'Video',
  29426. fn: function() {
  29427. return !!this.getTestElement('video').canPlayType;
  29428. }
  29429. },
  29430. {
  29431. /**
  29432. * @property LocalStorage `true` if localStorage is supported.
  29433. *
  29434. * This property is available at application boot time, before document ready.
  29435. * @type {Boolean}
  29436. */
  29437. name: 'LocalStorage',
  29438. fn: function() {
  29439. try {
  29440. // IE10/Win8 throws "Access Denied" accessing window.localStorage, so
  29441. // this test needs to have a try/catch
  29442. if ('localStorage' in window && window['localStorage'] !== null) {
  29443. // jshint ignore:line
  29444. //this should throw an error in private browsing mode in iOS as well
  29445. localStorage.setItem('sencha-localstorage-test', 'test success');
  29446. //clean up if setItem worked
  29447. localStorage.removeItem('sencha-localstorage-test');
  29448. return true;
  29449. }
  29450. } catch (e) {}
  29451. // ignore
  29452. return false;
  29453. }
  29454. },
  29455. {
  29456. /**
  29457. * @property {Boolean} XmlQuerySelector `true` if the browsers supports querySelector
  29458. * and querySelectorAll methods on XML nodes.
  29459. *
  29460. * This property is available at application boot time, before document ready.
  29461. */
  29462. name: 'XmlQuerySelector',
  29463. fn: function() {
  29464. var xmlString = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><root></root>',
  29465. xmlDoc;
  29466. // IE10 doesn't create IXMLDOMDocument via DOMParser
  29467. if (window.ActiveXObject) {
  29468. xmlDoc = new ActiveXObject("Microsoft.xmlDOM");
  29469. xmlDoc.async = false;
  29470. xmlDoc.loadXML(xmlString);
  29471. } else if (window.DOMParser) {
  29472. var parser = new DOMParser();
  29473. xmlDoc = parser.parseFromString(xmlString, 'text/xml');
  29474. }
  29475. return xmlDoc ? !!xmlDoc.lastChild.querySelector : false;
  29476. }
  29477. },
  29478. {
  29479. /**
  29480. * @property XHR2 `true` if the browser supports XMLHttpRequest
  29481. *
  29482. * This property is available at application boot time, before document ready.
  29483. * @type {Boolean}
  29484. */
  29485. name: 'XHR2',
  29486. fn: function() {
  29487. return window.ProgressEvent && window.FormData && window.XMLHttpRequest && ('withCredentials' in new XMLHttpRequest());
  29488. }
  29489. },
  29490. {
  29491. /**
  29492. * @property XHRUploadProgress `true` if the browser supports XMLHttpRequest
  29493. * upload progress info
  29494. *
  29495. * This property is available at application boot time, before document ready.
  29496. * @type {Boolean}
  29497. */
  29498. name: 'XHRUploadProgress',
  29499. fn: function() {
  29500. if (window.XMLHttpRequest && !Ext.browser.is.AndroidStock) {
  29501. var xhr = new XMLHttpRequest();
  29502. return xhr && ('upload' in xhr) && ('onprogress' in xhr.upload);
  29503. }
  29504. return false;
  29505. }
  29506. },
  29507. {
  29508. /**
  29509. * @property NumericInputPlaceHolder `true` if the browser supports placeholders
  29510. * on numeric input fields
  29511. *
  29512. * This property is available at application boot time, before document ready.
  29513. * @type {Boolean}
  29514. */
  29515. name: 'NumericInputPlaceHolder',
  29516. fn: function() {
  29517. return !(Ext.browser.is.AndroidStock4 && Ext.os.version.getMinor() < 2);
  29518. }
  29519. },
  29520. /**
  29521. * @property {String} matchesSelector
  29522. * The method name which matches an element against a selector if implemented in this environment.
  29523. *
  29524. * This property is available at application boot time, before document ready.
  29525. */
  29526. {
  29527. name: 'matchesSelector',
  29528. fn: function() {
  29529. var el = document.documentElement,
  29530. w3 = 'matches',
  29531. wk = 'webkitMatchesSelector',
  29532. ms = 'msMatchesSelector',
  29533. mz = 'mozMatchesSelector';
  29534. return el[w3] ? w3 : el[wk] ? wk : el[ms] ? ms : el[mz] ? mz : null;
  29535. }
  29536. },
  29537. /**
  29538. * @property RightMargin `true` if the device supports right margin.
  29539. * See https://bugs.webkit.org/show_bug.cgi?id=13343 for why this is needed.
  29540. *
  29541. * This property is *NOT* available at application boot time. Only after the document ready event.
  29542. * @type {Boolean}
  29543. */
  29544. {
  29545. name: 'RightMargin',
  29546. ready: true,
  29547. fn: function(doc, div) {
  29548. var view = doc.defaultView;
  29549. return !(view && view.getComputedStyle(div.firstChild.firstChild, null).marginRight !== '0px');
  29550. }
  29551. },
  29552. /**
  29553. * @property DisplayChangeInputSelectionBug `true` if INPUT elements lose their
  29554. * selection when their display style is changed. Essentially, if a text input
  29555. * has focus and its display style is changed, the I-beam disappears.
  29556. *
  29557. * This bug is encountered due to the work around in place for the {@link #RightMargin}
  29558. * bug. This has been observed in Safari 4.0.4 and older, and appears to be fixed
  29559. * in Safari 5. It's not clear if Safari 4.1 has the bug, but it has the same WebKit
  29560. * version number as Safari 5 (according to http://unixpapa.com/js/gecko.html).
  29561. *
  29562. * This property is available at application boot time, before document ready.
  29563. */
  29564. {
  29565. name: 'DisplayChangeInputSelectionBug',
  29566. fn: function() {
  29567. var webKitVersion = Ext.webKitVersion;
  29568. // WebKit but older than Safari 5 or Chrome 6:
  29569. return 0 < webKitVersion && webKitVersion < 533;
  29570. }
  29571. },
  29572. /**
  29573. * @property DisplayChangeTextAreaSelectionBug `true` if TEXTAREA elements lose their
  29574. * selection when their display style is changed. Essentially, if a text area has
  29575. * focus and its display style is changed, the I-beam disappears.
  29576. *
  29577. * This bug is encountered due to the work around in place for the {@link #RightMargin}
  29578. * bug. This has been observed in Chrome 10 and Safari 5 and older, and appears to
  29579. * be fixed in Chrome 11.
  29580. *
  29581. * This property is available at application boot time, before document ready.
  29582. */
  29583. {
  29584. name: 'DisplayChangeTextAreaSelectionBug',
  29585. fn: function() {
  29586. var webKitVersion = Ext.webKitVersion;
  29587. /*
  29588. Has bug w/textarea:
  29589. (Chrome) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US)
  29590. AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127
  29591. Safari/534.16
  29592. (Safari) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us)
  29593. AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5
  29594. Safari/533.21.1
  29595. No bug:
  29596. (Chrome) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7)
  29597. AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57
  29598. Safari/534.24
  29599. */
  29600. return 0 < webKitVersion && webKitVersion < 534.24;
  29601. }
  29602. },
  29603. /**
  29604. * @property TransparentColor `true` if the device supports transparent color.
  29605. * @type {Boolean}
  29606. *
  29607. * This property is *NOT* available at application boot time. Only after the document ready event.
  29608. */
  29609. {
  29610. name: 'TransparentColor',
  29611. ready: true,
  29612. fn: function(doc, div, view) {
  29613. view = doc.defaultView;
  29614. return !(view && view.getComputedStyle(div.lastChild, null).backgroundColor !== 'transparent');
  29615. }
  29616. },
  29617. /**
  29618. * @property ComputedStyle `true` if the browser supports document.defaultView.getComputedStyle().
  29619. * @type {Boolean}
  29620. *
  29621. * This property is *NOT* available at application boot time. Only after the document ready event.
  29622. */
  29623. {
  29624. name: 'ComputedStyle',
  29625. ready: true,
  29626. fn: function(doc, div, view) {
  29627. view = doc.defaultView;
  29628. return !!(view && view.getComputedStyle);
  29629. }
  29630. },
  29631. /**
  29632. * @property Float `true` if the device supports CSS float.
  29633. * @type {Boolean}
  29634. *
  29635. * This property is available at application boot time, before document ready.
  29636. */
  29637. {
  29638. name: 'Float',
  29639. fn: function(doc) {
  29640. return 'cssFloat' in doc.documentElement.style;
  29641. }
  29642. },
  29643. /**
  29644. * @property CSS3BorderRadius `true` if the device supports CSS3 border radius.
  29645. * @type {Boolean}
  29646. *
  29647. * This property is *NOT* available at application boot time. Only after the document ready event.
  29648. */
  29649. {
  29650. name: 'CSS3BorderRadius',
  29651. ready: true,
  29652. fn: function(doc) {
  29653. var domPrefixes = [
  29654. 'borderRadius',
  29655. 'BorderRadius',
  29656. 'MozBorderRadius',
  29657. 'WebkitBorderRadius',
  29658. 'OBorderRadius',
  29659. 'KhtmlBorderRadius'
  29660. ],
  29661. pass = false,
  29662. i;
  29663. for (i = 0; i < domPrefixes.length; i++) {
  29664. if (doc.documentElement.style[domPrefixes[i]] !== undefined) {
  29665. pass = true;
  29666. }
  29667. }
  29668. return pass && !Ext.isIE9;
  29669. }
  29670. },
  29671. /**
  29672. * @property CSS3LinearGradient `true` if the device supports CSS3 linear gradients.
  29673. * @type {Boolean}
  29674. *
  29675. * This property is available at application boot time, before document ready.
  29676. */
  29677. {
  29678. name: 'CSS3LinearGradient',
  29679. fn: function(doc, div) {
  29680. var property = 'background-image:',
  29681. webkit = '-webkit-gradient(linear, left top, right bottom, from(black), to(white))',
  29682. w3c = 'linear-gradient(left top, black, white)',
  29683. moz = '-moz-' + w3c,
  29684. ms = '-ms-' + w3c,
  29685. opera = '-o-' + w3c,
  29686. options = [
  29687. property + webkit,
  29688. property + w3c,
  29689. property + moz,
  29690. property + ms,
  29691. property + opera
  29692. ];
  29693. div.style.cssText = options.join(';');
  29694. return (("" + div.style.backgroundImage).indexOf('gradient') !== -1) && !Ext.isIE9;
  29695. }
  29696. },
  29697. /**
  29698. * @property MouseEnterLeave `true` if the browser supports mouseenter and mouseleave events
  29699. * @type {Boolean}
  29700. *
  29701. * This property is available at application boot time, before document ready.
  29702. */
  29703. {
  29704. name: 'MouseEnterLeave',
  29705. fn: function(doc) {
  29706. return ('onmouseenter' in doc.documentElement && 'onmouseleave' in doc.documentElement);
  29707. }
  29708. },
  29709. /**
  29710. * @property MouseWheel `true` if the browser supports the mousewheel event
  29711. * @type {Boolean}
  29712. *
  29713. * This property is available at application boot time, before document ready.
  29714. */
  29715. {
  29716. name: 'MouseWheel',
  29717. fn: function(doc) {
  29718. return ('onmousewheel' in doc.documentElement);
  29719. }
  29720. },
  29721. /**
  29722. * @property Opacity `true` if the browser supports normal css opacity
  29723. * @type {Boolean}
  29724. *
  29725. * This property is available at application boot time, before document ready.
  29726. */
  29727. {
  29728. name: 'Opacity',
  29729. fn: function(doc, div) {
  29730. // Not a strict equal comparison in case opacity can be converted to a number.
  29731. if (Ext.isIE8) {
  29732. return false;
  29733. }
  29734. div.firstChild.style.cssText = 'opacity:0.73';
  29735. return div.firstChild.style.opacity == '0.73';
  29736. }
  29737. },
  29738. // jshint ignore:line
  29739. /**
  29740. * @property Placeholder `true` if the browser supports the HTML5 placeholder attribute on inputs
  29741. * @type {Boolean}
  29742. *
  29743. * This property is available at application boot time, before document ready.
  29744. */
  29745. {
  29746. name: 'Placeholder',
  29747. fn: function(doc) {
  29748. return 'placeholder' in doc.createElement('input');
  29749. }
  29750. },
  29751. /**
  29752. * @property Direct2DBug `true` if when asking for an element's dimension via offsetWidth or offsetHeight,
  29753. * getBoundingClientRect, etc. the browser returns the subpixel width rounded to the nearest pixel.
  29754. *
  29755. * This property is available at application boot time, before document ready.
  29756. * @type {Boolean}
  29757. */
  29758. {
  29759. name: 'Direct2DBug',
  29760. fn: function(doc) {
  29761. return Ext.isString(doc.documentElement.style.msTransformOrigin) && Ext.isIE9m;
  29762. }
  29763. },
  29764. /**
  29765. * @property BoundingClientRect `true` if the browser supports the getBoundingClientRect method on elements
  29766. * @type {Boolean}
  29767. *
  29768. * This property is available at application boot time, before document ready.
  29769. */
  29770. {
  29771. name: 'BoundingClientRect',
  29772. fn: function(doc) {
  29773. return 'getBoundingClientRect' in doc.documentElement;
  29774. }
  29775. },
  29776. /**
  29777. * @property RotatedBoundingClientRect `true` if the BoundingClientRect is
  29778. * rotated when the element is rotated using a CSS transform.
  29779. * @type {Boolean}
  29780. *
  29781. * This property is *NOT* available at application boot time. Only after the document ready event.
  29782. */
  29783. {
  29784. name: 'RotatedBoundingClientRect',
  29785. ready: true,
  29786. fn: function(doc) {
  29787. var body = doc.body,
  29788. supports = false,
  29789. el = doc.createElement('div'),
  29790. style = el.style;
  29791. if (el.getBoundingClientRect) {
  29792. // If the document body already has child nodes (text nodes etc) we can end
  29793. // up with subpixel rounding errors in IE11 when measuring the height.
  29794. // Absolute positioning prevents this.
  29795. style.position = 'absolute';
  29796. style.top = "0";
  29797. style.WebkitTransform = style.MozTransform = style.msTransform = style.OTransform = style.transform = 'rotate(90deg)';
  29798. style.width = '100px';
  29799. style.height = '30px';
  29800. body.appendChild(el);
  29801. supports = el.getBoundingClientRect().height !== 100;
  29802. body.removeChild(el);
  29803. }
  29804. return supports;
  29805. }
  29806. },
  29807. /**
  29808. * @property ChildContentClearedWhenSettingInnerHTML `true` if created child elements
  29809. * lose their innerHTML when modifying the innerHTML of the parent element.
  29810. * @type {Boolean}
  29811. *
  29812. * This property is *NOT* available at application boot time. Only after the document ready event.
  29813. */
  29814. {
  29815. name: 'ChildContentClearedWhenSettingInnerHTML',
  29816. ready: true,
  29817. fn: function() {
  29818. var el = this.getTestElement(),
  29819. child;
  29820. el.innerHTML = '<div>a</div>';
  29821. child = el.firstChild;
  29822. el.innerHTML = '<div>b</div>';
  29823. return child.innerHTML !== 'a';
  29824. }
  29825. },
  29826. {
  29827. name: 'IncludePaddingInWidthCalculation',
  29828. ready: true,
  29829. fn: function(doc, div) {
  29830. return div.childNodes[1].firstChild.offsetWidth === 210;
  29831. }
  29832. },
  29833. {
  29834. name: 'IncludePaddingInHeightCalculation',
  29835. ready: true,
  29836. fn: function(doc, div) {
  29837. return div.childNodes[1].firstChild.offsetHeight === 210;
  29838. }
  29839. },
  29840. /**
  29841. * @property TextAreaMaxLength `true` if the browser supports maxlength on textareas.
  29842. * @type {Boolean}
  29843. *
  29844. * This property is available at application boot time, before document ready.
  29845. */
  29846. {
  29847. name: 'TextAreaMaxLength',
  29848. fn: function(doc) {
  29849. return ('maxlength' in doc.createElement('textarea'));
  29850. }
  29851. },
  29852. /**
  29853. * @property GetPositionPercentage `true` if the browser will return the left/top/right/bottom
  29854. * position as a percentage when explicitly set as a percentage value.
  29855. *
  29856. * This property is *NOT* available at application boot time. Only after the document ready event.
  29857. * @type {Boolean}
  29858. */
  29859. // Related bug: https://bugzilla.mozilla.org/show_bug.cgi?id=707691#c7
  29860. {
  29861. name: 'GetPositionPercentage',
  29862. ready: true,
  29863. fn: function(doc, div) {
  29864. return Ext.feature.getStyle(div.childNodes[2], 'left') === '10%';
  29865. }
  29866. },
  29867. /**
  29868. * @property {Boolean} PercentageHeightOverflowBug
  29869. * In some browsers (IE quirks, IE6, IE7, IE9, chrome, safari and opera at the time
  29870. * of this writing) a percentage-height element ignores the horizontal scrollbar
  29871. * of its parent element. This method returns true if the browser is affected
  29872. * by this bug.
  29873. *
  29874. * This property is *NOT* available at application boot time. Only after the document ready event.
  29875. * @private
  29876. */
  29877. {
  29878. name: 'PercentageHeightOverflowBug',
  29879. ready: true,
  29880. fn: function(doc) {
  29881. var hasBug = false,
  29882. style, el;
  29883. if (Ext.getScrollbarSize().height) {
  29884. // must have space-consuming scrollbars for bug to be possible
  29885. el = this.getTestElement('div', true);
  29886. style = el.style;
  29887. style.height = '50px';
  29888. style.width = '50px';
  29889. style.overflow = 'auto';
  29890. style.position = 'absolute';
  29891. el.innerHTML = [
  29892. '<div style="display:table;height:100%;">',
  29893. // The element that causes the horizontal overflow must be
  29894. // a child of the element with the 100% height, otherwise
  29895. // horizontal overflow is not triggered in webkit quirks mode
  29896. '<div style="width:51px;"></div>',
  29897. '</div>'
  29898. ].join('');
  29899. doc.body.appendChild(el);
  29900. if (el.firstChild.offsetHeight === 50) {
  29901. hasBug = true;
  29902. }
  29903. doc.body.removeChild(el);
  29904. }
  29905. return hasBug;
  29906. }
  29907. },
  29908. /**
  29909. * @property {Boolean} xOriginBug
  29910. * In Chrome 24.0, an RTL element which has vertical overflow positions its right X origin incorrectly.
  29911. * It skips a non-existent scrollbar which has been moved to the left edge due to the RTL setting.
  29912. *
  29913. * http://code.google.com/p/chromium/issues/detail?id=174656
  29914. *
  29915. * This method returns true if the browser is affected by this bug.
  29916. *
  29917. * This property is *NOT* available at application boot time. Only after the document ready event.
  29918. * @private
  29919. */
  29920. {
  29921. name: 'xOriginBug',
  29922. ready: true,
  29923. fn: function(doc, div) {
  29924. 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>';
  29925. var outerBox = document.getElementById('b1').getBoundingClientRect(),
  29926. b2 = document.getElementById('b2').getBoundingClientRect(),
  29927. b3 = document.getElementById('b3').getBoundingClientRect();
  29928. return (b2.left !== outerBox.left && b3.right !== outerBox.right);
  29929. }
  29930. },
  29931. /**
  29932. * @property {Boolean} ScrollWidthInlinePaddingBug
  29933. * In some browsers the right padding of an overflowing element is not accounted
  29934. * for in its scrollWidth. The result can vary depending on whether or not
  29935. * The element contains block-level children. This method tests the effect
  29936. * of padding on scrollWidth when there are no block-level children inside the
  29937. * overflowing element.
  29938. *
  29939. * This method returns true if the browser is affected by this bug.
  29940. *
  29941. * This property is *NOT* available at application boot time. Only after the document ready event.
  29942. */
  29943. {
  29944. name: 'ScrollWidthInlinePaddingBug',
  29945. ready: true,
  29946. fn: function(doc) {
  29947. var hasBug = false,
  29948. style, el;
  29949. el = doc.createElement('div');
  29950. style = el.style;
  29951. style.height = '50px';
  29952. style.width = '50px';
  29953. style.padding = '10px';
  29954. style.overflow = 'hidden';
  29955. style.position = 'absolute';
  29956. el.innerHTML = '<span style="display:inline-block;zoom:1;height:60px;width:60px;"></span>';
  29957. doc.body.appendChild(el);
  29958. if (el.scrollWidth === 70) {
  29959. hasBug = true;
  29960. }
  29961. doc.body.removeChild(el);
  29962. return hasBug;
  29963. }
  29964. },
  29965. /**
  29966. * @property {Boolean} rtlVertScrollbarOnRight
  29967. * Safari, in RTL mode keeps the scrollbar at the right side.
  29968. * This means that when two elements must keep their left/right positions synched, if one has no vert
  29969. * scrollbar, it must have some extra padding.
  29970. * See https://sencha.jira.com/browse/EXTJSIV-11245
  29971. *
  29972. * This property is *NOT* available at application boot time. Only after the document ready event.
  29973. * @private
  29974. */
  29975. {
  29976. name: 'rtlVertScrollbarOnRight',
  29977. ready: true,
  29978. fn: function(doc, div) {
  29979. div.innerHTML = '<div style="height:100px;width:100px;direction:rtl;overflow:scroll">' + '<div style="width:20px;height:200px;"></div>' + '</div>';
  29980. var outerBox = div.firstChild,
  29981. innerBox = outerBox.firstChild;
  29982. return (innerBox.offsetLeft + innerBox.offsetWidth !== outerBox.offsetLeft + outerBox.offsetWidth);
  29983. }
  29984. },
  29985. /**
  29986. * @property {Boolean} rtlVertScrollbarOverflowBug
  29987. * In Chrome, in RTL mode, horizontal overflow only into the vertical scrollbar does NOT trigger horizontal scrollability.
  29988. * See https://code.google.com/p/chromium/issues/detail?id=179332
  29989. * We need to detect this for when a grid header needs to have exactly the same horizontal scrolling range as its table view.
  29990. * See {@link Ext.grid.ColumnLayout#publishInnerCtSize}
  29991. * TODO: Remove this when all supported Chrome versions are fixed.
  29992. *
  29993. * This property is *NOT* available at application boot time. Only after the document ready event.
  29994. * @private
  29995. */
  29996. {
  29997. name: 'rtlVertScrollbarOverflowBug',
  29998. ready: true,
  29999. fn: function(doc, div) {
  30000. div.innerHTML = '<div style="height:100px;width:100px;direction:rtl;overflow:auto">' + '<div style="width:95px;height:200px;"></div>' + '</div>';
  30001. // If the bug is present, the 95 pixel wide inner div, encroaches into the
  30002. // vertical scrollbar, but does NOT trigger horizontal overflow, so the clientHeight remains
  30003. // equal to the offset height.
  30004. var outerBox = div.firstChild,
  30005. style = div.style,
  30006. pos = style.position;
  30007. // This issue seems to require a repaint to measure correctly
  30008. style.position = 'absolute';
  30009. outerBox.offsetHeight;
  30010. style.position = pos;
  30011. return outerBox.clientHeight === outerBox.offsetHeight;
  30012. }
  30013. },
  30014. {
  30015. identity: 'defineProperty',
  30016. fn: function() {
  30017. if (Ext.isIE8m) {
  30018. Ext.Object.defineProperty = Ext.emptyFn;
  30019. return false;
  30020. }
  30021. return true;
  30022. }
  30023. },
  30024. {
  30025. identify: 'nativeXhr',
  30026. fn: function() {
  30027. if (typeof XMLHttpRequest !== 'undefined') {
  30028. return true;
  30029. }
  30030. // Apply a polyfill:
  30031. XMLHttpRequest = function() {
  30032. // jshint ignore:line
  30033. try {
  30034. return new ActiveXObject('MSXML2.XMLHTTP.3.0');
  30035. } // jshint ignore:line
  30036. catch (ex) {
  30037. return null;
  30038. }
  30039. };
  30040. return false;
  30041. }
  30042. },
  30043. /**
  30044. * @property {Boolean} SpecialKeyDownRepeat
  30045. * True if the browser fires the keydown event on specialkey autorepeat
  30046. *
  30047. * note 1: IE fires ONLY the keydown event on specialkey autorepeat
  30048. * note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on
  30049. * specialkey autorepeat (research done by Jan Wolter at
  30050. * http://unixpapa.com/js/key.html)
  30051. * note 3: Opera 12 behaves like other modern browsers so this workaround does not
  30052. * work anymore
  30053. *
  30054. * This property is available at application boot time, before document ready.
  30055. */
  30056. {
  30057. name: 'SpecialKeyDownRepeat',
  30058. fn: function() {
  30059. return Ext.isWebKit ? parseInt(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1], 10) >= 525 : !(!(Ext.isGecko || Ext.isIE || Ext.isEdge) || (Ext.isOpera && Ext.operaVersion < 12));
  30060. }
  30061. },
  30062. /**
  30063. * @property {Boolean} EmulatedMouseOver
  30064. * True if the browser emulates a mouseover event on tap (mobile safari)
  30065. *
  30066. * This property is available at application boot time, before document ready.
  30067. */
  30068. {
  30069. name: 'EmulatedMouseOver',
  30070. fn: function() {
  30071. // TODO: is it possible to feature detect this?
  30072. return Ext.os.is.iOS;
  30073. }
  30074. },
  30075. /**
  30076. * @property Hashchange True if the user agent supports the hashchange event
  30077. *
  30078. * This property is available at application boot time, before document ready.
  30079. * @type {Boolean}
  30080. */
  30081. {
  30082. // support Vector 12
  30083. name: 'Hashchange',
  30084. fn: function() {
  30085. // Note that IE8 in IE7 compatibility mode reports true for 'onhashchange' in window, so also test documentMode
  30086. var docMode = document.documentMode;
  30087. return 'onhashchange' in window && (docMode === undefined || docMode > 7);
  30088. }
  30089. },
  30090. /**
  30091. * @property FixedTableWidthBug
  30092. * @private
  30093. * @type {Boolean}
  30094. * `true` if the browser has this bug: https://bugs.webkit.org/show_bug.cgi?id=130239
  30095. *
  30096. * This property is *NOT* available at application boot time. Only after the document ready event.
  30097. */
  30098. {
  30099. name: 'FixedTableWidthBug',
  30100. ready: true,
  30101. fn: function() {
  30102. if (Ext.isIE8) {
  30103. // IE8 incorrectly detects that we have this bug.
  30104. return false;
  30105. }
  30106. var outer = document.createElement('div'),
  30107. inner = document.createElement('div'),
  30108. width;
  30109. outer.setAttribute('style', 'display:table;table-layout:fixed;');
  30110. inner.setAttribute('style', 'display:table-cell;min-width:50px;');
  30111. outer.appendChild(inner);
  30112. document.body.appendChild(outer);
  30113. // must poke offsetWidth to trigger a reflow before setting width
  30114. outer.offsetWidth;
  30115. // jshint ignore:line
  30116. outer.style.width = '25px';
  30117. width = outer.offsetWidth;
  30118. document.body.removeChild(outer);
  30119. return width === 50;
  30120. }
  30121. },
  30122. /**
  30123. * @property FocusinFocusoutEvents
  30124. * @private
  30125. * @type {Boolean}
  30126. * `true` if the browser supports focusin and focusout events:
  30127. * https://developer.mozilla.org/en-US/docs/Web/Events/focusin
  30128. * At this point, only Firefox does not, see this bug:
  30129. * https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  30130. *
  30131. * This property is available at application boot time, before document ready.
  30132. */
  30133. {
  30134. name: 'FocusinFocusoutEvents',
  30135. fn: function() {
  30136. // There is no reliable way to feature detect focusin/focusout event support.
  30137. // window.onfocusin will return undefined both in Chrome (where it is supported)
  30138. // and in Firefox (where it is not supported); adding an element and trying to
  30139. // focus it will fail when the browser window itself is not focused.
  30140. return !(Ext.isGecko && Ext.firefoxVersion < 52);
  30141. }
  30142. },
  30143. /**
  30144. * @property {Boolean} AsyncFocusEvents
  30145. * `true` if the browser fires focus events (focus, blur, focusin, focusout)
  30146. * asynchronously, i.e. in a separate event loop invocation. This is only true
  30147. * for all versions Internet Explorer; Microsoft Edge and other browsers fire
  30148. * focus events synchronously.
  30149. */
  30150. {
  30151. name: 'AsyncFocusEvents',
  30152. fn: function() {
  30153. // The sad part is that we can't feature detect this because the focus
  30154. // event won't be fired when the browser window itself is not focused.
  30155. // Private shortcut for brevity
  30156. return Ext.asyncFocus = !!Ext.isIE;
  30157. }
  30158. },
  30159. /**
  30160. * @property {Object} accessibility Accessibility features.
  30161. *
  30162. * @property {Boolean} accessibility.Images `true` if the browser is configured
  30163. * to display images.
  30164. *
  30165. * @property {Boolean} accessibility.BackgroundImages `true` if the browser
  30166. * is configured to display background images.
  30167. *
  30168. * @property {Boolean} accessibility.BorderColors `true` if the browser
  30169. * is configured to honor CSS styling for border colors.
  30170. *
  30171. * @property {Boolean} accessibility.LightOnDark `true` if the browser
  30172. * is currently using reverse colors in light-on-dark accessibility mode.
  30173. */
  30174. {
  30175. name: 'accessibility',
  30176. ready: true,
  30177. fn: function(doc) {
  30178. var body = doc.body,
  30179. div, img, style, supports, bgImg;
  30180. function getColor(colorTxt) {
  30181. var values = [],
  30182. colorValue = 0,
  30183. regex, match;
  30184. if (colorTxt.indexOf('rgb(') !== -1) {
  30185. values = colorTxt.replace('rgb(', '').replace(')', '').split(', ');
  30186. } else if (colorTxt.indexOf('#') !== -1) {
  30187. regex = colorTxt.length === 7 ? /^#(\S\S)(\S\S)(\S\S)$/ : /^#(\S)(\S)(\S)$/;
  30188. match = colorTxt.match(regex);
  30189. if (match) {
  30190. values = [
  30191. '0x' + match[1],
  30192. '0x' + match[2],
  30193. '0x' + match[3]
  30194. ];
  30195. }
  30196. }
  30197. for (var i = 0; i < values.length; i++) {
  30198. colorValue += parseInt(values[i]);
  30199. }
  30200. return colorValue;
  30201. }
  30202. div = doc.createElement('div');
  30203. img = doc.createElement('img');
  30204. style = div.style;
  30205. Ext.apply(style, {
  30206. width: '2px',
  30207. position: 'absolute',
  30208. clip: 'rect(1px,1px,1px,1px)',
  30209. borderWidth: '1px',
  30210. borderStyle: 'solid',
  30211. borderTopTolor: '#f00',
  30212. borderRightColor: '#ff0',
  30213. backgroundColor: '#fff',
  30214. backgroundImage: 'url(' + Ext.BLANK_IMAGE_URL + ')'
  30215. });
  30216. img.alt = '';
  30217. img.src = Ext.BLANK_IMAGE_URL;
  30218. div.appendChild(img);
  30219. body.appendChild(div);
  30220. // Now check if the styles were indeed honored
  30221. style = div.currentStyle || div.style;
  30222. bgImg = style.backgroundImage;
  30223. supports = {
  30224. // In IE it is possible to untick "Show pictures" option in Advanced
  30225. // settings; this will result in img element reporting its readyState
  30226. // as 'uninitialized'.
  30227. // See http://www.paciellogroup.com/blog/2011/10/detecting-if-images-are-disabled-in-browsers/
  30228. Images: img.offsetWidth === 1 && img.readyState !== 'uninitialized',
  30229. BackgroundImages: !(bgImg !== null && (bgImg === "none" || bgImg === "url(invalid-url:)")),
  30230. BorderColors: style.borderTopColor !== style.borderRightColor,
  30231. LightOnDark: getColor(style.color) - getColor(style.backgroundColor) > 0
  30232. };
  30233. Ext.supports.HighContrastMode = !supports.BackgroundImages;
  30234. body.removeChild(div);
  30235. div = img = null;
  30236. return supports;
  30237. }
  30238. },
  30239. {
  30240. /**
  30241. * @property ViewportUnits `true` if the device supports ViewportUnits.
  30242. * @type {Boolean}
  30243. *
  30244. */
  30245. name: 'ViewportUnits',
  30246. ready: true,
  30247. fn: function(doc) {
  30248. // Even attempting to detect the feature throws a fatal error on IE8
  30249. if (Ext.isIE8) {
  30250. return false;
  30251. }
  30252. var body = doc.body,
  30253. div = document.createElement('div'),
  30254. style = div.currentStyle || div.style,
  30255. width, divWidth;
  30256. body.appendChild(div);
  30257. Ext.apply(style, {
  30258. width: '50vw'
  30259. });
  30260. width = parseInt(window.innerWidth / 2, 10);
  30261. divWidth = parseInt((window.getComputedStyle ? getComputedStyle(div, null) : div.currentStyle).width, 10);
  30262. body.removeChild(div);
  30263. div = null;
  30264. return width === divWidth;
  30265. }
  30266. },
  30267. {
  30268. name: 'CSSVariables',
  30269. ready: false,
  30270. fn: function() {
  30271. // Legacy browsers do not have this method.
  30272. if (!window.getComputedStyle) {
  30273. return false;
  30274. }
  30275. return window.CSS && window.CSS.supports && window.CSS.supports('--test-var', 0);
  30276. }
  30277. },
  30278. {
  30279. /**
  30280. * @property Selectors2 `true` if the browser supports the CSS selector API level 2.
  30281. * https://dev.w3.org/2006/webapi/selectors-api2/
  30282. * @type {Boolean}
  30283. *
  30284. */
  30285. name: 'Selectors2',
  30286. ready: false,
  30287. fn: function(doc) {
  30288. try {
  30289. return !!doc.querySelectorAll(':scope');
  30290. } catch (e) {
  30291. return false;
  30292. }
  30293. }
  30294. },
  30295. {
  30296. /**
  30297. * @property CSSScrollSnap
  30298. * @private
  30299. * @type {Boolean}
  30300. */
  30301. name: 'CSSScrollSnap',
  30302. ready: false,
  30303. fn: function(doc) {
  30304. var style = doc.documentElement.style;
  30305. return 'scrollSnapType' in style || 'webkitScrollSnapType' in style || 'msScrollSnapType' in style;
  30306. }
  30307. },
  30308. /**
  30309. * @property TranslateYCausesHorizontalScroll
  30310. * @private
  30311. * @type {Boolean}
  30312. *
  30313. * Bug for Edge logged here: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9743268/
  30314. */
  30315. {
  30316. name: 'TranslateYCausesHorizontalScroll',
  30317. ready: true,
  30318. fn: function(doc, div) {
  30319. div.innerHTML = '<div style="position: relative; overflow: auto; height: 200px; width: 200px;">' + '<div>' + '<div style="transform: translateY(260px); width: 50px;">a</div>' + '</div>' + '</div>';
  30320. return div.firstChild.scrollWidth > div.firstChild.clientWidth;
  30321. }
  30322. },
  30323. {
  30324. /**
  30325. * @property FlexBoxBasisBug
  30326. * @private
  30327. * @type {Boolean}
  30328. * Allows align: stretch to align items to the height of the tallest item
  30329. * in an auto-heighted hbox layout.
  30330. * can't use flex-basis: auto everywhere because it breaks percentage-sized children
  30331. * https://bugs.chromium.org/p/chromium/issues/detail?id=680484
  30332. */
  30333. name: 'FlexBoxBasisBug',
  30334. ready: true,
  30335. fn: function() {
  30336. 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))) {
  30337. return true;
  30338. }
  30339. return false;
  30340. }
  30341. },
  30342. {
  30343. /**
  30344. * @property PercentageSizeFlexBug
  30345. * @private
  30346. * @type {Boolean}
  30347. *
  30348. * Detects https://bugs.webkit.org/show_bug.cgi?id=137730
  30349. */
  30350. name: 'PercentageSizeFlexBug',
  30351. ready: true,
  30352. fn: function(doc, div) {
  30353. if (Ext.isIE9m) {
  30354. return false;
  30355. }
  30356. var style = div.style;
  30357. style.display = 'flex';
  30358. style.flexDirection = 'column';
  30359. style.height = style.width = '100px';
  30360. div.innerHTML = '<div style="flex: 1 1;"><div style="height:50%"></div></div>';
  30361. return div.firstChild.firstChild.offsetHeight !== 50;
  30362. }
  30363. },
  30364. {
  30365. /**
  30366. * @property CannotScrollExactHeight
  30367. * @type {Boolean}
  30368. *
  30369. * Feature detect the support of browsers that are unable to scroll elements that are the same
  30370. * height as the native scrollbar height.
  30371. */
  30372. name: 'CannotScrollExactHeight',
  30373. fn: function() {
  30374. return Ext.isIE10p;
  30375. }
  30376. },
  30377. {
  30378. /**
  30379. * @property WebKitTextInputMarginBug
  30380. * @private
  30381. * @type {Boolean}
  30382. *
  30383. * Detects the following bug:
  30384. * https://bugs.webkit.org/show_bug.cgi?id=137693
  30385. *
  30386. * Feb 22, 2017: This bug used to affect chrome as well, but appears to be fixed in
  30387. * Chrome 56. The issue still exists in safari 10
  30388. */
  30389. name: 'WebKitInputTableBoxModelBug',
  30390. ready: true,
  30391. fn: function(doc, div) {
  30392. var table = document.createElement('div'),
  30393. cell = document.createElement('div'),
  30394. input = document.createElement('input'),
  30395. tableStyle = table.style,
  30396. cellStyle = cell.style,
  30397. inputStyle = input.style,
  30398. body = doc.body,
  30399. hasBug;
  30400. input.type = 'text';
  30401. tableStyle.display = 'table';
  30402. tableStyle.height = '100px';
  30403. cellStyle.display = 'table-cell';
  30404. inputStyle.border = '0';
  30405. inputStyle.padding = '10px';
  30406. inputStyle.boxSizing = 'border-box';
  30407. inputStyle.height = '100%';
  30408. cell.appendChild(input);
  30409. table.appendChild(cell);
  30410. body.appendChild(table);
  30411. hasBug = input.offsetHeight === 80;
  30412. body.removeChild(table);
  30413. return hasBug;
  30414. }
  30415. },
  30416. {
  30417. /**
  30418. * @property PassiveEventListener
  30419. * @private
  30420. * @type {Boolean}
  30421. *
  30422. * Detects support for the "passive" event listener option
  30423. */
  30424. name: 'PassiveEventListener',
  30425. fn: function(doc, div) {
  30426. var supportsPassive = false,
  30427. options;
  30428. try {
  30429. options = Object.defineProperty({}, 'passive', {
  30430. get: function() {
  30431. supportsPassive = true;
  30432. }
  30433. });
  30434. window.addEventListener('e', null, options);
  30435. window.removeEventListener('e', null, options);
  30436. } catch (e) {}
  30437. return supportsPassive;
  30438. }
  30439. },
  30440. {
  30441. /**
  30442. * @property MinContent
  30443. * @private
  30444. * @type {Boolean}
  30445. *
  30446. * Detects support for CSS "min-content"
  30447. */
  30448. name: 'CSSMinContent',
  30449. ready: true,
  30450. fn: function(doc, div) {
  30451. // As of 3/24/2017 IE/Edge have no min-content support, and firefox has
  30452. // partial/buggy support: https://bugzilla.mozilla.org/show_bug.cgi?id=135015
  30453. // This feature detector is designed to return false if there is not "full" support.
  30454. 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>';
  30455. return div.firstChild.offsetHeight === 8;
  30456. }
  30457. },
  30458. {
  30459. name: 'ComputedSizeIncludesPadding',
  30460. ready: true,
  30461. fn: function(doc, div) {
  30462. var ret = false,
  30463. bd = document.body,
  30464. el, w;
  30465. if (window.getComputedStyle) {
  30466. el = document.createElement('div');
  30467. el.style.cssText = 'width:10px;padding:2px;' + '-webkit-box-sizing:border-box;box-sizing:border-box;';
  30468. bd.appendChild(el);
  30469. w = window.getComputedStyle(el, null).width;
  30470. ret = w === '10px';
  30471. bd.removeChild(el);
  30472. }
  30473. return ret;
  30474. }
  30475. },
  30476. 0
  30477. ]
  30478. };
  30479. // placeholder so legacy browser detectors can come/go cleanly
  30480. Ext.feature.tests.pop();
  30481. // remove the placeholder
  30482. Ext.supports = {};
  30483. Ext.feature.detect();
  30484. /**
  30485. * This class manages ready detection and handling. Direct use of this class is not
  30486. * recommended. Instead use `Ext.onReady`:
  30487. *
  30488. * Ext.onReady(function () {
  30489. * // DOM and Framework are ready...
  30490. * });
  30491. *
  30492. * ## DOM Ready
  30493. *
  30494. * The lowest-level of readiness is DOM readiness. This level implies only that the document
  30495. * body exists. Many things require the DOM to be ready for manipulation. If that is all
  30496. * that is required, the `Ext.onDocumentReady` method can be called to register a callback
  30497. * to be called as soon as the DOM is ready:
  30498. *
  30499. * Ext.onDocumentReady(function () {
  30500. * // the document body is ready
  30501. * });
  30502. *
  30503. * ## Framework Ready
  30504. *
  30505. * In production builds of applications it is common to have all of the code loaded before
  30506. * DOM ready, so the need to wait for "onReady" is often confused with only that concern.
  30507. * This is easy to understand, at least in part because historically `Ext.onReady` only
  30508. * waited for DOM ready.
  30509. *
  30510. * With the introduction of `Ext.Loader`, however, it became common for DOM ready to occur
  30511. * in the middle of dynamically loading code. If application code were executed at that
  30512. * time, any use of the yet-to-be-loaded classes would throw errors. As a consequence of
  30513. * this, the `Ext.onReady` mechanism was extended to wait for both DOM ready *and* all of
  30514. * the required classes to be loaded.
  30515. *
  30516. * When the framework enters or leaves a state where it is not ready (for example, the
  30517. * first dynamic load is requested or last load completes), `Ext.env.Ready` is informed.
  30518. * For example:
  30519. *
  30520. * Ext.env.Ready.block();
  30521. *
  30522. * //...
  30523. *
  30524. * Ext.env.Ready.unblock();
  30525. *
  30526. * When there are no blocks and the DOM is ready, the Framework is ready and the "onReady"
  30527. * callbacks are called.
  30528. *
  30529. * Priority can be used to control the ordering of onReady listeners, for example:
  30530. *
  30531. * Ext.onReady(function() {
  30532. *
  30533. * }, null, {
  30534. * priority: 100
  30535. * });
  30536. *
  30537. * Ready listeners with higher priorities will run sooner than those with lower priorities,
  30538. * the default priority being `0`. Internally the framework reserves priorities of 1000
  30539. * or greater, and -1000 or lesser for onReady handlers that must run before or after
  30540. * any application code. Applications should stick to using priorities in the -999 - 999
  30541. * range. The following priorities are currently in use by the framework:
  30542. *
  30543. * - Element_scroll rtl override: `1001`
  30544. * - Event system initialization: `2000`
  30545. * - Ext.dom.Element: `1500`
  30546. *
  30547. * @class Ext.env.Ready
  30548. * @singleton
  30549. * @private
  30550. * @since 5.0.0
  30551. */
  30552. Ext.env.Ready = {
  30553. // @define Ext.env.Ready
  30554. // @require Ext.env.Browser
  30555. // @require Ext.env.OS
  30556. // @require Ext.env.Feature
  30557. /**
  30558. * @property {Number} blocks The number of Framework readiness blocks.
  30559. * @private
  30560. */
  30561. blocks: (location.search || '').indexOf('ext-pauseReadyFire') > 0 ? 1 : 0,
  30562. /**
  30563. * @property {Number} bound This property stores the state of event listeners bound
  30564. * to the document or window to detect ready state.
  30565. * @private
  30566. */
  30567. bound: 0,
  30568. /**
  30569. * @property {Number} [delay=1]
  30570. * This allows the DOM listener thread to complete (usually desirable with mobWebkit,
  30571. * Gecko) before firing the entire onReady chain (high stack load on Loader). For mobile
  30572. * devices when running from Home Screen, the splash screen will not disappear until
  30573. * all external resource requests finish. This delay clears the splash screen.
  30574. * @private
  30575. */
  30576. delay: 1,
  30577. /**
  30578. * @property {Event[]} events An array of events that have triggered ready state. This
  30579. * is for diagnostic purposes only and is only available in debug builds.
  30580. * An array
  30581. * @private
  30582. */
  30583. events: [],
  30584. /**
  30585. * @property {Boolean} firing This property is `true` when we currently calling the
  30586. * listeners.
  30587. * @private
  30588. */
  30589. firing: false,
  30590. /**
  30591. * @property {Number} generation A counter of the number of mutations of `listeners`.
  30592. * @private
  30593. */
  30594. generation: 0,
  30595. /**
  30596. * @property {Object[]} listeners The set of listeners waiting for ready.
  30597. * @private
  30598. */
  30599. listeners: [],
  30600. /**
  30601. * @property {Number} nextId A counter so we can assign listeners an `id` to keep
  30602. * them in FIFO order.
  30603. * @private
  30604. */
  30605. nextId: 0,
  30606. /**
  30607. * @property {Number} sortGeneration A captured value of `generation` that indicates
  30608. * when the `listeners` were last sorted.
  30609. * @private
  30610. */
  30611. sortGeneration: 0,
  30612. /**
  30613. * @property {Number} state
  30614. * Holds the current ready state as managed by this class. The values possible are:
  30615. *
  30616. * * 0 - Not ready.
  30617. * * 1 - Ready detected but listeners are not yet notified.
  30618. * * 2 - Ready detected and listeners are notified. See also `firing`.
  30619. *
  30620. * @private
  30621. */
  30622. state: 0,
  30623. /**
  30624. * @property {Object} timer The handle from `setTimeout` for the delayed notification
  30625. * of ready.
  30626. * @private
  30627. */
  30628. timer: null,
  30629. /**
  30630. * Binds the appropriate browser event for checking if the DOM has loaded.
  30631. * @private
  30632. */
  30633. bind: function() {
  30634. var me = Ext.env.Ready,
  30635. doc = document;
  30636. if (!me.bound) {
  30637. // Test scenario where load is dynamic AFTER window.load
  30638. if (doc.readyState === 'complete') {
  30639. // Firefox4+ got support for this state, others already do.
  30640. me.onReadyEvent({
  30641. type: doc.readyState || 'body'
  30642. });
  30643. } else {
  30644. me.bound = 1;
  30645. if (Ext.browser.is.PhoneGap && !Ext.os.is.Desktop) {
  30646. me.bound = 2;
  30647. doc.addEventListener('deviceready', me.onReadyEvent, false);
  30648. }
  30649. doc.addEventListener('DOMContentLoaded', me.onReadyEvent, false);
  30650. window.addEventListener('load', me.onReadyEvent, false);
  30651. }
  30652. }
  30653. },
  30654. block: function() {
  30655. ++this.blocks;
  30656. Ext.isReady = false;
  30657. },
  30658. /**
  30659. * This method starts the process of firing the ready event. This may be delayed based
  30660. * on the `delay` property.
  30661. * @private
  30662. */
  30663. fireReady: function() {
  30664. var me = Ext.env.Ready;
  30665. if (!me.state) {
  30666. Ext._readyTime = Ext.ticks();
  30667. Ext.isDomReady = true;
  30668. me.state = 1;
  30669. // As soon as we transition to domready, complete the feature detection:
  30670. Ext.feature.detect(true);
  30671. if (!me.delay) {
  30672. me.handleReady();
  30673. } else if (navigator.standalone) {
  30674. // When running from Home Screen, the splash screen will not disappear
  30675. // until all external resource requests finish.
  30676. // The first timeout clears the splash screen
  30677. // The second timeout allows inital HTML content to be displayed
  30678. me.timer = Ext.defer(function() {
  30679. me.timer = null;
  30680. me.handleReadySoon();
  30681. }, 1);
  30682. } else {
  30683. me.handleReadySoon();
  30684. }
  30685. }
  30686. },
  30687. /**
  30688. * This method iterates over the `listeners` and invokes them. This advances the
  30689. * `state` from 1 to 2 and ensure the proper subset of `listeners` are invoked.
  30690. * @private
  30691. */
  30692. handleReady: function() {
  30693. var me = this;
  30694. if (me.state === 1) {
  30695. me.state = 2;
  30696. Ext._beforeReadyTime = Ext.ticks();
  30697. me.invokeAll();
  30698. Ext._afterReadyTime = Ext.ticks();
  30699. }
  30700. },
  30701. /**
  30702. * This method is called to schedule a call to `handleReady` using a `setTimeout`. It
  30703. * ensures that only one timer is pending.
  30704. * @param {Number} [delay] If passed, this overrides the `delay` property.
  30705. * @private
  30706. */
  30707. handleReadySoon: function(delay) {
  30708. var me = this;
  30709. if (!me.timer) {
  30710. me.timer = Ext.defer(function() {
  30711. me.timer = null;
  30712. me.handleReady();
  30713. }, delay || me.delay);
  30714. }
  30715. },
  30716. /**
  30717. * This method invokes the given `listener` instance based on its options.
  30718. * @param {Object} listener
  30719. */
  30720. invoke: function(listener) {
  30721. var delay = listener.delay;
  30722. if (delay) {
  30723. Ext.defer(listener.fn, delay, listener.scope);
  30724. } else {
  30725. if (Ext.elevateFunction) {
  30726. Ext.elevateFunction(listener.fn, listener.scope);
  30727. } else {
  30728. listener.fn.call(listener.scope);
  30729. }
  30730. }
  30731. },
  30732. /**
  30733. * Invokes as many listeners as are appropriate given the current state. This should
  30734. * only be called when DOM ready is achieved. The remaining business of `blocks` is
  30735. * handled here.
  30736. */
  30737. invokeAll: function() {
  30738. if (Ext.elevateFunction) {
  30739. Ext.elevateFunction(this.doInvokeAll, this);
  30740. } else {
  30741. this.doInvokeAll();
  30742. }
  30743. },
  30744. doInvokeAll: function() {
  30745. var me = this,
  30746. listeners = me.listeners,
  30747. listener;
  30748. if (!me.blocks) {
  30749. // Since DOM is ready and we have no blocks, we mark the framework as ready.
  30750. Ext.isReady = true;
  30751. }
  30752. me.firing = true;
  30753. // NOTE: We cannot cache this length because each time through the loop a callback
  30754. // may have added new callbacks.
  30755. while (listeners.length) {
  30756. if (me.sortGeneration !== me.generation) {
  30757. me.sortGeneration = me.generation;
  30758. // This will happen just once on the first pass... if nothing is being
  30759. // added as we call the callbacks. This sorts the listeners such that the
  30760. // highest priority listener is at the *end* of the array ... so we can
  30761. // use pop (as opposed to shift) to extract it.
  30762. listeners.sort(me.sortFn);
  30763. }
  30764. listener = listeners.pop();
  30765. if (me.blocks && !listener.dom) {
  30766. // If we are blocked (i.e., only DOM ready) and this listener is not a
  30767. // DOM-ready listener we have reached the end of the line. The remaining
  30768. // listeners are Framework ready listeners.
  30769. listeners.push(listener);
  30770. break;
  30771. }
  30772. me.invoke(listener);
  30773. }
  30774. me.firing = false;
  30775. },
  30776. /**
  30777. * This method wraps the given listener pieces in a proper object for the `listeners`
  30778. * array and `invoke` methods.
  30779. * @param {Function} fn The method to call.
  30780. * @param {Object} [scope] The scope (`this` reference) in which the `fn` executes.
  30781. * Defaults to the browser window.
  30782. * @param {Object} [options] An object with extra options.
  30783. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  30784. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  30785. * number will result in the callback being sorted before the others. Priorities
  30786. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  30787. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  30788. * means full Framework and DOM readiness.
  30789. * @return {Object} The listener instance.
  30790. * @private
  30791. */
  30792. makeListener: function(fn, scope, options) {
  30793. var ret = {
  30794. fn: fn,
  30795. id: ++this.nextId,
  30796. // so sortFn can respect FIFO
  30797. scope: scope,
  30798. dom: false,
  30799. priority: 0
  30800. };
  30801. if (options) {
  30802. Ext.apply(ret, options);
  30803. }
  30804. ret.phase = ret.dom ? 0 : 1;
  30805. // to simplify the sortFn
  30806. return ret;
  30807. },
  30808. /**
  30809. * Adds a listener to be notified when the document is ready (before onload and before
  30810. * images are loaded).
  30811. *
  30812. * @param {Function} fn The method to call.
  30813. * @param {Object} [scope] The scope (`this` reference) in which the `fn` executes.
  30814. * Defaults to the browser window.
  30815. * @param {Object} [options] An object with extra options.
  30816. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  30817. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  30818. * number will result in the callback being sorted before the others. Priorities
  30819. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  30820. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  30821. * means full Framework and DOM readiness.
  30822. * @private
  30823. */
  30824. on: function(fn, scope, options) {
  30825. var me = Ext.env.Ready,
  30826. listener = me.makeListener(fn, scope, options);
  30827. if (me.state === 2 && !me.firing && (listener.dom || !me.blocks)) {
  30828. // If we are DOM ready (state === 2) and not currently in invokeAll (!firing)
  30829. // and this listener is ready to call (either a DOM ready listener or there
  30830. // are no blocks), then we need to invoke the listener now.
  30831. //
  30832. // Otherwise we can fall to the else block and push the listener. The eventual
  30833. // (or currently executing) call to handleReady or unblock will trigger its
  30834. // delivery in proper priority order.
  30835. me.invoke(listener);
  30836. } else {
  30837. me.listeners.push(listener);
  30838. ++me.generation;
  30839. if (!me.bound) {
  30840. // If we have never bound then bind the ready event now. If we have unbound
  30841. // the event then me.bound == -1 and we don't want to rebind it as the DOM
  30842. // is ready.
  30843. me.bind();
  30844. }
  30845. }
  30846. },
  30847. /**
  30848. * This is a generic event handler method attached to all of the various events that
  30849. * may indicate ready state. The first call to this method indicates ready state has
  30850. * been achieved.
  30851. * @param {Event} [ev] The event instance.
  30852. * @private
  30853. */
  30854. onReadyEvent: function(ev) {
  30855. var me = Ext.env.Ready;
  30856. if (Ext.elevateFunction) {
  30857. Ext.elevateFunction(me.doReadyEvent, me, arguments);
  30858. } else {
  30859. me.doReadyEvent(ev);
  30860. }
  30861. },
  30862. doReadyEvent: function(ev) {
  30863. var me = this;
  30864. if (ev && ev.type) {
  30865. me.events.push(ev);
  30866. }
  30867. if (me.bound > 0) {
  30868. me.unbind();
  30869. me.bound = -1;
  30870. }
  30871. // NOTE: *not* 0 or false - we never want to rebind!
  30872. if (!me.state) {
  30873. me.fireReady();
  30874. }
  30875. },
  30876. /**
  30877. * Sorts the `listeners` array by `phase` and `priority` such that the first listener
  30878. * to fire can be determined using `pop` on the `listeners` array.
  30879. * @private
  30880. */
  30881. sortFn: function(a, b) {
  30882. return -((a.phase - b.phase) || (b.priority - a.priority) || (a.id - b.id));
  30883. },
  30884. unblock: function() {
  30885. var me = this;
  30886. if (me.blocks) {
  30887. if (!--me.blocks) {
  30888. if (me.state === 2 && !me.firing) {
  30889. // We have already finished handleReady (the DOM ready handler) so
  30890. // this trigger just needs to dispatch all the remaining listeners.
  30891. me.invokeAll();
  30892. }
  30893. }
  30894. }
  30895. },
  30896. // if we are currently firing then invokeAll will pick up the Framework
  30897. // ready listeners automatically.
  30898. //
  30899. // If me.state < 2 then we are waiting for DOM ready so it will eventually
  30900. // call handleReady and invokeAll when everything is ready.
  30901. /**
  30902. * This method is called to remove all event listeners that may have been set up to
  30903. * detect ready state.
  30904. * @private
  30905. */
  30906. unbind: function() {
  30907. var me = this,
  30908. doc = document;
  30909. if (me.bound > 1) {
  30910. doc.removeEventListener('deviceready', me.onReadyEvent, false);
  30911. }
  30912. doc.removeEventListener('DOMContentLoaded', me.onReadyEvent, false);
  30913. window.removeEventListener('load', me.onReadyEvent, false);
  30914. }
  30915. };
  30916. (function() {
  30917. var Ready = Ext.env.Ready;
  30918. /*
  30919. * EXTJS-13522
  30920. * Although IE 9 has the DOMContentLoaded event available, usage of that causes
  30921. * timing issues when attempting to access document.namespaces (VmlCanvas.js).
  30922. * Consequently, even in IE 9 we need to use the legacy bind override for ready
  30923. * detection. This defers ready firing enough to allow access to the
  30924. * document.namespaces property.
  30925. *
  30926. * NOTE: this issue is very timing sensitive, and typically only displays itself
  30927. * when there is a large amount of latency between the browser and the server, and
  30928. * when testing against a built page (ext-all.js) and not a dev mode page.
  30929. */
  30930. if (Ext.isIE9m) {
  30931. /* Customized implementation for Legacy IE. The default implementation is
  30932. * configured for use with all other 'standards compliant' agents.
  30933. * References: http://javascript.nwbox.com/IEContentLoaded/
  30934. * licensed courtesy of http://developer.yahoo.com/yui/license.html
  30935. */
  30936. Ext.apply(Ready, {
  30937. /**
  30938. * Timer for doScroll polling
  30939. * @private
  30940. */
  30941. scrollTimer: null,
  30942. /**
  30943. * @private
  30944. */
  30945. readyStatesRe: /complete/i,
  30946. /**
  30947. * This strategy has minimal benefits for Sencha solutions that build
  30948. * themselves (ie. minimal initial page markup). However, progressively-enhanced
  30949. * pages (with image content and/or embedded frames) will benefit the most
  30950. * from it. Browser timer resolution is too poor to ensure a doScroll check
  30951. * more than once on a page loaded with minimal assets (the readystatechange
  30952. * event 'complete' usually beats the doScroll timer on a 'lightly-loaded'
  30953. * initial document).
  30954. * @private
  30955. */
  30956. pollScroll: function() {
  30957. var scrollable = true;
  30958. try {
  30959. document.documentElement.doScroll('left');
  30960. } catch (e) {
  30961. scrollable = false;
  30962. }
  30963. // on IE8, when running within an iFrame, document.body is not immediately
  30964. // available
  30965. if (scrollable && document.body) {
  30966. Ready.onReadyEvent({
  30967. type: 'doScroll'
  30968. });
  30969. } else {
  30970. // Minimize thrashing --
  30971. // adjusted for setTimeout's close-to-minimums (not too low),
  30972. // as this method SHOULD always be called once initially
  30973. Ready.scrollTimer = Ext.defer(Ready.pollScroll, 20);
  30974. }
  30975. return scrollable;
  30976. },
  30977. bind: function() {
  30978. if (Ready.bound) {
  30979. return;
  30980. }
  30981. var doc = document,
  30982. topContext;
  30983. // See if we are in an IFRAME? (doScroll ineffective here)
  30984. try {
  30985. topContext = window.frameElement === undefined;
  30986. } catch (e) {}
  30987. // If we throw an exception, it means we're probably getting access
  30988. // denied, which means we're in an iframe cross domain.
  30989. if (!topContext || !doc.documentElement.doScroll) {
  30990. Ready.pollScroll = Ext.emptyFn;
  30991. }
  30992. //then noop this test altogether
  30993. else if (Ready.pollScroll()) {
  30994. // starts scroll polling if necessary
  30995. return;
  30996. }
  30997. if (doc.readyState === 'complete') {
  30998. // Loaded AFTER initial document write/load...
  30999. Ready.onReadyEvent({
  31000. type: 'already ' + (doc.readyState || 'body')
  31001. });
  31002. } else {
  31003. doc.attachEvent('onreadystatechange', Ready.onReadyStateChange);
  31004. window.attachEvent('onload', Ready.onReadyEvent);
  31005. Ready.bound = 1;
  31006. }
  31007. },
  31008. unbind: function() {
  31009. document.detachEvent('onreadystatechange', Ready.onReadyStateChange);
  31010. window.detachEvent('onload', Ready.onReadyEvent);
  31011. if (Ext.isNumber(Ready.scrollTimer)) {
  31012. Ext.undefer(Ready.scrollTimer);
  31013. Ready.scrollTimer = null;
  31014. }
  31015. },
  31016. /**
  31017. * This event handler is called when the readyState changes.
  31018. * @private
  31019. */
  31020. onReadyStateChange: function() {
  31021. var state = document.readyState;
  31022. if (Ready.readyStatesRe.test(state)) {
  31023. Ready.onReadyEvent({
  31024. type: state
  31025. });
  31026. }
  31027. }
  31028. });
  31029. }
  31030. /**
  31031. * @property {Boolean} isDomReady
  31032. * `true` when the document body is ready for use.
  31033. * @member Ext
  31034. * @readonly
  31035. */
  31036. /**
  31037. * @property {Boolean} isReady
  31038. * `true` when `isDomReady` is true and the Framework is ready for use.
  31039. * @member Ext
  31040. * @readonly
  31041. */
  31042. /**
  31043. * @method onDocumentReady
  31044. * @member Ext
  31045. * Adds a listener to be notified when the document is ready (before onload and before
  31046. * images are loaded).
  31047. *
  31048. * @param {Function} fn The method to call.
  31049. * @param {Object} [scope] The scope (`this` reference) in which the handler function
  31050. * executes. Defaults to the browser window.
  31051. * @param {Object} [options] An object with extra options.
  31052. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  31053. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  31054. * number will result in the callback being sorted before the others. Priorities
  31055. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  31056. * @private
  31057. */
  31058. Ext.onDocumentReady = function(fn, scope, options) {
  31059. var opt = {
  31060. dom: true
  31061. };
  31062. if (options) {
  31063. Ext.apply(opt, options);
  31064. }
  31065. Ready.on(fn, scope, opt);
  31066. };
  31067. /**
  31068. * @method onReady
  31069. * @member Ext
  31070. * Adds a listener to be notified when the document is ready (before onload and before
  31071. * images are loaded).
  31072. *
  31073. * @param {Function} fn The method to call.
  31074. * @param {Object} [scope] The scope (`this` reference) in which the handler function
  31075. * executes. Defaults to the browser window.
  31076. * @param {Object} [options] An object with extra options.
  31077. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  31078. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  31079. * number will result in the callback being sorted before the others. Priorities
  31080. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  31081. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  31082. * means full Framework and DOM readiness.
  31083. * numbers are reserved.
  31084. */
  31085. Ext.onReady = function(fn, scope, options) {
  31086. Ready.on(fn, scope, options);
  31087. };
  31088. // A shortcut method for onReady with a high priority
  31089. Ext.onInternalReady = function(fn, scope, options) {
  31090. Ready.on(fn, scope, Ext.apply({
  31091. priority: 1000
  31092. }, options));
  31093. };
  31094. Ready.bind();
  31095. }());
  31096. // @tag class
  31097. /**
  31098. * This class provides dynamic loading support for JavaScript classes. Application code
  31099. * does not typically need to call `Ext.Loader` except perhaps to configure path mappings
  31100. * when not using [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/).
  31101. *
  31102. * Ext.Loader.setPath('MyApp', 'app');
  31103. *
  31104. * When using Sencha Cmd, this is handled by the "bootstrap" provided by the application
  31105. * build script and such configuration is not necessary.
  31106. *
  31107. * # Typical Usage
  31108. *
  31109. * The `Ext.Loader` is most often used behind the scenes to satisfy class references in
  31110. * class declarations. Like so:
  31111. *
  31112. * Ext.define('MyApp.view.Main', {
  31113. * extend: 'Ext.panel.Panel',
  31114. *
  31115. * mixins: [
  31116. * 'MyApp.util.Mixin'
  31117. * ],
  31118. *
  31119. * requires: [
  31120. * 'Ext.grid.Panel'
  31121. * ],
  31122. *
  31123. * uses: [
  31124. * 'MyApp.util.Stuff'
  31125. * ]
  31126. * });
  31127. *
  31128. * In all of these cases, `Ext.Loader` is used internally to resolve these class names
  31129. * and ensure that the necessary class files are loaded.
  31130. *
  31131. * During development, these files are loaded individually for optimal debugging. For a
  31132. * production use, [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/) will replace
  31133. * all of these strings with the actual resolved class references because it ensures that
  31134. * the classes are all contained in the build in the correct order. In development, these
  31135. * files will not be loaded until the `MyApp.view.Main` class indicates they are needed
  31136. * as shown above.
  31137. *
  31138. * # Loading Classes
  31139. *
  31140. * You can also use `Ext.Loader` directly to load classes or files. The simplest form of
  31141. * use is `{@link Ext#require}`.
  31142. *
  31143. * For example:
  31144. *
  31145. * Ext.require('MyApp.view.Main', function () {
  31146. * // On callback, the MyApp.view.Main class is now loaded
  31147. *
  31148. * var view = new MyApp.view.Main();
  31149. * });
  31150. *
  31151. * You can alternatively require classes by alias or wildcard.
  31152. *
  31153. * Ext.require('widget.window');
  31154. *
  31155. * Ext.require(['widget.window', 'layout.border', 'Ext.data.Connection']);
  31156. *
  31157. * Ext.require(['widget.*', 'layout.*', 'Ext.data.*']);
  31158. *
  31159. * The callback function is optional.
  31160. *
  31161. * **Note** Using `Ext.require` at global scope will cause `{@link Ext#onReady}` and
  31162. * `{@link Ext.app.Application#launch}` methods to be deferred until the required classes
  31163. * are loaded. It is these cases where the callback function is most often unnecessary.
  31164. *
  31165. * ## Using Excludes
  31166. *
  31167. * Alternatively, you can exclude what you don't need:
  31168. *
  31169. * // Include everything except Ext.tree.*
  31170. * Ext.exclude('Ext.tree.*').require('*');
  31171. *
  31172. * // Include all widgets except widget.checkbox* (this will exclude
  31173. * // widget.checkbox, widget.checkboxfield, widget.checkboxgroup, etc.)
  31174. * Ext.exclude('widget.checkbox*').require('widget.*');
  31175. *
  31176. * # Dynamic Instantiation
  31177. *
  31178. * Another feature enabled by `Ext.Loader` is instantiation using class names or aliases.
  31179. *
  31180. * For example:
  31181. *
  31182. * var win = Ext.create({
  31183. * xtype: 'window',
  31184. *
  31185. * // or
  31186. * // xclass: 'Ext.window.Window'
  31187. *
  31188. * title: 'Hello'
  31189. * });
  31190. *
  31191. * This form of creation can be useful if the type to create (`window` in the above) is
  31192. * not known statically. Internally, `{@link Ext#method!create}` may need to *synchronously*
  31193. * load the desired class and its requirements. Doing this will generate a warning in
  31194. * the console:
  31195. *
  31196. * [Ext.Loader] Synchronously loading 'Ext.window.Window'...
  31197. *
  31198. * If you see these in your debug console, you should add the indicated class(es) to the
  31199. * appropriate `requires` array (as above) or make an `{@link Ext#require}` call.
  31200. *
  31201. *
  31202. * **Note** Using `{@link Ext#method!create}` has some performance overhead and is best reserved
  31203. * for cases where the target class is not known until run-time.
  31204. *
  31205. * @class Ext.Loader
  31206. * @singleton
  31207. */
  31208. Ext.Loader = (new function() {
  31209. // jshint ignore:line
  31210. // @define Ext.Loader
  31211. // @require Ext.Base
  31212. // @require Ext.Class
  31213. // @require Ext.ClassManager
  31214. // @require Ext.Function
  31215. // @require Ext.Array
  31216. // @require Ext.env.Ready
  31217. var Loader = this,
  31218. Manager = Ext.ClassManager,
  31219. // this is an instance of Ext.Inventory
  31220. Boot = Ext.Boot,
  31221. Class = Ext.Class,
  31222. Ready = Ext.env.Ready,
  31223. alias = Ext.Function.alias,
  31224. dependencyProperties = [
  31225. 'extend',
  31226. 'mixins',
  31227. 'requires'
  31228. ],
  31229. isInHistory = {},
  31230. history = [],
  31231. readyListeners = [],
  31232. usedClasses = [],
  31233. _requiresMap = {},
  31234. _config = {
  31235. /**
  31236. * @cfg {Boolean} [enabled=true]
  31237. * Whether or not to enable the dynamic dependency loading feature.
  31238. */
  31239. enabled: true,
  31240. /**
  31241. * @cfg {Boolean} [scriptChainDelay=false]
  31242. * millisecond delay between asynchronous script injection (prevents stack
  31243. * overflow on some user agents) 'false' disables delay but potentially
  31244. * increases stack load.
  31245. */
  31246. scriptChainDelay: false,
  31247. /**
  31248. * @cfg {Boolean} [disableCaching=true]
  31249. * Appends current timestamp to script files to prevent caching.
  31250. */
  31251. disableCaching: true,
  31252. /**
  31253. * @cfg {String} [disableCachingParam="_dc"]
  31254. * The get parameter name for the cache buster's timestamp.
  31255. */
  31256. disableCachingParam: '_dc',
  31257. /**
  31258. * @cfg {Object} paths
  31259. * The mapping from namespaces to file paths
  31260. *
  31261. * {
  31262. * 'Ext': '.', // This is set by default, Ext.layout.container.Container will be
  31263. * // loaded from ./layout/Container.js
  31264. *
  31265. * 'My': './src/my_own_folder' // My.layout.Container will be loaded from
  31266. * // ./src/my_own_folder/layout/Container.js
  31267. * }
  31268. *
  31269. * Note that all relative paths are relative to the current HTML document.
  31270. * If not being specified, for example, `Other.awesome.Class` will simply be
  31271. * loaded from `"./Other/awesome/Class.js"`.
  31272. */
  31273. paths: Manager.paths,
  31274. /**
  31275. * @cfg {Boolean} preserveScripts
  31276. * `false` to remove asynchronously loaded scripts, `true` to retain script
  31277. * element for browser debugger compatibility and improved load performance.
  31278. */
  31279. preserveScripts: true,
  31280. /**
  31281. * @cfg {String} scriptCharset
  31282. * Optional charset to specify encoding of dynamic script content.
  31283. */
  31284. scriptCharset: undefined
  31285. },
  31286. // These configs are delegated to Ext.Script and may need different names:
  31287. delegatedConfigs = {
  31288. disableCaching: true,
  31289. disableCachingParam: true,
  31290. preserveScripts: true,
  31291. scriptChainDelay: 'loadDelay'
  31292. };
  31293. Ext.apply(Loader, {
  31294. /**
  31295. * @private
  31296. */
  31297. isInHistory: isInHistory,
  31298. /**
  31299. * Flag indicating whether there are still files being loaded
  31300. * @private
  31301. */
  31302. isLoading: false,
  31303. /**
  31304. * An array of class names to keep track of the dependency loading order.
  31305. * This is not guaranteed to be the same everytime due to the asynchronous
  31306. * nature of the Loader.
  31307. *
  31308. * @property {Array} history
  31309. */
  31310. history: history,
  31311. /**
  31312. * Configuration
  31313. * @private
  31314. */
  31315. config: _config,
  31316. /**
  31317. * Maintain the list of listeners to execute when all required scripts are fully loaded
  31318. * @private
  31319. */
  31320. readyListeners: readyListeners,
  31321. /**
  31322. * Contains classes referenced in `uses` properties.
  31323. * @private
  31324. */
  31325. optionalRequires: usedClasses,
  31326. /**
  31327. * Map of fully qualified class names to an array of dependent classes.
  31328. * @private
  31329. */
  31330. requiresMap: _requiresMap,
  31331. /** @private */
  31332. hasFileLoadError: false,
  31333. /**
  31334. * The number of scripts loading via loadScript.
  31335. * @private
  31336. */
  31337. scriptsLoading: 0,
  31338. /**
  31339. * @private
  31340. */
  31341. classesLoading: {},
  31342. missingCount: 0,
  31343. missingQueue: {},
  31344. /**
  31345. * @private
  31346. */
  31347. syncModeEnabled: false,
  31348. init: function() {
  31349. // initalize the default path of the framework
  31350. var scripts = document.getElementsByTagName('script'),
  31351. src = scripts[scripts.length - 1].src,
  31352. path = src.substring(0, src.lastIndexOf('/') + 1),
  31353. meta = Ext._classPathMetadata,
  31354. microloader = Ext.Microloader,
  31355. manifest = Ext.manifest,
  31356. loadOrder, classes, className, idx, baseUrl, loadlen, l, loadItem;
  31357. if (src.indexOf("packages/core/src/") !== -1) {
  31358. path = path + "../../";
  31359. } else if (src.indexOf("/core/src/class/") !== -1) {
  31360. path = path + "../../../";
  31361. }
  31362. if (!Manager.getPath("Ext")) {
  31363. Manager.setPath('Ext', path + 'src');
  31364. }
  31365. // Pull in Cmd generated metadata if available.
  31366. if (meta) {
  31367. Ext._classPathMetadata = null;
  31368. Loader.addClassPathMappings(meta);
  31369. }
  31370. if (manifest) {
  31371. loadOrder = manifest.loadOrder;
  31372. // if the manifest paths were calculated as relative to the
  31373. // bootstrap file, then we need to prepend Boot.baseUrl to the
  31374. // paths before processing
  31375. baseUrl = Ext.Boot.baseUrl;
  31376. if (loadOrder && manifest.bootRelative) {
  31377. for (loadlen = loadOrder.length , l = 0; l < loadlen; l++) {
  31378. loadItem = loadOrder[l];
  31379. loadItem.path = baseUrl + loadItem.path;
  31380. loadItem.canonicalPath = true;
  31381. }
  31382. }
  31383. }
  31384. if (microloader) {
  31385. Ready.block();
  31386. microloader.onMicroloaderReady(function() {
  31387. Ready.unblock();
  31388. });
  31389. }
  31390. },
  31391. /**
  31392. * @method setConfig
  31393. * Set the configuration for the loader. This should be called right after ext-(debug).js
  31394. * is included in the page, and before Ext.onReady. i.e:
  31395. *
  31396. * <script type="text/javascript" src="ext-core-debug.js"></script>
  31397. * <script type="text/javascript">
  31398. * Ext.Loader.setConfig({
  31399. * enabled: true,
  31400. * paths: {
  31401. * 'My': 'my_own_path'
  31402. * }
  31403. * });
  31404. * </script>
  31405. * <script type="text/javascript">
  31406. * Ext.require(...);
  31407. *
  31408. * Ext.onReady(function() {
  31409. * // application code here
  31410. * });
  31411. * </script>
  31412. *
  31413. * Refer to config options of {@link Ext.Loader} for the list of possible properties
  31414. *
  31415. * @param {Object} config The config object to override the default values
  31416. * @return {Ext.Loader} this
  31417. */
  31418. setConfig: Ext.Function.flexSetter(function(name, value) {
  31419. if (name === 'paths') {
  31420. Loader.setPath(value);
  31421. } else {
  31422. _config[name] = value;
  31423. var delegated = delegatedConfigs[name];
  31424. if (delegated) {
  31425. Boot.setConfig((delegated === true) ? name : delegated, value);
  31426. }
  31427. }
  31428. return Loader;
  31429. }),
  31430. /**
  31431. * Get the config value corresponding to the specified name. If no name is given,
  31432. * will return the config object
  31433. *
  31434. * @param {String} name The config property name
  31435. * @return {Object}
  31436. */
  31437. getConfig: function(name) {
  31438. return name ? _config[name] : _config;
  31439. },
  31440. /**
  31441. * Sets the path of a namespace.
  31442. * For Example:
  31443. *
  31444. * Ext.Loader.setPath('Ext', '.');
  31445. *
  31446. * @param {String/Object} name See {@link Ext.Function#flexSetter flexSetter}
  31447. * @param {String} [path] See {@link Ext.Function#flexSetter flexSetter}
  31448. * @return {Ext.Loader} this
  31449. * @method
  31450. */
  31451. setPath: function() {
  31452. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  31453. Manager.setPath.apply(Manager, arguments);
  31454. return Loader;
  31455. },
  31456. /**
  31457. * Sets a batch of path entries
  31458. *
  31459. * @param {Object} paths a set of className: path mappings
  31460. * @return {Ext.Loader} this
  31461. */
  31462. addClassPathMappings: function(paths) {
  31463. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  31464. Manager.setPath(paths);
  31465. return Loader;
  31466. },
  31467. /**
  31468. * fixes up loader path configs by prepending Ext.Boot#baseUrl to the beginning
  31469. * of the path, then delegates to Ext.Loader#addClassPathMappings
  31470. * @param pathConfig
  31471. */
  31472. addBaseUrlClassPathMappings: function(pathConfig) {
  31473. for (var name in pathConfig) {
  31474. pathConfig[name] = Boot.baseUrl + pathConfig[name];
  31475. }
  31476. Ext.Loader.addClassPathMappings(pathConfig);
  31477. },
  31478. /**
  31479. * Translates a className to a file path by adding the
  31480. * the proper prefix and converting the .'s to /'s. For example:
  31481. *
  31482. * Ext.Loader.setPath('My', '/path/to/My');
  31483. *
  31484. * alert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/path/to/My/awesome/Class.js'
  31485. *
  31486. * Note that the deeper namespace levels, if explicitly set, are always resolved first.
  31487. * For example:
  31488. *
  31489. * Ext.Loader.setPath({
  31490. * 'My': '/path/to/lib',
  31491. * 'My.awesome': '/other/path/for/awesome/stuff',
  31492. * 'My.awesome.more': '/more/awesome/path'
  31493. * });
  31494. *
  31495. * alert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/other/path/for/awesome/stuff/Class.js'
  31496. *
  31497. * alert(Ext.Loader.getPath('My.awesome.more.Class')); // alerts '/more/awesome/path/Class.js'
  31498. *
  31499. * alert(Ext.Loader.getPath('My.cool.Class')); // alerts '/path/to/lib/cool/Class.js'
  31500. *
  31501. * alert(Ext.Loader.getPath('Unknown.strange.Stuff')); // alerts 'Unknown/strange/Stuff.js'
  31502. *
  31503. * @param {String} className
  31504. * @return {String} path
  31505. */
  31506. getPath: function(className) {
  31507. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  31508. return Manager.getPath(className);
  31509. },
  31510. require: function(expressions, fn, scope, excludes) {
  31511. if (excludes) {
  31512. return Loader.exclude(excludes).require(expressions, fn, scope);
  31513. }
  31514. var classNames = Manager.getNamesByExpression(expressions);
  31515. return Loader.load(classNames, fn, scope);
  31516. },
  31517. syncRequire: function() {
  31518. var wasEnabled = Loader.syncModeEnabled;
  31519. Loader.syncModeEnabled = true;
  31520. var ret = Loader.require.apply(Loader, arguments);
  31521. Loader.syncModeEnabled = wasEnabled;
  31522. return ret;
  31523. },
  31524. exclude: function(excludes) {
  31525. var selector = Manager.select({
  31526. require: function(classNames, fn, scope) {
  31527. return Loader.load(classNames, fn, scope);
  31528. },
  31529. syncRequire: function(classNames, fn, scope) {
  31530. var wasEnabled = Loader.syncModeEnabled;
  31531. Loader.syncModeEnabled = true;
  31532. var ret = Loader.load(classNames, fn, scope);
  31533. Loader.syncModeEnabled = wasEnabled;
  31534. return ret;
  31535. }
  31536. });
  31537. selector.exclude(excludes);
  31538. return selector;
  31539. },
  31540. load: function(classNames, callback, scope) {
  31541. if (callback) {
  31542. if (callback.length) {
  31543. // If callback expects arguments, shim it with a function that will map
  31544. // the requires class(es) from the names we are given.
  31545. callback = Loader.makeLoadCallback(classNames, callback);
  31546. }
  31547. callback = callback.bind(scope || Ext.global);
  31548. }
  31549. var state = Manager.classState,
  31550. missingClassNames = [],
  31551. urls = [],
  31552. urlByClass = {},
  31553. numClasses = classNames.length,
  31554. url, className, i, numMissing;
  31555. for (i = 0; i < numClasses; ++i) {
  31556. className = Manager.resolveName(classNames[i]);
  31557. if (!Manager.isCreated(className)) {
  31558. missingClassNames.push(className);
  31559. if (!state[className]) {
  31560. urlByClass[className] = Loader.getPath(className);
  31561. urls.push(urlByClass[className]);
  31562. }
  31563. }
  31564. }
  31565. // If the dynamic dependency feature is not being used, throw an error
  31566. // if the dependencies are not defined
  31567. numMissing = missingClassNames.length;
  31568. if (numMissing) {
  31569. Loader.missingCount += numMissing;
  31570. Manager.onCreated(function() {
  31571. if (callback) {
  31572. Ext.callback(callback, scope, arguments);
  31573. }
  31574. Loader.checkReady();
  31575. }, Loader, missingClassNames);
  31576. if (!_config.enabled) {
  31577. Ext.raise("Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. " + "Missing required class" + ((missingClassNames.length > 1) ? "es" : "") + ": " + missingClassNames.join(', '));
  31578. }
  31579. if (urls.length) {
  31580. Loader.loadScripts({
  31581. url: urls,
  31582. // scope will be this options object so we can pass these along:
  31583. _classNames: missingClassNames,
  31584. _urlByClass: urlByClass
  31585. });
  31586. } else {
  31587. // need to call checkReady here, as the _missingCoun
  31588. // may have transitioned from 0 to > 0, meaning we
  31589. // need to block ready
  31590. Loader.checkReady();
  31591. }
  31592. } else {
  31593. if (callback) {
  31594. callback.call(scope);
  31595. }
  31596. // need to call checkReady here, as the _missingCoun
  31597. // may have transitioned from 0 to > 0, meaning we
  31598. // need to block ready
  31599. Loader.checkReady();
  31600. }
  31601. if (Loader.syncModeEnabled) {
  31602. // Class may have been just loaded or was already loaded
  31603. if (numClasses === 1) {
  31604. return Manager.get(classNames[0]);
  31605. }
  31606. }
  31607. return Loader;
  31608. },
  31609. makeLoadCallback: function(classNames, callback) {
  31610. return function() {
  31611. var classes = [],
  31612. i = classNames.length;
  31613. while (i-- > 0) {
  31614. classes[i] = Manager.get(classNames[i]);
  31615. }
  31616. return callback.apply(this, classes);
  31617. };
  31618. },
  31619. onLoadFailure: function(request) {
  31620. var options = this,
  31621. entries = request.entries || [],
  31622. onError = options.onError,
  31623. error, entry, i;
  31624. Loader.hasFileLoadError = true;
  31625. --Loader.scriptsLoading;
  31626. if (onError) {
  31627. for (i = 0; i < entries.length; i++) {
  31628. entry = entries[i];
  31629. if (entry.error) {
  31630. error = new Error('Failed to load: ' + entry.url);
  31631. break;
  31632. }
  31633. }
  31634. error = error || new Error('Failed to load');
  31635. onError.call(options.userScope, options, error, request);
  31636. } else {
  31637. Ext.log.error("[Ext.Loader] Some requested files failed to load.");
  31638. }
  31639. Loader.checkReady();
  31640. },
  31641. onLoadSuccess: function() {
  31642. var options = this,
  31643. onLoad = options.onLoad,
  31644. classNames = options._classNames,
  31645. urlByClass = options._urlByClass,
  31646. state = Manager.classState,
  31647. missingQueue = Loader.missingQueue,
  31648. className, i, len;
  31649. --Loader.scriptsLoading;
  31650. if (onLoad) {
  31651. //TODO: need an adapter to convert to v4 onLoad signatures
  31652. onLoad.call(options.userScope, options);
  31653. }
  31654. // onLoad can cause more loads to start, so it must run first
  31655. // classNames is the array of *all* classes that load() was asked to load,
  31656. // including those that might have been already loaded but not yet created.
  31657. // urlByClass is a map of only those classes that we asked Boot to load.
  31658. for (i = 0 , len = classNames.length; i < len; i++) {
  31659. className = classNames[i];
  31660. // When a script is loaded and executed, we should have Ext.define() called
  31661. // for at least one of the classes in the list, which will set the state
  31662. // for that class. That by itself does not mean that the class is available
  31663. // *now* but it means that ClassManager is tracking it and will fire the
  31664. // onCreated callback that we set back in load().
  31665. // However if there is no state for the class, that may mean two things:
  31666. // either it is not a Ext class, or it is truly missing. In any case we need
  31667. // to watch for that thing ourselves, which we will do every checkReady().
  31668. if (!state[className]) {
  31669. missingQueue[className] = urlByClass[className];
  31670. }
  31671. }
  31672. Loader.checkReady();
  31673. },
  31674. // TODO: this timing of this needs to be deferred until all classes have had
  31675. // a chance to be created
  31676. reportMissingClasses: function() {
  31677. if (!Loader.syncModeEnabled && !Loader.scriptsLoading && Loader.isLoading && !Loader.hasFileLoadError) {
  31678. var missingQueue = Loader.missingQueue,
  31679. missingClasses = [],
  31680. missingPaths = [];
  31681. for (var missingClassName in missingQueue) {
  31682. missingClasses.push(missingClassName);
  31683. missingPaths.push(missingQueue[missingClassName]);
  31684. }
  31685. if (missingClasses.length) {
  31686. 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("', '"));
  31687. }
  31688. }
  31689. },
  31690. /**
  31691. * Add a new listener to be executed when all required scripts are fully loaded
  31692. *
  31693. * @param {Function} fn The function callback to be executed
  31694. * @param {Object} scope The execution scope (`this`) of the callback function.
  31695. * @param {Boolean} [withDomReady=true] Pass `false` to not also wait for document
  31696. * dom ready.
  31697. * @param {Object} [options] Additional callback options.
  31698. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  31699. * @param {Number} [options.priority=0] Relative priority of this callback. Negative
  31700. * numbers are reserved.
  31701. */
  31702. onReady: function(fn, scope, withDomReady, options) {
  31703. if (withDomReady) {
  31704. Ready.on(fn, scope, options);
  31705. } else {
  31706. var listener = Ready.makeListener(fn, scope, options);
  31707. if (Loader.isLoading) {
  31708. readyListeners.push(listener);
  31709. } else {
  31710. Ready.invoke(listener);
  31711. }
  31712. }
  31713. },
  31714. /**
  31715. * @private
  31716. * Ensure that any classes referenced in the `uses` property are loaded.
  31717. */
  31718. addUsedClasses: function(classes) {
  31719. var cls, i, ln;
  31720. if (classes) {
  31721. classes = (typeof classes === 'string') ? [
  31722. classes
  31723. ] : classes;
  31724. for (i = 0 , ln = classes.length; i < ln; i++) {
  31725. cls = classes[i];
  31726. if (typeof cls === 'string' && !Ext.Array.contains(usedClasses, cls)) {
  31727. usedClasses.push(cls);
  31728. }
  31729. }
  31730. }
  31731. return Loader;
  31732. },
  31733. /**
  31734. * @private
  31735. */
  31736. triggerReady: function() {
  31737. var listener,
  31738. refClasses = usedClasses;
  31739. if (Loader.isLoading && refClasses.length) {
  31740. // Empty the array to eliminate potential recursive loop issue
  31741. usedClasses = [];
  31742. // this may immediately call us back if all 'uses' classes
  31743. // have been loaded
  31744. Loader.require(refClasses);
  31745. } else {
  31746. // Must clear this before calling callbacks. This will cause any new loads
  31747. // to call Ready.block() again. See below for more on this.
  31748. Loader.isLoading = false;
  31749. // These listeners are just those attached directly to Loader to wait for
  31750. // class loading only.
  31751. readyListeners.sort(Ready.sortFn);
  31752. // this method can be called with Loader.isLoading either true or false
  31753. // (can be called with false when all 'uses' classes are already loaded)
  31754. // this may bypass the above if condition
  31755. while (readyListeners.length && !Loader.isLoading) {
  31756. // we may re-enter triggerReady so we cannot necessarily iterate the
  31757. // readyListeners array
  31758. listener = readyListeners.pop();
  31759. Ready.invoke(listener);
  31760. }
  31761. // If the DOM is also ready, this will fire the normal onReady listeners.
  31762. // An astute observer would note that we may now be back to isLoading and
  31763. // so ask "Why you call unblock?". The reason is that we must match the
  31764. // calls to block and since we transitioned from isLoading to !isLoading
  31765. // here we must call unblock. If we have transitioned back to isLoading in
  31766. // the above loop it will have called block again so the counter will be
  31767. // increased and this call will not reduce the block count to 0. This is
  31768. // done by loadScripts.
  31769. Ready.unblock();
  31770. }
  31771. },
  31772. /**
  31773. * @private
  31774. * @param {String} className
  31775. */
  31776. historyPush: function(className) {
  31777. if (className && !isInHistory[className] && !Manager.overrideMap[className]) {
  31778. isInHistory[className] = true;
  31779. history.push(className);
  31780. }
  31781. return Loader;
  31782. },
  31783. /**
  31784. * This is an internal method that delegate content loading to the
  31785. * bootstrap layer.
  31786. * @private
  31787. * @param params
  31788. */
  31789. loadScripts: function(params) {
  31790. var manifest = Ext.manifest,
  31791. loadOrder = manifest && manifest.loadOrder,
  31792. loadOrderMap = manifest && manifest.loadOrderMap,
  31793. options;
  31794. ++Loader.scriptsLoading;
  31795. // if the load order map hasn't been created, create it now
  31796. // and cache on the manifest
  31797. if (loadOrder && !loadOrderMap) {
  31798. manifest.loadOrderMap = loadOrderMap = Boot.createLoadOrderMap(loadOrder);
  31799. }
  31800. // verify the loading state, as this may have transitioned us from
  31801. // not loading to loading
  31802. Loader.checkReady();
  31803. options = Ext.apply({
  31804. loadOrder: loadOrder,
  31805. loadOrderMap: loadOrderMap,
  31806. charset: _config.scriptCharset,
  31807. success: Loader.onLoadSuccess,
  31808. failure: Loader.onLoadFailure,
  31809. sync: Loader.syncModeEnabled,
  31810. _classNames: []
  31811. }, params);
  31812. options.userScope = options.scope;
  31813. options.scope = options;
  31814. Boot.load(options);
  31815. },
  31816. /**
  31817. * This method is provide for use by the bootstrap layer.
  31818. * @private
  31819. * @param {String[]} urls
  31820. */
  31821. loadScriptsSync: function(urls) {
  31822. var syncwas = Loader.syncModeEnabled;
  31823. Loader.syncModeEnabled = true;
  31824. Loader.loadScripts({
  31825. url: urls
  31826. });
  31827. Loader.syncModeEnabled = syncwas;
  31828. },
  31829. /**
  31830. * This method is provide for use by the bootstrap layer.
  31831. * @private
  31832. * @param {String[]} urls
  31833. */
  31834. loadScriptsSyncBasePrefix: function(urls) {
  31835. var syncwas = Loader.syncModeEnabled;
  31836. Loader.syncModeEnabled = true;
  31837. Loader.loadScripts({
  31838. url: urls,
  31839. prependBaseUrl: true
  31840. });
  31841. Loader.syncModeEnabled = syncwas;
  31842. },
  31843. /**
  31844. * Loads the specified script URL and calls the supplied callbacks. If this method
  31845. * is called before {@link Ext#isReady}, the script's load will delay the transition
  31846. * to ready. This can be used to load arbitrary scripts that may contain further
  31847. * {@link Ext#require Ext.require} calls.
  31848. *
  31849. * @param {Object/String/String[]} options The options object or simply the URL(s) to load.
  31850. * @param {String} options.url The URL from which to load the script.
  31851. * @param {Function} [options.onLoad] The callback to call on successful load.
  31852. * @param {Function} [options.onError] The callback to call on failure to load.
  31853. * @param {Object} [options.scope] The scope (`this`) for the supplied callbacks.
  31854. */
  31855. loadScript: function(options) {
  31856. var isString = typeof options === 'string',
  31857. isArray = options instanceof Array,
  31858. isObject = !isArray && !isString,
  31859. url = isObject ? options.url : options,
  31860. onError = isObject && options.onError,
  31861. onLoad = isObject && options.onLoad,
  31862. scope = isObject && options.scope,
  31863. request = {
  31864. url: url,
  31865. scope: scope,
  31866. onLoad: onLoad,
  31867. onError: onError,
  31868. _classNames: []
  31869. };
  31870. Loader.loadScripts(request);
  31871. },
  31872. /**
  31873. * @private
  31874. */
  31875. checkMissingQueue: function() {
  31876. var missingQueue = Loader.missingQueue,
  31877. newQueue = {},
  31878. name,
  31879. missing = 0;
  31880. for (name in missingQueue) {
  31881. // If class state is available for the name, that means ClassManager
  31882. // is tracking it and will fire callback when it is created.
  31883. // We only need to track non-class things in the Loader.
  31884. if (!(Manager.classState[name] || Manager.isCreated(name))) {
  31885. newQueue[name] = missingQueue[name];
  31886. missing++;
  31887. }
  31888. }
  31889. Loader.missingCount = missing;
  31890. Loader.missingQueue = newQueue;
  31891. },
  31892. /**
  31893. * @private
  31894. */
  31895. checkReady: function() {
  31896. var wasLoading = Loader.isLoading,
  31897. isLoading;
  31898. Loader.checkMissingQueue();
  31899. isLoading = Loader.missingCount + Loader.scriptsLoading;
  31900. if (isLoading && !wasLoading) {
  31901. Ready.block();
  31902. Loader.isLoading = !!isLoading;
  31903. } else if (!isLoading && wasLoading) {
  31904. Loader.triggerReady();
  31905. }
  31906. if (!Loader.scriptsLoading && Loader.missingCount) {
  31907. // Things look bad, but since load requests may come later, defer this
  31908. // for a bit then check if things are still stuck.
  31909. Ext.defer(function() {
  31910. if (!Loader.scriptsLoading && Loader.missingCount) {
  31911. Ext.log.error('[Loader] The following classes failed to load:');
  31912. for (var name in Loader.missingQueue) {
  31913. Ext.log.error('[Loader] ' + name + ' from ' + Loader.missingQueue[name]);
  31914. }
  31915. }
  31916. }, 1000);
  31917. }
  31918. }
  31919. });
  31920. /**
  31921. * Loads all classes by the given names and all their direct dependencies; optionally
  31922. * executes the given callback function when finishes, within the optional scope.
  31923. *
  31924. * @param {String/String[]} expressions The class, classes or wildcards to load.
  31925. * @param {Function} [fn] The callback function.
  31926. * @param {Object} [scope] The execution scope (`this`) of the callback function.
  31927. * @member Ext
  31928. * @method require
  31929. */
  31930. Ext.require = alias(Loader, 'require');
  31931. /**
  31932. * Synchronously loads all classes by the given names and all their direct dependencies; optionally
  31933. * executes the given callback function when finishes, within the optional scope.
  31934. *
  31935. * @param {String/String[]} expressions The class, classes or wildcards to load.
  31936. * @param {Function} [fn] The callback function.
  31937. * @param {Object} [scope] The execution scope (`this`) of the callback function.
  31938. * @member Ext
  31939. * @method syncRequire
  31940. */
  31941. Ext.syncRequire = alias(Loader, 'syncRequire');
  31942. /**
  31943. * Explicitly exclude files from being loaded. Useful when used in conjunction with a
  31944. * broad include expression. Can be chained with more `require` and `exclude` methods,
  31945. * for example:
  31946. *
  31947. * Ext.exclude('Ext.data.*').require('*');
  31948. *
  31949. * Ext.exclude('widget.button*').require('widget.*');
  31950. *
  31951. * @param {String/String[]} excludes
  31952. * @return {Object} Contains `exclude`, `require` and `syncRequire` methods for chaining.
  31953. * @member Ext
  31954. * @method exclude
  31955. */
  31956. Ext.exclude = alias(Loader, 'exclude');
  31957. /**
  31958. * @cfg {String[]} requires
  31959. * @member Ext.Class
  31960. * List of classes that have to be loaded before instantiating this class.
  31961. * For example:
  31962. *
  31963. * Ext.define('Mother', {
  31964. * requires: ['Child'],
  31965. * giveBirth: function() {
  31966. * // we can be sure that child class is available.
  31967. * return new Child();
  31968. * }
  31969. * });
  31970. */
  31971. Class.registerPreprocessor('loader', function(cls, data, hooks, continueFn) {
  31972. Ext.classSystemMonitor && Ext.classSystemMonitor(cls, 'Ext.Loader#loaderPreprocessor', arguments);
  31973. // jshint ignore:line
  31974. var me = this,
  31975. dependencies = [],
  31976. dependency,
  31977. className = Manager.getName(cls),
  31978. i, j, ln, subLn, value, propertyName, propertyValue, requiredMap;
  31979. /*
  31980. Loop through the dependencyProperties, look for string class names and push
  31981. them into a stack, regardless of whether the property's value is a string, array or object. For example:
  31982. {
  31983. extend: 'Ext.MyClass',
  31984. requires: ['Ext.some.OtherClass'],
  31985. mixins: {
  31986. thing: 'Foo.bar.Thing';
  31987. }
  31988. }
  31989. which will later be transformed into:
  31990. {
  31991. extend: Ext.MyClass,
  31992. requires: [Ext.some.OtherClass],
  31993. mixins: {
  31994. thing: Foo.bar.Thing;
  31995. }
  31996. }
  31997. */
  31998. for (i = 0 , ln = dependencyProperties.length; i < ln; i++) {
  31999. propertyName = dependencyProperties[i];
  32000. if (data.hasOwnProperty(propertyName)) {
  32001. propertyValue = data[propertyName];
  32002. if (typeof propertyValue === 'string') {
  32003. dependencies.push(propertyValue);
  32004. } else if (propertyValue instanceof Array) {
  32005. for (j = 0 , subLn = propertyValue.length; j < subLn; j++) {
  32006. value = propertyValue[j];
  32007. if (typeof value === 'string') {
  32008. dependencies.push(value);
  32009. }
  32010. }
  32011. } else if (typeof propertyValue !== 'function') {
  32012. for (j in propertyValue) {
  32013. if (propertyValue.hasOwnProperty(j)) {
  32014. value = propertyValue[j];
  32015. if (typeof value === 'string') {
  32016. dependencies.push(value);
  32017. }
  32018. }
  32019. }
  32020. }
  32021. }
  32022. }
  32023. if (dependencies.length === 0) {
  32024. return;
  32025. }
  32026. if (className) {
  32027. _requiresMap[className] = dependencies;
  32028. }
  32029. var manifestClasses = Ext.manifest && Ext.manifest.classes,
  32030. deadlockPath = [],
  32031. detectDeadlock;
  32032. /*
  32033. * Automatically detect deadlocks before-hand,
  32034. * will throw an error with detailed path for ease of debugging. Examples
  32035. * of deadlock cases:
  32036. *
  32037. * - A extends B, then B extends A
  32038. * - A requires B, B requires C, then C requires A
  32039. *
  32040. * The detectDeadlock function will recursively transverse till the leaf, hence
  32041. * it can detect deadlocks no matter how deep the path is. However we don't need
  32042. * to run this check if the class name is in the manifest: that means Cmd has
  32043. * already resolved all dependencies for this class with no deadlocks.
  32044. */
  32045. if (className && (!manifestClasses || !manifestClasses[className])) {
  32046. requiredMap = Loader.requiredByMap || (Loader.requiredByMap = {});
  32047. for (i = 0 , ln = dependencies.length; i < ln; i++) {
  32048. dependency = dependencies[i];
  32049. (requiredMap[dependency] || (requiredMap[dependency] = [])).push(className);
  32050. }
  32051. detectDeadlock = function(cls) {
  32052. deadlockPath.push(cls);
  32053. var requires = _requiresMap[cls],
  32054. dep, i, ln;
  32055. if (requires) {
  32056. if (Ext.Array.contains(requires, className)) {
  32057. Ext.Error.raise("Circular requirement detected! '" + className + "' and '" + deadlockPath[1] + "' mutually require each other. Path: " + deadlockPath.join(' -> ') + " -> " + deadlockPath[0]);
  32058. }
  32059. for (i = 0 , ln = requires.length; i < ln; i++) {
  32060. dep = requires[i];
  32061. if (!isInHistory[dep]) {
  32062. detectDeadlock(requires[i]);
  32063. }
  32064. }
  32065. }
  32066. };
  32067. detectDeadlock(className);
  32068. }
  32069. (className ? Loader.exclude(className) : Loader).require(dependencies, function() {
  32070. for (i = 0 , ln = dependencyProperties.length; i < ln; i++) {
  32071. propertyName = dependencyProperties[i];
  32072. if (data.hasOwnProperty(propertyName)) {
  32073. propertyValue = data[propertyName];
  32074. if (typeof propertyValue === 'string') {
  32075. data[propertyName] = Manager.get(propertyValue);
  32076. } else if (propertyValue instanceof Array) {
  32077. for (j = 0 , subLn = propertyValue.length; j < subLn; j++) {
  32078. value = propertyValue[j];
  32079. if (typeof value === 'string') {
  32080. data[propertyName][j] = Manager.get(value);
  32081. }
  32082. }
  32083. } else if (typeof propertyValue !== 'function') {
  32084. for (var k in propertyValue) {
  32085. if (propertyValue.hasOwnProperty(k)) {
  32086. value = propertyValue[k];
  32087. if (typeof value === 'string') {
  32088. data[propertyName][k] = Manager.get(value);
  32089. }
  32090. }
  32091. }
  32092. }
  32093. }
  32094. }
  32095. continueFn.call(me, cls, data, hooks);
  32096. });
  32097. return false;
  32098. }, true, 'after', 'className');
  32099. /**
  32100. * @cfg {String[]} uses
  32101. * @member Ext.Class
  32102. * List of optional classes to load together with this class. These aren't neccessarily loaded before
  32103. * this class is created, but are guaranteed to be available before Ext.onReady listeners are
  32104. * invoked. For example:
  32105. *
  32106. * Ext.define('Mother', {
  32107. * uses: ['Child'],
  32108. * giveBirth: function() {
  32109. * // This code might, or might not work:
  32110. * // return new Child();
  32111. *
  32112. * // Instead use Ext.create() to load the class at the spot if not loaded already:
  32113. * return Ext.create('Child');
  32114. * }
  32115. * });
  32116. */
  32117. Manager.registerPostprocessor('uses', function(name, cls, data) {
  32118. Ext.classSystemMonitor && Ext.classSystemMonitor(cls, 'Ext.Loader#usesPostprocessor', arguments);
  32119. // jshint ignore:line
  32120. var uses = data.uses,
  32121. classNames;
  32122. if (uses) {
  32123. classNames = Manager.getNamesByExpression(data.uses);
  32124. Loader.addUsedClasses(classNames);
  32125. }
  32126. });
  32127. Manager.onCreated(Loader.historyPush);
  32128. Loader.init();
  32129. }());
  32130. //-----------------------------------------------------------------------------
  32131. // Use performance.now when available to keep timestamps consistent.
  32132. Ext._endTime = Ext.ticks();
  32133. // This hook is to allow tools like DynaTrace to deterministically detect the availability
  32134. // of Ext.onReady. Since Loader takes over Ext.onReady this must be done here and not in
  32135. // Ext.env.Ready.
  32136. if (Ext._beforereadyhandler) {
  32137. Ext._beforereadyhandler();
  32138. }
  32139. /**
  32140. * @class Ext.util.Positionable
  32141. */
  32142. Ext.define('Ext.overrides.util.Positionable', {
  32143. override: 'Ext.util.Positionable',
  32144. /**
  32145. * @method alignTo
  32146. * @param {Ext.util.Positionable/HTMLElement/String} anchorToEl The Positionable,
  32147. * HTMLElement, or id of the element to align to.
  32148. * @param {String} [alignment="tl-bl?"] The position to align to
  32149. * @param {Number[]} [offsets] Offset the positioning by [x, y]
  32150. * @param {Boolean/Object} [animate] true for the default animation or a standard
  32151. * Element animation config object
  32152. * @return {Ext.util.Positionable} this
  32153. */
  32154. /**
  32155. * @method anchorTo
  32156. * Anchors an element to another element and realigns it when the window is resized.
  32157. * @param {Ext.util.Positionable/HTMLElement/String} anchorToEl The Positionable,
  32158. * HTMLElement, or id of the element to align to.
  32159. * @param {String} [alignment="tl-bl?"] The position to align to
  32160. * @param {Number[]} [offsets] Offset the positioning by [x, y]
  32161. * @param {Boolean/Object} [animate] true for the default animation or a standard
  32162. * Element animation config object
  32163. * @param {Boolean/Number} [monitorScroll=50] True to monitor body scroll and
  32164. * reposition. If this parameter is a number, it is used as the buffer delay in
  32165. * milliseconds.
  32166. * @param {Function} [callback] The function to call after the animation finishes
  32167. * @return {Ext.util.Positionable} this
  32168. */
  32169. anchorTo: function(anchorToEl, alignment, offsets, animate, monitorScroll, callback) {
  32170. var me = this,
  32171. scroll = !Ext.isEmpty(monitorScroll),
  32172. action = function() {
  32173. me.mixins.positionable.alignTo.call(me, anchorToEl, alignment, offsets, animate);
  32174. Ext.callback(callback, me);
  32175. },
  32176. anchor = me.getAnchor();
  32177. // previous listener anchor, remove it
  32178. me.removeAnchor();
  32179. Ext.apply(anchor, {
  32180. fn: action,
  32181. scroll: scroll
  32182. });
  32183. Ext.on('resize', action, null);
  32184. if (scroll) {
  32185. Ext.getWin().on('scroll', action, null, {
  32186. buffer: !isNaN(monitorScroll) ? monitorScroll : 50
  32187. });
  32188. }
  32189. action();
  32190. // align immediately
  32191. return me;
  32192. },
  32193. getAnchor: function() {
  32194. var el = this.el,
  32195. data, anchor;
  32196. if (!el || !el.dom) {
  32197. return;
  32198. }
  32199. data = el.getData();
  32200. anchor = data._anchor;
  32201. if (!anchor) {
  32202. anchor = data._anchor = {};
  32203. }
  32204. return anchor;
  32205. },
  32206. alignTo: function(element, position, offsets, /* private (documented in ext) */
  32207. animate) {
  32208. var me = this,
  32209. el = me.el,
  32210. newMaxHeight, newRegion;
  32211. // Release any height constraint prior to aligning if we are shrinkwrap height.
  32212. if (me.isComponent && me.getSizeModel().height.shrinkWrap) {
  32213. if (me.maxHeight) {
  32214. me.setMaxHeight(null);
  32215. }
  32216. newMaxHeight = true;
  32217. }
  32218. newRegion = me.getAlignToRegion(element, position, offsets, me.minHeight || 150);
  32219. me.setXY([
  32220. newRegion.x,
  32221. newRegion.y
  32222. ], el.anim && !!animate ? el.anim(animate) : false);
  32223. // Impose calculated height constraint.
  32224. if (newMaxHeight && (newMaxHeight = newRegion.getHeight()) !== me.getHeight()) {
  32225. me.setMaxHeight(newMaxHeight);
  32226. }
  32227. return me;
  32228. },
  32229. /**
  32230. * @method move
  32231. * Move the element relative to its current position.
  32232. * @param {String} direction Possible values are:
  32233. *
  32234. * - `"l"` (or `"left"`)
  32235. * - `"r"` (or `"right"`)
  32236. * - `"t"` (or `"top"`, or `"up"`)
  32237. * - `"b"` (or `"bottom"`, or `"down"`)
  32238. *
  32239. * @param {Number} distance How far to move the element in pixels
  32240. * @param {Boolean/Object} [animate] true for the default animation or a standard
  32241. * Element animation config object
  32242. */
  32243. /**
  32244. * Remove any anchor to this element. See {@link #anchorTo}.
  32245. * @return {Ext.util.Positionable} this
  32246. */
  32247. removeAnchor: function() {
  32248. var anchor = this.getAnchor();
  32249. if (anchor && anchor.fn) {
  32250. Ext.un('resize', anchor.fn);
  32251. if (anchor.scroll) {
  32252. Ext.getWin().on('scroll', anchor.fn);
  32253. }
  32254. delete anchor.fn;
  32255. }
  32256. return this;
  32257. },
  32258. /**
  32259. * @method setBox
  32260. * Sets the element's box. If animate is true then x, y, width, and height will be
  32261. * animated concurrently.
  32262. * @param {Object} box The box to fill {x, y, width, height}
  32263. * @param {Boolean/Object} [animate] true for the default animation or a standard
  32264. * Element animation config object
  32265. * @return {Ext.util.Positionable} this
  32266. */
  32267. setBox: function(box, animate) {
  32268. var me = this;
  32269. if (box.isRegion) {
  32270. box = {
  32271. x: box.left,
  32272. y: box.top,
  32273. width: box.right - box.left,
  32274. height: box.bottom - box.top
  32275. };
  32276. }
  32277. if (animate) {
  32278. me.constrainBox(box);
  32279. me.animate(Ext.applyIf({
  32280. to: box,
  32281. listeners: {
  32282. afteranimate: Ext.Function.bind(me.afterSetPosition, me, [
  32283. box.x,
  32284. box.y
  32285. ])
  32286. }
  32287. }, animate));
  32288. } else {
  32289. me.callParent([
  32290. box
  32291. ]);
  32292. }
  32293. return me;
  32294. }
  32295. });
  32296. /**
  32297. * @method setX
  32298. * Sets the X position of the DOM element based on page coordinates.
  32299. * @param {Number} x The X position
  32300. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  32301. * Element animation config object
  32302. * @return {Ext.util.Positionable} this
  32303. */
  32304. /**
  32305. * @method setXY
  32306. * Sets the position of the DOM element in page coordinates.
  32307. * @param {Number[]} pos Contains X & Y [x, y] values for new position (coordinates
  32308. * are page-based)
  32309. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  32310. * Element animation config object
  32311. * @return {Ext.util.Positionable} this
  32312. */
  32313. /**
  32314. * @method setY
  32315. * Sets the Y position of the DOM element based on page coordinates.
  32316. * @param {Number} y The Y position
  32317. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  32318. * Element animation config object
  32319. * @return {Ext.util.Positionable} this
  32320. */
  32321. /**
  32322. * @class Ext.event.Event
  32323. */
  32324. Ext.define('Ext.overrides.event.Event', {
  32325. override: 'Ext.event.Event',
  32326. /**
  32327. * @method injectEvent
  32328. * @member Ext.event.Event
  32329. * Injects a DOM event using the data in this object and (optionally) a new target.
  32330. * This is a low-level technique and not likely to be used by application code. The
  32331. * currently supported event types are:
  32332. * <p><b>HTMLEvents</b></p>
  32333. * <ul>
  32334. * <li>load</li>
  32335. * <li>unload</li>
  32336. * <li>select</li>
  32337. * <li>change</li>
  32338. * <li>submit</li>
  32339. * <li>reset</li>
  32340. * <li>resize</li>
  32341. * <li>scroll</li>
  32342. * </ul>
  32343. * <p><b>MouseEvents</b></p>
  32344. * <ul>
  32345. * <li>click</li>
  32346. * <li>dblclick</li>
  32347. * <li>mousedown</li>
  32348. * <li>mouseup</li>
  32349. * <li>mouseover</li>
  32350. * <li>mousemove</li>
  32351. * <li>mouseout</li>
  32352. * </ul>
  32353. * <p><b>UIEvents</b></p>
  32354. * <ul>
  32355. * <li>focusin</li>
  32356. * <li>focusout</li>
  32357. * <li>activate</li>
  32358. * <li>focus</li>
  32359. * <li>blur</li>
  32360. * </ul>
  32361. * @param {Ext.Element/HTMLElement} target (optional) If specified, the target for the event. This
  32362. * is likely to be used when relaying a DOM event. If not specified, {@link #getTarget}
  32363. * is used to determine the target.
  32364. */
  32365. injectEvent: (function() {
  32366. var API,
  32367. dispatchers = {},
  32368. // keyed by event type (e.g., 'mousedown')
  32369. crazyIEButtons;
  32370. // Good reference: http://developer.yahoo.com/yui/docs/UserAction.js.html
  32371. // IE9 has createEvent, but this code causes major problems with htmleditor (it
  32372. // blocks all mouse events and maybe more). TODO
  32373. if (!Ext.isIE9m && document.createEvent) {
  32374. // if (DOM compliant)
  32375. API = {
  32376. createHtmlEvent: function(doc, type, bubbles, cancelable) {
  32377. var event = doc.createEvent('HTMLEvents');
  32378. event.initEvent(type, bubbles, cancelable);
  32379. return event;
  32380. },
  32381. createMouseEvent: function(doc, type, bubbles, cancelable, detail, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
  32382. var event = doc.createEvent('MouseEvents'),
  32383. view = doc.defaultView || window;
  32384. if (event.initMouseEvent) {
  32385. event.initMouseEvent(type, bubbles, cancelable, view, detail, clientX, clientY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);
  32386. } else {
  32387. // old Safari
  32388. event = doc.createEvent('UIEvents');
  32389. event.initEvent(type, bubbles, cancelable);
  32390. event.view = view;
  32391. event.detail = detail;
  32392. event.screenX = clientX;
  32393. event.screenY = clientY;
  32394. event.clientX = clientX;
  32395. event.clientY = clientY;
  32396. event.ctrlKey = ctrlKey;
  32397. event.altKey = altKey;
  32398. event.metaKey = metaKey;
  32399. event.shiftKey = shiftKey;
  32400. event.button = button;
  32401. event.relatedTarget = relatedTarget;
  32402. }
  32403. return event;
  32404. },
  32405. createUIEvent: function(doc, type, bubbles, cancelable, detail) {
  32406. var event = doc.createEvent('UIEvents'),
  32407. view = doc.defaultView || window;
  32408. event.initUIEvent(type, bubbles, cancelable, view, detail);
  32409. return event;
  32410. },
  32411. fireEvent: function(target, type, event) {
  32412. target.dispatchEvent(event);
  32413. }
  32414. };
  32415. } else if (document.createEventObject) {
  32416. // else if (IE)
  32417. crazyIEButtons = {
  32418. 0: 1,
  32419. 1: 4,
  32420. 2: 2
  32421. };
  32422. API = {
  32423. createHtmlEvent: function(doc, type, bubbles, cancelable) {
  32424. var event = doc.createEventObject();
  32425. event.bubbles = bubbles;
  32426. event.cancelable = cancelable;
  32427. return event;
  32428. },
  32429. createMouseEvent: function(doc, type, bubbles, cancelable, detail, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
  32430. var event = doc.createEventObject();
  32431. event.bubbles = bubbles;
  32432. event.cancelable = cancelable;
  32433. event.detail = detail;
  32434. event.screenX = clientX;
  32435. event.screenY = clientY;
  32436. event.clientX = clientX;
  32437. event.clientY = clientY;
  32438. event.ctrlKey = ctrlKey;
  32439. event.altKey = altKey;
  32440. event.shiftKey = shiftKey;
  32441. event.metaKey = metaKey;
  32442. event.button = crazyIEButtons[button] || button;
  32443. event.relatedTarget = relatedTarget;
  32444. // cannot assign to/fromElement
  32445. return event;
  32446. },
  32447. createUIEvent: function(doc, type, bubbles, cancelable, detail) {
  32448. var event = doc.createEventObject();
  32449. event.bubbles = bubbles;
  32450. event.cancelable = cancelable;
  32451. return event;
  32452. },
  32453. fireEvent: function(target, type, event) {
  32454. target.fireEvent('on' + type, event);
  32455. }
  32456. };
  32457. }
  32458. //----------------
  32459. // HTMLEvents
  32460. Ext.Object.each({
  32461. load: [
  32462. false,
  32463. false
  32464. ],
  32465. unload: [
  32466. false,
  32467. false
  32468. ],
  32469. select: [
  32470. true,
  32471. false
  32472. ],
  32473. change: [
  32474. true,
  32475. false
  32476. ],
  32477. submit: [
  32478. true,
  32479. true
  32480. ],
  32481. reset: [
  32482. true,
  32483. false
  32484. ],
  32485. resize: [
  32486. true,
  32487. false
  32488. ],
  32489. scroll: [
  32490. true,
  32491. false
  32492. ]
  32493. }, function(name, value) {
  32494. var bubbles = value[0],
  32495. cancelable = value[1];
  32496. dispatchers[name] = function(targetEl, srcEvent) {
  32497. var e = API.createHtmlEvent(name, bubbles, cancelable);
  32498. API.fireEvent(targetEl, name, e);
  32499. };
  32500. });
  32501. //----------------
  32502. // MouseEvents
  32503. function createMouseEventDispatcher(type, detail) {
  32504. var cancelable = (type !== 'mousemove');
  32505. return function(targetEl, srcEvent) {
  32506. var xy = srcEvent.getXY(),
  32507. 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);
  32508. API.fireEvent(targetEl, type, e);
  32509. };
  32510. }
  32511. Ext.each([
  32512. 'click',
  32513. 'dblclick',
  32514. 'mousedown',
  32515. 'mouseup',
  32516. 'mouseover',
  32517. 'mousemove',
  32518. 'mouseout'
  32519. ], function(eventName) {
  32520. dispatchers[eventName] = createMouseEventDispatcher(eventName, 1);
  32521. });
  32522. //----------------
  32523. // UIEvents
  32524. Ext.Object.each({
  32525. focusin: [
  32526. true,
  32527. false
  32528. ],
  32529. focusout: [
  32530. true,
  32531. false
  32532. ],
  32533. activate: [
  32534. true,
  32535. true
  32536. ],
  32537. focus: [
  32538. false,
  32539. false
  32540. ],
  32541. blur: [
  32542. false,
  32543. false
  32544. ]
  32545. }, function(name, value) {
  32546. var bubbles = value[0],
  32547. cancelable = value[1];
  32548. dispatchers[name] = function(targetEl, srcEvent) {
  32549. var e = API.createUIEvent(targetEl.ownerDocument, name, bubbles, cancelable, 1);
  32550. API.fireEvent(targetEl, name, e);
  32551. };
  32552. });
  32553. //---------
  32554. if (!API) {
  32555. // not even sure what ancient browsers fall into this category...
  32556. dispatchers = {};
  32557. // never mind all those we just built :P
  32558. API = {};
  32559. }
  32560. function cannotInject(target, srcEvent) {}
  32561. // TODO log something
  32562. return function(target) {
  32563. var me = this,
  32564. dispatcher = dispatchers[me.type] || cannotInject,
  32565. t = target ? (target.dom || target) : me.getTarget();
  32566. dispatcher(t, me);
  32567. };
  32568. }()),
  32569. // call to produce method
  32570. preventDefault: function(browserOnly) {
  32571. var me = this,
  32572. event = me.browserEvent,
  32573. parentEvent = me.parentEvent,
  32574. unselectable, target, fn;
  32575. // This check is for IE8/9. The event object may have been
  32576. // invalidated, so we can't delve into the details of it. If so,
  32577. // just fall out gracefully and don't attempt to do anything.
  32578. if (typeof event.type !== 'unknown') {
  32579. // In some cases we want to prevent default on the browser event
  32580. // but keep propagating it through our event system. For example,
  32581. // in Checkbox selection where the cells with checkboxes should
  32582. // prevent focusing on mousedown but still fire the click event.
  32583. if (!browserOnly) {
  32584. me.defaultPrevented = true;
  32585. }
  32586. // if the event was created by prototype-chaining a new object to an existing event
  32587. // instance, we need to make sure the parent event is defaultPrevented as well.
  32588. if (parentEvent) {
  32589. parentEvent.defaultPrevented = true;
  32590. }
  32591. if (event.preventDefault) {
  32592. event.preventDefault();
  32593. } else {
  32594. // The purpose of the code below is for preventDefault to stop focus from
  32595. // occurring like it does in other modern browsers. This only happens in
  32596. // IE8/9 when using attachEvent. The use of unselectable seems the most reliable
  32597. // way to prevent this from happening. We need to use a timeout to restore the
  32598. // unselectable state because if we don't setting it has no effect. It's important
  32599. // to set the atrribute to 'on' as opposed to just setting the property on the DOM element.
  32600. // See the link below for a discussion on the issue:
  32601. // http://bugs.jquery.com/ticket/10345
  32602. if (event.type === 'mousedown') {
  32603. target = event.target;
  32604. unselectable = target.getAttribute('unselectable');
  32605. if (unselectable !== 'on') {
  32606. target.setAttribute('unselectable', 'on');
  32607. fn = function() {
  32608. target.setAttribute('unselectable', unselectable);
  32609. };
  32610. // This function is hard to track, with a potential to be called
  32611. // for any HtmlElement in the document. It may be a Fly, it may
  32612. // not belong to any Component, and it may even be created by
  32613. // 3rd party code that we have no control over and cannot intercept
  32614. // the element being destroyed.
  32615. // On the other hand, the function is pretty simple, cannot lead
  32616. // to memory leaks and is only fired once. So, no harm no foul.
  32617. fn.$skipTimerCheck = true;
  32618. Ext.defer(fn, 1);
  32619. }
  32620. }
  32621. // IE9 and earlier do not support preventDefault
  32622. event.returnValue = false;
  32623. // Some keys events require setting the keyCode to -1 to be prevented
  32624. // all ctrl + X and F1 -> F12
  32625. if (event.ctrlKey || event.keyCode > 111 && event.keyCode < 124) {
  32626. event.keyCode = -1;
  32627. }
  32628. }
  32629. }
  32630. return me;
  32631. },
  32632. deprecated: {
  32633. '5.0': {
  32634. methods: {
  32635. /**
  32636. * @method clone
  32637. * @member Ext.event.Event
  32638. * Clones this event.
  32639. * @return {Ext.event.Event} The cloned copy
  32640. * @deprecated 5.0.0 This method is deprecated.
  32641. */
  32642. clone: function() {
  32643. return new this.self(this.browserEvent, this);
  32644. }
  32645. }
  32646. }
  32647. }
  32648. }, function() {
  32649. var Event = this,
  32650. btnMap;
  32651. if (Ext.isIE9m) {
  32652. btnMap = {
  32653. 0: 0,
  32654. 1: 0,
  32655. 4: 1,
  32656. 2: 2
  32657. };
  32658. Event.override({
  32659. statics: {
  32660. /**
  32661. * @member Ext.event.Event
  32662. * When events are attached using IE's attachEvent API instead of
  32663. * addEventListener accessing any members of an event object asynchronously
  32664. * results in "Member not found" error. To work around this we fabricate
  32665. * our own event object by copying all of its members to a new object.
  32666. * @param {Event} browserEvent The native browser event object
  32667. * @private
  32668. * @static
  32669. */
  32670. enableIEAsync: function(browserEvent) {
  32671. var name,
  32672. fakeEvent = {};
  32673. for (name in browserEvent) {
  32674. fakeEvent[name] = browserEvent[name];
  32675. }
  32676. return fakeEvent;
  32677. }
  32678. },
  32679. constructor: function(event, info, touchesMap, identifiers) {
  32680. var me = this;
  32681. me.callParent([
  32682. event,
  32683. info,
  32684. touchesMap,
  32685. identifiers
  32686. ]);
  32687. me.button = btnMap[event.button];
  32688. if (event.type === 'contextmenu') {
  32689. me.button = 2;
  32690. }
  32691. // IE8/9 reports click as 0, so we can at least attempt to infer here
  32692. // IE8 can throw an error when trying to access properties on a browserEvent
  32693. // object when the event has been buffered or delayed. Cache them here
  32694. // so we can access them later.
  32695. me.toElement = event.toElement;
  32696. me.fromElement = event.fromElement;
  32697. },
  32698. mouseLeaveRe: /(mouseout|mouseleave)/,
  32699. mouseEnterRe: /(mouseover|mouseenter)/,
  32700. /**
  32701. * @method enableIEAsync
  32702. * @member Ext.event.Event
  32703. * @inheritdoc Ext.event.Event#static-method-enableIEAsync
  32704. * @private
  32705. */
  32706. enableIEAsync: function(browserEvent) {
  32707. this.browserEvent = this.self.enableIEAsync(browserEvent);
  32708. },
  32709. getRelatedTarget: function(selector, maxDepth, returnEl) {
  32710. var me = this,
  32711. type, target;
  32712. if (!me.relatedTarget) {
  32713. type = me.type;
  32714. if (me.mouseLeaveRe.test(type)) {
  32715. target = me.toElement;
  32716. } else if (me.mouseEnterRe.test(type)) {
  32717. target = me.fromElement;
  32718. }
  32719. if (target) {
  32720. me.relatedTarget = me.self.resolveTextNode(target);
  32721. }
  32722. }
  32723. return me.callParent([
  32724. selector,
  32725. maxDepth,
  32726. returnEl
  32727. ]);
  32728. }
  32729. });
  32730. // We place these listeners to capture Tab and Shift-Tab key strokes
  32731. // and pass this information in the focus/blur event if it happens
  32732. // between keydown/keyup pair.
  32733. document.attachEvent('onkeydown', Ext.event.Event.globalTabKeyDown);
  32734. document.attachEvent('onkeyup', Ext.event.Event.globalTabKeyUp);
  32735. window.attachEvent('onunload', function() {
  32736. document.detachEvent('onkeydown', Ext.event.Event.globalTabKeyDown);
  32737. document.detachEvent('onkeyup', Ext.event.Event.globalTabKeyUp);
  32738. });
  32739. }
  32740. });
  32741. Ext.define('Ext.overrides.event.publisher.Dom', {
  32742. override: 'Ext.event.publisher.Dom'
  32743. }, function(DomPublisher) {
  32744. var focusEvents = {
  32745. focus: true,
  32746. focusin: true,
  32747. focusout: true,
  32748. blur: true
  32749. };
  32750. if (Ext.isIE10m) {
  32751. DomPublisher.override({
  32752. isEventBlocked: function(e) {
  32753. if (!focusEvents[e.type]) {
  32754. return this.callParent([
  32755. e
  32756. ]);
  32757. }
  32758. var body = document.body,
  32759. ev = e.browserEvent,
  32760. el = Ext.synchronouslyFocusing;
  32761. // This horrid hack is necessary to work around the issue with input elements
  32762. // in IE10m that can fail to focus under certain conditions. See comment in
  32763. // Ext.dom.Element override.
  32764. 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))) {
  32765. return true;
  32766. }
  32767. return false;
  32768. }
  32769. });
  32770. }
  32771. if (Ext.isIE9m) {
  32772. var docElement = document.documentElement,
  32773. docBody = document.body,
  32774. prototype = DomPublisher.prototype,
  32775. onDirectEvent, onDirectCaptureEvent;
  32776. prototype.target = document;
  32777. prototype.directBoundListeners = {};
  32778. // This method gets bound to the element scope in addDirectListener so that
  32779. // the currentTarget can be captured using "this".
  32780. onDirectEvent = function(e, publisher, capture) {
  32781. e.target = e.srcElement || window;
  32782. e.currentTarget = this;
  32783. if (capture) {
  32784. // Although directly attached capture listeners are not supported in IE9m
  32785. // we still need to call the handler so at least the event fires.
  32786. publisher.onDirectCaptureEvent(e);
  32787. } else {
  32788. publisher.onDirectEvent(e);
  32789. }
  32790. };
  32791. onDirectCaptureEvent = function(e, publisher) {
  32792. e.target = e.srcElement || window;
  32793. e.currentTarget = this;
  32794. // this, not DomPublisher
  32795. publisher.onDirectCaptureEvent(e);
  32796. };
  32797. DomPublisher.override({
  32798. addDelegatedListener: function(eventName) {
  32799. this.delegatedListeners[eventName] = 1;
  32800. // Use attachEvent for IE9 and below. Even though IE9 strict supports
  32801. // addEventListener, it has issues with using synthetic events.
  32802. this.target.attachEvent('on' + eventName, this.onDelegatedEvent);
  32803. },
  32804. removeDelegatedListener: function(eventName) {
  32805. delete this.delegatedListeners[eventName];
  32806. this.target.detachEvent('on' + eventName, this.onDelegatedEvent);
  32807. },
  32808. addDirectListener: function(eventName, element, capture) {
  32809. var me = this,
  32810. dom = element.dom,
  32811. // binding the listener to the element allows us to capture the
  32812. // "currentTarget" (see onDirectEvent)
  32813. boundFn = Ext.Function.bind(onDirectEvent, dom, [
  32814. me,
  32815. capture
  32816. ], true),
  32817. directBoundListeners = me.directBoundListeners,
  32818. handlers = directBoundListeners[eventName] || (directBoundListeners[eventName] = {});
  32819. handlers[dom.id] = boundFn;
  32820. // may be called with an SVG element here, which
  32821. // does not have the attachEvent method on IE 9 strict
  32822. if (dom.attachEvent) {
  32823. dom.attachEvent('on' + eventName, boundFn);
  32824. } else {
  32825. me.callParent([
  32826. eventName,
  32827. element,
  32828. capture
  32829. ]);
  32830. }
  32831. },
  32832. removeDirectListener: function(eventName, element, capture) {
  32833. var dom = element.dom;
  32834. if (dom.detachEvent) {
  32835. dom.detachEvent('on' + eventName, this.directBoundListeners[eventName][dom.id]);
  32836. } else {
  32837. this.callParent([
  32838. eventName,
  32839. element,
  32840. capture
  32841. ]);
  32842. }
  32843. },
  32844. doDelegatedEvent: function(e) {
  32845. e.target = e.srcElement || window;
  32846. if (e.type === 'focusin') {
  32847. // IE8 sometimes happen to focus <html> element instead of the body
  32848. e.relatedTarget = e.fromElement === docBody || e.fromElement === docElement ? null : e.fromElement;
  32849. } else if (e.type === 'focusout') {
  32850. e.relatedTarget = e.toElement === docBody || e.toElement === docElement ? null : e.toElement;
  32851. }
  32852. return this.callParent([
  32853. e
  32854. ]);
  32855. }
  32856. });
  32857. // can't capture any events without addEventListener. Have to have direct
  32858. // listeners for every event that does not bubble.
  32859. Ext.apply(prototype.directEvents, prototype.captureEvents);
  32860. // These do not bubble in IE9m so have to attach direct listeners as well.
  32861. Ext.apply(prototype.directEvents, {
  32862. change: 1,
  32863. input: 1,
  32864. paste: 1
  32865. });
  32866. prototype.captureEvents = {};
  32867. }
  32868. });
  32869. Ext.define('Ext.overrides.event.publisher.Gesture', {
  32870. override: 'Ext.event.publisher.Gesture'
  32871. }, function() {
  32872. if (Ext.isIE9m) {
  32873. this.override({
  32874. updateTouches: function(e, isEnd) {
  32875. var browserEvent = e.browserEvent,
  32876. xy = e.getXY();
  32877. // I don't always set pageX and pageY on the event object, but when I do
  32878. // it's because the Gesture publisher expects an event object that has them.
  32879. browserEvent.pageX = xy[0];
  32880. browserEvent.pageY = xy[1];
  32881. this.callParent([
  32882. e,
  32883. isEnd
  32884. ]);
  32885. },
  32886. doDelegatedEvent: function(e) {
  32887. // Workaround IE's "Member not found" errors when accessing an event
  32888. // object asynchronously. Needed for all gesture handlers because
  32889. // they use requestAnimationFrame (see enableIEAsync for more details)
  32890. this.callParent([
  32891. Ext.event.Event.enableIEAsync(e)
  32892. ]);
  32893. }
  32894. });
  32895. }
  32896. });
  32897. /**
  32898. * @class Ext.dom.Element
  32899. * @override Ext.dom.Element
  32900. */
  32901. Ext.define('Ext.overrides.dom.Element', (function() {
  32902. var Element,
  32903. // we cannot do this yet "= Ext.dom.Element"
  32904. WIN = window,
  32905. DOC = document,
  32906. HIDDEN = 'hidden',
  32907. ISCLIPPED = 'isClipped',
  32908. OVERFLOW = 'overflow',
  32909. OVERFLOWX = 'overflow-x',
  32910. OVERFLOWY = 'overflow-y',
  32911. ORIGINALCLIP = 'originalClip',
  32912. HEIGHT = 'height',
  32913. WIDTH = 'width',
  32914. VISIBILITY = 'visibility',
  32915. DISPLAY = 'display',
  32916. NONE = 'none',
  32917. OFFSETS = 'offsets',
  32918. CLIP = 'clip',
  32919. ORIGINALDISPLAY = 'originalDisplay',
  32920. VISMODE = 'visibilityMode',
  32921. ISVISIBLE = 'isVisible',
  32922. OFFSETCLASS = Ext.baseCSSPrefix + 'hidden-offsets',
  32923. CLIPCLASS = Ext.baseCSSPrefix + 'hidden-clip',
  32924. boxMarkup = [
  32925. '<div class="{0}-tl" role="presentation">',
  32926. '<div class="{0}-tr" role="presentation">',
  32927. '<div class="{0}-tc" role="presentation"></div>',
  32928. '</div>',
  32929. '</div>',
  32930. '<div class="{0}-ml" role="presentation">',
  32931. '<div class="{0}-mr" role="presentation">',
  32932. '<div class="{0}-mc" role="presentation"></div>',
  32933. '</div>',
  32934. '</div>',
  32935. '<div class="{0}-bl" role="presentation">',
  32936. '<div class="{0}-br" role="presentation">',
  32937. '<div class="{0}-bc" role="presentation"></div>',
  32938. '</div>',
  32939. '</div>'
  32940. ].join(''),
  32941. scriptTagRe = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,
  32942. replaceScriptTagRe = /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,
  32943. srcRe = /\ssrc=([\'\"])(.*?)\1/i,
  32944. nonSpaceRe = /\S/,
  32945. typeRe = /\stype=([\'\"])(.*?)\1/i,
  32946. adjustDirect2DTableRe = /table-row|table-.*-group/,
  32947. msRe = /^-ms-/,
  32948. camelRe = /(-[a-z])/gi,
  32949. camelReplaceFn = function(m, a) {
  32950. return a.charAt(1).toUpperCase();
  32951. },
  32952. XMASKED = Ext.baseCSSPrefix + "masked",
  32953. XMASKEDRELATIVE = Ext.baseCSSPrefix + "masked-relative",
  32954. EXTELMASKMSG = Ext.baseCSSPrefix + "mask-msg",
  32955. bodyRe = /^body/i,
  32956. propertyCache = {},
  32957. getVisMode = function(el) {
  32958. var data = el.getData(),
  32959. visMode = data[VISMODE];
  32960. if (visMode === undefined) {
  32961. data[VISMODE] = visMode = Element.VISIBILITY;
  32962. }
  32963. return visMode;
  32964. },
  32965. emptyRange = DOC.createRange ? DOC.createRange() : null,
  32966. syncContentFly;
  32967. if (Ext.isIE8) {
  32968. var garbageBin = DOC.createElement('div'),
  32969. destroyQueue = [],
  32970. // prevent memory leaks in IE8
  32971. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  32972. // This function is called to fully destroy an element on a timer so that code following the
  32973. // remove call can still access the element.
  32974. clearGarbage,
  32975. clearGarbageFn = function() {
  32976. var len = destroyQueue.length,
  32977. i;
  32978. for (i = 0; i < len; i++) {
  32979. garbageBin.appendChild(destroyQueue[i]);
  32980. }
  32981. garbageBin.innerHTML = '';
  32982. destroyQueue.length = 0;
  32983. };
  32984. clearGarbageFn.$skipTimerCheck = true;
  32985. clearGarbage = Ext.Function.createBuffered(clearGarbageFn, 10);
  32986. }
  32987. return {
  32988. override: 'Ext.dom.Element',
  32989. mixins: [
  32990. 'Ext.util.Animate'
  32991. ],
  32992. uses: [
  32993. 'Ext.dom.GarbageCollector',
  32994. 'Ext.dom.Fly',
  32995. 'Ext.event.publisher.MouseEnterLeave',
  32996. 'Ext.fx.Manager',
  32997. 'Ext.fx.Anim'
  32998. ],
  32999. skipGarbageCollection: false,
  33000. _init: function(E) {
  33001. Element = E;
  33002. // now we can poke this into closure scope
  33003. // We want to expose destroyQueue on the prototype for testing purposes
  33004. if (WIN.__UNIT_TESTING__) {
  33005. E.destroyQueue = destroyQueue;
  33006. }
  33007. },
  33008. statics: {
  33009. normalize: function(prop) {
  33010. if (prop === 'float') {
  33011. prop = Ext.supports.Float ? 'cssFloat' : 'styleFloat';
  33012. }
  33013. // For '-ms-foo' we need msFoo
  33014. return propertyCache[prop] || (propertyCache[prop] = prop.replace(msRe, 'ms-').replace(camelRe, camelReplaceFn));
  33015. }
  33016. },
  33017. /**
  33018. * Convenience method for constructing a KeyMap
  33019. * @param {String/Number/Number[]/Object} key Either a string with the keys to listen for, the numeric key code,
  33020. * array of key codes or an object with the following options:
  33021. * @param {Number/Array} key.key
  33022. * @param {Boolean} key.shift
  33023. * @param {Boolean} key.ctrl
  33024. * @param {Boolean} key.alt
  33025. * @param {Function} fn The function to call
  33026. * @param {Object} [scope] The scope (`this` reference) in which the specified function is executed. Defaults to this Element.
  33027. * @return {Ext.util.KeyMap} The KeyMap created
  33028. */
  33029. addKeyListener: function(key, fn, scope) {
  33030. var config;
  33031. if (typeof key !== 'object' || Ext.isArray(key)) {
  33032. config = {
  33033. target: this,
  33034. key: key,
  33035. fn: fn,
  33036. scope: scope
  33037. };
  33038. } else {
  33039. config = {
  33040. target: this,
  33041. key: key.key,
  33042. shift: key.shift,
  33043. ctrl: key.ctrl,
  33044. alt: key.alt,
  33045. fn: fn,
  33046. scope: scope
  33047. };
  33048. }
  33049. return new Ext.util.KeyMap(config);
  33050. },
  33051. /**
  33052. * Creates a KeyMap for this element
  33053. * @param {Object} config The KeyMap config. See {@link Ext.util.KeyMap} for more details
  33054. * @return {Ext.util.KeyMap} The KeyMap created
  33055. */
  33056. addKeyMap: function(config) {
  33057. return new Ext.util.KeyMap(Ext.apply({
  33058. target: this
  33059. }, config));
  33060. },
  33061. /**
  33062. * @private
  33063. * Returns the fractional portion of this element's measurement in the given dimension.
  33064. * (IE9+ only)
  33065. * @return {Number}
  33066. */
  33067. adjustDirect2DDimension: function(dimension) {
  33068. var me = this,
  33069. dom = me.dom,
  33070. display = me.getStyle('display'),
  33071. inlineDisplay = dom.style.display,
  33072. inlinePosition = dom.style.position,
  33073. originIndex = dimension === WIDTH ? 0 : 1,
  33074. currentStyle = dom.currentStyle,
  33075. floating;
  33076. if (display === 'inline') {
  33077. dom.style.display = 'inline-block';
  33078. }
  33079. dom.style.position = display.match(adjustDirect2DTableRe) ? 'absolute' : 'static';
  33080. // floating will contain digits that appears after the decimal point
  33081. // if height or width are set to auto we fallback to msTransformOrigin calculation
  33082. // Use currentStyle here instead of getStyle. In some difficult to reproduce
  33083. // instances it resets the scrollWidth of the element
  33084. floating = (parseFloat(currentStyle[dimension]) || parseFloat(currentStyle.msTransformOrigin.split(' ')[originIndex]) * 2) % 1;
  33085. dom.style.position = inlinePosition;
  33086. if (display === 'inline') {
  33087. dom.style.display = inlineDisplay;
  33088. }
  33089. return floating;
  33090. },
  33091. /**
  33092. * @private
  33093. */
  33094. afterAnimate: function() {
  33095. var shadow = this.shadow;
  33096. if (shadow && !shadow.disabled && !shadow.animate) {
  33097. shadow.show();
  33098. }
  33099. },
  33100. /**
  33101. * @private
  33102. */
  33103. anchorAnimX: function(anchor) {
  33104. var xName = (anchor === 'l') ? 'right' : 'left';
  33105. this.dom.style[xName] = '0px';
  33106. },
  33107. /**
  33108. * @private
  33109. * process the passed fx configuration.
  33110. */
  33111. anim: function(config) {
  33112. if (!Ext.isObject(config)) {
  33113. return (config) ? {} : false;
  33114. }
  33115. var me = this,
  33116. duration = config.duration || Ext.fx.Anim.prototype.duration,
  33117. easing = config.easing || 'ease',
  33118. animConfig;
  33119. if (config.stopAnimation) {
  33120. me.stopAnimation();
  33121. }
  33122. Ext.applyIf(config, Ext.fx.Manager.getFxDefaults(me.id));
  33123. // Clear any 'paused' defaults.
  33124. Ext.fx.Manager.setFxDefaults(me.id, {
  33125. delay: 0
  33126. });
  33127. animConfig = {
  33128. // Pass the DOM reference. That's tested first so will be converted to an Ext.fx.Target fastest.
  33129. target: me.dom,
  33130. remove: config.remove,
  33131. alternate: config.alternate || false,
  33132. duration: duration,
  33133. easing: easing,
  33134. callback: config.callback,
  33135. listeners: config.listeners,
  33136. iterations: config.iterations || 1,
  33137. scope: config.scope,
  33138. block: config.block,
  33139. concurrent: config.concurrent,
  33140. delay: config.delay || 0,
  33141. paused: true,
  33142. keyframes: config.keyframes,
  33143. from: config.from || {},
  33144. to: Ext.apply({}, config),
  33145. userConfig: config
  33146. };
  33147. Ext.apply(animConfig.to, config.to);
  33148. // Anim API properties - backward compat
  33149. delete animConfig.to.to;
  33150. delete animConfig.to.from;
  33151. delete animConfig.to.remove;
  33152. delete animConfig.to.alternate;
  33153. delete animConfig.to.keyframes;
  33154. delete animConfig.to.iterations;
  33155. delete animConfig.to.listeners;
  33156. delete animConfig.to.target;
  33157. delete animConfig.to.paused;
  33158. delete animConfig.to.callback;
  33159. delete animConfig.to.scope;
  33160. delete animConfig.to.duration;
  33161. delete animConfig.to.easing;
  33162. delete animConfig.to.concurrent;
  33163. delete animConfig.to.block;
  33164. delete animConfig.to.stopAnimation;
  33165. delete animConfig.to.delay;
  33166. return animConfig;
  33167. },
  33168. /**
  33169. * Calls `{@link #addAnimation}` and returns this Element (for call chaining). For
  33170. * details, see `{@link #addAnimation}`.
  33171. *
  33172. * @param {Object} config Configuration for {@link Ext.fx.Anim}.
  33173. * Note that the {@link Ext.fx.Anim#to to} config is required.
  33174. * @return {Ext.dom.Element} this
  33175. */
  33176. animate: function(config) {
  33177. this.addAnimation(config);
  33178. return this;
  33179. },
  33180. /**
  33181. * Starts a custom animation on this Element.
  33182. *
  33183. * The following properties may be specified in `from`, `to`, and `keyframe` objects:
  33184. *
  33185. * - `x` - The page X position in pixels.
  33186. * - `y` - The page Y position in pixels
  33187. * - `left` - The element's CSS `left` value. Units must be supplied.
  33188. * - `top` - The element's CSS `top` value. Units must be supplied.
  33189. * - `width` - The element's CSS `width` value. Units must be supplied.
  33190. * - `height` - The element's CSS `height` value. Units must be supplied.
  33191. * - `scrollLeft` - The element's `scrollLeft` value.
  33192. * - `scrollTop` - The element's `scrollTop` value.
  33193. * - `opacity` - The element's `opacity` value (between `0` and `1`).
  33194. *
  33195. * **Be aware** that animating an Element which is being used by an Ext Component
  33196. * without in some way informing the Component about the changed element state will
  33197. * result in incorrect Component behaviour. This is because the Component will be
  33198. * using the old state of the element. To avoid this problem, it is now possible
  33199. * to directly animate certain properties of Components.
  33200. *
  33201. * @param {Object} config Configuration for {@link Ext.fx.Anim}.
  33202. * Note that the {@link Ext.fx.Anim#to to} config is required.
  33203. * @return {Ext.fx.Anim} The new animation.
  33204. */
  33205. addAnimation: function(config) {
  33206. var me = this,
  33207. animId = me.dom.id || Ext.id(me.dom),
  33208. listeners, anim, end;
  33209. if (!Ext.fx.Manager.hasFxBlock(animId)) {
  33210. // Bit of gymnastics here to ensure our internal listeners get bound first
  33211. if (config.listeners) {
  33212. listeners = config.listeners;
  33213. delete config.listeners;
  33214. }
  33215. if (config.internalListeners) {
  33216. config.listeners = config.internalListeners;
  33217. delete config.internalListeners;
  33218. }
  33219. end = config.autoEnd;
  33220. delete config.autoEnd;
  33221. anim = new Ext.fx.Anim(me.anim(config));
  33222. anim.on({
  33223. afteranimate: 'afterAnimate',
  33224. beforeanimate: 'beforeAnimate',
  33225. scope: me,
  33226. single: true
  33227. });
  33228. if (listeners) {
  33229. anim.on(listeners);
  33230. }
  33231. Ext.fx.Manager.queueFx(anim);
  33232. if (end) {
  33233. anim.jumpToEnd();
  33234. }
  33235. }
  33236. return anim;
  33237. },
  33238. /**
  33239. * @private
  33240. */
  33241. beforeAnimate: function() {
  33242. var shadow = this.shadow;
  33243. if (shadow && !shadow.disabled && !shadow.animate) {
  33244. shadow.hide();
  33245. }
  33246. },
  33247. /**
  33248. * Wraps the specified element with a special 9 element markup/CSS block that renders by default as
  33249. * a gray container with a gradient background, rounded corners and a 4-way shadow.
  33250. *
  33251. * This special markup is used throughout Ext when box wrapping elements ({@link Ext.button.Button},
  33252. * {@link Ext.panel.Panel} when {@link Ext.panel.Panel#frame frame=true}, {@link Ext.window.Window}).
  33253. * The markup is of this form:
  33254. *
  33255. * <div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div>
  33256. * <div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div>
  33257. * <div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>
  33258. *
  33259. * Example usage:
  33260. *
  33261. * // Basic box wrap
  33262. * Ext.get("foo").boxWrap();
  33263. *
  33264. * // You can also add a custom class and use CSS inheritance rules to customize the box look.
  33265. * // 'x-box-blue' is a built-in alternative -- look at the related CSS definitions as an example
  33266. * // for how to create a custom box wrap style.
  33267. * Ext.get("foo").boxWrap().addCls("x-box-blue");
  33268. *
  33269. * @param {String} [cls='x-box'] A base CSS class to apply to the containing wrapper element.
  33270. * Note that there are a number of CSS rules that are dependent on this name to make the overall effect work,
  33271. * so if you supply an alternate base class, make sure you also supply all of the necessary rules.
  33272. * @return {Ext.dom.Element} The outermost wrapping element of the created box structure.
  33273. */
  33274. boxWrap: function(cls) {
  33275. cls = cls || Ext.baseCSSPrefix + 'box';
  33276. var el = Ext.get(this.insertHtml("beforeBegin", "<div class='" + cls + "' role='presentation'>" + Ext.String.format(boxMarkup, cls) + "</div>"));
  33277. el.selectNode('.' + cls + '-mc').appendChild(this.dom);
  33278. return el;
  33279. },
  33280. /**
  33281. * Removes Empty, or whitespace filled text nodes. Combines adjacent text nodes.
  33282. * @param {Boolean} [forceReclean=false] By default the element keeps track if it has been cleaned already
  33283. * so you can call this over and over. However, if you update the element and need to force a re-clean, you
  33284. * can pass true.
  33285. */
  33286. clean: function(forceReclean) {
  33287. var me = this,
  33288. dom = me.dom,
  33289. data = me.getData(),
  33290. n = dom.firstChild,
  33291. ni = -1,
  33292. nx;
  33293. if (data.isCleaned && forceReclean !== true) {
  33294. return me;
  33295. }
  33296. while (n) {
  33297. nx = n.nextSibling;
  33298. if (n.nodeType === 3) {
  33299. // Remove empty/whitespace text nodes
  33300. if (!(nonSpaceRe.test(n.nodeValue))) {
  33301. dom.removeChild(n);
  33302. }
  33303. // Combine adjacent text nodes
  33304. else if (nx && nx.nodeType === 3) {
  33305. n.appendData(Ext.String.trim(nx.data));
  33306. dom.removeChild(nx);
  33307. nx = n.nextSibling;
  33308. n.nodeIndex = ++ni;
  33309. }
  33310. } else {
  33311. // Recursively clean
  33312. Ext.fly(n, '_clean').clean();
  33313. n.nodeIndex = ++ni;
  33314. }
  33315. n = nx;
  33316. }
  33317. data.isCleaned = true;
  33318. return me;
  33319. },
  33320. /**
  33321. * @method
  33322. * Empties this element. Removes all child nodes.
  33323. */
  33324. empty: emptyRange ? function() {
  33325. var dom = this.dom;
  33326. if (dom.firstChild) {
  33327. emptyRange.setStartBefore(dom.firstChild);
  33328. emptyRange.setEndAfter(dom.lastChild);
  33329. emptyRange.deleteContents();
  33330. }
  33331. } : function() {
  33332. var dom = this.dom;
  33333. while (dom.lastChild) {
  33334. dom.removeChild(dom.lastChild);
  33335. }
  33336. },
  33337. clearListeners: function() {
  33338. this.removeAnchor();
  33339. this.callParent();
  33340. },
  33341. /**
  33342. * Clears positioning back to the default when the document was loaded.
  33343. * @param {String} [value=''] The value to use for the left, right, top, bottom.
  33344. * You could use 'auto'.
  33345. * @return {Ext.dom.Element} this
  33346. */
  33347. clearPositioning: function(value) {
  33348. value = value || '';
  33349. return this.setStyle({
  33350. left: value,
  33351. right: value,
  33352. top: value,
  33353. bottom: value,
  33354. 'z-index': '',
  33355. position: 'static'
  33356. });
  33357. },
  33358. /**
  33359. * Creates a proxy element of this element
  33360. * @param {String/Object} config The class name of the proxy element or a DomHelper config object
  33361. * @param {String/HTMLElement} [renderTo] The element or element id to render the proxy to. Defaults to: document.body.
  33362. * @param {Boolean} [matchBox=false] True to align and size the proxy to this element now.
  33363. * @return {Ext.dom.Element} The new proxy element
  33364. */
  33365. createProxy: function(config, renderTo, matchBox) {
  33366. config = (typeof config === 'object') ? config : {
  33367. tag: "div",
  33368. role: 'presentation',
  33369. cls: config
  33370. };
  33371. var me = this,
  33372. proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) : Ext.DomHelper.insertBefore(me.dom, config, true);
  33373. proxy.setVisibilityMode(Element.DISPLAY);
  33374. proxy.hide();
  33375. if (matchBox && me.setBox && me.getBox) {
  33376. // check to make sure Element_position.js is loaded
  33377. proxy.setBox(me.getBox());
  33378. }
  33379. return proxy;
  33380. },
  33381. /**
  33382. * Clears any opacity settings from this element. Required in some cases for IE.
  33383. * @return {Ext.dom.Element} this
  33384. */
  33385. clearOpacity: function() {
  33386. return this.setOpacity('');
  33387. },
  33388. /**
  33389. * Store the current overflow setting and clip overflow on the element - use {@link #unclip} to remove
  33390. * @return {Ext.dom.Element} this
  33391. */
  33392. clip: function() {
  33393. var me = this,
  33394. data = me.getData(),
  33395. style;
  33396. if (!data[ISCLIPPED]) {
  33397. data[ISCLIPPED] = true;
  33398. style = me.getStyle([
  33399. OVERFLOW,
  33400. OVERFLOWX,
  33401. OVERFLOWY
  33402. ]);
  33403. data[ORIGINALCLIP] = {
  33404. o: style[OVERFLOW],
  33405. x: style[OVERFLOWX],
  33406. y: style[OVERFLOWY]
  33407. };
  33408. me.setStyle(OVERFLOW, HIDDEN);
  33409. me.setStyle(OVERFLOWX, HIDDEN);
  33410. me.setStyle(OVERFLOWY, HIDDEN);
  33411. }
  33412. return me;
  33413. },
  33414. destroy: function() {
  33415. var me = this,
  33416. dom = me.dom,
  33417. data = me.peekData(),
  33418. maskEl, maskMsg;
  33419. if (dom) {
  33420. if (me.isAnimate) {
  33421. me.stopAnimation(true);
  33422. }
  33423. me.removeAnchor();
  33424. }
  33425. if (me.deferredFocusTimer) {
  33426. Ext.undefer(me.deferredFocusTimer);
  33427. me.deferredFocusTimer = null;
  33428. }
  33429. me.callParent();
  33430. // prevent memory leaks in IE8
  33431. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  33432. // must not be document, documentElement, body or window object
  33433. // Have to use != instead of !== for IE8 or it will not recognize that the window
  33434. // objects are equal
  33435. if (dom && Ext.isIE8 && (dom.window != dom) && (dom.nodeType !== 9) && (dom.tagName !== 'BODY') && (dom.tagName !== 'HTML')) {
  33436. destroyQueue[destroyQueue.length] = dom;
  33437. // Will perform extra IE8 cleanup in 10 milliseconds
  33438. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  33439. clearGarbage();
  33440. }
  33441. if (data) {
  33442. maskEl = data.maskEl;
  33443. maskMsg = data.maskMsg;
  33444. if (maskEl) {
  33445. maskEl.destroy();
  33446. }
  33447. if (maskMsg) {
  33448. maskMsg.destroy();
  33449. }
  33450. }
  33451. },
  33452. /**
  33453. * Convenience method for setVisibilityMode(Element.DISPLAY).
  33454. * @param {String} [display] What to set display to when visible
  33455. * @return {Ext.dom.Element} this
  33456. */
  33457. enableDisplayMode: function(display) {
  33458. var me = this;
  33459. me.setVisibilityMode(Element.DISPLAY);
  33460. if (display !== undefined) {
  33461. me.getData()[ORIGINALDISPLAY] = display;
  33462. }
  33463. return me;
  33464. },
  33465. /**
  33466. * Fade an element in (from transparent to opaque). The ending opacity can be specified using the `opacity`
  33467. * config option. Usage:
  33468. *
  33469. * // default: fade in from opacity 0 to 100%
  33470. * el.fadeIn();
  33471. *
  33472. * // custom: fade in from opacity 0 to 75% over 2 seconds
  33473. * el.fadeIn({ opacity: .75, duration: 2000});
  33474. *
  33475. * // common config options shown with default values
  33476. * el.fadeIn({
  33477. * opacity: 1, //can be any value between 0 and 1 (e.g. .5)
  33478. * easing: 'easeOut',
  33479. * duration: 500
  33480. * });
  33481. *
  33482. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  33483. * @return {Ext.dom.Element} The Element
  33484. */
  33485. fadeIn: function(options) {
  33486. var me = this,
  33487. dom = me.dom,
  33488. animFly = new Ext.dom.Fly();
  33489. me.animate(Ext.apply({}, options, {
  33490. opacity: 1,
  33491. internalListeners: {
  33492. beforeanimate: function(anim) {
  33493. // Reattach to the DOM in case the caller animated a Fly
  33494. // in which case the dom reference will have changed by now.
  33495. animFly.attach(dom);
  33496. // restore any visibility/display that may have
  33497. // been applied by a fadeout animation
  33498. if (animFly.isStyle('display', 'none')) {
  33499. animFly.setDisplayed('');
  33500. } else {
  33501. animFly.show();
  33502. }
  33503. }
  33504. }
  33505. }));
  33506. return this;
  33507. },
  33508. /**
  33509. * Fade an element out (from opaque to transparent). The ending opacity can be specified using the `opacity`
  33510. * config option. Note that IE may require `useDisplay:true` in order to redisplay correctly.
  33511. * Usage:
  33512. *
  33513. * // default: fade out from the element's current opacity to 0
  33514. * el.fadeOut();
  33515. *
  33516. * // custom: fade out from the element's current opacity to 25% over 2 seconds
  33517. * el.fadeOut({ opacity: .25, duration: 2000});
  33518. *
  33519. * // common config options shown with default values
  33520. * el.fadeOut({
  33521. * opacity: 0, //can be any value between 0 and 1 (e.g. .5)
  33522. * easing: 'easeOut',
  33523. * duration: 500,
  33524. * remove: false,
  33525. * useDisplay: false
  33526. * });
  33527. *
  33528. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  33529. * @return {Ext.dom.Element} The Element
  33530. */
  33531. fadeOut: function(options) {
  33532. var me = this,
  33533. dom = me.dom,
  33534. animFly = new Ext.dom.Fly();
  33535. options = Ext.apply({
  33536. opacity: 0,
  33537. internalListeners: {
  33538. afteranimate: function(anim) {
  33539. if (anim.to.opacity === 0) {
  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. // Reattach to the DOM in case the caller animated a Fly
  33544. // in which case the dom reference will have changed by now.
  33545. animFly.attach(dom);
  33546. if (options.useDisplay) {
  33547. animFly.setDisplayed(false);
  33548. } else {
  33549. animFly.hide();
  33550. }
  33551. }
  33552. }
  33553. }
  33554. }, options);
  33555. me.animate(options);
  33556. return me;
  33557. },
  33558. /**
  33559. * @private
  33560. */
  33561. fixDisplay: function() {
  33562. var me = this;
  33563. if (me.isStyle(DISPLAY, NONE)) {
  33564. me.setStyle(VISIBILITY, HIDDEN);
  33565. me.setStyle(DISPLAY, me._getDisplay());
  33566. // first try reverting to default
  33567. if (me.isStyle(DISPLAY, NONE)) {
  33568. // if that fails, default to block
  33569. me.setStyle(DISPLAY, "block");
  33570. }
  33571. }
  33572. },
  33573. /**
  33574. * Shows a ripple of exploding, attenuating borders to draw attention to an Element. Usage:
  33575. *
  33576. * // default: a single light blue ripple
  33577. * el.frame();
  33578. *
  33579. * // custom: 3 red ripples lasting 3 seconds total
  33580. * el.frame("#ff0000", 3, { duration: 3000 });
  33581. *
  33582. * // common config options shown with default values
  33583. * el.frame("#C3DAF9", 1, {
  33584. * duration: 1000 // duration of each individual ripple.
  33585. * // Note: Easing is not configurable and will be ignored if included
  33586. * });
  33587. *
  33588. * @param {String} [color='#C3DAF9'] The hex color value for the border.
  33589. * @param {Number} [count=1] The number of ripples to display.
  33590. * @param {Object} [obj] Object literal with any of the {@link Ext.fx.Anim} config options
  33591. * @return {Ext.dom.Element} The Element
  33592. */
  33593. frame: function(color, count, obj) {
  33594. var me = this,
  33595. dom = me.dom,
  33596. animFly = new Ext.dom.Fly(),
  33597. beforeAnim;
  33598. color = color || '#C3DAF9';
  33599. count = count || 1;
  33600. obj = obj || {};
  33601. beforeAnim = function() {
  33602. var animScope = this,
  33603. box, proxy, proxyAnim;
  33604. // Reattach to the DOM in case the caller animated a Fly
  33605. // in which case the dom reference will have changed by now.
  33606. animFly.attach(dom);
  33607. animFly.show();
  33608. box = animFly.getBox();
  33609. proxy = Ext.getBody().createChild({
  33610. role: 'presentation',
  33611. id: animFly.dom.id + '-anim-proxy',
  33612. style: {
  33613. position: 'absolute',
  33614. 'pointer-events': 'none',
  33615. 'z-index': 35000,
  33616. border: '0px solid ' + color
  33617. }
  33618. });
  33619. proxyAnim = new Ext.fx.Anim({
  33620. target: proxy,
  33621. duration: obj.duration || 1000,
  33622. iterations: count,
  33623. from: {
  33624. top: box.y,
  33625. left: box.x,
  33626. borderWidth: 0,
  33627. opacity: 1,
  33628. height: box.height,
  33629. width: box.width
  33630. },
  33631. to: {
  33632. top: box.y - 20,
  33633. left: box.x - 20,
  33634. borderWidth: 10,
  33635. opacity: 0,
  33636. height: box.height + 40,
  33637. width: box.width + 40
  33638. }
  33639. });
  33640. proxyAnim.on('afteranimate', function() {
  33641. proxy.destroy();
  33642. // kill the no-op element animation created below
  33643. animScope.end();
  33644. });
  33645. };
  33646. me.animate({
  33647. // See "A Note About Wrapped Animations" at the top of this class:
  33648. duration: (Math.max(obj.duration, 500) * 2) || 2000,
  33649. listeners: {
  33650. beforeanimate: {
  33651. fn: beforeAnim
  33652. }
  33653. },
  33654. callback: obj.callback,
  33655. scope: obj.scope
  33656. });
  33657. return me;
  33658. },
  33659. /**
  33660. * Return the CSS color for the specified CSS attribute. rgb, 3 digit (like `#fff`)
  33661. * and valid values are convert to standard 6 digit hex color.
  33662. * @param {String} attr The css attribute
  33663. * @param {String} defaultValue The default value to use when a valid color isn't found
  33664. * @param {String} [prefix] defaults to #. Use an empty string when working with
  33665. * color anims.
  33666. * @private
  33667. */
  33668. getColor: function(attr, defaultValue, prefix) {
  33669. var v = this.getStyle(attr),
  33670. color = prefix || prefix === '' ? prefix : '#',
  33671. h, len,
  33672. i = 0;
  33673. if (!v || (/transparent|inherit/.test(v))) {
  33674. return defaultValue;
  33675. }
  33676. if (/^r/.test(v)) {
  33677. v = v.slice(4, v.length - 1).split(',');
  33678. len = v.length;
  33679. for (; i < len; i++) {
  33680. h = parseInt(v[i], 10);
  33681. color += (h < 16 ? '0' : '') + h.toString(16);
  33682. }
  33683. } else {
  33684. v = v.replace('#', '');
  33685. color += v.length === 3 ? v.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3') : v;
  33686. }
  33687. return (color.length > 5 ? color.toLowerCase() : defaultValue);
  33688. },
  33689. /**
  33690. * Gets this element's {@link Ext.ElementLoader ElementLoader}
  33691. * @return {Ext.ElementLoader} The loader
  33692. */
  33693. getLoader: function() {
  33694. var me = this,
  33695. data = me.getData(),
  33696. loader = data.loader;
  33697. if (!loader) {
  33698. data.loader = loader = new Ext.ElementLoader({
  33699. target: me
  33700. });
  33701. }
  33702. return loader;
  33703. },
  33704. /**
  33705. * Gets an object with all CSS positioning properties. Useful along with
  33706. * `setPositioning` to get snapshot before performing an update and then restoring
  33707. * the element.
  33708. * @param {Boolean} [autoPx=false] true to return pixel values for "auto" styles.
  33709. * @return {Object}
  33710. */
  33711. getPositioning: function(autoPx) {
  33712. var styles = this.getStyle([
  33713. 'left',
  33714. 'top',
  33715. 'position',
  33716. 'z-index'
  33717. ]),
  33718. dom = this.dom;
  33719. if (autoPx) {
  33720. if (styles.left === 'auto') {
  33721. styles.left = dom.offsetLeft + 'px';
  33722. }
  33723. if (styles.top === 'auto') {
  33724. styles.top = dom.offsetTop + 'px';
  33725. }
  33726. }
  33727. return styles;
  33728. },
  33729. /**
  33730. * Slides the element while fading it out of view. An anchor point can be optionally passed to set the ending point
  33731. * of the effect. Usage:
  33732. *
  33733. * // default: slide the element downward while fading out
  33734. * el.ghost();
  33735. *
  33736. * // custom: slide the element out to the right with a 2-second duration
  33737. * el.ghost('r', { duration: 2000 });
  33738. *
  33739. * // common config options shown with default values
  33740. * el.ghost('b', {
  33741. * easing: 'easeOut',
  33742. * duration: 500
  33743. * });
  33744. *
  33745. * @param {String} [anchor] One of the valid {@link Ext.fx.Anim} anchor positions (defaults to bottom: 'b')
  33746. * @param {Object} [options] Object literal with any of the {@link Ext.fx.Anim} config options
  33747. * @return {Ext.dom.Element} The Element
  33748. */
  33749. ghost: function(anchor, options) {
  33750. var me = this,
  33751. dom = me.dom,
  33752. animFly = new Ext.dom.Fly(),
  33753. beforeAnim;
  33754. anchor = anchor || "b";
  33755. beforeAnim = function() {
  33756. // Reattach to the DOM in case the caller animated a Fly
  33757. // in which case the dom reference will have changed by now.
  33758. animFly.attach(dom);
  33759. var width = animFly.getWidth(),
  33760. height = animFly.getHeight(),
  33761. xy = animFly.getXY(),
  33762. position = animFly.getPositioning(),
  33763. to = {
  33764. opacity: 0
  33765. };
  33766. switch (anchor) {
  33767. case 't':
  33768. to.y = xy[1] - height;
  33769. break;
  33770. case 'l':
  33771. to.x = xy[0] - width;
  33772. break;
  33773. case 'r':
  33774. to.x = xy[0] + width;
  33775. break;
  33776. case 'b':
  33777. to.y = xy[1] + height;
  33778. break;
  33779. case 'tl':
  33780. to.x = xy[0] - width;
  33781. to.y = xy[1] - height;
  33782. break;
  33783. case 'bl':
  33784. to.x = xy[0] - width;
  33785. to.y = xy[1] + height;
  33786. break;
  33787. case 'br':
  33788. to.x = xy[0] + width;
  33789. to.y = xy[1] + height;
  33790. break;
  33791. case 'tr':
  33792. to.x = xy[0] + width;
  33793. to.y = xy[1] - height;
  33794. break;
  33795. }
  33796. this.to = to;
  33797. this.on('afteranimate', function() {
  33798. // Reattach to the DOM in case the caller animated a Fly
  33799. // in which case the dom reference will have changed by now.
  33800. animFly.attach(dom);
  33801. if (animFly) {
  33802. animFly.hide();
  33803. animFly.clearOpacity();
  33804. animFly.setPositioning(position);
  33805. }
  33806. });
  33807. };
  33808. me.animate(Ext.applyIf(options || {}, {
  33809. duration: 500,
  33810. easing: 'ease-out',
  33811. listeners: {
  33812. beforeanimate: beforeAnim
  33813. }
  33814. }));
  33815. return me;
  33816. },
  33817. getTextSelection: function() {
  33818. var ret = this.callParent();
  33819. if (typeof ret[0] !== 'number') {
  33820. var dom = this.dom;
  33821. var doc = dom.ownerDocument;
  33822. var range = doc.selection.createRange();
  33823. var textRange = dom.createTextRange();
  33824. textRange.setEndPoint('EndToStart', range);
  33825. ret[0] = textRange.text.length;
  33826. ret[1] = ret[0] + range.text.length;
  33827. }
  33828. return ret;
  33829. },
  33830. /**
  33831. * Hide this element - Uses display mode to determine whether to use "display",
  33832. * "visibility", "offsets", or "clip". See {@link #setVisible}.
  33833. * @param {Boolean/Object} [animate] true for the default animation or a standard
  33834. * Element animation config object
  33835. * @return {Ext.dom.Element} this
  33836. */
  33837. hide: function(animate) {
  33838. // hideMode override
  33839. if (typeof animate === 'string') {
  33840. this.setVisible(false, animate);
  33841. return this;
  33842. }
  33843. this.setVisible(false, this.anim(animate));
  33844. return this;
  33845. },
  33846. /**
  33847. * Highlights the Element by setting a color (applies to the background-color by default, but can be changed using
  33848. * the "attr" config option) and then fading back to the original color. If no original color is available, you
  33849. * should provide the "endColor" config option which will be cleared after the animation. Usage:
  33850. *
  33851. * // default: highlight background to yellow
  33852. * el.highlight();
  33853. *
  33854. * // custom: highlight foreground text to blue for 2 seconds
  33855. * el.highlight("0000ff", { attr: 'color', duration: 2000 });
  33856. *
  33857. * // common config options shown with default values
  33858. * el.highlight("ffff9c", {
  33859. * attr: "backgroundColor", //can be any valid CSS property (attribute) that supports a color value
  33860. * endColor: (current color) or "ffffff",
  33861. * easing: 'easeIn',
  33862. * duration: 1000
  33863. * });
  33864. *
  33865. * @param {String} color (optional) The highlight color. Should be a 6 char hex color without the leading #
  33866. * (defaults to yellow: 'ffff9c')
  33867. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  33868. * @return {Ext.dom.Element} The Element
  33869. */
  33870. highlight: function(color, options) {
  33871. var me = this,
  33872. dom = me.dom,
  33873. from = {},
  33874. animFly = new Ext.dom.Fly(),
  33875. restore, to, attr, lns, event, fn;
  33876. options = options || {};
  33877. lns = options.listeners || {};
  33878. attr = options.attr || 'backgroundColor';
  33879. from[attr] = color || 'ffff9c';
  33880. if (!options.to) {
  33881. to = {};
  33882. to[attr] = options.endColor || me.getColor(attr, 'ffffff', '');
  33883. } else {
  33884. to = options.to;
  33885. }
  33886. // Don't apply directly on lns, since we reference it in our own callbacks below
  33887. options.listeners = Ext.apply(Ext.apply({}, lns), {
  33888. beforeanimate: function() {
  33889. // Reattach to the DOM in case the caller animated a Fly
  33890. // in which case the dom reference will have changed by now.
  33891. animFly.attach(dom);
  33892. restore = dom.style[attr];
  33893. animFly.clearOpacity();
  33894. animFly.show();
  33895. event = lns.beforeanimate;
  33896. if (event) {
  33897. fn = event.fn || event;
  33898. return fn.apply(event.scope || lns.scope || WIN, arguments);
  33899. }
  33900. },
  33901. afteranimate: function() {
  33902. if (dom) {
  33903. dom.style[attr] = restore;
  33904. }
  33905. event = lns.afteranimate;
  33906. if (event) {
  33907. fn = event.fn || event;
  33908. fn.apply(event.scope || lns.scope || WIN, arguments);
  33909. }
  33910. }
  33911. });
  33912. me.animate(Ext.apply({}, options, {
  33913. duration: 1000,
  33914. easing: 'ease-in',
  33915. from: from,
  33916. to: to
  33917. }));
  33918. return me;
  33919. },
  33920. /**
  33921. * Initializes a {@link Ext.dd.DD} drag drop object for this element.
  33922. * @param {String} group The group the DD object is member of
  33923. * @param {Object} config The DD config object
  33924. * @param {Object} overrides An object containing methods to override/implement on the DD object
  33925. * @return {Ext.dd.DD} The DD object
  33926. */
  33927. initDD: function(group, config, overrides) {
  33928. var dd = new Ext.dd.DD(Ext.id(this.dom), group, config);
  33929. return Ext.apply(dd, overrides);
  33930. },
  33931. /**
  33932. * Initializes a {@link Ext.dd.DDProxy} object for this element.
  33933. * @param {String} group The group the DDProxy object is member of
  33934. * @param {Object} config The DDProxy config object
  33935. * @param {Object} overrides An object containing methods to override/implement on the DDProxy object
  33936. * @return {Ext.dd.DDProxy} The DDProxy object
  33937. */
  33938. initDDProxy: function(group, config, overrides) {
  33939. var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config);
  33940. return Ext.apply(dd, overrides);
  33941. },
  33942. /**
  33943. * Initializes a {@link Ext.dd.DDTarget} object for this element.
  33944. * @param {String} group The group the DDTarget object is member of
  33945. * @param {Object} config The DDTarget config object
  33946. * @param {Object} overrides An object containing methods to override/implement on the DDTarget object
  33947. * @return {Ext.dd.DDTarget} The DDTarget object
  33948. */
  33949. initDDTarget: function(group, config, overrides) {
  33950. var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config);
  33951. return Ext.apply(dd, overrides);
  33952. },
  33953. /**
  33954. * Returns true if this element is masked. Also re-centers any displayed message
  33955. * within the mask.
  33956. *
  33957. * @param {Boolean} [deep] Go up the DOM hierarchy to determine if any parent
  33958. * element is masked.
  33959. *
  33960. * @return {Boolean}
  33961. */
  33962. isMasked: function(deep) {
  33963. var me = this,
  33964. data = me.getData(),
  33965. maskEl = data.maskEl,
  33966. maskMsg = data.maskMsg,
  33967. hasMask = false,
  33968. parent;
  33969. if (maskEl && maskEl.isVisible()) {
  33970. if (maskMsg) {
  33971. maskMsg.center(me);
  33972. }
  33973. hasMask = true;
  33974. } else if (deep) {
  33975. parent = me.findParentNode();
  33976. if (parent) {
  33977. return Ext.fly(parent).isMasked(deep);
  33978. }
  33979. }
  33980. return hasMask;
  33981. },
  33982. /**
  33983. * Direct access to the Ext.ElementLoader {@link Ext.ElementLoader#method-load} method.
  33984. * The method takes the same object parameter as {@link Ext.ElementLoader#method-load}
  33985. * @param {Object} options a options object for Ext.ElementLoader {@link Ext.ElementLoader#method-load}
  33986. * @return {Ext.dom.Element} this
  33987. */
  33988. load: function(options) {
  33989. this.getLoader().load(options);
  33990. return this;
  33991. },
  33992. /**
  33993. * Puts a mask over this element to disable user interaction.
  33994. * This method can only be applied to elements which accept child nodes. Use
  33995. * {@link #unmask} to remove the mask.
  33996. *
  33997. * @param {String} [msg] A message to display in the mask
  33998. * @param {String} [msgCls] A css class to apply to the msg element
  33999. * @param {Number} elHeight (private) Passed by AbstractComponent.mask to avoid the need to interrogate the DOM to get the height
  34000. * @return {Ext.dom.Element} The mask element
  34001. */
  34002. mask: function(msg, msgCls, elHeight) {
  34003. var me = this,
  34004. dom = me.dom,
  34005. data = me.getData(),
  34006. maskEl = data.maskEl,
  34007. maskMsg;
  34008. if (!(bodyRe.test(dom.tagName) && me.getStyle('position') === 'static')) {
  34009. me.addCls(XMASKEDRELATIVE);
  34010. }
  34011. // We always needs to recreate the mask since the DOM element may have been re-created
  34012. if (maskEl) {
  34013. maskEl.destroy();
  34014. }
  34015. maskEl = Ext.DomHelper.append(dom, {
  34016. role: 'presentation',
  34017. cls: Ext.baseCSSPrefix + "mask " + Ext.baseCSSPrefix + "border-box",
  34018. children: {
  34019. role: 'presentation',
  34020. cls: msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG,
  34021. cn: {
  34022. tag: 'div',
  34023. role: 'presentation',
  34024. cls: Ext.baseCSSPrefix + 'mask-msg-inner',
  34025. cn: {
  34026. tag: 'div',
  34027. role: 'presentation',
  34028. cls: Ext.baseCSSPrefix + 'mask-msg-text',
  34029. html: msg || ''
  34030. }
  34031. }
  34032. }
  34033. }, true);
  34034. maskMsg = Ext.fly(maskEl.dom.firstChild);
  34035. data.maskEl = maskEl;
  34036. me.addCls(XMASKED);
  34037. maskEl.setDisplayed(true);
  34038. if (typeof msg === 'string') {
  34039. maskMsg.setDisplayed(true);
  34040. maskMsg.center(me);
  34041. } else {
  34042. maskMsg.setDisplayed(false);
  34043. }
  34044. if (dom === DOC.body) {
  34045. maskEl.addCls(Ext.baseCSSPrefix + 'mask-fixed');
  34046. }
  34047. // When masking the body, don't touch its tabbable state
  34048. me.saveTabbableState({
  34049. skipSelf: dom === DOC.body
  34050. });
  34051. // ie will not expand full height automatically
  34052. if (Ext.isIE9m && dom !== DOC.body && me.isStyle('height', 'auto')) {
  34053. maskEl.setSize(undefined, elHeight || me.getHeight());
  34054. }
  34055. return maskEl;
  34056. },
  34057. /**
  34058. * Fades the element out while slowly expanding it in all directions. When the effect is completed, the element will
  34059. * be hidden (visibility = 'hidden') but block elements will still take up space in the document. Usage:
  34060. *
  34061. * // default
  34062. * el.puff();
  34063. *
  34064. * // common config options shown with default values
  34065. * el.puff({
  34066. * easing: 'easeOut',
  34067. * duration: 500,
  34068. * useDisplay: false
  34069. * });
  34070. *
  34071. * @param {Object} obj (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  34072. * @return {Ext.dom.Element} The Element
  34073. */
  34074. puff: function(obj) {
  34075. var me = this,
  34076. dom = me.dom,
  34077. animFly = new Ext.dom.Fly(),
  34078. beforeAnim,
  34079. box = me.getBox(),
  34080. originalStyles = me.getStyle([
  34081. 'width',
  34082. 'height',
  34083. 'left',
  34084. 'right',
  34085. 'top',
  34086. 'bottom',
  34087. 'position',
  34088. 'z-index',
  34089. 'font-size',
  34090. 'opacity'
  34091. ], true);
  34092. obj = Ext.applyIf(obj || {}, {
  34093. easing: 'ease-out',
  34094. duration: 500,
  34095. useDisplay: false
  34096. });
  34097. beforeAnim = function() {
  34098. // Reattach to the DOM in case the caller animated a Fly
  34099. // in which case the dom reference will have changed by now.
  34100. animFly.attach(dom);
  34101. animFly.clearOpacity();
  34102. animFly.show();
  34103. this.to = {
  34104. width: box.width * 2,
  34105. height: box.height * 2,
  34106. x: box.x - (box.width / 2),
  34107. y: box.y - (box.height / 2),
  34108. opacity: 0,
  34109. fontSize: '200%'
  34110. };
  34111. this.on('afteranimate', function() {
  34112. // Reattach to the DOM in case the caller animated a Fly
  34113. // in which case the dom reference will have changed by now.
  34114. animFly.attach(dom);
  34115. if (obj.useDisplay) {
  34116. animFly.setDisplayed(false);
  34117. } else {
  34118. animFly.hide();
  34119. }
  34120. animFly.setStyle(originalStyles);
  34121. Ext.callback(obj.callback, obj.scope);
  34122. });
  34123. };
  34124. me.animate({
  34125. duration: obj.duration,
  34126. easing: obj.easing,
  34127. listeners: {
  34128. beforeanimate: {
  34129. fn: beforeAnim
  34130. }
  34131. }
  34132. });
  34133. return me;
  34134. },
  34135. // private
  34136. // used to ensure the mouseup event is captured if it occurs outside of the
  34137. // window in IE9m. The only reason this method exists, (vs just calling
  34138. // el.dom.setCapture() directly) is so that we can override it to emptyFn
  34139. // during testing because setCapture() can wreak havoc on emulated mouse events
  34140. // http://msdn.microsoft.com/en-us/library/windows/desktop/ms646262(v=vs.85).aspx
  34141. setCapture: function() {
  34142. var dom = this.dom;
  34143. if (Ext.isIE9m && dom.setCapture) {
  34144. dom.setCapture();
  34145. }
  34146. },
  34147. /**
  34148. * Set the height of this Element.
  34149. *
  34150. * // change the height to 200px and animate with default configuration
  34151. * Ext.fly('elementId').setHeight(200, true);
  34152. *
  34153. * // change the height to 150px and animate with a custom configuration
  34154. * Ext.fly('elId').setHeight(150, {
  34155. * duration : 500, // animation will have a duration of .5 seconds
  34156. * // will change the content to "finished"
  34157. * callback: function(){ this.setHtml("finished"); }
  34158. * });
  34159. *
  34160. * @param {Number/String} height The new height. This may be one of:
  34161. *
  34162. * - A Number specifying the new height in pixels.
  34163. * - A String used to set the CSS height style. Animation may **not** be used.
  34164. *
  34165. * @param {Boolean/Object} [animate] a standard Element animation config object or `true` for
  34166. * the default animation (`{duration: 350, easing: 'ease-in'}`)
  34167. * @return {Ext.dom.Element} this
  34168. */
  34169. setHeight: function(height, animate) {
  34170. var me = this;
  34171. if (!animate || !me.anim) {
  34172. me.callParent(arguments);
  34173. } else {
  34174. if (!Ext.isObject(animate)) {
  34175. animate = {};
  34176. }
  34177. me.animate(Ext.applyIf({
  34178. to: {
  34179. height: height
  34180. }
  34181. }, animate));
  34182. }
  34183. return me;
  34184. },
  34185. /**
  34186. * Removes "vertical" state from this element (reverses everything done
  34187. * by {@link #setVertical}).
  34188. * @private
  34189. */
  34190. setHorizontal: function() {
  34191. var me = this,
  34192. cls = me.verticalCls;
  34193. delete me.vertical;
  34194. if (cls) {
  34195. delete me.verticalCls;
  34196. me.removeCls(cls);
  34197. }
  34198. // delete the inverted methods and revert to inheriting from the prototype
  34199. delete me.setWidth;
  34200. delete me.setHeight;
  34201. if (!Ext.isIE8) {
  34202. delete me.getWidth;
  34203. delete me.getHeight;
  34204. }
  34205. // revert to inheriting styleHooks from the prototype
  34206. delete me.styleHooks;
  34207. },
  34208. /**
  34209. * Updates the *text* value of this element.
  34210. * Replaces the content of this element with a *single text node* containing the passed text.
  34211. * @param {String} text The text to display in this Element.
  34212. */
  34213. updateText: function(text) {
  34214. var me = this,
  34215. dom, textNode;
  34216. if (dom) {
  34217. textNode = dom.firstChild;
  34218. if (!textNode || (textNode.nodeType !== 3 || textNode.nextSibling)) {
  34219. textNode = DOC.createTextNode();
  34220. me.empty();
  34221. dom.appendChild(textNode);
  34222. }
  34223. if (text) {
  34224. textNode.data = text;
  34225. }
  34226. }
  34227. },
  34228. /**
  34229. * Updates the innerHTML of this element, optionally searching for and processing scripts.
  34230. * @param {String} html The new HTML
  34231. * @param {Boolean} [loadScripts] Pass `true` to look for and process scripts.
  34232. * @param {Function} [callback] For async script loading you can be notified when the update completes.
  34233. * @param {Object} [scope=`this`] The scope (`this` reference) in which to execute the callback.
  34234. *
  34235. * Also used as the scope for any *inline* script source if the `loadScripts` parameter is `true`.
  34236. * Scripts with a `src` attribute cannot be executed in this scope.
  34237. *
  34238. * Defaults to this Element.
  34239. * @return {Ext.dom.Element} this
  34240. */
  34241. setHtml: function(html, loadScripts, callback, scope) {
  34242. var me = this,
  34243. id, dom, interval;
  34244. if (!me.dom) {
  34245. return me;
  34246. }
  34247. html = html || '';
  34248. dom = me.dom;
  34249. if (loadScripts !== true) {
  34250. dom.innerHTML = html;
  34251. Ext.callback(callback, me);
  34252. return me;
  34253. }
  34254. id = Ext.id();
  34255. html += '<span id="' + id + '" role="presentation"></span>';
  34256. interval = Ext.interval(function() {
  34257. var hd, match, attrs, srcMatch, typeMatch, el, s;
  34258. if (!(el = DOC.getElementById(id))) {
  34259. return false;
  34260. }
  34261. Ext.uninterval(interval);
  34262. Ext.removeNode(el);
  34263. hd = Ext.getHead().dom;
  34264. while ((match = scriptTagRe.exec(html))) {
  34265. attrs = match[1];
  34266. srcMatch = attrs ? attrs.match(srcRe) : false;
  34267. if (srcMatch && srcMatch[2]) {
  34268. s = DOC.createElement("script");
  34269. s.src = srcMatch[2];
  34270. typeMatch = attrs.match(typeRe);
  34271. if (typeMatch && typeMatch[2]) {
  34272. s.type = typeMatch[2];
  34273. }
  34274. hd.appendChild(s);
  34275. } else if (match[2] && match[2].length > 0) {
  34276. if (scope) {
  34277. Ext.functionFactory(match[2]).call(scope);
  34278. } else {
  34279. Ext.globalEval(match[2]);
  34280. }
  34281. }
  34282. }
  34283. Ext.callback(callback, scope || me);
  34284. }, 20);
  34285. dom.innerHTML = html.replace(replaceScriptTagRe, '');
  34286. return me;
  34287. },
  34288. /**
  34289. * Set the opacity of the element
  34290. * @param {Number} opacity The new opacity. 0 = transparent, .5 = 50% visible, 1 = fully visible, etc
  34291. * @param {Boolean/Object} [animate] a standard Element animation config object or `true` for
  34292. * the default animation (`{duration: 350, easing: 'ease-in'}`)
  34293. * @return {Ext.dom.Element} this
  34294. */
  34295. setOpacity: function(opacity, animate) {
  34296. var me = this;
  34297. if (!me.dom) {
  34298. return me;
  34299. }
  34300. if (!animate || !me.anim) {
  34301. me.setStyle('opacity', opacity);
  34302. } else {
  34303. if (typeof animate != 'object') {
  34304. animate = {
  34305. duration: 350,
  34306. easing: 'ease-in'
  34307. };
  34308. }
  34309. me.animate(Ext.applyIf({
  34310. to: {
  34311. opacity: opacity
  34312. }
  34313. }, animate));
  34314. }
  34315. return me;
  34316. },
  34317. /**
  34318. * Set positioning with an object returned by `getPositioning`.
  34319. * @param {Object} pc
  34320. * @return {Ext.dom.Element} this
  34321. */
  34322. setPositioning: function(pc) {
  34323. return this.setStyle(pc);
  34324. },
  34325. /**
  34326. * Changes this Element's state to "vertical" (rotated 90 or 270 degrees).
  34327. * This involves inverting the getters and setters for height and width,
  34328. * and applying hooks for rotating getters and setters for border/margin/padding.
  34329. * (getWidth becomes getHeight and vice versa), setStyle and getStyle will
  34330. * also return the inverse when height or width are being operated on.
  34331. *
  34332. * @param {Number} angle the angle of rotation - either 90 or 270
  34333. * @param {String} cls an optional css class that contains the required
  34334. * styles for switching the element to vertical orientation. Omit this if
  34335. * the element already contains vertical styling. If cls is provided,
  34336. * it will be removed from the element when {@link #setHorizontal} is called.
  34337. * @private
  34338. */
  34339. setVertical: function(angle, cls) {
  34340. var me = this,
  34341. proto = Element.prototype;
  34342. me.vertical = true;
  34343. if (cls) {
  34344. me.addCls(me.verticalCls = cls);
  34345. }
  34346. me.setWidth = proto.setHeight;
  34347. me.setHeight = proto.setWidth;
  34348. if (!Ext.isIE8) {
  34349. // In browsers that use CSS3 transforms we must invert getHeight and
  34350. // get Width. In IE8 no adjustment is needed because we use
  34351. // a BasicImage filter to rotate the element and the element's
  34352. // offsetWidth and offsetHeight are automatically inverted.
  34353. me.getWidth = proto.getHeight;
  34354. me.getHeight = proto.getWidth;
  34355. }
  34356. // Switch to using the appropriate vertical style hooks
  34357. me.styleHooks = (angle === 270) ? proto.verticalStyleHooks270 : proto.verticalStyleHooks90;
  34358. },
  34359. /**
  34360. * Set the size of this Element. If animation is true, both width and height will be animated concurrently.
  34361. * @param {Number/String} width The new width. This may be one of:
  34362. *
  34363. * - A Number specifying the new width in pixels.
  34364. * - A String used to set the CSS width style. Animation may **not** be used.
  34365. * - A size object in the format `{width: widthValue, height: heightValue}`.
  34366. *
  34367. * @param {Number/String} height The new height. This may be one of:
  34368. *
  34369. * - A Number specifying the new height in pixels.
  34370. * - A String used to set the CSS height style. Animation may **not** be used.
  34371. *
  34372. * @param {Boolean/Object} [animate] a standard Element animation config object or `true` for
  34373. * the default animation (`{duration: 350, easing: 'ease-in'}`)
  34374. *
  34375. * @return {Ext.dom.Element} this
  34376. */
  34377. setSize: function(width, height, animate) {
  34378. var me = this;
  34379. if (Ext.isObject(width)) {
  34380. // in case of object from getSize()
  34381. animate = height;
  34382. height = width.height;
  34383. width = width.width;
  34384. }
  34385. if (!animate || !me.anim) {
  34386. me.dom.style.width = Element.addUnits(width);
  34387. me.dom.style.height = Element.addUnits(height);
  34388. if (me.shadow || me.shim) {
  34389. me.syncUnderlays();
  34390. }
  34391. } else {
  34392. if (animate === true) {
  34393. animate = {};
  34394. }
  34395. me.animate(Ext.applyIf({
  34396. to: {
  34397. width: width,
  34398. height: height
  34399. }
  34400. }, animate));
  34401. }
  34402. return me;
  34403. },
  34404. /**
  34405. * Sets the visibility of the element (see details). If the visibilityMode is set
  34406. * to Element.DISPLAY, it will use the display property to hide the element,
  34407. * otherwise it uses visibility. The default is to hide and show using the
  34408. * visibility property.
  34409. *
  34410. * @param {Boolean} visible Whether the element is visible
  34411. * @param {Boolean/Object} [animate] True for the default animation,
  34412. * or a standard Element animation config object.
  34413. *
  34414. * @return {Ext.dom.Element} this
  34415. */
  34416. setVisible: function(visible, animate) {
  34417. var me = this,
  34418. dom = me.dom,
  34419. animFly,
  34420. visMode = getVisMode(me);
  34421. // hideMode string override
  34422. if (typeof animate === 'string') {
  34423. switch (animate) {
  34424. case DISPLAY:
  34425. visMode = Element.DISPLAY;
  34426. break;
  34427. case VISIBILITY:
  34428. visMode = Element.VISIBILITY;
  34429. break;
  34430. case OFFSETS:
  34431. visMode = Element.OFFSETS;
  34432. break;
  34433. case CLIP:
  34434. visMode = Element.CLIP;
  34435. break;
  34436. }
  34437. me.setVisibilityMode(visMode);
  34438. animate = false;
  34439. }
  34440. if (!animate || !me.anim) {
  34441. if (visMode === Element.DISPLAY) {
  34442. return me.setDisplayed(visible);
  34443. } else if (visMode === Element.OFFSETS) {
  34444. me[visible ? 'removeCls' : 'addCls'](OFFSETCLASS);
  34445. } else if (visMode === Element.CLIP) {
  34446. me[visible ? 'removeCls' : 'addCls'](CLIPCLASS);
  34447. } else if (visMode === Element.VISIBILITY) {
  34448. me.fixDisplay();
  34449. // Show by clearing visibility style. Explicitly setting to "visible" overrides parent visibility setting
  34450. dom.style.visibility = visible ? '' : HIDDEN;
  34451. }
  34452. } else {
  34453. // closure for composites
  34454. if (visible) {
  34455. me.setOpacity(0.01);
  34456. me.setVisible(true);
  34457. }
  34458. if (!Ext.isObject(animate)) {
  34459. animate = {
  34460. duration: 350,
  34461. easing: 'ease-in'
  34462. };
  34463. }
  34464. animFly = new Ext.dom.Fly() , me.animate(Ext.applyIf({
  34465. callback: function() {
  34466. if (!visible) {
  34467. // Grab the dom again, since the reference may have changed if we use fly
  34468. animFly.attach(dom).setVisible(false).setOpacity(1);
  34469. }
  34470. },
  34471. to: {
  34472. opacity: (visible) ? 1 : 0
  34473. }
  34474. }, animate));
  34475. }
  34476. me.getData()[ISVISIBLE] = visible;
  34477. if (me.shadow || me.shim) {
  34478. me.setUnderlaysVisible(visible);
  34479. }
  34480. return me;
  34481. },
  34482. /**
  34483. * Set the width of this Element.
  34484. *
  34485. * // change the width to 200px and animate with default configuration
  34486. * Ext.fly('elementId').setWidth(200, true);
  34487. *
  34488. * // change the width to 150px and animate with a custom configuration
  34489. * Ext.fly('elId').setWidth(150, {
  34490. * duration : 500, // animation will have a duration of .5 seconds
  34491. * // will change the content to "finished"
  34492. * callback: function(){ this.setHtml("finished"); }
  34493. * });
  34494. *
  34495. * @param {Number/String} width The new width. This may be one of:
  34496. *
  34497. * - A Number specifying the new width in pixels.
  34498. * - A String used to set the CSS width style. Animation may **not** be used.
  34499. *
  34500. * @param {Boolean/Object} [animate] a standard Element animation config object or `true` for
  34501. * the default animation (`{duration: 350, easing: 'ease-in'}`)
  34502. * @return {Ext.dom.Element} this
  34503. */
  34504. setWidth: function(width, animate) {
  34505. var me = this;
  34506. if (!animate || !me.anim) {
  34507. me.callParent(arguments);
  34508. } else {
  34509. if (!Ext.isObject(animate)) {
  34510. animate = {};
  34511. }
  34512. me.animate(Ext.applyIf({
  34513. to: {
  34514. width: width
  34515. }
  34516. }, animate));
  34517. }
  34518. return me;
  34519. },
  34520. setX: function(x, animate) {
  34521. return this.setXY([
  34522. x,
  34523. this.getY()
  34524. ], animate);
  34525. },
  34526. setXY: function(xy, animate) {
  34527. var me = this;
  34528. if (!animate || !me.anim) {
  34529. me.callParent([
  34530. xy
  34531. ]);
  34532. } else {
  34533. if (!Ext.isObject(animate)) {
  34534. animate = {};
  34535. }
  34536. me.animate(Ext.applyIf({
  34537. to: {
  34538. x: xy[0],
  34539. y: xy[1]
  34540. }
  34541. }, animate));
  34542. }
  34543. return this;
  34544. },
  34545. setY: function(y, animate) {
  34546. return this.setXY([
  34547. this.getX(),
  34548. y
  34549. ], animate);
  34550. },
  34551. /**
  34552. * Show this element - Uses display mode to determine whether to use "display",
  34553. * "visibility", "offsets", or "clip". See {@link #setVisible}.
  34554. *
  34555. * @param {Boolean/Object} [animate] true for the default animation or a standard
  34556. * Element animation config object.
  34557. *
  34558. * @return {Ext.dom.Element} this
  34559. */
  34560. show: function(animate) {
  34561. // hideMode override
  34562. if (typeof animate === 'string') {
  34563. this.setVisible(true, animate);
  34564. return this;
  34565. }
  34566. this.setVisible(true, this.anim(animate));
  34567. return this;
  34568. },
  34569. /**
  34570. * Slides the element into view. An anchor point can be optionally passed to set the point of origin for the slide
  34571. * effect. This function automatically handles wrapping the element with a fixed-size container if needed. See the
  34572. * {@link Ext.fx.Anim} class overview for valid anchor point options. Usage:
  34573. *
  34574. * // default: slide the element in from the top
  34575. * el.slideIn();
  34576. *
  34577. * // custom: slide the element in from the right with a 2-second duration
  34578. * el.slideIn('r', { duration: 2000 });
  34579. *
  34580. * // common config options shown with default values
  34581. * el.slideIn('t', {
  34582. * easing: 'easeOut',
  34583. * duration: 500
  34584. * });
  34585. *
  34586. * @param {String} [anchor] One of the valid {@link Ext.fx.Anim} anchor positions (defaults to top: 't')
  34587. * @param {Object} [options] Object literal with any of the {@link Ext.fx.Anim} config options
  34588. * @param {Boolean} options.preserveScroll Set to true if preservation of any descendant elements'
  34589. * `scrollTop` values is required. By default the DOM wrapping operation performed by `slideIn` and
  34590. * `slideOut` causes the browser to lose all scroll positions.
  34591. * @param {Boolean} slideOut
  34592. * @return {Ext.dom.Element} The Element
  34593. */
  34594. slideIn: function(anchor, options, slideOut) {
  34595. var me = this,
  34596. dom = me.dom,
  34597. elStyle = dom.style,
  34598. animFly = new Ext.dom.Fly(),
  34599. beforeAnim, wrapAnim, restoreScroll, wrapDomParentNode;
  34600. anchor = anchor || "t";
  34601. options = options || {};
  34602. beforeAnim = function() {
  34603. // Reattach to the DOM in case the caller animated a Fly
  34604. // in which case the dom reference will have changed by now.
  34605. animFly.attach(dom);
  34606. var animScope = this,
  34607. listeners = options.listeners,
  34608. box, originalStyles, anim, wrap;
  34609. if (!slideOut) {
  34610. animFly.fixDisplay();
  34611. }
  34612. box = animFly.getBox();
  34613. if ((anchor === 't' || anchor === 'b') && box.height === 0) {
  34614. box.height = dom.scrollHeight;
  34615. } else if ((anchor === 'l' || anchor === 'r') && box.width === 0) {
  34616. box.width = dom.scrollWidth;
  34617. }
  34618. originalStyles = animFly.getStyle([
  34619. 'width',
  34620. 'height',
  34621. 'left',
  34622. 'right',
  34623. 'top',
  34624. 'bottom',
  34625. 'position',
  34626. 'z-index'
  34627. ], true);
  34628. animFly.setSize(box.width, box.height);
  34629. // Cache all descendants' scrollTop & scrollLeft values if configured to preserve scroll.
  34630. if (options.preserveScroll) {
  34631. restoreScroll = animFly.cacheScrollValues();
  34632. }
  34633. wrap = animFly.wrap({
  34634. role: 'presentation',
  34635. id: Ext.id() + '-anim-wrap-for-' + dom.id,
  34636. style: {
  34637. visibility: slideOut ? 'visible' : 'hidden'
  34638. }
  34639. });
  34640. wrapDomParentNode = wrap.dom.parentNode;
  34641. wrap.setPositioning(animFly.getPositioning());
  34642. if (wrap.isStyle('position', 'static')) {
  34643. wrap.position('relative');
  34644. }
  34645. animFly.clearPositioning('auto');
  34646. wrap.clip();
  34647. // The wrap will have reset all descendant scrollTops. Restore them if we cached them.
  34648. if (restoreScroll) {
  34649. restoreScroll();
  34650. }
  34651. // This element is temporarily positioned absolute within its wrapper.
  34652. // Restore to its default, CSS-inherited visibility setting.
  34653. // We cannot explicitly poke visibility:visible into its style because that overrides the visibility of the wrap.
  34654. animFly.setStyle({
  34655. visibility: '',
  34656. position: 'absolute'
  34657. });
  34658. if (slideOut) {
  34659. wrap.setSize(box.width, box.height);
  34660. }
  34661. switch (anchor) {
  34662. case 't':
  34663. anim = {
  34664. from: {
  34665. width: box.width + 'px',
  34666. height: '0px'
  34667. },
  34668. to: {
  34669. width: box.width + 'px',
  34670. height: box.height + 'px'
  34671. }
  34672. };
  34673. elStyle.bottom = '0px';
  34674. break;
  34675. case 'l':
  34676. anim = {
  34677. from: {
  34678. width: '0px',
  34679. height: box.height + 'px'
  34680. },
  34681. to: {
  34682. width: box.width + 'px',
  34683. height: box.height + 'px'
  34684. }
  34685. };
  34686. me.anchorAnimX(anchor);
  34687. break;
  34688. case 'r':
  34689. anim = {
  34690. from: {
  34691. x: box.x + box.width,
  34692. width: '0px',
  34693. height: box.height + 'px'
  34694. },
  34695. to: {
  34696. x: box.x,
  34697. width: box.width + 'px',
  34698. height: box.height + 'px'
  34699. }
  34700. };
  34701. me.anchorAnimX(anchor);
  34702. break;
  34703. case 'b':
  34704. anim = {
  34705. from: {
  34706. y: box.y + box.height,
  34707. width: box.width + 'px',
  34708. height: '0px'
  34709. },
  34710. to: {
  34711. y: box.y,
  34712. width: box.width + 'px',
  34713. height: box.height + 'px'
  34714. }
  34715. };
  34716. break;
  34717. case 'tl':
  34718. anim = {
  34719. from: {
  34720. x: box.x,
  34721. y: box.y,
  34722. width: '0px',
  34723. height: '0px'
  34724. },
  34725. to: {
  34726. width: box.width + 'px',
  34727. height: box.height + 'px'
  34728. }
  34729. };
  34730. elStyle.bottom = '0px';
  34731. me.anchorAnimX('l');
  34732. break;
  34733. case 'bl':
  34734. anim = {
  34735. from: {
  34736. y: box.y + box.height,
  34737. width: '0px',
  34738. height: '0px'
  34739. },
  34740. to: {
  34741. y: box.y,
  34742. width: box.width + 'px',
  34743. height: box.height + 'px'
  34744. }
  34745. };
  34746. me.anchorAnimX('l');
  34747. break;
  34748. case 'br':
  34749. anim = {
  34750. from: {
  34751. x: box.x + box.width,
  34752. y: box.y + box.height,
  34753. width: '0px',
  34754. height: '0px'
  34755. },
  34756. to: {
  34757. x: box.x,
  34758. y: box.y,
  34759. width: box.width + 'px',
  34760. height: box.height + 'px'
  34761. }
  34762. };
  34763. me.anchorAnimX('r');
  34764. break;
  34765. case 'tr':
  34766. anim = {
  34767. from: {
  34768. x: box.x + box.width,
  34769. width: '0px',
  34770. height: '0px'
  34771. },
  34772. to: {
  34773. x: box.x,
  34774. width: box.width + 'px',
  34775. height: box.height + 'px'
  34776. }
  34777. };
  34778. elStyle.bottom = '0px';
  34779. me.anchorAnimX('r');
  34780. break;
  34781. }
  34782. wrap.show();
  34783. wrapAnim = Ext.apply({}, options);
  34784. delete wrapAnim.listeners;
  34785. wrapAnim = new Ext.fx.Anim(Ext.applyIf(wrapAnim, {
  34786. target: wrap,
  34787. duration: 500,
  34788. easing: 'ease-out',
  34789. from: slideOut ? anim.to : anim.from,
  34790. to: slideOut ? anim.from : anim.to
  34791. }));
  34792. // In the absence of a callback, this listener MUST be added first
  34793. wrapAnim.on('afteranimate', function() {
  34794. // Reattach to the DOM in case the caller animated a Fly
  34795. // in which case the dom reference will have changed by now.
  34796. animFly.attach(dom);
  34797. animFly.setStyle(originalStyles);
  34798. if (slideOut) {
  34799. if (options.useDisplay) {
  34800. animFly.setDisplayed(false);
  34801. } else {
  34802. animFly.hide();
  34803. }
  34804. }
  34805. if (wrap.dom) {
  34806. if (wrap.dom.parentNode) {
  34807. wrap.dom.parentNode.insertBefore(dom, wrap.dom);
  34808. } else {
  34809. wrapDomParentNode.appendChild(dom);
  34810. }
  34811. wrap.destroy();
  34812. }
  34813. // The unwrap will have reset all descendant scrollTops. Restore them if we cached them.
  34814. if (restoreScroll) {
  34815. restoreScroll();
  34816. }
  34817. // kill the no-op element animation created below
  34818. animScope.end();
  34819. });
  34820. // Add configured listeners after
  34821. if (listeners) {
  34822. wrapAnim.on(listeners);
  34823. }
  34824. };
  34825. me.animate({
  34826. // See "A Note About Wrapped Animations" at the top of this class:
  34827. duration: options.duration ? Math.max(options.duration, 500) * 2 : 1000,
  34828. listeners: {
  34829. beforeanimate: beforeAnim
  34830. }
  34831. });
  34832. // kick off the wrap animation
  34833. return me;
  34834. },
  34835. /**
  34836. * Slides the element out of view. An anchor point can be optionally passed to set the end point for the slide
  34837. * effect. When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will
  34838. * still take up space in the document. The element must be removed from the DOM using the 'remove' config option if
  34839. * desired. This function automatically handles wrapping the element with a fixed-size container if needed. See the
  34840. * {@link Ext.fx.Anim} class overview for valid anchor point options. Usage:
  34841. *
  34842. * // default: slide the element out to the top
  34843. * el.slideOut();
  34844. *
  34845. * // custom: slide the element out to the right with a 2-second duration
  34846. * el.slideOut('r', { duration: 2000 });
  34847. *
  34848. * // common config options shown with default values
  34849. * el.slideOut('t', {
  34850. * easing: 'easeOut',
  34851. * duration: 500,
  34852. * remove: false,
  34853. * useDisplay: false
  34854. * });
  34855. *
  34856. * @param {String} anchor (optional) One of the valid {@link Ext.fx.Anim} anchor positions (defaults to top: 't')
  34857. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  34858. * @return {Ext.dom.Element} The Element
  34859. */
  34860. slideOut: function(anchor, options) {
  34861. return this.slideIn(anchor, options, true);
  34862. },
  34863. /**
  34864. * Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television).
  34865. * When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still
  34866. * take up space in the document. The element must be removed from the DOM using the 'remove' config option if
  34867. * desired. Usage:
  34868. *
  34869. * // default
  34870. * el.switchOff();
  34871. *
  34872. * // all config options shown with default values
  34873. * el.switchOff({
  34874. * easing: 'easeIn',
  34875. * duration: .3,
  34876. * remove: false,
  34877. * useDisplay: false
  34878. * });
  34879. *
  34880. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  34881. * @return {Ext.dom.Element} The Element
  34882. */
  34883. switchOff: function(options) {
  34884. var me = this,
  34885. dom = me.dom,
  34886. animFly = new Ext.dom.Fly(),
  34887. beforeAnim;
  34888. options = Ext.applyIf(options || {}, {
  34889. easing: 'ease-in',
  34890. duration: 500,
  34891. remove: false,
  34892. useDisplay: false
  34893. });
  34894. beforeAnim = function() {
  34895. // Reattach to the DOM in case the caller animated a Fly
  34896. // in which case the dom reference will have changed by now.
  34897. animFly.attach(dom);
  34898. var animScope = this,
  34899. size = animFly.getSize(),
  34900. xy = animFly.getXY(),
  34901. keyframe, position;
  34902. animFly.clearOpacity();
  34903. animFly.clip();
  34904. position = animFly.getPositioning();
  34905. keyframe = new Ext.fx.Animator({
  34906. target: dom,
  34907. duration: options.duration,
  34908. easing: options.easing,
  34909. keyframes: {
  34910. 33: {
  34911. opacity: 0.3
  34912. },
  34913. 66: {
  34914. height: 1,
  34915. y: xy[1] + size.height / 2
  34916. },
  34917. 100: {
  34918. width: 1,
  34919. x: xy[0] + size.width / 2
  34920. }
  34921. }
  34922. });
  34923. keyframe.on('afteranimate', function() {
  34924. // Reattach to the DOM in case the caller animated a Fly
  34925. // in which case the dom reference will have changed by now.
  34926. animFly.attach(dom);
  34927. if (options.useDisplay) {
  34928. animFly.setDisplayed(false);
  34929. } else {
  34930. animFly.hide();
  34931. }
  34932. animFly.clearOpacity();
  34933. animFly.setPositioning(position);
  34934. animFly.setSize(size);
  34935. // kill the no-op element animation created below
  34936. animScope.end();
  34937. });
  34938. };
  34939. me.animate({
  34940. // See "A Note About Wrapped Animations" at the top of this class:
  34941. duration: (Math.max(options.duration, 500) * 2),
  34942. listeners: {
  34943. beforeanimate: {
  34944. fn: beforeAnim
  34945. }
  34946. },
  34947. callback: options.callback,
  34948. scope: options.scope
  34949. });
  34950. return me;
  34951. },
  34952. /**
  34953. * @private
  34954. * Currently used for updating grid cells without modifying DOM structure
  34955. *
  34956. * Synchronizes content of this Element with the content of the passed element.
  34957. *
  34958. * Style and CSS class are copied from source into this Element, and contents are synced
  34959. * recursively. If a child node is a text node, the textual data is copied.
  34960. */
  34961. syncContent: function(source) {
  34962. source = Ext.getDom(source);
  34963. var sourceNodes = source.childNodes,
  34964. sourceLen = sourceNodes.length,
  34965. dest = this.dom,
  34966. destNodes = dest.childNodes,
  34967. destLen = destNodes.length,
  34968. i, destNode, sourceNode, sourceStyle, nodeType, newAttrs, attLen, attName, value,
  34969. elData = dest._extData;
  34970. if (!syncContentFly) {
  34971. syncContentFly = new Ext.dom.Fly();
  34972. }
  34973. // Update any attributes who's values have changed..
  34974. newAttrs = source.attributes;
  34975. attLen = newAttrs.length;
  34976. for (i = 0; i < attLen; i++) {
  34977. attName = newAttrs[i].name;
  34978. value = newAttrs[i].value;
  34979. if (attName !== 'id' && dest.getAttribute(attName) !== value) {
  34980. dest.setAttribute(attName, newAttrs[i].value);
  34981. }
  34982. }
  34983. // The element's data is no longer synchronized. We just overwrite it in the DOM
  34984. if (elData) {
  34985. elData.isSynchronized = false;
  34986. }
  34987. // If the number of child nodes does not match, fall back to replacing innerHTML
  34988. if (sourceLen !== destLen) {
  34989. dest.innerHTML = source.innerHTML;
  34990. return;
  34991. }
  34992. // Loop through source nodes.
  34993. // If there are fewer, we must remove excess
  34994. for (i = 0; i < sourceLen; i++) {
  34995. sourceNode = sourceNodes[i];
  34996. destNode = destNodes[i];
  34997. nodeType = sourceNode.nodeType;
  34998. sourceStyle = sourceNode.style;
  34999. // If node structure is out of sync, just drop innerHTML in and return
  35000. if (nodeType !== destNode.nodeType || (nodeType === 1 && sourceNode.tagName !== destNode.tagName)) {
  35001. dest.innerHTML = source.innerHTML;
  35002. return;
  35003. }
  35004. // Update non-Element node (text, comment)
  35005. if (!sourceStyle) {
  35006. destNode.data = sourceNode.data;
  35007. } else // Sync element content
  35008. {
  35009. if (sourceNode.id && destNode.id !== sourceNode.id) {
  35010. destNode.id = sourceNode.id;
  35011. }
  35012. destNode.style.cssText = sourceStyle.cssText;
  35013. destNode.className = sourceNode.className;
  35014. syncContentFly.attach(destNode).syncContent(sourceNode);
  35015. }
  35016. }
  35017. },
  35018. /**
  35019. * Toggles the element's visibility, depending on visibility mode.
  35020. * @param {Boolean/Object} [animate] True for the default animation, or a standard Element animation config object
  35021. * @return {Ext.dom.Element} this
  35022. */
  35023. toggle: function(animate) {
  35024. var me = this;
  35025. me.setVisible(!me.isVisible(), me.anim(animate));
  35026. return me;
  35027. },
  35028. /**
  35029. * Hides a previously applied mask.
  35030. */
  35031. unmask: function() {
  35032. var me = this,
  35033. data = me.getData(),
  35034. maskEl = data.maskEl,
  35035. style;
  35036. if (maskEl) {
  35037. style = maskEl.dom.style;
  35038. // Remove resource-intensive CSS expressions as soon as they are not required.
  35039. if (style.clearExpression) {
  35040. style.clearExpression('width');
  35041. style.clearExpression('height');
  35042. }
  35043. if (maskEl) {
  35044. maskEl.destroy();
  35045. delete data.maskEl;
  35046. }
  35047. me.removeCls([
  35048. XMASKED,
  35049. XMASKEDRELATIVE
  35050. ]);
  35051. }
  35052. me.restoreTabbableState(me.dom === DOC.body);
  35053. },
  35054. /**
  35055. * Return clipping (overflow) to original clipping before {@link #clip} was called
  35056. * @return {Ext.dom.Element} this
  35057. */
  35058. unclip: function() {
  35059. var me = this,
  35060. data = me.getData(),
  35061. clip;
  35062. if (data[ISCLIPPED]) {
  35063. data[ISCLIPPED] = false;
  35064. clip = data[ORIGINALCLIP];
  35065. if (clip.o) {
  35066. me.setStyle(OVERFLOW, clip.o);
  35067. }
  35068. if (clip.x) {
  35069. me.setStyle(OVERFLOWX, clip.x);
  35070. }
  35071. if (clip.y) {
  35072. me.setStyle(OVERFLOWY, clip.y);
  35073. }
  35074. }
  35075. return me;
  35076. },
  35077. translate: function(x, y, z) {
  35078. if (Ext.supports.CssTransforms && !Ext.isIE9m) {
  35079. this.callParent(arguments);
  35080. } else {
  35081. if (x != null) {
  35082. this.dom.style.left = x + 'px';
  35083. }
  35084. if (y != null) {
  35085. this.dom.style.top = y + 'px';
  35086. }
  35087. }
  35088. },
  35089. deprecated: {
  35090. '4.0': {
  35091. methods: {
  35092. /**
  35093. * @method pause
  35094. * Creates a pause before any subsequent queued effects begin. If there are no effects queued after the pause it will
  35095. * have no effect. Usage:
  35096. *
  35097. * el.pause(1);
  35098. *
  35099. * @deprecated 4.0 Use the `delay` config to {@link #animate} instead.
  35100. * @param {Number} ms The length of time to pause (in milliseconds)
  35101. * @return {Ext.dom.Element} The Element
  35102. */
  35103. pause: function(ms) {
  35104. var me = this;
  35105. Ext.fx.Manager.setFxDefaults(me.id, {
  35106. delay: ms
  35107. });
  35108. return me;
  35109. },
  35110. /**
  35111. * @method scale
  35112. * Animates the transition of an element's dimensions from a starting height/width to an ending height/width. This
  35113. * method is a convenience implementation of {@link #shift}. Usage:
  35114. *
  35115. * // change height and width to 100x100 pixels
  35116. * el.scale(100, 100);
  35117. *
  35118. * // common config options shown with default values. The height and width will default to
  35119. * // the element's existing values if passed as null.
  35120. * el.scale(
  35121. * [element's width],
  35122. * [element's height], {
  35123. * easing: 'easeOut',
  35124. * duration: 350
  35125. * }
  35126. * );
  35127. *
  35128. * @deprecated 4.0 Just use {@link #animate} instead.
  35129. * @param {Number} width The new width (pass undefined to keep the original width)
  35130. * @param {Number} height The new height (pass undefined to keep the original height)
  35131. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim} config options
  35132. * @return {Ext.dom.Element} The Element
  35133. */
  35134. scale: function(width, height, options) {
  35135. this.animate(Ext.apply({}, options, {
  35136. width: width,
  35137. height: height
  35138. }));
  35139. return this;
  35140. },
  35141. /**
  35142. * @method shift
  35143. * Animates the transition of any combination of an element's dimensions, xy position and/or opacity. Any of these
  35144. * properties not specified in the config object will not be changed. This effect requires that at least one new
  35145. * dimension, position or opacity setting must be passed in on the config object in order for the function to have
  35146. * any effect. Usage:
  35147. *
  35148. * // slide the element horizontally to x position 200 while changing the height and opacity
  35149. * el.shift({ x: 200, height: 50, opacity: .8 });
  35150. *
  35151. * // common config options shown with default values.
  35152. * el.shift({
  35153. * width: [element's width],
  35154. * height: [element's height],
  35155. * x: [element's x position],
  35156. * y: [element's y position],
  35157. * opacity: [element's opacity],
  35158. * easing: 'easeOut',
  35159. * duration: 350
  35160. * });
  35161. *
  35162. * @deprecated 4.0 Just use {@link #animate} instead.
  35163. * @param {Object} options Object literal with any of the {@link Ext.fx.Anim} config options
  35164. * @return {Ext.dom.Element} The Element
  35165. */
  35166. shift: function(options) {
  35167. this.animate(options);
  35168. return this;
  35169. }
  35170. }
  35171. },
  35172. '4.2': {
  35173. methods: {
  35174. /**
  35175. * @method moveTo
  35176. * Sets the position of the element in page coordinates.
  35177. * @param {Number} x X value for new position (coordinates are page-based)
  35178. * @param {Number} y Y value for new position (coordinates are page-based)
  35179. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  35180. * Element animation config object
  35181. * @return {Ext.dom.Element} this
  35182. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setXY} instead.
  35183. */
  35184. moveTo: function(x, y, animate) {
  35185. return this.setXY([
  35186. x,
  35187. y
  35188. ], animate);
  35189. },
  35190. /**
  35191. * @method setBounds
  35192. * Sets the element's position and size in one shot. If animation is true then
  35193. * width, height, x and y will be animated concurrently.
  35194. *
  35195. * @param {Number} x X value for new position (coordinates are page-based)
  35196. * @param {Number} y Y value for new position (coordinates are page-based)
  35197. * @param {Number/String} width The new width. This may be one of:
  35198. *
  35199. * - A Number specifying the new width in pixels
  35200. * - A String used to set the CSS width style. Animation may **not** be used.
  35201. *
  35202. * @param {Number/String} height The new height. This may be one of:
  35203. *
  35204. * - A Number specifying the new height in pixels
  35205. * - A String used to set the CSS height style. Animation may **not** be used.
  35206. *
  35207. * @param {Boolean/Object} [animate] true for the default animation or
  35208. * a standard Element animation config object
  35209. *
  35210. * @return {Ext.dom.Element} this
  35211. * @deprecated 4.2.0 Use {@link Ext.util.Positionable#setBox} instead.
  35212. */
  35213. setBounds: function(x, y, width, height, animate) {
  35214. return this.setBox({
  35215. x: x,
  35216. y: y,
  35217. width: width,
  35218. height: height
  35219. }, animate);
  35220. },
  35221. /**
  35222. * @method setLeftTop
  35223. * Sets the element's left and top positions directly using CSS style
  35224. * @param {Number/String} left Number of pixels or CSS string value to
  35225. * set as the left CSS property value
  35226. * @param {Number/String} top Number of pixels or CSS string value to
  35227. * set as the top CSS property value
  35228. * @return {Ext.dom.Element} this
  35229. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setLocalXY} instead
  35230. */
  35231. setLeftTop: function(left, top) {
  35232. var me = this,
  35233. style = me.dom.style;
  35234. style.left = Element.addUnits(left);
  35235. style.top = Element.addUnits(top);
  35236. if (me.shadow || me.shim) {
  35237. me.syncUnderlays();
  35238. }
  35239. return me;
  35240. },
  35241. /**
  35242. * @method setLocation
  35243. * Sets the position of the element in page coordinates.
  35244. * @param {Number} x X value for new position
  35245. * @param {Number} y Y value for new position
  35246. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  35247. * Element animation config object
  35248. * @return {Ext.dom.Element} this
  35249. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setXY} instead.
  35250. */
  35251. setLocation: function(x, y, animate) {
  35252. return this.setXY([
  35253. x,
  35254. y
  35255. ], animate);
  35256. }
  35257. }
  35258. },
  35259. '5.0': {
  35260. methods: {
  35261. /**
  35262. * @method getAttributeNS
  35263. * Returns the value of a namespaced attribute from the element's underlying DOM node.
  35264. * @param {String} namespace The namespace in which to look for the attribute
  35265. * @param {String} name The attribute name
  35266. * @return {String} The attribute value
  35267. * @deprecated 5.0.0 Please use {@link Ext.dom.Element#getAttribute} instead.
  35268. */
  35269. getAttributeNS: function(namespace, name) {
  35270. return this.getAttribute(name, namespace);
  35271. },
  35272. /**
  35273. * @method getCenterXY
  35274. * Calculates the x, y to center this element on the screen
  35275. * @return {Number[]} The x, y values [x, y]
  35276. * @deprecated 5.0.0 Use {@link Ext.dom.Element#getAlignToXY} instead.
  35277. * el.getAlignToXY(document, 'c-c');
  35278. */
  35279. getCenterXY: function() {
  35280. return this.getAlignToXY(DOC, 'c-c');
  35281. },
  35282. /**
  35283. * @method getComputedHeight
  35284. * Returns either the offsetHeight or the height of this element based on CSS height adjusted by padding or borders
  35285. * when needed to simulate offsetHeight when offsets aren't available. This may not work on display:none elements
  35286. * if a height has not been set using CSS.
  35287. * @return {Number}
  35288. * @deprecated 5.0.0 use {@link Ext.dom.Element#getHeight} instead
  35289. */
  35290. getComputedHeight: function() {
  35291. return Math.max(this.dom.offsetHeight, this.dom.clientHeight) || parseFloat(this.getStyle(HEIGHT)) || 0;
  35292. },
  35293. /**
  35294. * @method getComputedWidth
  35295. * Returns either the offsetWidth or the width of this element based on CSS width adjusted by padding or borders
  35296. * when needed to simulate offsetWidth when offsets aren't available. This may not work on display:none elements
  35297. * if a width has not been set using CSS.
  35298. * @return {Number}
  35299. * @deprecated 5.0.0 use {@link Ext.dom.Element#getWidth} instead.
  35300. */
  35301. getComputedWidth: function() {
  35302. return Math.max(this.dom.offsetWidth, this.dom.clientWidth) || parseFloat(this.getStyle(WIDTH)) || 0;
  35303. },
  35304. /**
  35305. * @method getStyleSize
  35306. * Returns the dimensions of the element available to lay content out in.
  35307. *
  35308. * getStyleSize utilizes prefers style sizing if present, otherwise it chooses the larger of offsetHeight/clientHeight and
  35309. * offsetWidth/clientWidth. To obtain the size excluding scrollbars, use getViewSize.
  35310. *
  35311. * Sizing of the document body is handled at the adapter level which handles special cases for IE and strict modes, etc.
  35312. *
  35313. * @return {Object} Object describing width and height.
  35314. * @return {Number} return.width
  35315. * @return {Number} return.height
  35316. * @deprecated 5.0.0 Use {@link Ext.dom.Element#getSize} instead.
  35317. */
  35318. getStyleSize: function() {
  35319. var me = this,
  35320. d = this.dom,
  35321. isDoc = (d === DOC || d === DOC.body),
  35322. s, w, h;
  35323. // If the body, use static methods
  35324. if (isDoc) {
  35325. return {
  35326. width: Element.getViewportWidth(),
  35327. height: Element.getViewportHeight()
  35328. };
  35329. }
  35330. s = me.getStyle([
  35331. 'height',
  35332. 'width'
  35333. ], true);
  35334. //seek inline
  35335. // Use Styles if they are set
  35336. if (s.width && s.width !== 'auto') {
  35337. w = parseFloat(s.width);
  35338. }
  35339. // Use Styles if they are set
  35340. if (s.height && s.height !== 'auto') {
  35341. h = parseFloat(s.height);
  35342. }
  35343. // Use getWidth/getHeight if style not set.
  35344. return {
  35345. width: w || me.getWidth(true),
  35346. height: h || me.getHeight(true)
  35347. };
  35348. },
  35349. /**
  35350. * @method isBorderBox
  35351. * Returns true if this element uses the border-box-sizing model. This method is
  35352. * deprecated as of version 5.0 because border-box sizing is forced upon all elements
  35353. * via a style sheet rule, and the browsers that do not support border-box (IE6/7 strict
  35354. * mode) are no longer supported.
  35355. * @deprecated 5.0.0 This method is deprecated. Browsers that do not
  35356. * support border-box (IE6/7 strict mode) are no longer supported.
  35357. * @return {Boolean}
  35358. */
  35359. isBorderBox: function() {
  35360. return true;
  35361. },
  35362. /**
  35363. * @method isDisplayed
  35364. * Returns true if display is not "none"
  35365. * @return {Boolean}
  35366. * @deprecated 5.0.0 use element.isStyle('display', 'none');
  35367. */
  35368. isDisplayed: function() {
  35369. return !this.isStyle('display', 'none');
  35370. },
  35371. /**
  35372. * @method focusable
  35373. * Checks whether this element can be focused.
  35374. * @return {Boolean} True if the element is focusable
  35375. * @deprecated 5.0.0 use {@link #isFocusable} instead
  35376. */
  35377. focusable: 'isFocusable'
  35378. }
  35379. }
  35380. }
  35381. };
  35382. })(), function() {
  35383. var Element = Ext.dom.Element,
  35384. proto = Element.prototype,
  35385. useDocForId = !Ext.isIE8,
  35386. DOC = document,
  35387. view = DOC.defaultView,
  35388. opacityRe = /alpha\(opacity=(.*)\)/i,
  35389. trimRe = /^\s+|\s+$/g,
  35390. styleHooks = proto.styleHooks,
  35391. supports = Ext.supports,
  35392. verticalStyleHooks90, verticalStyleHooks270, edges, k, edge, borderWidth, getBorderWidth;
  35393. proto._init(Element);
  35394. delete proto._init;
  35395. Ext.plainTableCls = Ext.baseCSSPrefix + 'table-plain';
  35396. Ext.plainListCls = Ext.baseCSSPrefix + 'list-plain';
  35397. // ensure that any methods added by this override are also added to Ext.CompositeElementLite
  35398. if (Ext.CompositeElementLite) {
  35399. Ext.CompositeElementLite.importElementMethods();
  35400. }
  35401. if (!supports.Opacity && Ext.isIE) {
  35402. Ext.apply(styleHooks.opacity, {
  35403. get: function(dom) {
  35404. var filter = dom.style.filter,
  35405. match, opacity;
  35406. if (filter.match) {
  35407. match = filter.match(opacityRe);
  35408. if (match) {
  35409. opacity = parseFloat(match[1]);
  35410. if (!isNaN(opacity)) {
  35411. return opacity ? opacity / 100 : 0;
  35412. }
  35413. }
  35414. }
  35415. return 1;
  35416. },
  35417. set: function(dom, value) {
  35418. var style = dom.style,
  35419. val = style.filter.replace(opacityRe, '').replace(trimRe, '');
  35420. style.zoom = 1;
  35421. // ensure dom.hasLayout
  35422. // value can be a number or '' or null... so treat falsey as no opacity
  35423. if (typeof (value) === 'number' && value >= 0 && value < 1) {
  35424. value *= 100;
  35425. style.filter = val + (val.length ? ' ' : '') + 'alpha(opacity=' + value + ')';
  35426. } else {
  35427. style.filter = val;
  35428. }
  35429. }
  35430. });
  35431. }
  35432. if (!supports.matchesSelector) {
  35433. // Match basic tagName.ClassName selector syntax for is implementation
  35434. var simpleSelectorRe = /^([a-z]+|\*)?(?:\.([a-z][a-z\-_0-9]*))?$/i,
  35435. dashRe = /\-/g,
  35436. fragment,
  35437. classMatcher = function(tag, cls) {
  35438. var classRe = new RegExp('(?:^|\\s+)' + cls.replace(dashRe, '\\-') + '(?:\\s+|$)');
  35439. if (tag && tag !== '*') {
  35440. tag = tag.toUpperCase();
  35441. return function(el) {
  35442. return el.tagName === tag && classRe.test(el.className);
  35443. };
  35444. }
  35445. return function(el) {
  35446. return classRe.test(el.className);
  35447. };
  35448. },
  35449. tagMatcher = function(tag) {
  35450. tag = tag.toUpperCase();
  35451. return function(el) {
  35452. return el.tagName === tag;
  35453. };
  35454. },
  35455. cache = {};
  35456. proto.matcherCache = cache;
  35457. proto.is = function(selector) {
  35458. // Empty selector always matches
  35459. if (!selector) {
  35460. return true;
  35461. }
  35462. var dom = this.dom,
  35463. cls, match, testFn, root, isOrphan, is, tag;
  35464. // Only Element node types can be matched.
  35465. if (dom.nodeType !== 1) {
  35466. return false;
  35467. }
  35468. if (!(testFn = Ext.isFunction(selector) ? selector : cache[selector])) {
  35469. if (!(match = selector.match(simpleSelectorRe))) {
  35470. // Not a simple tagName.className selector, do it the hard way
  35471. root = dom.parentNode;
  35472. if (!root) {
  35473. isOrphan = true;
  35474. root = fragment || (fragment = DOC.createDocumentFragment());
  35475. fragment.appendChild(dom);
  35476. }
  35477. is = Ext.Array.indexOf(Ext.fly(root, '_is').query(selector), dom) !== -1;
  35478. if (isOrphan) {
  35479. fragment.removeChild(dom);
  35480. }
  35481. return is;
  35482. }
  35483. tag = match[1];
  35484. cls = match[2];
  35485. cache[selector] = testFn = cls ? classMatcher(tag, cls) : tagMatcher(tag);
  35486. }
  35487. return testFn(dom);
  35488. };
  35489. }
  35490. // IE8 needs its own implementation of getStyle because it doesn't support getComputedStyle
  35491. if (!view || !view.getComputedStyle) {
  35492. proto.getStyle = function(property, inline) {
  35493. var me = this,
  35494. dom = me.dom,
  35495. multiple = typeof property !== 'string',
  35496. prop = property,
  35497. props = prop,
  35498. len = 1,
  35499. isInline = inline,
  35500. styleHooks = me.styleHooks,
  35501. camel, domStyle, values, hook, out, style, i;
  35502. if (multiple) {
  35503. values = {};
  35504. prop = props[0];
  35505. i = 0;
  35506. if (!(len = props.length)) {
  35507. return values;
  35508. }
  35509. }
  35510. if (!dom || dom.documentElement) {
  35511. return values || '';
  35512. }
  35513. domStyle = dom.style;
  35514. if (inline) {
  35515. style = domStyle;
  35516. } else {
  35517. style = dom.currentStyle;
  35518. // fallback to inline style if rendering context not available
  35519. if (!style) {
  35520. isInline = true;
  35521. style = domStyle;
  35522. }
  35523. }
  35524. do {
  35525. hook = styleHooks[prop];
  35526. if (!hook) {
  35527. styleHooks[prop] = hook = {
  35528. name: Element.normalize(prop)
  35529. };
  35530. }
  35531. if (hook.get) {
  35532. out = hook.get(dom, me, isInline, style);
  35533. } else {
  35534. camel = hook.name;
  35535. out = style[camel];
  35536. }
  35537. if (!multiple) {
  35538. return out;
  35539. }
  35540. values[prop] = out;
  35541. prop = props[++i];
  35542. } while (i < len);
  35543. return values;
  35544. };
  35545. }
  35546. // override getStyle for border-*-width
  35547. if (Ext.isIE8) {
  35548. getBorderWidth = function(dom, el, inline, style) {
  35549. if (style[this.styleName] === 'none') {
  35550. return '0px';
  35551. }
  35552. return style[this.name];
  35553. };
  35554. edges = [
  35555. 'Top',
  35556. 'Right',
  35557. 'Bottom',
  35558. 'Left'
  35559. ];
  35560. k = edges.length;
  35561. while (k--) {
  35562. edge = edges[k];
  35563. borderWidth = 'border' + edge + 'Width';
  35564. styleHooks['border-' + edge.toLowerCase() + '-width'] = styleHooks[borderWidth] = {
  35565. name: borderWidth,
  35566. styleName: 'border' + edge + 'Style',
  35567. get: getBorderWidth
  35568. };
  35569. }
  35570. // IE8 has an odd bug with handling font icons in pseudo elements;
  35571. // it will render the icon once and not update it when something
  35572. // like text color is changed via style addition or removal.
  35573. // We have to force icon repaint by adding a style with forced empty
  35574. // pseudo element content, (x-sync-repaint) and removing it back to work
  35575. // around this issue.
  35576. // See this: https://github.com/FortAwesome/Font-Awesome/issues/954
  35577. // and this: https://github.com/twbs/bootstrap/issues/13863
  35578. var syncRepaintCls = Ext.baseCSSPrefix + 'sync-repaint';
  35579. proto.syncRepaint = function() {
  35580. this.addCls(syncRepaintCls);
  35581. // Measuring element width will make the browser to repaint it
  35582. this.getWidth();
  35583. // Removing empty content makes the icon to appear again and be redrawn
  35584. this.removeCls(syncRepaintCls);
  35585. };
  35586. }
  35587. if (Ext.isIE10m) {
  35588. Ext.override(Element, {
  35589. focus: function(defer, dom) {
  35590. var me = this,
  35591. ex;
  35592. dom = dom || me.dom;
  35593. if (me.deferredFocusTimer) {
  35594. Ext.undefer(me.deferredFocusTimer);
  35595. }
  35596. me.deferredFocusTimer = null;
  35597. if (Number(defer)) {
  35598. me.deferredFocusTimer = Ext.defer(me.focus, defer, me, [
  35599. null,
  35600. dom
  35601. ]);
  35602. } else {
  35603. Ext.GlobalEvents.fireEvent('beforefocus', dom);
  35604. // IE10m has an acute problem with focusing input elements;
  35605. // when the element was just shown and did not have enough
  35606. // time to initialize, focusing it might fail. The problem
  35607. // is somewhat random in nature; most of the time focusing
  35608. // an input element will succeed, failing only occasionally.
  35609. // When it fails, the focus will be thrown to the document
  35610. // body element, with subsequent focusout/focusin event pair
  35611. // on the body, which throws off our focusenter/focusleave
  35612. // processing.
  35613. // Fortunately for us, when this focus failure happens, the
  35614. // resulting focusout event will happen *synchronously*
  35615. // unlike the normal focusing events which IE will fire
  35616. // asynchronously. Also fortunately for us, in most cases
  35617. // trying to focus the given element the second time
  35618. // immediately after it failed to focus the first time
  35619. // seems to do the trick; however when second focus attempt
  35620. // succeeds, it will result in focusout on the body and
  35621. // focusin on the given element, which again wreaks havoc
  35622. // on our focusenter/focusleave handling.
  35623. // The only workable solution we have is to pretend that
  35624. // focus never went to the document body and ignore the
  35625. // focusout and focusin caused by failed first focus attempt.
  35626. // To this end, we fudge the event stream in Focus publisher
  35627. // override.
  35628. if (dom && (dom.tagName === 'INPUT' || dom.tagname === 'TEXTAREA')) {
  35629. Ext.synchronouslyFocusing = document.activeElement;
  35630. }
  35631. // Also note that trying to focus an unfocusable element
  35632. // might throw an exception in IE8. What a cute idea, MS. :(
  35633. try {
  35634. dom.focus();
  35635. } catch (xcpt) {
  35636. ex = xcpt;
  35637. }
  35638. // Ok so now we have this situation when we tried to focus
  35639. // the first time but did not succeed. Let's try again but
  35640. // not if there was an exception the first time - when the
  35641. // "focus failure" happens it does so silently. :(
  35642. if (Ext.synchronouslyFocusing && document.activeElement !== dom && !ex) {
  35643. dom.focus();
  35644. }
  35645. Ext.synchronouslyFocusing = null;
  35646. }
  35647. return me;
  35648. }
  35649. });
  35650. }
  35651. Ext.apply(Ext, {
  35652. /**
  35653. * `true` to automatically uncache orphaned Ext.Elements periodically. If set to
  35654. * `false`, the application will be required to clean up orphaned Ext.Elements and
  35655. * it's listeners as to not cause memory leakage.
  35656. * @member Ext
  35657. */
  35658. enableGarbageCollector: true,
  35659. // In sencha v5 isBorderBox is no longer needed since all supported browsers
  35660. // support border-box, but it is hard coded to true for backward compatibility
  35661. isBorderBox: true,
  35662. /**
  35663. * @property {Boolean} useShims
  35664. * @member Ext
  35665. * Set to `true` to use a {@link Ext.util.Floating#shim shim} on all floating Components
  35666. * and {@link Ext.LoadMask LoadMasks}
  35667. */
  35668. useShims: false,
  35669. getElementById: function(id) {
  35670. var el = DOC.getElementById(id),
  35671. detachedBodyEl;
  35672. if (!el && (detachedBodyEl = Ext.detachedBodyEl)) {
  35673. el = detachedBodyEl.dom.querySelector(Ext.makeIdSelector(id));
  35674. }
  35675. return el;
  35676. },
  35677. /**
  35678. * Applies event listeners to elements by selectors when the document is ready.
  35679. * The event name is specified with an `@` suffix.
  35680. *
  35681. * Ext.addBehaviors({
  35682. * // add a listener for click on all anchors in element with id foo
  35683. * '#foo a@click': function(e, t){
  35684. * // do something
  35685. * },
  35686. *
  35687. * // add the same listener to multiple selectors (separated by comma BEFORE the @)
  35688. * '#foo a, #bar span.some-class@mouseover': function(){
  35689. * // do something
  35690. * }
  35691. * });
  35692. *
  35693. * @param {Object} obj The list of behaviors to apply
  35694. * @member Ext
  35695. */
  35696. addBehaviors: function(obj) {
  35697. if (!Ext.isReady) {
  35698. Ext.onInternalReady(function() {
  35699. Ext.addBehaviors(obj);
  35700. });
  35701. } else {
  35702. var cache = {},
  35703. // simple cache for applying multiple behaviors to same selector does query multiple times
  35704. parts, b, s;
  35705. for (b in obj) {
  35706. if ((parts = b.split('@'))[1]) {
  35707. // for Object prototype breakers
  35708. s = parts[0];
  35709. if (!cache[s]) {
  35710. cache[s] = Ext.fly(document).select(s, true);
  35711. }
  35712. cache[s].on(parts[1], obj[b]);
  35713. }
  35714. }
  35715. cache = null;
  35716. }
  35717. }
  35718. });
  35719. if (Ext.isIE9m) {
  35720. Ext.getElementById = function(id) {
  35721. var el = DOC.getElementById(id),
  35722. detachedBodyEl;
  35723. if (!el && (detachedBodyEl = Ext.detachedBodyEl)) {
  35724. el = detachedBodyEl.dom.all[id];
  35725. }
  35726. return el;
  35727. };
  35728. proto.getById = function(id, asDom) {
  35729. var dom = this.dom,
  35730. ret = null,
  35731. entry, el;
  35732. if (dom) {
  35733. // for normal elements getElementById is the best solution, but if the el is
  35734. // not part of the document.body, we need to use all[]
  35735. el = (useDocForId && DOC.getElementById(id)) || dom.all[id];
  35736. if (el) {
  35737. if (asDom) {
  35738. ret = el;
  35739. } else {
  35740. // calling Element.get here is a real hit (2x slower) because it has to
  35741. // redetermine that we are giving it a dom el.
  35742. entry = Ext.cache[id];
  35743. if (entry) {
  35744. if (entry.skipGarbageCollection || !Ext.isGarbage(entry.dom)) {
  35745. ret = entry;
  35746. } else {
  35747. Ext.raise("Stale Element with id '" + el.id + "' found in Element cache. " + "Make sure to clean up Element instances using destroy()");
  35748. entry.destroy();
  35749. }
  35750. }
  35751. ret = ret || new Ext.Element(el);
  35752. }
  35753. }
  35754. }
  35755. return ret;
  35756. };
  35757. } else if (!DOC.querySelector) {
  35758. Ext.getDetachedBody = Ext.getBody;
  35759. Ext.getElementById = function(id) {
  35760. return DOC.getElementById(id);
  35761. };
  35762. proto.getById = function(id, asDom) {
  35763. var dom = DOC.getElementById(id);
  35764. return asDom ? dom : (dom ? Ext.get(dom) : null);
  35765. };
  35766. }
  35767. if (Ext.isIE && !(Ext.isIE9p && DOC.documentMode >= 9)) {
  35768. // Essentially all web browsers (Firefox, Internet Explorer, recent versions of Opera, Safari, Konqueror, and iCab,
  35769. // as a non-exhaustive list) return null when the specified attribute does not exist on the specified element.
  35770. // The DOM specification says that the correct return value in this case is actually the empty string, and some
  35771. // DOM implementations implement this behavior. The implementation of getAttribute in XUL (Gecko) actually follows
  35772. // the specification and returns an empty string. Consequently, you should use hasAttribute to check for an attribute's
  35773. // existence prior to calling getAttribute() if it is possible that the requested attribute does not exist on the specified element.
  35774. //
  35775. // https://developer.mozilla.org/en-US/docs/DOM/element.getAttribute
  35776. // http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614
  35777. proto.getAttribute = function(name, ns) {
  35778. var d = this.dom,
  35779. type;
  35780. if (ns) {
  35781. type = typeof d[ns + ":" + name];
  35782. if (type !== 'undefined' && type !== 'unknown') {
  35783. return d[ns + ":" + name] || null;
  35784. }
  35785. return null;
  35786. }
  35787. if (name === "for") {
  35788. name = "htmlFor";
  35789. }
  35790. return d[name] || null;
  35791. };
  35792. }
  35793. Ext.onInternalReady(function() {
  35794. var transparentRe = /^(?:transparent|(?:rgba[(](?:\s*\d+\s*[,]){3}\s*0\s*[)]))$/i,
  35795. origSetWidth = proto.setWidth,
  35796. origSetHeight = proto.setHeight,
  35797. origSetSize = proto.setSize,
  35798. origUnselectable = proto.unselectable,
  35799. pxRe = /^\d+(?:\.\d*)?px$/i,
  35800. colorStyles, i, name, camel;
  35801. if (supports.FixedTableWidthBug) {
  35802. // EXTJSIV-12665
  35803. // https://bugs.webkit.org/show_bug.cgi?id=130239
  35804. // Webkit browsers fail to layout correctly when a form field's width is less
  35805. // than the min-width of the body element. The only way to fix it seems to be
  35806. // to toggle the display style of the field's element before and after setting
  35807. // the width. Note: once the bug has been corrected by toggling the element's
  35808. // display, successive calls to setWidth will work without the hack. It's only
  35809. // when going from naturally widthed to having an explicit width that the bug
  35810. // occurs.
  35811. styleHooks.width = {
  35812. name: 'width',
  35813. set: function(dom, value, el) {
  35814. var style = dom.style,
  35815. needsFix = el._needsTableWidthFix,
  35816. origDisplay = style.display;
  35817. if (needsFix) {
  35818. style.display = 'none';
  35819. }
  35820. style.width = value;
  35821. if (needsFix) {
  35822. // repaint
  35823. dom.scrollWidth;
  35824. // jshint ignore:line
  35825. style.display = origDisplay;
  35826. }
  35827. }
  35828. };
  35829. proto.setWidth = function(width, animate) {
  35830. var me = this,
  35831. dom = me.dom,
  35832. style = dom.style,
  35833. needsFix = me._needsTableWidthFix,
  35834. origDisplay = style.display;
  35835. if (needsFix && !animate) {
  35836. style.display = 'none';
  35837. }
  35838. origSetWidth.call(me, width, animate);
  35839. if (needsFix && !animate) {
  35840. // repaint
  35841. dom.scrollWidth;
  35842. // jshint ignore:line
  35843. style.display = origDisplay;
  35844. }
  35845. return me;
  35846. };
  35847. proto.setSize = function(width, height, animate) {
  35848. var me = this,
  35849. dom = me.dom,
  35850. style = dom.style,
  35851. needsFix = me._needsTableWidthFix,
  35852. origDisplay = style.display;
  35853. if (needsFix && !animate) {
  35854. style.display = 'none';
  35855. }
  35856. origSetSize.call(me, width, height, animate);
  35857. if (needsFix && !animate) {
  35858. // repaint
  35859. dom.scrollWidth;
  35860. // jshint ignore:line
  35861. style.display = origDisplay;
  35862. }
  35863. return me;
  35864. };
  35865. }
  35866. if (Ext.isIE8) {
  35867. styleHooks.height = {
  35868. name: 'height',
  35869. set: function(dom, value, el) {
  35870. var component = el.component,
  35871. frameInfo, frameBodyStyle;
  35872. if (component && component._syncFrameHeight && el === component.el) {
  35873. frameBodyStyle = component.frameBody.dom.style;
  35874. if (pxRe.test(value)) {
  35875. frameInfo = component.getFrameInfo();
  35876. if (frameInfo) {
  35877. frameBodyStyle.height = (parseInt(value, 10) - frameInfo.height) + 'px';
  35878. }
  35879. } else if (!value || value === 'auto') {
  35880. frameBodyStyle.height = '';
  35881. }
  35882. }
  35883. dom.style.height = value;
  35884. }
  35885. };
  35886. proto.setHeight = function(height, animate) {
  35887. var component = this.component,
  35888. frameInfo, frameBodyStyle;
  35889. if (component && component._syncFrameHeight && this === component.el) {
  35890. frameBodyStyle = component.frameBody.dom.style;
  35891. if (!height || height === 'auto') {
  35892. frameBodyStyle.height = '';
  35893. } else {
  35894. frameInfo = component.getFrameInfo();
  35895. if (frameInfo) {
  35896. frameBodyStyle.height = (height - frameInfo.height) + 'px';
  35897. }
  35898. }
  35899. }
  35900. return origSetHeight.call(this, height, animate);
  35901. };
  35902. proto.setSize = function(width, height, animate) {
  35903. var component = this.component,
  35904. frameInfo, frameBodyStyle;
  35905. if (component && component._syncFrameHeight && this === component.el) {
  35906. frameBodyStyle = component.frameBody.dom.style;
  35907. if (!height || height === 'auto') {
  35908. frameBodyStyle.height = '';
  35909. } else {
  35910. frameInfo = component.getFrameInfo();
  35911. if (frameInfo) {
  35912. frameBodyStyle.height = (height - frameInfo.height) + 'px';
  35913. }
  35914. }
  35915. }
  35916. return origSetSize.call(this, width, height, animate);
  35917. };
  35918. // Override for IE8 which throws an error setting innerHTML when inside
  35919. // an event handler invoked from that element.
  35920. proto.setText = function(text) {
  35921. var dom = this.dom;
  35922. // Remove all child nodes, leave only a single textNode
  35923. if (!(dom.childNodes.length === 1 && dom.firstChild.nodeType === 3)) {
  35924. while (dom.lastChild && dom.lastChild.nodeType !== 3) {
  35925. dom.removeChild(dom.lastChild);
  35926. }
  35927. dom.appendChild(document.createTextNode());
  35928. }
  35929. // Set the data of the textNode
  35930. dom.firstChild.data = text;
  35931. };
  35932. proto.unselectable = function() {
  35933. origUnselectable.call(this);
  35934. this.dom.onselectstart = function() {
  35935. return false;
  35936. };
  35937. };
  35938. }
  35939. function fixTransparent(dom, el, inline, style) {
  35940. var value = style[this.name] || '';
  35941. return transparentRe.test(value) ? 'transparent' : value;
  35942. }
  35943. /*
  35944. * Helper function to create the function that will restore the selection.
  35945. */
  35946. function makeSelectionRestoreFn(activeEl, start, end) {
  35947. return function() {
  35948. activeEl.selectionStart = start;
  35949. activeEl.selectionEnd = end;
  35950. };
  35951. }
  35952. /*
  35953. * Creates a function to call to clean up problems with the work-around for the
  35954. * WebKit RightMargin bug. The work-around is to add "display: 'inline-block'" to
  35955. * the element before calling getComputedStyle and then to restore its original
  35956. * display value. The problem with this is that it corrupts the selection of an
  35957. * INPUT or TEXTAREA element (as in the "I-beam" goes away but the focus remains).
  35958. * To cleanup after this, we need to capture the selection of any such element and
  35959. * then restore it after we have restored the display style.
  35960. *
  35961. * @param {HTMLElement} target The top-most element being adjusted.
  35962. * @private
  35963. */
  35964. function getRightMarginFixCleaner(target) {
  35965. var hasInputBug = supports.DisplayChangeInputSelectionBug,
  35966. hasTextAreaBug = supports.DisplayChangeTextAreaSelectionBug,
  35967. activeEl, tag, start, end;
  35968. if (hasInputBug || hasTextAreaBug) {
  35969. activeEl = Element.getActiveElement();
  35970. tag = activeEl && activeEl.tagName;
  35971. if ((hasTextAreaBug && tag === 'TEXTAREA') || (hasInputBug && tag === 'INPUT' && activeEl.type === 'text')) {
  35972. if (Ext.fly(target).isAncestor(activeEl)) {
  35973. start = activeEl.selectionStart;
  35974. end = activeEl.selectionEnd;
  35975. if (Ext.isNumber(start) && Ext.isNumber(end)) {
  35976. // to be safe...
  35977. // We don't create the raw closure here inline because that
  35978. // will be costly even if we don't want to return it (nested
  35979. // function decls and exprs are often instantiated on entry
  35980. // regardless of whether execution ever reaches them):
  35981. return makeSelectionRestoreFn(activeEl, start, end);
  35982. }
  35983. }
  35984. }
  35985. }
  35986. return Ext.emptyFn;
  35987. }
  35988. // avoid special cases, just return a nop
  35989. function fixRightMargin(dom, el, inline, style) {
  35990. var result = style.marginRight,
  35991. domStyle, display;
  35992. // Ignore cases when the margin is correctly reported as 0, the bug only shows
  35993. // numbers larger.
  35994. if (result !== '0px') {
  35995. domStyle = dom.style;
  35996. display = domStyle.display;
  35997. domStyle.display = 'inline-block';
  35998. result = (inline ? style : dom.ownerDocument.defaultView.getComputedStyle(dom, null)).marginRight;
  35999. domStyle.display = display;
  36000. }
  36001. return result;
  36002. }
  36003. function fixRightMarginAndInputFocus(dom, el, inline, style) {
  36004. var result = style.marginRight,
  36005. domStyle, cleaner, display;
  36006. if (result !== '0px') {
  36007. domStyle = dom.style;
  36008. cleaner = getRightMarginFixCleaner(dom);
  36009. display = domStyle.display;
  36010. domStyle.display = 'inline-block';
  36011. result = (inline ? style : dom.ownerDocument.defaultView.getComputedStyle(dom, '')).marginRight;
  36012. domStyle.display = display;
  36013. cleaner();
  36014. }
  36015. return result;
  36016. }
  36017. //TODO - this was fixed in Safari 3 - verify if this is still an issue
  36018. // Fix bug caused by this: https://bugs.webkit.org/show_bug.cgi?id=13343
  36019. if (!supports.RightMargin) {
  36020. styleHooks.marginRight = styleHooks['margin-right'] = {
  36021. name: 'marginRight',
  36022. // TODO - Touch should use conditional compilation here or ensure that the
  36023. // underlying Ext.supports flags are set correctly...
  36024. get: (supports.DisplayChangeInputSelectionBug || supports.DisplayChangeTextAreaSelectionBug) ? fixRightMarginAndInputFocus : fixRightMargin
  36025. };
  36026. }
  36027. if (!supports.TransparentColor) {
  36028. colorStyles = [
  36029. 'background-color',
  36030. 'border-color',
  36031. 'color',
  36032. 'outline-color'
  36033. ];
  36034. for (i = colorStyles.length; i--; ) {
  36035. name = colorStyles[i];
  36036. camel = Element.normalize(name);
  36037. styleHooks[name] = styleHooks[camel] = {
  36038. name: camel,
  36039. get: fixTransparent
  36040. };
  36041. }
  36042. }
  36043. // When elements are rotated 80 or 270 degrees, their border, margin and padding hooks
  36044. // need to be rotated as well.
  36045. proto.verticalStyleHooks90 = verticalStyleHooks90 = Ext.Object.chain(styleHooks);
  36046. proto.verticalStyleHooks270 = verticalStyleHooks270 = Ext.Object.chain(styleHooks);
  36047. verticalStyleHooks90.width = styleHooks.height || {
  36048. name: 'height'
  36049. };
  36050. verticalStyleHooks90.height = styleHooks.width || {
  36051. name: 'width'
  36052. };
  36053. verticalStyleHooks90['margin-top'] = {
  36054. name: 'marginLeft'
  36055. };
  36056. verticalStyleHooks90['margin-right'] = {
  36057. name: 'marginTop'
  36058. };
  36059. verticalStyleHooks90['margin-bottom'] = {
  36060. name: 'marginRight'
  36061. };
  36062. verticalStyleHooks90['margin-left'] = {
  36063. name: 'marginBottom'
  36064. };
  36065. verticalStyleHooks90['padding-top'] = {
  36066. name: 'paddingLeft'
  36067. };
  36068. verticalStyleHooks90['padding-right'] = {
  36069. name: 'paddingTop'
  36070. };
  36071. verticalStyleHooks90['padding-bottom'] = {
  36072. name: 'paddingRight'
  36073. };
  36074. verticalStyleHooks90['padding-left'] = {
  36075. name: 'paddingBottom'
  36076. };
  36077. verticalStyleHooks90['border-top'] = {
  36078. name: 'borderLeft'
  36079. };
  36080. verticalStyleHooks90['border-right'] = {
  36081. name: 'borderTop'
  36082. };
  36083. verticalStyleHooks90['border-bottom'] = {
  36084. name: 'borderRight'
  36085. };
  36086. verticalStyleHooks90['border-left'] = {
  36087. name: 'borderBottom'
  36088. };
  36089. verticalStyleHooks270.width = styleHooks.height || {
  36090. name: 'height'
  36091. };
  36092. verticalStyleHooks270.height = styleHooks.width || {
  36093. name: 'width'
  36094. };
  36095. verticalStyleHooks270['margin-top'] = {
  36096. name: 'marginRight'
  36097. };
  36098. verticalStyleHooks270['margin-right'] = {
  36099. name: 'marginBottom'
  36100. };
  36101. verticalStyleHooks270['margin-bottom'] = {
  36102. name: 'marginLeft'
  36103. };
  36104. verticalStyleHooks270['margin-left'] = {
  36105. name: 'marginTop'
  36106. };
  36107. verticalStyleHooks270['padding-top'] = {
  36108. name: 'paddingRight'
  36109. };
  36110. verticalStyleHooks270['padding-right'] = {
  36111. name: 'paddingBottom'
  36112. };
  36113. verticalStyleHooks270['padding-bottom'] = {
  36114. name: 'paddingLeft'
  36115. };
  36116. verticalStyleHooks270['padding-left'] = {
  36117. name: 'paddingTop'
  36118. };
  36119. verticalStyleHooks270['border-top'] = {
  36120. name: 'borderRight'
  36121. };
  36122. verticalStyleHooks270['border-right'] = {
  36123. name: 'borderBottom'
  36124. };
  36125. verticalStyleHooks270['border-bottom'] = {
  36126. name: 'borderLeft'
  36127. };
  36128. verticalStyleHooks270['border-left'] = {
  36129. name: 'borderTop'
  36130. };
  36131. /**
  36132. * @property {Boolean} scopeCss
  36133. * @member Ext
  36134. * Set this to true before onReady to prevent any styling from being added to
  36135. * the body element. By default a few styles such as font-family, and color
  36136. * are added to the body element via a "x-body" class. When this is set to
  36137. * `true` the "x-body" class is not added to the body element, but is added
  36138. * to the elements of root-level containers instead.
  36139. */
  36140. if (!Ext.scopeCss) {
  36141. Ext.getBody().addCls(Ext.baseCSSPrefix + 'body');
  36142. }
  36143. }, null, {
  36144. priority: 1500
  36145. });
  36146. });
  36147. // onReady
  36148. // @tag core
  36149. /**
  36150. * @class Ext.GlobalEvents
  36151. */
  36152. Ext.define('Ext.overrides.GlobalEvents', {
  36153. override: 'Ext.GlobalEvents',
  36154. /**
  36155. * @event resumelayouts
  36156. * Fires after global layout processing has been resumed in {@link
  36157. * Ext.Component#resumeLayouts}.
  36158. */
  36159. attachListeners: function() {
  36160. var me = this,
  36161. docElement, bufferedFn;
  36162. // In IE9- when using legacy onresize event via attachEvent or onresize property,
  36163. // the event may fire for *content size changes* as well as actual document view
  36164. // size changes. See this: https://msdn.microsoft.com/en-us/library/ms536959(v=vs.85).aspx
  36165. // and this: http://stackoverflow.com/questions/1852751/window-resize-event-firing-in-internet-explorer
  36166. // The amount of these events firing all at once can be entirely staggering, and they
  36167. // often happen during layouts so we have to be über careful to execute as few JavaScript
  36168. // statements as possible to improve overall framework performance.
  36169. if (Ext.isIE8) {
  36170. docElement = Ext.getDoc().dom.documentElement;
  36171. bufferedFn = Ext.Function.createBuffered(me.fireResize, me.resizeBuffer, me);
  36172. Ext.getWin().dom.attachEvent('onresize', function() {
  36173. if (docElement.clientWidth !== Ext.GlobalEvents.curWidth || docElement.clientHeight !== Ext.GlobalEvents.curHeight) {
  36174. bufferedFn();
  36175. }
  36176. });
  36177. }
  36178. me.callParent();
  36179. },
  36180. deprecated: {
  36181. 5: {
  36182. methods: {
  36183. addListener: function(ename, fn, scope, options, order, caller, eventOptions) {
  36184. var name, readyFn;
  36185. // The "ready" event was removed from Ext.globalEvents in 5.0 in favor of
  36186. // Ext.onReady(). This function adds compatibility for the ready event
  36187. if (ename === 'ready') {
  36188. readyFn = fn;
  36189. } else if (typeof ename !== 'string') {
  36190. for (name in ename) {
  36191. if (name === 'ready') {
  36192. readyFn = ename[name];
  36193. }
  36194. }
  36195. }
  36196. if (readyFn) {
  36197. Ext.log.warn("Ext.on('ready', fn) is deprecated. Please use Ext.onReady(fn) instead.");
  36198. Ext.onReady(readyFn);
  36199. }
  36200. this.callParent([
  36201. ename,
  36202. fn,
  36203. scope,
  36204. options,
  36205. order,
  36206. caller,
  36207. eventOptions
  36208. ]);
  36209. }
  36210. }
  36211. }
  36212. }
  36213. });
  36214. /**
  36215. * @class Ext.plugin.Abstract
  36216. */
  36217. Ext.define('Ext.overrides.plugin.Abstract', {
  36218. override: 'Ext.plugin.Abstract',
  36219. $configStrict: false,
  36220. $configPrefixed: false,
  36221. disabled: false,
  36222. /**
  36223. * @cfg {String|Array} stateEvents
  36224. * The configured list of stateEvents used to (optionally) participate in Owner Component's state management.
  36225. * @member Ext.plugin.Abstract
  36226. */
  36227. /**
  36228. * @method
  36229. * The getState method is invoked by the client Component's State mixin when one or more of the the specified {@link #stateEvents} are raised.
  36230. *
  36231. * The supplied implementation is empty. If plugin Subclasses are to (optionally) participate in the client Component's
  36232. * state management, implementers should provide a suitable method which returns a state object.
  36233. * @return {Object} state
  36234. * @member Ext.plugin.Abstract
  36235. */
  36236. getState: null,
  36237. /**
  36238. * @method
  36239. * The applyState method is invoked by the client Component's State mixin after initComponent method has been run for the client.
  36240. *
  36241. * The supplied implementation is empty. If plugin Subclasses are to (optionally) participate in the client Component's
  36242. * state management, implementers should provide a suitable method to utilize it.
  36243. * @param {Object} state The current plugin state object to be applied.
  36244. * @param {Object} allState The current aggregate state of the Component and all plugins.
  36245. * @member Ext.plugin.Abstract
  36246. */
  36247. applyState: null,
  36248. /**
  36249. * The base implementation just sets the plugin's `disabled` flag to `false`
  36250. *
  36251. * Plugin subclasses which need more complex processing may implement an overriding implementation.
  36252. * @member Ext.plugin.Abstract
  36253. */
  36254. enable: function() {
  36255. this.disabled = false;
  36256. },
  36257. /**
  36258. * The base implementation just sets the plugin's `disabled` flag to `true`
  36259. *
  36260. * Plugin subclasses which need more complex processing may implement an overriding implementation.
  36261. * @member Ext.plugin.Abstract
  36262. */
  36263. disable: function() {
  36264. this.disabled = true;
  36265. }
  36266. });
  36267. /**
  36268. * @class Ext.Widget
  36269. */
  36270. Ext.define('Ext.overrides.Widget', {
  36271. override: 'Ext.Widget',
  36272. uses: [
  36273. 'Ext.Component',
  36274. 'Ext.layout.component.Auto'
  36275. ],
  36276. $configStrict: false,
  36277. isComponent: true,
  36278. liquidLayout: true,
  36279. // in Ext JS the rendered flag is set as soon as a component has its element. Since
  36280. // widgets always have an element when constructed, they are always considered to be
  36281. // "rendered"
  36282. rendered: true,
  36283. rendering: true,
  36284. config: {
  36285. renderTo: null
  36286. },
  36287. constructor: function(config) {
  36288. var me = this,
  36289. renderTo;
  36290. me.callParent([
  36291. config
  36292. ]);
  36293. // initialize the component layout
  36294. me.getComponentLayout();
  36295. renderTo = me.getRenderTo();
  36296. if (renderTo) {
  36297. me.render(renderTo);
  36298. }
  36299. },
  36300. addClsWithUI: function(cls) {
  36301. this.el.addCls(cls);
  36302. },
  36303. afterComponentLayout: Ext.emptyFn,
  36304. updateLayout: function() {
  36305. var owner = this.getRefOwner();
  36306. if (owner) {
  36307. owner.updateLayout();
  36308. }
  36309. },
  36310. destroy: function() {
  36311. var me = this,
  36312. ownerCt = me.ownerCt;
  36313. if (ownerCt && ownerCt.remove) {
  36314. ownerCt.remove(me, false);
  36315. }
  36316. me.callParent();
  36317. },
  36318. finishRender: function() {
  36319. this.rendering = false;
  36320. this.initBindable();
  36321. this.initKeyMap();
  36322. },
  36323. getAnimationProps: function() {
  36324. // see Ext.util.Animate mixin
  36325. return {};
  36326. },
  36327. getComponentLayout: function() {
  36328. var me = this,
  36329. layout = me.componentLayout;
  36330. if (!layout) {
  36331. layout = me.componentLayout = new Ext.layout.component.Auto();
  36332. layout.setOwner(me);
  36333. }
  36334. return layout;
  36335. },
  36336. getEl: function() {
  36337. return this.element;
  36338. },
  36339. /**
  36340. * @private
  36341. * Needed for when widget is rendered into a grid cell. The class to add to the cell element.
  36342. * @member Ext.Widget
  36343. */
  36344. getTdCls: function() {
  36345. return Ext.baseCSSPrefix + this.getTdType() + '-' + (this.ui || 'default') + '-cell';
  36346. },
  36347. /**
  36348. * @private
  36349. * Partner method to {@link #getTdCls}.
  36350. *
  36351. * Returns the base type for the component. Defaults to return `this.xtype`, but
  36352. * All derived classes of {@link Ext.form.field.Text TextField} can return the type 'textfield',
  36353. * and all derived classes of {@link Ext.button.Button Button} can return the type 'button'
  36354. * @member Ext.Widget
  36355. */
  36356. getTdType: function() {
  36357. return this.xtype;
  36358. },
  36359. getItemId: function() {
  36360. // needed by ComponentQuery
  36361. return this.itemId || this.id;
  36362. },
  36363. getSizeModel: function() {
  36364. return Ext.Component.prototype.getSizeModel.apply(this, arguments);
  36365. },
  36366. onAdded: function(container, pos, instanced) {
  36367. var me = this;
  36368. me.ownerCt = container;
  36369. me.onInheritedAdd(me, instanced);
  36370. // this component is no longer detached from the body
  36371. me.isDetached = false;
  36372. },
  36373. onRemoved: function(destroying) {
  36374. this.onInheritedRemove(destroying);
  36375. this.ownerCt = this.ownerLayout = null;
  36376. },
  36377. parseBox: function(box) {
  36378. return Ext.Element.parseBox(box);
  36379. },
  36380. removeClsWithUI: function(cls) {
  36381. this.el.removeCls(cls);
  36382. },
  36383. render: function(container, position) {
  36384. var me = this,
  36385. element = me.element,
  36386. proto = Ext.Component.prototype,
  36387. nextSibling;
  36388. if (!me.ownerCt || me.floating) {
  36389. if (Ext.scopeCss) {
  36390. element.addCls(proto.rootCls);
  36391. }
  36392. element.addCls(proto.borderBoxCls);
  36393. }
  36394. if (position) {
  36395. nextSibling = container.childNodes[position];
  36396. if (nextSibling) {
  36397. Ext.fly(container).insertBefore(element, nextSibling);
  36398. return;
  36399. }
  36400. }
  36401. Ext.fly(container).appendChild(element);
  36402. me.finishRender();
  36403. },
  36404. setPosition: function(x, y) {
  36405. this.el.setLocalXY(x, y);
  36406. },
  36407. up: function() {
  36408. return Ext.Component.prototype.up.apply(this, arguments);
  36409. },
  36410. isAncestor: function() {
  36411. return Ext.Component.prototype.isAncestor.apply(this, arguments);
  36412. },
  36413. onFocusEnter: function() {
  36414. return Ext.Component.prototype.onFocusEnter.apply(this, arguments);
  36415. },
  36416. onFocusLeave: function() {
  36417. return Ext.Component.prototype.onFocusLeave.apply(this, arguments);
  36418. },
  36419. isLayoutChild: function(candidate) {
  36420. var ownerCt = this.ownerCt;
  36421. return ownerCt ? (ownerCt === candidate || ownerCt.isLayoutChild(candidate)) : false;
  36422. },
  36423. privates: {
  36424. doAddListener: function(name, fn, scope, options, order, caller, manager) {
  36425. if (name == 'painted' || name == 'resize') {
  36426. this.element.doAddListener(name, fn, scope || this, options, order);
  36427. }
  36428. this.callParent([
  36429. name,
  36430. fn,
  36431. scope,
  36432. options,
  36433. order,
  36434. caller,
  36435. manager
  36436. ]);
  36437. },
  36438. doRemoveListener: function(name, fn, scope) {
  36439. if (name == 'painted' || name == 'resize') {
  36440. this.element.doRemoveListener(name, fn, scope);
  36441. }
  36442. this.callParent([
  36443. name,
  36444. fn,
  36445. scope
  36446. ]);
  36447. }
  36448. }
  36449. }, function(Cls) {
  36450. var prototype = Cls.prototype;
  36451. if (Ext.isIE9m) {
  36452. // Since IE8/9 don't not support Object.defineProperty correctly we can't add the reference
  36453. // nodes on demand, so we just fall back to adding all references up front.
  36454. prototype.addElementReferenceOnDemand = prototype.addElementReference;
  36455. }
  36456. });
  36457. /**
  36458. * @class Ext.Progress
  36459. *
  36460. * @example
  36461. * Ext.create({
  36462. * xtype: 'grid',
  36463. * title: 'Simpsons',
  36464. * store: {
  36465. * data: [
  36466. * { name: 'Lisa', progress: .159 },
  36467. * { name: 'Bart', progress: .216 },
  36468. * { name: 'Homer', progress: .55 },
  36469. * { name: 'Maggie', progress: .167 },
  36470. * { name: 'Marge', progress: .145 }
  36471. * ]
  36472. * },
  36473. * columns: [
  36474. * { text: 'Name', dataIndex: 'name' },
  36475. * {
  36476. * text: 'Progress',
  36477. * xtype: 'widgetcolumn',
  36478. * width: 120,
  36479. * dataIndex: 'progress',
  36480. * widget: {
  36481. * xtype: 'progress'
  36482. * }
  36483. * }
  36484. * ],
  36485. * height: 200,
  36486. * width: 400,
  36487. * renderTo: Ext.getBody()
  36488. * });
  36489. */
  36490. Ext.define('Ext.overrides.Progress', {
  36491. override: 'Ext.Progress',
  36492. config: {
  36493. ui: 'default'
  36494. },
  36495. updateWidth: function(width, oldWidth) {
  36496. var me = this;
  36497. me.callParent([
  36498. width,
  36499. oldWidth
  36500. ]);
  36501. width -= me.element.getBorderWidth('lr');
  36502. me.backgroundEl.setWidth(width);
  36503. me.textEl.setWidth(width);
  36504. },
  36505. privates: {
  36506. startBarAnimation: function(o) {
  36507. this.barEl.animate(o);
  36508. },
  36509. stopBarAnimation: function() {
  36510. this.barEl.stopAnimation();
  36511. }
  36512. }
  36513. });
  36514. /**
  36515. * @class Ext.mixin.Focusable
  36516. */
  36517. Ext.define('Ext.overrides.mixin.Focusable', {
  36518. override: 'Ext.Component',
  36519. /**
  36520. * @cfg {String} [focusCls='focus'] CSS class suffix that will be used to
  36521. * compose the CSS class name that will be added to Component's {@link #focusClsEl},
  36522. * and removed when Component blurs.
  36523. *
  36524. * **Note** that this is not a full CSS class name; this suffix will be combined
  36525. * with component's UI class via {@link #addClsWithUI} and {@link #removeClsWithUI} methods.
  36526. */
  36527. focusCls: 'focus',
  36528. /**
  36529. * Try to focus this component.
  36530. *
  36531. * If this component is disabled, a close relation will be targeted for focus instead
  36532. * to keep focus localized for keyboard users.
  36533. * @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.
  36534. * @param {Boolean/Number} [delay] Delay the focus this number of milliseconds (true for 10 milliseconds).
  36535. * @param {Function} [callback] Only needed if the `delay` parameter is used. A function to call upon focus.
  36536. * @param {Function} [scope] Only needed if the `delay` parameter is used. The scope (`this` reference) in which to execute the callback.
  36537. * @return {Ext.Component} The focused Component. Usually `this` Component. Some Containers may
  36538. * delegate focus to a descendant Component ({@link Ext.window.Window Window}s can do this through their
  36539. * {@link Ext.window.Window#defaultFocus defaultFocus} config option. If this component is disabled, a closely
  36540. * related component will be focused and that will be returned.
  36541. */
  36542. focus: function(selectText, delay, callback, scope) {
  36543. var me = this,
  36544. containerScrollTop;
  36545. if ((!me.focusable && !me.isContainer) || me.destroyed || me.destroying) {
  36546. return me;
  36547. }
  36548. // If delay is wanted, queue a call to this function.
  36549. if (delay) {
  36550. me.getFocusTask().delay(Ext.isNumber(delay) ? delay : 10, me.focus, me, [
  36551. selectText,
  36552. false,
  36553. callback,
  36554. scope
  36555. ]);
  36556. return me;
  36557. }
  36558. // An immediate focus call must cancel any outstanding delayed focus calls.
  36559. me.cancelFocus();
  36560. if (me.floating && me.container && me.container.dom) {
  36561. containerScrollTop = me.container.dom.scrollTop;
  36562. }
  36563. // Core Focusable method will return true if focusing was attempted
  36564. if (me.mixins.focusable.focus.apply(me, arguments) !== false) {
  36565. if (callback) {
  36566. Ext.callback(callback, scope);
  36567. }
  36568. // Focusing a floating Component brings it to the front of its stack.
  36569. // this is performed by its zIndexManager. Pass preventFocus true to avoid recursion.
  36570. if (me.floating && containerScrollTop !== undefined) {
  36571. me.container.dom.scrollTop = containerScrollTop;
  36572. }
  36573. }
  36574. return me;
  36575. },
  36576. /**
  36577. * Cancel any deferred focus on this component
  36578. * @protected
  36579. */
  36580. cancelFocus: function() {
  36581. var me = this,
  36582. task = me.getFocusTask();
  36583. if (task) {
  36584. task.cancel();
  36585. }
  36586. },
  36587. /**
  36588. * @method
  36589. * Template method to do any pre-blur processing.
  36590. * @protected
  36591. * @param {Ext.event.Event} e The event object
  36592. */
  36593. beforeBlur: Ext.emptyFn,
  36594. /**
  36595. * @method
  36596. * Template method to do any post-blur processing.
  36597. * @protected
  36598. * @param {Ext.event.Event} e The event object
  36599. */
  36600. postBlur: Ext.emptyFn,
  36601. /**
  36602. * @method
  36603. * Template method to do any pre-focus processing.
  36604. * @protected
  36605. * @param {Ext.event.Event} e The event object
  36606. */
  36607. beforeFocus: Ext.emptyFn,
  36608. /**
  36609. * @method
  36610. * Template method to do any post-focus processing.
  36611. * @protected
  36612. * @param {Ext.event.Event} e The event object
  36613. */
  36614. postFocus: Ext.emptyFn,
  36615. onFocusEnter: function(e) {
  36616. var me = this;
  36617. if (me.destroying || me.destroyed) {
  36618. return;
  36619. }
  36620. // Focusing must being a floating component to the front.
  36621. // Only bring to front if this component is not the manager's
  36622. // topmost component (may be a result of focusOnToFront).
  36623. if (me.floating && me !== me.zIndexManager.getActive()) {
  36624. me.toFront(true);
  36625. }
  36626. me.callParent([
  36627. e
  36628. ]);
  36629. },
  36630. destroyFocusable: function() {
  36631. var me = this;
  36632. // Calling cancelFocus() will assign focusTask property,
  36633. // which we don't want during destruction
  36634. if (me.focusTask) {
  36635. me.focusTask.stop(me.focus, me);
  36636. }
  36637. me.callParent();
  36638. },
  36639. privates: {
  36640. addFocusCls: function(e) {
  36641. var me = this,
  36642. focusCls = me.focusCls,
  36643. el;
  36644. if (focusCls) {
  36645. el = me.getFocusClsEl(e);
  36646. if (el) {
  36647. el.addCls(me.addClsWithUI(focusCls, true));
  36648. }
  36649. }
  36650. },
  36651. removeFocusCls: function(e) {
  36652. var me = this,
  36653. focusCls = me.focusCls,
  36654. el;
  36655. if (focusCls) {
  36656. el = me.getFocusClsEl(e);
  36657. if (el) {
  36658. el.removeCls(me.removeClsWithUI(focusCls, true));
  36659. }
  36660. }
  36661. },
  36662. /**
  36663. * @private
  36664. */
  36665. getFocusTask: function() {
  36666. if (!this.focusTask) {
  36667. this.focusTask = Ext.focusTask;
  36668. }
  36669. return this.focusTask;
  36670. },
  36671. updateMaskState: function(state, mask) {
  36672. var me = this,
  36673. ariaEl = me.ariaEl.dom,
  36674. value;
  36675. if (state) {
  36676. me.disableTabbing();
  36677. me.setMasked(true);
  36678. if (ariaEl) {
  36679. ariaEl.setAttribute('aria-busy', 'true');
  36680. // It is possible that ariaEl already has aria-describedby attribute;
  36681. // in that case we need to save it to restore later.
  36682. value = ariaEl.getAttribute('aria-describedby');
  36683. if (value) {
  36684. me._savedAriaDescribedBy = value;
  36685. }
  36686. ariaEl.setAttribute('aria-describedby', mask.ariaEl.id);
  36687. }
  36688. } else {
  36689. me.enableTabbing();
  36690. me.setMasked(false);
  36691. if (ariaEl) {
  36692. ariaEl.removeAttribute('aria-busy');
  36693. value = ariaEl.getAttribute('aria-describedby');
  36694. ariaEl.removeAttribute('aria-describedby');
  36695. if (value === mask.ariaEl.id && me._savedAriaDescribedBy) {
  36696. ariaEl.setAttribute('aria-describedby', me._savedAriaDescribedBy);
  36697. delete me._savedAriaDescribedBy;
  36698. }
  36699. }
  36700. }
  36701. }
  36702. }
  36703. }, function() {
  36704. // One global DelayedTask to assign focus
  36705. // So that the last focus call wins.
  36706. if (!Ext.focusTask) {
  36707. Ext.focusTask = new Ext.util.DelayedTask();
  36708. }
  36709. });
  36710. Ext.define('Ext.overrides.app.domain.Component', {
  36711. override: 'Ext.app.domain.Component',
  36712. requires: [
  36713. 'Ext.Component'
  36714. ]
  36715. }, function(ComponentDomain) {
  36716. // The core Component domain monitors events on the Ext.Widget class
  36717. // in Ext Components are not widgets so we need to monitor Ext.Component as well.
  36718. ComponentDomain.monitor(Ext.Component);
  36719. });
  36720. // This is an override because it must be loaded very early, possibly before Ext.app.Application
  36721. // in dev mode so that Ext.application() can be called.
  36722. // Being an override also ensures that it is only included in a built app if Ext.app.Application
  36723. // is present.
  36724. //
  36725. // @override Ext.app.Application
  36726. /**
  36727. * @method application
  36728. * @member Ext
  36729. * Loads Ext.app.Application class and starts it up with given configuration after the
  36730. * page is ready.
  36731. *
  36732. * See `Ext.app.Application` for details.
  36733. *
  36734. * @param {Object/String} config Application config object or name of a class derived
  36735. * from Ext.app.Application.
  36736. */
  36737. Ext.application = function(config) {
  36738. var createApp = function(App) {
  36739. // This won't be called until App class has been created.
  36740. Ext.onReady(function() {
  36741. var Viewport = Ext.viewport;
  36742. Viewport = Viewport && Viewport['Viewport'];
  36743. if (Viewport && Viewport.setup) {
  36744. Viewport.setup(App.prototype.config.viewport);
  36745. }
  36746. Ext.app.Application.instance = new App();
  36747. });
  36748. };
  36749. if (typeof config === "string") {
  36750. Ext.require(config, function() {
  36751. createApp(Ext.ClassManager.get(config));
  36752. });
  36753. } else {
  36754. config = Ext.apply({
  36755. extend: 'Ext.app.Application'
  36756. }, // can be replaced by config!
  36757. config);
  36758. // We have to process "paths" before creating Application class,
  36759. // or `requires` won't work.
  36760. Ext.app.setupPaths(config.name, config.appFolder, config.paths);
  36761. config['paths processed'] = true;
  36762. // Let Ext.define do the hard work but don't assign a class name.
  36763. Ext.define(config.name + ".$application", config, function() {
  36764. createApp(this);
  36765. });
  36766. }
  36767. };
  36768. /**
  36769. * @class Ext.app.Application
  36770. */
  36771. Ext.define('Ext.overrides.app.Application', {
  36772. override: 'Ext.app.Application',
  36773. uses: [
  36774. 'Ext.tip.QuickTipManager'
  36775. ],
  36776. // @cmd-auto-dependency {aliasPrefix: "view.", mvc: true, requires: ["Ext.plugin.Viewport"]}
  36777. /**
  36778. * @cfg {Boolean/String} [autoCreateViewport=false]
  36779. * @deprecated 5.1 Instead use {@link #mainView}
  36780. * @member Ext.app.Application
  36781. */
  36782. autoCreateViewport: false,
  36783. config: {
  36784. /**
  36785. * @cfg {Boolean} enableQuickTips
  36786. * @deprecated 6.2.0 Use {@link #quickTips}.
  36787. */
  36788. enableQuickTips: null
  36789. },
  36790. /**
  36791. * @cfg {Boolean} quickTips
  36792. * True to automatically set up Ext.tip.QuickTip support.
  36793. *
  36794. * @since 6.2.0
  36795. */
  36796. quickTips: true,
  36797. updateEnableQuickTips: function(enableQuickTips) {
  36798. this.setQuickTips(enableQuickTips);
  36799. },
  36800. applyMainView: function(mainView) {
  36801. var view, proto, config, protoPlugins, configPlugins;
  36802. if (typeof mainView === 'string') {
  36803. view = this.getView(mainView);
  36804. config = {};
  36805. } else {
  36806. config = mainView;
  36807. view = Ext.ClassManager.getByConfig(mainView);
  36808. }
  36809. proto = view.prototype;
  36810. if (!proto.isViewport) {
  36811. // Need to copy over any plugins defined on the prototype and on the config.
  36812. protoPlugins = Ext.Array.from(proto.plugins);
  36813. configPlugins = Ext.Array.from(config.plugins);
  36814. config = Ext.apply({}, config);
  36815. config.plugins = [
  36816. 'viewport'
  36817. ].concat(protoPlugins, configPlugins);
  36818. }
  36819. return view.create(config);
  36820. },
  36821. getDependencies: function(cls, data, requires) {
  36822. var Controller = Ext.app.Controller,
  36823. proto = cls.prototype,
  36824. namespace = data.$namespace,
  36825. viewportClass = data.autoCreateViewport;
  36826. if (viewportClass) {
  36827. if (!namespace) {
  36828. Ext.raise("[Ext.app.Application] Can't resolve namespace for " + data.$className + ", did you forget to specify 'name' property?");
  36829. }
  36830. if (viewportClass === true) {
  36831. viewportClass = 'Viewport';
  36832. } else {
  36833. requires.push('Ext.plugin.Viewport');
  36834. }
  36835. Controller.processDependencies(proto, requires, namespace, 'view', viewportClass);
  36836. }
  36837. },
  36838. onBeforeLaunch: function() {
  36839. var me = this,
  36840. autoCreateViewport = me.autoCreateViewport;
  36841. if (me.getQuickTips()) {
  36842. me.initQuickTips();
  36843. }
  36844. if (autoCreateViewport) {
  36845. me.initViewport();
  36846. }
  36847. this.callParent(arguments);
  36848. },
  36849. getViewportName: function() {
  36850. var name = null,
  36851. autoCreate = this.autoCreateViewport;
  36852. if (autoCreate) {
  36853. name = (autoCreate === true) ? 'Viewport' : autoCreate;
  36854. }
  36855. return name;
  36856. },
  36857. initViewport: function() {
  36858. this.setMainView(this.getViewportName());
  36859. },
  36860. initQuickTips: function() {
  36861. Ext.tip.QuickTipManager.init();
  36862. }
  36863. });
  36864. Ext.define('Ext.overrides.app.domain.View', {
  36865. override: 'Ext.app.domain.View',
  36866. requires: [
  36867. 'Ext.Component'
  36868. ],
  36869. constructor: function(controller) {
  36870. this.callParent([
  36871. controller
  36872. ]);
  36873. // The base class handles Ext.Widget, which encompasses
  36874. // component for modern, so we only need the override here.
  36875. this.monitoredClasses.push(Ext.Component);
  36876. }
  36877. });
  36878. /**
  36879. * @class Ext.dom.Helper
  36880. */
  36881. Ext.define('Ext.overrides.dom.Helper', (function() {
  36882. var tableRe = /^(?:table|thead|tbody|tr|td)$/i,
  36883. tableElRe = /td|tr|tbody|thead/i,
  36884. ts = '<table>',
  36885. te = '</table>',
  36886. tbs = ts + '<tbody>',
  36887. tbe = '</tbody>' + te,
  36888. trs = tbs + '<tr>',
  36889. tre = '</tr>' + tbe;
  36890. return {
  36891. override: 'Ext.dom.Helper',
  36892. ieInsertHtml: function(where, el, html) {
  36893. var frag = null;
  36894. // IE's incomplete table implementation: http://www.ericvasilik.com/2006/07/code-karma.html
  36895. if (Ext.isIE9m && tableRe.test(el.tagName)) {
  36896. frag = this.insertIntoTable(el.tagName.toLowerCase(), where, el, html);
  36897. }
  36898. return frag;
  36899. },
  36900. ieOverwrite: function(el, html) {
  36901. // IE Inserting HTML into a table/tbody/tr requires extra processing:
  36902. // http://www.ericvasilik.com/2006/07/code-karma.html
  36903. if (Ext.isIE9m && tableRe.test(el.tagName)) {
  36904. // Clearing table elements requires removal of all elements.
  36905. while (el.firstChild) {
  36906. el.removeChild(el.firstChild);
  36907. }
  36908. if (html) {
  36909. return this.insertHtml('afterbegin', el, html);
  36910. }
  36911. }
  36912. },
  36913. ieTable: function(depth, openingTags, htmlContent, closingTags) {
  36914. var i = -1,
  36915. el = this.detachedDiv,
  36916. ns, nx;
  36917. el.innerHTML = [
  36918. openingTags,
  36919. htmlContent,
  36920. closingTags
  36921. ].join('');
  36922. while (++i < depth) {
  36923. el = el.firstChild;
  36924. }
  36925. // If the result is multiple siblings, then encapsulate them into one fragment.
  36926. ns = el.nextSibling;
  36927. if (ns) {
  36928. ns = el;
  36929. el = document.createDocumentFragment();
  36930. while (ns) {
  36931. nx = ns.nextSibling;
  36932. el.appendChild(ns);
  36933. ns = nx;
  36934. }
  36935. }
  36936. return el;
  36937. },
  36938. /**
  36939. * @private
  36940. * @method insertIntoTable
  36941. * @member Ext.dom.Helper
  36942. * workaround for broken table implementation in IE9m
  36943. * http://www.ericvasilik.com/2006/07/code-karma.html
  36944. */
  36945. insertIntoTable: function(tag, where, destinationEl, html) {
  36946. var node, before,
  36947. bb = where === 'beforebegin',
  36948. ab = where === 'afterbegin',
  36949. be = where === 'beforeend',
  36950. ae = where === 'afterend';
  36951. if (tag === 'td' && (ab || be) || !tableElRe.test(tag) && (bb || ae)) {
  36952. return null;
  36953. }
  36954. before = bb ? destinationEl : ae ? destinationEl.nextSibling : ab ? destinationEl.firstChild : null;
  36955. if (bb || ae) {
  36956. destinationEl = destinationEl.parentNode;
  36957. }
  36958. if (tag === 'td' || (tag === 'tr' && (be || ab))) {
  36959. node = this.ieTable(4, trs, html, tre);
  36960. } else if (((tag === 'tbody' || tag === 'thead') && (be || ab)) || (tag === 'tr' && (bb || ae))) {
  36961. node = this.ieTable(3, tbs, html, tbe);
  36962. } else {
  36963. node = this.ieTable(2, ts, html, te);
  36964. }
  36965. destinationEl.insertBefore(node, before);
  36966. return node;
  36967. }
  36968. };
  36969. })());
  36970. /**
  36971. * @class Ext.list.AbstractTreeItem
  36972. */
  36973. Ext.define('Ext.overrides.list.AbstractTreeItem', {
  36974. override: 'Ext.list.AbstractTreeItem',
  36975. // This config is used by TreeIten, however to support the generic API (RootItem),
  36976. // we need this up here.
  36977. config: {
  36978. floated: null
  36979. }
  36980. });
  36981. /**
  36982. * @class Ext.list.TreeItem
  36983. */
  36984. Ext.define('Ext.overrides.list.TreeItem', {
  36985. override: 'Ext.list.TreeItem',
  36986. // Implement a setter.
  36987. // There *is* no "floated" config in Classic.
  36988. // We're still an inner item, we just get put inside a Container.
  36989. setFloated: function(floated) {
  36990. var me = this,
  36991. el = me.element,
  36992. placeholder = me.placeholder,
  36993. node, wasExpanded;
  36994. if (me.treeItemFloated !== floated) {
  36995. if (floated) {
  36996. placeholder = el.clone(false, true);
  36997. // shallow, asDom
  36998. placeholder.id += '-placeholder';
  36999. // avoid duplicate id
  37000. me.placeholder = Ext.get(placeholder);
  37001. me.wasExpanded = me.getExpanded();
  37002. me.setExpanded(true);
  37003. el.addCls(me.floatedCls);
  37004. el.dom.parentNode.insertBefore(placeholder, el.dom);
  37005. me.floater = me.createFloater();
  37006. }
  37007. // toolkit-specific
  37008. else if (placeholder) {
  37009. wasExpanded = me.wasExpanded;
  37010. node = me.getNode();
  37011. me.setExpanded(wasExpanded);
  37012. if (!wasExpanded && node.isExpanded()) {
  37013. // If we have been floating and expanded a child, we may have been
  37014. // expanded as part of the ancestors. Attempt to restore state.
  37015. me.preventAnimation = true;
  37016. node.collapse();
  37017. me.preventAnimation = false;
  37018. }
  37019. me.floater.remove(me, false);
  37020. // don't destroy
  37021. el.removeCls(me.floatedCls);
  37022. placeholder.dom.parentNode.insertBefore(el.dom, placeholder.dom);
  37023. placeholder.destroy();
  37024. me.floater.destroy();
  37025. me.placeholder = me.floater = null;
  37026. }
  37027. // Use an internal property name. We are NOT really floated
  37028. me.treeItemFloated = floated;
  37029. }
  37030. },
  37031. getFloated: function() {
  37032. return this.treeItemFloated;
  37033. },
  37034. runAnimation: function(animation) {
  37035. return this.itemContainer.addAnimation(animation);
  37036. },
  37037. stopAnimation: function(animation) {
  37038. animation.jumpToEnd();
  37039. },
  37040. privates: {
  37041. createFloater: function() {
  37042. var me = this,
  37043. owner = me.getOwner(),
  37044. ownerTree = me.up('treelist'),
  37045. floater,
  37046. toolElement = me.getToolElement(),
  37047. expandedWidth = ownerTree.expandedWidth,
  37048. defaultListWidth = ownerTree.defaultListWidth;
  37049. if (expandedWidth === null) {
  37050. expandedWidth = defaultListWidth;
  37051. }
  37052. me.floater = floater = new Ext.container.Container({
  37053. cls: ownerTree.self.prototype.element.cls + ' ' + ownerTree.uiPrefix + ownerTree.getUi() + ' ' + Ext.baseCSSPrefix + 'treelist-floater',
  37054. floating: true,
  37055. // We do not get element resize events on IE8
  37056. // so fall back to 6.0.1 sizing to 200 wide.
  37057. width: Ext.isIE8 ? defaultListWidth : (expandedWidth - toolElement.getWidth()),
  37058. shadow: false,
  37059. hidden: true,
  37060. renderTo: Ext.getBody(),
  37061. listeners: {
  37062. element: 'el',
  37063. click: function(e) {
  37064. return owner.onClick(e);
  37065. }
  37066. }
  37067. });
  37068. floater.add(me);
  37069. floater.show();
  37070. floater.el.alignTo(toolElement, 'tr?');
  37071. return floater;
  37072. }
  37073. }
  37074. });
  37075. /**
  37076. * @class Ext.list.Tree
  37077. */
  37078. Ext.define('Ext.overrides.list.Tree', {
  37079. override: 'Ext.list.Tree',
  37080. canMeasure: true,
  37081. constructor: function(config) {
  37082. this.callParent([
  37083. config
  37084. ]);
  37085. // Track size so that we can track the expanded size
  37086. // for use by the floated state of items when in micro mode.
  37087. // Browsers where this event is not supported, fall back to a width
  37088. // of 200px for floated tree items.
  37089. if (!Ext.isIE8) {
  37090. this.element.on('resize', 'onElResize', this);
  37091. }
  37092. },
  37093. beforeLayout: function() {
  37094. this.syncIconSize();
  37095. },
  37096. onElResize: function(el, details) {
  37097. if (!this.getMicro() && this.canMeasure) {
  37098. this.expandedWidth = details.width;
  37099. }
  37100. },
  37101. privates: {
  37102. defaultListWidth: 200,
  37103. expandedWidth: null
  37104. }
  37105. });
  37106. /**
  37107. * @class Ext.sparkline.Base
  37108. */
  37109. Ext.define('Ext.override.sparkline.Base', {
  37110. override: 'Ext.sparkline.Base',
  37111. statics: {
  37112. constructTip: function() {
  37113. return new Ext.tip['ToolTip']({
  37114. id: 'sparklines-tooltip',
  37115. showDelay: 0,
  37116. dismissDelay: 0,
  37117. hideDelay: 400
  37118. });
  37119. }
  37120. },
  37121. onMouseMove: function(e) {
  37122. this.getSharedTooltip().triggerEvent = e;
  37123. this.callParent([
  37124. e
  37125. ]);
  37126. },
  37127. onMouseLeave: function(e) {
  37128. this.callParent([
  37129. e
  37130. ]);
  37131. this.getSharedTooltip().target = null;
  37132. },
  37133. privates: {
  37134. hideTip: function() {
  37135. var tip = this.getSharedTooltip();
  37136. tip.target = null;
  37137. tip.hide();
  37138. },
  37139. showTip: function() {
  37140. var tip = this.getSharedTooltip();
  37141. tip.target = this.el;
  37142. tip.onTargetOver(tip.triggerEvent);
  37143. }
  37144. }
  37145. }, function(Cls) {
  37146. // If we are on a VML platform (IE8 - TODO: remove this when that retires)...
  37147. if (!Ext.supports.Canvas) {
  37148. Cls.prototype.element = {
  37149. tag: 'span',
  37150. reference: 'element',
  37151. listeners: {
  37152. mouseenter: 'onMouseEnter',
  37153. mouseleave: 'onMouseLeave',
  37154. mousemove: 'onMouseMove'
  37155. },
  37156. style: {
  37157. display: 'inline-block',
  37158. position: 'relative',
  37159. overflow: 'hidden',
  37160. margin: '0px',
  37161. padding: '0px',
  37162. verticalAlign: 'top',
  37163. cursor: 'default'
  37164. },
  37165. children: [
  37166. {
  37167. tag: 'svml:group',
  37168. reference: 'groupEl',
  37169. coordorigin: '0 0',
  37170. coordsize: '0 0',
  37171. style: 'position:absolute;width:0;height:0;pointer-events:none'
  37172. }
  37173. ]
  37174. };
  37175. }
  37176. });
  37177. /**
  37178. * @class Ext.app.ViewController
  37179. */
  37180. /**
  37181. * @method beforeRender
  37182. * @template
  37183. * Template method called by the owning component's
  37184. * {@link Ext.Component#method-beforeRender beforeRender} method.
  37185. * @param {Ext.Component} component The owner component attached to the
  37186. * ViewController
  37187. */
  37188. /**
  37189. * @method afterRender
  37190. * @template
  37191. * Template method called by the owning component's
  37192. * {@link Ext.Component#method-afterRender afterRender} method.
  37193. * @param {Ext.Component} component The owner component attached to the
  37194. * ViewController
  37195. */
  37196. /**
  37197. * @method boxReady
  37198. * @template
  37199. * Template method called by the owning component's
  37200. * {@link Ext.Component#method-onBoxReady onBoxReady} method.
  37201. * @param {Ext.Component} component The owner component attached to the
  37202. * ViewController
  37203. */
  37204. /**
  37205. * @class Ext.form.field.Checkbox
  37206. */
  37207. Ext.define(null, {
  37208. override: 'Ext.form.field.Checkbox',
  37209. compatibility: Ext.isIE8,
  37210. // IE8 does not support change event but it has propertychange which is even better
  37211. changeEventName: 'propertychange',
  37212. onChangeEvent: function(e) {
  37213. // IE8 propertychange fires for *any* property change but we're only interested in checked
  37214. // We also don't want to react to propertychange fired as the result of assigning
  37215. // checked property in setRawValue().
  37216. if (this.duringSetRawValue || e.browserEvent.propertyName !== 'checked') {
  37217. return;
  37218. }
  37219. this.callParent([
  37220. e
  37221. ]);
  37222. },
  37223. updateCheckedCls: function(checked) {
  37224. var me = this,
  37225. displayEl = me.displayEl;
  37226. me.callParent([
  37227. checked
  37228. ]);
  37229. // IE8 has a bug with font icons and pseudo-elements
  37230. if (displayEl && checked !== me.lastValue) {
  37231. displayEl.repaint();
  37232. }
  37233. }
  37234. });
  37235. /**
  37236. * @class Ext.form.field.Radio
  37237. */
  37238. Ext.define(null, {
  37239. override: 'Ext.form.field.Radio',
  37240. compatibility: Ext.isIE8,
  37241. getSubTplData: function(fieldData) {
  37242. var data = this.callParent([
  37243. fieldData
  37244. ]);
  37245. // Rendering a radio button with checked attribute
  37246. // will have a curious side effect in IE8: the DOM
  37247. // node will have checked property set to `true` but
  37248. // radio group (radios with the same name attribute)
  37249. // will behave as if no radio is checked in the group;
  37250. // tabbing into the group will select first or last
  37251. // button instead of the checked one.
  37252. // So instead of rendering the attribute we will set
  37253. // checked value in the DOM after rendering. Apparently
  37254. // such a tiny nudge is enough for the browser to behave.
  37255. delete data.checked;
  37256. return data;
  37257. },
  37258. afterRender: function() {
  37259. this.callParent();
  37260. if (this.checked) {
  37261. this.inputEl.dom.checked = true;
  37262. }
  37263. },
  37264. onChange: function(newValue, oldValue) {
  37265. // We don't need to bother updating other radio buttons in IE8
  37266. // since it will fire propertychange event on any change, not only false -> true.
  37267. // This is unlike standard compliant browsers, see main class.
  37268. this.callSuper([
  37269. newValue,
  37270. oldValue
  37271. ]);
  37272. }
  37273. });
  37274. /**
  37275. * @class Ext.scroll.Scroller
  37276. */
  37277. Ext.define(null, {
  37278. override: 'Ext.scroll.Scroller',
  37279. compatibility: Ext.isIE8,
  37280. privates: {
  37281. // Important note: this code had to be copied as a whole
  37282. // because the scrollLeft assignment trickery only works
  37283. // reliably when it is done within the same function context.
  37284. doScrollTo: function(x, y, animate) {
  37285. var me = this,
  37286. element = me.getScrollElement(),
  37287. maxPosition, dom, to, xInf, yInf, ret, deferred, callback;
  37288. if (element && !element.destroyed) {
  37289. dom = element.dom;
  37290. xInf = (x === Infinity);
  37291. yInf = (y === Infinity);
  37292. if (xInf || yInf) {
  37293. maxPosition = me.getMaxPosition();
  37294. if (xInf) {
  37295. x = maxPosition.x;
  37296. }
  37297. if (yInf) {
  37298. y = maxPosition.y;
  37299. }
  37300. }
  37301. if (x !== null) {
  37302. x = me.convertX(x);
  37303. }
  37304. if (animate) {
  37305. to = {};
  37306. if (y != null) {
  37307. to.scrollTop = y;
  37308. }
  37309. if (x != null) {
  37310. to.scrollLeft = x;
  37311. }
  37312. animate = Ext.mergeIf({
  37313. to: {
  37314. scrollTop: y,
  37315. scrollLeft: x
  37316. }
  37317. }, animate);
  37318. deferred = new Ext.Deferred();
  37319. callback = animate.callback;
  37320. animate.callback = function() {
  37321. if (callback) {
  37322. callback.call(animate.scope || Ext.global, arguments);
  37323. }
  37324. // The callback will be called if the element is destroyed
  37325. if (me.destroyed) {
  37326. deferred.reject();
  37327. } else {
  37328. deferred.resolve();
  37329. }
  37330. };
  37331. element.animate(animate);
  37332. ret = deferred.promise;
  37333. } else {
  37334. // When we need to assign both scrollTop and scrollLeft,
  37335. // IE8 might fire scroll event on the first assignment
  37336. // but not on the second; that behavior is unlike the other
  37337. // browsers which will wait for the second assignment
  37338. // to happen before firing the event. This leads to our
  37339. // scrollstart event firing prematurely, when the scrolling
  37340. // has not actually finished yet.
  37341. // To work around that, we ignore the first event and then
  37342. // force another one by assigning scrollLeft the second time.
  37343. if ((x != null && x !== 0) && y != null) {
  37344. me.deferDomScroll = true;
  37345. }
  37346. if (y != null) {
  37347. dom.scrollTop = y;
  37348. }
  37349. if (x != null) {
  37350. dom.scrollLeft = x;
  37351. }
  37352. if (me.deferDomScroll) {
  37353. me.deferDomScroll = false;
  37354. // Reading the DOM makes sure the second assignment
  37355. // will fire the event.
  37356. +dom.scrollLeft;
  37357. dom.scrollLeft = x;
  37358. +dom.scrollTop;
  37359. dom.scrollTop = y;
  37360. }
  37361. ret = Ext.Deferred.getCachedResolved();
  37362. }
  37363. // Our position object will need refreshing before returning.
  37364. me.positionDirty = true;
  37365. } else {
  37366. ret = Ext.Deferred.getCachedRejected();
  37367. }
  37368. return ret;
  37369. },
  37370. onDomScroll: function() {
  37371. var me = this;
  37372. if (me.deferDomScroll) {
  37373. return;
  37374. }
  37375. me.callParent();
  37376. }
  37377. }
  37378. });