jquery-1.11.2.js 278 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347
  1. /*!
  2. * jQuery JavaScript Library v1.11.2
  3. * http://jquery.com/
  4. *
  5. * Includes Sizzle.js
  6. * http://sizzlejs.com/
  7. *
  8. * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
  9. * Released under the MIT license
  10. * http://jquery.org/license
  11. *
  12. * Date: 2014-12-17T15:27Z
  13. */
  14. (function( global, factory ) {
  15. if ( typeof module === "object" && typeof module.exports === "object" ) {
  16. // For CommonJS and CommonJS-like environments where a proper window is present,
  17. // execute the factory and get jQuery
  18. // For environments that do not inherently posses a window with a document
  19. // (such as Node.js), expose a jQuery-making factory as module.exports
  20. // This accentuates the need for the creation of a real window
  21. // e.g. var jQuery = require("jquery")(window);
  22. // See ticket #14549 for more info
  23. module.exports = global.document ?
  24. factory( global, true ) :
  25. function( w ) {
  26. if ( !w.document ) {
  27. throw new Error( "jQuery requires a window with a document" );
  28. }
  29. return factory( w );
  30. };
  31. } else {
  32. factory( global );
  33. }
  34. // Pass this if window is not defined yet
  35. }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  36. // Can't do this because several apps including ASP.NET trace
  37. // the stack via arguments.caller.callee and Firefox dies if
  38. // you try to trace through "use strict" call chains. (#13335)
  39. // Support: Firefox 18+
  40. //
  41. var deletedIds = [];
  42. var slice = deletedIds.slice;
  43. var concat = deletedIds.concat;
  44. var push = deletedIds.push;
  45. var indexOf = deletedIds.indexOf;
  46. var class2type = {};
  47. var toString = class2type.toString;
  48. var hasOwn = class2type.hasOwnProperty;
  49. var support = {};
  50. var
  51. version = "1.11.2",
  52. // Define a local copy of jQuery
  53. jQuery = function( selector, context ) {
  54. // The jQuery object is actually just the init constructor 'enhanced'
  55. // Need init if jQuery is called (just allow error to be thrown if not included)
  56. return new jQuery.fn.init( selector, context );
  57. },
  58. // Support: Android<4.1, IE<9
  59. // Make sure we trim BOM and NBSP
  60. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  61. // Matches dashed string for camelizing
  62. rmsPrefix = /^-ms-/,
  63. rdashAlpha = /-([\da-z])/gi,
  64. // Used by jQuery.camelCase as callback to replace()
  65. fcamelCase = function( all, letter ) {
  66. return letter.toUpperCase();
  67. };
  68. jQuery.fn = jQuery.prototype = {
  69. // The current version of jQuery being used
  70. jquery: version,
  71. constructor: jQuery,
  72. // Start with an empty selector
  73. selector: "",
  74. // The default length of a jQuery object is 0
  75. length: 0,
  76. toArray: function() {
  77. return slice.call( this );
  78. },
  79. // Get the Nth element in the matched element set OR
  80. // Get the whole matched element set as a clean array
  81. get: function( num ) {
  82. return num != null ?
  83. // Return just the one element from the set
  84. ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
  85. // Return all the elements in a clean array
  86. slice.call( this );
  87. },
  88. // Take an array of elements and push it onto the stack
  89. // (returning the new matched element set)
  90. pushStack: function( elems ) {
  91. // Build a new jQuery matched element set
  92. var ret = jQuery.merge( this.constructor(), elems );
  93. // Add the old object onto the stack (as a reference)
  94. ret.prevObject = this;
  95. ret.context = this.context;
  96. // Return the newly-formed element set
  97. return ret;
  98. },
  99. // Execute a callback for every element in the matched set.
  100. // (You can seed the arguments with an array of args, but this is
  101. // only used internally.)
  102. each: function( callback, args ) {
  103. return jQuery.each( this, callback, args );
  104. },
  105. map: function( callback ) {
  106. return this.pushStack( jQuery.map(this, function( elem, i ) {
  107. return callback.call( elem, i, elem );
  108. }));
  109. },
  110. slice: function() {
  111. return this.pushStack( slice.apply( this, arguments ) );
  112. },
  113. first: function() {
  114. return this.eq( 0 );
  115. },
  116. last: function() {
  117. return this.eq( -1 );
  118. },
  119. eq: function( i ) {
  120. var len = this.length,
  121. j = +i + ( i < 0 ? len : 0 );
  122. return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
  123. },
  124. end: function() {
  125. return this.prevObject || this.constructor(null);
  126. },
  127. // For internal use only.
  128. // Behaves like an Array's method, not like a jQuery method.
  129. push: push,
  130. sort: deletedIds.sort,
  131. splice: deletedIds.splice
  132. };
  133. jQuery.extend = jQuery.fn.extend = function() {
  134. var src, copyIsArray, copy, name, options, clone,
  135. target = arguments[0] || {},
  136. i = 1,
  137. length = arguments.length,
  138. deep = false;
  139. // Handle a deep copy situation
  140. if ( typeof target === "boolean" ) {
  141. deep = target;
  142. // skip the boolean and the target
  143. target = arguments[ i ] || {};
  144. i++;
  145. }
  146. // Handle case when target is a string or something (possible in deep copy)
  147. if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  148. target = {};
  149. }
  150. // extend jQuery itself if only one argument is passed
  151. if ( i === length ) {
  152. target = this;
  153. i--;
  154. }
  155. for ( ; i < length; i++ ) {
  156. // Only deal with non-null/undefined values
  157. if ( (options = arguments[ i ]) != null ) {
  158. // Extend the base object
  159. for ( name in options ) {
  160. src = target[ name ];
  161. copy = options[ name ];
  162. // Prevent never-ending loop
  163. if ( target === copy ) {
  164. continue;
  165. }
  166. // Recurse if we're merging plain objects or arrays
  167. if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
  168. if ( copyIsArray ) {
  169. copyIsArray = false;
  170. clone = src && jQuery.isArray(src) ? src : [];
  171. } else {
  172. clone = src && jQuery.isPlainObject(src) ? src : {};
  173. }
  174. // Never move original objects, clone them
  175. target[ name ] = jQuery.extend( deep, clone, copy );
  176. // Don't bring in undefined values
  177. } else if ( copy !== undefined ) {
  178. target[ name ] = copy;
  179. }
  180. }
  181. }
  182. }
  183. // Return the modified object
  184. return target;
  185. };
  186. jQuery.extend({
  187. // Unique for each copy of jQuery on the page
  188. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  189. // Assume jQuery is ready without the ready module
  190. isReady: true,
  191. error: function( msg ) {
  192. throw new Error( msg );
  193. },
  194. noop: function() {},
  195. // See test/unit/core.js for details concerning isFunction.
  196. // Since version 1.3, DOM methods and functions like alert
  197. // aren't supported. They return false on IE (#2968).
  198. isFunction: function( obj ) {
  199. return jQuery.type(obj) === "function";
  200. },
  201. isArray: Array.isArray || function( obj ) {
  202. return jQuery.type(obj) === "array";
  203. },
  204. isWindow: function( obj ) {
  205. /* jshint eqeqeq: false */
  206. return obj != null && obj == obj.window;
  207. },
  208. isNumeric: function( obj ) {
  209. // parseFloat NaNs numeric-cast false positives (null|true|false|"")
  210. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  211. // subtraction forces infinities to NaN
  212. // adding 1 corrects loss of precision from parseFloat (#15100)
  213. return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
  214. },
  215. isEmptyObject: function( obj ) {
  216. var name;
  217. for ( name in obj ) {
  218. return false;
  219. }
  220. return true;
  221. },
  222. isPlainObject: function( obj ) {
  223. var key;
  224. // Must be an Object.
  225. // Because of IE, we also have to check the presence of the constructor property.
  226. // Make sure that DOM nodes and window objects don't pass through, as well
  227. if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  228. return false;
  229. }
  230. try {
  231. // Not own constructor property must be Object
  232. if ( obj.constructor &&
  233. !hasOwn.call(obj, "constructor") &&
  234. !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
  235. return false;
  236. }
  237. } catch ( e ) {
  238. // IE8,9 Will throw exceptions on certain host objects #9897
  239. return false;
  240. }
  241. // Support: IE<9
  242. // Handle iteration over inherited properties before own properties.
  243. if ( support.ownLast ) {
  244. for ( key in obj ) {
  245. return hasOwn.call( obj, key );
  246. }
  247. }
  248. // Own properties are enumerated firstly, so to speed up,
  249. // if last one is own, then all properties are own.
  250. for ( key in obj ) {}
  251. return key === undefined || hasOwn.call( obj, key );
  252. },
  253. type: function( obj ) {
  254. if ( obj == null ) {
  255. return obj + "";
  256. }
  257. return typeof obj === "object" || typeof obj === "function" ?
  258. class2type[ toString.call(obj) ] || "object" :
  259. typeof obj;
  260. },
  261. // Evaluates a script in a global context
  262. // Workarounds based on findings by Jim Driscoll
  263. // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
  264. globalEval: function( data ) {
  265. if ( data && jQuery.trim( data ) ) {
  266. // We use execScript on Internet Explorer
  267. // We use an anonymous function so that context is window
  268. // rather than jQuery in Firefox
  269. ( window.execScript || function( data ) {
  270. window[ "eval" ].call( window, data );
  271. } )( data );
  272. }
  273. },
  274. // Convert dashed to camelCase; used by the css and data modules
  275. // Microsoft forgot to hump their vendor prefix (#9572)
  276. camelCase: function( string ) {
  277. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  278. },
  279. nodeName: function( elem, name ) {
  280. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  281. },
  282. // args is for internal usage only
  283. each: function( obj, callback, args ) {
  284. var value,
  285. i = 0,
  286. length = obj.length,
  287. isArray = isArraylike( obj );
  288. if ( args ) {
  289. if ( isArray ) {
  290. for ( ; i < length; i++ ) {
  291. value = callback.apply( obj[ i ], args );
  292. if ( value === false ) {
  293. break;
  294. }
  295. }
  296. } else {
  297. for ( i in obj ) {
  298. value = callback.apply( obj[ i ], args );
  299. if ( value === false ) {
  300. break;
  301. }
  302. }
  303. }
  304. // A special, fast, case for the most common use of each
  305. } else {
  306. if ( isArray ) {
  307. for ( ; i < length; i++ ) {
  308. value = callback.call( obj[ i ], i, obj[ i ] );
  309. if ( value === false ) {
  310. break;
  311. }
  312. }
  313. } else {
  314. for ( i in obj ) {
  315. value = callback.call( obj[ i ], i, obj[ i ] );
  316. if ( value === false ) {
  317. break;
  318. }
  319. }
  320. }
  321. }
  322. return obj;
  323. },
  324. // Support: Android<4.1, IE<9
  325. trim: function( text ) {
  326. return text == null ?
  327. "" :
  328. ( text + "" ).replace( rtrim, "" );
  329. },
  330. // results is for internal usage only
  331. makeArray: function( arr, results ) {
  332. var ret = results || [];
  333. if ( arr != null ) {
  334. if ( isArraylike( Object(arr) ) ) {
  335. jQuery.merge( ret,
  336. typeof arr === "string" ?
  337. [ arr ] : arr
  338. );
  339. } else {
  340. push.call( ret, arr );
  341. }
  342. }
  343. return ret;
  344. },
  345. inArray: function( elem, arr, i ) {
  346. var len;
  347. if ( arr ) {
  348. if ( indexOf ) {
  349. return indexOf.call( arr, elem, i );
  350. }
  351. len = arr.length;
  352. i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
  353. for ( ; i < len; i++ ) {
  354. // Skip accessing in sparse arrays
  355. if ( i in arr && arr[ i ] === elem ) {
  356. return i;
  357. }
  358. }
  359. }
  360. return -1;
  361. },
  362. merge: function( first, second ) {
  363. var len = +second.length,
  364. j = 0,
  365. i = first.length;
  366. while ( j < len ) {
  367. first[ i++ ] = second[ j++ ];
  368. }
  369. // Support: IE<9
  370. // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
  371. if ( len !== len ) {
  372. while ( second[j] !== undefined ) {
  373. first[ i++ ] = second[ j++ ];
  374. }
  375. }
  376. first.length = i;
  377. return first;
  378. },
  379. grep: function( elems, callback, invert ) {
  380. var callbackInverse,
  381. matches = [],
  382. i = 0,
  383. length = elems.length,
  384. callbackExpect = !invert;
  385. // Go through the array, only saving the items
  386. // that pass the validator function
  387. for ( ; i < length; i++ ) {
  388. callbackInverse = !callback( elems[ i ], i );
  389. if ( callbackInverse !== callbackExpect ) {
  390. matches.push( elems[ i ] );
  391. }
  392. }
  393. return matches;
  394. },
  395. // arg is for internal usage only
  396. map: function( elems, callback, arg ) {
  397. var value,
  398. i = 0,
  399. length = elems.length,
  400. isArray = isArraylike( elems ),
  401. ret = [];
  402. // Go through the array, translating each of the items to their new values
  403. if ( isArray ) {
  404. for ( ; i < length; i++ ) {
  405. value = callback( elems[ i ], i, arg );
  406. if ( value != null ) {
  407. ret.push( value );
  408. }
  409. }
  410. // Go through every key on the object,
  411. } else {
  412. for ( i in elems ) {
  413. value = callback( elems[ i ], i, arg );
  414. if ( value != null ) {
  415. ret.push( value );
  416. }
  417. }
  418. }
  419. // Flatten any nested arrays
  420. return concat.apply( [], ret );
  421. },
  422. // A global GUID counter for objects
  423. guid: 1,
  424. // Bind a function to a context, optionally partially applying any
  425. // arguments.
  426. proxy: function( fn, context ) {
  427. var args, proxy, tmp;
  428. if ( typeof context === "string" ) {
  429. tmp = fn[ context ];
  430. context = fn;
  431. fn = tmp;
  432. }
  433. // Quick check to determine if target is callable, in the spec
  434. // this throws a TypeError, but we will just return undefined.
  435. if ( !jQuery.isFunction( fn ) ) {
  436. return undefined;
  437. }
  438. // Simulated bind
  439. args = slice.call( arguments, 2 );
  440. proxy = function() {
  441. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  442. };
  443. // Set the guid of unique handler to the same of original handler, so it can be removed
  444. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  445. return proxy;
  446. },
  447. now: function() {
  448. return +( new Date() );
  449. },
  450. // jQuery.support is not used in Core but other projects attach their
  451. // properties to it so it needs to exist.
  452. support: support
  453. });
  454. // Populate the class2type map
  455. jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
  456. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  457. });
  458. function isArraylike( obj ) {
  459. var length = obj.length,
  460. type = jQuery.type( obj );
  461. if ( type === "function" || jQuery.isWindow( obj ) ) {
  462. return false;
  463. }
  464. if ( obj.nodeType === 1 && length ) {
  465. return true;
  466. }
  467. return type === "array" || length === 0 ||
  468. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  469. }
  470. var Sizzle =
  471. /*!
  472. * Sizzle CSS Selector Engine v2.2.0-pre
  473. * http://sizzlejs.com/
  474. *
  475. * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
  476. * Released under the MIT license
  477. * http://jquery.org/license
  478. *
  479. * Date: 2014-12-16
  480. */
  481. (function( window ) {
  482. var i,
  483. support,
  484. Expr,
  485. getText,
  486. isXML,
  487. tokenize,
  488. compile,
  489. select,
  490. outermostContext,
  491. sortInput,
  492. hasDuplicate,
  493. // Local document vars
  494. setDocument,
  495. document,
  496. docElem,
  497. documentIsHTML,
  498. rbuggyQSA,
  499. rbuggyMatches,
  500. matches,
  501. contains,
  502. // Instance-specific data
  503. expando = "sizzle" + 1 * new Date(),
  504. preferredDoc = window.document,
  505. dirruns = 0,
  506. done = 0,
  507. classCache = createCache(),
  508. tokenCache = createCache(),
  509. compilerCache = createCache(),
  510. sortOrder = function( a, b ) {
  511. if ( a === b ) {
  512. hasDuplicate = true;
  513. }
  514. return 0;
  515. },
  516. // General-purpose constants
  517. MAX_NEGATIVE = 1 << 31,
  518. // Instance methods
  519. hasOwn = ({}).hasOwnProperty,
  520. arr = [],
  521. pop = arr.pop,
  522. push_native = arr.push,
  523. push = arr.push,
  524. slice = arr.slice,
  525. // Use a stripped-down indexOf as it's faster than native
  526. // http://jsperf.com/thor-indexof-vs-for/5
  527. indexOf = function( list, elem ) {
  528. var i = 0,
  529. len = list.length;
  530. for ( ; i < len; i++ ) {
  531. if ( list[i] === elem ) {
  532. return i;
  533. }
  534. }
  535. return -1;
  536. },
  537. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  538. // Regular expressions
  539. // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
  540. whitespace = "[\\x20\\t\\r\\n\\f]",
  541. // http://www.w3.org/TR/css3-syntax/#characters
  542. characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
  543. // Loosely modeled on CSS identifier characters
  544. // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
  545. // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  546. identifier = characterEncoding.replace( "w", "w#" ),
  547. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  548. attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
  549. // Operator (capture 2)
  550. "*([*^$|!~]?=)" + whitespace +
  551. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  552. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  553. "*\\]",
  554. pseudos = ":(" + characterEncoding + ")(?:\\((" +
  555. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  556. // 1. quoted (capture 3; capture 4 or capture 5)
  557. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  558. // 2. simple (capture 6)
  559. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  560. // 3. anything else (capture 2)
  561. ".*" +
  562. ")\\)|)",
  563. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  564. rwhitespace = new RegExp( whitespace + "+", "g" ),
  565. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  566. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  567. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  568. rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  569. rpseudo = new RegExp( pseudos ),
  570. ridentifier = new RegExp( "^" + identifier + "$" ),
  571. matchExpr = {
  572. "ID": new RegExp( "^#(" + characterEncoding + ")" ),
  573. "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
  574. "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
  575. "ATTR": new RegExp( "^" + attributes ),
  576. "PSEUDO": new RegExp( "^" + pseudos ),
  577. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  578. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  579. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  580. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  581. // For use in libraries implementing .is()
  582. // We use this for POS matching in `select`
  583. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  584. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  585. },
  586. rinputs = /^(?:input|select|textarea|button)$/i,
  587. rheader = /^h\d$/i,
  588. rnative = /^[^{]+\{\s*\[native \w/,
  589. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  590. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  591. rsibling = /[+~]/,
  592. rescape = /'|\\/g,
  593. // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  594. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  595. funescape = function( _, escaped, escapedWhitespace ) {
  596. var high = "0x" + escaped - 0x10000;
  597. // NaN means non-codepoint
  598. // Support: Firefox<24
  599. // Workaround erroneous numeric interpretation of +"0x"
  600. return high !== high || escapedWhitespace ?
  601. escaped :
  602. high < 0 ?
  603. // BMP codepoint
  604. String.fromCharCode( high + 0x10000 ) :
  605. // Supplemental Plane codepoint (surrogate pair)
  606. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  607. },
  608. // Used for iframes
  609. // See setDocument()
  610. // Removing the function wrapper causes a "Permission Denied"
  611. // error in IE
  612. unloadHandler = function() {
  613. setDocument();
  614. };
  615. // Optimize for push.apply( _, NodeList )
  616. try {
  617. push.apply(
  618. (arr = slice.call( preferredDoc.childNodes )),
  619. preferredDoc.childNodes
  620. );
  621. // Support: Android<4.0
  622. // Detect silently failing push.apply
  623. arr[ preferredDoc.childNodes.length ].nodeType;
  624. } catch ( e ) {
  625. push = { apply: arr.length ?
  626. // Leverage slice if possible
  627. function( target, els ) {
  628. push_native.apply( target, slice.call(els) );
  629. } :
  630. // Support: IE<9
  631. // Otherwise append directly
  632. function( target, els ) {
  633. var j = target.length,
  634. i = 0;
  635. // Can't trust NodeList.length
  636. while ( (target[j++] = els[i++]) ) {}
  637. target.length = j - 1;
  638. }
  639. };
  640. }
  641. function Sizzle( selector, context, results, seed ) {
  642. var match, elem, m, nodeType,
  643. // QSA vars
  644. i, groups, old, nid, newContext, newSelector;
  645. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  646. setDocument( context );
  647. }
  648. context = context || document;
  649. results = results || [];
  650. nodeType = context.nodeType;
  651. if ( typeof selector !== "string" || !selector ||
  652. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  653. return results;
  654. }
  655. if ( !seed && documentIsHTML ) {
  656. // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
  657. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  658. // Speed-up: Sizzle("#ID")
  659. if ( (m = match[1]) ) {
  660. if ( nodeType === 9 ) {
  661. elem = context.getElementById( m );
  662. // Check parentNode to catch when Blackberry 4.6 returns
  663. // nodes that are no longer in the document (jQuery #6963)
  664. if ( elem && elem.parentNode ) {
  665. // Handle the case where IE, Opera, and Webkit return items
  666. // by name instead of ID
  667. if ( elem.id === m ) {
  668. results.push( elem );
  669. return results;
  670. }
  671. } else {
  672. return results;
  673. }
  674. } else {
  675. // Context is not a document
  676. if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
  677. contains( context, elem ) && elem.id === m ) {
  678. results.push( elem );
  679. return results;
  680. }
  681. }
  682. // Speed-up: Sizzle("TAG")
  683. } else if ( match[2] ) {
  684. push.apply( results, context.getElementsByTagName( selector ) );
  685. return results;
  686. // Speed-up: Sizzle(".CLASS")
  687. } else if ( (m = match[3]) && support.getElementsByClassName ) {
  688. push.apply( results, context.getElementsByClassName( m ) );
  689. return results;
  690. }
  691. }
  692. // QSA path
  693. if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  694. nid = old = expando;
  695. newContext = context;
  696. newSelector = nodeType !== 1 && selector;
  697. // qSA works strangely on Element-rooted queries
  698. // We can work around this by specifying an extra ID on the root
  699. // and working up from there (Thanks to Andrew Dupont for the technique)
  700. // IE 8 doesn't work on object elements
  701. if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
  702. groups = tokenize( selector );
  703. if ( (old = context.getAttribute("id")) ) {
  704. nid = old.replace( rescape, "\\$&" );
  705. } else {
  706. context.setAttribute( "id", nid );
  707. }
  708. nid = "[id='" + nid + "'] ";
  709. i = groups.length;
  710. while ( i-- ) {
  711. groups[i] = nid + toSelector( groups[i] );
  712. }
  713. newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
  714. newSelector = groups.join(",");
  715. }
  716. if ( newSelector ) {
  717. try {
  718. push.apply( results,
  719. newContext.querySelectorAll( newSelector )
  720. );
  721. return results;
  722. } catch(qsaError) {
  723. } finally {
  724. if ( !old ) {
  725. context.removeAttribute("id");
  726. }
  727. }
  728. }
  729. }
  730. }
  731. // All others
  732. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  733. }
  734. /**
  735. * Create key-value caches of limited size
  736. * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
  737. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  738. * deleting the oldest entry
  739. */
  740. function createCache() {
  741. var keys = [];
  742. function cache( key, value ) {
  743. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  744. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  745. // Only keep the most recent entries
  746. delete cache[ keys.shift() ];
  747. }
  748. return (cache[ key + " " ] = value);
  749. }
  750. return cache;
  751. }
  752. /**
  753. * Mark a function for special use by Sizzle
  754. * @param {Function} fn The function to mark
  755. */
  756. function markFunction( fn ) {
  757. fn[ expando ] = true;
  758. return fn;
  759. }
  760. /**
  761. * Support testing using an element
  762. * @param {Function} fn Passed the created div and expects a boolean result
  763. */
  764. function assert( fn ) {
  765. var div = document.createElement("div");
  766. try {
  767. return !!fn( div );
  768. } catch (e) {
  769. return false;
  770. } finally {
  771. // Remove from its parent by default
  772. if ( div.parentNode ) {
  773. div.parentNode.removeChild( div );
  774. }
  775. // release memory in IE
  776. div = null;
  777. }
  778. }
  779. /**
  780. * Adds the same handler for all of the specified attrs
  781. * @param {String} attrs Pipe-separated list of attributes
  782. * @param {Function} handler The method that will be applied
  783. */
  784. function addHandle( attrs, handler ) {
  785. var arr = attrs.split("|"),
  786. i = attrs.length;
  787. while ( i-- ) {
  788. Expr.attrHandle[ arr[i] ] = handler;
  789. }
  790. }
  791. /**
  792. * Checks document order of two siblings
  793. * @param {Element} a
  794. * @param {Element} b
  795. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  796. */
  797. function siblingCheck( a, b ) {
  798. var cur = b && a,
  799. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  800. ( ~b.sourceIndex || MAX_NEGATIVE ) -
  801. ( ~a.sourceIndex || MAX_NEGATIVE );
  802. // Use IE sourceIndex if available on both nodes
  803. if ( diff ) {
  804. return diff;
  805. }
  806. // Check if b follows a
  807. if ( cur ) {
  808. while ( (cur = cur.nextSibling) ) {
  809. if ( cur === b ) {
  810. return -1;
  811. }
  812. }
  813. }
  814. return a ? 1 : -1;
  815. }
  816. /**
  817. * Returns a function to use in pseudos for input types
  818. * @param {String} type
  819. */
  820. function createInputPseudo( type ) {
  821. return function( elem ) {
  822. var name = elem.nodeName.toLowerCase();
  823. return name === "input" && elem.type === type;
  824. };
  825. }
  826. /**
  827. * Returns a function to use in pseudos for buttons
  828. * @param {String} type
  829. */
  830. function createButtonPseudo( type ) {
  831. return function( elem ) {
  832. var name = elem.nodeName.toLowerCase();
  833. return (name === "input" || name === "button") && elem.type === type;
  834. };
  835. }
  836. /**
  837. * Returns a function to use in pseudos for positionals
  838. * @param {Function} fn
  839. */
  840. function createPositionalPseudo( fn ) {
  841. return markFunction(function( argument ) {
  842. argument = +argument;
  843. return markFunction(function( seed, matches ) {
  844. var j,
  845. matchIndexes = fn( [], seed.length, argument ),
  846. i = matchIndexes.length;
  847. // Match elements found at the specified indexes
  848. while ( i-- ) {
  849. if ( seed[ (j = matchIndexes[i]) ] ) {
  850. seed[j] = !(matches[j] = seed[j]);
  851. }
  852. }
  853. });
  854. });
  855. }
  856. /**
  857. * Checks a node for validity as a Sizzle context
  858. * @param {Element|Object=} context
  859. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  860. */
  861. function testContext( context ) {
  862. return context && typeof context.getElementsByTagName !== "undefined" && context;
  863. }
  864. // Expose support vars for convenience
  865. support = Sizzle.support = {};
  866. /**
  867. * Detects XML nodes
  868. * @param {Element|Object} elem An element or a document
  869. * @returns {Boolean} True iff elem is a non-HTML XML node
  870. */
  871. isXML = Sizzle.isXML = function( elem ) {
  872. // documentElement is verified for cases where it doesn't yet exist
  873. // (such as loading iframes in IE - #4833)
  874. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  875. return documentElement ? documentElement.nodeName !== "HTML" : false;
  876. };
  877. /**
  878. * Sets document-related variables once based on the current document
  879. * @param {Element|Object} [doc] An element or document object to use to set the document
  880. * @returns {Object} Returns the current document
  881. */
  882. setDocument = Sizzle.setDocument = function( node ) {
  883. var hasCompare, parent,
  884. doc = node ? node.ownerDocument || node : preferredDoc;
  885. // If no document and documentElement is available, return
  886. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  887. return document;
  888. }
  889. // Set our document
  890. document = doc;
  891. docElem = doc.documentElement;
  892. parent = doc.defaultView;
  893. // Support: IE>8
  894. // If iframe document is assigned to "document" variable and if iframe has been reloaded,
  895. // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
  896. // IE6-8 do not support the defaultView property so parent will be undefined
  897. if ( parent && parent !== parent.top ) {
  898. // IE11 does not have attachEvent, so all must suffer
  899. if ( parent.addEventListener ) {
  900. parent.addEventListener( "unload", unloadHandler, false );
  901. } else if ( parent.attachEvent ) {
  902. parent.attachEvent( "onunload", unloadHandler );
  903. }
  904. }
  905. /* Support tests
  906. ---------------------------------------------------------------------- */
  907. documentIsHTML = !isXML( doc );
  908. /* Attributes
  909. ---------------------------------------------------------------------- */
  910. // Support: IE<8
  911. // Verify that getAttribute really returns attributes and not properties
  912. // (excepting IE8 booleans)
  913. support.attributes = assert(function( div ) {
  914. div.className = "i";
  915. return !div.getAttribute("className");
  916. });
  917. /* getElement(s)By*
  918. ---------------------------------------------------------------------- */
  919. // Check if getElementsByTagName("*") returns only elements
  920. support.getElementsByTagName = assert(function( div ) {
  921. div.appendChild( doc.createComment("") );
  922. return !div.getElementsByTagName("*").length;
  923. });
  924. // Support: IE<9
  925. support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
  926. // Support: IE<10
  927. // Check if getElementById returns elements by name
  928. // The broken getElementById methods don't pick up programatically-set names,
  929. // so use a roundabout getElementsByName test
  930. support.getById = assert(function( div ) {
  931. docElem.appendChild( div ).id = expando;
  932. return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
  933. });
  934. // ID find and filter
  935. if ( support.getById ) {
  936. Expr.find["ID"] = function( id, context ) {
  937. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  938. var m = context.getElementById( id );
  939. // Check parentNode to catch when Blackberry 4.6 returns
  940. // nodes that are no longer in the document #6963
  941. return m && m.parentNode ? [ m ] : [];
  942. }
  943. };
  944. Expr.filter["ID"] = function( id ) {
  945. var attrId = id.replace( runescape, funescape );
  946. return function( elem ) {
  947. return elem.getAttribute("id") === attrId;
  948. };
  949. };
  950. } else {
  951. // Support: IE6/7
  952. // getElementById is not reliable as a find shortcut
  953. delete Expr.find["ID"];
  954. Expr.filter["ID"] = function( id ) {
  955. var attrId = id.replace( runescape, funescape );
  956. return function( elem ) {
  957. var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  958. return node && node.value === attrId;
  959. };
  960. };
  961. }
  962. // Tag
  963. Expr.find["TAG"] = support.getElementsByTagName ?
  964. function( tag, context ) {
  965. if ( typeof context.getElementsByTagName !== "undefined" ) {
  966. return context.getElementsByTagName( tag );
  967. // DocumentFragment nodes don't have gEBTN
  968. } else if ( support.qsa ) {
  969. return context.querySelectorAll( tag );
  970. }
  971. } :
  972. function( tag, context ) {
  973. var elem,
  974. tmp = [],
  975. i = 0,
  976. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  977. results = context.getElementsByTagName( tag );
  978. // Filter out possible comments
  979. if ( tag === "*" ) {
  980. while ( (elem = results[i++]) ) {
  981. if ( elem.nodeType === 1 ) {
  982. tmp.push( elem );
  983. }
  984. }
  985. return tmp;
  986. }
  987. return results;
  988. };
  989. // Class
  990. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  991. if ( documentIsHTML ) {
  992. return context.getElementsByClassName( className );
  993. }
  994. };
  995. /* QSA/matchesSelector
  996. ---------------------------------------------------------------------- */
  997. // QSA and matchesSelector support
  998. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  999. rbuggyMatches = [];
  1000. // qSa(:focus) reports false when true (Chrome 21)
  1001. // We allow this because of a bug in IE8/9 that throws an error
  1002. // whenever `document.activeElement` is accessed on an iframe
  1003. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  1004. // See http://bugs.jquery.com/ticket/13378
  1005. rbuggyQSA = [];
  1006. if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
  1007. // Build QSA regex
  1008. // Regex strategy adopted from Diego Perini
  1009. assert(function( div ) {
  1010. // Select is set to empty string on purpose
  1011. // This is to test IE's treatment of not explicitly
  1012. // setting a boolean content attribute,
  1013. // since its presence should be enough
  1014. // http://bugs.jquery.com/ticket/12359
  1015. docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
  1016. "<select id='" + expando + "-\f]' msallowcapture=''>" +
  1017. "<option selected=''></option></select>";
  1018. // Support: IE8, Opera 11-12.16
  1019. // Nothing should be selected when empty strings follow ^= or $= or *=
  1020. // The test attribute must be unknown in Opera but "safe" for WinRT
  1021. // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  1022. if ( div.querySelectorAll("[msallowcapture^='']").length ) {
  1023. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  1024. }
  1025. // Support: IE8
  1026. // Boolean attributes and "value" are not treated correctly
  1027. if ( !div.querySelectorAll("[selected]").length ) {
  1028. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1029. }
  1030. // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
  1031. if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  1032. rbuggyQSA.push("~=");
  1033. }
  1034. // Webkit/Opera - :checked should return selected option elements
  1035. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1036. // IE8 throws error here and will not see later tests
  1037. if ( !div.querySelectorAll(":checked").length ) {
  1038. rbuggyQSA.push(":checked");
  1039. }
  1040. // Support: Safari 8+, iOS 8+
  1041. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1042. // In-page `selector#id sibing-combinator selector` fails
  1043. if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1044. rbuggyQSA.push(".#.+[+~]");
  1045. }
  1046. });
  1047. assert(function( div ) {
  1048. // Support: Windows 8 Native Apps
  1049. // The type and name attributes are restricted during .innerHTML assignment
  1050. var input = doc.createElement("input");
  1051. input.setAttribute( "type", "hidden" );
  1052. div.appendChild( input ).setAttribute( "name", "D" );
  1053. // Support: IE8
  1054. // Enforce case-sensitivity of name attribute
  1055. if ( div.querySelectorAll("[name=d]").length ) {
  1056. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  1057. }
  1058. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  1059. // IE8 throws error here and will not see later tests
  1060. if ( !div.querySelectorAll(":enabled").length ) {
  1061. rbuggyQSA.push( ":enabled", ":disabled" );
  1062. }
  1063. // Opera 10-11 does not throw on post-comma invalid pseudos
  1064. div.querySelectorAll("*,:x");
  1065. rbuggyQSA.push(",.*:");
  1066. });
  1067. }
  1068. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  1069. docElem.webkitMatchesSelector ||
  1070. docElem.mozMatchesSelector ||
  1071. docElem.oMatchesSelector ||
  1072. docElem.msMatchesSelector) )) ) {
  1073. assert(function( div ) {
  1074. // Check to see if it's possible to do matchesSelector
  1075. // on a disconnected node (IE 9)
  1076. support.disconnectedMatch = matches.call( div, "div" );
  1077. // This should fail with an exception
  1078. // Gecko does not error, returns false instead
  1079. matches.call( div, "[s!='']:x" );
  1080. rbuggyMatches.push( "!=", pseudos );
  1081. });
  1082. }
  1083. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  1084. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  1085. /* Contains
  1086. ---------------------------------------------------------------------- */
  1087. hasCompare = rnative.test( docElem.compareDocumentPosition );
  1088. // Element contains another
  1089. // Purposefully does not implement inclusive descendent
  1090. // As in, an element does not contain itself
  1091. contains = hasCompare || rnative.test( docElem.contains ) ?
  1092. function( a, b ) {
  1093. var adown = a.nodeType === 9 ? a.documentElement : a,
  1094. bup = b && b.parentNode;
  1095. return a === bup || !!( bup && bup.nodeType === 1 && (
  1096. adown.contains ?
  1097. adown.contains( bup ) :
  1098. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  1099. ));
  1100. } :
  1101. function( a, b ) {
  1102. if ( b ) {
  1103. while ( (b = b.parentNode) ) {
  1104. if ( b === a ) {
  1105. return true;
  1106. }
  1107. }
  1108. }
  1109. return false;
  1110. };
  1111. /* Sorting
  1112. ---------------------------------------------------------------------- */
  1113. // Document order sorting
  1114. sortOrder = hasCompare ?
  1115. function( a, b ) {
  1116. // Flag for duplicate removal
  1117. if ( a === b ) {
  1118. hasDuplicate = true;
  1119. return 0;
  1120. }
  1121. // Sort on method existence if only one input has compareDocumentPosition
  1122. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1123. if ( compare ) {
  1124. return compare;
  1125. }
  1126. // Calculate position if both inputs belong to the same document
  1127. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  1128. a.compareDocumentPosition( b ) :
  1129. // Otherwise we know they are disconnected
  1130. 1;
  1131. // Disconnected nodes
  1132. if ( compare & 1 ||
  1133. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  1134. // Choose the first element that is related to our preferred document
  1135. if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  1136. return -1;
  1137. }
  1138. if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  1139. return 1;
  1140. }
  1141. // Maintain original order
  1142. return sortInput ?
  1143. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1144. 0;
  1145. }
  1146. return compare & 4 ? -1 : 1;
  1147. } :
  1148. function( a, b ) {
  1149. // Exit early if the nodes are identical
  1150. if ( a === b ) {
  1151. hasDuplicate = true;
  1152. return 0;
  1153. }
  1154. var cur,
  1155. i = 0,
  1156. aup = a.parentNode,
  1157. bup = b.parentNode,
  1158. ap = [ a ],
  1159. bp = [ b ];
  1160. // Parentless nodes are either documents or disconnected
  1161. if ( !aup || !bup ) {
  1162. return a === doc ? -1 :
  1163. b === doc ? 1 :
  1164. aup ? -1 :
  1165. bup ? 1 :
  1166. sortInput ?
  1167. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1168. 0;
  1169. // If the nodes are siblings, we can do a quick check
  1170. } else if ( aup === bup ) {
  1171. return siblingCheck( a, b );
  1172. }
  1173. // Otherwise we need full lists of their ancestors for comparison
  1174. cur = a;
  1175. while ( (cur = cur.parentNode) ) {
  1176. ap.unshift( cur );
  1177. }
  1178. cur = b;
  1179. while ( (cur = cur.parentNode) ) {
  1180. bp.unshift( cur );
  1181. }
  1182. // Walk down the tree looking for a discrepancy
  1183. while ( ap[i] === bp[i] ) {
  1184. i++;
  1185. }
  1186. return i ?
  1187. // Do a sibling check if the nodes have a common ancestor
  1188. siblingCheck( ap[i], bp[i] ) :
  1189. // Otherwise nodes in our document sort first
  1190. ap[i] === preferredDoc ? -1 :
  1191. bp[i] === preferredDoc ? 1 :
  1192. 0;
  1193. };
  1194. return doc;
  1195. };
  1196. Sizzle.matches = function( expr, elements ) {
  1197. return Sizzle( expr, null, null, elements );
  1198. };
  1199. Sizzle.matchesSelector = function( elem, expr ) {
  1200. // Set document vars if needed
  1201. if ( ( elem.ownerDocument || elem ) !== document ) {
  1202. setDocument( elem );
  1203. }
  1204. // Make sure that attribute selectors are quoted
  1205. expr = expr.replace( rattributeQuotes, "='$1']" );
  1206. if ( support.matchesSelector && documentIsHTML &&
  1207. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  1208. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1209. try {
  1210. var ret = matches.call( elem, expr );
  1211. // IE 9's matchesSelector returns false on disconnected nodes
  1212. if ( ret || support.disconnectedMatch ||
  1213. // As well, disconnected nodes are said to be in a document
  1214. // fragment in IE 9
  1215. elem.document && elem.document.nodeType !== 11 ) {
  1216. return ret;
  1217. }
  1218. } catch (e) {}
  1219. }
  1220. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  1221. };
  1222. Sizzle.contains = function( context, elem ) {
  1223. // Set document vars if needed
  1224. if ( ( context.ownerDocument || context ) !== document ) {
  1225. setDocument( context );
  1226. }
  1227. return contains( context, elem );
  1228. };
  1229. Sizzle.attr = function( elem, name ) {
  1230. // Set document vars if needed
  1231. if ( ( elem.ownerDocument || elem ) !== document ) {
  1232. setDocument( elem );
  1233. }
  1234. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1235. // Don't get fooled by Object.prototype properties (jQuery #13807)
  1236. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1237. fn( elem, name, !documentIsHTML ) :
  1238. undefined;
  1239. return val !== undefined ?
  1240. val :
  1241. support.attributes || !documentIsHTML ?
  1242. elem.getAttribute( name ) :
  1243. (val = elem.getAttributeNode(name)) && val.specified ?
  1244. val.value :
  1245. null;
  1246. };
  1247. Sizzle.error = function( msg ) {
  1248. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1249. };
  1250. /**
  1251. * Document sorting and removing duplicates
  1252. * @param {ArrayLike} results
  1253. */
  1254. Sizzle.uniqueSort = function( results ) {
  1255. var elem,
  1256. duplicates = [],
  1257. j = 0,
  1258. i = 0;
  1259. // Unless we *know* we can detect duplicates, assume their presence
  1260. hasDuplicate = !support.detectDuplicates;
  1261. sortInput = !support.sortStable && results.slice( 0 );
  1262. results.sort( sortOrder );
  1263. if ( hasDuplicate ) {
  1264. while ( (elem = results[i++]) ) {
  1265. if ( elem === results[ i ] ) {
  1266. j = duplicates.push( i );
  1267. }
  1268. }
  1269. while ( j-- ) {
  1270. results.splice( duplicates[ j ], 1 );
  1271. }
  1272. }
  1273. // Clear input after sorting to release objects
  1274. // See https://github.com/jquery/sizzle/pull/225
  1275. sortInput = null;
  1276. return results;
  1277. };
  1278. /**
  1279. * Utility function for retrieving the text value of an array of DOM nodes
  1280. * @param {Array|Element} elem
  1281. */
  1282. getText = Sizzle.getText = function( elem ) {
  1283. var node,
  1284. ret = "",
  1285. i = 0,
  1286. nodeType = elem.nodeType;
  1287. if ( !nodeType ) {
  1288. // If no nodeType, this is expected to be an array
  1289. while ( (node = elem[i++]) ) {
  1290. // Do not traverse comment nodes
  1291. ret += getText( node );
  1292. }
  1293. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  1294. // Use textContent for elements
  1295. // innerText usage removed for consistency of new lines (jQuery #11153)
  1296. if ( typeof elem.textContent === "string" ) {
  1297. return elem.textContent;
  1298. } else {
  1299. // Traverse its children
  1300. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1301. ret += getText( elem );
  1302. }
  1303. }
  1304. } else if ( nodeType === 3 || nodeType === 4 ) {
  1305. return elem.nodeValue;
  1306. }
  1307. // Do not include comment or processing instruction nodes
  1308. return ret;
  1309. };
  1310. Expr = Sizzle.selectors = {
  1311. // Can be adjusted by the user
  1312. cacheLength: 50,
  1313. createPseudo: markFunction,
  1314. match: matchExpr,
  1315. attrHandle: {},
  1316. find: {},
  1317. relative: {
  1318. ">": { dir: "parentNode", first: true },
  1319. " ": { dir: "parentNode" },
  1320. "+": { dir: "previousSibling", first: true },
  1321. "~": { dir: "previousSibling" }
  1322. },
  1323. preFilter: {
  1324. "ATTR": function( match ) {
  1325. match[1] = match[1].replace( runescape, funescape );
  1326. // Move the given value to match[3] whether quoted or unquoted
  1327. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  1328. if ( match[2] === "~=" ) {
  1329. match[3] = " " + match[3] + " ";
  1330. }
  1331. return match.slice( 0, 4 );
  1332. },
  1333. "CHILD": function( match ) {
  1334. /* matches from matchExpr["CHILD"]
  1335. 1 type (only|nth|...)
  1336. 2 what (child|of-type)
  1337. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1338. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1339. 5 sign of xn-component
  1340. 6 x of xn-component
  1341. 7 sign of y-component
  1342. 8 y of y-component
  1343. */
  1344. match[1] = match[1].toLowerCase();
  1345. if ( match[1].slice( 0, 3 ) === "nth" ) {
  1346. // nth-* requires argument
  1347. if ( !match[3] ) {
  1348. Sizzle.error( match[0] );
  1349. }
  1350. // numeric x and y parameters for Expr.filter.CHILD
  1351. // remember that false/true cast respectively to 0/1
  1352. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  1353. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  1354. // other types prohibit arguments
  1355. } else if ( match[3] ) {
  1356. Sizzle.error( match[0] );
  1357. }
  1358. return match;
  1359. },
  1360. "PSEUDO": function( match ) {
  1361. var excess,
  1362. unquoted = !match[6] && match[2];
  1363. if ( matchExpr["CHILD"].test( match[0] ) ) {
  1364. return null;
  1365. }
  1366. // Accept quoted arguments as-is
  1367. if ( match[3] ) {
  1368. match[2] = match[4] || match[5] || "";
  1369. // Strip excess characters from unquoted arguments
  1370. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1371. // Get excess from tokenize (recursively)
  1372. (excess = tokenize( unquoted, true )) &&
  1373. // advance to the next closing parenthesis
  1374. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  1375. // excess is a negative index
  1376. match[0] = match[0].slice( 0, excess );
  1377. match[2] = unquoted.slice( 0, excess );
  1378. }
  1379. // Return only captures needed by the pseudo filter method (type and argument)
  1380. return match.slice( 0, 3 );
  1381. }
  1382. },
  1383. filter: {
  1384. "TAG": function( nodeNameSelector ) {
  1385. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1386. return nodeNameSelector === "*" ?
  1387. function() { return true; } :
  1388. function( elem ) {
  1389. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  1390. };
  1391. },
  1392. "CLASS": function( className ) {
  1393. var pattern = classCache[ className + " " ];
  1394. return pattern ||
  1395. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  1396. classCache( className, function( elem ) {
  1397. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  1398. });
  1399. },
  1400. "ATTR": function( name, operator, check ) {
  1401. return function( elem ) {
  1402. var result = Sizzle.attr( elem, name );
  1403. if ( result == null ) {
  1404. return operator === "!=";
  1405. }
  1406. if ( !operator ) {
  1407. return true;
  1408. }
  1409. result += "";
  1410. return operator === "=" ? result === check :
  1411. operator === "!=" ? result !== check :
  1412. operator === "^=" ? check && result.indexOf( check ) === 0 :
  1413. operator === "*=" ? check && result.indexOf( check ) > -1 :
  1414. operator === "$=" ? check && result.slice( -check.length ) === check :
  1415. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  1416. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  1417. false;
  1418. };
  1419. },
  1420. "CHILD": function( type, what, argument, first, last ) {
  1421. var simple = type.slice( 0, 3 ) !== "nth",
  1422. forward = type.slice( -4 ) !== "last",
  1423. ofType = what === "of-type";
  1424. return first === 1 && last === 0 ?
  1425. // Shortcut for :nth-*(n)
  1426. function( elem ) {
  1427. return !!elem.parentNode;
  1428. } :
  1429. function( elem, context, xml ) {
  1430. var cache, outerCache, node, diff, nodeIndex, start,
  1431. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1432. parent = elem.parentNode,
  1433. name = ofType && elem.nodeName.toLowerCase(),
  1434. useCache = !xml && !ofType;
  1435. if ( parent ) {
  1436. // :(first|last|only)-(child|of-type)
  1437. if ( simple ) {
  1438. while ( dir ) {
  1439. node = elem;
  1440. while ( (node = node[ dir ]) ) {
  1441. if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
  1442. return false;
  1443. }
  1444. }
  1445. // Reverse direction for :only-* (if we haven't yet done so)
  1446. start = dir = type === "only" && !start && "nextSibling";
  1447. }
  1448. return true;
  1449. }
  1450. start = [ forward ? parent.firstChild : parent.lastChild ];
  1451. // non-xml :nth-child(...) stores cache data on `parent`
  1452. if ( forward && useCache ) {
  1453. // Seek `elem` from a previously-cached index
  1454. outerCache = parent[ expando ] || (parent[ expando ] = {});
  1455. cache = outerCache[ type ] || [];
  1456. nodeIndex = cache[0] === dirruns && cache[1];
  1457. diff = cache[0] === dirruns && cache[2];
  1458. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1459. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1460. // Fallback to seeking `elem` from the start
  1461. (diff = nodeIndex = 0) || start.pop()) ) {
  1462. // When found, cache indexes on `parent` and break
  1463. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1464. outerCache[ type ] = [ dirruns, nodeIndex, diff ];
  1465. break;
  1466. }
  1467. }
  1468. // Use previously-cached element index if available
  1469. } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
  1470. diff = cache[1];
  1471. // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1472. } else {
  1473. // Use the same loop as above to seek `elem` from the start
  1474. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1475. (diff = nodeIndex = 0) || start.pop()) ) {
  1476. if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
  1477. // Cache the index of each encountered element
  1478. if ( useCache ) {
  1479. (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
  1480. }
  1481. if ( node === elem ) {
  1482. break;
  1483. }
  1484. }
  1485. }
  1486. }
  1487. // Incorporate the offset, then check against cycle size
  1488. diff -= last;
  1489. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1490. }
  1491. };
  1492. },
  1493. "PSEUDO": function( pseudo, argument ) {
  1494. // pseudo-class names are case-insensitive
  1495. // http://www.w3.org/TR/selectors/#pseudo-classes
  1496. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1497. // Remember that setFilters inherits from pseudos
  1498. var args,
  1499. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1500. Sizzle.error( "unsupported pseudo: " + pseudo );
  1501. // The user may use createPseudo to indicate that
  1502. // arguments are needed to create the filter function
  1503. // just as Sizzle does
  1504. if ( fn[ expando ] ) {
  1505. return fn( argument );
  1506. }
  1507. // But maintain support for old signatures
  1508. if ( fn.length > 1 ) {
  1509. args = [ pseudo, pseudo, "", argument ];
  1510. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1511. markFunction(function( seed, matches ) {
  1512. var idx,
  1513. matched = fn( seed, argument ),
  1514. i = matched.length;
  1515. while ( i-- ) {
  1516. idx = indexOf( seed, matched[i] );
  1517. seed[ idx ] = !( matches[ idx ] = matched[i] );
  1518. }
  1519. }) :
  1520. function( elem ) {
  1521. return fn( elem, 0, args );
  1522. };
  1523. }
  1524. return fn;
  1525. }
  1526. },
  1527. pseudos: {
  1528. // Potentially complex pseudos
  1529. "not": markFunction(function( selector ) {
  1530. // Trim the selector passed to compile
  1531. // to avoid treating leading and trailing
  1532. // spaces as combinators
  1533. var input = [],
  1534. results = [],
  1535. matcher = compile( selector.replace( rtrim, "$1" ) );
  1536. return matcher[ expando ] ?
  1537. markFunction(function( seed, matches, context, xml ) {
  1538. var elem,
  1539. unmatched = matcher( seed, null, xml, [] ),
  1540. i = seed.length;
  1541. // Match elements unmatched by `matcher`
  1542. while ( i-- ) {
  1543. if ( (elem = unmatched[i]) ) {
  1544. seed[i] = !(matches[i] = elem);
  1545. }
  1546. }
  1547. }) :
  1548. function( elem, context, xml ) {
  1549. input[0] = elem;
  1550. matcher( input, null, xml, results );
  1551. // Don't keep the element (issue #299)
  1552. input[0] = null;
  1553. return !results.pop();
  1554. };
  1555. }),
  1556. "has": markFunction(function( selector ) {
  1557. return function( elem ) {
  1558. return Sizzle( selector, elem ).length > 0;
  1559. };
  1560. }),
  1561. "contains": markFunction(function( text ) {
  1562. text = text.replace( runescape, funescape );
  1563. return function( elem ) {
  1564. return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
  1565. };
  1566. }),
  1567. // "Whether an element is represented by a :lang() selector
  1568. // is based solely on the element's language value
  1569. // being equal to the identifier C,
  1570. // or beginning with the identifier C immediately followed by "-".
  1571. // The matching of C against the element's language value is performed case-insensitively.
  1572. // The identifier C does not have to be a valid language name."
  1573. // http://www.w3.org/TR/selectors/#lang-pseudo
  1574. "lang": markFunction( function( lang ) {
  1575. // lang value must be a valid identifier
  1576. if ( !ridentifier.test(lang || "") ) {
  1577. Sizzle.error( "unsupported lang: " + lang );
  1578. }
  1579. lang = lang.replace( runescape, funescape ).toLowerCase();
  1580. return function( elem ) {
  1581. var elemLang;
  1582. do {
  1583. if ( (elemLang = documentIsHTML ?
  1584. elem.lang :
  1585. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  1586. elemLang = elemLang.toLowerCase();
  1587. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  1588. }
  1589. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  1590. return false;
  1591. };
  1592. }),
  1593. // Miscellaneous
  1594. "target": function( elem ) {
  1595. var hash = window.location && window.location.hash;
  1596. return hash && hash.slice( 1 ) === elem.id;
  1597. },
  1598. "root": function( elem ) {
  1599. return elem === docElem;
  1600. },
  1601. "focus": function( elem ) {
  1602. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  1603. },
  1604. // Boolean properties
  1605. "enabled": function( elem ) {
  1606. return elem.disabled === false;
  1607. },
  1608. "disabled": function( elem ) {
  1609. return elem.disabled === true;
  1610. },
  1611. "checked": function( elem ) {
  1612. // In CSS3, :checked should return both checked and selected elements
  1613. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1614. var nodeName = elem.nodeName.toLowerCase();
  1615. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  1616. },
  1617. "selected": function( elem ) {
  1618. // Accessing this property makes selected-by-default
  1619. // options in Safari work properly
  1620. if ( elem.parentNode ) {
  1621. elem.parentNode.selectedIndex;
  1622. }
  1623. return elem.selected === true;
  1624. },
  1625. // Contents
  1626. "empty": function( elem ) {
  1627. // http://www.w3.org/TR/selectors/#empty-pseudo
  1628. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  1629. // but not by others (comment: 8; processing instruction: 7; etc.)
  1630. // nodeType < 6 works because attributes (2) do not appear as children
  1631. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1632. if ( elem.nodeType < 6 ) {
  1633. return false;
  1634. }
  1635. }
  1636. return true;
  1637. },
  1638. "parent": function( elem ) {
  1639. return !Expr.pseudos["empty"]( elem );
  1640. },
  1641. // Element/input types
  1642. "header": function( elem ) {
  1643. return rheader.test( elem.nodeName );
  1644. },
  1645. "input": function( elem ) {
  1646. return rinputs.test( elem.nodeName );
  1647. },
  1648. "button": function( elem ) {
  1649. var name = elem.nodeName.toLowerCase();
  1650. return name === "input" && elem.type === "button" || name === "button";
  1651. },
  1652. "text": function( elem ) {
  1653. var attr;
  1654. return elem.nodeName.toLowerCase() === "input" &&
  1655. elem.type === "text" &&
  1656. // Support: IE<8
  1657. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  1658. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  1659. },
  1660. // Position-in-collection
  1661. "first": createPositionalPseudo(function() {
  1662. return [ 0 ];
  1663. }),
  1664. "last": createPositionalPseudo(function( matchIndexes, length ) {
  1665. return [ length - 1 ];
  1666. }),
  1667. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1668. return [ argument < 0 ? argument + length : argument ];
  1669. }),
  1670. "even": createPositionalPseudo(function( matchIndexes, length ) {
  1671. var i = 0;
  1672. for ( ; i < length; i += 2 ) {
  1673. matchIndexes.push( i );
  1674. }
  1675. return matchIndexes;
  1676. }),
  1677. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  1678. var i = 1;
  1679. for ( ; i < length; i += 2 ) {
  1680. matchIndexes.push( i );
  1681. }
  1682. return matchIndexes;
  1683. }),
  1684. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1685. var i = argument < 0 ? argument + length : argument;
  1686. for ( ; --i >= 0; ) {
  1687. matchIndexes.push( i );
  1688. }
  1689. return matchIndexes;
  1690. }),
  1691. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1692. var i = argument < 0 ? argument + length : argument;
  1693. for ( ; ++i < length; ) {
  1694. matchIndexes.push( i );
  1695. }
  1696. return matchIndexes;
  1697. })
  1698. }
  1699. };
  1700. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  1701. // Add button/input type pseudos
  1702. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  1703. Expr.pseudos[ i ] = createInputPseudo( i );
  1704. }
  1705. for ( i in { submit: true, reset: true } ) {
  1706. Expr.pseudos[ i ] = createButtonPseudo( i );
  1707. }
  1708. // Easy API for creating new setFilters
  1709. function setFilters() {}
  1710. setFilters.prototype = Expr.filters = Expr.pseudos;
  1711. Expr.setFilters = new setFilters();
  1712. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  1713. var matched, match, tokens, type,
  1714. soFar, groups, preFilters,
  1715. cached = tokenCache[ selector + " " ];
  1716. if ( cached ) {
  1717. return parseOnly ? 0 : cached.slice( 0 );
  1718. }
  1719. soFar = selector;
  1720. groups = [];
  1721. preFilters = Expr.preFilter;
  1722. while ( soFar ) {
  1723. // Comma and first run
  1724. if ( !matched || (match = rcomma.exec( soFar )) ) {
  1725. if ( match ) {
  1726. // Don't consume trailing commas as valid
  1727. soFar = soFar.slice( match[0].length ) || soFar;
  1728. }
  1729. groups.push( (tokens = []) );
  1730. }
  1731. matched = false;
  1732. // Combinators
  1733. if ( (match = rcombinators.exec( soFar )) ) {
  1734. matched = match.shift();
  1735. tokens.push({
  1736. value: matched,
  1737. // Cast descendant combinators to space
  1738. type: match[0].replace( rtrim, " " )
  1739. });
  1740. soFar = soFar.slice( matched.length );
  1741. }
  1742. // Filters
  1743. for ( type in Expr.filter ) {
  1744. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  1745. (match = preFilters[ type ]( match ))) ) {
  1746. matched = match.shift();
  1747. tokens.push({
  1748. value: matched,
  1749. type: type,
  1750. matches: match
  1751. });
  1752. soFar = soFar.slice( matched.length );
  1753. }
  1754. }
  1755. if ( !matched ) {
  1756. break;
  1757. }
  1758. }
  1759. // Return the length of the invalid excess
  1760. // if we're just parsing
  1761. // Otherwise, throw an error or return tokens
  1762. return parseOnly ?
  1763. soFar.length :
  1764. soFar ?
  1765. Sizzle.error( selector ) :
  1766. // Cache the tokens
  1767. tokenCache( selector, groups ).slice( 0 );
  1768. };
  1769. function toSelector( tokens ) {
  1770. var i = 0,
  1771. len = tokens.length,
  1772. selector = "";
  1773. for ( ; i < len; i++ ) {
  1774. selector += tokens[i].value;
  1775. }
  1776. return selector;
  1777. }
  1778. function addCombinator( matcher, combinator, base ) {
  1779. var dir = combinator.dir,
  1780. checkNonElements = base && dir === "parentNode",
  1781. doneName = done++;
  1782. return combinator.first ?
  1783. // Check against closest ancestor/preceding element
  1784. function( elem, context, xml ) {
  1785. while ( (elem = elem[ dir ]) ) {
  1786. if ( elem.nodeType === 1 || checkNonElements ) {
  1787. return matcher( elem, context, xml );
  1788. }
  1789. }
  1790. } :
  1791. // Check against all ancestor/preceding elements
  1792. function( elem, context, xml ) {
  1793. var oldCache, outerCache,
  1794. newCache = [ dirruns, doneName ];
  1795. // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
  1796. if ( xml ) {
  1797. while ( (elem = elem[ dir ]) ) {
  1798. if ( elem.nodeType === 1 || checkNonElements ) {
  1799. if ( matcher( elem, context, xml ) ) {
  1800. return true;
  1801. }
  1802. }
  1803. }
  1804. } else {
  1805. while ( (elem = elem[ dir ]) ) {
  1806. if ( elem.nodeType === 1 || checkNonElements ) {
  1807. outerCache = elem[ expando ] || (elem[ expando ] = {});
  1808. if ( (oldCache = outerCache[ dir ]) &&
  1809. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  1810. // Assign to newCache so results back-propagate to previous elements
  1811. return (newCache[ 2 ] = oldCache[ 2 ]);
  1812. } else {
  1813. // Reuse newcache so results back-propagate to previous elements
  1814. outerCache[ dir ] = newCache;
  1815. // A match means we're done; a fail means we have to keep checking
  1816. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  1817. return true;
  1818. }
  1819. }
  1820. }
  1821. }
  1822. }
  1823. };
  1824. }
  1825. function elementMatcher( matchers ) {
  1826. return matchers.length > 1 ?
  1827. function( elem, context, xml ) {
  1828. var i = matchers.length;
  1829. while ( i-- ) {
  1830. if ( !matchers[i]( elem, context, xml ) ) {
  1831. return false;
  1832. }
  1833. }
  1834. return true;
  1835. } :
  1836. matchers[0];
  1837. }
  1838. function multipleContexts( selector, contexts, results ) {
  1839. var i = 0,
  1840. len = contexts.length;
  1841. for ( ; i < len; i++ ) {
  1842. Sizzle( selector, contexts[i], results );
  1843. }
  1844. return results;
  1845. }
  1846. function condense( unmatched, map, filter, context, xml ) {
  1847. var elem,
  1848. newUnmatched = [],
  1849. i = 0,
  1850. len = unmatched.length,
  1851. mapped = map != null;
  1852. for ( ; i < len; i++ ) {
  1853. if ( (elem = unmatched[i]) ) {
  1854. if ( !filter || filter( elem, context, xml ) ) {
  1855. newUnmatched.push( elem );
  1856. if ( mapped ) {
  1857. map.push( i );
  1858. }
  1859. }
  1860. }
  1861. }
  1862. return newUnmatched;
  1863. }
  1864. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  1865. if ( postFilter && !postFilter[ expando ] ) {
  1866. postFilter = setMatcher( postFilter );
  1867. }
  1868. if ( postFinder && !postFinder[ expando ] ) {
  1869. postFinder = setMatcher( postFinder, postSelector );
  1870. }
  1871. return markFunction(function( seed, results, context, xml ) {
  1872. var temp, i, elem,
  1873. preMap = [],
  1874. postMap = [],
  1875. preexisting = results.length,
  1876. // Get initial elements from seed or context
  1877. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  1878. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  1879. matcherIn = preFilter && ( seed || !selector ) ?
  1880. condense( elems, preMap, preFilter, context, xml ) :
  1881. elems,
  1882. matcherOut = matcher ?
  1883. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  1884. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  1885. // ...intermediate processing is necessary
  1886. [] :
  1887. // ...otherwise use results directly
  1888. results :
  1889. matcherIn;
  1890. // Find primary matches
  1891. if ( matcher ) {
  1892. matcher( matcherIn, matcherOut, context, xml );
  1893. }
  1894. // Apply postFilter
  1895. if ( postFilter ) {
  1896. temp = condense( matcherOut, postMap );
  1897. postFilter( temp, [], context, xml );
  1898. // Un-match failing elements by moving them back to matcherIn
  1899. i = temp.length;
  1900. while ( i-- ) {
  1901. if ( (elem = temp[i]) ) {
  1902. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  1903. }
  1904. }
  1905. }
  1906. if ( seed ) {
  1907. if ( postFinder || preFilter ) {
  1908. if ( postFinder ) {
  1909. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  1910. temp = [];
  1911. i = matcherOut.length;
  1912. while ( i-- ) {
  1913. if ( (elem = matcherOut[i]) ) {
  1914. // Restore matcherIn since elem is not yet a final match
  1915. temp.push( (matcherIn[i] = elem) );
  1916. }
  1917. }
  1918. postFinder( null, (matcherOut = []), temp, xml );
  1919. }
  1920. // Move matched elements from seed to results to keep them synchronized
  1921. i = matcherOut.length;
  1922. while ( i-- ) {
  1923. if ( (elem = matcherOut[i]) &&
  1924. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  1925. seed[temp] = !(results[temp] = elem);
  1926. }
  1927. }
  1928. }
  1929. // Add elements to results, through postFinder if defined
  1930. } else {
  1931. matcherOut = condense(
  1932. matcherOut === results ?
  1933. matcherOut.splice( preexisting, matcherOut.length ) :
  1934. matcherOut
  1935. );
  1936. if ( postFinder ) {
  1937. postFinder( null, results, matcherOut, xml );
  1938. } else {
  1939. push.apply( results, matcherOut );
  1940. }
  1941. }
  1942. });
  1943. }
  1944. function matcherFromTokens( tokens ) {
  1945. var checkContext, matcher, j,
  1946. len = tokens.length,
  1947. leadingRelative = Expr.relative[ tokens[0].type ],
  1948. implicitRelative = leadingRelative || Expr.relative[" "],
  1949. i = leadingRelative ? 1 : 0,
  1950. // The foundational matcher ensures that elements are reachable from top-level context(s)
  1951. matchContext = addCombinator( function( elem ) {
  1952. return elem === checkContext;
  1953. }, implicitRelative, true ),
  1954. matchAnyContext = addCombinator( function( elem ) {
  1955. return indexOf( checkContext, elem ) > -1;
  1956. }, implicitRelative, true ),
  1957. matchers = [ function( elem, context, xml ) {
  1958. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  1959. (checkContext = context).nodeType ?
  1960. matchContext( elem, context, xml ) :
  1961. matchAnyContext( elem, context, xml ) );
  1962. // Avoid hanging onto element (issue #299)
  1963. checkContext = null;
  1964. return ret;
  1965. } ];
  1966. for ( ; i < len; i++ ) {
  1967. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  1968. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  1969. } else {
  1970. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  1971. // Return special upon seeing a positional matcher
  1972. if ( matcher[ expando ] ) {
  1973. // Find the next relative operator (if any) for proper handling
  1974. j = ++i;
  1975. for ( ; j < len; j++ ) {
  1976. if ( Expr.relative[ tokens[j].type ] ) {
  1977. break;
  1978. }
  1979. }
  1980. return setMatcher(
  1981. i > 1 && elementMatcher( matchers ),
  1982. i > 1 && toSelector(
  1983. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  1984. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  1985. ).replace( rtrim, "$1" ),
  1986. matcher,
  1987. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  1988. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  1989. j < len && toSelector( tokens )
  1990. );
  1991. }
  1992. matchers.push( matcher );
  1993. }
  1994. }
  1995. return elementMatcher( matchers );
  1996. }
  1997. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  1998. var bySet = setMatchers.length > 0,
  1999. byElement = elementMatchers.length > 0,
  2000. superMatcher = function( seed, context, xml, results, outermost ) {
  2001. var elem, j, matcher,
  2002. matchedCount = 0,
  2003. i = "0",
  2004. unmatched = seed && [],
  2005. setMatched = [],
  2006. contextBackup = outermostContext,
  2007. // We must always have either seed elements or outermost context
  2008. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  2009. // Use integer dirruns iff this is the outermost matcher
  2010. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  2011. len = elems.length;
  2012. if ( outermost ) {
  2013. outermostContext = context !== document && context;
  2014. }
  2015. // Add elements passing elementMatchers directly to results
  2016. // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
  2017. // Support: IE<9, Safari
  2018. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  2019. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  2020. if ( byElement && elem ) {
  2021. j = 0;
  2022. while ( (matcher = elementMatchers[j++]) ) {
  2023. if ( matcher( elem, context, xml ) ) {
  2024. results.push( elem );
  2025. break;
  2026. }
  2027. }
  2028. if ( outermost ) {
  2029. dirruns = dirrunsUnique;
  2030. }
  2031. }
  2032. // Track unmatched elements for set filters
  2033. if ( bySet ) {
  2034. // They will have gone through all possible matchers
  2035. if ( (elem = !matcher && elem) ) {
  2036. matchedCount--;
  2037. }
  2038. // Lengthen the array for every element, matched or not
  2039. if ( seed ) {
  2040. unmatched.push( elem );
  2041. }
  2042. }
  2043. }
  2044. // Apply set filters to unmatched elements
  2045. matchedCount += i;
  2046. if ( bySet && i !== matchedCount ) {
  2047. j = 0;
  2048. while ( (matcher = setMatchers[j++]) ) {
  2049. matcher( unmatched, setMatched, context, xml );
  2050. }
  2051. if ( seed ) {
  2052. // Reintegrate element matches to eliminate the need for sorting
  2053. if ( matchedCount > 0 ) {
  2054. while ( i-- ) {
  2055. if ( !(unmatched[i] || setMatched[i]) ) {
  2056. setMatched[i] = pop.call( results );
  2057. }
  2058. }
  2059. }
  2060. // Discard index placeholder values to get only actual matches
  2061. setMatched = condense( setMatched );
  2062. }
  2063. // Add matches to results
  2064. push.apply( results, setMatched );
  2065. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2066. if ( outermost && !seed && setMatched.length > 0 &&
  2067. ( matchedCount + setMatchers.length ) > 1 ) {
  2068. Sizzle.uniqueSort( results );
  2069. }
  2070. }
  2071. // Override manipulation of globals by nested matchers
  2072. if ( outermost ) {
  2073. dirruns = dirrunsUnique;
  2074. outermostContext = contextBackup;
  2075. }
  2076. return unmatched;
  2077. };
  2078. return bySet ?
  2079. markFunction( superMatcher ) :
  2080. superMatcher;
  2081. }
  2082. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  2083. var i,
  2084. setMatchers = [],
  2085. elementMatchers = [],
  2086. cached = compilerCache[ selector + " " ];
  2087. if ( !cached ) {
  2088. // Generate a function of recursive functions that can be used to check each element
  2089. if ( !match ) {
  2090. match = tokenize( selector );
  2091. }
  2092. i = match.length;
  2093. while ( i-- ) {
  2094. cached = matcherFromTokens( match[i] );
  2095. if ( cached[ expando ] ) {
  2096. setMatchers.push( cached );
  2097. } else {
  2098. elementMatchers.push( cached );
  2099. }
  2100. }
  2101. // Cache the compiled function
  2102. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  2103. // Save selector and tokenization
  2104. cached.selector = selector;
  2105. }
  2106. return cached;
  2107. };
  2108. /**
  2109. * A low-level selection function that works with Sizzle's compiled
  2110. * selector functions
  2111. * @param {String|Function} selector A selector or a pre-compiled
  2112. * selector function built with Sizzle.compile
  2113. * @param {Element} context
  2114. * @param {Array} [results]
  2115. * @param {Array} [seed] A set of elements to match against
  2116. */
  2117. select = Sizzle.select = function( selector, context, results, seed ) {
  2118. var i, tokens, token, type, find,
  2119. compiled = typeof selector === "function" && selector,
  2120. match = !seed && tokenize( (selector = compiled.selector || selector) );
  2121. results = results || [];
  2122. // Try to minimize operations if there is no seed and only one group
  2123. if ( match.length === 1 ) {
  2124. // Take a shortcut and set the context if the root selector is an ID
  2125. tokens = match[0] = match[0].slice( 0 );
  2126. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  2127. support.getById && context.nodeType === 9 && documentIsHTML &&
  2128. Expr.relative[ tokens[1].type ] ) {
  2129. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  2130. if ( !context ) {
  2131. return results;
  2132. // Precompiled matchers will still verify ancestry, so step up a level
  2133. } else if ( compiled ) {
  2134. context = context.parentNode;
  2135. }
  2136. selector = selector.slice( tokens.shift().value.length );
  2137. }
  2138. // Fetch a seed set for right-to-left matching
  2139. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  2140. while ( i-- ) {
  2141. token = tokens[i];
  2142. // Abort if we hit a combinator
  2143. if ( Expr.relative[ (type = token.type) ] ) {
  2144. break;
  2145. }
  2146. if ( (find = Expr.find[ type ]) ) {
  2147. // Search, expanding context for leading sibling combinators
  2148. if ( (seed = find(
  2149. token.matches[0].replace( runescape, funescape ),
  2150. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  2151. )) ) {
  2152. // If seed is empty or no tokens remain, we can return early
  2153. tokens.splice( i, 1 );
  2154. selector = seed.length && toSelector( tokens );
  2155. if ( !selector ) {
  2156. push.apply( results, seed );
  2157. return results;
  2158. }
  2159. break;
  2160. }
  2161. }
  2162. }
  2163. }
  2164. // Compile and execute a filtering function if one is not provided
  2165. // Provide `match` to avoid retokenization if we modified the selector above
  2166. ( compiled || compile( selector, match ) )(
  2167. seed,
  2168. context,
  2169. !documentIsHTML,
  2170. results,
  2171. rsibling.test( selector ) && testContext( context.parentNode ) || context
  2172. );
  2173. return results;
  2174. };
  2175. // One-time assignments
  2176. // Sort stability
  2177. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  2178. // Support: Chrome 14-35+
  2179. // Always assume duplicates if they aren't passed to the comparison function
  2180. support.detectDuplicates = !!hasDuplicate;
  2181. // Initialize against the default document
  2182. setDocument();
  2183. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  2184. // Detached nodes confoundingly follow *each other*
  2185. support.sortDetached = assert(function( div1 ) {
  2186. // Should return 1, but returns 4 (following)
  2187. return div1.compareDocumentPosition( document.createElement("div") ) & 1;
  2188. });
  2189. // Support: IE<8
  2190. // Prevent attribute/property "interpolation"
  2191. // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  2192. if ( !assert(function( div ) {
  2193. div.innerHTML = "<a href='#'></a>";
  2194. return div.firstChild.getAttribute("href") === "#" ;
  2195. }) ) {
  2196. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  2197. if ( !isXML ) {
  2198. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  2199. }
  2200. });
  2201. }
  2202. // Support: IE<9
  2203. // Use defaultValue in place of getAttribute("value")
  2204. if ( !support.attributes || !assert(function( div ) {
  2205. div.innerHTML = "<input/>";
  2206. div.firstChild.setAttribute( "value", "" );
  2207. return div.firstChild.getAttribute( "value" ) === "";
  2208. }) ) {
  2209. addHandle( "value", function( elem, name, isXML ) {
  2210. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  2211. return elem.defaultValue;
  2212. }
  2213. });
  2214. }
  2215. // Support: IE<9
  2216. // Use getAttributeNode to fetch booleans when getAttribute lies
  2217. if ( !assert(function( div ) {
  2218. return div.getAttribute("disabled") == null;
  2219. }) ) {
  2220. addHandle( booleans, function( elem, name, isXML ) {
  2221. var val;
  2222. if ( !isXML ) {
  2223. return elem[ name ] === true ? name.toLowerCase() :
  2224. (val = elem.getAttributeNode( name )) && val.specified ?
  2225. val.value :
  2226. null;
  2227. }
  2228. });
  2229. }
  2230. return Sizzle;
  2231. })( window );
  2232. jQuery.find = Sizzle;
  2233. jQuery.expr = Sizzle.selectors;
  2234. jQuery.expr[":"] = jQuery.expr.pseudos;
  2235. jQuery.unique = Sizzle.uniqueSort;
  2236. jQuery.text = Sizzle.getText;
  2237. jQuery.isXMLDoc = Sizzle.isXML;
  2238. jQuery.contains = Sizzle.contains;
  2239. var rneedsContext = jQuery.expr.match.needsContext;
  2240. var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
  2241. var risSimple = /^.[^:#\[\.,]*$/;
  2242. // Implement the identical functionality for filter and not
  2243. function winnow( elements, qualifier, not ) {
  2244. if ( jQuery.isFunction( qualifier ) ) {
  2245. return jQuery.grep( elements, function( elem, i ) {
  2246. /* jshint -W018 */
  2247. return !!qualifier.call( elem, i, elem ) !== not;
  2248. });
  2249. }
  2250. if ( qualifier.nodeType ) {
  2251. return jQuery.grep( elements, function( elem ) {
  2252. return ( elem === qualifier ) !== not;
  2253. });
  2254. }
  2255. if ( typeof qualifier === "string" ) {
  2256. if ( risSimple.test( qualifier ) ) {
  2257. return jQuery.filter( qualifier, elements, not );
  2258. }
  2259. qualifier = jQuery.filter( qualifier, elements );
  2260. }
  2261. return jQuery.grep( elements, function( elem ) {
  2262. return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
  2263. });
  2264. }
  2265. jQuery.filter = function( expr, elems, not ) {
  2266. var elem = elems[ 0 ];
  2267. if ( not ) {
  2268. expr = ":not(" + expr + ")";
  2269. }
  2270. return elems.length === 1 && elem.nodeType === 1 ?
  2271. jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
  2272. jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2273. return elem.nodeType === 1;
  2274. }));
  2275. };
  2276. jQuery.fn.extend({
  2277. find: function( selector ) {
  2278. var i,
  2279. ret = [],
  2280. self = this,
  2281. len = self.length;
  2282. if ( typeof selector !== "string" ) {
  2283. return this.pushStack( jQuery( selector ).filter(function() {
  2284. for ( i = 0; i < len; i++ ) {
  2285. if ( jQuery.contains( self[ i ], this ) ) {
  2286. return true;
  2287. }
  2288. }
  2289. }) );
  2290. }
  2291. for ( i = 0; i < len; i++ ) {
  2292. jQuery.find( selector, self[ i ], ret );
  2293. }
  2294. // Needed because $( selector, context ) becomes $( context ).find( selector )
  2295. ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
  2296. ret.selector = this.selector ? this.selector + " " + selector : selector;
  2297. return ret;
  2298. },
  2299. filter: function( selector ) {
  2300. return this.pushStack( winnow(this, selector || [], false) );
  2301. },
  2302. not: function( selector ) {
  2303. return this.pushStack( winnow(this, selector || [], true) );
  2304. },
  2305. is: function( selector ) {
  2306. return !!winnow(
  2307. this,
  2308. // If this is a positional/relative selector, check membership in the returned set
  2309. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2310. typeof selector === "string" && rneedsContext.test( selector ) ?
  2311. jQuery( selector ) :
  2312. selector || [],
  2313. false
  2314. ).length;
  2315. }
  2316. });
  2317. // Initialize a jQuery object
  2318. // A central reference to the root jQuery(document)
  2319. var rootjQuery,
  2320. // Use the correct document accordingly with window argument (sandbox)
  2321. document = window.document,
  2322. // A simple way to check for HTML strings
  2323. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  2324. // Strict HTML recognition (#11290: must start with <)
  2325. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
  2326. init = jQuery.fn.init = function( selector, context ) {
  2327. var match, elem;
  2328. // HANDLE: $(""), $(null), $(undefined), $(false)
  2329. if ( !selector ) {
  2330. return this;
  2331. }
  2332. // Handle HTML strings
  2333. if ( typeof selector === "string" ) {
  2334. if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
  2335. // Assume that strings that start and end with <> are HTML and skip the regex check
  2336. match = [ null, selector, null ];
  2337. } else {
  2338. match = rquickExpr.exec( selector );
  2339. }
  2340. // Match html or make sure no context is specified for #id
  2341. if ( match && (match[1] || !context) ) {
  2342. // HANDLE: $(html) -> $(array)
  2343. if ( match[1] ) {
  2344. context = context instanceof jQuery ? context[0] : context;
  2345. // scripts is true for back-compat
  2346. // Intentionally let the error be thrown if parseHTML is not present
  2347. jQuery.merge( this, jQuery.parseHTML(
  2348. match[1],
  2349. context && context.nodeType ? context.ownerDocument || context : document,
  2350. true
  2351. ) );
  2352. // HANDLE: $(html, props)
  2353. if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
  2354. for ( match in context ) {
  2355. // Properties of context are called as methods if possible
  2356. if ( jQuery.isFunction( this[ match ] ) ) {
  2357. this[ match ]( context[ match ] );
  2358. // ...and otherwise set as attributes
  2359. } else {
  2360. this.attr( match, context[ match ] );
  2361. }
  2362. }
  2363. }
  2364. return this;
  2365. // HANDLE: $(#id)
  2366. } else {
  2367. elem = document.getElementById( match[2] );
  2368. // Check parentNode to catch when Blackberry 4.6 returns
  2369. // nodes that are no longer in the document #6963
  2370. if ( elem && elem.parentNode ) {
  2371. // Handle the case where IE and Opera return items
  2372. // by name instead of ID
  2373. if ( elem.id !== match[2] ) {
  2374. return rootjQuery.find( selector );
  2375. }
  2376. // Otherwise, we inject the element directly into the jQuery object
  2377. this.length = 1;
  2378. this[0] = elem;
  2379. }
  2380. this.context = document;
  2381. this.selector = selector;
  2382. return this;
  2383. }
  2384. // HANDLE: $(expr, $(...))
  2385. } else if ( !context || context.jquery ) {
  2386. return ( context || rootjQuery ).find( selector );
  2387. // HANDLE: $(expr, context)
  2388. // (which is just equivalent to: $(context).find(expr)
  2389. } else {
  2390. return this.constructor( context ).find( selector );
  2391. }
  2392. // HANDLE: $(DOMElement)
  2393. } else if ( selector.nodeType ) {
  2394. this.context = this[0] = selector;
  2395. this.length = 1;
  2396. return this;
  2397. // HANDLE: $(function)
  2398. // Shortcut for document ready
  2399. } else if ( jQuery.isFunction( selector ) ) {
  2400. return typeof rootjQuery.ready !== "undefined" ?
  2401. rootjQuery.ready( selector ) :
  2402. // Execute immediately if ready is not present
  2403. selector( jQuery );
  2404. }
  2405. if ( selector.selector !== undefined ) {
  2406. this.selector = selector.selector;
  2407. this.context = selector.context;
  2408. }
  2409. return jQuery.makeArray( selector, this );
  2410. };
  2411. // Give the init function the jQuery prototype for later instantiation
  2412. init.prototype = jQuery.fn;
  2413. // Initialize central reference
  2414. rootjQuery = jQuery( document );
  2415. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  2416. // methods guaranteed to produce a unique set when starting from a unique set
  2417. guaranteedUnique = {
  2418. children: true,
  2419. contents: true,
  2420. next: true,
  2421. prev: true
  2422. };
  2423. jQuery.extend({
  2424. dir: function( elem, dir, until ) {
  2425. var matched = [],
  2426. cur = elem[ dir ];
  2427. while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
  2428. if ( cur.nodeType === 1 ) {
  2429. matched.push( cur );
  2430. }
  2431. cur = cur[dir];
  2432. }
  2433. return matched;
  2434. },
  2435. sibling: function( n, elem ) {
  2436. var r = [];
  2437. for ( ; n; n = n.nextSibling ) {
  2438. if ( n.nodeType === 1 && n !== elem ) {
  2439. r.push( n );
  2440. }
  2441. }
  2442. return r;
  2443. }
  2444. });
  2445. jQuery.fn.extend({
  2446. has: function( target ) {
  2447. var i,
  2448. targets = jQuery( target, this ),
  2449. len = targets.length;
  2450. return this.filter(function() {
  2451. for ( i = 0; i < len; i++ ) {
  2452. if ( jQuery.contains( this, targets[i] ) ) {
  2453. return true;
  2454. }
  2455. }
  2456. });
  2457. },
  2458. closest: function( selectors, context ) {
  2459. var cur,
  2460. i = 0,
  2461. l = this.length,
  2462. matched = [],
  2463. pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
  2464. jQuery( selectors, context || this.context ) :
  2465. 0;
  2466. for ( ; i < l; i++ ) {
  2467. for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
  2468. // Always skip document fragments
  2469. if ( cur.nodeType < 11 && (pos ?
  2470. pos.index(cur) > -1 :
  2471. // Don't pass non-elements to Sizzle
  2472. cur.nodeType === 1 &&
  2473. jQuery.find.matchesSelector(cur, selectors)) ) {
  2474. matched.push( cur );
  2475. break;
  2476. }
  2477. }
  2478. }
  2479. return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
  2480. },
  2481. // Determine the position of an element within
  2482. // the matched set of elements
  2483. index: function( elem ) {
  2484. // No argument, return index in parent
  2485. if ( !elem ) {
  2486. return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
  2487. }
  2488. // index in selector
  2489. if ( typeof elem === "string" ) {
  2490. return jQuery.inArray( this[0], jQuery( elem ) );
  2491. }
  2492. // Locate the position of the desired element
  2493. return jQuery.inArray(
  2494. // If it receives a jQuery object, the first element is used
  2495. elem.jquery ? elem[0] : elem, this );
  2496. },
  2497. add: function( selector, context ) {
  2498. return this.pushStack(
  2499. jQuery.unique(
  2500. jQuery.merge( this.get(), jQuery( selector, context ) )
  2501. )
  2502. );
  2503. },
  2504. addBack: function( selector ) {
  2505. return this.add( selector == null ?
  2506. this.prevObject : this.prevObject.filter(selector)
  2507. );
  2508. }
  2509. });
  2510. function sibling( cur, dir ) {
  2511. do {
  2512. cur = cur[ dir ];
  2513. } while ( cur && cur.nodeType !== 1 );
  2514. return cur;
  2515. }
  2516. jQuery.each({
  2517. parent: function( elem ) {
  2518. var parent = elem.parentNode;
  2519. return parent && parent.nodeType !== 11 ? parent : null;
  2520. },
  2521. parents: function( elem ) {
  2522. return jQuery.dir( elem, "parentNode" );
  2523. },
  2524. parentsUntil: function( elem, i, until ) {
  2525. return jQuery.dir( elem, "parentNode", until );
  2526. },
  2527. next: function( elem ) {
  2528. return sibling( elem, "nextSibling" );
  2529. },
  2530. prev: function( elem ) {
  2531. return sibling( elem, "previousSibling" );
  2532. },
  2533. nextAll: function( elem ) {
  2534. return jQuery.dir( elem, "nextSibling" );
  2535. },
  2536. prevAll: function( elem ) {
  2537. return jQuery.dir( elem, "previousSibling" );
  2538. },
  2539. nextUntil: function( elem, i, until ) {
  2540. return jQuery.dir( elem, "nextSibling", until );
  2541. },
  2542. prevUntil: function( elem, i, until ) {
  2543. return jQuery.dir( elem, "previousSibling", until );
  2544. },
  2545. siblings: function( elem ) {
  2546. return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
  2547. },
  2548. children: function( elem ) {
  2549. return jQuery.sibling( elem.firstChild );
  2550. },
  2551. contents: function( elem ) {
  2552. return jQuery.nodeName( elem, "iframe" ) ?
  2553. elem.contentDocument || elem.contentWindow.document :
  2554. jQuery.merge( [], elem.childNodes );
  2555. }
  2556. }, function( name, fn ) {
  2557. jQuery.fn[ name ] = function( until, selector ) {
  2558. var ret = jQuery.map( this, fn, until );
  2559. if ( name.slice( -5 ) !== "Until" ) {
  2560. selector = until;
  2561. }
  2562. if ( selector && typeof selector === "string" ) {
  2563. ret = jQuery.filter( selector, ret );
  2564. }
  2565. if ( this.length > 1 ) {
  2566. // Remove duplicates
  2567. if ( !guaranteedUnique[ name ] ) {
  2568. ret = jQuery.unique( ret );
  2569. }
  2570. // Reverse order for parents* and prev-derivatives
  2571. if ( rparentsprev.test( name ) ) {
  2572. ret = ret.reverse();
  2573. }
  2574. }
  2575. return this.pushStack( ret );
  2576. };
  2577. });
  2578. var rnotwhite = (/\S+/g);
  2579. // String to Object options format cache
  2580. var optionsCache = {};
  2581. // Convert String-formatted options into Object-formatted ones and store in cache
  2582. function createOptions( options ) {
  2583. var object = optionsCache[ options ] = {};
  2584. jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
  2585. object[ flag ] = true;
  2586. });
  2587. return object;
  2588. }
  2589. /*
  2590. * Create a callback list using the following parameters:
  2591. *
  2592. * options: an optional list of space-separated options that will change how
  2593. * the callback list behaves or a more traditional option object
  2594. *
  2595. * By default a callback list will act like an event callback list and can be
  2596. * "fired" multiple times.
  2597. *
  2598. * Possible options:
  2599. *
  2600. * once: will ensure the callback list can only be fired once (like a Deferred)
  2601. *
  2602. * memory: will keep track of previous values and will call any callback added
  2603. * after the list has been fired right away with the latest "memorized"
  2604. * values (like a Deferred)
  2605. *
  2606. * unique: will ensure a callback can only be added once (no duplicate in the list)
  2607. *
  2608. * stopOnFalse: interrupt callings when a callback returns false
  2609. *
  2610. */
  2611. jQuery.Callbacks = function( options ) {
  2612. // Convert options from String-formatted to Object-formatted if needed
  2613. // (we check in cache first)
  2614. options = typeof options === "string" ?
  2615. ( optionsCache[ options ] || createOptions( options ) ) :
  2616. jQuery.extend( {}, options );
  2617. var // Flag to know if list is currently firing
  2618. firing,
  2619. // Last fire value (for non-forgettable lists)
  2620. memory,
  2621. // Flag to know if list was already fired
  2622. fired,
  2623. // End of the loop when firing
  2624. firingLength,
  2625. // Index of currently firing callback (modified by remove if needed)
  2626. firingIndex,
  2627. // First callback to fire (used internally by add and fireWith)
  2628. firingStart,
  2629. // Actual callback list
  2630. list = [],
  2631. // Stack of fire calls for repeatable lists
  2632. stack = !options.once && [],
  2633. // Fire callbacks
  2634. fire = function( data ) {
  2635. memory = options.memory && data;
  2636. fired = true;
  2637. firingIndex = firingStart || 0;
  2638. firingStart = 0;
  2639. firingLength = list.length;
  2640. firing = true;
  2641. for ( ; list && firingIndex < firingLength; firingIndex++ ) {
  2642. if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
  2643. memory = false; // To prevent further calls using add
  2644. break;
  2645. }
  2646. }
  2647. firing = false;
  2648. if ( list ) {
  2649. if ( stack ) {
  2650. if ( stack.length ) {
  2651. fire( stack.shift() );
  2652. }
  2653. } else if ( memory ) {
  2654. list = [];
  2655. } else {
  2656. self.disable();
  2657. }
  2658. }
  2659. },
  2660. // Actual Callbacks object
  2661. self = {
  2662. // Add a callback or a collection of callbacks to the list
  2663. add: function() {
  2664. if ( list ) {
  2665. // First, we save the current length
  2666. var start = list.length;
  2667. (function add( args ) {
  2668. jQuery.each( args, function( _, arg ) {
  2669. var type = jQuery.type( arg );
  2670. if ( type === "function" ) {
  2671. if ( !options.unique || !self.has( arg ) ) {
  2672. list.push( arg );
  2673. }
  2674. } else if ( arg && arg.length && type !== "string" ) {
  2675. // Inspect recursively
  2676. add( arg );
  2677. }
  2678. });
  2679. })( arguments );
  2680. // Do we need to add the callbacks to the
  2681. // current firing batch?
  2682. if ( firing ) {
  2683. firingLength = list.length;
  2684. // With memory, if we're not firing then
  2685. // we should call right away
  2686. } else if ( memory ) {
  2687. firingStart = start;
  2688. fire( memory );
  2689. }
  2690. }
  2691. return this;
  2692. },
  2693. // Remove a callback from the list
  2694. remove: function() {
  2695. if ( list ) {
  2696. jQuery.each( arguments, function( _, arg ) {
  2697. var index;
  2698. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  2699. list.splice( index, 1 );
  2700. // Handle firing indexes
  2701. if ( firing ) {
  2702. if ( index <= firingLength ) {
  2703. firingLength--;
  2704. }
  2705. if ( index <= firingIndex ) {
  2706. firingIndex--;
  2707. }
  2708. }
  2709. }
  2710. });
  2711. }
  2712. return this;
  2713. },
  2714. // Check if a given callback is in the list.
  2715. // If no argument is given, return whether or not list has callbacks attached.
  2716. has: function( fn ) {
  2717. return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
  2718. },
  2719. // Remove all callbacks from the list
  2720. empty: function() {
  2721. list = [];
  2722. firingLength = 0;
  2723. return this;
  2724. },
  2725. // Have the list do nothing anymore
  2726. disable: function() {
  2727. list = stack = memory = undefined;
  2728. return this;
  2729. },
  2730. // Is it disabled?
  2731. disabled: function() {
  2732. return !list;
  2733. },
  2734. // Lock the list in its current state
  2735. lock: function() {
  2736. stack = undefined;
  2737. if ( !memory ) {
  2738. self.disable();
  2739. }
  2740. return this;
  2741. },
  2742. // Is it locked?
  2743. locked: function() {
  2744. return !stack;
  2745. },
  2746. // Call all callbacks with the given context and arguments
  2747. fireWith: function( context, args ) {
  2748. if ( list && ( !fired || stack ) ) {
  2749. args = args || [];
  2750. args = [ context, args.slice ? args.slice() : args ];
  2751. if ( firing ) {
  2752. stack.push( args );
  2753. } else {
  2754. fire( args );
  2755. }
  2756. }
  2757. return this;
  2758. },
  2759. // Call all the callbacks with the given arguments
  2760. fire: function() {
  2761. self.fireWith( this, arguments );
  2762. return this;
  2763. },
  2764. // To know if the callbacks have already been called at least once
  2765. fired: function() {
  2766. return !!fired;
  2767. }
  2768. };
  2769. return self;
  2770. };
  2771. jQuery.extend({
  2772. Deferred: function( func ) {
  2773. var tuples = [
  2774. // action, add listener, listener list, final state
  2775. [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
  2776. [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
  2777. [ "notify", "progress", jQuery.Callbacks("memory") ]
  2778. ],
  2779. state = "pending",
  2780. promise = {
  2781. state: function() {
  2782. return state;
  2783. },
  2784. always: function() {
  2785. deferred.done( arguments ).fail( arguments );
  2786. return this;
  2787. },
  2788. then: function( /* fnDone, fnFail, fnProgress */ ) {
  2789. var fns = arguments;
  2790. return jQuery.Deferred(function( newDefer ) {
  2791. jQuery.each( tuples, function( i, tuple ) {
  2792. var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
  2793. // deferred[ done | fail | progress ] for forwarding actions to newDefer
  2794. deferred[ tuple[1] ](function() {
  2795. var returned = fn && fn.apply( this, arguments );
  2796. if ( returned && jQuery.isFunction( returned.promise ) ) {
  2797. returned.promise()
  2798. .done( newDefer.resolve )
  2799. .fail( newDefer.reject )
  2800. .progress( newDefer.notify );
  2801. } else {
  2802. newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
  2803. }
  2804. });
  2805. });
  2806. fns = null;
  2807. }).promise();
  2808. },
  2809. // Get a promise for this deferred
  2810. // If obj is provided, the promise aspect is added to the object
  2811. promise: function( obj ) {
  2812. return obj != null ? jQuery.extend( obj, promise ) : promise;
  2813. }
  2814. },
  2815. deferred = {};
  2816. // Keep pipe for back-compat
  2817. promise.pipe = promise.then;
  2818. // Add list-specific methods
  2819. jQuery.each( tuples, function( i, tuple ) {
  2820. var list = tuple[ 2 ],
  2821. stateString = tuple[ 3 ];
  2822. // promise[ done | fail | progress ] = list.add
  2823. promise[ tuple[1] ] = list.add;
  2824. // Handle state
  2825. if ( stateString ) {
  2826. list.add(function() {
  2827. // state = [ resolved | rejected ]
  2828. state = stateString;
  2829. // [ reject_list | resolve_list ].disable; progress_list.lock
  2830. }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
  2831. }
  2832. // deferred[ resolve | reject | notify ]
  2833. deferred[ tuple[0] ] = function() {
  2834. deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
  2835. return this;
  2836. };
  2837. deferred[ tuple[0] + "With" ] = list.fireWith;
  2838. });
  2839. // Make the deferred a promise
  2840. promise.promise( deferred );
  2841. // Call given func if any
  2842. if ( func ) {
  2843. func.call( deferred, deferred );
  2844. }
  2845. // All done!
  2846. return deferred;
  2847. },
  2848. // Deferred helper
  2849. when: function( subordinate /* , ..., subordinateN */ ) {
  2850. var i = 0,
  2851. resolveValues = slice.call( arguments ),
  2852. length = resolveValues.length,
  2853. // the count of uncompleted subordinates
  2854. remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
  2855. // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
  2856. deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
  2857. // Update function for both resolve and progress values
  2858. updateFunc = function( i, contexts, values ) {
  2859. return function( value ) {
  2860. contexts[ i ] = this;
  2861. values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  2862. if ( values === progressValues ) {
  2863. deferred.notifyWith( contexts, values );
  2864. } else if ( !(--remaining) ) {
  2865. deferred.resolveWith( contexts, values );
  2866. }
  2867. };
  2868. },
  2869. progressValues, progressContexts, resolveContexts;
  2870. // add listeners to Deferred subordinates; treat others as resolved
  2871. if ( length > 1 ) {
  2872. progressValues = new Array( length );
  2873. progressContexts = new Array( length );
  2874. resolveContexts = new Array( length );
  2875. for ( ; i < length; i++ ) {
  2876. if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
  2877. resolveValues[ i ].promise()
  2878. .done( updateFunc( i, resolveContexts, resolveValues ) )
  2879. .fail( deferred.reject )
  2880. .progress( updateFunc( i, progressContexts, progressValues ) );
  2881. } else {
  2882. --remaining;
  2883. }
  2884. }
  2885. }
  2886. // if we're not waiting on anything, resolve the master
  2887. if ( !remaining ) {
  2888. deferred.resolveWith( resolveContexts, resolveValues );
  2889. }
  2890. return deferred.promise();
  2891. }
  2892. });
  2893. // The deferred used on DOM ready
  2894. var readyList;
  2895. jQuery.fn.ready = function( fn ) {
  2896. // Add the callback
  2897. jQuery.ready.promise().done( fn );
  2898. return this;
  2899. };
  2900. jQuery.extend({
  2901. // Is the DOM ready to be used? Set to true once it occurs.
  2902. isReady: false,
  2903. // A counter to track how many items to wait for before
  2904. // the ready event fires. See #6781
  2905. readyWait: 1,
  2906. // Hold (or release) the ready event
  2907. holdReady: function( hold ) {
  2908. if ( hold ) {
  2909. jQuery.readyWait++;
  2910. } else {
  2911. jQuery.ready( true );
  2912. }
  2913. },
  2914. // Handle when the DOM is ready
  2915. ready: function( wait ) {
  2916. // Abort if there are pending holds or we're already ready
  2917. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  2918. return;
  2919. }
  2920. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  2921. if ( !document.body ) {
  2922. return setTimeout( jQuery.ready );
  2923. }
  2924. // Remember that the DOM is ready
  2925. jQuery.isReady = true;
  2926. // If a normal DOM Ready event fired, decrement, and wait if need be
  2927. if ( wait !== true && --jQuery.readyWait > 0 ) {
  2928. return;
  2929. }
  2930. // If there are functions bound, to execute
  2931. readyList.resolveWith( document, [ jQuery ] );
  2932. // Trigger any bound ready events
  2933. if ( jQuery.fn.triggerHandler ) {
  2934. jQuery( document ).triggerHandler( "ready" );
  2935. jQuery( document ).off( "ready" );
  2936. }
  2937. }
  2938. });
  2939. /**
  2940. * Clean-up method for dom ready events
  2941. */
  2942. function detach() {
  2943. if ( document.addEventListener ) {
  2944. document.removeEventListener( "DOMContentLoaded", completed, false );
  2945. window.removeEventListener( "load", completed, false );
  2946. } else {
  2947. document.detachEvent( "onreadystatechange", completed );
  2948. window.detachEvent( "onload", completed );
  2949. }
  2950. }
  2951. /**
  2952. * The ready event handler and self cleanup method
  2953. */
  2954. function completed() {
  2955. // readyState === "complete" is good enough for us to call the dom ready in oldIE
  2956. if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
  2957. detach();
  2958. jQuery.ready();
  2959. }
  2960. }
  2961. jQuery.ready.promise = function( obj ) {
  2962. if ( !readyList ) {
  2963. readyList = jQuery.Deferred();
  2964. // Catch cases where $(document).ready() is called after the browser event has already occurred.
  2965. // we once tried to use readyState "interactive" here, but it caused issues like the one
  2966. // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
  2967. if ( document.readyState === "complete" ) {
  2968. // Handle it asynchronously to allow scripts the opportunity to delay ready
  2969. setTimeout( jQuery.ready );
  2970. // Standards-based browsers support DOMContentLoaded
  2971. } else if ( document.addEventListener ) {
  2972. // Use the handy event callback
  2973. document.addEventListener( "DOMContentLoaded", completed, false );
  2974. // A fallback to window.onload, that will always work
  2975. window.addEventListener( "load", completed, false );
  2976. // If IE event model is used
  2977. } else {
  2978. // Ensure firing before onload, maybe late but safe also for iframes
  2979. document.attachEvent( "onreadystatechange", completed );
  2980. // A fallback to window.onload, that will always work
  2981. window.attachEvent( "onload", completed );
  2982. // If IE and not a frame
  2983. // continually check to see if the document is ready
  2984. var top = false;
  2985. try {
  2986. top = window.frameElement == null && document.documentElement;
  2987. } catch(e) {}
  2988. if ( top && top.doScroll ) {
  2989. (function doScrollCheck() {
  2990. if ( !jQuery.isReady ) {
  2991. try {
  2992. // Use the trick by Diego Perini
  2993. // http://javascript.nwbox.com/IEContentLoaded/
  2994. top.doScroll("left");
  2995. } catch(e) {
  2996. return setTimeout( doScrollCheck, 50 );
  2997. }
  2998. // detach all dom ready events
  2999. detach();
  3000. // and execute any waiting functions
  3001. jQuery.ready();
  3002. }
  3003. })();
  3004. }
  3005. }
  3006. }
  3007. return readyList.promise( obj );
  3008. };
  3009. var strundefined = typeof undefined;
  3010. // Support: IE<9
  3011. // Iteration over object's inherited properties before its own
  3012. var i;
  3013. for ( i in jQuery( support ) ) {
  3014. break;
  3015. }
  3016. support.ownLast = i !== "0";
  3017. // Note: most support tests are defined in their respective modules.
  3018. // false until the test is run
  3019. support.inlineBlockNeedsLayout = false;
  3020. // Execute ASAP in case we need to set body.style.zoom
  3021. jQuery(function() {
  3022. // Minified: var a,b,c,d
  3023. var val, div, body, container;
  3024. body = document.getElementsByTagName( "body" )[ 0 ];
  3025. if ( !body || !body.style ) {
  3026. // Return for frameset docs that don't have a body
  3027. return;
  3028. }
  3029. // Setup
  3030. div = document.createElement( "div" );
  3031. container = document.createElement( "div" );
  3032. container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
  3033. body.appendChild( container ).appendChild( div );
  3034. if ( typeof div.style.zoom !== strundefined ) {
  3035. // Support: IE<8
  3036. // Check if natively block-level elements act like inline-block
  3037. // elements when setting their display to 'inline' and giving
  3038. // them layout
  3039. div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
  3040. support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
  3041. if ( val ) {
  3042. // Prevent IE 6 from affecting layout for positioned elements #11048
  3043. // Prevent IE from shrinking the body in IE 7 mode #12869
  3044. // Support: IE<8
  3045. body.style.zoom = 1;
  3046. }
  3047. }
  3048. body.removeChild( container );
  3049. });
  3050. (function() {
  3051. var div = document.createElement( "div" );
  3052. // Execute the test only if not already executed in another module.
  3053. if (support.deleteExpando == null) {
  3054. // Support: IE<9
  3055. support.deleteExpando = true;
  3056. try {
  3057. delete div.test;
  3058. } catch( e ) {
  3059. support.deleteExpando = false;
  3060. }
  3061. }
  3062. // Null elements to avoid leaks in IE.
  3063. div = null;
  3064. })();
  3065. /**
  3066. * Determines whether an object can have data
  3067. */
  3068. jQuery.acceptData = function( elem ) {
  3069. var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
  3070. nodeType = +elem.nodeType || 1;
  3071. // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
  3072. return nodeType !== 1 && nodeType !== 9 ?
  3073. false :
  3074. // Nodes accept data unless otherwise specified; rejection can be conditional
  3075. !noData || noData !== true && elem.getAttribute("classid") === noData;
  3076. };
  3077. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  3078. rmultiDash = /([A-Z])/g;
  3079. function dataAttr( elem, key, data ) {
  3080. // If nothing was found internally, try to fetch any
  3081. // data from the HTML5 data-* attribute
  3082. if ( data === undefined && elem.nodeType === 1 ) {
  3083. var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
  3084. data = elem.getAttribute( name );
  3085. if ( typeof data === "string" ) {
  3086. try {
  3087. data = data === "true" ? true :
  3088. data === "false" ? false :
  3089. data === "null" ? null :
  3090. // Only convert to a number if it doesn't change the string
  3091. +data + "" === data ? +data :
  3092. rbrace.test( data ) ? jQuery.parseJSON( data ) :
  3093. data;
  3094. } catch( e ) {}
  3095. // Make sure we set the data so it isn't changed later
  3096. jQuery.data( elem, key, data );
  3097. } else {
  3098. data = undefined;
  3099. }
  3100. }
  3101. return data;
  3102. }
  3103. // checks a cache object for emptiness
  3104. function isEmptyDataObject( obj ) {
  3105. var name;
  3106. for ( name in obj ) {
  3107. // if the public data object is empty, the private is still empty
  3108. if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
  3109. continue;
  3110. }
  3111. if ( name !== "toJSON" ) {
  3112. return false;
  3113. }
  3114. }
  3115. return true;
  3116. }
  3117. function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
  3118. if ( !jQuery.acceptData( elem ) ) {
  3119. return;
  3120. }
  3121. var ret, thisCache,
  3122. internalKey = jQuery.expando,
  3123. // We have to handle DOM nodes and JS objects differently because IE6-7
  3124. // can't GC object references properly across the DOM-JS boundary
  3125. isNode = elem.nodeType,
  3126. // Only DOM nodes need the global jQuery cache; JS object data is
  3127. // attached directly to the object so GC can occur automatically
  3128. cache = isNode ? jQuery.cache : elem,
  3129. // Only defining an ID for JS objects if its cache already exists allows
  3130. // the code to shortcut on the same path as a DOM node with no cache
  3131. id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
  3132. // Avoid doing any more work than we need to when trying to get data on an
  3133. // object that has no data at all
  3134. if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
  3135. return;
  3136. }
  3137. if ( !id ) {
  3138. // Only DOM nodes need a new unique ID for each element since their data
  3139. // ends up in the global cache
  3140. if ( isNode ) {
  3141. id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
  3142. } else {
  3143. id = internalKey;
  3144. }
  3145. }
  3146. if ( !cache[ id ] ) {
  3147. // Avoid exposing jQuery metadata on plain JS objects when the object
  3148. // is serialized using JSON.stringify
  3149. cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
  3150. }
  3151. // An object can be passed to jQuery.data instead of a key/value pair; this gets
  3152. // shallow copied over onto the existing cache
  3153. if ( typeof name === "object" || typeof name === "function" ) {
  3154. if ( pvt ) {
  3155. cache[ id ] = jQuery.extend( cache[ id ], name );
  3156. } else {
  3157. cache[ id ].data = jQuery.extend( cache[ id ].data, name );
  3158. }
  3159. }
  3160. thisCache = cache[ id ];
  3161. // jQuery data() is stored in a separate object inside the object's internal data
  3162. // cache in order to avoid key collisions between internal data and user-defined
  3163. // data.
  3164. if ( !pvt ) {
  3165. if ( !thisCache.data ) {
  3166. thisCache.data = {};
  3167. }
  3168. thisCache = thisCache.data;
  3169. }
  3170. if ( data !== undefined ) {
  3171. thisCache[ jQuery.camelCase( name ) ] = data;
  3172. }
  3173. // Check for both converted-to-camel and non-converted data property names
  3174. // If a data property was specified
  3175. if ( typeof name === "string" ) {
  3176. // First Try to find as-is property data
  3177. ret = thisCache[ name ];
  3178. // Test for null|undefined property data
  3179. if ( ret == null ) {
  3180. // Try to find the camelCased property
  3181. ret = thisCache[ jQuery.camelCase( name ) ];
  3182. }
  3183. } else {
  3184. ret = thisCache;
  3185. }
  3186. return ret;
  3187. }
  3188. function internalRemoveData( elem, name, pvt ) {
  3189. if ( !jQuery.acceptData( elem ) ) {
  3190. return;
  3191. }
  3192. var thisCache, i,
  3193. isNode = elem.nodeType,
  3194. // See jQuery.data for more information
  3195. cache = isNode ? jQuery.cache : elem,
  3196. id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
  3197. // If there is already no cache entry for this object, there is no
  3198. // purpose in continuing
  3199. if ( !cache[ id ] ) {
  3200. return;
  3201. }
  3202. if ( name ) {
  3203. thisCache = pvt ? cache[ id ] : cache[ id ].data;
  3204. if ( thisCache ) {
  3205. // Support array or space separated string names for data keys
  3206. if ( !jQuery.isArray( name ) ) {
  3207. // try the string as a key before any manipulation
  3208. if ( name in thisCache ) {
  3209. name = [ name ];
  3210. } else {
  3211. // split the camel cased version by spaces unless a key with the spaces exists
  3212. name = jQuery.camelCase( name );
  3213. if ( name in thisCache ) {
  3214. name = [ name ];
  3215. } else {
  3216. name = name.split(" ");
  3217. }
  3218. }
  3219. } else {
  3220. // If "name" is an array of keys...
  3221. // When data is initially created, via ("key", "val") signature,
  3222. // keys will be converted to camelCase.
  3223. // Since there is no way to tell _how_ a key was added, remove
  3224. // both plain key and camelCase key. #12786
  3225. // This will only penalize the array argument path.
  3226. name = name.concat( jQuery.map( name, jQuery.camelCase ) );
  3227. }
  3228. i = name.length;
  3229. while ( i-- ) {
  3230. delete thisCache[ name[i] ];
  3231. }
  3232. // If there is no data left in the cache, we want to continue
  3233. // and let the cache object itself get destroyed
  3234. if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
  3235. return;
  3236. }
  3237. }
  3238. }
  3239. // See jQuery.data for more information
  3240. if ( !pvt ) {
  3241. delete cache[ id ].data;
  3242. // Don't destroy the parent cache unless the internal data object
  3243. // had been the only thing left in it
  3244. if ( !isEmptyDataObject( cache[ id ] ) ) {
  3245. return;
  3246. }
  3247. }
  3248. // Destroy the cache
  3249. if ( isNode ) {
  3250. jQuery.cleanData( [ elem ], true );
  3251. // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
  3252. /* jshint eqeqeq: false */
  3253. } else if ( support.deleteExpando || cache != cache.window ) {
  3254. /* jshint eqeqeq: true */
  3255. delete cache[ id ];
  3256. // When all else fails, null
  3257. } else {
  3258. cache[ id ] = null;
  3259. }
  3260. }
  3261. jQuery.extend({
  3262. cache: {},
  3263. // The following elements (space-suffixed to avoid Object.prototype collisions)
  3264. // throw uncatchable exceptions if you attempt to set expando properties
  3265. noData: {
  3266. "applet ": true,
  3267. "embed ": true,
  3268. // ...but Flash objects (which have this classid) *can* handle expandos
  3269. "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  3270. },
  3271. hasData: function( elem ) {
  3272. elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
  3273. return !!elem && !isEmptyDataObject( elem );
  3274. },
  3275. data: function( elem, name, data ) {
  3276. return internalData( elem, name, data );
  3277. },
  3278. removeData: function( elem, name ) {
  3279. return internalRemoveData( elem, name );
  3280. },
  3281. // For internal use only.
  3282. _data: function( elem, name, data ) {
  3283. return internalData( elem, name, data, true );
  3284. },
  3285. _removeData: function( elem, name ) {
  3286. return internalRemoveData( elem, name, true );
  3287. }
  3288. });
  3289. jQuery.fn.extend({
  3290. data: function( key, value ) {
  3291. var i, name, data,
  3292. elem = this[0],
  3293. attrs = elem && elem.attributes;
  3294. // Special expections of .data basically thwart jQuery.access,
  3295. // so implement the relevant behavior ourselves
  3296. // Gets all values
  3297. if ( key === undefined ) {
  3298. if ( this.length ) {
  3299. data = jQuery.data( elem );
  3300. if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
  3301. i = attrs.length;
  3302. while ( i-- ) {
  3303. // Support: IE11+
  3304. // The attrs elements can be null (#14894)
  3305. if ( attrs[ i ] ) {
  3306. name = attrs[ i ].name;
  3307. if ( name.indexOf( "data-" ) === 0 ) {
  3308. name = jQuery.camelCase( name.slice(5) );
  3309. dataAttr( elem, name, data[ name ] );
  3310. }
  3311. }
  3312. }
  3313. jQuery._data( elem, "parsedAttrs", true );
  3314. }
  3315. }
  3316. return data;
  3317. }
  3318. // Sets multiple values
  3319. if ( typeof key === "object" ) {
  3320. return this.each(function() {
  3321. jQuery.data( this, key );
  3322. });
  3323. }
  3324. return arguments.length > 1 ?
  3325. // Sets one value
  3326. this.each(function() {
  3327. jQuery.data( this, key, value );
  3328. }) :
  3329. // Gets one value
  3330. // Try to fetch any internally stored data first
  3331. elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
  3332. },
  3333. removeData: function( key ) {
  3334. return this.each(function() {
  3335. jQuery.removeData( this, key );
  3336. });
  3337. }
  3338. });
  3339. jQuery.extend({
  3340. queue: function( elem, type, data ) {
  3341. var queue;
  3342. if ( elem ) {
  3343. type = ( type || "fx" ) + "queue";
  3344. queue = jQuery._data( elem, type );
  3345. // Speed up dequeue by getting out quickly if this is just a lookup
  3346. if ( data ) {
  3347. if ( !queue || jQuery.isArray(data) ) {
  3348. queue = jQuery._data( elem, type, jQuery.makeArray(data) );
  3349. } else {
  3350. queue.push( data );
  3351. }
  3352. }
  3353. return queue || [];
  3354. }
  3355. },
  3356. dequeue: function( elem, type ) {
  3357. type = type || "fx";
  3358. var queue = jQuery.queue( elem, type ),
  3359. startLength = queue.length,
  3360. fn = queue.shift(),
  3361. hooks = jQuery._queueHooks( elem, type ),
  3362. next = function() {
  3363. jQuery.dequeue( elem, type );
  3364. };
  3365. // If the fx queue is dequeued, always remove the progress sentinel
  3366. if ( fn === "inprogress" ) {
  3367. fn = queue.shift();
  3368. startLength--;
  3369. }
  3370. if ( fn ) {
  3371. // Add a progress sentinel to prevent the fx queue from being
  3372. // automatically dequeued
  3373. if ( type === "fx" ) {
  3374. queue.unshift( "inprogress" );
  3375. }
  3376. // clear up the last queue stop function
  3377. delete hooks.stop;
  3378. fn.call( elem, next, hooks );
  3379. }
  3380. if ( !startLength && hooks ) {
  3381. hooks.empty.fire();
  3382. }
  3383. },
  3384. // not intended for public consumption - generates a queueHooks object, or returns the current one
  3385. _queueHooks: function( elem, type ) {
  3386. var key = type + "queueHooks";
  3387. return jQuery._data( elem, key ) || jQuery._data( elem, key, {
  3388. empty: jQuery.Callbacks("once memory").add(function() {
  3389. jQuery._removeData( elem, type + "queue" );
  3390. jQuery._removeData( elem, key );
  3391. })
  3392. });
  3393. }
  3394. });
  3395. jQuery.fn.extend({
  3396. queue: function( type, data ) {
  3397. var setter = 2;
  3398. if ( typeof type !== "string" ) {
  3399. data = type;
  3400. type = "fx";
  3401. setter--;
  3402. }
  3403. if ( arguments.length < setter ) {
  3404. return jQuery.queue( this[0], type );
  3405. }
  3406. return data === undefined ?
  3407. this :
  3408. this.each(function() {
  3409. var queue = jQuery.queue( this, type, data );
  3410. // ensure a hooks for this queue
  3411. jQuery._queueHooks( this, type );
  3412. if ( type === "fx" && queue[0] !== "inprogress" ) {
  3413. jQuery.dequeue( this, type );
  3414. }
  3415. });
  3416. },
  3417. dequeue: function( type ) {
  3418. return this.each(function() {
  3419. jQuery.dequeue( this, type );
  3420. });
  3421. },
  3422. clearQueue: function( type ) {
  3423. return this.queue( type || "fx", [] );
  3424. },
  3425. // Get a promise resolved when queues of a certain type
  3426. // are emptied (fx is the type by default)
  3427. promise: function( type, obj ) {
  3428. var tmp,
  3429. count = 1,
  3430. defer = jQuery.Deferred(),
  3431. elements = this,
  3432. i = this.length,
  3433. resolve = function() {
  3434. if ( !( --count ) ) {
  3435. defer.resolveWith( elements, [ elements ] );
  3436. }
  3437. };
  3438. if ( typeof type !== "string" ) {
  3439. obj = type;
  3440. type = undefined;
  3441. }
  3442. type = type || "fx";
  3443. while ( i-- ) {
  3444. tmp = jQuery._data( elements[ i ], type + "queueHooks" );
  3445. if ( tmp && tmp.empty ) {
  3446. count++;
  3447. tmp.empty.add( resolve );
  3448. }
  3449. }
  3450. resolve();
  3451. return defer.promise( obj );
  3452. }
  3453. });
  3454. var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
  3455. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  3456. var isHidden = function( elem, el ) {
  3457. // isHidden might be called from jQuery#filter function;
  3458. // in that case, element will be second argument
  3459. elem = el || elem;
  3460. return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
  3461. };
  3462. // Multifunctional method to get and set values of a collection
  3463. // The value/s can optionally be executed if it's a function
  3464. var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  3465. var i = 0,
  3466. length = elems.length,
  3467. bulk = key == null;
  3468. // Sets many values
  3469. if ( jQuery.type( key ) === "object" ) {
  3470. chainable = true;
  3471. for ( i in key ) {
  3472. jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
  3473. }
  3474. // Sets one value
  3475. } else if ( value !== undefined ) {
  3476. chainable = true;
  3477. if ( !jQuery.isFunction( value ) ) {
  3478. raw = true;
  3479. }
  3480. if ( bulk ) {
  3481. // Bulk operations run against the entire set
  3482. if ( raw ) {
  3483. fn.call( elems, value );
  3484. fn = null;
  3485. // ...except when executing function values
  3486. } else {
  3487. bulk = fn;
  3488. fn = function( elem, key, value ) {
  3489. return bulk.call( jQuery( elem ), value );
  3490. };
  3491. }
  3492. }
  3493. if ( fn ) {
  3494. for ( ; i < length; i++ ) {
  3495. fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
  3496. }
  3497. }
  3498. }
  3499. return chainable ?
  3500. elems :
  3501. // Gets
  3502. bulk ?
  3503. fn.call( elems ) :
  3504. length ? fn( elems[0], key ) : emptyGet;
  3505. };
  3506. var rcheckableType = (/^(?:checkbox|radio)$/i);
  3507. (function() {
  3508. // Minified: var a,b,c
  3509. var input = document.createElement( "input" ),
  3510. div = document.createElement( "div" ),
  3511. fragment = document.createDocumentFragment();
  3512. // Setup
  3513. div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
  3514. // IE strips leading whitespace when .innerHTML is used
  3515. support.leadingWhitespace = div.firstChild.nodeType === 3;
  3516. // Make sure that tbody elements aren't automatically inserted
  3517. // IE will insert them into empty tables
  3518. support.tbody = !div.getElementsByTagName( "tbody" ).length;
  3519. // Make sure that link elements get serialized correctly by innerHTML
  3520. // This requires a wrapper element in IE
  3521. support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
  3522. // Makes sure cloning an html5 element does not cause problems
  3523. // Where outerHTML is undefined, this still works
  3524. support.html5Clone =
  3525. document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
  3526. // Check if a disconnected checkbox will retain its checked
  3527. // value of true after appended to the DOM (IE6/7)
  3528. input.type = "checkbox";
  3529. input.checked = true;
  3530. fragment.appendChild( input );
  3531. support.appendChecked = input.checked;
  3532. // Make sure textarea (and checkbox) defaultValue is properly cloned
  3533. // Support: IE6-IE11+
  3534. div.innerHTML = "<textarea>x</textarea>";
  3535. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  3536. // #11217 - WebKit loses check when the name is after the checked attribute
  3537. fragment.appendChild( div );
  3538. div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
  3539. // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
  3540. // old WebKit doesn't clone checked state correctly in fragments
  3541. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  3542. // Support: IE<9
  3543. // Opera does not clone events (and typeof div.attachEvent === undefined).
  3544. // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
  3545. support.noCloneEvent = true;
  3546. if ( div.attachEvent ) {
  3547. div.attachEvent( "onclick", function() {
  3548. support.noCloneEvent = false;
  3549. });
  3550. div.cloneNode( true ).click();
  3551. }
  3552. // Execute the test only if not already executed in another module.
  3553. if (support.deleteExpando == null) {
  3554. // Support: IE<9
  3555. support.deleteExpando = true;
  3556. try {
  3557. delete div.test;
  3558. } catch( e ) {
  3559. support.deleteExpando = false;
  3560. }
  3561. }
  3562. })();
  3563. (function() {
  3564. var i, eventName,
  3565. div = document.createElement( "div" );
  3566. // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
  3567. for ( i in { submit: true, change: true, focusin: true }) {
  3568. eventName = "on" + i;
  3569. if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
  3570. // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
  3571. div.setAttribute( eventName, "t" );
  3572. support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
  3573. }
  3574. }
  3575. // Null elements to avoid leaks in IE.
  3576. div = null;
  3577. })();
  3578. var rformElems = /^(?:input|select|textarea)$/i,
  3579. rkeyEvent = /^key/,
  3580. rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
  3581. rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  3582. rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
  3583. function returnTrue() {
  3584. return true;
  3585. }
  3586. function returnFalse() {
  3587. return false;
  3588. }
  3589. function safeActiveElement() {
  3590. try {
  3591. return document.activeElement;
  3592. } catch ( err ) { }
  3593. }
  3594. /*
  3595. * Helper functions for managing events -- not part of the public interface.
  3596. * Props to Dean Edwards' addEvent library for many of the ideas.
  3597. */
  3598. jQuery.event = {
  3599. global: {},
  3600. add: function( elem, types, handler, data, selector ) {
  3601. var tmp, events, t, handleObjIn,
  3602. special, eventHandle, handleObj,
  3603. handlers, type, namespaces, origType,
  3604. elemData = jQuery._data( elem );
  3605. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  3606. if ( !elemData ) {
  3607. return;
  3608. }
  3609. // Caller can pass in an object of custom data in lieu of the handler
  3610. if ( handler.handler ) {
  3611. handleObjIn = handler;
  3612. handler = handleObjIn.handler;
  3613. selector = handleObjIn.selector;
  3614. }
  3615. // Make sure that the handler has a unique ID, used to find/remove it later
  3616. if ( !handler.guid ) {
  3617. handler.guid = jQuery.guid++;
  3618. }
  3619. // Init the element's event structure and main handler, if this is the first
  3620. if ( !(events = elemData.events) ) {
  3621. events = elemData.events = {};
  3622. }
  3623. if ( !(eventHandle = elemData.handle) ) {
  3624. eventHandle = elemData.handle = function( e ) {
  3625. // Discard the second event of a jQuery.event.trigger() and
  3626. // when an event is called after a page has unloaded
  3627. return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
  3628. jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
  3629. undefined;
  3630. };
  3631. // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
  3632. eventHandle.elem = elem;
  3633. }
  3634. // Handle multiple events separated by a space
  3635. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  3636. t = types.length;
  3637. while ( t-- ) {
  3638. tmp = rtypenamespace.exec( types[t] ) || [];
  3639. type = origType = tmp[1];
  3640. namespaces = ( tmp[2] || "" ).split( "." ).sort();
  3641. // There *must* be a type, no attaching namespace-only handlers
  3642. if ( !type ) {
  3643. continue;
  3644. }
  3645. // If event changes its type, use the special event handlers for the changed type
  3646. special = jQuery.event.special[ type ] || {};
  3647. // If selector defined, determine special event api type, otherwise given type
  3648. type = ( selector ? special.delegateType : special.bindType ) || type;
  3649. // Update special based on newly reset type
  3650. special = jQuery.event.special[ type ] || {};
  3651. // handleObj is passed to all event handlers
  3652. handleObj = jQuery.extend({
  3653. type: type,
  3654. origType: origType,
  3655. data: data,
  3656. handler: handler,
  3657. guid: handler.guid,
  3658. selector: selector,
  3659. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  3660. namespace: namespaces.join(".")
  3661. }, handleObjIn );
  3662. // Init the event handler queue if we're the first
  3663. if ( !(handlers = events[ type ]) ) {
  3664. handlers = events[ type ] = [];
  3665. handlers.delegateCount = 0;
  3666. // Only use addEventListener/attachEvent if the special events handler returns false
  3667. if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  3668. // Bind the global event handler to the element
  3669. if ( elem.addEventListener ) {
  3670. elem.addEventListener( type, eventHandle, false );
  3671. } else if ( elem.attachEvent ) {
  3672. elem.attachEvent( "on" + type, eventHandle );
  3673. }
  3674. }
  3675. }
  3676. if ( special.add ) {
  3677. special.add.call( elem, handleObj );
  3678. if ( !handleObj.handler.guid ) {
  3679. handleObj.handler.guid = handler.guid;
  3680. }
  3681. }
  3682. // Add to the element's handler list, delegates in front
  3683. if ( selector ) {
  3684. handlers.splice( handlers.delegateCount++, 0, handleObj );
  3685. } else {
  3686. handlers.push( handleObj );
  3687. }
  3688. // Keep track of which events have ever been used, for event optimization
  3689. jQuery.event.global[ type ] = true;
  3690. }
  3691. // Nullify elem to prevent memory leaks in IE
  3692. elem = null;
  3693. },
  3694. // Detach an event or set of events from an element
  3695. remove: function( elem, types, handler, selector, mappedTypes ) {
  3696. var j, handleObj, tmp,
  3697. origCount, t, events,
  3698. special, handlers, type,
  3699. namespaces, origType,
  3700. elemData = jQuery.hasData( elem ) && jQuery._data( elem );
  3701. if ( !elemData || !(events = elemData.events) ) {
  3702. return;
  3703. }
  3704. // Once for each type.namespace in types; type may be omitted
  3705. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  3706. t = types.length;
  3707. while ( t-- ) {
  3708. tmp = rtypenamespace.exec( types[t] ) || [];
  3709. type = origType = tmp[1];
  3710. namespaces = ( tmp[2] || "" ).split( "." ).sort();
  3711. // Unbind all events (on this namespace, if provided) for the element
  3712. if ( !type ) {
  3713. for ( type in events ) {
  3714. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  3715. }
  3716. continue;
  3717. }
  3718. special = jQuery.event.special[ type ] || {};
  3719. type = ( selector ? special.delegateType : special.bindType ) || type;
  3720. handlers = events[ type ] || [];
  3721. tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
  3722. // Remove matching events
  3723. origCount = j = handlers.length;
  3724. while ( j-- ) {
  3725. handleObj = handlers[ j ];
  3726. if ( ( mappedTypes || origType === handleObj.origType ) &&
  3727. ( !handler || handler.guid === handleObj.guid ) &&
  3728. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  3729. ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
  3730. handlers.splice( j, 1 );
  3731. if ( handleObj.selector ) {
  3732. handlers.delegateCount--;
  3733. }
  3734. if ( special.remove ) {
  3735. special.remove.call( elem, handleObj );
  3736. }
  3737. }
  3738. }
  3739. // Remove generic event handler if we removed something and no more handlers exist
  3740. // (avoids potential for endless recursion during removal of special event handlers)
  3741. if ( origCount && !handlers.length ) {
  3742. if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  3743. jQuery.removeEvent( elem, type, elemData.handle );
  3744. }
  3745. delete events[ type ];
  3746. }
  3747. }
  3748. // Remove the expando if it's no longer used
  3749. if ( jQuery.isEmptyObject( events ) ) {
  3750. delete elemData.handle;
  3751. // removeData also checks for emptiness and clears the expando if empty
  3752. // so use it instead of delete
  3753. jQuery._removeData( elem, "events" );
  3754. }
  3755. },
  3756. trigger: function( event, data, elem, onlyHandlers ) {
  3757. var handle, ontype, cur,
  3758. bubbleType, special, tmp, i,
  3759. eventPath = [ elem || document ],
  3760. type = hasOwn.call( event, "type" ) ? event.type : event,
  3761. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
  3762. cur = tmp = elem = elem || document;
  3763. // Don't do events on text and comment nodes
  3764. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  3765. return;
  3766. }
  3767. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  3768. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  3769. return;
  3770. }
  3771. if ( type.indexOf(".") >= 0 ) {
  3772. // Namespaced trigger; create a regexp to match event type in handle()
  3773. namespaces = type.split(".");
  3774. type = namespaces.shift();
  3775. namespaces.sort();
  3776. }
  3777. ontype = type.indexOf(":") < 0 && "on" + type;
  3778. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  3779. event = event[ jQuery.expando ] ?
  3780. event :
  3781. new jQuery.Event( type, typeof event === "object" && event );
  3782. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  3783. event.isTrigger = onlyHandlers ? 2 : 3;
  3784. event.namespace = namespaces.join(".");
  3785. event.namespace_re = event.namespace ?
  3786. new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
  3787. null;
  3788. // Clean up the event in case it is being reused
  3789. event.result = undefined;
  3790. if ( !event.target ) {
  3791. event.target = elem;
  3792. }
  3793. // Clone any incoming data and prepend the event, creating the handler arg list
  3794. data = data == null ?
  3795. [ event ] :
  3796. jQuery.makeArray( data, [ event ] );
  3797. // Allow special events to draw outside the lines
  3798. special = jQuery.event.special[ type ] || {};
  3799. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  3800. return;
  3801. }
  3802. // Determine event propagation path in advance, per W3C events spec (#9951)
  3803. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  3804. if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
  3805. bubbleType = special.delegateType || type;
  3806. if ( !rfocusMorph.test( bubbleType + type ) ) {
  3807. cur = cur.parentNode;
  3808. }
  3809. for ( ; cur; cur = cur.parentNode ) {
  3810. eventPath.push( cur );
  3811. tmp = cur;
  3812. }
  3813. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  3814. if ( tmp === (elem.ownerDocument || document) ) {
  3815. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  3816. }
  3817. }
  3818. // Fire handlers on the event path
  3819. i = 0;
  3820. while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
  3821. event.type = i > 1 ?
  3822. bubbleType :
  3823. special.bindType || type;
  3824. // jQuery handler
  3825. handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
  3826. if ( handle ) {
  3827. handle.apply( cur, data );
  3828. }
  3829. // Native handler
  3830. handle = ontype && cur[ ontype ];
  3831. if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
  3832. event.result = handle.apply( cur, data );
  3833. if ( event.result === false ) {
  3834. event.preventDefault();
  3835. }
  3836. }
  3837. }
  3838. event.type = type;
  3839. // If nobody prevented the default action, do it now
  3840. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  3841. if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
  3842. jQuery.acceptData( elem ) ) {
  3843. // Call a native DOM method on the target with the same name name as the event.
  3844. // Can't use an .isFunction() check here because IE6/7 fails that test.
  3845. // Don't do default actions on window, that's where global variables be (#6170)
  3846. if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
  3847. // Don't re-trigger an onFOO event when we call its FOO() method
  3848. tmp = elem[ ontype ];
  3849. if ( tmp ) {
  3850. elem[ ontype ] = null;
  3851. }
  3852. // Prevent re-triggering of the same event, since we already bubbled it above
  3853. jQuery.event.triggered = type;
  3854. try {
  3855. elem[ type ]();
  3856. } catch ( e ) {
  3857. // IE<9 dies on focus/blur to hidden element (#1486,#12518)
  3858. // only reproducible on winXP IE8 native, not IE9 in IE8 mode
  3859. }
  3860. jQuery.event.triggered = undefined;
  3861. if ( tmp ) {
  3862. elem[ ontype ] = tmp;
  3863. }
  3864. }
  3865. }
  3866. }
  3867. return event.result;
  3868. },
  3869. dispatch: function( event ) {
  3870. // Make a writable jQuery.Event from the native event object
  3871. event = jQuery.event.fix( event );
  3872. var i, ret, handleObj, matched, j,
  3873. handlerQueue = [],
  3874. args = slice.call( arguments ),
  3875. handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
  3876. special = jQuery.event.special[ event.type ] || {};
  3877. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  3878. args[0] = event;
  3879. event.delegateTarget = this;
  3880. // Call the preDispatch hook for the mapped type, and let it bail if desired
  3881. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  3882. return;
  3883. }
  3884. // Determine handlers
  3885. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  3886. // Run delegates first; they may want to stop propagation beneath us
  3887. i = 0;
  3888. while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
  3889. event.currentTarget = matched.elem;
  3890. j = 0;
  3891. while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
  3892. // Triggered event must either 1) have no namespace, or
  3893. // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
  3894. if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
  3895. event.handleObj = handleObj;
  3896. event.data = handleObj.data;
  3897. ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
  3898. .apply( matched.elem, args );
  3899. if ( ret !== undefined ) {
  3900. if ( (event.result = ret) === false ) {
  3901. event.preventDefault();
  3902. event.stopPropagation();
  3903. }
  3904. }
  3905. }
  3906. }
  3907. }
  3908. // Call the postDispatch hook for the mapped type
  3909. if ( special.postDispatch ) {
  3910. special.postDispatch.call( this, event );
  3911. }
  3912. return event.result;
  3913. },
  3914. handlers: function( event, handlers ) {
  3915. var sel, handleObj, matches, i,
  3916. handlerQueue = [],
  3917. delegateCount = handlers.delegateCount,
  3918. cur = event.target;
  3919. // Find delegate handlers
  3920. // Black-hole SVG <use> instance trees (#13180)
  3921. // Avoid non-left-click bubbling in Firefox (#3861)
  3922. if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
  3923. /* jshint eqeqeq: false */
  3924. for ( ; cur != this; cur = cur.parentNode || this ) {
  3925. /* jshint eqeqeq: true */
  3926. // Don't check non-elements (#13208)
  3927. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  3928. if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
  3929. matches = [];
  3930. for ( i = 0; i < delegateCount; i++ ) {
  3931. handleObj = handlers[ i ];
  3932. // Don't conflict with Object.prototype properties (#13203)
  3933. sel = handleObj.selector + " ";
  3934. if ( matches[ sel ] === undefined ) {
  3935. matches[ sel ] = handleObj.needsContext ?
  3936. jQuery( sel, this ).index( cur ) >= 0 :
  3937. jQuery.find( sel, this, null, [ cur ] ).length;
  3938. }
  3939. if ( matches[ sel ] ) {
  3940. matches.push( handleObj );
  3941. }
  3942. }
  3943. if ( matches.length ) {
  3944. handlerQueue.push({ elem: cur, handlers: matches });
  3945. }
  3946. }
  3947. }
  3948. }
  3949. // Add the remaining (directly-bound) handlers
  3950. if ( delegateCount < handlers.length ) {
  3951. handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
  3952. }
  3953. return handlerQueue;
  3954. },
  3955. fix: function( event ) {
  3956. if ( event[ jQuery.expando ] ) {
  3957. return event;
  3958. }
  3959. // Create a writable copy of the event object and normalize some properties
  3960. var i, prop, copy,
  3961. type = event.type,
  3962. originalEvent = event,
  3963. fixHook = this.fixHooks[ type ];
  3964. if ( !fixHook ) {
  3965. this.fixHooks[ type ] = fixHook =
  3966. rmouseEvent.test( type ) ? this.mouseHooks :
  3967. rkeyEvent.test( type ) ? this.keyHooks :
  3968. {};
  3969. }
  3970. copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
  3971. event = new jQuery.Event( originalEvent );
  3972. i = copy.length;
  3973. while ( i-- ) {
  3974. prop = copy[ i ];
  3975. event[ prop ] = originalEvent[ prop ];
  3976. }
  3977. // Support: IE<9
  3978. // Fix target property (#1925)
  3979. if ( !event.target ) {
  3980. event.target = originalEvent.srcElement || document;
  3981. }
  3982. // Support: Chrome 23+, Safari?
  3983. // Target should not be a text node (#504, #13143)
  3984. if ( event.target.nodeType === 3 ) {
  3985. event.target = event.target.parentNode;
  3986. }
  3987. // Support: IE<9
  3988. // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
  3989. event.metaKey = !!event.metaKey;
  3990. return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
  3991. },
  3992. // Includes some event props shared by KeyEvent and MouseEvent
  3993. props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  3994. fixHooks: {},
  3995. keyHooks: {
  3996. props: "char charCode key keyCode".split(" "),
  3997. filter: function( event, original ) {
  3998. // Add which for key events
  3999. if ( event.which == null ) {
  4000. event.which = original.charCode != null ? original.charCode : original.keyCode;
  4001. }
  4002. return event;
  4003. }
  4004. },
  4005. mouseHooks: {
  4006. props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
  4007. filter: function( event, original ) {
  4008. var body, eventDoc, doc,
  4009. button = original.button,
  4010. fromElement = original.fromElement;
  4011. // Calculate pageX/Y if missing and clientX/Y available
  4012. if ( event.pageX == null && original.clientX != null ) {
  4013. eventDoc = event.target.ownerDocument || document;
  4014. doc = eventDoc.documentElement;
  4015. body = eventDoc.body;
  4016. event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
  4017. event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
  4018. }
  4019. // Add relatedTarget, if necessary
  4020. if ( !event.relatedTarget && fromElement ) {
  4021. event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
  4022. }
  4023. // Add which for click: 1 === left; 2 === middle; 3 === right
  4024. // Note: button is not normalized, so don't use it
  4025. if ( !event.which && button !== undefined ) {
  4026. event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
  4027. }
  4028. return event;
  4029. }
  4030. },
  4031. special: {
  4032. load: {
  4033. // Prevent triggered image.load events from bubbling to window.load
  4034. noBubble: true
  4035. },
  4036. focus: {
  4037. // Fire native event if possible so blur/focus sequence is correct
  4038. trigger: function() {
  4039. if ( this !== safeActiveElement() && this.focus ) {
  4040. try {
  4041. this.focus();
  4042. return false;
  4043. } catch ( e ) {
  4044. // Support: IE<9
  4045. // If we error on focus to hidden element (#1486, #12518),
  4046. // let .trigger() run the handlers
  4047. }
  4048. }
  4049. },
  4050. delegateType: "focusin"
  4051. },
  4052. blur: {
  4053. trigger: function() {
  4054. if ( this === safeActiveElement() && this.blur ) {
  4055. this.blur();
  4056. return false;
  4057. }
  4058. },
  4059. delegateType: "focusout"
  4060. },
  4061. click: {
  4062. // For checkbox, fire native event so checked state will be right
  4063. trigger: function() {
  4064. if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
  4065. this.click();
  4066. return false;
  4067. }
  4068. },
  4069. // For cross-browser consistency, don't fire native .click() on links
  4070. _default: function( event ) {
  4071. return jQuery.nodeName( event.target, "a" );
  4072. }
  4073. },
  4074. beforeunload: {
  4075. postDispatch: function( event ) {
  4076. // Support: Firefox 20+
  4077. // Firefox doesn't alert if the returnValue field is not set.
  4078. if ( event.result !== undefined && event.originalEvent ) {
  4079. event.originalEvent.returnValue = event.result;
  4080. }
  4081. }
  4082. }
  4083. },
  4084. simulate: function( type, elem, event, bubble ) {
  4085. // Piggyback on a donor event to simulate a different one.
  4086. // Fake originalEvent to avoid donor's stopPropagation, but if the
  4087. // simulated event prevents default then we do the same on the donor.
  4088. var e = jQuery.extend(
  4089. new jQuery.Event(),
  4090. event,
  4091. {
  4092. type: type,
  4093. isSimulated: true,
  4094. originalEvent: {}
  4095. }
  4096. );
  4097. if ( bubble ) {
  4098. jQuery.event.trigger( e, null, elem );
  4099. } else {
  4100. jQuery.event.dispatch.call( elem, e );
  4101. }
  4102. if ( e.isDefaultPrevented() ) {
  4103. event.preventDefault();
  4104. }
  4105. }
  4106. };
  4107. jQuery.removeEvent = document.removeEventListener ?
  4108. function( elem, type, handle ) {
  4109. if ( elem.removeEventListener ) {
  4110. elem.removeEventListener( type, handle, false );
  4111. }
  4112. } :
  4113. function( elem, type, handle ) {
  4114. var name = "on" + type;
  4115. if ( elem.detachEvent ) {
  4116. // #8545, #7054, preventing memory leaks for custom events in IE6-8
  4117. // detachEvent needed property on element, by name of that event, to properly expose it to GC
  4118. if ( typeof elem[ name ] === strundefined ) {
  4119. elem[ name ] = null;
  4120. }
  4121. elem.detachEvent( name, handle );
  4122. }
  4123. };
  4124. jQuery.Event = function( src, props ) {
  4125. // Allow instantiation without the 'new' keyword
  4126. if ( !(this instanceof jQuery.Event) ) {
  4127. return new jQuery.Event( src, props );
  4128. }
  4129. // Event object
  4130. if ( src && src.type ) {
  4131. this.originalEvent = src;
  4132. this.type = src.type;
  4133. // Events bubbling up the document may have been marked as prevented
  4134. // by a handler lower down the tree; reflect the correct value.
  4135. this.isDefaultPrevented = src.defaultPrevented ||
  4136. src.defaultPrevented === undefined &&
  4137. // Support: IE < 9, Android < 4.0
  4138. src.returnValue === false ?
  4139. returnTrue :
  4140. returnFalse;
  4141. // Event type
  4142. } else {
  4143. this.type = src;
  4144. }
  4145. // Put explicitly provided properties onto the event object
  4146. if ( props ) {
  4147. jQuery.extend( this, props );
  4148. }
  4149. // Create a timestamp if incoming event doesn't have one
  4150. this.timeStamp = src && src.timeStamp || jQuery.now();
  4151. // Mark it as fixed
  4152. this[ jQuery.expando ] = true;
  4153. };
  4154. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  4155. // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  4156. jQuery.Event.prototype = {
  4157. isDefaultPrevented: returnFalse,
  4158. isPropagationStopped: returnFalse,
  4159. isImmediatePropagationStopped: returnFalse,
  4160. preventDefault: function() {
  4161. var e = this.originalEvent;
  4162. this.isDefaultPrevented = returnTrue;
  4163. if ( !e ) {
  4164. return;
  4165. }
  4166. // If preventDefault exists, run it on the original event
  4167. if ( e.preventDefault ) {
  4168. e.preventDefault();
  4169. // Support: IE
  4170. // Otherwise set the returnValue property of the original event to false
  4171. } else {
  4172. e.returnValue = false;
  4173. }
  4174. },
  4175. stopPropagation: function() {
  4176. var e = this.originalEvent;
  4177. this.isPropagationStopped = returnTrue;
  4178. if ( !e ) {
  4179. return;
  4180. }
  4181. // If stopPropagation exists, run it on the original event
  4182. if ( e.stopPropagation ) {
  4183. e.stopPropagation();
  4184. }
  4185. // Support: IE
  4186. // Set the cancelBubble property of the original event to true
  4187. e.cancelBubble = true;
  4188. },
  4189. stopImmediatePropagation: function() {
  4190. var e = this.originalEvent;
  4191. this.isImmediatePropagationStopped = returnTrue;
  4192. if ( e && e.stopImmediatePropagation ) {
  4193. e.stopImmediatePropagation();
  4194. }
  4195. this.stopPropagation();
  4196. }
  4197. };
  4198. // Create mouseenter/leave events using mouseover/out and event-time checks
  4199. jQuery.each({
  4200. mouseenter: "mouseover",
  4201. mouseleave: "mouseout",
  4202. pointerenter: "pointerover",
  4203. pointerleave: "pointerout"
  4204. }, function( orig, fix ) {
  4205. jQuery.event.special[ orig ] = {
  4206. delegateType: fix,
  4207. bindType: fix,
  4208. handle: function( event ) {
  4209. var ret,
  4210. target = this,
  4211. related = event.relatedTarget,
  4212. handleObj = event.handleObj;
  4213. // For mousenter/leave call the handler if related is outside the target.
  4214. // NB: No relatedTarget if the mouse left/entered the browser window
  4215. if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
  4216. event.type = handleObj.origType;
  4217. ret = handleObj.handler.apply( this, arguments );
  4218. event.type = fix;
  4219. }
  4220. return ret;
  4221. }
  4222. };
  4223. });
  4224. // IE submit delegation
  4225. if ( !support.submitBubbles ) {
  4226. jQuery.event.special.submit = {
  4227. setup: function() {
  4228. // Only need this for delegated form submit events
  4229. if ( jQuery.nodeName( this, "form" ) ) {
  4230. return false;
  4231. }
  4232. // Lazy-add a submit handler when a descendant form may potentially be submitted
  4233. jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
  4234. // Node name check avoids a VML-related crash in IE (#9807)
  4235. var elem = e.target,
  4236. form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
  4237. if ( form && !jQuery._data( form, "submitBubbles" ) ) {
  4238. jQuery.event.add( form, "submit._submit", function( event ) {
  4239. event._submit_bubble = true;
  4240. });
  4241. jQuery._data( form, "submitBubbles", true );
  4242. }
  4243. });
  4244. // return undefined since we don't need an event listener
  4245. },
  4246. postDispatch: function( event ) {
  4247. // If form was submitted by the user, bubble the event up the tree
  4248. if ( event._submit_bubble ) {
  4249. delete event._submit_bubble;
  4250. if ( this.parentNode && !event.isTrigger ) {
  4251. jQuery.event.simulate( "submit", this.parentNode, event, true );
  4252. }
  4253. }
  4254. },
  4255. teardown: function() {
  4256. // Only need this for delegated form submit events
  4257. if ( jQuery.nodeName( this, "form" ) ) {
  4258. return false;
  4259. }
  4260. // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
  4261. jQuery.event.remove( this, "._submit" );
  4262. }
  4263. };
  4264. }
  4265. // IE change delegation and checkbox/radio fix
  4266. if ( !support.changeBubbles ) {
  4267. jQuery.event.special.change = {
  4268. setup: function() {
  4269. if ( rformElems.test( this.nodeName ) ) {
  4270. // IE doesn't fire change on a check/radio until blur; trigger it on click
  4271. // after a propertychange. Eat the blur-change in special.change.handle.
  4272. // This still fires onchange a second time for check/radio after blur.
  4273. if ( this.type === "checkbox" || this.type === "radio" ) {
  4274. jQuery.event.add( this, "propertychange._change", function( event ) {
  4275. if ( event.originalEvent.propertyName === "checked" ) {
  4276. this._just_changed = true;
  4277. }
  4278. });
  4279. jQuery.event.add( this, "click._change", function( event ) {
  4280. if ( this._just_changed && !event.isTrigger ) {
  4281. this._just_changed = false;
  4282. }
  4283. // Allow triggered, simulated change events (#11500)
  4284. jQuery.event.simulate( "change", this, event, true );
  4285. });
  4286. }
  4287. return false;
  4288. }
  4289. // Delegated event; lazy-add a change handler on descendant inputs
  4290. jQuery.event.add( this, "beforeactivate._change", function( e ) {
  4291. var elem = e.target;
  4292. if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
  4293. jQuery.event.add( elem, "change._change", function( event ) {
  4294. if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
  4295. jQuery.event.simulate( "change", this.parentNode, event, true );
  4296. }
  4297. });
  4298. jQuery._data( elem, "changeBubbles", true );
  4299. }
  4300. });
  4301. },
  4302. handle: function( event ) {
  4303. var elem = event.target;
  4304. // Swallow native change events from checkbox/radio, we already triggered them above
  4305. if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
  4306. return event.handleObj.handler.apply( this, arguments );
  4307. }
  4308. },
  4309. teardown: function() {
  4310. jQuery.event.remove( this, "._change" );
  4311. return !rformElems.test( this.nodeName );
  4312. }
  4313. };
  4314. }
  4315. // Create "bubbling" focus and blur events
  4316. if ( !support.focusinBubbles ) {
  4317. jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  4318. // Attach a single capturing handler on the document while someone wants focusin/focusout
  4319. var handler = function( event ) {
  4320. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
  4321. };
  4322. jQuery.event.special[ fix ] = {
  4323. setup: function() {
  4324. var doc = this.ownerDocument || this,
  4325. attaches = jQuery._data( doc, fix );
  4326. if ( !attaches ) {
  4327. doc.addEventListener( orig, handler, true );
  4328. }
  4329. jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
  4330. },
  4331. teardown: function() {
  4332. var doc = this.ownerDocument || this,
  4333. attaches = jQuery._data( doc, fix ) - 1;
  4334. if ( !attaches ) {
  4335. doc.removeEventListener( orig, handler, true );
  4336. jQuery._removeData( doc, fix );
  4337. } else {
  4338. jQuery._data( doc, fix, attaches );
  4339. }
  4340. }
  4341. };
  4342. });
  4343. }
  4344. jQuery.fn.extend({
  4345. on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
  4346. var type, origFn;
  4347. // Types can be a map of types/handlers
  4348. if ( typeof types === "object" ) {
  4349. // ( types-Object, selector, data )
  4350. if ( typeof selector !== "string" ) {
  4351. // ( types-Object, data )
  4352. data = data || selector;
  4353. selector = undefined;
  4354. }
  4355. for ( type in types ) {
  4356. this.on( type, selector, data, types[ type ], one );
  4357. }
  4358. return this;
  4359. }
  4360. if ( data == null && fn == null ) {
  4361. // ( types, fn )
  4362. fn = selector;
  4363. data = selector = undefined;
  4364. } else if ( fn == null ) {
  4365. if ( typeof selector === "string" ) {
  4366. // ( types, selector, fn )
  4367. fn = data;
  4368. data = undefined;
  4369. } else {
  4370. // ( types, data, fn )
  4371. fn = data;
  4372. data = selector;
  4373. selector = undefined;
  4374. }
  4375. }
  4376. if ( fn === false ) {
  4377. fn = returnFalse;
  4378. } else if ( !fn ) {
  4379. return this;
  4380. }
  4381. if ( one === 1 ) {
  4382. origFn = fn;
  4383. fn = function( event ) {
  4384. // Can use an empty set, since event contains the info
  4385. jQuery().off( event );
  4386. return origFn.apply( this, arguments );
  4387. };
  4388. // Use same guid so caller can remove using origFn
  4389. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  4390. }
  4391. return this.each( function() {
  4392. jQuery.event.add( this, types, fn, data, selector );
  4393. });
  4394. },
  4395. one: function( types, selector, data, fn ) {
  4396. return this.on( types, selector, data, fn, 1 );
  4397. },
  4398. off: function( types, selector, fn ) {
  4399. var handleObj, type;
  4400. if ( types && types.preventDefault && types.handleObj ) {
  4401. // ( event ) dispatched jQuery.Event
  4402. handleObj = types.handleObj;
  4403. jQuery( types.delegateTarget ).off(
  4404. handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
  4405. handleObj.selector,
  4406. handleObj.handler
  4407. );
  4408. return this;
  4409. }
  4410. if ( typeof types === "object" ) {
  4411. // ( types-object [, selector] )
  4412. for ( type in types ) {
  4413. this.off( type, selector, types[ type ] );
  4414. }
  4415. return this;
  4416. }
  4417. if ( selector === false || typeof selector === "function" ) {
  4418. // ( types [, fn] )
  4419. fn = selector;
  4420. selector = undefined;
  4421. }
  4422. if ( fn === false ) {
  4423. fn = returnFalse;
  4424. }
  4425. return this.each(function() {
  4426. jQuery.event.remove( this, types, fn, selector );
  4427. });
  4428. },
  4429. trigger: function( type, data ) {
  4430. return this.each(function() {
  4431. jQuery.event.trigger( type, data, this );
  4432. });
  4433. },
  4434. triggerHandler: function( type, data ) {
  4435. var elem = this[0];
  4436. if ( elem ) {
  4437. return jQuery.event.trigger( type, data, elem, true );
  4438. }
  4439. }
  4440. });
  4441. function createSafeFragment( document ) {
  4442. var list = nodeNames.split( "|" ),
  4443. safeFrag = document.createDocumentFragment();
  4444. if ( safeFrag.createElement ) {
  4445. while ( list.length ) {
  4446. safeFrag.createElement(
  4447. list.pop()
  4448. );
  4449. }
  4450. }
  4451. return safeFrag;
  4452. }
  4453. var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
  4454. "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
  4455. rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
  4456. rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
  4457. rleadingWhitespace = /^\s+/,
  4458. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
  4459. rtagName = /<([\w:]+)/,
  4460. rtbody = /<tbody/i,
  4461. rhtml = /<|&#?\w+;/,
  4462. rnoInnerhtml = /<(?:script|style|link)/i,
  4463. // checked="checked" or checked
  4464. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4465. rscriptType = /^$|\/(?:java|ecma)script/i,
  4466. rscriptTypeMasked = /^true\/(.*)/,
  4467. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
  4468. // We have to close these tags to support XHTML (#13200)
  4469. wrapMap = {
  4470. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  4471. legend: [ 1, "<fieldset>", "</fieldset>" ],
  4472. area: [ 1, "<map>", "</map>" ],
  4473. param: [ 1, "<object>", "</object>" ],
  4474. thead: [ 1, "<table>", "</table>" ],
  4475. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  4476. col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
  4477. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  4478. // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
  4479. // unless wrapped in a div with non-breaking characters in front of it.
  4480. _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
  4481. },
  4482. safeFragment = createSafeFragment( document ),
  4483. fragmentDiv = safeFragment.appendChild( document.createElement("div") );
  4484. wrapMap.optgroup = wrapMap.option;
  4485. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  4486. wrapMap.th = wrapMap.td;
  4487. function getAll( context, tag ) {
  4488. var elems, elem,
  4489. i = 0,
  4490. found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
  4491. typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
  4492. undefined;
  4493. if ( !found ) {
  4494. for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
  4495. if ( !tag || jQuery.nodeName( elem, tag ) ) {
  4496. found.push( elem );
  4497. } else {
  4498. jQuery.merge( found, getAll( elem, tag ) );
  4499. }
  4500. }
  4501. }
  4502. return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
  4503. jQuery.merge( [ context ], found ) :
  4504. found;
  4505. }
  4506. // Used in buildFragment, fixes the defaultChecked property
  4507. function fixDefaultChecked( elem ) {
  4508. if ( rcheckableType.test( elem.type ) ) {
  4509. elem.defaultChecked = elem.checked;
  4510. }
  4511. }
  4512. // Support: IE<8
  4513. // Manipulating tables requires a tbody
  4514. function manipulationTarget( elem, content ) {
  4515. return jQuery.nodeName( elem, "table" ) &&
  4516. jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
  4517. elem.getElementsByTagName("tbody")[0] ||
  4518. elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
  4519. elem;
  4520. }
  4521. // Replace/restore the type attribute of script elements for safe DOM manipulation
  4522. function disableScript( elem ) {
  4523. elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
  4524. return elem;
  4525. }
  4526. function restoreScript( elem ) {
  4527. var match = rscriptTypeMasked.exec( elem.type );
  4528. if ( match ) {
  4529. elem.type = match[1];
  4530. } else {
  4531. elem.removeAttribute("type");
  4532. }
  4533. return elem;
  4534. }
  4535. // Mark scripts as having already been evaluated
  4536. function setGlobalEval( elems, refElements ) {
  4537. var elem,
  4538. i = 0;
  4539. for ( ; (elem = elems[i]) != null; i++ ) {
  4540. jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
  4541. }
  4542. }
  4543. function cloneCopyEvent( src, dest ) {
  4544. if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
  4545. return;
  4546. }
  4547. var type, i, l,
  4548. oldData = jQuery._data( src ),
  4549. curData = jQuery._data( dest, oldData ),
  4550. events = oldData.events;
  4551. if ( events ) {
  4552. delete curData.handle;
  4553. curData.events = {};
  4554. for ( type in events ) {
  4555. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4556. jQuery.event.add( dest, type, events[ type ][ i ] );
  4557. }
  4558. }
  4559. }
  4560. // make the cloned public data object a copy from the original
  4561. if ( curData.data ) {
  4562. curData.data = jQuery.extend( {}, curData.data );
  4563. }
  4564. }
  4565. function fixCloneNodeIssues( src, dest ) {
  4566. var nodeName, e, data;
  4567. // We do not need to do anything for non-Elements
  4568. if ( dest.nodeType !== 1 ) {
  4569. return;
  4570. }
  4571. nodeName = dest.nodeName.toLowerCase();
  4572. // IE6-8 copies events bound via attachEvent when using cloneNode.
  4573. if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
  4574. data = jQuery._data( dest );
  4575. for ( e in data.events ) {
  4576. jQuery.removeEvent( dest, e, data.handle );
  4577. }
  4578. // Event data gets referenced instead of copied if the expando gets copied too
  4579. dest.removeAttribute( jQuery.expando );
  4580. }
  4581. // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
  4582. if ( nodeName === "script" && dest.text !== src.text ) {
  4583. disableScript( dest ).text = src.text;
  4584. restoreScript( dest );
  4585. // IE6-10 improperly clones children of object elements using classid.
  4586. // IE10 throws NoModificationAllowedError if parent is null, #12132.
  4587. } else if ( nodeName === "object" ) {
  4588. if ( dest.parentNode ) {
  4589. dest.outerHTML = src.outerHTML;
  4590. }
  4591. // This path appears unavoidable for IE9. When cloning an object
  4592. // element in IE9, the outerHTML strategy above is not sufficient.
  4593. // If the src has innerHTML and the destination does not,
  4594. // copy the src.innerHTML into the dest.innerHTML. #10324
  4595. if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
  4596. dest.innerHTML = src.innerHTML;
  4597. }
  4598. } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  4599. // IE6-8 fails to persist the checked state of a cloned checkbox
  4600. // or radio button. Worse, IE6-7 fail to give the cloned element
  4601. // a checked appearance if the defaultChecked value isn't also set
  4602. dest.defaultChecked = dest.checked = src.checked;
  4603. // IE6-7 get confused and end up setting the value of a cloned
  4604. // checkbox/radio button to an empty string instead of "on"
  4605. if ( dest.value !== src.value ) {
  4606. dest.value = src.value;
  4607. }
  4608. // IE6-8 fails to return the selected option to the default selected
  4609. // state when cloning options
  4610. } else if ( nodeName === "option" ) {
  4611. dest.defaultSelected = dest.selected = src.defaultSelected;
  4612. // IE6-8 fails to set the defaultValue to the correct value when
  4613. // cloning other types of input fields
  4614. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4615. dest.defaultValue = src.defaultValue;
  4616. }
  4617. }
  4618. jQuery.extend({
  4619. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  4620. var destElements, node, clone, i, srcElements,
  4621. inPage = jQuery.contains( elem.ownerDocument, elem );
  4622. if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
  4623. clone = elem.cloneNode( true );
  4624. // IE<=8 does not properly clone detached, unknown element nodes
  4625. } else {
  4626. fragmentDiv.innerHTML = elem.outerHTML;
  4627. fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
  4628. }
  4629. if ( (!support.noCloneEvent || !support.noCloneChecked) &&
  4630. (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
  4631. // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
  4632. destElements = getAll( clone );
  4633. srcElements = getAll( elem );
  4634. // Fix all IE cloning issues
  4635. for ( i = 0; (node = srcElements[i]) != null; ++i ) {
  4636. // Ensure that the destination node is not null; Fixes #9587
  4637. if ( destElements[i] ) {
  4638. fixCloneNodeIssues( node, destElements[i] );
  4639. }
  4640. }
  4641. }
  4642. // Copy the events from the original to the clone
  4643. if ( dataAndEvents ) {
  4644. if ( deepDataAndEvents ) {
  4645. srcElements = srcElements || getAll( elem );
  4646. destElements = destElements || getAll( clone );
  4647. for ( i = 0; (node = srcElements[i]) != null; i++ ) {
  4648. cloneCopyEvent( node, destElements[i] );
  4649. }
  4650. } else {
  4651. cloneCopyEvent( elem, clone );
  4652. }
  4653. }
  4654. // Preserve script evaluation history
  4655. destElements = getAll( clone, "script" );
  4656. if ( destElements.length > 0 ) {
  4657. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  4658. }
  4659. destElements = srcElements = node = null;
  4660. // Return the cloned set
  4661. return clone;
  4662. },
  4663. buildFragment: function( elems, context, scripts, selection ) {
  4664. var j, elem, contains,
  4665. tmp, tag, tbody, wrap,
  4666. l = elems.length,
  4667. // Ensure a safe fragment
  4668. safe = createSafeFragment( context ),
  4669. nodes = [],
  4670. i = 0;
  4671. for ( ; i < l; i++ ) {
  4672. elem = elems[ i ];
  4673. if ( elem || elem === 0 ) {
  4674. // Add nodes directly
  4675. if ( jQuery.type( elem ) === "object" ) {
  4676. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  4677. // Convert non-html into a text node
  4678. } else if ( !rhtml.test( elem ) ) {
  4679. nodes.push( context.createTextNode( elem ) );
  4680. // Convert html into DOM nodes
  4681. } else {
  4682. tmp = tmp || safe.appendChild( context.createElement("div") );
  4683. // Deserialize a standard representation
  4684. tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
  4685. wrap = wrapMap[ tag ] || wrapMap._default;
  4686. tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
  4687. // Descend through wrappers to the right content
  4688. j = wrap[0];
  4689. while ( j-- ) {
  4690. tmp = tmp.lastChild;
  4691. }
  4692. // Manually add leading whitespace removed by IE
  4693. if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
  4694. nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
  4695. }
  4696. // Remove IE's autoinserted <tbody> from table fragments
  4697. if ( !support.tbody ) {
  4698. // String was a <table>, *may* have spurious <tbody>
  4699. elem = tag === "table" && !rtbody.test( elem ) ?
  4700. tmp.firstChild :
  4701. // String was a bare <thead> or <tfoot>
  4702. wrap[1] === "<table>" && !rtbody.test( elem ) ?
  4703. tmp :
  4704. 0;
  4705. j = elem && elem.childNodes.length;
  4706. while ( j-- ) {
  4707. if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
  4708. elem.removeChild( tbody );
  4709. }
  4710. }
  4711. }
  4712. jQuery.merge( nodes, tmp.childNodes );
  4713. // Fix #12392 for WebKit and IE > 9
  4714. tmp.textContent = "";
  4715. // Fix #12392 for oldIE
  4716. while ( tmp.firstChild ) {
  4717. tmp.removeChild( tmp.firstChild );
  4718. }
  4719. // Remember the top-level container for proper cleanup
  4720. tmp = safe.lastChild;
  4721. }
  4722. }
  4723. }
  4724. // Fix #11356: Clear elements from fragment
  4725. if ( tmp ) {
  4726. safe.removeChild( tmp );
  4727. }
  4728. // Reset defaultChecked for any radios and checkboxes
  4729. // about to be appended to the DOM in IE 6/7 (#8060)
  4730. if ( !support.appendChecked ) {
  4731. jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
  4732. }
  4733. i = 0;
  4734. while ( (elem = nodes[ i++ ]) ) {
  4735. // #4087 - If origin and destination elements are the same, and this is
  4736. // that element, do not do anything
  4737. if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
  4738. continue;
  4739. }
  4740. contains = jQuery.contains( elem.ownerDocument, elem );
  4741. // Append to fragment
  4742. tmp = getAll( safe.appendChild( elem ), "script" );
  4743. // Preserve script evaluation history
  4744. if ( contains ) {
  4745. setGlobalEval( tmp );
  4746. }
  4747. // Capture executables
  4748. if ( scripts ) {
  4749. j = 0;
  4750. while ( (elem = tmp[ j++ ]) ) {
  4751. if ( rscriptType.test( elem.type || "" ) ) {
  4752. scripts.push( elem );
  4753. }
  4754. }
  4755. }
  4756. }
  4757. tmp = null;
  4758. return safe;
  4759. },
  4760. cleanData: function( elems, /* internal */ acceptData ) {
  4761. var elem, type, id, data,
  4762. i = 0,
  4763. internalKey = jQuery.expando,
  4764. cache = jQuery.cache,
  4765. deleteExpando = support.deleteExpando,
  4766. special = jQuery.event.special;
  4767. for ( ; (elem = elems[i]) != null; i++ ) {
  4768. if ( acceptData || jQuery.acceptData( elem ) ) {
  4769. id = elem[ internalKey ];
  4770. data = id && cache[ id ];
  4771. if ( data ) {
  4772. if ( data.events ) {
  4773. for ( type in data.events ) {
  4774. if ( special[ type ] ) {
  4775. jQuery.event.remove( elem, type );
  4776. // This is a shortcut to avoid jQuery.event.remove's overhead
  4777. } else {
  4778. jQuery.removeEvent( elem, type, data.handle );
  4779. }
  4780. }
  4781. }
  4782. // Remove cache only if it was not already removed by jQuery.event.remove
  4783. if ( cache[ id ] ) {
  4784. delete cache[ id ];
  4785. // IE does not allow us to delete expando properties from nodes,
  4786. // nor does it have a removeAttribute function on Document nodes;
  4787. // we must handle all of these cases
  4788. if ( deleteExpando ) {
  4789. delete elem[ internalKey ];
  4790. } else if ( typeof elem.removeAttribute !== strundefined ) {
  4791. elem.removeAttribute( internalKey );
  4792. } else {
  4793. elem[ internalKey ] = null;
  4794. }
  4795. deletedIds.push( id );
  4796. }
  4797. }
  4798. }
  4799. }
  4800. }
  4801. });
  4802. jQuery.fn.extend({
  4803. text: function( value ) {
  4804. return access( this, function( value ) {
  4805. return value === undefined ?
  4806. jQuery.text( this ) :
  4807. this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
  4808. }, null, value, arguments.length );
  4809. },
  4810. append: function() {
  4811. return this.domManip( arguments, function( elem ) {
  4812. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4813. var target = manipulationTarget( this, elem );
  4814. target.appendChild( elem );
  4815. }
  4816. });
  4817. },
  4818. prepend: function() {
  4819. return this.domManip( arguments, function( elem ) {
  4820. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4821. var target = manipulationTarget( this, elem );
  4822. target.insertBefore( elem, target.firstChild );
  4823. }
  4824. });
  4825. },
  4826. before: function() {
  4827. return this.domManip( arguments, function( elem ) {
  4828. if ( this.parentNode ) {
  4829. this.parentNode.insertBefore( elem, this );
  4830. }
  4831. });
  4832. },
  4833. after: function() {
  4834. return this.domManip( arguments, function( elem ) {
  4835. if ( this.parentNode ) {
  4836. this.parentNode.insertBefore( elem, this.nextSibling );
  4837. }
  4838. });
  4839. },
  4840. remove: function( selector, keepData /* Internal Use Only */ ) {
  4841. var elem,
  4842. elems = selector ? jQuery.filter( selector, this ) : this,
  4843. i = 0;
  4844. for ( ; (elem = elems[i]) != null; i++ ) {
  4845. if ( !keepData && elem.nodeType === 1 ) {
  4846. jQuery.cleanData( getAll( elem ) );
  4847. }
  4848. if ( elem.parentNode ) {
  4849. if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
  4850. setGlobalEval( getAll( elem, "script" ) );
  4851. }
  4852. elem.parentNode.removeChild( elem );
  4853. }
  4854. }
  4855. return this;
  4856. },
  4857. empty: function() {
  4858. var elem,
  4859. i = 0;
  4860. for ( ; (elem = this[i]) != null; i++ ) {
  4861. // Remove element nodes and prevent memory leaks
  4862. if ( elem.nodeType === 1 ) {
  4863. jQuery.cleanData( getAll( elem, false ) );
  4864. }
  4865. // Remove any remaining nodes
  4866. while ( elem.firstChild ) {
  4867. elem.removeChild( elem.firstChild );
  4868. }
  4869. // If this is a select, ensure that it displays empty (#12336)
  4870. // Support: IE<9
  4871. if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
  4872. elem.options.length = 0;
  4873. }
  4874. }
  4875. return this;
  4876. },
  4877. clone: function( dataAndEvents, deepDataAndEvents ) {
  4878. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  4879. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  4880. return this.map(function() {
  4881. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  4882. });
  4883. },
  4884. html: function( value ) {
  4885. return access( this, function( value ) {
  4886. var elem = this[ 0 ] || {},
  4887. i = 0,
  4888. l = this.length;
  4889. if ( value === undefined ) {
  4890. return elem.nodeType === 1 ?
  4891. elem.innerHTML.replace( rinlinejQuery, "" ) :
  4892. undefined;
  4893. }
  4894. // See if we can take a shortcut and just use innerHTML
  4895. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  4896. ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
  4897. ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
  4898. !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
  4899. value = value.replace( rxhtmlTag, "<$1></$2>" );
  4900. try {
  4901. for (; i < l; i++ ) {
  4902. // Remove element nodes and prevent memory leaks
  4903. elem = this[i] || {};
  4904. if ( elem.nodeType === 1 ) {
  4905. jQuery.cleanData( getAll( elem, false ) );
  4906. elem.innerHTML = value;
  4907. }
  4908. }
  4909. elem = 0;
  4910. // If using innerHTML throws an exception, use the fallback method
  4911. } catch(e) {}
  4912. }
  4913. if ( elem ) {
  4914. this.empty().append( value );
  4915. }
  4916. }, null, value, arguments.length );
  4917. },
  4918. replaceWith: function() {
  4919. var arg = arguments[ 0 ];
  4920. // Make the changes, replacing each context element with the new content
  4921. this.domManip( arguments, function( elem ) {
  4922. arg = this.parentNode;
  4923. jQuery.cleanData( getAll( this ) );
  4924. if ( arg ) {
  4925. arg.replaceChild( elem, this );
  4926. }
  4927. });
  4928. // Force removal if there was no new content (e.g., from empty arguments)
  4929. return arg && (arg.length || arg.nodeType) ? this : this.remove();
  4930. },
  4931. detach: function( selector ) {
  4932. return this.remove( selector, true );
  4933. },
  4934. domManip: function( args, callback ) {
  4935. // Flatten any nested arrays
  4936. args = concat.apply( [], args );
  4937. var first, node, hasScripts,
  4938. scripts, doc, fragment,
  4939. i = 0,
  4940. l = this.length,
  4941. set = this,
  4942. iNoClone = l - 1,
  4943. value = args[0],
  4944. isFunction = jQuery.isFunction( value );
  4945. // We can't cloneNode fragments that contain checked, in WebKit
  4946. if ( isFunction ||
  4947. ( l > 1 && typeof value === "string" &&
  4948. !support.checkClone && rchecked.test( value ) ) ) {
  4949. return this.each(function( index ) {
  4950. var self = set.eq( index );
  4951. if ( isFunction ) {
  4952. args[0] = value.call( this, index, self.html() );
  4953. }
  4954. self.domManip( args, callback );
  4955. });
  4956. }
  4957. if ( l ) {
  4958. fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
  4959. first = fragment.firstChild;
  4960. if ( fragment.childNodes.length === 1 ) {
  4961. fragment = first;
  4962. }
  4963. if ( first ) {
  4964. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  4965. hasScripts = scripts.length;
  4966. // Use the original fragment for the last item instead of the first because it can end up
  4967. // being emptied incorrectly in certain situations (#8070).
  4968. for ( ; i < l; i++ ) {
  4969. node = fragment;
  4970. if ( i !== iNoClone ) {
  4971. node = jQuery.clone( node, true, true );
  4972. // Keep references to cloned scripts for later restoration
  4973. if ( hasScripts ) {
  4974. jQuery.merge( scripts, getAll( node, "script" ) );
  4975. }
  4976. }
  4977. callback.call( this[i], node, i );
  4978. }
  4979. if ( hasScripts ) {
  4980. doc = scripts[ scripts.length - 1 ].ownerDocument;
  4981. // Reenable scripts
  4982. jQuery.map( scripts, restoreScript );
  4983. // Evaluate executable scripts on first document insertion
  4984. for ( i = 0; i < hasScripts; i++ ) {
  4985. node = scripts[ i ];
  4986. if ( rscriptType.test( node.type || "" ) &&
  4987. !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
  4988. if ( node.src ) {
  4989. // Optional AJAX dependency, but won't run scripts if not present
  4990. if ( jQuery._evalUrl ) {
  4991. jQuery._evalUrl( node.src );
  4992. }
  4993. } else {
  4994. jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
  4995. }
  4996. }
  4997. }
  4998. }
  4999. // Fix #11809: Avoid leaking memory
  5000. fragment = first = null;
  5001. }
  5002. }
  5003. return this;
  5004. }
  5005. });
  5006. jQuery.each({
  5007. appendTo: "append",
  5008. prependTo: "prepend",
  5009. insertBefore: "before",
  5010. insertAfter: "after",
  5011. replaceAll: "replaceWith"
  5012. }, function( name, original ) {
  5013. jQuery.fn[ name ] = function( selector ) {
  5014. var elems,
  5015. i = 0,
  5016. ret = [],
  5017. insert = jQuery( selector ),
  5018. last = insert.length - 1;
  5019. for ( ; i <= last; i++ ) {
  5020. elems = i === last ? this : this.clone(true);
  5021. jQuery( insert[i] )[ original ]( elems );
  5022. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  5023. push.apply( ret, elems.get() );
  5024. }
  5025. return this.pushStack( ret );
  5026. };
  5027. });
  5028. var iframe,
  5029. elemdisplay = {};
  5030. /**
  5031. * Retrieve the actual display of a element
  5032. * @param {String} name nodeName of the element
  5033. * @param {Object} doc Document object
  5034. */
  5035. // Called only from within defaultDisplay
  5036. function actualDisplay( name, doc ) {
  5037. var style,
  5038. elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
  5039. // getDefaultComputedStyle might be reliably used only on attached element
  5040. display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
  5041. // Use of this method is a temporary fix (more like optmization) until something better comes along,
  5042. // since it was removed from specification and supported only in FF
  5043. style.display : jQuery.css( elem[ 0 ], "display" );
  5044. // We don't have any data stored on the element,
  5045. // so use "detach" method as fast way to get rid of the element
  5046. elem.detach();
  5047. return display;
  5048. }
  5049. /**
  5050. * Try to determine the default display value of an element
  5051. * @param {String} nodeName
  5052. */
  5053. function defaultDisplay( nodeName ) {
  5054. var doc = document,
  5055. display = elemdisplay[ nodeName ];
  5056. if ( !display ) {
  5057. display = actualDisplay( nodeName, doc );
  5058. // If the simple way fails, read from inside an iframe
  5059. if ( display === "none" || !display ) {
  5060. // Use the already-created iframe if possible
  5061. iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
  5062. // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
  5063. doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
  5064. // Support: IE
  5065. doc.write();
  5066. doc.close();
  5067. display = actualDisplay( nodeName, doc );
  5068. iframe.detach();
  5069. }
  5070. // Store the correct default display
  5071. elemdisplay[ nodeName ] = display;
  5072. }
  5073. return display;
  5074. }
  5075. (function() {
  5076. var shrinkWrapBlocksVal;
  5077. support.shrinkWrapBlocks = function() {
  5078. if ( shrinkWrapBlocksVal != null ) {
  5079. return shrinkWrapBlocksVal;
  5080. }
  5081. // Will be changed later if needed.
  5082. shrinkWrapBlocksVal = false;
  5083. // Minified: var b,c,d
  5084. var div, body, container;
  5085. body = document.getElementsByTagName( "body" )[ 0 ];
  5086. if ( !body || !body.style ) {
  5087. // Test fired too early or in an unsupported environment, exit.
  5088. return;
  5089. }
  5090. // Setup
  5091. div = document.createElement( "div" );
  5092. container = document.createElement( "div" );
  5093. container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
  5094. body.appendChild( container ).appendChild( div );
  5095. // Support: IE6
  5096. // Check if elements with layout shrink-wrap their children
  5097. if ( typeof div.style.zoom !== strundefined ) {
  5098. // Reset CSS: box-sizing; display; margin; border
  5099. div.style.cssText =
  5100. // Support: Firefox<29, Android 2.3
  5101. // Vendor-prefix box-sizing
  5102. "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
  5103. "box-sizing:content-box;display:block;margin:0;border:0;" +
  5104. "padding:1px;width:1px;zoom:1";
  5105. div.appendChild( document.createElement( "div" ) ).style.width = "5px";
  5106. shrinkWrapBlocksVal = div.offsetWidth !== 3;
  5107. }
  5108. body.removeChild( container );
  5109. return shrinkWrapBlocksVal;
  5110. };
  5111. })();
  5112. var rmargin = (/^margin/);
  5113. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  5114. var getStyles, curCSS,
  5115. rposition = /^(top|right|bottom|left)$/;
  5116. if ( window.getComputedStyle ) {
  5117. getStyles = function( elem ) {
  5118. // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
  5119. // IE throws on elements created in popups
  5120. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  5121. if ( elem.ownerDocument.defaultView.opener ) {
  5122. return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
  5123. }
  5124. return window.getComputedStyle( elem, null );
  5125. };
  5126. curCSS = function( elem, name, computed ) {
  5127. var width, minWidth, maxWidth, ret,
  5128. style = elem.style;
  5129. computed = computed || getStyles( elem );
  5130. // getPropertyValue is only needed for .css('filter') in IE9, see #12537
  5131. ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
  5132. if ( computed ) {
  5133. if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
  5134. ret = jQuery.style( elem, name );
  5135. }
  5136. // A tribute to the "awesome hack by Dean Edwards"
  5137. // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
  5138. // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
  5139. // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
  5140. if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
  5141. // Remember the original values
  5142. width = style.width;
  5143. minWidth = style.minWidth;
  5144. maxWidth = style.maxWidth;
  5145. // Put in the new values to get a computed value out
  5146. style.minWidth = style.maxWidth = style.width = ret;
  5147. ret = computed.width;
  5148. // Revert the changed values
  5149. style.width = width;
  5150. style.minWidth = minWidth;
  5151. style.maxWidth = maxWidth;
  5152. }
  5153. }
  5154. // Support: IE
  5155. // IE returns zIndex value as an integer.
  5156. return ret === undefined ?
  5157. ret :
  5158. ret + "";
  5159. };
  5160. } else if ( document.documentElement.currentStyle ) {
  5161. getStyles = function( elem ) {
  5162. return elem.currentStyle;
  5163. };
  5164. curCSS = function( elem, name, computed ) {
  5165. var left, rs, rsLeft, ret,
  5166. style = elem.style;
  5167. computed = computed || getStyles( elem );
  5168. ret = computed ? computed[ name ] : undefined;
  5169. // Avoid setting ret to empty string here
  5170. // so we don't default to auto
  5171. if ( ret == null && style && style[ name ] ) {
  5172. ret = style[ name ];
  5173. }
  5174. // From the awesome hack by Dean Edwards
  5175. // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
  5176. // If we're not dealing with a regular pixel number
  5177. // but a number that has a weird ending, we need to convert it to pixels
  5178. // but not position css attributes, as those are proportional to the parent element instead
  5179. // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
  5180. if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
  5181. // Remember the original values
  5182. left = style.left;
  5183. rs = elem.runtimeStyle;
  5184. rsLeft = rs && rs.left;
  5185. // Put in the new values to get a computed value out
  5186. if ( rsLeft ) {
  5187. rs.left = elem.currentStyle.left;
  5188. }
  5189. style.left = name === "fontSize" ? "1em" : ret;
  5190. ret = style.pixelLeft + "px";
  5191. // Revert the changed values
  5192. style.left = left;
  5193. if ( rsLeft ) {
  5194. rs.left = rsLeft;
  5195. }
  5196. }
  5197. // Support: IE
  5198. // IE returns zIndex value as an integer.
  5199. return ret === undefined ?
  5200. ret :
  5201. ret + "" || "auto";
  5202. };
  5203. }
  5204. function addGetHookIf( conditionFn, hookFn ) {
  5205. // Define the hook, we'll check on the first run if it's really needed.
  5206. return {
  5207. get: function() {
  5208. var condition = conditionFn();
  5209. if ( condition == null ) {
  5210. // The test was not ready at this point; screw the hook this time
  5211. // but check again when needed next time.
  5212. return;
  5213. }
  5214. if ( condition ) {
  5215. // Hook not needed (or it's not possible to use it due to missing dependency),
  5216. // remove it.
  5217. // Since there are no other hooks for marginRight, remove the whole object.
  5218. delete this.get;
  5219. return;
  5220. }
  5221. // Hook needed; redefine it so that the support test is not executed again.
  5222. return (this.get = hookFn).apply( this, arguments );
  5223. }
  5224. };
  5225. }
  5226. (function() {
  5227. // Minified: var b,c,d,e,f,g, h,i
  5228. var div, style, a, pixelPositionVal, boxSizingReliableVal,
  5229. reliableHiddenOffsetsVal, reliableMarginRightVal;
  5230. // Setup
  5231. div = document.createElement( "div" );
  5232. div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
  5233. a = div.getElementsByTagName( "a" )[ 0 ];
  5234. style = a && a.style;
  5235. // Finish early in limited (non-browser) environments
  5236. if ( !style ) {
  5237. return;
  5238. }
  5239. style.cssText = "float:left;opacity:.5";
  5240. // Support: IE<9
  5241. // Make sure that element opacity exists (as opposed to filter)
  5242. support.opacity = style.opacity === "0.5";
  5243. // Verify style float existence
  5244. // (IE uses styleFloat instead of cssFloat)
  5245. support.cssFloat = !!style.cssFloat;
  5246. div.style.backgroundClip = "content-box";
  5247. div.cloneNode( true ).style.backgroundClip = "";
  5248. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  5249. // Support: Firefox<29, Android 2.3
  5250. // Vendor-prefix box-sizing
  5251. support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||
  5252. style.WebkitBoxSizing === "";
  5253. jQuery.extend(support, {
  5254. reliableHiddenOffsets: function() {
  5255. if ( reliableHiddenOffsetsVal == null ) {
  5256. computeStyleTests();
  5257. }
  5258. return reliableHiddenOffsetsVal;
  5259. },
  5260. boxSizingReliable: function() {
  5261. if ( boxSizingReliableVal == null ) {
  5262. computeStyleTests();
  5263. }
  5264. return boxSizingReliableVal;
  5265. },
  5266. pixelPosition: function() {
  5267. if ( pixelPositionVal == null ) {
  5268. computeStyleTests();
  5269. }
  5270. return pixelPositionVal;
  5271. },
  5272. // Support: Android 2.3
  5273. reliableMarginRight: function() {
  5274. if ( reliableMarginRightVal == null ) {
  5275. computeStyleTests();
  5276. }
  5277. return reliableMarginRightVal;
  5278. }
  5279. });
  5280. function computeStyleTests() {
  5281. // Minified: var b,c,d,j
  5282. var div, body, container, contents;
  5283. body = document.getElementsByTagName( "body" )[ 0 ];
  5284. if ( !body || !body.style ) {
  5285. // Test fired too early or in an unsupported environment, exit.
  5286. return;
  5287. }
  5288. // Setup
  5289. div = document.createElement( "div" );
  5290. container = document.createElement( "div" );
  5291. container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
  5292. body.appendChild( container ).appendChild( div );
  5293. div.style.cssText =
  5294. // Support: Firefox<29, Android 2.3
  5295. // Vendor-prefix box-sizing
  5296. "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
  5297. "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
  5298. "border:1px;padding:1px;width:4px;position:absolute";
  5299. // Support: IE<9
  5300. // Assume reasonable values in the absence of getComputedStyle
  5301. pixelPositionVal = boxSizingReliableVal = false;
  5302. reliableMarginRightVal = true;
  5303. // Check for getComputedStyle so that this code is not run in IE<9.
  5304. if ( window.getComputedStyle ) {
  5305. pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
  5306. boxSizingReliableVal =
  5307. ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
  5308. // Support: Android 2.3
  5309. // Div with explicit width and no margin-right incorrectly
  5310. // gets computed margin-right based on width of container (#3333)
  5311. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  5312. contents = div.appendChild( document.createElement( "div" ) );
  5313. // Reset CSS: box-sizing; display; margin; border; padding
  5314. contents.style.cssText = div.style.cssText =
  5315. // Support: Firefox<29, Android 2.3
  5316. // Vendor-prefix box-sizing
  5317. "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
  5318. "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
  5319. contents.style.marginRight = contents.style.width = "0";
  5320. div.style.width = "1px";
  5321. reliableMarginRightVal =
  5322. !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
  5323. div.removeChild( contents );
  5324. }
  5325. // Support: IE8
  5326. // Check if table cells still have offsetWidth/Height when they are set
  5327. // to display:none and there are still other visible table cells in a
  5328. // table row; if so, offsetWidth/Height are not reliable for use when
  5329. // determining if an element has been hidden directly using
  5330. // display:none (it is still safe to use offsets if a parent element is
  5331. // hidden; don safety goggles and see bug #4512 for more information).
  5332. div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
  5333. contents = div.getElementsByTagName( "td" );
  5334. contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
  5335. reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
  5336. if ( reliableHiddenOffsetsVal ) {
  5337. contents[ 0 ].style.display = "";
  5338. contents[ 1 ].style.display = "none";
  5339. reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
  5340. }
  5341. body.removeChild( container );
  5342. }
  5343. })();
  5344. // A method for quickly swapping in/out CSS properties to get correct calculations.
  5345. jQuery.swap = function( elem, options, callback, args ) {
  5346. var ret, name,
  5347. old = {};
  5348. // Remember the old values, and insert the new ones
  5349. for ( name in options ) {
  5350. old[ name ] = elem.style[ name ];
  5351. elem.style[ name ] = options[ name ];
  5352. }
  5353. ret = callback.apply( elem, args || [] );
  5354. // Revert the old values
  5355. for ( name in options ) {
  5356. elem.style[ name ] = old[ name ];
  5357. }
  5358. return ret;
  5359. };
  5360. var
  5361. ralpha = /alpha\([^)]*\)/i,
  5362. ropacity = /opacity\s*=\s*([^)]*)/,
  5363. // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
  5364. // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  5365. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  5366. rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
  5367. rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
  5368. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  5369. cssNormalTransform = {
  5370. letterSpacing: "0",
  5371. fontWeight: "400"
  5372. },
  5373. cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
  5374. // return a css property mapped to a potentially vendor prefixed property
  5375. function vendorPropName( style, name ) {
  5376. // shortcut for names that are not vendor prefixed
  5377. if ( name in style ) {
  5378. return name;
  5379. }
  5380. // check for vendor prefixed names
  5381. var capName = name.charAt(0).toUpperCase() + name.slice(1),
  5382. origName = name,
  5383. i = cssPrefixes.length;
  5384. while ( i-- ) {
  5385. name = cssPrefixes[ i ] + capName;
  5386. if ( name in style ) {
  5387. return name;
  5388. }
  5389. }
  5390. return origName;
  5391. }
  5392. function showHide( elements, show ) {
  5393. var display, elem, hidden,
  5394. values = [],
  5395. index = 0,
  5396. length = elements.length;
  5397. for ( ; index < length; index++ ) {
  5398. elem = elements[ index ];
  5399. if ( !elem.style ) {
  5400. continue;
  5401. }
  5402. values[ index ] = jQuery._data( elem, "olddisplay" );
  5403. display = elem.style.display;
  5404. if ( show ) {
  5405. // Reset the inline display of this element to learn if it is
  5406. // being hidden by cascaded rules or not
  5407. if ( !values[ index ] && display === "none" ) {
  5408. elem.style.display = "";
  5409. }
  5410. // Set elements which have been overridden with display: none
  5411. // in a stylesheet to whatever the default browser style is
  5412. // for such an element
  5413. if ( elem.style.display === "" && isHidden( elem ) ) {
  5414. values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
  5415. }
  5416. } else {
  5417. hidden = isHidden( elem );
  5418. if ( display && display !== "none" || !hidden ) {
  5419. jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
  5420. }
  5421. }
  5422. }
  5423. // Set the display of most of the elements in a second loop
  5424. // to avoid the constant reflow
  5425. for ( index = 0; index < length; index++ ) {
  5426. elem = elements[ index ];
  5427. if ( !elem.style ) {
  5428. continue;
  5429. }
  5430. if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
  5431. elem.style.display = show ? values[ index ] || "" : "none";
  5432. }
  5433. }
  5434. return elements;
  5435. }
  5436. function setPositiveNumber( elem, value, subtract ) {
  5437. var matches = rnumsplit.exec( value );
  5438. return matches ?
  5439. // Guard against undefined "subtract", e.g., when used as in cssHooks
  5440. Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
  5441. value;
  5442. }
  5443. function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
  5444. var i = extra === ( isBorderBox ? "border" : "content" ) ?
  5445. // If we already have the right measurement, avoid augmentation
  5446. 4 :
  5447. // Otherwise initialize for horizontal or vertical properties
  5448. name === "width" ? 1 : 0,
  5449. val = 0;
  5450. for ( ; i < 4; i += 2 ) {
  5451. // both box models exclude margin, so add it if we want it
  5452. if ( extra === "margin" ) {
  5453. val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
  5454. }
  5455. if ( isBorderBox ) {
  5456. // border-box includes padding, so remove it if we want content
  5457. if ( extra === "content" ) {
  5458. val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5459. }
  5460. // at this point, extra isn't border nor margin, so remove border
  5461. if ( extra !== "margin" ) {
  5462. val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5463. }
  5464. } else {
  5465. // at this point, extra isn't content, so add padding
  5466. val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5467. // at this point, extra isn't content nor padding, so add border
  5468. if ( extra !== "padding" ) {
  5469. val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5470. }
  5471. }
  5472. }
  5473. return val;
  5474. }
  5475. function getWidthOrHeight( elem, name, extra ) {
  5476. // Start with offset property, which is equivalent to the border-box value
  5477. var valueIsBorderBox = true,
  5478. val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
  5479. styles = getStyles( elem ),
  5480. isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  5481. // some non-html elements return undefined for offsetWidth, so check for null/undefined
  5482. // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
  5483. // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
  5484. if ( val <= 0 || val == null ) {
  5485. // Fall back to computed then uncomputed css if necessary
  5486. val = curCSS( elem, name, styles );
  5487. if ( val < 0 || val == null ) {
  5488. val = elem.style[ name ];
  5489. }
  5490. // Computed unit is not pixels. Stop here and return.
  5491. if ( rnumnonpx.test(val) ) {
  5492. return val;
  5493. }
  5494. // we need the check for style in case a browser which returns unreliable values
  5495. // for getComputedStyle silently falls back to the reliable elem.style
  5496. valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
  5497. // Normalize "", auto, and prepare for extra
  5498. val = parseFloat( val ) || 0;
  5499. }
  5500. // use the active box-sizing model to add/subtract irrelevant styles
  5501. return ( val +
  5502. augmentWidthOrHeight(
  5503. elem,
  5504. name,
  5505. extra || ( isBorderBox ? "border" : "content" ),
  5506. valueIsBorderBox,
  5507. styles
  5508. )
  5509. ) + "px";
  5510. }
  5511. jQuery.extend({
  5512. // Add in style property hooks for overriding the default
  5513. // behavior of getting and setting a style property
  5514. cssHooks: {
  5515. opacity: {
  5516. get: function( elem, computed ) {
  5517. if ( computed ) {
  5518. // We should always get a number back from opacity
  5519. var ret = curCSS( elem, "opacity" );
  5520. return ret === "" ? "1" : ret;
  5521. }
  5522. }
  5523. }
  5524. },
  5525. // Don't automatically add "px" to these possibly-unitless properties
  5526. cssNumber: {
  5527. "columnCount": true,
  5528. "fillOpacity": true,
  5529. "flexGrow": true,
  5530. "flexShrink": true,
  5531. "fontWeight": true,
  5532. "lineHeight": true,
  5533. "opacity": true,
  5534. "order": true,
  5535. "orphans": true,
  5536. "widows": true,
  5537. "zIndex": true,
  5538. "zoom": true
  5539. },
  5540. // Add in properties whose names you wish to fix before
  5541. // setting or getting the value
  5542. cssProps: {
  5543. // normalize float css property
  5544. "float": support.cssFloat ? "cssFloat" : "styleFloat"
  5545. },
  5546. // Get and set the style property on a DOM Node
  5547. style: function( elem, name, value, extra ) {
  5548. // Don't set styles on text and comment nodes
  5549. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5550. return;
  5551. }
  5552. // Make sure that we're working with the right name
  5553. var ret, type, hooks,
  5554. origName = jQuery.camelCase( name ),
  5555. style = elem.style;
  5556. name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
  5557. // gets hook for the prefixed version
  5558. // followed by the unprefixed version
  5559. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5560. // Check if we're setting a value
  5561. if ( value !== undefined ) {
  5562. type = typeof value;
  5563. // convert relative number strings (+= or -=) to relative numbers. #7345
  5564. if ( type === "string" && (ret = rrelNum.exec( value )) ) {
  5565. value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
  5566. // Fixes bug #9237
  5567. type = "number";
  5568. }
  5569. // Make sure that null and NaN values aren't set. See: #7116
  5570. if ( value == null || value !== value ) {
  5571. return;
  5572. }
  5573. // If a number was passed in, add 'px' to the (except for certain CSS properties)
  5574. if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
  5575. value += "px";
  5576. }
  5577. // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
  5578. // but it would mean to define eight (for every problematic property) identical functions
  5579. if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
  5580. style[ name ] = "inherit";
  5581. }
  5582. // If a hook was provided, use that value, otherwise just set the specified value
  5583. if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
  5584. // Support: IE
  5585. // Swallow errors from 'invalid' CSS values (#5509)
  5586. try {
  5587. style[ name ] = value;
  5588. } catch(e) {}
  5589. }
  5590. } else {
  5591. // If a hook was provided get the non-computed value from there
  5592. if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
  5593. return ret;
  5594. }
  5595. // Otherwise just get the value from the style object
  5596. return style[ name ];
  5597. }
  5598. },
  5599. css: function( elem, name, extra, styles ) {
  5600. var num, val, hooks,
  5601. origName = jQuery.camelCase( name );
  5602. // Make sure that we're working with the right name
  5603. name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
  5604. // gets hook for the prefixed version
  5605. // followed by the unprefixed version
  5606. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5607. // If a hook was provided get the computed value from there
  5608. if ( hooks && "get" in hooks ) {
  5609. val = hooks.get( elem, true, extra );
  5610. }
  5611. // Otherwise, if a way to get the computed value exists, use that
  5612. if ( val === undefined ) {
  5613. val = curCSS( elem, name, styles );
  5614. }
  5615. //convert "normal" to computed value
  5616. if ( val === "normal" && name in cssNormalTransform ) {
  5617. val = cssNormalTransform[ name ];
  5618. }
  5619. // Return, converting to number if forced or a qualifier was provided and val looks numeric
  5620. if ( extra === "" || extra ) {
  5621. num = parseFloat( val );
  5622. return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
  5623. }
  5624. return val;
  5625. }
  5626. });
  5627. jQuery.each([ "height", "width" ], function( i, name ) {
  5628. jQuery.cssHooks[ name ] = {
  5629. get: function( elem, computed, extra ) {
  5630. if ( computed ) {
  5631. // certain elements can have dimension info if we invisibly show them
  5632. // however, it must have a current display style that would benefit from this
  5633. return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
  5634. jQuery.swap( elem, cssShow, function() {
  5635. return getWidthOrHeight( elem, name, extra );
  5636. }) :
  5637. getWidthOrHeight( elem, name, extra );
  5638. }
  5639. },
  5640. set: function( elem, value, extra ) {
  5641. var styles = extra && getStyles( elem );
  5642. return setPositiveNumber( elem, value, extra ?
  5643. augmentWidthOrHeight(
  5644. elem,
  5645. name,
  5646. extra,
  5647. support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5648. styles
  5649. ) : 0
  5650. );
  5651. }
  5652. };
  5653. });
  5654. if ( !support.opacity ) {
  5655. jQuery.cssHooks.opacity = {
  5656. get: function( elem, computed ) {
  5657. // IE uses filters for opacity
  5658. return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
  5659. ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
  5660. computed ? "1" : "";
  5661. },
  5662. set: function( elem, value ) {
  5663. var style = elem.style,
  5664. currentStyle = elem.currentStyle,
  5665. opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
  5666. filter = currentStyle && currentStyle.filter || style.filter || "";
  5667. // IE has trouble with opacity if it does not have layout
  5668. // Force it by setting the zoom level
  5669. style.zoom = 1;
  5670. // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
  5671. // if value === "", then remove inline opacity #12685
  5672. if ( ( value >= 1 || value === "" ) &&
  5673. jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
  5674. style.removeAttribute ) {
  5675. // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
  5676. // if "filter:" is present at all, clearType is disabled, we want to avoid this
  5677. // style.removeAttribute is IE Only, but so apparently is this code path...
  5678. style.removeAttribute( "filter" );
  5679. // if there is no filter style applied in a css rule or unset inline opacity, we are done
  5680. if ( value === "" || currentStyle && !currentStyle.filter ) {
  5681. return;
  5682. }
  5683. }
  5684. // otherwise, set new filter values
  5685. style.filter = ralpha.test( filter ) ?
  5686. filter.replace( ralpha, opacity ) :
  5687. filter + " " + opacity;
  5688. }
  5689. };
  5690. }
  5691. jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
  5692. function( elem, computed ) {
  5693. if ( computed ) {
  5694. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  5695. // Work around by temporarily setting element display to inline-block
  5696. return jQuery.swap( elem, { "display": "inline-block" },
  5697. curCSS, [ elem, "marginRight" ] );
  5698. }
  5699. }
  5700. );
  5701. // These hooks are used by animate to expand properties
  5702. jQuery.each({
  5703. margin: "",
  5704. padding: "",
  5705. border: "Width"
  5706. }, function( prefix, suffix ) {
  5707. jQuery.cssHooks[ prefix + suffix ] = {
  5708. expand: function( value ) {
  5709. var i = 0,
  5710. expanded = {},
  5711. // assumes a single number if not a string
  5712. parts = typeof value === "string" ? value.split(" ") : [ value ];
  5713. for ( ; i < 4; i++ ) {
  5714. expanded[ prefix + cssExpand[ i ] + suffix ] =
  5715. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  5716. }
  5717. return expanded;
  5718. }
  5719. };
  5720. if ( !rmargin.test( prefix ) ) {
  5721. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  5722. }
  5723. });
  5724. jQuery.fn.extend({
  5725. css: function( name, value ) {
  5726. return access( this, function( elem, name, value ) {
  5727. var styles, len,
  5728. map = {},
  5729. i = 0;
  5730. if ( jQuery.isArray( name ) ) {
  5731. styles = getStyles( elem );
  5732. len = name.length;
  5733. for ( ; i < len; i++ ) {
  5734. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  5735. }
  5736. return map;
  5737. }
  5738. return value !== undefined ?
  5739. jQuery.style( elem, name, value ) :
  5740. jQuery.css( elem, name );
  5741. }, name, value, arguments.length > 1 );
  5742. },
  5743. show: function() {
  5744. return showHide( this, true );
  5745. },
  5746. hide: function() {
  5747. return showHide( this );
  5748. },
  5749. toggle: function( state ) {
  5750. if ( typeof state === "boolean" ) {
  5751. return state ? this.show() : this.hide();
  5752. }
  5753. return this.each(function() {
  5754. if ( isHidden( this ) ) {
  5755. jQuery( this ).show();
  5756. } else {
  5757. jQuery( this ).hide();
  5758. }
  5759. });
  5760. }
  5761. });
  5762. function Tween( elem, options, prop, end, easing ) {
  5763. return new Tween.prototype.init( elem, options, prop, end, easing );
  5764. }
  5765. jQuery.Tween = Tween;
  5766. Tween.prototype = {
  5767. constructor: Tween,
  5768. init: function( elem, options, prop, end, easing, unit ) {
  5769. this.elem = elem;
  5770. this.prop = prop;
  5771. this.easing = easing || "swing";
  5772. this.options = options;
  5773. this.start = this.now = this.cur();
  5774. this.end = end;
  5775. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  5776. },
  5777. cur: function() {
  5778. var hooks = Tween.propHooks[ this.prop ];
  5779. return hooks && hooks.get ?
  5780. hooks.get( this ) :
  5781. Tween.propHooks._default.get( this );
  5782. },
  5783. run: function( percent ) {
  5784. var eased,
  5785. hooks = Tween.propHooks[ this.prop ];
  5786. if ( this.options.duration ) {
  5787. this.pos = eased = jQuery.easing[ this.easing ](
  5788. percent, this.options.duration * percent, 0, 1, this.options.duration
  5789. );
  5790. } else {
  5791. this.pos = eased = percent;
  5792. }
  5793. this.now = ( this.end - this.start ) * eased + this.start;
  5794. if ( this.options.step ) {
  5795. this.options.step.call( this.elem, this.now, this );
  5796. }
  5797. if ( hooks && hooks.set ) {
  5798. hooks.set( this );
  5799. } else {
  5800. Tween.propHooks._default.set( this );
  5801. }
  5802. return this;
  5803. }
  5804. };
  5805. Tween.prototype.init.prototype = Tween.prototype;
  5806. Tween.propHooks = {
  5807. _default: {
  5808. get: function( tween ) {
  5809. var result;
  5810. if ( tween.elem[ tween.prop ] != null &&
  5811. (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
  5812. return tween.elem[ tween.prop ];
  5813. }
  5814. // passing an empty string as a 3rd parameter to .css will automatically
  5815. // attempt a parseFloat and fallback to a string if the parse fails
  5816. // so, simple values such as "10px" are parsed to Float.
  5817. // complex values such as "rotate(1rad)" are returned as is.
  5818. result = jQuery.css( tween.elem, tween.prop, "" );
  5819. // Empty strings, null, undefined and "auto" are converted to 0.
  5820. return !result || result === "auto" ? 0 : result;
  5821. },
  5822. set: function( tween ) {
  5823. // use step hook for back compat - use cssHook if its there - use .style if its
  5824. // available and use plain properties where available
  5825. if ( jQuery.fx.step[ tween.prop ] ) {
  5826. jQuery.fx.step[ tween.prop ]( tween );
  5827. } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
  5828. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  5829. } else {
  5830. tween.elem[ tween.prop ] = tween.now;
  5831. }
  5832. }
  5833. }
  5834. };
  5835. // Support: IE <=9
  5836. // Panic based approach to setting things on disconnected nodes
  5837. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  5838. set: function( tween ) {
  5839. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  5840. tween.elem[ tween.prop ] = tween.now;
  5841. }
  5842. }
  5843. };
  5844. jQuery.easing = {
  5845. linear: function( p ) {
  5846. return p;
  5847. },
  5848. swing: function( p ) {
  5849. return 0.5 - Math.cos( p * Math.PI ) / 2;
  5850. }
  5851. };
  5852. jQuery.fx = Tween.prototype.init;
  5853. // Back Compat <1.8 extension point
  5854. jQuery.fx.step = {};
  5855. var
  5856. fxNow, timerId,
  5857. rfxtypes = /^(?:toggle|show|hide)$/,
  5858. rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
  5859. rrun = /queueHooks$/,
  5860. animationPrefilters = [ defaultPrefilter ],
  5861. tweeners = {
  5862. "*": [ function( prop, value ) {
  5863. var tween = this.createTween( prop, value ),
  5864. target = tween.cur(),
  5865. parts = rfxnum.exec( value ),
  5866. unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  5867. // Starting value computation is required for potential unit mismatches
  5868. start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
  5869. rfxnum.exec( jQuery.css( tween.elem, prop ) ),
  5870. scale = 1,
  5871. maxIterations = 20;
  5872. if ( start && start[ 3 ] !== unit ) {
  5873. // Trust units reported by jQuery.css
  5874. unit = unit || start[ 3 ];
  5875. // Make sure we update the tween properties later on
  5876. parts = parts || [];
  5877. // Iteratively approximate from a nonzero starting point
  5878. start = +target || 1;
  5879. do {
  5880. // If previous iteration zeroed out, double until we get *something*
  5881. // Use a string for doubling factor so we don't accidentally see scale as unchanged below
  5882. scale = scale || ".5";
  5883. // Adjust and apply
  5884. start = start / scale;
  5885. jQuery.style( tween.elem, prop, start + unit );
  5886. // Update scale, tolerating zero or NaN from tween.cur()
  5887. // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
  5888. } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
  5889. }
  5890. // Update tween properties
  5891. if ( parts ) {
  5892. start = tween.start = +start || +target || 0;
  5893. tween.unit = unit;
  5894. // If a +=/-= token was provided, we're doing a relative animation
  5895. tween.end = parts[ 1 ] ?
  5896. start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
  5897. +parts[ 2 ];
  5898. }
  5899. return tween;
  5900. } ]
  5901. };
  5902. // Animations created synchronously will run synchronously
  5903. function createFxNow() {
  5904. setTimeout(function() {
  5905. fxNow = undefined;
  5906. });
  5907. return ( fxNow = jQuery.now() );
  5908. }
  5909. // Generate parameters to create a standard animation
  5910. function genFx( type, includeWidth ) {
  5911. var which,
  5912. attrs = { height: type },
  5913. i = 0;
  5914. // if we include width, step value is 1 to do all cssExpand values,
  5915. // if we don't include width, step value is 2 to skip over Left and Right
  5916. includeWidth = includeWidth ? 1 : 0;
  5917. for ( ; i < 4 ; i += 2 - includeWidth ) {
  5918. which = cssExpand[ i ];
  5919. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  5920. }
  5921. if ( includeWidth ) {
  5922. attrs.opacity = attrs.width = type;
  5923. }
  5924. return attrs;
  5925. }
  5926. function createTween( value, prop, animation ) {
  5927. var tween,
  5928. collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
  5929. index = 0,
  5930. length = collection.length;
  5931. for ( ; index < length; index++ ) {
  5932. if ( (tween = collection[ index ].call( animation, prop, value )) ) {
  5933. // we're done with this property
  5934. return tween;
  5935. }
  5936. }
  5937. }
  5938. function defaultPrefilter( elem, props, opts ) {
  5939. /* jshint validthis: true */
  5940. var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
  5941. anim = this,
  5942. orig = {},
  5943. style = elem.style,
  5944. hidden = elem.nodeType && isHidden( elem ),
  5945. dataShow = jQuery._data( elem, "fxshow" );
  5946. // handle queue: false promises
  5947. if ( !opts.queue ) {
  5948. hooks = jQuery._queueHooks( elem, "fx" );
  5949. if ( hooks.unqueued == null ) {
  5950. hooks.unqueued = 0;
  5951. oldfire = hooks.empty.fire;
  5952. hooks.empty.fire = function() {
  5953. if ( !hooks.unqueued ) {
  5954. oldfire();
  5955. }
  5956. };
  5957. }
  5958. hooks.unqueued++;
  5959. anim.always(function() {
  5960. // doing this makes sure that the complete handler will be called
  5961. // before this completes
  5962. anim.always(function() {
  5963. hooks.unqueued--;
  5964. if ( !jQuery.queue( elem, "fx" ).length ) {
  5965. hooks.empty.fire();
  5966. }
  5967. });
  5968. });
  5969. }
  5970. // height/width overflow pass
  5971. if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
  5972. // Make sure that nothing sneaks out
  5973. // Record all 3 overflow attributes because IE does not
  5974. // change the overflow attribute when overflowX and
  5975. // overflowY are set to the same value
  5976. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  5977. // Set display property to inline-block for height/width
  5978. // animations on inline elements that are having width/height animated
  5979. display = jQuery.css( elem, "display" );
  5980. // Test default display if display is currently "none"
  5981. checkDisplay = display === "none" ?
  5982. jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
  5983. if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
  5984. // inline-level elements accept inline-block;
  5985. // block-level elements need to be inline with layout
  5986. if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
  5987. style.display = "inline-block";
  5988. } else {
  5989. style.zoom = 1;
  5990. }
  5991. }
  5992. }
  5993. if ( opts.overflow ) {
  5994. style.overflow = "hidden";
  5995. if ( !support.shrinkWrapBlocks() ) {
  5996. anim.always(function() {
  5997. style.overflow = opts.overflow[ 0 ];
  5998. style.overflowX = opts.overflow[ 1 ];
  5999. style.overflowY = opts.overflow[ 2 ];
  6000. });
  6001. }
  6002. }
  6003. // show/hide pass
  6004. for ( prop in props ) {
  6005. value = props[ prop ];
  6006. if ( rfxtypes.exec( value ) ) {
  6007. delete props[ prop ];
  6008. toggle = toggle || value === "toggle";
  6009. if ( value === ( hidden ? "hide" : "show" ) ) {
  6010. // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
  6011. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  6012. hidden = true;
  6013. } else {
  6014. continue;
  6015. }
  6016. }
  6017. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  6018. // Any non-fx value stops us from restoring the original display value
  6019. } else {
  6020. display = undefined;
  6021. }
  6022. }
  6023. if ( !jQuery.isEmptyObject( orig ) ) {
  6024. if ( dataShow ) {
  6025. if ( "hidden" in dataShow ) {
  6026. hidden = dataShow.hidden;
  6027. }
  6028. } else {
  6029. dataShow = jQuery._data( elem, "fxshow", {} );
  6030. }
  6031. // store state if its toggle - enables .stop().toggle() to "reverse"
  6032. if ( toggle ) {
  6033. dataShow.hidden = !hidden;
  6034. }
  6035. if ( hidden ) {
  6036. jQuery( elem ).show();
  6037. } else {
  6038. anim.done(function() {
  6039. jQuery( elem ).hide();
  6040. });
  6041. }
  6042. anim.done(function() {
  6043. var prop;
  6044. jQuery._removeData( elem, "fxshow" );
  6045. for ( prop in orig ) {
  6046. jQuery.style( elem, prop, orig[ prop ] );
  6047. }
  6048. });
  6049. for ( prop in orig ) {
  6050. tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  6051. if ( !( prop in dataShow ) ) {
  6052. dataShow[ prop ] = tween.start;
  6053. if ( hidden ) {
  6054. tween.end = tween.start;
  6055. tween.start = prop === "width" || prop === "height" ? 1 : 0;
  6056. }
  6057. }
  6058. }
  6059. // If this is a noop like .hide().hide(), restore an overwritten display value
  6060. } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
  6061. style.display = display;
  6062. }
  6063. }
  6064. function propFilter( props, specialEasing ) {
  6065. var index, name, easing, value, hooks;
  6066. // camelCase, specialEasing and expand cssHook pass
  6067. for ( index in props ) {
  6068. name = jQuery.camelCase( index );
  6069. easing = specialEasing[ name ];
  6070. value = props[ index ];
  6071. if ( jQuery.isArray( value ) ) {
  6072. easing = value[ 1 ];
  6073. value = props[ index ] = value[ 0 ];
  6074. }
  6075. if ( index !== name ) {
  6076. props[ name ] = value;
  6077. delete props[ index ];
  6078. }
  6079. hooks = jQuery.cssHooks[ name ];
  6080. if ( hooks && "expand" in hooks ) {
  6081. value = hooks.expand( value );
  6082. delete props[ name ];
  6083. // not quite $.extend, this wont overwrite keys already present.
  6084. // also - reusing 'index' from above because we have the correct "name"
  6085. for ( index in value ) {
  6086. if ( !( index in props ) ) {
  6087. props[ index ] = value[ index ];
  6088. specialEasing[ index ] = easing;
  6089. }
  6090. }
  6091. } else {
  6092. specialEasing[ name ] = easing;
  6093. }
  6094. }
  6095. }
  6096. function Animation( elem, properties, options ) {
  6097. var result,
  6098. stopped,
  6099. index = 0,
  6100. length = animationPrefilters.length,
  6101. deferred = jQuery.Deferred().always( function() {
  6102. // don't match elem in the :animated selector
  6103. delete tick.elem;
  6104. }),
  6105. tick = function() {
  6106. if ( stopped ) {
  6107. return false;
  6108. }
  6109. var currentTime = fxNow || createFxNow(),
  6110. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  6111. // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
  6112. temp = remaining / animation.duration || 0,
  6113. percent = 1 - temp,
  6114. index = 0,
  6115. length = animation.tweens.length;
  6116. for ( ; index < length ; index++ ) {
  6117. animation.tweens[ index ].run( percent );
  6118. }
  6119. deferred.notifyWith( elem, [ animation, percent, remaining ]);
  6120. if ( percent < 1 && length ) {
  6121. return remaining;
  6122. } else {
  6123. deferred.resolveWith( elem, [ animation ] );
  6124. return false;
  6125. }
  6126. },
  6127. animation = deferred.promise({
  6128. elem: elem,
  6129. props: jQuery.extend( {}, properties ),
  6130. opts: jQuery.extend( true, { specialEasing: {} }, options ),
  6131. originalProperties: properties,
  6132. originalOptions: options,
  6133. startTime: fxNow || createFxNow(),
  6134. duration: options.duration,
  6135. tweens: [],
  6136. createTween: function( prop, end ) {
  6137. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  6138. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  6139. animation.tweens.push( tween );
  6140. return tween;
  6141. },
  6142. stop: function( gotoEnd ) {
  6143. var index = 0,
  6144. // if we are going to the end, we want to run all the tweens
  6145. // otherwise we skip this part
  6146. length = gotoEnd ? animation.tweens.length : 0;
  6147. if ( stopped ) {
  6148. return this;
  6149. }
  6150. stopped = true;
  6151. for ( ; index < length ; index++ ) {
  6152. animation.tweens[ index ].run( 1 );
  6153. }
  6154. // resolve when we played the last frame
  6155. // otherwise, reject
  6156. if ( gotoEnd ) {
  6157. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  6158. } else {
  6159. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  6160. }
  6161. return this;
  6162. }
  6163. }),
  6164. props = animation.props;
  6165. propFilter( props, animation.opts.specialEasing );
  6166. for ( ; index < length ; index++ ) {
  6167. result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
  6168. if ( result ) {
  6169. return result;
  6170. }
  6171. }
  6172. jQuery.map( props, createTween, animation );
  6173. if ( jQuery.isFunction( animation.opts.start ) ) {
  6174. animation.opts.start.call( elem, animation );
  6175. }
  6176. jQuery.fx.timer(
  6177. jQuery.extend( tick, {
  6178. elem: elem,
  6179. anim: animation,
  6180. queue: animation.opts.queue
  6181. })
  6182. );
  6183. // attach callbacks from options
  6184. return animation.progress( animation.opts.progress )
  6185. .done( animation.opts.done, animation.opts.complete )
  6186. .fail( animation.opts.fail )
  6187. .always( animation.opts.always );
  6188. }
  6189. jQuery.Animation = jQuery.extend( Animation, {
  6190. tweener: function( props, callback ) {
  6191. if ( jQuery.isFunction( props ) ) {
  6192. callback = props;
  6193. props = [ "*" ];
  6194. } else {
  6195. props = props.split(" ");
  6196. }
  6197. var prop,
  6198. index = 0,
  6199. length = props.length;
  6200. for ( ; index < length ; index++ ) {
  6201. prop = props[ index ];
  6202. tweeners[ prop ] = tweeners[ prop ] || [];
  6203. tweeners[ prop ].unshift( callback );
  6204. }
  6205. },
  6206. prefilter: function( callback, prepend ) {
  6207. if ( prepend ) {
  6208. animationPrefilters.unshift( callback );
  6209. } else {
  6210. animationPrefilters.push( callback );
  6211. }
  6212. }
  6213. });
  6214. jQuery.speed = function( speed, easing, fn ) {
  6215. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  6216. complete: fn || !fn && easing ||
  6217. jQuery.isFunction( speed ) && speed,
  6218. duration: speed,
  6219. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  6220. };
  6221. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  6222. opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
  6223. // normalize opt.queue - true/undefined/null -> "fx"
  6224. if ( opt.queue == null || opt.queue === true ) {
  6225. opt.queue = "fx";
  6226. }
  6227. // Queueing
  6228. opt.old = opt.complete;
  6229. opt.complete = function() {
  6230. if ( jQuery.isFunction( opt.old ) ) {
  6231. opt.old.call( this );
  6232. }
  6233. if ( opt.queue ) {
  6234. jQuery.dequeue( this, opt.queue );
  6235. }
  6236. };
  6237. return opt;
  6238. };
  6239. jQuery.fn.extend({
  6240. fadeTo: function( speed, to, easing, callback ) {
  6241. // show any hidden elements after setting opacity to 0
  6242. return this.filter( isHidden ).css( "opacity", 0 ).show()
  6243. // animate to the value specified
  6244. .end().animate({ opacity: to }, speed, easing, callback );
  6245. },
  6246. animate: function( prop, speed, easing, callback ) {
  6247. var empty = jQuery.isEmptyObject( prop ),
  6248. optall = jQuery.speed( speed, easing, callback ),
  6249. doAnimation = function() {
  6250. // Operate on a copy of prop so per-property easing won't be lost
  6251. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  6252. // Empty animations, or finishing resolves immediately
  6253. if ( empty || jQuery._data( this, "finish" ) ) {
  6254. anim.stop( true );
  6255. }
  6256. };
  6257. doAnimation.finish = doAnimation;
  6258. return empty || optall.queue === false ?
  6259. this.each( doAnimation ) :
  6260. this.queue( optall.queue, doAnimation );
  6261. },
  6262. stop: function( type, clearQueue, gotoEnd ) {
  6263. var stopQueue = function( hooks ) {
  6264. var stop = hooks.stop;
  6265. delete hooks.stop;
  6266. stop( gotoEnd );
  6267. };
  6268. if ( typeof type !== "string" ) {
  6269. gotoEnd = clearQueue;
  6270. clearQueue = type;
  6271. type = undefined;
  6272. }
  6273. if ( clearQueue && type !== false ) {
  6274. this.queue( type || "fx", [] );
  6275. }
  6276. return this.each(function() {
  6277. var dequeue = true,
  6278. index = type != null && type + "queueHooks",
  6279. timers = jQuery.timers,
  6280. data = jQuery._data( this );
  6281. if ( index ) {
  6282. if ( data[ index ] && data[ index ].stop ) {
  6283. stopQueue( data[ index ] );
  6284. }
  6285. } else {
  6286. for ( index in data ) {
  6287. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  6288. stopQueue( data[ index ] );
  6289. }
  6290. }
  6291. }
  6292. for ( index = timers.length; index--; ) {
  6293. if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
  6294. timers[ index ].anim.stop( gotoEnd );
  6295. dequeue = false;
  6296. timers.splice( index, 1 );
  6297. }
  6298. }
  6299. // start the next in the queue if the last step wasn't forced
  6300. // timers currently will call their complete callbacks, which will dequeue
  6301. // but only if they were gotoEnd
  6302. if ( dequeue || !gotoEnd ) {
  6303. jQuery.dequeue( this, type );
  6304. }
  6305. });
  6306. },
  6307. finish: function( type ) {
  6308. if ( type !== false ) {
  6309. type = type || "fx";
  6310. }
  6311. return this.each(function() {
  6312. var index,
  6313. data = jQuery._data( this ),
  6314. queue = data[ type + "queue" ],
  6315. hooks = data[ type + "queueHooks" ],
  6316. timers = jQuery.timers,
  6317. length = queue ? queue.length : 0;
  6318. // enable finishing flag on private data
  6319. data.finish = true;
  6320. // empty the queue first
  6321. jQuery.queue( this, type, [] );
  6322. if ( hooks && hooks.stop ) {
  6323. hooks.stop.call( this, true );
  6324. }
  6325. // look for any active animations, and finish them
  6326. for ( index = timers.length; index--; ) {
  6327. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  6328. timers[ index ].anim.stop( true );
  6329. timers.splice( index, 1 );
  6330. }
  6331. }
  6332. // look for any animations in the old queue and finish them
  6333. for ( index = 0; index < length; index++ ) {
  6334. if ( queue[ index ] && queue[ index ].finish ) {
  6335. queue[ index ].finish.call( this );
  6336. }
  6337. }
  6338. // turn off finishing flag
  6339. delete data.finish;
  6340. });
  6341. }
  6342. });
  6343. jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
  6344. var cssFn = jQuery.fn[ name ];
  6345. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6346. return speed == null || typeof speed === "boolean" ?
  6347. cssFn.apply( this, arguments ) :
  6348. this.animate( genFx( name, true ), speed, easing, callback );
  6349. };
  6350. });
  6351. // Generate shortcuts for custom animations
  6352. jQuery.each({
  6353. slideDown: genFx("show"),
  6354. slideUp: genFx("hide"),
  6355. slideToggle: genFx("toggle"),
  6356. fadeIn: { opacity: "show" },
  6357. fadeOut: { opacity: "hide" },
  6358. fadeToggle: { opacity: "toggle" }
  6359. }, function( name, props ) {
  6360. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6361. return this.animate( props, speed, easing, callback );
  6362. };
  6363. });
  6364. jQuery.timers = [];
  6365. jQuery.fx.tick = function() {
  6366. var timer,
  6367. timers = jQuery.timers,
  6368. i = 0;
  6369. fxNow = jQuery.now();
  6370. for ( ; i < timers.length; i++ ) {
  6371. timer = timers[ i ];
  6372. // Checks the timer has not already been removed
  6373. if ( !timer() && timers[ i ] === timer ) {
  6374. timers.splice( i--, 1 );
  6375. }
  6376. }
  6377. if ( !timers.length ) {
  6378. jQuery.fx.stop();
  6379. }
  6380. fxNow = undefined;
  6381. };
  6382. jQuery.fx.timer = function( timer ) {
  6383. jQuery.timers.push( timer );
  6384. if ( timer() ) {
  6385. jQuery.fx.start();
  6386. } else {
  6387. jQuery.timers.pop();
  6388. }
  6389. };
  6390. jQuery.fx.interval = 13;
  6391. jQuery.fx.start = function() {
  6392. if ( !timerId ) {
  6393. timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
  6394. }
  6395. };
  6396. jQuery.fx.stop = function() {
  6397. clearInterval( timerId );
  6398. timerId = null;
  6399. };
  6400. jQuery.fx.speeds = {
  6401. slow: 600,
  6402. fast: 200,
  6403. // Default speed
  6404. _default: 400
  6405. };
  6406. // Based off of the plugin by Clint Helfers, with permission.
  6407. // http://blindsignals.com/index.php/2009/07/jquery-delay/
  6408. jQuery.fn.delay = function( time, type ) {
  6409. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  6410. type = type || "fx";
  6411. return this.queue( type, function( next, hooks ) {
  6412. var timeout = setTimeout( next, time );
  6413. hooks.stop = function() {
  6414. clearTimeout( timeout );
  6415. };
  6416. });
  6417. };
  6418. (function() {
  6419. // Minified: var a,b,c,d,e
  6420. var input, div, select, a, opt;
  6421. // Setup
  6422. div = document.createElement( "div" );
  6423. div.setAttribute( "className", "t" );
  6424. div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
  6425. a = div.getElementsByTagName("a")[ 0 ];
  6426. // First batch of tests.
  6427. select = document.createElement("select");
  6428. opt = select.appendChild( document.createElement("option") );
  6429. input = div.getElementsByTagName("input")[ 0 ];
  6430. a.style.cssText = "top:1px";
  6431. // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
  6432. support.getSetAttribute = div.className !== "t";
  6433. // Get the style information from getAttribute
  6434. // (IE uses .cssText instead)
  6435. support.style = /top/.test( a.getAttribute("style") );
  6436. // Make sure that URLs aren't manipulated
  6437. // (IE normalizes it by default)
  6438. support.hrefNormalized = a.getAttribute("href") === "/a";
  6439. // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
  6440. support.checkOn = !!input.value;
  6441. // Make sure that a selected-by-default option has a working selected property.
  6442. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
  6443. support.optSelected = opt.selected;
  6444. // Tests for enctype support on a form (#6743)
  6445. support.enctype = !!document.createElement("form").enctype;
  6446. // Make sure that the options inside disabled selects aren't marked as disabled
  6447. // (WebKit marks them as disabled)
  6448. select.disabled = true;
  6449. support.optDisabled = !opt.disabled;
  6450. // Support: IE8 only
  6451. // Check if we can trust getAttribute("value")
  6452. input = document.createElement( "input" );
  6453. input.setAttribute( "value", "" );
  6454. support.input = input.getAttribute( "value" ) === "";
  6455. // Check if an input maintains its value after becoming a radio
  6456. input.value = "t";
  6457. input.setAttribute( "type", "radio" );
  6458. support.radioValue = input.value === "t";
  6459. })();
  6460. var rreturn = /\r/g;
  6461. jQuery.fn.extend({
  6462. val: function( value ) {
  6463. var hooks, ret, isFunction,
  6464. elem = this[0];
  6465. if ( !arguments.length ) {
  6466. if ( elem ) {
  6467. hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  6468. if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
  6469. return ret;
  6470. }
  6471. ret = elem.value;
  6472. return typeof ret === "string" ?
  6473. // handle most common string cases
  6474. ret.replace(rreturn, "") :
  6475. // handle cases where value is null/undef or number
  6476. ret == null ? "" : ret;
  6477. }
  6478. return;
  6479. }
  6480. isFunction = jQuery.isFunction( value );
  6481. return this.each(function( i ) {
  6482. var val;
  6483. if ( this.nodeType !== 1 ) {
  6484. return;
  6485. }
  6486. if ( isFunction ) {
  6487. val = value.call( this, i, jQuery( this ).val() );
  6488. } else {
  6489. val = value;
  6490. }
  6491. // Treat null/undefined as ""; convert numbers to string
  6492. if ( val == null ) {
  6493. val = "";
  6494. } else if ( typeof val === "number" ) {
  6495. val += "";
  6496. } else if ( jQuery.isArray( val ) ) {
  6497. val = jQuery.map( val, function( value ) {
  6498. return value == null ? "" : value + "";
  6499. });
  6500. }
  6501. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  6502. // If set returns undefined, fall back to normal setting
  6503. if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
  6504. this.value = val;
  6505. }
  6506. });
  6507. }
  6508. });
  6509. jQuery.extend({
  6510. valHooks: {
  6511. option: {
  6512. get: function( elem ) {
  6513. var val = jQuery.find.attr( elem, "value" );
  6514. return val != null ?
  6515. val :
  6516. // Support: IE10-11+
  6517. // option.text throws exceptions (#14686, #14858)
  6518. jQuery.trim( jQuery.text( elem ) );
  6519. }
  6520. },
  6521. select: {
  6522. get: function( elem ) {
  6523. var value, option,
  6524. options = elem.options,
  6525. index = elem.selectedIndex,
  6526. one = elem.type === "select-one" || index < 0,
  6527. values = one ? null : [],
  6528. max = one ? index + 1 : options.length,
  6529. i = index < 0 ?
  6530. max :
  6531. one ? index : 0;
  6532. // Loop through all the selected options
  6533. for ( ; i < max; i++ ) {
  6534. option = options[ i ];
  6535. // oldIE doesn't update selected after form reset (#2551)
  6536. if ( ( option.selected || i === index ) &&
  6537. // Don't return options that are disabled or in a disabled optgroup
  6538. ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
  6539. ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
  6540. // Get the specific value for the option
  6541. value = jQuery( option ).val();
  6542. // We don't need an array for one selects
  6543. if ( one ) {
  6544. return value;
  6545. }
  6546. // Multi-Selects return an array
  6547. values.push( value );
  6548. }
  6549. }
  6550. return values;
  6551. },
  6552. set: function( elem, value ) {
  6553. var optionSet, option,
  6554. options = elem.options,
  6555. values = jQuery.makeArray( value ),
  6556. i = options.length;
  6557. while ( i-- ) {
  6558. option = options[ i ];
  6559. if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
  6560. // Support: IE6
  6561. // When new option element is added to select box we need to
  6562. // force reflow of newly added node in order to workaround delay
  6563. // of initialization properties
  6564. try {
  6565. option.selected = optionSet = true;
  6566. } catch ( _ ) {
  6567. // Will be executed only in IE6
  6568. option.scrollHeight;
  6569. }
  6570. } else {
  6571. option.selected = false;
  6572. }
  6573. }
  6574. // Force browsers to behave consistently when non-matching value is set
  6575. if ( !optionSet ) {
  6576. elem.selectedIndex = -1;
  6577. }
  6578. return options;
  6579. }
  6580. }
  6581. }
  6582. });
  6583. // Radios and checkboxes getter/setter
  6584. jQuery.each([ "radio", "checkbox" ], function() {
  6585. jQuery.valHooks[ this ] = {
  6586. set: function( elem, value ) {
  6587. if ( jQuery.isArray( value ) ) {
  6588. return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
  6589. }
  6590. }
  6591. };
  6592. if ( !support.checkOn ) {
  6593. jQuery.valHooks[ this ].get = function( elem ) {
  6594. // Support: Webkit
  6595. // "" is returned instead of "on" if a value isn't specified
  6596. return elem.getAttribute("value") === null ? "on" : elem.value;
  6597. };
  6598. }
  6599. });
  6600. var nodeHook, boolHook,
  6601. attrHandle = jQuery.expr.attrHandle,
  6602. ruseDefault = /^(?:checked|selected)$/i,
  6603. getSetAttribute = support.getSetAttribute,
  6604. getSetInput = support.input;
  6605. jQuery.fn.extend({
  6606. attr: function( name, value ) {
  6607. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  6608. },
  6609. removeAttr: function( name ) {
  6610. return this.each(function() {
  6611. jQuery.removeAttr( this, name );
  6612. });
  6613. }
  6614. });
  6615. jQuery.extend({
  6616. attr: function( elem, name, value ) {
  6617. var hooks, ret,
  6618. nType = elem.nodeType;
  6619. // don't get/set attributes on text, comment and attribute nodes
  6620. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  6621. return;
  6622. }
  6623. // Fallback to prop when attributes are not supported
  6624. if ( typeof elem.getAttribute === strundefined ) {
  6625. return jQuery.prop( elem, name, value );
  6626. }
  6627. // All attributes are lowercase
  6628. // Grab necessary hook if one is defined
  6629. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6630. name = name.toLowerCase();
  6631. hooks = jQuery.attrHooks[ name ] ||
  6632. ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
  6633. }
  6634. if ( value !== undefined ) {
  6635. if ( value === null ) {
  6636. jQuery.removeAttr( elem, name );
  6637. } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
  6638. return ret;
  6639. } else {
  6640. elem.setAttribute( name, value + "" );
  6641. return value;
  6642. }
  6643. } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
  6644. return ret;
  6645. } else {
  6646. ret = jQuery.find.attr( elem, name );
  6647. // Non-existent attributes return null, we normalize to undefined
  6648. return ret == null ?
  6649. undefined :
  6650. ret;
  6651. }
  6652. },
  6653. removeAttr: function( elem, value ) {
  6654. var name, propName,
  6655. i = 0,
  6656. attrNames = value && value.match( rnotwhite );
  6657. if ( attrNames && elem.nodeType === 1 ) {
  6658. while ( (name = attrNames[i++]) ) {
  6659. propName = jQuery.propFix[ name ] || name;
  6660. // Boolean attributes get special treatment (#10870)
  6661. if ( jQuery.expr.match.bool.test( name ) ) {
  6662. // Set corresponding property to false
  6663. if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
  6664. elem[ propName ] = false;
  6665. // Support: IE<9
  6666. // Also clear defaultChecked/defaultSelected (if appropriate)
  6667. } else {
  6668. elem[ jQuery.camelCase( "default-" + name ) ] =
  6669. elem[ propName ] = false;
  6670. }
  6671. // See #9699 for explanation of this approach (setting first, then removal)
  6672. } else {
  6673. jQuery.attr( elem, name, "" );
  6674. }
  6675. elem.removeAttribute( getSetAttribute ? name : propName );
  6676. }
  6677. }
  6678. },
  6679. attrHooks: {
  6680. type: {
  6681. set: function( elem, value ) {
  6682. if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
  6683. // Setting the type on a radio button after the value resets the value in IE6-9
  6684. // Reset value to default in case type is set after value during creation
  6685. var val = elem.value;
  6686. elem.setAttribute( "type", value );
  6687. if ( val ) {
  6688. elem.value = val;
  6689. }
  6690. return value;
  6691. }
  6692. }
  6693. }
  6694. }
  6695. });
  6696. // Hook for boolean attributes
  6697. boolHook = {
  6698. set: function( elem, value, name ) {
  6699. if ( value === false ) {
  6700. // Remove boolean attributes when set to false
  6701. jQuery.removeAttr( elem, name );
  6702. } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
  6703. // IE<8 needs the *property* name
  6704. elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
  6705. // Use defaultChecked and defaultSelected for oldIE
  6706. } else {
  6707. elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
  6708. }
  6709. return name;
  6710. }
  6711. };
  6712. // Retrieve booleans specially
  6713. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  6714. var getter = attrHandle[ name ] || jQuery.find.attr;
  6715. attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
  6716. function( elem, name, isXML ) {
  6717. var ret, handle;
  6718. if ( !isXML ) {
  6719. // Avoid an infinite loop by temporarily removing this function from the getter
  6720. handle = attrHandle[ name ];
  6721. attrHandle[ name ] = ret;
  6722. ret = getter( elem, name, isXML ) != null ?
  6723. name.toLowerCase() :
  6724. null;
  6725. attrHandle[ name ] = handle;
  6726. }
  6727. return ret;
  6728. } :
  6729. function( elem, name, isXML ) {
  6730. if ( !isXML ) {
  6731. return elem[ jQuery.camelCase( "default-" + name ) ] ?
  6732. name.toLowerCase() :
  6733. null;
  6734. }
  6735. };
  6736. });
  6737. // fix oldIE attroperties
  6738. if ( !getSetInput || !getSetAttribute ) {
  6739. jQuery.attrHooks.value = {
  6740. set: function( elem, value, name ) {
  6741. if ( jQuery.nodeName( elem, "input" ) ) {
  6742. // Does not return so that setAttribute is also used
  6743. elem.defaultValue = value;
  6744. } else {
  6745. // Use nodeHook if defined (#1954); otherwise setAttribute is fine
  6746. return nodeHook && nodeHook.set( elem, value, name );
  6747. }
  6748. }
  6749. };
  6750. }
  6751. // IE6/7 do not support getting/setting some attributes with get/setAttribute
  6752. if ( !getSetAttribute ) {
  6753. // Use this for any attribute in IE6/7
  6754. // This fixes almost every IE6/7 issue
  6755. nodeHook = {
  6756. set: function( elem, value, name ) {
  6757. // Set the existing or create a new attribute node
  6758. var ret = elem.getAttributeNode( name );
  6759. if ( !ret ) {
  6760. elem.setAttributeNode(
  6761. (ret = elem.ownerDocument.createAttribute( name ))
  6762. );
  6763. }
  6764. ret.value = value += "";
  6765. // Break association with cloned elements by also using setAttribute (#9646)
  6766. if ( name === "value" || value === elem.getAttribute( name ) ) {
  6767. return value;
  6768. }
  6769. }
  6770. };
  6771. // Some attributes are constructed with empty-string values when not defined
  6772. attrHandle.id = attrHandle.name = attrHandle.coords =
  6773. function( elem, name, isXML ) {
  6774. var ret;
  6775. if ( !isXML ) {
  6776. return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
  6777. ret.value :
  6778. null;
  6779. }
  6780. };
  6781. // Fixing value retrieval on a button requires this module
  6782. jQuery.valHooks.button = {
  6783. get: function( elem, name ) {
  6784. var ret = elem.getAttributeNode( name );
  6785. if ( ret && ret.specified ) {
  6786. return ret.value;
  6787. }
  6788. },
  6789. set: nodeHook.set
  6790. };
  6791. // Set contenteditable to false on removals(#10429)
  6792. // Setting to empty string throws an error as an invalid value
  6793. jQuery.attrHooks.contenteditable = {
  6794. set: function( elem, value, name ) {
  6795. nodeHook.set( elem, value === "" ? false : value, name );
  6796. }
  6797. };
  6798. // Set width and height to auto instead of 0 on empty string( Bug #8150 )
  6799. // This is for removals
  6800. jQuery.each([ "width", "height" ], function( i, name ) {
  6801. jQuery.attrHooks[ name ] = {
  6802. set: function( elem, value ) {
  6803. if ( value === "" ) {
  6804. elem.setAttribute( name, "auto" );
  6805. return value;
  6806. }
  6807. }
  6808. };
  6809. });
  6810. }
  6811. if ( !support.style ) {
  6812. jQuery.attrHooks.style = {
  6813. get: function( elem ) {
  6814. // Return undefined in the case of empty string
  6815. // Note: IE uppercases css property names, but if we were to .toLowerCase()
  6816. // .cssText, that would destroy case senstitivity in URL's, like in "background"
  6817. return elem.style.cssText || undefined;
  6818. },
  6819. set: function( elem, value ) {
  6820. return ( elem.style.cssText = value + "" );
  6821. }
  6822. };
  6823. }
  6824. var rfocusable = /^(?:input|select|textarea|button|object)$/i,
  6825. rclickable = /^(?:a|area)$/i;
  6826. jQuery.fn.extend({
  6827. prop: function( name, value ) {
  6828. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  6829. },
  6830. removeProp: function( name ) {
  6831. name = jQuery.propFix[ name ] || name;
  6832. return this.each(function() {
  6833. // try/catch handles cases where IE balks (such as removing a property on window)
  6834. try {
  6835. this[ name ] = undefined;
  6836. delete this[ name ];
  6837. } catch( e ) {}
  6838. });
  6839. }
  6840. });
  6841. jQuery.extend({
  6842. propFix: {
  6843. "for": "htmlFor",
  6844. "class": "className"
  6845. },
  6846. prop: function( elem, name, value ) {
  6847. var ret, hooks, notxml,
  6848. nType = elem.nodeType;
  6849. // don't get/set properties on text, comment and attribute nodes
  6850. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  6851. return;
  6852. }
  6853. notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
  6854. if ( notxml ) {
  6855. // Fix name and attach hooks
  6856. name = jQuery.propFix[ name ] || name;
  6857. hooks = jQuery.propHooks[ name ];
  6858. }
  6859. if ( value !== undefined ) {
  6860. return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
  6861. ret :
  6862. ( elem[ name ] = value );
  6863. } else {
  6864. return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
  6865. ret :
  6866. elem[ name ];
  6867. }
  6868. },
  6869. propHooks: {
  6870. tabIndex: {
  6871. get: function( elem ) {
  6872. // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
  6873. // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  6874. // Use proper attribute retrieval(#12072)
  6875. var tabindex = jQuery.find.attr( elem, "tabindex" );
  6876. return tabindex ?
  6877. parseInt( tabindex, 10 ) :
  6878. rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
  6879. 0 :
  6880. -1;
  6881. }
  6882. }
  6883. }
  6884. });
  6885. // Some attributes require a special call on IE
  6886. // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  6887. if ( !support.hrefNormalized ) {
  6888. // href/src property should get the full normalized URL (#10299/#12915)
  6889. jQuery.each([ "href", "src" ], function( i, name ) {
  6890. jQuery.propHooks[ name ] = {
  6891. get: function( elem ) {
  6892. return elem.getAttribute( name, 4 );
  6893. }
  6894. };
  6895. });
  6896. }
  6897. // Support: Safari, IE9+
  6898. // mis-reports the default selected property of an option
  6899. // Accessing the parent's selectedIndex property fixes it
  6900. if ( !support.optSelected ) {
  6901. jQuery.propHooks.selected = {
  6902. get: function( elem ) {
  6903. var parent = elem.parentNode;
  6904. if ( parent ) {
  6905. parent.selectedIndex;
  6906. // Make sure that it also works with optgroups, see #5701
  6907. if ( parent.parentNode ) {
  6908. parent.parentNode.selectedIndex;
  6909. }
  6910. }
  6911. return null;
  6912. }
  6913. };
  6914. }
  6915. jQuery.each([
  6916. "tabIndex",
  6917. "readOnly",
  6918. "maxLength",
  6919. "cellSpacing",
  6920. "cellPadding",
  6921. "rowSpan",
  6922. "colSpan",
  6923. "useMap",
  6924. "frameBorder",
  6925. "contentEditable"
  6926. ], function() {
  6927. jQuery.propFix[ this.toLowerCase() ] = this;
  6928. });
  6929. // IE6/7 call enctype encoding
  6930. if ( !support.enctype ) {
  6931. jQuery.propFix.enctype = "encoding";
  6932. }
  6933. var rclass = /[\t\r\n\f]/g;
  6934. jQuery.fn.extend({
  6935. addClass: function( value ) {
  6936. var classes, elem, cur, clazz, j, finalValue,
  6937. i = 0,
  6938. len = this.length,
  6939. proceed = typeof value === "string" && value;
  6940. if ( jQuery.isFunction( value ) ) {
  6941. return this.each(function( j ) {
  6942. jQuery( this ).addClass( value.call( this, j, this.className ) );
  6943. });
  6944. }
  6945. if ( proceed ) {
  6946. // The disjunction here is for better compressibility (see removeClass)
  6947. classes = ( value || "" ).match( rnotwhite ) || [];
  6948. for ( ; i < len; i++ ) {
  6949. elem = this[ i ];
  6950. cur = elem.nodeType === 1 && ( elem.className ?
  6951. ( " " + elem.className + " " ).replace( rclass, " " ) :
  6952. " "
  6953. );
  6954. if ( cur ) {
  6955. j = 0;
  6956. while ( (clazz = classes[j++]) ) {
  6957. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  6958. cur += clazz + " ";
  6959. }
  6960. }
  6961. // only assign if different to avoid unneeded rendering.
  6962. finalValue = jQuery.trim( cur );
  6963. if ( elem.className !== finalValue ) {
  6964. elem.className = finalValue;
  6965. }
  6966. }
  6967. }
  6968. }
  6969. return this;
  6970. },
  6971. removeClass: function( value ) {
  6972. var classes, elem, cur, clazz, j, finalValue,
  6973. i = 0,
  6974. len = this.length,
  6975. proceed = arguments.length === 0 || typeof value === "string" && value;
  6976. if ( jQuery.isFunction( value ) ) {
  6977. return this.each(function( j ) {
  6978. jQuery( this ).removeClass( value.call( this, j, this.className ) );
  6979. });
  6980. }
  6981. if ( proceed ) {
  6982. classes = ( value || "" ).match( rnotwhite ) || [];
  6983. for ( ; i < len; i++ ) {
  6984. elem = this[ i ];
  6985. // This expression is here for better compressibility (see addClass)
  6986. cur = elem.nodeType === 1 && ( elem.className ?
  6987. ( " " + elem.className + " " ).replace( rclass, " " ) :
  6988. ""
  6989. );
  6990. if ( cur ) {
  6991. j = 0;
  6992. while ( (clazz = classes[j++]) ) {
  6993. // Remove *all* instances
  6994. while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
  6995. cur = cur.replace( " " + clazz + " ", " " );
  6996. }
  6997. }
  6998. // only assign if different to avoid unneeded rendering.
  6999. finalValue = value ? jQuery.trim( cur ) : "";
  7000. if ( elem.className !== finalValue ) {
  7001. elem.className = finalValue;
  7002. }
  7003. }
  7004. }
  7005. }
  7006. return this;
  7007. },
  7008. toggleClass: function( value, stateVal ) {
  7009. var type = typeof value;
  7010. if ( typeof stateVal === "boolean" && type === "string" ) {
  7011. return stateVal ? this.addClass( value ) : this.removeClass( value );
  7012. }
  7013. if ( jQuery.isFunction( value ) ) {
  7014. return this.each(function( i ) {
  7015. jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
  7016. });
  7017. }
  7018. return this.each(function() {
  7019. if ( type === "string" ) {
  7020. // toggle individual class names
  7021. var className,
  7022. i = 0,
  7023. self = jQuery( this ),
  7024. classNames = value.match( rnotwhite ) || [];
  7025. while ( (className = classNames[ i++ ]) ) {
  7026. // check each className given, space separated list
  7027. if ( self.hasClass( className ) ) {
  7028. self.removeClass( className );
  7029. } else {
  7030. self.addClass( className );
  7031. }
  7032. }
  7033. // Toggle whole class name
  7034. } else if ( type === strundefined || type === "boolean" ) {
  7035. if ( this.className ) {
  7036. // store className if set
  7037. jQuery._data( this, "__className__", this.className );
  7038. }
  7039. // If the element has a class name or if we're passed "false",
  7040. // then remove the whole classname (if there was one, the above saved it).
  7041. // Otherwise bring back whatever was previously saved (if anything),
  7042. // falling back to the empty string if nothing was stored.
  7043. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
  7044. }
  7045. });
  7046. },
  7047. hasClass: function( selector ) {
  7048. var className = " " + selector + " ",
  7049. i = 0,
  7050. l = this.length;
  7051. for ( ; i < l; i++ ) {
  7052. if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
  7053. return true;
  7054. }
  7055. }
  7056. return false;
  7057. }
  7058. });
  7059. // Return jQuery for attributes-only inclusion
  7060. jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
  7061. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  7062. "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
  7063. // Handle event binding
  7064. jQuery.fn[ name ] = function( data, fn ) {
  7065. return arguments.length > 0 ?
  7066. this.on( name, null, data, fn ) :
  7067. this.trigger( name );
  7068. };
  7069. });
  7070. jQuery.fn.extend({
  7071. hover: function( fnOver, fnOut ) {
  7072. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  7073. },
  7074. bind: function( types, data, fn ) {
  7075. return this.on( types, null, data, fn );
  7076. },
  7077. unbind: function( types, fn ) {
  7078. return this.off( types, null, fn );
  7079. },
  7080. delegate: function( selector, types, data, fn ) {
  7081. return this.on( types, selector, data, fn );
  7082. },
  7083. undelegate: function( selector, types, fn ) {
  7084. // ( namespace ) or ( selector, types [, fn] )
  7085. return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
  7086. }
  7087. });
  7088. var nonce = jQuery.now();
  7089. var rquery = (/\?/);
  7090. var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
  7091. jQuery.parseJSON = function( data ) {
  7092. // Attempt to parse using the native JSON parser first
  7093. if ( window.JSON && window.JSON.parse ) {
  7094. // Support: Android 2.3
  7095. // Workaround failure to string-cast null input
  7096. return window.JSON.parse( data + "" );
  7097. }
  7098. var requireNonComma,
  7099. depth = null,
  7100. str = jQuery.trim( data + "" );
  7101. // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
  7102. // after removing valid tokens
  7103. return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
  7104. // Force termination if we see a misplaced comma
  7105. if ( requireNonComma && comma ) {
  7106. depth = 0;
  7107. }
  7108. // Perform no more replacements after returning to outermost depth
  7109. if ( depth === 0 ) {
  7110. return token;
  7111. }
  7112. // Commas must not follow "[", "{", or ","
  7113. requireNonComma = open || comma;
  7114. // Determine new depth
  7115. // array/object open ("[" or "{"): depth += true - false (increment)
  7116. // array/object close ("]" or "}"): depth += false - true (decrement)
  7117. // other cases ("," or primitive): depth += true - true (numeric cast)
  7118. depth += !close - !open;
  7119. // Remove this token
  7120. return "";
  7121. }) ) ?
  7122. ( Function( "return " + str ) )() :
  7123. jQuery.error( "Invalid JSON: " + data );
  7124. };
  7125. // Cross-browser xml parsing
  7126. jQuery.parseXML = function( data ) {
  7127. var xml, tmp;
  7128. if ( !data || typeof data !== "string" ) {
  7129. return null;
  7130. }
  7131. try {
  7132. if ( window.DOMParser ) { // Standard
  7133. tmp = new DOMParser();
  7134. xml = tmp.parseFromString( data, "text/xml" );
  7135. } else { // IE
  7136. xml = new ActiveXObject( "Microsoft.XMLDOM" );
  7137. xml.async = "false";
  7138. xml.loadXML( data );
  7139. }
  7140. } catch( e ) {
  7141. xml = undefined;
  7142. }
  7143. if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
  7144. jQuery.error( "Invalid XML: " + data );
  7145. }
  7146. return xml;
  7147. };
  7148. var
  7149. // Document location
  7150. ajaxLocParts,
  7151. ajaxLocation,
  7152. rhash = /#.*$/,
  7153. rts = /([?&])_=[^&]*/,
  7154. rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
  7155. // #7653, #8125, #8152: local protocol detection
  7156. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  7157. rnoContent = /^(?:GET|HEAD)$/,
  7158. rprotocol = /^\/\//,
  7159. rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
  7160. /* Prefilters
  7161. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  7162. * 2) These are called:
  7163. * - BEFORE asking for a transport
  7164. * - AFTER param serialization (s.data is a string if s.processData is true)
  7165. * 3) key is the dataType
  7166. * 4) the catchall symbol "*" can be used
  7167. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  7168. */
  7169. prefilters = {},
  7170. /* Transports bindings
  7171. * 1) key is the dataType
  7172. * 2) the catchall symbol "*" can be used
  7173. * 3) selection will start with transport dataType and THEN go to "*" if needed
  7174. */
  7175. transports = {},
  7176. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  7177. allTypes = "*/".concat("*");
  7178. // #8138, IE may throw an exception when accessing
  7179. // a field from window.location if document.domain has been set
  7180. try {
  7181. ajaxLocation = location.href;
  7182. } catch( e ) {
  7183. // Use the href attribute of an A element
  7184. // since IE will modify it given document.location
  7185. ajaxLocation = document.createElement( "a" );
  7186. ajaxLocation.href = "";
  7187. ajaxLocation = ajaxLocation.href;
  7188. }
  7189. // Segment location into parts
  7190. ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
  7191. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  7192. function addToPrefiltersOrTransports( structure ) {
  7193. // dataTypeExpression is optional and defaults to "*"
  7194. return function( dataTypeExpression, func ) {
  7195. if ( typeof dataTypeExpression !== "string" ) {
  7196. func = dataTypeExpression;
  7197. dataTypeExpression = "*";
  7198. }
  7199. var dataType,
  7200. i = 0,
  7201. dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
  7202. if ( jQuery.isFunction( func ) ) {
  7203. // For each dataType in the dataTypeExpression
  7204. while ( (dataType = dataTypes[i++]) ) {
  7205. // Prepend if requested
  7206. if ( dataType.charAt( 0 ) === "+" ) {
  7207. dataType = dataType.slice( 1 ) || "*";
  7208. (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
  7209. // Otherwise append
  7210. } else {
  7211. (structure[ dataType ] = structure[ dataType ] || []).push( func );
  7212. }
  7213. }
  7214. }
  7215. };
  7216. }
  7217. // Base inspection function for prefilters and transports
  7218. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  7219. var inspected = {},
  7220. seekingTransport = ( structure === transports );
  7221. function inspect( dataType ) {
  7222. var selected;
  7223. inspected[ dataType ] = true;
  7224. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  7225. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  7226. if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  7227. options.dataTypes.unshift( dataTypeOrTransport );
  7228. inspect( dataTypeOrTransport );
  7229. return false;
  7230. } else if ( seekingTransport ) {
  7231. return !( selected = dataTypeOrTransport );
  7232. }
  7233. });
  7234. return selected;
  7235. }
  7236. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  7237. }
  7238. // A special extend for ajax options
  7239. // that takes "flat" options (not to be deep extended)
  7240. // Fixes #9887
  7241. function ajaxExtend( target, src ) {
  7242. var deep, key,
  7243. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  7244. for ( key in src ) {
  7245. if ( src[ key ] !== undefined ) {
  7246. ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
  7247. }
  7248. }
  7249. if ( deep ) {
  7250. jQuery.extend( true, target, deep );
  7251. }
  7252. return target;
  7253. }
  7254. /* Handles responses to an ajax request:
  7255. * - finds the right dataType (mediates between content-type and expected dataType)
  7256. * - returns the corresponding response
  7257. */
  7258. function ajaxHandleResponses( s, jqXHR, responses ) {
  7259. var firstDataType, ct, finalDataType, type,
  7260. contents = s.contents,
  7261. dataTypes = s.dataTypes;
  7262. // Remove auto dataType and get content-type in the process
  7263. while ( dataTypes[ 0 ] === "*" ) {
  7264. dataTypes.shift();
  7265. if ( ct === undefined ) {
  7266. ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
  7267. }
  7268. }
  7269. // Check if we're dealing with a known content-type
  7270. if ( ct ) {
  7271. for ( type in contents ) {
  7272. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  7273. dataTypes.unshift( type );
  7274. break;
  7275. }
  7276. }
  7277. }
  7278. // Check to see if we have a response for the expected dataType
  7279. if ( dataTypes[ 0 ] in responses ) {
  7280. finalDataType = dataTypes[ 0 ];
  7281. } else {
  7282. // Try convertible dataTypes
  7283. for ( type in responses ) {
  7284. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
  7285. finalDataType = type;
  7286. break;
  7287. }
  7288. if ( !firstDataType ) {
  7289. firstDataType = type;
  7290. }
  7291. }
  7292. // Or just use first one
  7293. finalDataType = finalDataType || firstDataType;
  7294. }
  7295. // If we found a dataType
  7296. // We add the dataType to the list if needed
  7297. // and return the corresponding response
  7298. if ( finalDataType ) {
  7299. if ( finalDataType !== dataTypes[ 0 ] ) {
  7300. dataTypes.unshift( finalDataType );
  7301. }
  7302. return responses[ finalDataType ];
  7303. }
  7304. }
  7305. /* Chain conversions given the request and the original response
  7306. * Also sets the responseXXX fields on the jqXHR instance
  7307. */
  7308. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  7309. var conv2, current, conv, tmp, prev,
  7310. converters = {},
  7311. // Work with a copy of dataTypes in case we need to modify it for conversion
  7312. dataTypes = s.dataTypes.slice();
  7313. // Create converters map with lowercased keys
  7314. if ( dataTypes[ 1 ] ) {
  7315. for ( conv in s.converters ) {
  7316. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  7317. }
  7318. }
  7319. current = dataTypes.shift();
  7320. // Convert to each sequential dataType
  7321. while ( current ) {
  7322. if ( s.responseFields[ current ] ) {
  7323. jqXHR[ s.responseFields[ current ] ] = response;
  7324. }
  7325. // Apply the dataFilter if provided
  7326. if ( !prev && isSuccess && s.dataFilter ) {
  7327. response = s.dataFilter( response, s.dataType );
  7328. }
  7329. prev = current;
  7330. current = dataTypes.shift();
  7331. if ( current ) {
  7332. // There's only work to do if current dataType is non-auto
  7333. if ( current === "*" ) {
  7334. current = prev;
  7335. // Convert response if prev dataType is non-auto and differs from current
  7336. } else if ( prev !== "*" && prev !== current ) {
  7337. // Seek a direct converter
  7338. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  7339. // If none found, seek a pair
  7340. if ( !conv ) {
  7341. for ( conv2 in converters ) {
  7342. // If conv2 outputs current
  7343. tmp = conv2.split( " " );
  7344. if ( tmp[ 1 ] === current ) {
  7345. // If prev can be converted to accepted input
  7346. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  7347. converters[ "* " + tmp[ 0 ] ];
  7348. if ( conv ) {
  7349. // Condense equivalence converters
  7350. if ( conv === true ) {
  7351. conv = converters[ conv2 ];
  7352. // Otherwise, insert the intermediate dataType
  7353. } else if ( converters[ conv2 ] !== true ) {
  7354. current = tmp[ 0 ];
  7355. dataTypes.unshift( tmp[ 1 ] );
  7356. }
  7357. break;
  7358. }
  7359. }
  7360. }
  7361. }
  7362. // Apply converter (if not an equivalence)
  7363. if ( conv !== true ) {
  7364. // Unless errors are allowed to bubble, catch and return them
  7365. if ( conv && s[ "throws" ] ) {
  7366. response = conv( response );
  7367. } else {
  7368. try {
  7369. response = conv( response );
  7370. } catch ( e ) {
  7371. return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
  7372. }
  7373. }
  7374. }
  7375. }
  7376. }
  7377. }
  7378. return { state: "success", data: response };
  7379. }
  7380. jQuery.extend({
  7381. // Counter for holding the number of active queries
  7382. active: 0,
  7383. // Last-Modified header cache for next request
  7384. lastModified: {},
  7385. etag: {},
  7386. ajaxSettings: {
  7387. url: ajaxLocation,
  7388. type: "GET",
  7389. isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
  7390. global: true,
  7391. processData: true,
  7392. async: true,
  7393. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  7394. /*
  7395. timeout: 0,
  7396. data: null,
  7397. dataType: null,
  7398. username: null,
  7399. password: null,
  7400. cache: null,
  7401. throws: false,
  7402. traditional: false,
  7403. headers: {},
  7404. */
  7405. accepts: {
  7406. "*": allTypes,
  7407. text: "text/plain",
  7408. html: "text/html",
  7409. xml: "application/xml, text/xml",
  7410. json: "application/json, text/javascript"
  7411. },
  7412. contents: {
  7413. xml: /xml/,
  7414. html: /html/,
  7415. json: /json/
  7416. },
  7417. responseFields: {
  7418. xml: "responseXML",
  7419. text: "responseText",
  7420. json: "responseJSON"
  7421. },
  7422. // Data converters
  7423. // Keys separate source (or catchall "*") and destination types with a single space
  7424. converters: {
  7425. // Convert anything to text
  7426. "* text": String,
  7427. // Text to html (true = no transformation)
  7428. "text html": true,
  7429. // Evaluate text as a json expression
  7430. "text json": jQuery.parseJSON,
  7431. // Parse text as xml
  7432. "text xml": jQuery.parseXML
  7433. },
  7434. // For options that shouldn't be deep extended:
  7435. // you can add your own custom options here if
  7436. // and when you create one that shouldn't be
  7437. // deep extended (see ajaxExtend)
  7438. flatOptions: {
  7439. url: true,
  7440. context: true
  7441. }
  7442. },
  7443. // Creates a full fledged settings object into target
  7444. // with both ajaxSettings and settings fields.
  7445. // If target is omitted, writes into ajaxSettings.
  7446. ajaxSetup: function( target, settings ) {
  7447. return settings ?
  7448. // Building a settings object
  7449. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  7450. // Extending ajaxSettings
  7451. ajaxExtend( jQuery.ajaxSettings, target );
  7452. },
  7453. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  7454. ajaxTransport: addToPrefiltersOrTransports( transports ),
  7455. // Main method
  7456. ajax: function( url, options ) {
  7457. // If url is an object, simulate pre-1.5 signature
  7458. if ( typeof url === "object" ) {
  7459. options = url;
  7460. url = undefined;
  7461. }
  7462. // Force options to be an object
  7463. options = options || {};
  7464. var // Cross-domain detection vars
  7465. parts,
  7466. // Loop variable
  7467. i,
  7468. // URL without anti-cache param
  7469. cacheURL,
  7470. // Response headers as string
  7471. responseHeadersString,
  7472. // timeout handle
  7473. timeoutTimer,
  7474. // To know if global events are to be dispatched
  7475. fireGlobals,
  7476. transport,
  7477. // Response headers
  7478. responseHeaders,
  7479. // Create the final options object
  7480. s = jQuery.ajaxSetup( {}, options ),
  7481. // Callbacks context
  7482. callbackContext = s.context || s,
  7483. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  7484. globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
  7485. jQuery( callbackContext ) :
  7486. jQuery.event,
  7487. // Deferreds
  7488. deferred = jQuery.Deferred(),
  7489. completeDeferred = jQuery.Callbacks("once memory"),
  7490. // Status-dependent callbacks
  7491. statusCode = s.statusCode || {},
  7492. // Headers (they are sent all at once)
  7493. requestHeaders = {},
  7494. requestHeadersNames = {},
  7495. // The jqXHR state
  7496. state = 0,
  7497. // Default abort message
  7498. strAbort = "canceled",
  7499. // Fake xhr
  7500. jqXHR = {
  7501. readyState: 0,
  7502. // Builds headers hashtable if needed
  7503. getResponseHeader: function( key ) {
  7504. var match;
  7505. if ( state === 2 ) {
  7506. if ( !responseHeaders ) {
  7507. responseHeaders = {};
  7508. while ( (match = rheaders.exec( responseHeadersString )) ) {
  7509. responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
  7510. }
  7511. }
  7512. match = responseHeaders[ key.toLowerCase() ];
  7513. }
  7514. return match == null ? null : match;
  7515. },
  7516. // Raw string
  7517. getAllResponseHeaders: function() {
  7518. return state === 2 ? responseHeadersString : null;
  7519. },
  7520. // Caches the header
  7521. setRequestHeader: function( name, value ) {
  7522. var lname = name.toLowerCase();
  7523. if ( !state ) {
  7524. name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
  7525. requestHeaders[ name ] = value;
  7526. }
  7527. return this;
  7528. },
  7529. // Overrides response content-type header
  7530. overrideMimeType: function( type ) {
  7531. if ( !state ) {
  7532. s.mimeType = type;
  7533. }
  7534. return this;
  7535. },
  7536. // Status-dependent callbacks
  7537. statusCode: function( map ) {
  7538. var code;
  7539. if ( map ) {
  7540. if ( state < 2 ) {
  7541. for ( code in map ) {
  7542. // Lazy-add the new callback in a way that preserves old ones
  7543. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  7544. }
  7545. } else {
  7546. // Execute the appropriate callbacks
  7547. jqXHR.always( map[ jqXHR.status ] );
  7548. }
  7549. }
  7550. return this;
  7551. },
  7552. // Cancel the request
  7553. abort: function( statusText ) {
  7554. var finalText = statusText || strAbort;
  7555. if ( transport ) {
  7556. transport.abort( finalText );
  7557. }
  7558. done( 0, finalText );
  7559. return this;
  7560. }
  7561. };
  7562. // Attach deferreds
  7563. deferred.promise( jqXHR ).complete = completeDeferred.add;
  7564. jqXHR.success = jqXHR.done;
  7565. jqXHR.error = jqXHR.fail;
  7566. // Remove hash character (#7531: and string promotion)
  7567. // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
  7568. // Handle falsy url in the settings object (#10093: consistency with old signature)
  7569. // We also use the url parameter if available
  7570. s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
  7571. // Alias method option to type as per ticket #12004
  7572. s.type = options.method || options.type || s.method || s.type;
  7573. // Extract dataTypes list
  7574. s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
  7575. // A cross-domain request is in order when we have a protocol:host:port mismatch
  7576. if ( s.crossDomain == null ) {
  7577. parts = rurl.exec( s.url.toLowerCase() );
  7578. s.crossDomain = !!( parts &&
  7579. ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
  7580. ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
  7581. ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
  7582. );
  7583. }
  7584. // Convert data if not already a string
  7585. if ( s.data && s.processData && typeof s.data !== "string" ) {
  7586. s.data = jQuery.param( s.data, s.traditional );
  7587. }
  7588. // Apply prefilters
  7589. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  7590. // If request was aborted inside a prefilter, stop there
  7591. if ( state === 2 ) {
  7592. return jqXHR;
  7593. }
  7594. // We can fire global events as of now if asked to
  7595. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  7596. fireGlobals = jQuery.event && s.global;
  7597. // Watch for a new set of requests
  7598. if ( fireGlobals && jQuery.active++ === 0 ) {
  7599. jQuery.event.trigger("ajaxStart");
  7600. }
  7601. // Uppercase the type
  7602. s.type = s.type.toUpperCase();
  7603. // Determine if request has content
  7604. s.hasContent = !rnoContent.test( s.type );
  7605. // Save the URL in case we're toying with the If-Modified-Since
  7606. // and/or If-None-Match header later on
  7607. cacheURL = s.url;
  7608. // More options handling for requests with no content
  7609. if ( !s.hasContent ) {
  7610. // If data is available, append data to url
  7611. if ( s.data ) {
  7612. cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
  7613. // #9682: remove data so that it's not used in an eventual retry
  7614. delete s.data;
  7615. }
  7616. // Add anti-cache in url if needed
  7617. if ( s.cache === false ) {
  7618. s.url = rts.test( cacheURL ) ?
  7619. // If there is already a '_' parameter, set its value
  7620. cacheURL.replace( rts, "$1_=" + nonce++ ) :
  7621. // Otherwise add one to the end
  7622. cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
  7623. }
  7624. }
  7625. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7626. if ( s.ifModified ) {
  7627. if ( jQuery.lastModified[ cacheURL ] ) {
  7628. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  7629. }
  7630. if ( jQuery.etag[ cacheURL ] ) {
  7631. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  7632. }
  7633. }
  7634. // Set the correct header, if data is being sent
  7635. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  7636. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  7637. }
  7638. // Set the Accepts header for the server, depending on the dataType
  7639. jqXHR.setRequestHeader(
  7640. "Accept",
  7641. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
  7642. s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  7643. s.accepts[ "*" ]
  7644. );
  7645. // Check for headers option
  7646. for ( i in s.headers ) {
  7647. jqXHR.setRequestHeader( i, s.headers[ i ] );
  7648. }
  7649. // Allow custom headers/mimetypes and early abort
  7650. if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
  7651. // Abort if not done already and return
  7652. return jqXHR.abort();
  7653. }
  7654. // aborting is no longer a cancellation
  7655. strAbort = "abort";
  7656. // Install callbacks on deferreds
  7657. for ( i in { success: 1, error: 1, complete: 1 } ) {
  7658. jqXHR[ i ]( s[ i ] );
  7659. }
  7660. // Get transport
  7661. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  7662. // If no transport, we auto-abort
  7663. if ( !transport ) {
  7664. done( -1, "No Transport" );
  7665. } else {
  7666. jqXHR.readyState = 1;
  7667. // Send global event
  7668. if ( fireGlobals ) {
  7669. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  7670. }
  7671. // Timeout
  7672. if ( s.async && s.timeout > 0 ) {
  7673. timeoutTimer = setTimeout(function() {
  7674. jqXHR.abort("timeout");
  7675. }, s.timeout );
  7676. }
  7677. try {
  7678. state = 1;
  7679. transport.send( requestHeaders, done );
  7680. } catch ( e ) {
  7681. // Propagate exception as error if not done
  7682. if ( state < 2 ) {
  7683. done( -1, e );
  7684. // Simply rethrow otherwise
  7685. } else {
  7686. throw e;
  7687. }
  7688. }
  7689. }
  7690. // Callback for when everything is done
  7691. function done( status, nativeStatusText, responses, headers ) {
  7692. var isSuccess, success, error, response, modified,
  7693. statusText = nativeStatusText;
  7694. // Called once
  7695. if ( state === 2 ) {
  7696. return;
  7697. }
  7698. // State is "done" now
  7699. state = 2;
  7700. // Clear timeout if it exists
  7701. if ( timeoutTimer ) {
  7702. clearTimeout( timeoutTimer );
  7703. }
  7704. // Dereference transport for early garbage collection
  7705. // (no matter how long the jqXHR object will be used)
  7706. transport = undefined;
  7707. // Cache response headers
  7708. responseHeadersString = headers || "";
  7709. // Set readyState
  7710. jqXHR.readyState = status > 0 ? 4 : 0;
  7711. // Determine if successful
  7712. isSuccess = status >= 200 && status < 300 || status === 304;
  7713. // Get response data
  7714. if ( responses ) {
  7715. response = ajaxHandleResponses( s, jqXHR, responses );
  7716. }
  7717. // Convert no matter what (that way responseXXX fields are always set)
  7718. response = ajaxConvert( s, response, jqXHR, isSuccess );
  7719. // If successful, handle type chaining
  7720. if ( isSuccess ) {
  7721. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7722. if ( s.ifModified ) {
  7723. modified = jqXHR.getResponseHeader("Last-Modified");
  7724. if ( modified ) {
  7725. jQuery.lastModified[ cacheURL ] = modified;
  7726. }
  7727. modified = jqXHR.getResponseHeader("etag");
  7728. if ( modified ) {
  7729. jQuery.etag[ cacheURL ] = modified;
  7730. }
  7731. }
  7732. // if no content
  7733. if ( status === 204 || s.type === "HEAD" ) {
  7734. statusText = "nocontent";
  7735. // if not modified
  7736. } else if ( status === 304 ) {
  7737. statusText = "notmodified";
  7738. // If we have data, let's convert it
  7739. } else {
  7740. statusText = response.state;
  7741. success = response.data;
  7742. error = response.error;
  7743. isSuccess = !error;
  7744. }
  7745. } else {
  7746. // We extract error from statusText
  7747. // then normalize statusText and status for non-aborts
  7748. error = statusText;
  7749. if ( status || !statusText ) {
  7750. statusText = "error";
  7751. if ( status < 0 ) {
  7752. status = 0;
  7753. }
  7754. }
  7755. }
  7756. // Set data for the fake xhr object
  7757. jqXHR.status = status;
  7758. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  7759. // Success/Error
  7760. if ( isSuccess ) {
  7761. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  7762. } else {
  7763. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  7764. }
  7765. // Status-dependent callbacks
  7766. jqXHR.statusCode( statusCode );
  7767. statusCode = undefined;
  7768. if ( fireGlobals ) {
  7769. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  7770. [ jqXHR, s, isSuccess ? success : error ] );
  7771. }
  7772. // Complete
  7773. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  7774. if ( fireGlobals ) {
  7775. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  7776. // Handle the global AJAX counter
  7777. if ( !( --jQuery.active ) ) {
  7778. jQuery.event.trigger("ajaxStop");
  7779. }
  7780. }
  7781. }
  7782. return jqXHR;
  7783. },
  7784. getJSON: function( url, data, callback ) {
  7785. return jQuery.get( url, data, callback, "json" );
  7786. },
  7787. getScript: function( url, callback ) {
  7788. return jQuery.get( url, undefined, callback, "script" );
  7789. }
  7790. });
  7791. jQuery.each( [ "get", "post" ], function( i, method ) {
  7792. jQuery[ method ] = function( url, data, callback, type ) {
  7793. // shift arguments if data argument was omitted
  7794. if ( jQuery.isFunction( data ) ) {
  7795. type = type || callback;
  7796. callback = data;
  7797. data = undefined;
  7798. }
  7799. return jQuery.ajax({
  7800. url: url,
  7801. type: method,
  7802. dataType: type,
  7803. data: data,
  7804. success: callback
  7805. });
  7806. };
  7807. });
  7808. jQuery._evalUrl = function( url ) {
  7809. return jQuery.ajax({
  7810. url: url,
  7811. type: "GET",
  7812. dataType: "script",
  7813. async: false,
  7814. global: false,
  7815. "throws": true
  7816. });
  7817. };
  7818. jQuery.fn.extend({
  7819. wrapAll: function( html ) {
  7820. if ( jQuery.isFunction( html ) ) {
  7821. return this.each(function(i) {
  7822. jQuery(this).wrapAll( html.call(this, i) );
  7823. });
  7824. }
  7825. if ( this[0] ) {
  7826. // The elements to wrap the target around
  7827. var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
  7828. if ( this[0].parentNode ) {
  7829. wrap.insertBefore( this[0] );
  7830. }
  7831. wrap.map(function() {
  7832. var elem = this;
  7833. while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
  7834. elem = elem.firstChild;
  7835. }
  7836. return elem;
  7837. }).append( this );
  7838. }
  7839. return this;
  7840. },
  7841. wrapInner: function( html ) {
  7842. if ( jQuery.isFunction( html ) ) {
  7843. return this.each(function(i) {
  7844. jQuery(this).wrapInner( html.call(this, i) );
  7845. });
  7846. }
  7847. return this.each(function() {
  7848. var self = jQuery( this ),
  7849. contents = self.contents();
  7850. if ( contents.length ) {
  7851. contents.wrapAll( html );
  7852. } else {
  7853. self.append( html );
  7854. }
  7855. });
  7856. },
  7857. wrap: function( html ) {
  7858. var isFunction = jQuery.isFunction( html );
  7859. return this.each(function(i) {
  7860. jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
  7861. });
  7862. },
  7863. unwrap: function() {
  7864. return this.parent().each(function() {
  7865. if ( !jQuery.nodeName( this, "body" ) ) {
  7866. jQuery( this ).replaceWith( this.childNodes );
  7867. }
  7868. }).end();
  7869. }
  7870. });
  7871. jQuery.expr.filters.hidden = function( elem ) {
  7872. // Support: Opera <= 12.12
  7873. // Opera reports offsetWidths and offsetHeights less than zero on some elements
  7874. return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
  7875. (!support.reliableHiddenOffsets() &&
  7876. ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
  7877. };
  7878. jQuery.expr.filters.visible = function( elem ) {
  7879. return !jQuery.expr.filters.hidden( elem );
  7880. };
  7881. var r20 = /%20/g,
  7882. rbracket = /\[\]$/,
  7883. rCRLF = /\r?\n/g,
  7884. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  7885. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  7886. function buildParams( prefix, obj, traditional, add ) {
  7887. var name;
  7888. if ( jQuery.isArray( obj ) ) {
  7889. // Serialize array item.
  7890. jQuery.each( obj, function( i, v ) {
  7891. if ( traditional || rbracket.test( prefix ) ) {
  7892. // Treat each array item as a scalar.
  7893. add( prefix, v );
  7894. } else {
  7895. // Item is non-scalar (array or object), encode its numeric index.
  7896. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
  7897. }
  7898. });
  7899. } else if ( !traditional && jQuery.type( obj ) === "object" ) {
  7900. // Serialize object item.
  7901. for ( name in obj ) {
  7902. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  7903. }
  7904. } else {
  7905. // Serialize scalar item.
  7906. add( prefix, obj );
  7907. }
  7908. }
  7909. // Serialize an array of form elements or a set of
  7910. // key/values into a query string
  7911. jQuery.param = function( a, traditional ) {
  7912. var prefix,
  7913. s = [],
  7914. add = function( key, value ) {
  7915. // If value is a function, invoke it and return its value
  7916. value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
  7917. s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
  7918. };
  7919. // Set traditional to true for jQuery <= 1.3.2 behavior.
  7920. if ( traditional === undefined ) {
  7921. traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
  7922. }
  7923. // If an array was passed in, assume that it is an array of form elements.
  7924. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  7925. // Serialize the form elements
  7926. jQuery.each( a, function() {
  7927. add( this.name, this.value );
  7928. });
  7929. } else {
  7930. // If traditional, encode the "old" way (the way 1.3.2 or older
  7931. // did it), otherwise encode params recursively.
  7932. for ( prefix in a ) {
  7933. buildParams( prefix, a[ prefix ], traditional, add );
  7934. }
  7935. }
  7936. // Return the resulting serialization
  7937. return s.join( "&" ).replace( r20, "+" );
  7938. };
  7939. jQuery.fn.extend({
  7940. serialize: function() {
  7941. return jQuery.param( this.serializeArray() );
  7942. },
  7943. serializeArray: function() {
  7944. return this.map(function() {
  7945. // Can add propHook for "elements" to filter or add form elements
  7946. var elements = jQuery.prop( this, "elements" );
  7947. return elements ? jQuery.makeArray( elements ) : this;
  7948. })
  7949. .filter(function() {
  7950. var type = this.type;
  7951. // Use .is(":disabled") so that fieldset[disabled] works
  7952. return this.name && !jQuery( this ).is( ":disabled" ) &&
  7953. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  7954. ( this.checked || !rcheckableType.test( type ) );
  7955. })
  7956. .map(function( i, elem ) {
  7957. var val = jQuery( this ).val();
  7958. return val == null ?
  7959. null :
  7960. jQuery.isArray( val ) ?
  7961. jQuery.map( val, function( val ) {
  7962. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7963. }) :
  7964. { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7965. }).get();
  7966. }
  7967. });
  7968. // Create the request object
  7969. // (This is still attached to ajaxSettings for backward compatibility)
  7970. jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
  7971. // Support: IE6+
  7972. function() {
  7973. // XHR cannot access local files, always use ActiveX for that case
  7974. return !this.isLocal &&
  7975. // Support: IE7-8
  7976. // oldIE XHR does not support non-RFC2616 methods (#13240)
  7977. // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
  7978. // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
  7979. // Although this check for six methods instead of eight
  7980. // since IE also does not support "trace" and "connect"
  7981. /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
  7982. createStandardXHR() || createActiveXHR();
  7983. } :
  7984. // For all other browsers, use the standard XMLHttpRequest object
  7985. createStandardXHR;
  7986. var xhrId = 0,
  7987. xhrCallbacks = {},
  7988. xhrSupported = jQuery.ajaxSettings.xhr();
  7989. // Support: IE<10
  7990. // Open requests must be manually aborted on unload (#5280)
  7991. // See https://support.microsoft.com/kb/2856746 for more info
  7992. if ( window.attachEvent ) {
  7993. window.attachEvent( "onunload", function() {
  7994. for ( var key in xhrCallbacks ) {
  7995. xhrCallbacks[ key ]( undefined, true );
  7996. }
  7997. });
  7998. }
  7999. // Determine support properties
  8000. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  8001. xhrSupported = support.ajax = !!xhrSupported;
  8002. // Create transport if the browser can provide an xhr
  8003. if ( xhrSupported ) {
  8004. jQuery.ajaxTransport(function( options ) {
  8005. // Cross domain only allowed if supported through XMLHttpRequest
  8006. if ( !options.crossDomain || support.cors ) {
  8007. var callback;
  8008. return {
  8009. send: function( headers, complete ) {
  8010. var i,
  8011. xhr = options.xhr(),
  8012. id = ++xhrId;
  8013. // Open the socket
  8014. xhr.open( options.type, options.url, options.async, options.username, options.password );
  8015. // Apply custom fields if provided
  8016. if ( options.xhrFields ) {
  8017. for ( i in options.xhrFields ) {
  8018. xhr[ i ] = options.xhrFields[ i ];
  8019. }
  8020. }
  8021. // Override mime type if needed
  8022. if ( options.mimeType && xhr.overrideMimeType ) {
  8023. xhr.overrideMimeType( options.mimeType );
  8024. }
  8025. // X-Requested-With header
  8026. // For cross-domain requests, seeing as conditions for a preflight are
  8027. // akin to a jigsaw puzzle, we simply never set it to be sure.
  8028. // (it can always be set on a per-request basis or even using ajaxSetup)
  8029. // For same-domain requests, won't change header if already provided.
  8030. if ( !options.crossDomain && !headers["X-Requested-With"] ) {
  8031. headers["X-Requested-With"] = "XMLHttpRequest";
  8032. }
  8033. // Set headers
  8034. for ( i in headers ) {
  8035. // Support: IE<9
  8036. // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
  8037. // request header to a null-value.
  8038. //
  8039. // To keep consistent with other XHR implementations, cast the value
  8040. // to string and ignore `undefined`.
  8041. if ( headers[ i ] !== undefined ) {
  8042. xhr.setRequestHeader( i, headers[ i ] + "" );
  8043. }
  8044. }
  8045. // Do send the request
  8046. // This may raise an exception which is actually
  8047. // handled in jQuery.ajax (so no try/catch here)
  8048. xhr.send( ( options.hasContent && options.data ) || null );
  8049. // Listener
  8050. callback = function( _, isAbort ) {
  8051. var status, statusText, responses;
  8052. // Was never called and is aborted or complete
  8053. if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
  8054. // Clean up
  8055. delete xhrCallbacks[ id ];
  8056. callback = undefined;
  8057. xhr.onreadystatechange = jQuery.noop;
  8058. // Abort manually if needed
  8059. if ( isAbort ) {
  8060. if ( xhr.readyState !== 4 ) {
  8061. xhr.abort();
  8062. }
  8063. } else {
  8064. responses = {};
  8065. status = xhr.status;
  8066. // Support: IE<10
  8067. // Accessing binary-data responseText throws an exception
  8068. // (#11426)
  8069. if ( typeof xhr.responseText === "string" ) {
  8070. responses.text = xhr.responseText;
  8071. }
  8072. // Firefox throws an exception when accessing
  8073. // statusText for faulty cross-domain requests
  8074. try {
  8075. statusText = xhr.statusText;
  8076. } catch( e ) {
  8077. // We normalize with Webkit giving an empty statusText
  8078. statusText = "";
  8079. }
  8080. // Filter status for non standard behaviors
  8081. // If the request is local and we have data: assume a success
  8082. // (success with no data won't get notified, that's the best we
  8083. // can do given current implementations)
  8084. if ( !status && options.isLocal && !options.crossDomain ) {
  8085. status = responses.text ? 200 : 404;
  8086. // IE - #1450: sometimes returns 1223 when it should be 204
  8087. } else if ( status === 1223 ) {
  8088. status = 204;
  8089. }
  8090. }
  8091. }
  8092. // Call complete if needed
  8093. if ( responses ) {
  8094. complete( status, statusText, responses, xhr.getAllResponseHeaders() );
  8095. }
  8096. };
  8097. if ( !options.async ) {
  8098. // if we're in sync mode we fire the callback
  8099. callback();
  8100. } else if ( xhr.readyState === 4 ) {
  8101. // (IE6 & IE7) if it's in cache and has been
  8102. // retrieved directly we need to fire the callback
  8103. setTimeout( callback );
  8104. } else {
  8105. // Add to the list of active xhr callbacks
  8106. xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
  8107. }
  8108. },
  8109. abort: function() {
  8110. if ( callback ) {
  8111. callback( undefined, true );
  8112. }
  8113. }
  8114. };
  8115. }
  8116. });
  8117. }
  8118. // Functions to create xhrs
  8119. function createStandardXHR() {
  8120. try {
  8121. return new window.XMLHttpRequest();
  8122. } catch( e ) {}
  8123. }
  8124. function createActiveXHR() {
  8125. try {
  8126. return new window.ActiveXObject( "Microsoft.XMLHTTP" );
  8127. } catch( e ) {}
  8128. }
  8129. // Install script dataType
  8130. jQuery.ajaxSetup({
  8131. accepts: {
  8132. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  8133. },
  8134. contents: {
  8135. script: /(?:java|ecma)script/
  8136. },
  8137. converters: {
  8138. "text script": function( text ) {
  8139. jQuery.globalEval( text );
  8140. return text;
  8141. }
  8142. }
  8143. });
  8144. // Handle cache's special case and global
  8145. jQuery.ajaxPrefilter( "script", function( s ) {
  8146. if ( s.cache === undefined ) {
  8147. s.cache = false;
  8148. }
  8149. if ( s.crossDomain ) {
  8150. s.type = "GET";
  8151. s.global = false;
  8152. }
  8153. });
  8154. // Bind script tag hack transport
  8155. jQuery.ajaxTransport( "script", function(s) {
  8156. // This transport only deals with cross domain requests
  8157. if ( s.crossDomain ) {
  8158. var script,
  8159. head = document.head || jQuery("head")[0] || document.documentElement;
  8160. return {
  8161. send: function( _, callback ) {
  8162. script = document.createElement("script");
  8163. script.async = true;
  8164. if ( s.scriptCharset ) {
  8165. script.charset = s.scriptCharset;
  8166. }
  8167. script.src = s.url;
  8168. // Attach handlers for all browsers
  8169. script.onload = script.onreadystatechange = function( _, isAbort ) {
  8170. if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
  8171. // Handle memory leak in IE
  8172. script.onload = script.onreadystatechange = null;
  8173. // Remove the script
  8174. if ( script.parentNode ) {
  8175. script.parentNode.removeChild( script );
  8176. }
  8177. // Dereference the script
  8178. script = null;
  8179. // Callback if not abort
  8180. if ( !isAbort ) {
  8181. callback( 200, "success" );
  8182. }
  8183. }
  8184. };
  8185. // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
  8186. // Use native DOM manipulation to avoid our domManip AJAX trickery
  8187. head.insertBefore( script, head.firstChild );
  8188. },
  8189. abort: function() {
  8190. if ( script ) {
  8191. script.onload( undefined, true );
  8192. }
  8193. }
  8194. };
  8195. }
  8196. });
  8197. var oldCallbacks = [],
  8198. rjsonp = /(=)\?(?=&|$)|\?\?/;
  8199. // Default jsonp settings
  8200. jQuery.ajaxSetup({
  8201. jsonp: "callback",
  8202. jsonpCallback: function() {
  8203. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  8204. this[ callback ] = true;
  8205. return callback;
  8206. }
  8207. });
  8208. // Detect, normalize options and install callbacks for jsonp requests
  8209. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  8210. var callbackName, overwritten, responseContainer,
  8211. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  8212. "url" :
  8213. typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
  8214. );
  8215. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  8216. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  8217. // Get callback name, remembering preexisting value associated with it
  8218. callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
  8219. s.jsonpCallback() :
  8220. s.jsonpCallback;
  8221. // Insert callback into url or form data
  8222. if ( jsonProp ) {
  8223. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  8224. } else if ( s.jsonp !== false ) {
  8225. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  8226. }
  8227. // Use data converter to retrieve json after script execution
  8228. s.converters["script json"] = function() {
  8229. if ( !responseContainer ) {
  8230. jQuery.error( callbackName + " was not called" );
  8231. }
  8232. return responseContainer[ 0 ];
  8233. };
  8234. // force json dataType
  8235. s.dataTypes[ 0 ] = "json";
  8236. // Install callback
  8237. overwritten = window[ callbackName ];
  8238. window[ callbackName ] = function() {
  8239. responseContainer = arguments;
  8240. };
  8241. // Clean-up function (fires after converters)
  8242. jqXHR.always(function() {
  8243. // Restore preexisting value
  8244. window[ callbackName ] = overwritten;
  8245. // Save back as free
  8246. if ( s[ callbackName ] ) {
  8247. // make sure that re-using the options doesn't screw things around
  8248. s.jsonpCallback = originalSettings.jsonpCallback;
  8249. // save the callback name for future use
  8250. oldCallbacks.push( callbackName );
  8251. }
  8252. // Call if it was a function and we have a response
  8253. if ( responseContainer && jQuery.isFunction( overwritten ) ) {
  8254. overwritten( responseContainer[ 0 ] );
  8255. }
  8256. responseContainer = overwritten = undefined;
  8257. });
  8258. // Delegate to script
  8259. return "script";
  8260. }
  8261. });
  8262. // data: string of html
  8263. // context (optional): If specified, the fragment will be created in this context, defaults to document
  8264. // keepScripts (optional): If true, will include scripts passed in the html string
  8265. jQuery.parseHTML = function( data, context, keepScripts ) {
  8266. if ( !data || typeof data !== "string" ) {
  8267. return null;
  8268. }
  8269. if ( typeof context === "boolean" ) {
  8270. keepScripts = context;
  8271. context = false;
  8272. }
  8273. context = context || document;
  8274. var parsed = rsingleTag.exec( data ),
  8275. scripts = !keepScripts && [];
  8276. // Single tag
  8277. if ( parsed ) {
  8278. return [ context.createElement( parsed[1] ) ];
  8279. }
  8280. parsed = jQuery.buildFragment( [ data ], context, scripts );
  8281. if ( scripts && scripts.length ) {
  8282. jQuery( scripts ).remove();
  8283. }
  8284. return jQuery.merge( [], parsed.childNodes );
  8285. };
  8286. // Keep a copy of the old load method
  8287. var _load = jQuery.fn.load;
  8288. /**
  8289. * Load a url into a page
  8290. */
  8291. jQuery.fn.load = function( url, params, callback ) {
  8292. if ( typeof url !== "string" && _load ) {
  8293. return _load.apply( this, arguments );
  8294. }
  8295. var selector, response, type,
  8296. self = this,
  8297. off = url.indexOf(" ");
  8298. if ( off >= 0 ) {
  8299. selector = jQuery.trim( url.slice( off, url.length ) );
  8300. url = url.slice( 0, off );
  8301. }
  8302. // If it's a function
  8303. if ( jQuery.isFunction( params ) ) {
  8304. // We assume that it's the callback
  8305. callback = params;
  8306. params = undefined;
  8307. // Otherwise, build a param string
  8308. } else if ( params && typeof params === "object" ) {
  8309. type = "POST";
  8310. }
  8311. // If we have elements to modify, make the request
  8312. if ( self.length > 0 ) {
  8313. jQuery.ajax({
  8314. url: url,
  8315. // if "type" variable is undefined, then "GET" method will be used
  8316. type: type,
  8317. dataType: "html",
  8318. data: params
  8319. }).done(function( responseText ) {
  8320. // Save response for use in complete callback
  8321. response = arguments;
  8322. self.html( selector ?
  8323. // If a selector was specified, locate the right elements in a dummy div
  8324. // Exclude scripts to avoid IE 'Permission Denied' errors
  8325. jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
  8326. // Otherwise use the full result
  8327. responseText );
  8328. }).complete( callback && function( jqXHR, status ) {
  8329. self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
  8330. });
  8331. }
  8332. return this;
  8333. };
  8334. // Attach a bunch of functions for handling common AJAX events
  8335. jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
  8336. jQuery.fn[ type ] = function( fn ) {
  8337. return this.on( type, fn );
  8338. };
  8339. });
  8340. jQuery.expr.filters.animated = function( elem ) {
  8341. return jQuery.grep(jQuery.timers, function( fn ) {
  8342. return elem === fn.elem;
  8343. }).length;
  8344. };
  8345. var docElem = window.document.documentElement;
  8346. /**
  8347. * Gets a window from an element
  8348. */
  8349. function getWindow( elem ) {
  8350. return jQuery.isWindow( elem ) ?
  8351. elem :
  8352. elem.nodeType === 9 ?
  8353. elem.defaultView || elem.parentWindow :
  8354. false;
  8355. }
  8356. jQuery.offset = {
  8357. setOffset: function( elem, options, i ) {
  8358. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  8359. position = jQuery.css( elem, "position" ),
  8360. curElem = jQuery( elem ),
  8361. props = {};
  8362. // set position first, in-case top/left are set even on static elem
  8363. if ( position === "static" ) {
  8364. elem.style.position = "relative";
  8365. }
  8366. curOffset = curElem.offset();
  8367. curCSSTop = jQuery.css( elem, "top" );
  8368. curCSSLeft = jQuery.css( elem, "left" );
  8369. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  8370. jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
  8371. // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
  8372. if ( calculatePosition ) {
  8373. curPosition = curElem.position();
  8374. curTop = curPosition.top;
  8375. curLeft = curPosition.left;
  8376. } else {
  8377. curTop = parseFloat( curCSSTop ) || 0;
  8378. curLeft = parseFloat( curCSSLeft ) || 0;
  8379. }
  8380. if ( jQuery.isFunction( options ) ) {
  8381. options = options.call( elem, i, curOffset );
  8382. }
  8383. if ( options.top != null ) {
  8384. props.top = ( options.top - curOffset.top ) + curTop;
  8385. }
  8386. if ( options.left != null ) {
  8387. props.left = ( options.left - curOffset.left ) + curLeft;
  8388. }
  8389. if ( "using" in options ) {
  8390. options.using.call( elem, props );
  8391. } else {
  8392. curElem.css( props );
  8393. }
  8394. }
  8395. };
  8396. jQuery.fn.extend({
  8397. offset: function( options ) {
  8398. if ( arguments.length ) {
  8399. return options === undefined ?
  8400. this :
  8401. this.each(function( i ) {
  8402. jQuery.offset.setOffset( this, options, i );
  8403. });
  8404. }
  8405. var docElem, win,
  8406. box = { top: 0, left: 0 },
  8407. elem = this[ 0 ],
  8408. doc = elem && elem.ownerDocument;
  8409. if ( !doc ) {
  8410. return;
  8411. }
  8412. docElem = doc.documentElement;
  8413. // Make sure it's not a disconnected DOM node
  8414. if ( !jQuery.contains( docElem, elem ) ) {
  8415. return box;
  8416. }
  8417. // If we don't have gBCR, just use 0,0 rather than error
  8418. // BlackBerry 5, iOS 3 (original iPhone)
  8419. if ( typeof elem.getBoundingClientRect !== strundefined ) {
  8420. box = elem.getBoundingClientRect();
  8421. }
  8422. win = getWindow( doc );
  8423. return {
  8424. top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
  8425. left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
  8426. };
  8427. },
  8428. position: function() {
  8429. if ( !this[ 0 ] ) {
  8430. return;
  8431. }
  8432. var offsetParent, offset,
  8433. parentOffset = { top: 0, left: 0 },
  8434. elem = this[ 0 ];
  8435. // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
  8436. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  8437. // we assume that getBoundingClientRect is available when computed position is fixed
  8438. offset = elem.getBoundingClientRect();
  8439. } else {
  8440. // Get *real* offsetParent
  8441. offsetParent = this.offsetParent();
  8442. // Get correct offsets
  8443. offset = this.offset();
  8444. if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
  8445. parentOffset = offsetParent.offset();
  8446. }
  8447. // Add offsetParent borders
  8448. parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
  8449. parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
  8450. }
  8451. // Subtract parent offsets and element margins
  8452. // note: when an element has margin: auto the offsetLeft and marginLeft
  8453. // are the same in Safari causing offset.left to incorrectly be 0
  8454. return {
  8455. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  8456. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
  8457. };
  8458. },
  8459. offsetParent: function() {
  8460. return this.map(function() {
  8461. var offsetParent = this.offsetParent || docElem;
  8462. while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
  8463. offsetParent = offsetParent.offsetParent;
  8464. }
  8465. return offsetParent || docElem;
  8466. });
  8467. }
  8468. });
  8469. // Create scrollLeft and scrollTop methods
  8470. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  8471. var top = /Y/.test( prop );
  8472. jQuery.fn[ method ] = function( val ) {
  8473. return access( this, function( elem, method, val ) {
  8474. var win = getWindow( elem );
  8475. if ( val === undefined ) {
  8476. return win ? (prop in win) ? win[ prop ] :
  8477. win.document.documentElement[ method ] :
  8478. elem[ method ];
  8479. }
  8480. if ( win ) {
  8481. win.scrollTo(
  8482. !top ? val : jQuery( win ).scrollLeft(),
  8483. top ? val : jQuery( win ).scrollTop()
  8484. );
  8485. } else {
  8486. elem[ method ] = val;
  8487. }
  8488. }, method, val, arguments.length, null );
  8489. };
  8490. });
  8491. // Add the top/left cssHooks using jQuery.fn.position
  8492. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  8493. // getComputedStyle returns percent when specified for top/left/bottom/right
  8494. // rather than make the css module depend on the offset module, we just check for it here
  8495. jQuery.each( [ "top", "left" ], function( i, prop ) {
  8496. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  8497. function( elem, computed ) {
  8498. if ( computed ) {
  8499. computed = curCSS( elem, prop );
  8500. // if curCSS returns percentage, fallback to offset
  8501. return rnumnonpx.test( computed ) ?
  8502. jQuery( elem ).position()[ prop ] + "px" :
  8503. computed;
  8504. }
  8505. }
  8506. );
  8507. });
  8508. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  8509. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  8510. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
  8511. // margin is only for outerHeight, outerWidth
  8512. jQuery.fn[ funcName ] = function( margin, value ) {
  8513. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  8514. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  8515. return access( this, function( elem, type, value ) {
  8516. var doc;
  8517. if ( jQuery.isWindow( elem ) ) {
  8518. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  8519. // isn't a whole lot we can do. See pull request at this URL for discussion:
  8520. // https://github.com/jquery/jquery/pull/764
  8521. return elem.document.documentElement[ "client" + name ];
  8522. }
  8523. // Get document width or height
  8524. if ( elem.nodeType === 9 ) {
  8525. doc = elem.documentElement;
  8526. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  8527. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  8528. return Math.max(
  8529. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  8530. elem.body[ "offset" + name ], doc[ "offset" + name ],
  8531. doc[ "client" + name ]
  8532. );
  8533. }
  8534. return value === undefined ?
  8535. // Get width or height on the element, requesting but not forcing parseFloat
  8536. jQuery.css( elem, type, extra ) :
  8537. // Set width or height on the element
  8538. jQuery.style( elem, type, value, extra );
  8539. }, type, chainable ? margin : undefined, chainable, null );
  8540. };
  8541. });
  8542. });
  8543. // The number of elements contained in the matched element set
  8544. jQuery.fn.size = function() {
  8545. return this.length;
  8546. };
  8547. jQuery.fn.andSelf = jQuery.fn.addBack;
  8548. // Register as a named AMD module, since jQuery can be concatenated with other
  8549. // files that may use define, but not via a proper concatenation script that
  8550. // understands anonymous AMD modules. A named AMD is safest and most robust
  8551. // way to register. Lowercase jquery is used because AMD module names are
  8552. // derived from file names, and jQuery is normally delivered in a lowercase
  8553. // file name. Do this after creating the global so that if an AMD module wants
  8554. // to call noConflict to hide this version of jQuery, it will work.
  8555. // Note that for maximum portability, libraries that are not jQuery should
  8556. // declare themselves as anonymous modules, and avoid setting a global if an
  8557. // AMD loader is present. jQuery is a special case. For more information, see
  8558. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  8559. if ( typeof define === "function" && define.amd ) {
  8560. define( "jquery", [], function() {
  8561. return jQuery;
  8562. });
  8563. }
  8564. var
  8565. // Map over jQuery in case of overwrite
  8566. _jQuery = window.jQuery,
  8567. // Map over the $ in case of overwrite
  8568. _$ = window.$;
  8569. jQuery.noConflict = function( deep ) {
  8570. if ( window.$ === jQuery ) {
  8571. window.$ = _$;
  8572. }
  8573. if ( deep && window.jQuery === jQuery ) {
  8574. window.jQuery = _jQuery;
  8575. }
  8576. return jQuery;
  8577. };
  8578. // Expose jQuery and $ identifiers, even in
  8579. // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  8580. // and CommonJS for browser emulators (#13566)
  8581. if ( typeof noGlobal === strundefined ) {
  8582. window.jQuery = window.$ = jQuery;
  8583. }
  8584. return jQuery;
  8585. }));