jquery.js 242 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252
  1. /*! jQuery v1.7.1 jquery.com | jquery.org/license */
  2. (function( window, undefined ) {
  3. // Use the correct document accordingly with window argument (sandbox)
  4. var document = window.document,
  5. navigator = window.navigator,
  6. location = window.location;
  7. var jQuery = (function() {
  8. // Define a local copy of jQuery
  9. var jQuery = function( selector, context ) {
  10. // The jQuery object is actually just the init constructor 'enhanced'
  11. return new jQuery.fn.init( selector, context, rootjQuery );
  12. },
  13. // Map over jQuery in case of overwrite
  14. _jQuery = window.jQuery,
  15. // Map over the $ in case of overwrite
  16. _$ = window.$,
  17. // A central reference to the root jQuery(document)
  18. rootjQuery,
  19. // A simple way to check for HTML strings or ID strings
  20. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  21. quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
  22. // Check if a string has a non-whitespace character in it
  23. rnotwhite = /\S/,
  24. // Used for trimming whitespace
  25. trimLeft = /^\s+/,
  26. trimRight = /\s+$/,
  27. // Match a standalone tag
  28. rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
  29. // JSON RegExp
  30. rvalidchars = /^[\],:{}\s]*$/,
  31. rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
  32. rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  33. rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
  34. // Useragent RegExp
  35. rwebkit = /(webkit)[ \/]([\w.]+)/,
  36. ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
  37. rmsie = /(msie) ([\w.]+)/,
  38. rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
  39. // Matches dashed string for camelizing
  40. rdashAlpha = /-([a-z]|[0-9])/ig,
  41. rmsPrefix = /^-ms-/,
  42. // Used by jQuery.camelCase as callback to replace()
  43. fcamelCase = function( all, letter ) {
  44. return ( letter + "" ).toUpperCase();
  45. },
  46. // Keep a UserAgent string for use with jQuery.browser
  47. userAgent = navigator.userAgent,
  48. // For matching the engine and version of the browser
  49. browserMatch,
  50. // The deferred used on DOM ready
  51. readyList,
  52. // The ready event handler
  53. DOMContentLoaded,
  54. // Save a reference to some core methods
  55. toString = Object.prototype.toString,
  56. hasOwn = Object.prototype.hasOwnProperty,
  57. push = Array.prototype.push,
  58. slice = Array.prototype.slice,
  59. trim = String.prototype.trim,
  60. indexOf = Array.prototype.indexOf,
  61. // [[Class]] -> type pairs
  62. class2type = {};
  63. jQuery.fn = jQuery.prototype = {
  64. constructor: jQuery,
  65. init: function( selector, context, rootjQuery ) {
  66. var match, elem, ret, doc;
  67. // Handle $(""), $(null), or $(undefined)
  68. if ( !selector ) {
  69. return this;
  70. }
  71. // Handle $(DOMElement)
  72. if ( selector.nodeType ) {
  73. this.context = this[0] = selector;
  74. this.length = 1;
  75. return this;
  76. }
  77. // The body element only exists once, optimize finding it
  78. if ( selector === "body" && !context && document.body ) {
  79. this.context = document;
  80. this[0] = document.body;
  81. this.selector = selector;
  82. this.length = 1;
  83. return this;
  84. }
  85. // Handle HTML strings
  86. if ( typeof selector === "string" ) {
  87. // Are we dealing with HTML string or an ID?
  88. if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
  89. // Assume that strings that start and end with <> are HTML and skip the regex check
  90. match = [ null, selector, null ];
  91. } else {
  92. match = quickExpr.exec( selector );
  93. }
  94. // Verify a match, and that no context was specified for #id
  95. if ( match && (match[1] || !context) ) {
  96. // HANDLE: $(html) -> $(array)
  97. if ( match[1] ) {
  98. context = context instanceof jQuery ? context[0] : context;
  99. doc = ( context ? context.ownerDocument || context : document );
  100. // If a single string is passed in and it's a single tag
  101. // just do a createElement and skip the rest
  102. ret = rsingleTag.exec( selector );
  103. if ( ret ) {
  104. if ( jQuery.isPlainObject( context ) ) {
  105. selector = [ document.createElement( ret[1] ) ];
  106. jQuery.fn.attr.call( selector, context, true );
  107. } else {
  108. selector = [ doc.createElement( ret[1] ) ];
  109. }
  110. } else {
  111. ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
  112. selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
  113. }
  114. return jQuery.merge( this, selector );
  115. // HANDLE: $("#id")
  116. } else {
  117. elem = document.getElementById( match[2] );
  118. // Check parentNode to catch when Blackberry 4.6 returns
  119. // nodes that are no longer in the document #6963
  120. if ( elem && elem.parentNode ) {
  121. // Handle the case where IE and Opera return items
  122. // by name instead of ID
  123. if ( elem.id !== match[2] ) {
  124. return rootjQuery.find( selector );
  125. }
  126. // Otherwise, we inject the element directly into the jQuery object
  127. this.length = 1;
  128. this[0] = elem;
  129. }
  130. this.context = document;
  131. this.selector = selector;
  132. return this;
  133. }
  134. // HANDLE: $(expr, $(...))
  135. } else if ( !context || context.jquery ) {
  136. return ( context || rootjQuery ).find( selector );
  137. // HANDLE: $(expr, context)
  138. // (which is just equivalent to: $(context).find(expr)
  139. } else {
  140. return this.constructor( context ).find( selector );
  141. }
  142. // HANDLE: $(function)
  143. // Shortcut for document ready
  144. } else if ( jQuery.isFunction( selector ) ) {
  145. return rootjQuery.ready( selector );
  146. }
  147. if ( selector.selector !== undefined ) {
  148. this.selector = selector.selector;
  149. this.context = selector.context;
  150. }
  151. return jQuery.makeArray( selector, this );
  152. },
  153. // Start with an empty selector
  154. selector: "",
  155. // The current version of jQuery being used
  156. jquery: "1.7.1",
  157. // The default length of a jQuery object is 0
  158. length: 0,
  159. // The number of elements contained in the matched element set
  160. size: function() {
  161. return this.length;
  162. },
  163. toArray: function() {
  164. return slice.call( this, 0 );
  165. },
  166. // Get the Nth element in the matched element set OR
  167. // Get the whole matched element set as a clean array
  168. get: function( num ) {
  169. return num == null ?
  170. // Return a 'clean' array
  171. this.toArray() :
  172. // Return just the object
  173. ( num < 0 ? this[ this.length + num ] : this[ num ] );
  174. },
  175. // Take an array of elements and push it onto the stack
  176. // (returning the new matched element set)
  177. pushStack: function( elems, name, selector ) {
  178. // Build a new jQuery matched element set
  179. var ret = this.constructor();
  180. if ( jQuery.isArray( elems ) ) {
  181. push.apply( ret, elems );
  182. } else {
  183. jQuery.merge( ret, elems );
  184. }
  185. // Add the old object onto the stack (as a reference)
  186. ret.prevObject = this;
  187. ret.context = this.context;
  188. if ( name === "find" ) {
  189. ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
  190. } else if ( name ) {
  191. ret.selector = this.selector + "." + name + "(" + selector + ")";
  192. }
  193. // Return the newly-formed element set
  194. return ret;
  195. },
  196. // Execute a callback for every element in the matched set.
  197. // (You can seed the arguments with an array of args, but this is
  198. // only used internally.)
  199. each: function( callback, args ) {
  200. return jQuery.each( this, callback, args );
  201. },
  202. ready: function( fn ) {
  203. // Attach the listeners
  204. jQuery.bindReady();
  205. // Add the callback
  206. readyList.add( fn );
  207. return this;
  208. },
  209. eq: function( i ) {
  210. i = +i;
  211. return i === -1 ?
  212. this.slice( i ) :
  213. this.slice( i, i + 1 );
  214. },
  215. first: function() {
  216. return this.eq( 0 );
  217. },
  218. last: function() {
  219. return this.eq( -1 );
  220. },
  221. slice: function() {
  222. return this.pushStack( slice.apply( this, arguments ),
  223. "slice", slice.call(arguments).join(",") );
  224. },
  225. map: function( callback ) {
  226. return this.pushStack( jQuery.map(this, function( elem, i ) {
  227. return callback.call( elem, i, elem );
  228. }));
  229. },
  230. end: function() {
  231. return this.prevObject || this.constructor(null);
  232. },
  233. // For internal use only.
  234. // Behaves like an Array's method, not like a jQuery method.
  235. push: push,
  236. sort: [].sort,
  237. splice: [].splice
  238. };
  239. // Give the init function the jQuery prototype for later instantiation
  240. jQuery.fn.init.prototype = jQuery.fn;
  241. jQuery.extend = jQuery.fn.extend = function() {
  242. var options, name, src, copy, copyIsArray, clone,
  243. target = arguments[0] || {},
  244. i = 1,
  245. length = arguments.length,
  246. deep = false;
  247. // Handle a deep copy situation
  248. if ( typeof target === "boolean" ) {
  249. deep = target;
  250. target = arguments[1] || {};
  251. // skip the boolean and the target
  252. i = 2;
  253. }
  254. // Handle case when target is a string or something (possible in deep copy)
  255. if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  256. target = {};
  257. }
  258. // extend jQuery itself if only one argument is passed
  259. if ( length === i ) {
  260. target = this;
  261. --i;
  262. }
  263. for ( ; i < length; i++ ) {
  264. // Only deal with non-null/undefined values
  265. if ( (options = arguments[ i ]) != null ) {
  266. // Extend the base object
  267. for ( name in options ) {
  268. src = target[ name ];
  269. copy = options[ name ];
  270. // Prevent never-ending loop
  271. if ( target === copy ) {
  272. continue;
  273. }
  274. // Recurse if we're merging plain objects or arrays
  275. if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
  276. if ( copyIsArray ) {
  277. copyIsArray = false;
  278. clone = src && jQuery.isArray(src) ? src : [];
  279. } else {
  280. clone = src && jQuery.isPlainObject(src) ? src : {};
  281. }
  282. // Never move original objects, clone them
  283. target[ name ] = jQuery.extend( deep, clone, copy );
  284. // Don't bring in undefined values
  285. } else if ( copy !== undefined ) {
  286. target[ name ] = copy;
  287. }
  288. }
  289. }
  290. }
  291. // Return the modified object
  292. return target;
  293. };
  294. jQuery.extend({
  295. noConflict: function( deep ) {
  296. if ( window.$ === jQuery ) {
  297. window.$ = _$;
  298. }
  299. if ( deep && window.jQuery === jQuery ) {
  300. window.jQuery = _jQuery;
  301. }
  302. return jQuery;
  303. },
  304. // Is the DOM ready to be used? Set to true once it occurs.
  305. isReady: false,
  306. // A counter to track how many items to wait for before
  307. // the ready event fires. See #6781
  308. readyWait: 1,
  309. // Hold (or release) the ready event
  310. holdReady: function( hold ) {
  311. if ( hold ) {
  312. jQuery.readyWait++;
  313. } else {
  314. jQuery.ready( true );
  315. }
  316. },
  317. // Handle when the DOM is ready
  318. ready: function( wait ) {
  319. // Either a released hold or an DOMready/load event and not yet ready
  320. if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
  321. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  322. if ( !document.body ) {
  323. return setTimeout( jQuery.ready, 1 );
  324. }
  325. // Remember that the DOM is ready
  326. jQuery.isReady = true;
  327. // If a normal DOM Ready event fired, decrement, and wait if need be
  328. if ( wait !== true && --jQuery.readyWait > 0 ) {
  329. return;
  330. }
  331. // If there are functions bound, to execute
  332. readyList.fireWith( document, [ jQuery ] );
  333. // Trigger any bound ready events
  334. if ( jQuery.fn.trigger ) {
  335. jQuery( document ).trigger( "ready" ).off( "ready" );
  336. }
  337. }
  338. },
  339. bindReady: function() {
  340. if ( readyList ) {
  341. return;
  342. }
  343. readyList = jQuery.Callbacks( "once memory" );
  344. // Catch cases where $(document).ready() is called after the
  345. // browser event has already occurred.
  346. if ( document.readyState === "complete" ) {
  347. // Handle it asynchronously to allow scripts the opportunity to delay ready
  348. return setTimeout( jQuery.ready, 1 );
  349. }
  350. // Mozilla, Opera and webkit nightlies currently support this event
  351. if ( document.addEventListener ) {
  352. // Use the handy event callback
  353. document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  354. // A fallback to window.onload, that will always work
  355. window.addEventListener( "load", jQuery.ready, false );
  356. // If IE event model is used
  357. } else if ( document.attachEvent ) {
  358. // ensure firing before onload,
  359. // maybe late but safe also for iframes
  360. document.attachEvent( "onreadystatechange", DOMContentLoaded );
  361. // A fallback to window.onload, that will always work
  362. window.attachEvent( "onload", jQuery.ready );
  363. // If IE and not a frame
  364. // continually check to see if the document is ready
  365. var toplevel = false;
  366. try {
  367. toplevel = window.frameElement == null;
  368. } catch(e) {}
  369. if ( document.documentElement.doScroll && toplevel ) {
  370. doScrollCheck();
  371. }
  372. }
  373. },
  374. // See test/unit/core.js for details concerning isFunction.
  375. // Since version 1.3, DOM methods and functions like alert
  376. // aren't supported. They return false on IE (#2968).
  377. isFunction: function( obj ) {
  378. return jQuery.type(obj) === "function";
  379. },
  380. isArray: Array.isArray || function( obj ) {
  381. return jQuery.type(obj) === "array";
  382. },
  383. // A crude way of determining if an object is a window
  384. isWindow: function( obj ) {
  385. return obj && typeof obj === "object" && "setInterval" in obj;
  386. },
  387. isNumeric: function( obj ) {
  388. return !isNaN( parseFloat(obj) ) && isFinite( obj );
  389. },
  390. type: function( obj ) {
  391. return obj == null ?
  392. String( obj ) :
  393. class2type[ toString.call(obj) ] || "object";
  394. },
  395. isPlainObject: function( obj ) {
  396. // Must be an Object.
  397. // Because of IE, we also have to check the presence of the constructor property.
  398. // Make sure that DOM nodes and window objects don't pass through, as well
  399. if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  400. return false;
  401. }
  402. try {
  403. // Not own constructor property must be Object
  404. if ( obj.constructor &&
  405. !hasOwn.call(obj, "constructor") &&
  406. !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
  407. return false;
  408. }
  409. } catch ( e ) {
  410. // IE8,9 Will throw exceptions on certain host objects #9897
  411. return false;
  412. }
  413. // Own properties are enumerated firstly, so to speed up,
  414. // if last one is own, then all properties are own.
  415. var key;
  416. for ( key in obj ) {}
  417. return key === undefined || hasOwn.call( obj, key );
  418. },
  419. isEmptyObject: function( obj ) {
  420. for ( var name in obj ) {
  421. return false;
  422. }
  423. return true;
  424. },
  425. error: function( msg ) {
  426. throw new Error( msg );
  427. },
  428. parseJSON: function( data ) {
  429. if ( typeof data !== "string" || !data ) {
  430. return null;
  431. }
  432. // Make sure leading/trailing whitespace is removed (IE can't handle it)
  433. data = jQuery.trim( data );
  434. // Attempt to parse using the native JSON parser first
  435. if ( window.JSON && window.JSON.parse ) {
  436. return window.JSON.parse( data );
  437. }
  438. // Make sure the incoming data is actual JSON
  439. // Logic borrowed from http://json.org/json2.js
  440. if ( rvalidchars.test( data.replace( rvalidescape, "@" )
  441. .replace( rvalidtokens, "]" )
  442. .replace( rvalidbraces, "")) ) {
  443. return ( new Function( "return " + data ) )();
  444. }
  445. jQuery.error( "Invalid JSON: " + data );
  446. },
  447. // Cross-browser xml parsing
  448. parseXML: function( data ) {
  449. var xml, tmp;
  450. try {
  451. if ( window.DOMParser ) { // Standard
  452. tmp = new DOMParser();
  453. xml = tmp.parseFromString( data , "text/xml" );
  454. } else { // IE
  455. xml = new ActiveXObject( "Microsoft.XMLDOM" );
  456. xml.async = "false";
  457. xml.loadXML( data );
  458. }
  459. } catch( e ) {
  460. xml = undefined;
  461. }
  462. if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
  463. jQuery.error( "Invalid XML: " + data );
  464. }
  465. return xml;
  466. },
  467. noop: function() {},
  468. // Evaluates a script in a global context
  469. // Workarounds based on findings by Jim Driscoll
  470. // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
  471. globalEval: function( data ) {
  472. if ( data && rnotwhite.test( data ) ) {
  473. // We use execScript on Internet Explorer
  474. // We use an anonymous function so that context is window
  475. // rather than jQuery in Firefox
  476. ( window.execScript || function( data ) {
  477. window[ "eval" ].call( window, data );
  478. } )( data );
  479. }
  480. },
  481. // Convert dashed to camelCase; used by the css and data modules
  482. // Microsoft forgot to hump their vendor prefix (#9572)
  483. camelCase: function( string ) {
  484. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  485. },
  486. nodeName: function( elem, name ) {
  487. return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
  488. },
  489. // args is for internal usage only
  490. each: function( object, callback, args ) {
  491. var name, i = 0,
  492. length = object.length,
  493. isObj = length === undefined || jQuery.isFunction( object );
  494. if ( args ) {
  495. if ( isObj ) {
  496. for ( name in object ) {
  497. if ( callback.apply( object[ name ], args ) === false ) {
  498. break;
  499. }
  500. }
  501. } else {
  502. for ( ; i < length; ) {
  503. if ( callback.apply( object[ i++ ], args ) === false ) {
  504. break;
  505. }
  506. }
  507. }
  508. // A special, fast, case for the most common use of each
  509. } else {
  510. if ( isObj ) {
  511. for ( name in object ) {
  512. if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
  513. break;
  514. }
  515. }
  516. } else {
  517. for ( ; i < length; ) {
  518. if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
  519. break;
  520. }
  521. }
  522. }
  523. }
  524. return object;
  525. },
  526. // Use native String.trim function wherever possible
  527. trim: trim ?
  528. function( text ) {
  529. return text == null ?
  530. "" :
  531. trim.call( text );
  532. } :
  533. // Otherwise use our own trimming functionality
  534. function( text ) {
  535. return text == null ?
  536. "" :
  537. text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
  538. },
  539. // results is for internal usage only
  540. makeArray: function( array, results ) {
  541. var ret = results || [];
  542. if ( array != null ) {
  543. // The window, strings (and functions) also have 'length'
  544. // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
  545. var type = jQuery.type( array );
  546. if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
  547. push.call( ret, array );
  548. } else {
  549. jQuery.merge( ret, array );
  550. }
  551. }
  552. return ret;
  553. },
  554. inArray: function( elem, array, i ) {
  555. var len;
  556. if ( array ) {
  557. if ( indexOf ) {
  558. return indexOf.call( array, elem, i );
  559. }
  560. len = array.length;
  561. i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
  562. for ( ; i < len; i++ ) {
  563. // Skip accessing in sparse arrays
  564. if ( i in array && array[ i ] === elem ) {
  565. return i;
  566. }
  567. }
  568. }
  569. return -1;
  570. },
  571. merge: function( first, second ) {
  572. var i = first.length,
  573. j = 0;
  574. if ( typeof second.length === "number" ) {
  575. for ( var l = second.length; j < l; j++ ) {
  576. first[ i++ ] = second[ j ];
  577. }
  578. } else {
  579. while ( second[j] !== undefined ) {
  580. first[ i++ ] = second[ j++ ];
  581. }
  582. }
  583. first.length = i;
  584. return first;
  585. },
  586. grep: function( elems, callback, inv ) {
  587. var ret = [], retVal;
  588. inv = !!inv;
  589. // Go through the array, only saving the items
  590. // that pass the validator function
  591. for ( var i = 0, length = elems.length; i < length; i++ ) {
  592. retVal = !!callback( elems[ i ], i );
  593. if ( inv !== retVal ) {
  594. ret.push( elems[ i ] );
  595. }
  596. }
  597. return ret;
  598. },
  599. // arg is for internal usage only
  600. map: function( elems, callback, arg ) {
  601. var value, key, ret = [],
  602. i = 0,
  603. length = elems.length,
  604. // jquery objects are treated as arrays
  605. isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
  606. // Go through the array, translating each of the items to their
  607. if ( isArray ) {
  608. for ( ; i < length; i++ ) {
  609. value = callback( elems[ i ], i, arg );
  610. if ( value != null ) {
  611. ret[ ret.length ] = value;
  612. }
  613. }
  614. // Go through every key on the object
  615. } else {
  616. for ( key in elems ) {
  617. value = callback( elems[ key ], key, arg );
  618. if ( value != null ) {
  619. ret[ ret.length ] = value;
  620. }
  621. }
  622. }
  623. // Flatten any nested arrays
  624. return ret.concat.apply( [], ret );
  625. },
  626. // A global GUID counter for objects
  627. guid: 1,
  628. // Bind a function to a context, optionally partially applying any
  629. // arguments.
  630. proxy: function( fn, context ) {
  631. if ( typeof context === "string" ) {
  632. var tmp = fn[ context ];
  633. context = fn;
  634. fn = tmp;
  635. }
  636. // Quick check to determine if target is callable, in the spec
  637. // this throws a TypeError, but we will just return undefined.
  638. if ( !jQuery.isFunction( fn ) ) {
  639. return undefined;
  640. }
  641. // Simulated bind
  642. var args = slice.call( arguments, 2 ),
  643. proxy = function() {
  644. return fn.apply( context, args.concat( slice.call( arguments ) ) );
  645. };
  646. // Set the guid of unique handler to the same of original handler, so it can be removed
  647. proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
  648. return proxy;
  649. },
  650. // Mutifunctional method to get and set values to a collection
  651. // The value/s can optionally be executed if it's a function
  652. access: function( elems, key, value, exec, fn, pass ) {
  653. var length = elems.length;
  654. // Setting many attributes
  655. if ( typeof key === "object" ) {
  656. for ( var k in key ) {
  657. jQuery.access( elems, k, key[k], exec, fn, value );
  658. }
  659. return elems;
  660. }
  661. // Setting one attribute
  662. if ( value !== undefined ) {
  663. // Optionally, function values get executed if exec is true
  664. exec = !pass && exec && jQuery.isFunction(value);
  665. for ( var i = 0; i < length; i++ ) {
  666. fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
  667. }
  668. return elems;
  669. }
  670. // Getting an attribute
  671. return length ? fn( elems[0], key ) : undefined;
  672. },
  673. now: function() {
  674. return ( new Date() ).getTime();
  675. },
  676. // Use of jQuery.browser is frowned upon.
  677. // More details: http://docs.jquery.com/Utilities/jQuery.browser
  678. uaMatch: function( ua ) {
  679. ua = ua.toLowerCase();
  680. var match = rwebkit.exec( ua ) ||
  681. ropera.exec( ua ) ||
  682. rmsie.exec( ua ) ||
  683. ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
  684. [];
  685. return { browser: match[1] || "", version: match[2] || "0" };
  686. },
  687. sub: function() {
  688. function jQuerySub( selector, context ) {
  689. return new jQuerySub.fn.init( selector, context );
  690. }
  691. jQuery.extend( true, jQuerySub, this );
  692. jQuerySub.superclass = this;
  693. jQuerySub.fn = jQuerySub.prototype = this();
  694. jQuerySub.fn.constructor = jQuerySub;
  695. jQuerySub.sub = this.sub;
  696. jQuerySub.fn.init = function init( selector, context ) {
  697. if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
  698. context = jQuerySub( context );
  699. }
  700. return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
  701. };
  702. jQuerySub.fn.init.prototype = jQuerySub.fn;
  703. var rootjQuerySub = jQuerySub(document);
  704. return jQuerySub;
  705. },
  706. browser: {}
  707. });
  708. // Populate the class2type map
  709. jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
  710. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  711. });
  712. browserMatch = jQuery.uaMatch( userAgent );
  713. if ( browserMatch.browser ) {
  714. jQuery.browser[ browserMatch.browser ] = true;
  715. jQuery.browser.version = browserMatch.version;
  716. }
  717. // Deprecated, use jQuery.browser.webkit instead
  718. if ( jQuery.browser.webkit ) {
  719. jQuery.browser.safari = true;
  720. }
  721. // IE doesn't match non-breaking spaces with \s
  722. if ( rnotwhite.test( "\xA0" ) ) {
  723. trimLeft = /^[\s\xA0]+/;
  724. trimRight = /[\s\xA0]+$/;
  725. }
  726. // All jQuery objects should point back to these
  727. rootjQuery = jQuery(document);
  728. // Cleanup functions for the document ready method
  729. if ( document.addEventListener ) {
  730. DOMContentLoaded = function() {
  731. document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  732. jQuery.ready();
  733. };
  734. } else if ( document.attachEvent ) {
  735. DOMContentLoaded = function() {
  736. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  737. if ( document.readyState === "complete" ) {
  738. document.detachEvent( "onreadystatechange", DOMContentLoaded );
  739. jQuery.ready();
  740. }
  741. };
  742. }
  743. // The DOM ready check for Internet Explorer
  744. function doScrollCheck() {
  745. if ( jQuery.isReady ) {
  746. return;
  747. }
  748. try {
  749. // If IE is used, use the trick by Diego Perini
  750. // http://javascript.nwbox.com/IEContentLoaded/
  751. document.documentElement.doScroll("left");
  752. } catch(e) {
  753. setTimeout( doScrollCheck, 1 );
  754. return;
  755. }
  756. // and execute any waiting functions
  757. jQuery.ready();
  758. }
  759. return jQuery;
  760. })();
  761. // String to Object flags format cache
  762. var flagsCache = {};
  763. // Convert String-formatted flags into Object-formatted ones and store in cache
  764. function createFlags( flags ) {
  765. var object = flagsCache[ flags ] = {},
  766. i, length;
  767. flags = flags.split( /\s+/ );
  768. for ( i = 0, length = flags.length; i < length; i++ ) {
  769. object[ flags[i] ] = true;
  770. }
  771. return object;
  772. }
  773. /*
  774. * Create a callback list using the following parameters:
  775. *
  776. * flags: an optional list of space-separated flags that will change how
  777. * the callback list behaves
  778. *
  779. * By default a callback list will act like an event callback list and can be
  780. * "fired" multiple times.
  781. *
  782. * Possible flags:
  783. *
  784. * once: will ensure the callback list can only be fired once (like a Deferred)
  785. *
  786. * memory: will keep track of previous values and will call any callback added
  787. * after the list has been fired right away with the latest "memorized"
  788. * values (like a Deferred)
  789. *
  790. * unique: will ensure a callback can only be added once (no duplicate in the list)
  791. *
  792. * stopOnFalse: interrupt callings when a callback returns false
  793. *
  794. */
  795. jQuery.Callbacks = function( flags ) {
  796. // Convert flags from String-formatted to Object-formatted
  797. // (we check in cache first)
  798. flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
  799. var // Actual callback list
  800. list = [],
  801. // Stack of fire calls for repeatable lists
  802. stack = [],
  803. // Last fire value (for non-forgettable lists)
  804. memory,
  805. // Flag to know if list is currently firing
  806. firing,
  807. // First callback to fire (used internally by add and fireWith)
  808. firingStart,
  809. // End of the loop when firing
  810. firingLength,
  811. // Index of currently firing callback (modified by remove if needed)
  812. firingIndex,
  813. // Add one or several callbacks to the list
  814. add = function( args ) {
  815. var i,
  816. length,
  817. elem,
  818. type,
  819. actual;
  820. for ( i = 0, length = args.length; i < length; i++ ) {
  821. elem = args[ i ];
  822. type = jQuery.type( elem );
  823. if ( type === "array" ) {
  824. // Inspect recursively
  825. add( elem );
  826. } else if ( type === "function" ) {
  827. // Add if not in unique mode and callback is not in
  828. if ( !flags.unique || !self.has( elem ) ) {
  829. list.push( elem );
  830. }
  831. }
  832. }
  833. },
  834. // Fire callbacks
  835. fire = function( context, args ) {
  836. args = args || [];
  837. memory = !flags.memory || [ context, args ];
  838. firing = true;
  839. firingIndex = firingStart || 0;
  840. firingStart = 0;
  841. firingLength = list.length;
  842. for ( ; list && firingIndex < firingLength; firingIndex++ ) {
  843. if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
  844. memory = true; // Mark as halted
  845. break;
  846. }
  847. }
  848. firing = false;
  849. if ( list ) {
  850. if ( !flags.once ) {
  851. if ( stack && stack.length ) {
  852. memory = stack.shift();
  853. self.fireWith( memory[ 0 ], memory[ 1 ] );
  854. }
  855. } else if ( memory === true ) {
  856. self.disable();
  857. } else {
  858. list = [];
  859. }
  860. }
  861. },
  862. // Actual Callbacks object
  863. self = {
  864. // Add a callback or a collection of callbacks to the list
  865. add: function() {
  866. if ( list ) {
  867. var length = list.length;
  868. add( arguments );
  869. // Do we need to add the callbacks to the
  870. // current firing batch?
  871. if ( firing ) {
  872. firingLength = list.length;
  873. // With memory, if we're not firing then
  874. // we should call right away, unless previous
  875. // firing was halted (stopOnFalse)
  876. } else if ( memory && memory !== true ) {
  877. firingStart = length;
  878. fire( memory[ 0 ], memory[ 1 ] );
  879. }
  880. }
  881. return this;
  882. },
  883. // Remove a callback from the list
  884. remove: function() {
  885. if ( list ) {
  886. var args = arguments,
  887. argIndex = 0,
  888. argLength = args.length;
  889. for ( ; argIndex < argLength ; argIndex++ ) {
  890. for ( var i = 0; i < list.length; i++ ) {
  891. if ( args[ argIndex ] === list[ i ] ) {
  892. // Handle firingIndex and firingLength
  893. if ( firing ) {
  894. if ( i <= firingLength ) {
  895. firingLength--;
  896. if ( i <= firingIndex ) {
  897. firingIndex--;
  898. }
  899. }
  900. }
  901. // Remove the element
  902. list.splice( i--, 1 );
  903. // If we have some unicity property then
  904. // we only need to do this once
  905. if ( flags.unique ) {
  906. break;
  907. }
  908. }
  909. }
  910. }
  911. }
  912. return this;
  913. },
  914. // Control if a given callback is in the list
  915. has: function( fn ) {
  916. if ( list ) {
  917. var i = 0,
  918. length = list.length;
  919. for ( ; i < length; i++ ) {
  920. if ( fn === list[ i ] ) {
  921. return true;
  922. }
  923. }
  924. }
  925. return false;
  926. },
  927. // Remove all callbacks from the list
  928. empty: function() {
  929. list = [];
  930. return this;
  931. },
  932. // Have the list do nothing anymore
  933. disable: function() {
  934. list = stack = memory = undefined;
  935. return this;
  936. },
  937. // Is it disabled?
  938. disabled: function() {
  939. return !list;
  940. },
  941. // Lock the list in its current state
  942. lock: function() {
  943. stack = undefined;
  944. if ( !memory || memory === true ) {
  945. self.disable();
  946. }
  947. return this;
  948. },
  949. // Is it locked?
  950. locked: function() {
  951. return !stack;
  952. },
  953. // Call all callbacks with the given context and arguments
  954. fireWith: function( context, args ) {
  955. if ( stack ) {
  956. if ( firing ) {
  957. if ( !flags.once ) {
  958. stack.push( [ context, args ] );
  959. }
  960. } else if ( !( flags.once && memory ) ) {
  961. fire( context, args );
  962. }
  963. }
  964. return this;
  965. },
  966. // Call all the callbacks with the given arguments
  967. fire: function() {
  968. self.fireWith( this, arguments );
  969. return this;
  970. },
  971. // To know if the callbacks have already been called at least once
  972. fired: function() {
  973. return !!memory;
  974. }
  975. };
  976. return self;
  977. };
  978. var // Static reference to slice
  979. sliceDeferred = [].slice;
  980. jQuery.extend({
  981. Deferred: function( func ) {
  982. var doneList = jQuery.Callbacks( "once memory" ),
  983. failList = jQuery.Callbacks( "once memory" ),
  984. progressList = jQuery.Callbacks( "memory" ),
  985. state = "pending",
  986. lists = {
  987. resolve: doneList,
  988. reject: failList,
  989. notify: progressList
  990. },
  991. promise = {
  992. done: doneList.add,
  993. fail: failList.add,
  994. progress: progressList.add,
  995. state: function() {
  996. return state;
  997. },
  998. // Deprecated
  999. isResolved: doneList.fired,
  1000. isRejected: failList.fired,
  1001. then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
  1002. deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
  1003. return this;
  1004. },
  1005. always: function() {
  1006. deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
  1007. return this;
  1008. },
  1009. pipe: function( fnDone, fnFail, fnProgress ) {
  1010. return jQuery.Deferred(function( newDefer ) {
  1011. jQuery.each( {
  1012. done: [ fnDone, "resolve" ],
  1013. fail: [ fnFail, "reject" ],
  1014. progress: [ fnProgress, "notify" ]
  1015. }, function( handler, data ) {
  1016. var fn = data[ 0 ],
  1017. action = data[ 1 ],
  1018. returned;
  1019. if ( jQuery.isFunction( fn ) ) {
  1020. deferred[ handler ](function() {
  1021. returned = fn.apply( this, arguments );
  1022. if ( returned && jQuery.isFunction( returned.promise ) ) {
  1023. returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
  1024. } else {
  1025. newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
  1026. }
  1027. });
  1028. } else {
  1029. deferred[ handler ]( newDefer[ action ] );
  1030. }
  1031. });
  1032. }).promise();
  1033. },
  1034. // Get a promise for this deferred
  1035. // If obj is provided, the promise aspect is added to the object
  1036. promise: function( obj ) {
  1037. if ( obj == null ) {
  1038. obj = promise;
  1039. } else {
  1040. for ( var key in promise ) {
  1041. obj[ key ] = promise[ key ];
  1042. }
  1043. }
  1044. return obj;
  1045. }
  1046. },
  1047. deferred = promise.promise({}),
  1048. key;
  1049. for ( key in lists ) {
  1050. deferred[ key ] = lists[ key ].fire;
  1051. deferred[ key + "With" ] = lists[ key ].fireWith;
  1052. }
  1053. // Handle state
  1054. deferred.done( function() {
  1055. state = "resolved";
  1056. }, failList.disable, progressList.lock ).fail( function() {
  1057. state = "rejected";
  1058. }, doneList.disable, progressList.lock );
  1059. // Call given func if any
  1060. if ( func ) {
  1061. func.call( deferred, deferred );
  1062. }
  1063. // All done!
  1064. return deferred;
  1065. },
  1066. // Deferred helper
  1067. when: function( firstParam ) {
  1068. var args = sliceDeferred.call( arguments, 0 ),
  1069. i = 0,
  1070. length = args.length,
  1071. pValues = new Array( length ),
  1072. count = length,
  1073. pCount = length,
  1074. deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
  1075. firstParam :
  1076. jQuery.Deferred(),
  1077. promise = deferred.promise();
  1078. function resolveFunc( i ) {
  1079. return function( value ) {
  1080. args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
  1081. if ( !( --count ) ) {
  1082. deferred.resolveWith( deferred, args );
  1083. }
  1084. };
  1085. }
  1086. function progressFunc( i ) {
  1087. return function( value ) {
  1088. pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
  1089. deferred.notifyWith( promise, pValues );
  1090. };
  1091. }
  1092. if ( length > 1 ) {
  1093. for ( ; i < length; i++ ) {
  1094. if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
  1095. args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
  1096. } else {
  1097. --count;
  1098. }
  1099. }
  1100. if ( !count ) {
  1101. deferred.resolveWith( deferred, args );
  1102. }
  1103. } else if ( deferred !== firstParam ) {
  1104. deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
  1105. }
  1106. return promise;
  1107. }
  1108. });
  1109. jQuery.support = (function() {
  1110. var support,
  1111. all,
  1112. a,
  1113. select,
  1114. opt,
  1115. input,
  1116. marginDiv,
  1117. fragment,
  1118. tds,
  1119. events,
  1120. eventName,
  1121. i,
  1122. isSupported,
  1123. div = document.createElement( "div" ),
  1124. documentElement = document.documentElement;
  1125. // Preliminary tests
  1126. div.setAttribute("className", "t");
  1127. div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
  1128. all = div.getElementsByTagName( "*" );
  1129. a = div.getElementsByTagName( "a" )[ 0 ];
  1130. // Can't get basic test support
  1131. if ( !all || !all.length || !a ) {
  1132. return {};
  1133. }
  1134. // First batch of supports tests
  1135. select = document.createElement( "select" );
  1136. opt = select.appendChild( document.createElement("option") );
  1137. input = div.getElementsByTagName( "input" )[ 0 ];
  1138. support = {
  1139. // IE strips leading whitespace when .innerHTML is used
  1140. leadingWhitespace: ( div.firstChild.nodeType === 3 ),
  1141. // Make sure that tbody elements aren't automatically inserted
  1142. // IE will insert them into empty tables
  1143. tbody: !div.getElementsByTagName("tbody").length,
  1144. // Make sure that link elements get serialized correctly by innerHTML
  1145. // This requires a wrapper element in IE
  1146. htmlSerialize: !!div.getElementsByTagName("link").length,
  1147. // Get the style information from getAttribute
  1148. // (IE uses .cssText instead)
  1149. style: /top/.test( a.getAttribute("style") ),
  1150. // Make sure that URLs aren't manipulated
  1151. // (IE normalizes it by default)
  1152. hrefNormalized: ( a.getAttribute("href") === "/a" ),
  1153. // Make sure that element opacity exists
  1154. // (IE uses filter instead)
  1155. // Use a regex to work around a WebKit issue. See #5145
  1156. opacity: /^0.55/.test( a.style.opacity ),
  1157. // Verify style float existence
  1158. // (IE uses styleFloat instead of cssFloat)
  1159. cssFloat: !!a.style.cssFloat,
  1160. // Make sure that if no value is specified for a checkbox
  1161. // that it defaults to "on".
  1162. // (WebKit defaults to "" instead)
  1163. checkOn: ( input.value === "on" ),
  1164. // Make sure that a selected-by-default option has a working selected property.
  1165. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
  1166. optSelected: opt.selected,
  1167. // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
  1168. getSetAttribute: div.className !== "t",
  1169. // Tests for enctype support on a form(#6743)
  1170. enctype: !!document.createElement("form").enctype,
  1171. // Makes sure cloning an html5 element does not cause problems
  1172. // Where outerHTML is undefined, this still works
  1173. html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
  1174. // Will be defined later
  1175. submitBubbles: true,
  1176. changeBubbles: true,
  1177. focusinBubbles: false,
  1178. deleteExpando: true,
  1179. noCloneEvent: true,
  1180. inlineBlockNeedsLayout: false,
  1181. shrinkWrapBlocks: false,
  1182. reliableMarginRight: true
  1183. };
  1184. // Make sure checked status is properly cloned
  1185. input.checked = true;
  1186. support.noCloneChecked = input.cloneNode( true ).checked;
  1187. // Make sure that the options inside disabled selects aren't marked as disabled
  1188. // (WebKit marks them as disabled)
  1189. select.disabled = true;
  1190. support.optDisabled = !opt.disabled;
  1191. // Test to see if it's possible to delete an expando from an element
  1192. // Fails in Internet Explorer
  1193. try {
  1194. delete div.test;
  1195. } catch( e ) {
  1196. support.deleteExpando = false;
  1197. }
  1198. if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
  1199. div.attachEvent( "onclick", function() {
  1200. // Cloning a node shouldn't copy over any
  1201. // bound event handlers (IE does this)
  1202. support.noCloneEvent = false;
  1203. });
  1204. div.cloneNode( true ).fireEvent( "onclick" );
  1205. }
  1206. // Check if a radio maintains its value
  1207. // after being appended to the DOM
  1208. input = document.createElement("input");
  1209. input.value = "t";
  1210. input.setAttribute("type", "radio");
  1211. support.radioValue = input.value === "t";
  1212. input.setAttribute("checked", "checked");
  1213. div.appendChild( input );
  1214. fragment = document.createDocumentFragment();
  1215. fragment.appendChild( div.lastChild );
  1216. // WebKit doesn't clone checked state correctly in fragments
  1217. support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
  1218. // Check if a disconnected checkbox will retain its checked
  1219. // value of true after appended to the DOM (IE6/7)
  1220. support.appendChecked = input.checked;
  1221. fragment.removeChild( input );
  1222. fragment.appendChild( div );
  1223. div.innerHTML = "";
  1224. // Check if div with explicit width and no margin-right incorrectly
  1225. // gets computed margin-right based on width of container. For more
  1226. // info see bug #3333
  1227. // Fails in WebKit before Feb 2011 nightlies
  1228. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  1229. if ( window.getComputedStyle ) {
  1230. marginDiv = document.createElement( "div" );
  1231. marginDiv.style.width = "0";
  1232. marginDiv.style.marginRight = "0";
  1233. div.style.width = "2px";
  1234. div.appendChild( marginDiv );
  1235. support.reliableMarginRight =
  1236. ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
  1237. }
  1238. // Technique from Juriy Zaytsev
  1239. // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
  1240. // We only care about the case where non-standard event systems
  1241. // are used, namely in IE. Short-circuiting here helps us to
  1242. // avoid an eval call (in setAttribute) which can cause CSP
  1243. // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
  1244. if ( div.attachEvent ) {
  1245. for( i in {
  1246. submit: 1,
  1247. change: 1,
  1248. focusin: 1
  1249. }) {
  1250. eventName = "on" + i;
  1251. isSupported = ( eventName in div );
  1252. if ( !isSupported ) {
  1253. div.setAttribute( eventName, "return;" );
  1254. isSupported = ( typeof div[ eventName ] === "function" );
  1255. }
  1256. support[ i + "Bubbles" ] = isSupported;
  1257. }
  1258. }
  1259. fragment.removeChild( div );
  1260. // Null elements to avoid leaks in IE
  1261. fragment = select = opt = marginDiv = div = input = null;
  1262. // Run tests that need a body at doc ready
  1263. jQuery(function() {
  1264. var container, outer, inner, table, td, offsetSupport,
  1265. conMarginTop, ptlm, vb, style, html,
  1266. body = document.getElementsByTagName("body")[0];
  1267. if ( !body ) {
  1268. // Return for frameset docs that don't have a body
  1269. return;
  1270. }
  1271. conMarginTop = 1;
  1272. ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";
  1273. vb = "visibility:hidden;border:0;";
  1274. style = "style='" + ptlm + "border:5px solid #000;padding:0;'";
  1275. html = "<div " + style + "><div></div></div>" +
  1276. "<table " + style + " cellpadding='0' cellspacing='0'>" +
  1277. "<tr><td></td></tr></table>";
  1278. container = document.createElement("div");
  1279. container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
  1280. body.insertBefore( container, body.firstChild );
  1281. // Construct the test element
  1282. div = document.createElement("div");
  1283. container.appendChild( div );
  1284. // Check if table cells still have offsetWidth/Height when they are set
  1285. // to display:none and there are still other visible table cells in a
  1286. // table row; if so, offsetWidth/Height are not reliable for use when
  1287. // determining if an element has been hidden directly using
  1288. // display:none (it is still safe to use offsets if a parent element is
  1289. // hidden; don safety goggles and see bug #4512 for more information).
  1290. // (only IE 8 fails this test)
  1291. div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
  1292. tds = div.getElementsByTagName( "td" );
  1293. isSupported = ( tds[ 0 ].offsetHeight === 0 );
  1294. tds[ 0 ].style.display = "";
  1295. tds[ 1 ].style.display = "none";
  1296. // Check if empty table cells still have offsetWidth/Height
  1297. // (IE <= 8 fail this test)
  1298. support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
  1299. // Figure out if the W3C box model works as expected
  1300. div.innerHTML = "";
  1301. div.style.width = div.style.paddingLeft = "1px";
  1302. jQuery.boxModel = support.boxModel = div.offsetWidth === 2;
  1303. if ( typeof div.style.zoom !== "undefined" ) {
  1304. // Check if natively block-level elements act like inline-block
  1305. // elements when setting their display to 'inline' and giving
  1306. // them layout
  1307. // (IE < 8 does this)
  1308. div.style.display = "inline";
  1309. div.style.zoom = 1;
  1310. support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
  1311. // Check if elements with layout shrink-wrap their children
  1312. // (IE 6 does this)
  1313. div.style.display = "";
  1314. div.innerHTML = "<div style='width:4px;'></div>";
  1315. support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
  1316. }
  1317. div.style.cssText = ptlm + vb;
  1318. div.innerHTML = html;
  1319. outer = div.firstChild;
  1320. inner = outer.firstChild;
  1321. td = outer.nextSibling.firstChild.firstChild;
  1322. offsetSupport = {
  1323. doesNotAddBorder: ( inner.offsetTop !== 5 ),
  1324. doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
  1325. };
  1326. inner.style.position = "fixed";
  1327. inner.style.top = "20px";
  1328. // safari subtracts parent border width here which is 5px
  1329. offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
  1330. inner.style.position = inner.style.top = "";
  1331. outer.style.overflow = "hidden";
  1332. outer.style.position = "relative";
  1333. offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
  1334. offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
  1335. body.removeChild( container );
  1336. div = container = null;
  1337. jQuery.extend( support, offsetSupport );
  1338. });
  1339. return support;
  1340. })();
  1341. var rbrace = /^(?:\{.*\}|\[.*\])$/,
  1342. rmultiDash = /([A-Z])/g;
  1343. jQuery.extend({
  1344. cache: {},
  1345. // Please use with caution
  1346. uuid: 0,
  1347. // Unique for each copy of jQuery on the page
  1348. // Non-digits removed to match rinlinejQuery
  1349. expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
  1350. // The following elements throw uncatchable exceptions if you
  1351. // attempt to add expando properties to them.
  1352. noData: {
  1353. "embed": true,
  1354. // Ban all objects except for Flash (which handle expandos)
  1355. "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
  1356. "applet": true
  1357. },
  1358. hasData: function( elem ) {
  1359. elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
  1360. return !!elem && !isEmptyDataObject( elem );
  1361. },
  1362. data: function( elem, name, data, pvt /* Internal Use Only */ ) {
  1363. if ( !jQuery.acceptData( elem ) ) {
  1364. return;
  1365. }
  1366. var privateCache, thisCache, ret,
  1367. internalKey = jQuery.expando,
  1368. getByName = typeof name === "string",
  1369. // We have to handle DOM nodes and JS objects differently because IE6-7
  1370. // can't GC object references properly across the DOM-JS boundary
  1371. isNode = elem.nodeType,
  1372. // Only DOM nodes need the global jQuery cache; JS object data is
  1373. // attached directly to the object so GC can occur automatically
  1374. cache = isNode ? jQuery.cache : elem,
  1375. // Only defining an ID for JS objects if its cache already exists allows
  1376. // the code to shortcut on the same path as a DOM node with no cache
  1377. id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
  1378. isEvents = name === "events";
  1379. // Avoid doing any more work than we need to when trying to get data on an
  1380. // object that has no data at all
  1381. if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
  1382. return;
  1383. }
  1384. if ( !id ) {
  1385. // Only DOM nodes need a new unique ID for each element since their data
  1386. // ends up in the global cache
  1387. if ( isNode ) {
  1388. elem[ internalKey ] = id = ++jQuery.uuid;
  1389. } else {
  1390. id = internalKey;
  1391. }
  1392. }
  1393. if ( !cache[ id ] ) {
  1394. cache[ id ] = {};
  1395. // Avoids exposing jQuery metadata on plain JS objects when the object
  1396. // is serialized using JSON.stringify
  1397. if ( !isNode ) {
  1398. cache[ id ].toJSON = jQuery.noop;
  1399. }
  1400. }
  1401. // An object can be passed to jQuery.data instead of a key/value pair; this gets
  1402. // shallow copied over onto the existing cache
  1403. if ( typeof name === "object" || typeof name === "function" ) {
  1404. if ( pvt ) {
  1405. cache[ id ] = jQuery.extend( cache[ id ], name );
  1406. } else {
  1407. cache[ id ].data = jQuery.extend( cache[ id ].data, name );
  1408. }
  1409. }
  1410. privateCache = thisCache = cache[ id ];
  1411. // jQuery data() is stored in a separate object inside the object's internal data
  1412. // cache in order to avoid key collisions between internal data and user-defined
  1413. // data.
  1414. if ( !pvt ) {
  1415. if ( !thisCache.data ) {
  1416. thisCache.data = {};
  1417. }
  1418. thisCache = thisCache.data;
  1419. }
  1420. if ( data !== undefined ) {
  1421. thisCache[ jQuery.camelCase( name ) ] = data;
  1422. }
  1423. // Users should not attempt to inspect the internal events object using jQuery.data,
  1424. // it is undocumented and subject to change. But does anyone listen? No.
  1425. if ( isEvents && !thisCache[ name ] ) {
  1426. return privateCache.events;
  1427. }
  1428. // Check for both converted-to-camel and non-converted data property names
  1429. // If a data property was specified
  1430. if ( getByName ) {
  1431. // First Try to find as-is property data
  1432. ret = thisCache[ name ];
  1433. // Test for null|undefined property data
  1434. if ( ret == null ) {
  1435. // Try to find the camelCased property
  1436. ret = thisCache[ jQuery.camelCase( name ) ];
  1437. }
  1438. } else {
  1439. ret = thisCache;
  1440. }
  1441. return ret;
  1442. },
  1443. removeData: function( elem, name, pvt /* Internal Use Only */ ) {
  1444. if ( !jQuery.acceptData( elem ) ) {
  1445. return;
  1446. }
  1447. var thisCache, i, l,
  1448. // Reference to internal data cache key
  1449. internalKey = jQuery.expando,
  1450. isNode = elem.nodeType,
  1451. // See jQuery.data for more information
  1452. cache = isNode ? jQuery.cache : elem,
  1453. // See jQuery.data for more information
  1454. id = isNode ? elem[ internalKey ] : internalKey;
  1455. // If there is already no cache entry for this object, there is no
  1456. // purpose in continuing
  1457. if ( !cache[ id ] ) {
  1458. return;
  1459. }
  1460. if ( name ) {
  1461. thisCache = pvt ? cache[ id ] : cache[ id ].data;
  1462. if ( thisCache ) {
  1463. // Support array or space separated string names for data keys
  1464. if ( !jQuery.isArray( name ) ) {
  1465. // try the string as a key before any manipulation
  1466. if ( name in thisCache ) {
  1467. name = [ name ];
  1468. } else {
  1469. // split the camel cased version by spaces unless a key with the spaces exists
  1470. name = jQuery.camelCase( name );
  1471. if ( name in thisCache ) {
  1472. name = [ name ];
  1473. } else {
  1474. name = name.split( " " );
  1475. }
  1476. }
  1477. }
  1478. for ( i = 0, l = name.length; i < l; i++ ) {
  1479. delete thisCache[ name[i] ];
  1480. }
  1481. // If there is no data left in the cache, we want to continue
  1482. // and let the cache object itself get destroyed
  1483. if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
  1484. return;
  1485. }
  1486. }
  1487. }
  1488. // See jQuery.data for more information
  1489. if ( !pvt ) {
  1490. delete cache[ id ].data;
  1491. // Don't destroy the parent cache unless the internal data object
  1492. // had been the only thing left in it
  1493. if ( !isEmptyDataObject(cache[ id ]) ) {
  1494. return;
  1495. }
  1496. }
  1497. // Browsers that fail expando deletion also refuse to delete expandos on
  1498. // the window, but it will allow it on all other JS objects; other browsers
  1499. // don't care
  1500. // Ensure that `cache` is not a window object #10080
  1501. if ( jQuery.support.deleteExpando || !cache.setInterval ) {
  1502. delete cache[ id ];
  1503. } else {
  1504. cache[ id ] = null;
  1505. }
  1506. // We destroyed the cache and need to eliminate the expando on the node to avoid
  1507. // false lookups in the cache for entries that no longer exist
  1508. if ( isNode ) {
  1509. // IE does not allow us to delete expando properties from nodes,
  1510. // nor does it have a removeAttribute function on Document nodes;
  1511. // we must handle all of these cases
  1512. if ( jQuery.support.deleteExpando ) {
  1513. delete elem[ internalKey ];
  1514. } else if ( elem.removeAttribute ) {
  1515. elem.removeAttribute( internalKey );
  1516. } else {
  1517. elem[ internalKey ] = null;
  1518. }
  1519. }
  1520. },
  1521. // For internal use only.
  1522. _data: function( elem, name, data ) {
  1523. return jQuery.data( elem, name, data, true );
  1524. },
  1525. // A method for determining if a DOM node can handle the data expando
  1526. acceptData: function( elem ) {
  1527. if ( elem.nodeName ) {
  1528. var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
  1529. if ( match ) {
  1530. return !(match === true || elem.getAttribute("classid") !== match);
  1531. }
  1532. }
  1533. return true;
  1534. }
  1535. });
  1536. jQuery.fn.extend({
  1537. data: function( key, value ) {
  1538. var parts, attr, name,
  1539. data = null;
  1540. if ( typeof key === "undefined" ) {
  1541. if ( this.length ) {
  1542. data = jQuery.data( this[0] );
  1543. if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) {
  1544. attr = this[0].attributes;
  1545. for ( var i = 0, l = attr.length; i < l; i++ ) {
  1546. name = attr[i].name;
  1547. if ( name.indexOf( "data-" ) === 0 ) {
  1548. name = jQuery.camelCase( name.substring(5) );
  1549. dataAttr( this[0], name, data[ name ] );
  1550. }
  1551. }
  1552. jQuery._data( this[0], "parsedAttrs", true );
  1553. }
  1554. }
  1555. return data;
  1556. } else if ( typeof key === "object" ) {
  1557. return this.each(function() {
  1558. jQuery.data( this, key );
  1559. });
  1560. }
  1561. parts = key.split(".");
  1562. parts[1] = parts[1] ? "." + parts[1] : "";
  1563. if ( value === undefined ) {
  1564. data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
  1565. // Try to fetch any internally stored data first
  1566. if ( data === undefined && this.length ) {
  1567. data = jQuery.data( this[0], key );
  1568. data = dataAttr( this[0], key, data );
  1569. }
  1570. return data === undefined && parts[1] ?
  1571. this.data( parts[0] ) :
  1572. data;
  1573. } else {
  1574. return this.each(function() {
  1575. var self = jQuery( this ),
  1576. args = [ parts[0], value ];
  1577. self.triggerHandler( "setData" + parts[1] + "!", args );
  1578. jQuery.data( this, key, value );
  1579. self.triggerHandler( "changeData" + parts[1] + "!", args );
  1580. });
  1581. }
  1582. },
  1583. removeData: function( key ) {
  1584. return this.each(function() {
  1585. jQuery.removeData( this, key );
  1586. });
  1587. }
  1588. });
  1589. function dataAttr( elem, key, data ) {
  1590. // If nothing was found internally, try to fetch any
  1591. // data from the HTML5 data-* attribute
  1592. if ( data === undefined && elem.nodeType === 1 ) {
  1593. var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
  1594. data = elem.getAttribute( name );
  1595. if ( typeof data === "string" ) {
  1596. try {
  1597. data = data === "true" ? true :
  1598. data === "false" ? false :
  1599. data === "null" ? null :
  1600. jQuery.isNumeric( data ) ? parseFloat( data ) :
  1601. rbrace.test( data ) ? jQuery.parseJSON( data ) :
  1602. data;
  1603. } catch( e ) {}
  1604. // Make sure we set the data so it isn't changed later
  1605. jQuery.data( elem, key, data );
  1606. } else {
  1607. data = undefined;
  1608. }
  1609. }
  1610. return data;
  1611. }
  1612. // checks a cache object for emptiness
  1613. function isEmptyDataObject( obj ) {
  1614. for ( var name in obj ) {
  1615. // if the public data object is empty, the private is still empty
  1616. if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
  1617. continue;
  1618. }
  1619. if ( name !== "toJSON" ) {
  1620. return false;
  1621. }
  1622. }
  1623. return true;
  1624. }
  1625. function handleQueueMarkDefer( elem, type, src ) {
  1626. var deferDataKey = type + "defer",
  1627. queueDataKey = type + "queue",
  1628. markDataKey = type + "mark",
  1629. defer = jQuery._data( elem, deferDataKey );
  1630. if ( defer &&
  1631. ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
  1632. ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
  1633. // Give room for hard-coded callbacks to fire first
  1634. // and eventually mark/queue something else on the element
  1635. setTimeout( function() {
  1636. if ( !jQuery._data( elem, queueDataKey ) &&
  1637. !jQuery._data( elem, markDataKey ) ) {
  1638. jQuery.removeData( elem, deferDataKey, true );
  1639. defer.fire();
  1640. }
  1641. }, 0 );
  1642. }
  1643. }
  1644. jQuery.extend({
  1645. _mark: function( elem, type ) {
  1646. if ( elem ) {
  1647. type = ( type || "fx" ) + "mark";
  1648. jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
  1649. }
  1650. },
  1651. _unmark: function( force, elem, type ) {
  1652. if ( force !== true ) {
  1653. type = elem;
  1654. elem = force;
  1655. force = false;
  1656. }
  1657. if ( elem ) {
  1658. type = type || "fx";
  1659. var key = type + "mark",
  1660. count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
  1661. if ( count ) {
  1662. jQuery._data( elem, key, count );
  1663. } else {
  1664. jQuery.removeData( elem, key, true );
  1665. handleQueueMarkDefer( elem, type, "mark" );
  1666. }
  1667. }
  1668. },
  1669. queue: function( elem, type, data ) {
  1670. var q;
  1671. if ( elem ) {
  1672. type = ( type || "fx" ) + "queue";
  1673. q = jQuery._data( elem, type );
  1674. // Speed up dequeue by getting out quickly if this is just a lookup
  1675. if ( data ) {
  1676. if ( !q || jQuery.isArray(data) ) {
  1677. q = jQuery._data( elem, type, jQuery.makeArray(data) );
  1678. } else {
  1679. q.push( data );
  1680. }
  1681. }
  1682. return q || [];
  1683. }
  1684. },
  1685. dequeue: function( elem, type ) {
  1686. type = type || "fx";
  1687. var queue = jQuery.queue( elem, type ),
  1688. fn = queue.shift(),
  1689. hooks = {};
  1690. // If the fx queue is dequeued, always remove the progress sentinel
  1691. if ( fn === "inprogress" ) {
  1692. fn = queue.shift();
  1693. }
  1694. if ( fn ) {
  1695. // Add a progress sentinel to prevent the fx queue from being
  1696. // automatically dequeued
  1697. if ( type === "fx" ) {
  1698. queue.unshift( "inprogress" );
  1699. }
  1700. jQuery._data( elem, type + ".run", hooks );
  1701. fn.call( elem, function() {
  1702. jQuery.dequeue( elem, type );
  1703. }, hooks );
  1704. }
  1705. if ( !queue.length ) {
  1706. jQuery.removeData( elem, type + "queue " + type + ".run", true );
  1707. handleQueueMarkDefer( elem, type, "queue" );
  1708. }
  1709. }
  1710. });
  1711. jQuery.fn.extend({
  1712. queue: function( type, data ) {
  1713. if ( typeof type !== "string" ) {
  1714. data = type;
  1715. type = "fx";
  1716. }
  1717. if ( data === undefined ) {
  1718. return jQuery.queue( this[0], type );
  1719. }
  1720. return this.each(function() {
  1721. var queue = jQuery.queue( this, type, data );
  1722. if ( type === "fx" && queue[0] !== "inprogress" ) {
  1723. jQuery.dequeue( this, type );
  1724. }
  1725. });
  1726. },
  1727. dequeue: function( type ) {
  1728. return this.each(function() {
  1729. jQuery.dequeue( this, type );
  1730. });
  1731. },
  1732. // Based off of the plugin by Clint Helfers, with permission.
  1733. // http://blindsignals.com/index.php/2009/07/jquery-delay/
  1734. delay: function( time, type ) {
  1735. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  1736. type = type || "fx";
  1737. return this.queue( type, function( next, hooks ) {
  1738. var timeout = setTimeout( next, time );
  1739. hooks.stop = function() {
  1740. clearTimeout( timeout );
  1741. };
  1742. });
  1743. },
  1744. clearQueue: function( type ) {
  1745. return this.queue( type || "fx", [] );
  1746. },
  1747. // Get a promise resolved when queues of a certain type
  1748. // are emptied (fx is the type by default)
  1749. promise: function( type, object ) {
  1750. if ( typeof type !== "string" ) {
  1751. object = type;
  1752. type = undefined;
  1753. }
  1754. type = type || "fx";
  1755. var defer = jQuery.Deferred(),
  1756. elements = this,
  1757. i = elements.length,
  1758. count = 1,
  1759. deferDataKey = type + "defer",
  1760. queueDataKey = type + "queue",
  1761. markDataKey = type + "mark",
  1762. tmp;
  1763. function resolve() {
  1764. if ( !( --count ) ) {
  1765. defer.resolveWith( elements, [ elements ] );
  1766. }
  1767. }
  1768. while( i-- ) {
  1769. if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
  1770. ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
  1771. jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
  1772. jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
  1773. count++;
  1774. tmp.add( resolve );
  1775. }
  1776. }
  1777. resolve();
  1778. return defer.promise();
  1779. }
  1780. });
  1781. var rclass = /[\n\t\r]/g,
  1782. rspace = /\s+/,
  1783. rreturn = /\r/g,
  1784. rtype = /^(?:button|input)$/i,
  1785. rfocusable = /^(?:button|input|object|select|textarea)$/i,
  1786. rclickable = /^a(?:rea)?$/i,
  1787. rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
  1788. getSetAttribute = jQuery.support.getSetAttribute,
  1789. nodeHook, boolHook, fixSpecified;
  1790. jQuery.fn.extend({
  1791. attr: function( name, value ) {
  1792. return jQuery.access( this, name, value, true, jQuery.attr );
  1793. },
  1794. removeAttr: function( name ) {
  1795. return this.each(function() {
  1796. jQuery.removeAttr( this, name );
  1797. });
  1798. },
  1799. prop: function( name, value ) {
  1800. return jQuery.access( this, name, value, true, jQuery.prop );
  1801. },
  1802. removeProp: function( name ) {
  1803. name = jQuery.propFix[ name ] || name;
  1804. return this.each(function() {
  1805. // try/catch handles cases where IE balks (such as removing a property on window)
  1806. try {
  1807. this[ name ] = undefined;
  1808. delete this[ name ];
  1809. } catch( e ) {}
  1810. });
  1811. },
  1812. addClass: function( value ) {
  1813. var classNames, i, l, elem,
  1814. setClass, c, cl;
  1815. if ( jQuery.isFunction( value ) ) {
  1816. return this.each(function( j ) {
  1817. jQuery( this ).addClass( value.call(this, j, this.className) );
  1818. });
  1819. }
  1820. if ( value && typeof value === "string" ) {
  1821. classNames = value.split( rspace );
  1822. for ( i = 0, l = this.length; i < l; i++ ) {
  1823. elem = this[ i ];
  1824. if ( elem.nodeType === 1 ) {
  1825. if ( !elem.className && classNames.length === 1 ) {
  1826. elem.className = value;
  1827. } else {
  1828. setClass = " " + elem.className + " ";
  1829. for ( c = 0, cl = classNames.length; c < cl; c++ ) {
  1830. if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
  1831. setClass += classNames[ c ] + " ";
  1832. }
  1833. }
  1834. elem.className = jQuery.trim( setClass );
  1835. }
  1836. }
  1837. }
  1838. }
  1839. return this;
  1840. },
  1841. removeClass: function( value ) {
  1842. var classNames, i, l, elem, className, c, cl;
  1843. if ( jQuery.isFunction( value ) ) {
  1844. return this.each(function( j ) {
  1845. jQuery( this ).removeClass( value.call(this, j, this.className) );
  1846. });
  1847. }
  1848. if ( (value && typeof value === "string") || value === undefined ) {
  1849. classNames = ( value || "" ).split( rspace );
  1850. for ( i = 0, l = this.length; i < l; i++ ) {
  1851. elem = this[ i ];
  1852. if ( elem.nodeType === 1 && elem.className ) {
  1853. if ( value ) {
  1854. className = (" " + elem.className + " ").replace( rclass, " " );
  1855. for ( c = 0, cl = classNames.length; c < cl; c++ ) {
  1856. className = className.replace(" " + classNames[ c ] + " ", " ");
  1857. }
  1858. elem.className = jQuery.trim( className );
  1859. } else {
  1860. elem.className = "";
  1861. }
  1862. }
  1863. }
  1864. }
  1865. return this;
  1866. },
  1867. toggleClass: function( value, stateVal ) {
  1868. var type = typeof value,
  1869. isBool = typeof stateVal === "boolean";
  1870. if ( jQuery.isFunction( value ) ) {
  1871. return this.each(function( i ) {
  1872. jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
  1873. });
  1874. }
  1875. return this.each(function() {
  1876. if ( type === "string" ) {
  1877. // toggle individual class names
  1878. var className,
  1879. i = 0,
  1880. self = jQuery( this ),
  1881. state = stateVal,
  1882. classNames = value.split( rspace );
  1883. while ( (className = classNames[ i++ ]) ) {
  1884. // check each className given, space seperated list
  1885. state = isBool ? state : !self.hasClass( className );
  1886. self[ state ? "addClass" : "removeClass" ]( className );
  1887. }
  1888. } else if ( type === "undefined" || type === "boolean" ) {
  1889. if ( this.className ) {
  1890. // store className if set
  1891. jQuery._data( this, "__className__", this.className );
  1892. }
  1893. // toggle whole className
  1894. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
  1895. }
  1896. });
  1897. },
  1898. hasClass: function( selector ) {
  1899. var className = " " + selector + " ",
  1900. i = 0,
  1901. l = this.length;
  1902. for ( ; i < l; i++ ) {
  1903. if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
  1904. return true;
  1905. }
  1906. }
  1907. return false;
  1908. },
  1909. val: function( value ) {
  1910. var hooks, ret, isFunction,
  1911. elem = this[0];
  1912. if ( !arguments.length ) {
  1913. if ( elem ) {
  1914. hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
  1915. if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
  1916. return ret;
  1917. }
  1918. ret = elem.value;
  1919. return typeof ret === "string" ?
  1920. // handle most common string cases
  1921. ret.replace(rreturn, "") :
  1922. // handle cases where value is null/undef or number
  1923. ret == null ? "" : ret;
  1924. }
  1925. return;
  1926. }
  1927. isFunction = jQuery.isFunction( value );
  1928. return this.each(function( i ) {
  1929. var self = jQuery(this), val;
  1930. if ( this.nodeType !== 1 ) {
  1931. return;
  1932. }
  1933. if ( isFunction ) {
  1934. val = value.call( this, i, self.val() );
  1935. } else {
  1936. val = value;
  1937. }
  1938. // Treat null/undefined as ""; convert numbers to string
  1939. if ( val == null ) {
  1940. val = "";
  1941. } else if ( typeof val === "number" ) {
  1942. val += "";
  1943. } else if ( jQuery.isArray( val ) ) {
  1944. val = jQuery.map(val, function ( value ) {
  1945. return value == null ? "" : value + "";
  1946. });
  1947. }
  1948. hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
  1949. // If set returns undefined, fall back to normal setting
  1950. if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
  1951. this.value = val;
  1952. }
  1953. });
  1954. }
  1955. });
  1956. jQuery.extend({
  1957. valHooks: {
  1958. option: {
  1959. get: function( elem ) {
  1960. // attributes.value is undefined in Blackberry 4.7 but
  1961. // uses .value. See #6932
  1962. var val = elem.attributes.value;
  1963. return !val || val.specified ? elem.value : elem.text;
  1964. }
  1965. },
  1966. select: {
  1967. get: function( elem ) {
  1968. var value, i, max, option,
  1969. index = elem.selectedIndex,
  1970. values = [],
  1971. options = elem.options,
  1972. one = elem.type === "select-one";
  1973. // Nothing was selected
  1974. if ( index < 0 ) {
  1975. return null;
  1976. }
  1977. // Loop through all the selected options
  1978. i = one ? index : 0;
  1979. max = one ? index + 1 : options.length;
  1980. for ( ; i < max; i++ ) {
  1981. option = options[ i ];
  1982. // Don't return options that are disabled or in a disabled optgroup
  1983. if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
  1984. (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
  1985. // Get the specific value for the option
  1986. value = jQuery( option ).val();
  1987. // We don't need an array for one selects
  1988. if ( one ) {
  1989. return value;
  1990. }
  1991. // Multi-Selects return an array
  1992. values.push( value );
  1993. }
  1994. }
  1995. // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
  1996. if ( one && !values.length && options.length ) {
  1997. return jQuery( options[ index ] ).val();
  1998. }
  1999. return values;
  2000. },
  2001. set: function( elem, value ) {
  2002. var values = jQuery.makeArray( value );
  2003. jQuery(elem).find("option").each(function() {
  2004. this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
  2005. });
  2006. if ( !values.length ) {
  2007. elem.selectedIndex = -1;
  2008. }
  2009. return values;
  2010. }
  2011. }
  2012. },
  2013. attrFn: {
  2014. val: true,
  2015. css: true,
  2016. html: true,
  2017. text: true,
  2018. data: true,
  2019. width: true,
  2020. height: true,
  2021. offset: true
  2022. },
  2023. attr: function( elem, name, value, pass ) {
  2024. var ret, hooks, notxml,
  2025. nType = elem.nodeType;
  2026. // don't get/set attributes on text, comment and attribute nodes
  2027. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  2028. return;
  2029. }
  2030. if ( pass && name in jQuery.attrFn ) {
  2031. return jQuery( elem )[ name ]( value );
  2032. }
  2033. // Fallback to prop when attributes are not supported
  2034. if ( typeof elem.getAttribute === "undefined" ) {
  2035. return jQuery.prop( elem, name, value );
  2036. }
  2037. notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
  2038. // All attributes are lowercase
  2039. // Grab necessary hook if one is defined
  2040. if ( notxml ) {
  2041. name = name.toLowerCase();
  2042. hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
  2043. }
  2044. if ( value !== undefined ) {
  2045. if ( value === null ) {
  2046. jQuery.removeAttr( elem, name );
  2047. return;
  2048. } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
  2049. return ret;
  2050. } else {
  2051. elem.setAttribute( name, "" + value );
  2052. return value;
  2053. }
  2054. } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
  2055. return ret;
  2056. } else {
  2057. ret = elem.getAttribute( name );
  2058. // Non-existent attributes return null, we normalize to undefined
  2059. return ret === null ?
  2060. undefined :
  2061. ret;
  2062. }
  2063. },
  2064. removeAttr: function( elem, value ) {
  2065. var propName, attrNames, name, l,
  2066. i = 0;
  2067. if ( value && elem.nodeType === 1 ) {
  2068. attrNames = value.toLowerCase().split( rspace );
  2069. l = attrNames.length;
  2070. for ( ; i < l; i++ ) {
  2071. name = attrNames[ i ];
  2072. if ( name ) {
  2073. propName = jQuery.propFix[ name ] || name;
  2074. // See #9699 for explanation of this approach (setting first, then removal)
  2075. jQuery.attr( elem, name, "" );
  2076. elem.removeAttribute( getSetAttribute ? name : propName );
  2077. // Set corresponding property to false for boolean attributes
  2078. if ( rboolean.test( name ) && propName in elem ) {
  2079. elem[ propName ] = false;
  2080. }
  2081. }
  2082. }
  2083. }
  2084. },
  2085. attrHooks: {
  2086. type: {
  2087. set: function( elem, value ) {
  2088. // We can't allow the type property to be changed (since it causes problems in IE)
  2089. if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
  2090. jQuery.error( "type property can't be changed" );
  2091. } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
  2092. // Setting the type on a radio button after the value resets the value in IE6-9
  2093. // Reset value to it's default in case type is set after value
  2094. // This is for element creation
  2095. var val = elem.value;
  2096. elem.setAttribute( "type", value );
  2097. if ( val ) {
  2098. elem.value = val;
  2099. }
  2100. return value;
  2101. }
  2102. }
  2103. },
  2104. // Use the value property for back compat
  2105. // Use the nodeHook for button elements in IE6/7 (#1954)
  2106. value: {
  2107. get: function( elem, name ) {
  2108. if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
  2109. return nodeHook.get( elem, name );
  2110. }
  2111. return name in elem ?
  2112. elem.value :
  2113. null;
  2114. },
  2115. set: function( elem, value, name ) {
  2116. if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
  2117. return nodeHook.set( elem, value, name );
  2118. }
  2119. // Does not return so that setAttribute is also used
  2120. elem.value = value;
  2121. }
  2122. }
  2123. },
  2124. propFix: {
  2125. tabindex: "tabIndex",
  2126. readonly: "readOnly",
  2127. "for": "htmlFor",
  2128. "class": "className",
  2129. maxlength: "maxLength",
  2130. cellspacing: "cellSpacing",
  2131. cellpadding: "cellPadding",
  2132. rowspan: "rowSpan",
  2133. colspan: "colSpan",
  2134. usemap: "useMap",
  2135. frameborder: "frameBorder",
  2136. contenteditable: "contentEditable"
  2137. },
  2138. prop: function( elem, name, value ) {
  2139. var ret, hooks, notxml,
  2140. nType = elem.nodeType;
  2141. // don't get/set properties on text, comment and attribute nodes
  2142. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  2143. return;
  2144. }
  2145. notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
  2146. if ( notxml ) {
  2147. // Fix name and attach hooks
  2148. name = jQuery.propFix[ name ] || name;
  2149. hooks = jQuery.propHooks[ name ];
  2150. }
  2151. if ( value !== undefined ) {
  2152. if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
  2153. return ret;
  2154. } else {
  2155. return ( elem[ name ] = value );
  2156. }
  2157. } else {
  2158. if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
  2159. return ret;
  2160. } else {
  2161. return elem[ name ];
  2162. }
  2163. }
  2164. },
  2165. propHooks: {
  2166. tabIndex: {
  2167. get: function( elem ) {
  2168. // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
  2169. // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  2170. var attributeNode = elem.getAttributeNode("tabindex");
  2171. return attributeNode && attributeNode.specified ?
  2172. parseInt( attributeNode.value, 10 ) :
  2173. rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
  2174. 0 :
  2175. undefined;
  2176. }
  2177. }
  2178. }
  2179. });
  2180. // Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
  2181. jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
  2182. // Hook for boolean attributes
  2183. boolHook = {
  2184. get: function( elem, name ) {
  2185. // Align boolean attributes with corresponding properties
  2186. // Fall back to attribute presence where some booleans are not supported
  2187. var attrNode,
  2188. property = jQuery.prop( elem, name );
  2189. return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
  2190. name.toLowerCase() :
  2191. undefined;
  2192. },
  2193. set: function( elem, value, name ) {
  2194. var propName;
  2195. if ( value === false ) {
  2196. // Remove boolean attributes when set to false
  2197. jQuery.removeAttr( elem, name );
  2198. } else {
  2199. // value is true since we know at this point it's type boolean and not false
  2200. // Set boolean attributes to the same name and set the DOM property
  2201. propName = jQuery.propFix[ name ] || name;
  2202. if ( propName in elem ) {
  2203. // Only set the IDL specifically if it already exists on the element
  2204. elem[ propName ] = true;
  2205. }
  2206. elem.setAttribute( name, name.toLowerCase() );
  2207. }
  2208. return name;
  2209. }
  2210. };
  2211. // IE6/7 do not support getting/setting some attributes with get/setAttribute
  2212. if ( !getSetAttribute ) {
  2213. fixSpecified = {
  2214. name: true,
  2215. id: true
  2216. };
  2217. // Use this for any attribute in IE6/7
  2218. // This fixes almost every IE6/7 issue
  2219. nodeHook = jQuery.valHooks.button = {
  2220. get: function( elem, name ) {
  2221. var ret;
  2222. ret = elem.getAttributeNode( name );
  2223. return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
  2224. ret.nodeValue :
  2225. undefined;
  2226. },
  2227. set: function( elem, value, name ) {
  2228. // Set the existing or create a new attribute node
  2229. var ret = elem.getAttributeNode( name );
  2230. if ( !ret ) {
  2231. ret = document.createAttribute( name );
  2232. elem.setAttributeNode( ret );
  2233. }
  2234. return ( ret.nodeValue = value + "" );
  2235. }
  2236. };
  2237. // Apply the nodeHook to tabindex
  2238. jQuery.attrHooks.tabindex.set = nodeHook.set;
  2239. // Set width and height to auto instead of 0 on empty string( Bug #8150 )
  2240. // This is for removals
  2241. jQuery.each([ "width", "height" ], function( i, name ) {
  2242. jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
  2243. set: function( elem, value ) {
  2244. if ( value === "" ) {
  2245. elem.setAttribute( name, "auto" );
  2246. return value;
  2247. }
  2248. }
  2249. });
  2250. });
  2251. // Set contenteditable to false on removals(#10429)
  2252. // Setting to empty string throws an error as an invalid value
  2253. jQuery.attrHooks.contenteditable = {
  2254. get: nodeHook.get,
  2255. set: function( elem, value, name ) {
  2256. if ( value === "" ) {
  2257. value = "false";
  2258. }
  2259. nodeHook.set( elem, value, name );
  2260. }
  2261. };
  2262. }
  2263. // Some attributes require a special call on IE
  2264. if ( !jQuery.support.hrefNormalized ) {
  2265. jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
  2266. jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
  2267. get: function( elem ) {
  2268. var ret = elem.getAttribute( name, 2 );
  2269. return ret === null ? undefined : ret;
  2270. }
  2271. });
  2272. });
  2273. }
  2274. if ( !jQuery.support.style ) {
  2275. jQuery.attrHooks.style = {
  2276. get: function( elem ) {
  2277. // Return undefined in the case of empty string
  2278. // Normalize to lowercase since IE uppercases css property names
  2279. return elem.style.cssText.toLowerCase() || undefined;
  2280. },
  2281. set: function( elem, value ) {
  2282. return ( elem.style.cssText = "" + value );
  2283. }
  2284. };
  2285. }
  2286. // Safari mis-reports the default selected property of an option
  2287. // Accessing the parent's selectedIndex property fixes it
  2288. if ( !jQuery.support.optSelected ) {
  2289. jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
  2290. get: function( elem ) {
  2291. var parent = elem.parentNode;
  2292. if ( parent ) {
  2293. parent.selectedIndex;
  2294. // Make sure that it also works with optgroups, see #5701
  2295. if ( parent.parentNode ) {
  2296. parent.parentNode.selectedIndex;
  2297. }
  2298. }
  2299. return null;
  2300. }
  2301. });
  2302. }
  2303. // IE6/7 call enctype encoding
  2304. if ( !jQuery.support.enctype ) {
  2305. jQuery.propFix.enctype = "encoding";
  2306. }
  2307. // Radios and checkboxes getter/setter
  2308. if ( !jQuery.support.checkOn ) {
  2309. jQuery.each([ "radio", "checkbox" ], function() {
  2310. jQuery.valHooks[ this ] = {
  2311. get: function( elem ) {
  2312. // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
  2313. return elem.getAttribute("value") === null ? "on" : elem.value;
  2314. }
  2315. };
  2316. });
  2317. }
  2318. jQuery.each([ "radio", "checkbox" ], function() {
  2319. jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
  2320. set: function( elem, value ) {
  2321. if ( jQuery.isArray( value ) ) {
  2322. return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
  2323. }
  2324. }
  2325. });
  2326. });
  2327. var rformElems = /^(?:textarea|input|select)$/i,
  2328. rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
  2329. rhoverHack = /\bhover(\.\S+)?\b/,
  2330. rkeyEvent = /^key/,
  2331. rmouseEvent = /^(?:mouse|contextmenu)|click/,
  2332. rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  2333. rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
  2334. quickParse = function( selector ) {
  2335. var quick = rquickIs.exec( selector );
  2336. if ( quick ) {
  2337. // 0 1 2 3
  2338. // [ _, tag, id, class ]
  2339. quick[1] = ( quick[1] || "" ).toLowerCase();
  2340. quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
  2341. }
  2342. return quick;
  2343. },
  2344. quickIs = function( elem, m ) {
  2345. var attrs = elem.attributes || {};
  2346. return (
  2347. (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
  2348. (!m[2] || (attrs.id || {}).value === m[2]) &&
  2349. (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
  2350. );
  2351. },
  2352. hoverHack = function( events ) {
  2353. return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
  2354. };
  2355. /*
  2356. * Helper functions for managing events -- not part of the public interface.
  2357. * Props to Dean Edwards' addEvent library for many of the ideas.
  2358. */
  2359. jQuery.event = {
  2360. add: function( elem, types, handler, data, selector ) {
  2361. var elemData, eventHandle, events,
  2362. t, tns, type, namespaces, handleObj,
  2363. handleObjIn, quick, handlers, special;
  2364. // Don't attach events to noData or text/comment nodes (allow plain objects tho)
  2365. if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
  2366. return;
  2367. }
  2368. // Caller can pass in an object of custom data in lieu of the handler
  2369. if ( handler.handler ) {
  2370. handleObjIn = handler;
  2371. handler = handleObjIn.handler;
  2372. }
  2373. // Make sure that the handler has a unique ID, used to find/remove it later
  2374. if ( !handler.guid ) {
  2375. handler.guid = jQuery.guid++;
  2376. }
  2377. // Init the element's event structure and main handler, if this is the first
  2378. events = elemData.events;
  2379. if ( !events ) {
  2380. elemData.events = events = {};
  2381. }
  2382. eventHandle = elemData.handle;
  2383. if ( !eventHandle ) {
  2384. elemData.handle = eventHandle = function( e ) {
  2385. // Discard the second event of a jQuery.event.trigger() and
  2386. // when an event is called after a page has unloaded
  2387. return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
  2388. jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
  2389. undefined;
  2390. };
  2391. // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
  2392. eventHandle.elem = elem;
  2393. }
  2394. // Handle multiple events separated by a space
  2395. // jQuery(...).bind("mouseover mouseout", fn);
  2396. types = jQuery.trim( hoverHack(types) ).split( " " );
  2397. for ( t = 0; t < types.length; t++ ) {
  2398. tns = rtypenamespace.exec( types[t] ) || [];
  2399. type = tns[1];
  2400. namespaces = ( tns[2] || "" ).split( "." ).sort();
  2401. // If event changes its type, use the special event handlers for the changed type
  2402. special = jQuery.event.special[ type ] || {};
  2403. // If selector defined, determine special event api type, otherwise given type
  2404. type = ( selector ? special.delegateType : special.bindType ) || type;
  2405. // Update special based on newly reset type
  2406. special = jQuery.event.special[ type ] || {};
  2407. // handleObj is passed to all event handlers
  2408. handleObj = jQuery.extend({
  2409. type: type,
  2410. origType: tns[1],
  2411. data: data,
  2412. handler: handler,
  2413. guid: handler.guid,
  2414. selector: selector,
  2415. quick: quickParse( selector ),
  2416. namespace: namespaces.join(".")
  2417. }, handleObjIn );
  2418. // Init the event handler queue if we're the first
  2419. handlers = events[ type ];
  2420. if ( !handlers ) {
  2421. handlers = events[ type ] = [];
  2422. handlers.delegateCount = 0;
  2423. // Only use addEventListener/attachEvent if the special events handler returns false
  2424. if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  2425. // Bind the global event handler to the element
  2426. if ( elem.addEventListener ) {
  2427. elem.addEventListener( type, eventHandle, false );
  2428. } else if ( elem.attachEvent ) {
  2429. elem.attachEvent( "on" + type, eventHandle );
  2430. }
  2431. }
  2432. }
  2433. if ( special.add ) {
  2434. special.add.call( elem, handleObj );
  2435. if ( !handleObj.handler.guid ) {
  2436. handleObj.handler.guid = handler.guid;
  2437. }
  2438. }
  2439. // Add to the element's handler list, delegates in front
  2440. if ( selector ) {
  2441. handlers.splice( handlers.delegateCount++, 0, handleObj );
  2442. } else {
  2443. handlers.push( handleObj );
  2444. }
  2445. // Keep track of which events have ever been used, for event optimization
  2446. jQuery.event.global[ type ] = true;
  2447. }
  2448. // Nullify elem to prevent memory leaks in IE
  2449. elem = null;
  2450. },
  2451. global: {},
  2452. // Detach an event or set of events from an element
  2453. remove: function( elem, types, handler, selector, mappedTypes ) {
  2454. var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
  2455. t, tns, type, origType, namespaces, origCount,
  2456. j, events, special, handle, eventType, handleObj;
  2457. if ( !elemData || !(events = elemData.events) ) {
  2458. return;
  2459. }
  2460. // Once for each type.namespace in types; type may be omitted
  2461. types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
  2462. for ( t = 0; t < types.length; t++ ) {
  2463. tns = rtypenamespace.exec( types[t] ) || [];
  2464. type = origType = tns[1];
  2465. namespaces = tns[2];
  2466. // Unbind all events (on this namespace, if provided) for the element
  2467. if ( !type ) {
  2468. for ( type in events ) {
  2469. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  2470. }
  2471. continue;
  2472. }
  2473. special = jQuery.event.special[ type ] || {};
  2474. type = ( selector? special.delegateType : special.bindType ) || type;
  2475. eventType = events[ type ] || [];
  2476. origCount = eventType.length;
  2477. namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
  2478. // Remove matching events
  2479. for ( j = 0; j < eventType.length; j++ ) {
  2480. handleObj = eventType[ j ];
  2481. if ( ( mappedTypes || origType === handleObj.origType ) &&
  2482. ( !handler || handler.guid === handleObj.guid ) &&
  2483. ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
  2484. ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
  2485. eventType.splice( j--, 1 );
  2486. if ( handleObj.selector ) {
  2487. eventType.delegateCount--;
  2488. }
  2489. if ( special.remove ) {
  2490. special.remove.call( elem, handleObj );
  2491. }
  2492. }
  2493. }
  2494. // Remove generic event handler if we removed something and no more handlers exist
  2495. // (avoids potential for endless recursion during removal of special event handlers)
  2496. if ( eventType.length === 0 && origCount !== eventType.length ) {
  2497. if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
  2498. jQuery.removeEvent( elem, type, elemData.handle );
  2499. }
  2500. delete events[ type ];
  2501. }
  2502. }
  2503. // Remove the expando if it's no longer used
  2504. if ( jQuery.isEmptyObject( events ) ) {
  2505. handle = elemData.handle;
  2506. if ( handle ) {
  2507. handle.elem = null;
  2508. }
  2509. // removeData also checks for emptiness and clears the expando if empty
  2510. // so use it instead of delete
  2511. jQuery.removeData( elem, [ "events", "handle" ], true );
  2512. }
  2513. },
  2514. // Events that are safe to short-circuit if no handlers are attached.
  2515. // Native DOM events should not be added, they may have inline handlers.
  2516. customEvent: {
  2517. "getData": true,
  2518. "setData": true,
  2519. "changeData": true
  2520. },
  2521. trigger: function( event, data, elem, onlyHandlers ) {
  2522. // Don't do events on text and comment nodes
  2523. if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
  2524. return;
  2525. }
  2526. // Event object or event type
  2527. var type = event.type || event,
  2528. namespaces = [],
  2529. cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
  2530. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  2531. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  2532. return;
  2533. }
  2534. if ( type.indexOf( "!" ) >= 0 ) {
  2535. // Exclusive events trigger only for the exact event (no namespaces)
  2536. type = type.slice(0, -1);
  2537. exclusive = true;
  2538. }
  2539. if ( type.indexOf( "." ) >= 0 ) {
  2540. // Namespaced trigger; create a regexp to match event type in handle()
  2541. namespaces = type.split(".");
  2542. type = namespaces.shift();
  2543. namespaces.sort();
  2544. }
  2545. if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
  2546. // No jQuery handlers for this event type, and it can't have inline handlers
  2547. return;
  2548. }
  2549. // Caller can pass in an Event, Object, or just an event type string
  2550. event = typeof event === "object" ?
  2551. // jQuery.Event object
  2552. event[ jQuery.expando ] ? event :
  2553. // Object literal
  2554. new jQuery.Event( type, event ) :
  2555. // Just the event type (string)
  2556. new jQuery.Event( type );
  2557. event.type = type;
  2558. event.isTrigger = true;
  2559. event.exclusive = exclusive;
  2560. event.namespace = namespaces.join( "." );
  2561. event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
  2562. ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
  2563. // Handle a global trigger
  2564. if ( !elem ) {
  2565. // TODO: Stop taunting the data cache; remove global events and always attach to document
  2566. cache = jQuery.cache;
  2567. for ( i in cache ) {
  2568. if ( cache[ i ].events && cache[ i ].events[ type ] ) {
  2569. jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
  2570. }
  2571. }
  2572. return;
  2573. }
  2574. // Clean up the event in case it is being reused
  2575. event.result = undefined;
  2576. if ( !event.target ) {
  2577. event.target = elem;
  2578. }
  2579. // Clone any incoming data and prepend the event, creating the handler arg list
  2580. data = data != null ? jQuery.makeArray( data ) : [];
  2581. data.unshift( event );
  2582. // Allow special events to draw outside the lines
  2583. special = jQuery.event.special[ type ] || {};
  2584. if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
  2585. return;
  2586. }
  2587. // Determine event propagation path in advance, per W3C events spec (#9951)
  2588. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  2589. eventPath = [[ elem, special.bindType || type ]];
  2590. if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
  2591. bubbleType = special.delegateType || type;
  2592. cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
  2593. old = null;
  2594. for ( ; cur; cur = cur.parentNode ) {
  2595. eventPath.push([ cur, bubbleType ]);
  2596. old = cur;
  2597. }
  2598. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  2599. if ( old && old === elem.ownerDocument ) {
  2600. eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
  2601. }
  2602. }
  2603. // Fire handlers on the event path
  2604. for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
  2605. cur = eventPath[i][0];
  2606. event.type = eventPath[i][1];
  2607. handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
  2608. if ( handle ) {
  2609. handle.apply( cur, data );
  2610. }
  2611. // Note that this is a bare JS function and not a jQuery handler
  2612. handle = ontype && cur[ ontype ];
  2613. if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
  2614. event.preventDefault();
  2615. }
  2616. }
  2617. event.type = type;
  2618. // If nobody prevented the default action, do it now
  2619. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  2620. if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
  2621. !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
  2622. // Call a native DOM method on the target with the same name name as the event.
  2623. // Can't use an .isFunction() check here because IE6/7 fails that test.
  2624. // Don't do default actions on window, that's where global variables be (#6170)
  2625. // IE<9 dies on focus/blur to hidden element (#1486)
  2626. if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
  2627. // Don't re-trigger an onFOO event when we call its FOO() method
  2628. old = elem[ ontype ];
  2629. if ( old ) {
  2630. elem[ ontype ] = null;
  2631. }
  2632. // Prevent re-triggering of the same event, since we already bubbled it above
  2633. jQuery.event.triggered = type;
  2634. elem[ type ]();
  2635. jQuery.event.triggered = undefined;
  2636. if ( old ) {
  2637. elem[ ontype ] = old;
  2638. }
  2639. }
  2640. }
  2641. }
  2642. return event.result;
  2643. },
  2644. dispatch: function( event ) {
  2645. // Make a writable jQuery.Event from the native event object
  2646. event = jQuery.event.fix( event || window.event );
  2647. var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
  2648. delegateCount = handlers.delegateCount,
  2649. args = [].slice.call( arguments, 0 ),
  2650. run_all = !event.exclusive && !event.namespace,
  2651. handlerQueue = [],
  2652. i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
  2653. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  2654. args[0] = event;
  2655. event.delegateTarget = this;
  2656. // Determine handlers that should run if there are delegated events
  2657. // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861)
  2658. if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {
  2659. // Pregenerate a single jQuery object for reuse with .is()
  2660. jqcur = jQuery(this);
  2661. jqcur.context = this.ownerDocument || this;
  2662. for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
  2663. selMatch = {};
  2664. matches = [];
  2665. jqcur[0] = cur;
  2666. for ( i = 0; i < delegateCount; i++ ) {
  2667. handleObj = handlers[ i ];
  2668. sel = handleObj.selector;
  2669. if ( selMatch[ sel ] === undefined ) {
  2670. selMatch[ sel ] = (
  2671. handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
  2672. );
  2673. }
  2674. if ( selMatch[ sel ] ) {
  2675. matches.push( handleObj );
  2676. }
  2677. }
  2678. if ( matches.length ) {
  2679. handlerQueue.push({ elem: cur, matches: matches });
  2680. }
  2681. }
  2682. }
  2683. // Add the remaining (directly-bound) handlers
  2684. if ( handlers.length > delegateCount ) {
  2685. handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
  2686. }
  2687. // Run delegates first; they may want to stop propagation beneath us
  2688. for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
  2689. matched = handlerQueue[ i ];
  2690. event.currentTarget = matched.elem;
  2691. for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
  2692. handleObj = matched.matches[ j ];
  2693. // Triggered event must either 1) be non-exclusive and have no namespace, or
  2694. // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
  2695. if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
  2696. event.data = handleObj.data;
  2697. event.handleObj = handleObj;
  2698. ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
  2699. .apply( matched.elem, args );
  2700. if ( ret !== undefined ) {
  2701. event.result = ret;
  2702. if ( ret === false ) {
  2703. event.preventDefault();
  2704. event.stopPropagation();
  2705. }
  2706. }
  2707. }
  2708. }
  2709. }
  2710. return event.result;
  2711. },
  2712. // Includes some event props shared by KeyEvent and MouseEvent
  2713. // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
  2714. props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  2715. fixHooks: {},
  2716. keyHooks: {
  2717. props: "char charCode key keyCode".split(" "),
  2718. filter: function( event, original ) {
  2719. // Add which for key events
  2720. if ( event.which == null ) {
  2721. event.which = original.charCode != null ? original.charCode : original.keyCode;
  2722. }
  2723. return event;
  2724. }
  2725. },
  2726. mouseHooks: {
  2727. props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
  2728. filter: function( event, original ) {
  2729. var eventDoc, doc, body,
  2730. button = original.button,
  2731. fromElement = original.fromElement;
  2732. // Calculate pageX/Y if missing and clientX/Y available
  2733. if ( event.pageX == null && original.clientX != null ) {
  2734. eventDoc = event.target.ownerDocument || document;
  2735. doc = eventDoc.documentElement;
  2736. body = eventDoc.body;
  2737. event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
  2738. event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
  2739. }
  2740. // Add relatedTarget, if necessary
  2741. if ( !event.relatedTarget && fromElement ) {
  2742. event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
  2743. }
  2744. // Add which for click: 1 === left; 2 === middle; 3 === right
  2745. // Note: button is not normalized, so don't use it
  2746. if ( !event.which && button !== undefined ) {
  2747. event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
  2748. }
  2749. return event;
  2750. }
  2751. },
  2752. fix: function( event ) {
  2753. if ( event[ jQuery.expando ] ) {
  2754. return event;
  2755. }
  2756. // Create a writable copy of the event object and normalize some properties
  2757. var i, prop,
  2758. originalEvent = event,
  2759. fixHook = jQuery.event.fixHooks[ event.type ] || {},
  2760. copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
  2761. event = jQuery.Event( originalEvent );
  2762. for ( i = copy.length; i; ) {
  2763. prop = copy[ --i ];
  2764. event[ prop ] = originalEvent[ prop ];
  2765. }
  2766. // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
  2767. if ( !event.target ) {
  2768. event.target = originalEvent.srcElement || document;
  2769. }
  2770. // Target should not be a text node (#504, Safari)
  2771. if ( event.target.nodeType === 3 ) {
  2772. event.target = event.target.parentNode;
  2773. }
  2774. // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
  2775. if ( event.metaKey === undefined ) {
  2776. event.metaKey = event.ctrlKey;
  2777. }
  2778. return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
  2779. },
  2780. special: {
  2781. ready: {
  2782. // Make sure the ready event is setup
  2783. setup: jQuery.bindReady
  2784. },
  2785. load: {
  2786. // Prevent triggered image.load events from bubbling to window.load
  2787. noBubble: true
  2788. },
  2789. focus: {
  2790. delegateType: "focusin"
  2791. },
  2792. blur: {
  2793. delegateType: "focusout"
  2794. },
  2795. beforeunload: {
  2796. setup: function( data, namespaces, eventHandle ) {
  2797. // We only want to do this special case on windows
  2798. if ( jQuery.isWindow( this ) ) {
  2799. this.onbeforeunload = eventHandle;
  2800. }
  2801. },
  2802. teardown: function( namespaces, eventHandle ) {
  2803. if ( this.onbeforeunload === eventHandle ) {
  2804. this.onbeforeunload = null;
  2805. }
  2806. }
  2807. }
  2808. },
  2809. simulate: function( type, elem, event, bubble ) {
  2810. // Piggyback on a donor event to simulate a different one.
  2811. // Fake originalEvent to avoid donor's stopPropagation, but if the
  2812. // simulated event prevents default then we do the same on the donor.
  2813. var e = jQuery.extend(
  2814. new jQuery.Event(),
  2815. event,
  2816. { type: type,
  2817. isSimulated: true,
  2818. originalEvent: {}
  2819. }
  2820. );
  2821. if ( bubble ) {
  2822. jQuery.event.trigger( e, null, elem );
  2823. } else {
  2824. jQuery.event.dispatch.call( elem, e );
  2825. }
  2826. if ( e.isDefaultPrevented() ) {
  2827. event.preventDefault();
  2828. }
  2829. }
  2830. };
  2831. // Some plugins are using, but it's undocumented/deprecated and will be removed.
  2832. // The 1.7 special event interface should provide all the hooks needed now.
  2833. jQuery.event.handle = jQuery.event.dispatch;
  2834. jQuery.removeEvent = document.removeEventListener ?
  2835. function( elem, type, handle ) {
  2836. if ( elem.removeEventListener ) {
  2837. elem.removeEventListener( type, handle, false );
  2838. }
  2839. } :
  2840. function( elem, type, handle ) {
  2841. if ( elem.detachEvent ) {
  2842. elem.detachEvent( "on" + type, handle );
  2843. }
  2844. };
  2845. jQuery.Event = function( src, props ) {
  2846. // Allow instantiation without the 'new' keyword
  2847. if ( !(this instanceof jQuery.Event) ) {
  2848. return new jQuery.Event( src, props );
  2849. }
  2850. // Event object
  2851. if ( src && src.type ) {
  2852. this.originalEvent = src;
  2853. this.type = src.type;
  2854. // Events bubbling up the document may have been marked as prevented
  2855. // by a handler lower down the tree; reflect the correct value.
  2856. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
  2857. src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
  2858. // Event type
  2859. } else {
  2860. this.type = src;
  2861. }
  2862. // Put explicitly provided properties onto the event object
  2863. if ( props ) {
  2864. jQuery.extend( this, props );
  2865. }
  2866. // Create a timestamp if incoming event doesn't have one
  2867. this.timeStamp = src && src.timeStamp || jQuery.now();
  2868. // Mark it as fixed
  2869. this[ jQuery.expando ] = true;
  2870. };
  2871. function returnFalse() {
  2872. return false;
  2873. }
  2874. function returnTrue() {
  2875. return true;
  2876. }
  2877. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  2878. // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  2879. jQuery.Event.prototype = {
  2880. preventDefault: function() {
  2881. this.isDefaultPrevented = returnTrue;
  2882. var e = this.originalEvent;
  2883. if ( !e ) {
  2884. return;
  2885. }
  2886. // if preventDefault exists run it on the original event
  2887. if ( e.preventDefault ) {
  2888. e.preventDefault();
  2889. // otherwise set the returnValue property of the original event to false (IE)
  2890. } else {
  2891. e.returnValue = false;
  2892. }
  2893. },
  2894. stopPropagation: function() {
  2895. this.isPropagationStopped = returnTrue;
  2896. var e = this.originalEvent;
  2897. if ( !e ) {
  2898. return;
  2899. }
  2900. // if stopPropagation exists run it on the original event
  2901. if ( e.stopPropagation ) {
  2902. e.stopPropagation();
  2903. }
  2904. // otherwise set the cancelBubble property of the original event to true (IE)
  2905. e.cancelBubble = true;
  2906. },
  2907. stopImmediatePropagation: function() {
  2908. this.isImmediatePropagationStopped = returnTrue;
  2909. this.stopPropagation();
  2910. },
  2911. isDefaultPrevented: returnFalse,
  2912. isPropagationStopped: returnFalse,
  2913. isImmediatePropagationStopped: returnFalse
  2914. };
  2915. // Create mouseenter/leave events using mouseover/out and event-time checks
  2916. jQuery.each({
  2917. mouseenter: "mouseover",
  2918. mouseleave: "mouseout"
  2919. }, function( orig, fix ) {
  2920. jQuery.event.special[ orig ] = {
  2921. delegateType: fix,
  2922. bindType: fix,
  2923. handle: function( event ) {
  2924. var target = this,
  2925. related = event.relatedTarget,
  2926. handleObj = event.handleObj,
  2927. selector = handleObj.selector,
  2928. ret;
  2929. // For mousenter/leave call the handler if related is outside the target.
  2930. // NB: No relatedTarget if the mouse left/entered the browser window
  2931. if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
  2932. event.type = handleObj.origType;
  2933. ret = handleObj.handler.apply( this, arguments );
  2934. event.type = fix;
  2935. }
  2936. return ret;
  2937. }
  2938. };
  2939. });
  2940. // IE submit delegation
  2941. if ( !jQuery.support.submitBubbles ) {
  2942. jQuery.event.special.submit = {
  2943. setup: function() {
  2944. // Only need this for delegated form submit events
  2945. if ( jQuery.nodeName( this, "form" ) ) {
  2946. return false;
  2947. }
  2948. // Lazy-add a submit handler when a descendant form may potentially be submitted
  2949. jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
  2950. // Node name check avoids a VML-related crash in IE (#9807)
  2951. var elem = e.target,
  2952. form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
  2953. if ( form && !form._submit_attached ) {
  2954. jQuery.event.add( form, "submit._submit", function( event ) {
  2955. // If form was submitted by the user, bubble the event up the tree
  2956. if ( this.parentNode && !event.isTrigger ) {
  2957. jQuery.event.simulate( "submit", this.parentNode, event, true );
  2958. }
  2959. });
  2960. form._submit_attached = true;
  2961. }
  2962. });
  2963. // return undefined since we don't need an event listener
  2964. },
  2965. teardown: function() {
  2966. // Only need this for delegated form submit events
  2967. if ( jQuery.nodeName( this, "form" ) ) {
  2968. return false;
  2969. }
  2970. // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
  2971. jQuery.event.remove( this, "._submit" );
  2972. }
  2973. };
  2974. }
  2975. // IE change delegation and checkbox/radio fix
  2976. if ( !jQuery.support.changeBubbles ) {
  2977. jQuery.event.special.change = {
  2978. setup: function() {
  2979. if ( rformElems.test( this.nodeName ) ) {
  2980. // IE doesn't fire change on a check/radio until blur; trigger it on click
  2981. // after a propertychange. Eat the blur-change in special.change.handle.
  2982. // This still fires onchange a second time for check/radio after blur.
  2983. if ( this.type === "checkbox" || this.type === "radio" ) {
  2984. jQuery.event.add( this, "propertychange._change", function( event ) {
  2985. if ( event.originalEvent.propertyName === "checked" ) {
  2986. this._just_changed = true;
  2987. }
  2988. });
  2989. jQuery.event.add( this, "click._change", function( event ) {
  2990. if ( this._just_changed && !event.isTrigger ) {
  2991. this._just_changed = false;
  2992. jQuery.event.simulate( "change", this, event, true );
  2993. }
  2994. });
  2995. }
  2996. return false;
  2997. }
  2998. // Delegated event; lazy-add a change handler on descendant inputs
  2999. jQuery.event.add( this, "beforeactivate._change", function( e ) {
  3000. var elem = e.target;
  3001. if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
  3002. jQuery.event.add( elem, "change._change", function( event ) {
  3003. if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
  3004. jQuery.event.simulate( "change", this.parentNode, event, true );
  3005. }
  3006. });
  3007. elem._change_attached = true;
  3008. }
  3009. });
  3010. },
  3011. handle: function( event ) {
  3012. var elem = event.target;
  3013. // Swallow native change events from checkbox/radio, we already triggered them above
  3014. if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
  3015. return event.handleObj.handler.apply( this, arguments );
  3016. }
  3017. },
  3018. teardown: function() {
  3019. jQuery.event.remove( this, "._change" );
  3020. return rformElems.test( this.nodeName );
  3021. }
  3022. };
  3023. }
  3024. // Create "bubbling" focus and blur events
  3025. if ( !jQuery.support.focusinBubbles ) {
  3026. jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  3027. // Attach a single capturing handler while someone wants focusin/focusout
  3028. var attaches = 0,
  3029. handler = function( event ) {
  3030. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
  3031. };
  3032. jQuery.event.special[ fix ] = {
  3033. setup: function() {
  3034. if ( attaches++ === 0 ) {
  3035. document.addEventListener( orig, handler, true );
  3036. }
  3037. },
  3038. teardown: function() {
  3039. if ( --attaches === 0 ) {
  3040. document.removeEventListener( orig, handler, true );
  3041. }
  3042. }
  3043. };
  3044. });
  3045. }
  3046. jQuery.fn.extend({
  3047. on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
  3048. var origFn, type;
  3049. // Types can be a map of types/handlers
  3050. if ( typeof types === "object" ) {
  3051. // ( types-Object, selector, data )
  3052. if ( typeof selector !== "string" ) {
  3053. // ( types-Object, data )
  3054. data = selector;
  3055. selector = undefined;
  3056. }
  3057. for ( type in types ) {
  3058. this.on( type, selector, data, types[ type ], one );
  3059. }
  3060. return this;
  3061. }
  3062. if ( data == null && fn == null ) {
  3063. // ( types, fn )
  3064. fn = selector;
  3065. data = selector = undefined;
  3066. } else if ( fn == null ) {
  3067. if ( typeof selector === "string" ) {
  3068. // ( types, selector, fn )
  3069. fn = data;
  3070. data = undefined;
  3071. } else {
  3072. // ( types, data, fn )
  3073. fn = data;
  3074. data = selector;
  3075. selector = undefined;
  3076. }
  3077. }
  3078. if ( fn === false ) {
  3079. fn = returnFalse;
  3080. } else if ( !fn ) {
  3081. return this;
  3082. }
  3083. if ( one === 1 ) {
  3084. origFn = fn;
  3085. fn = function( event ) {
  3086. // Can use an empty set, since event contains the info
  3087. jQuery().off( event );
  3088. return origFn.apply( this, arguments );
  3089. };
  3090. // Use same guid so caller can remove using origFn
  3091. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  3092. }
  3093. return this.each( function() {
  3094. jQuery.event.add( this, types, fn, data, selector );
  3095. });
  3096. },
  3097. one: function( types, selector, data, fn ) {
  3098. return this.on.call( this, types, selector, data, fn, 1 );
  3099. },
  3100. off: function( types, selector, fn ) {
  3101. if ( types && types.preventDefault && types.handleObj ) {
  3102. // ( event ) dispatched jQuery.Event
  3103. var handleObj = types.handleObj;
  3104. jQuery( types.delegateTarget ).off(
  3105. handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type,
  3106. handleObj.selector,
  3107. handleObj.handler
  3108. );
  3109. return this;
  3110. }
  3111. if ( typeof types === "object" ) {
  3112. // ( types-object [, selector] )
  3113. for ( var type in types ) {
  3114. this.off( type, selector, types[ type ] );
  3115. }
  3116. return this;
  3117. }
  3118. if ( selector === false || typeof selector === "function" ) {
  3119. // ( types [, fn] )
  3120. fn = selector;
  3121. selector = undefined;
  3122. }
  3123. if ( fn === false ) {
  3124. fn = returnFalse;
  3125. }
  3126. return this.each(function() {
  3127. jQuery.event.remove( this, types, fn, selector );
  3128. });
  3129. },
  3130. bind: function( types, data, fn ) {
  3131. return this.on( types, null, data, fn );
  3132. },
  3133. unbind: function( types, fn ) {
  3134. return this.off( types, null, fn );
  3135. },
  3136. live: function( types, data, fn ) {
  3137. jQuery( this.context ).on( types, this.selector, data, fn );
  3138. return this;
  3139. },
  3140. die: function( types, fn ) {
  3141. jQuery( this.context ).off( types, this.selector || "**", fn );
  3142. return this;
  3143. },
  3144. delegate: function( selector, types, data, fn ) {
  3145. return this.on( types, selector, data, fn );
  3146. },
  3147. undelegate: function( selector, types, fn ) {
  3148. // ( namespace ) or ( selector, types [, fn] )
  3149. return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
  3150. },
  3151. trigger: function( type, data ) {
  3152. return this.each(function() {
  3153. jQuery.event.trigger( type, data, this );
  3154. });
  3155. },
  3156. triggerHandler: function( type, data ) {
  3157. if ( this[0] ) {
  3158. return jQuery.event.trigger( type, data, this[0], true );
  3159. }
  3160. },
  3161. toggle: function( fn ) {
  3162. // Save reference to arguments for access in closure
  3163. var args = arguments,
  3164. guid = fn.guid || jQuery.guid++,
  3165. i = 0,
  3166. toggler = function( event ) {
  3167. // Figure out which function to execute
  3168. var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
  3169. jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
  3170. // Make sure that clicks stop
  3171. event.preventDefault();
  3172. // and execute the function
  3173. return args[ lastToggle ].apply( this, arguments ) || false;
  3174. };
  3175. // link all the functions, so any of them can unbind this click handler
  3176. toggler.guid = guid;
  3177. while ( i < args.length ) {
  3178. args[ i++ ].guid = guid;
  3179. }
  3180. return this.click( toggler );
  3181. },
  3182. hover: function( fnOver, fnOut ) {
  3183. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  3184. }
  3185. });
  3186. jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
  3187. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  3188. "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
  3189. // Handle event binding
  3190. jQuery.fn[ name ] = function( data, fn ) {
  3191. if ( fn == null ) {
  3192. fn = data;
  3193. data = null;
  3194. }
  3195. return arguments.length > 0 ?
  3196. this.on( name, null, data, fn ) :
  3197. this.trigger( name );
  3198. };
  3199. if ( jQuery.attrFn ) {
  3200. jQuery.attrFn[ name ] = true;
  3201. }
  3202. if ( rkeyEvent.test( name ) ) {
  3203. jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
  3204. }
  3205. if ( rmouseEvent.test( name ) ) {
  3206. jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
  3207. }
  3208. });
  3209. /*!
  3210. * Sizzle CSS Selector Engine
  3211. * Copyright 2012, The Dojo Foundation
  3212. * Released under the MIT, BSD, and GPL Licenses.
  3213. * More information: http://sizzlejs.com/
  3214. */
  3215. (function(){
  3216. var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
  3217. expando = "sizcache" + (Math.random() + '').replace('.', ''),
  3218. done = 0,
  3219. toString = Object.prototype.toString,
  3220. hasDuplicate = false,
  3221. baseHasDuplicate = true,
  3222. rBackslash = /\\/g,
  3223. rReturn = /\r\n/g,
  3224. rNonWord = /\W/;
  3225. // Here we check if the JavaScript engine is using some sort of
  3226. // optimization where it does not always call our comparision
  3227. // function. If that is the case, discard the hasDuplicate value.
  3228. // Thus far that includes Google Chrome.
  3229. [0, 0].sort(function() {
  3230. baseHasDuplicate = false;
  3231. return 0;
  3232. });
  3233. var Sizzle = function( selector, context, results, seed ) {
  3234. results = results || [];
  3235. context = context || document;
  3236. var origContext = context;
  3237. if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
  3238. return [];
  3239. }
  3240. if ( !selector || typeof selector !== "string" ) {
  3241. return results;
  3242. }
  3243. var m, set, checkSet, extra, ret, cur, pop, i,
  3244. prune = true,
  3245. contextXML = Sizzle.isXML( context ),
  3246. parts = [],
  3247. soFar = selector;
  3248. // Reset the position of the chunker regexp (start from head)
  3249. do {
  3250. chunker.exec( "" );
  3251. m = chunker.exec( soFar );
  3252. if ( m ) {
  3253. soFar = m[3];
  3254. parts.push( m[1] );
  3255. if ( m[2] ) {
  3256. extra = m[3];
  3257. break;
  3258. }
  3259. }
  3260. } while ( m );
  3261. if ( parts.length > 1 && origPOS.exec( selector ) ) {
  3262. if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
  3263. set = posProcess( parts[0] + parts[1], context, seed );
  3264. } else {
  3265. set = Expr.relative[ parts[0] ] ?
  3266. [ context ] :
  3267. Sizzle( parts.shift(), context );
  3268. while ( parts.length ) {
  3269. selector = parts.shift();
  3270. if ( Expr.relative[ selector ] ) {
  3271. selector += parts.shift();
  3272. }
  3273. set = posProcess( selector, set, seed );
  3274. }
  3275. }
  3276. } else {
  3277. // Take a shortcut and set the context if the root selector is an ID
  3278. // (but not if it'll be faster if the inner selector is an ID)
  3279. if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
  3280. Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
  3281. ret = Sizzle.find( parts.shift(), context, contextXML );
  3282. context = ret.expr ?
  3283. Sizzle.filter( ret.expr, ret.set )[0] :
  3284. ret.set[0];
  3285. }
  3286. if ( context ) {
  3287. ret = seed ?
  3288. { expr: parts.pop(), set: makeArray(seed) } :
  3289. Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
  3290. set = ret.expr ?
  3291. Sizzle.filter( ret.expr, ret.set ) :
  3292. ret.set;
  3293. if ( parts.length > 0 ) {
  3294. checkSet = makeArray( set );
  3295. } else {
  3296. prune = false;
  3297. }
  3298. while ( parts.length ) {
  3299. cur = parts.pop();
  3300. pop = cur;
  3301. if ( !Expr.relative[ cur ] ) {
  3302. cur = "";
  3303. } else {
  3304. pop = parts.pop();
  3305. }
  3306. if ( pop == null ) {
  3307. pop = context;
  3308. }
  3309. Expr.relative[ cur ]( checkSet, pop, contextXML );
  3310. }
  3311. } else {
  3312. checkSet = parts = [];
  3313. }
  3314. }
  3315. if ( !checkSet ) {
  3316. checkSet = set;
  3317. }
  3318. if ( !checkSet ) {
  3319. Sizzle.error( cur || selector );
  3320. }
  3321. if ( toString.call(checkSet) === "[object Array]" ) {
  3322. if ( !prune ) {
  3323. results.push.apply( results, checkSet );
  3324. } else if ( context && context.nodeType === 1 ) {
  3325. for ( i = 0; checkSet[i] != null; i++ ) {
  3326. if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
  3327. results.push( set[i] );
  3328. }
  3329. }
  3330. } else {
  3331. for ( i = 0; checkSet[i] != null; i++ ) {
  3332. if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
  3333. results.push( set[i] );
  3334. }
  3335. }
  3336. }
  3337. } else {
  3338. makeArray( checkSet, results );
  3339. }
  3340. if ( extra ) {
  3341. Sizzle( extra, origContext, results, seed );
  3342. Sizzle.uniqueSort( results );
  3343. }
  3344. return results;
  3345. };
  3346. Sizzle.uniqueSort = function( results ) {
  3347. if ( sortOrder ) {
  3348. hasDuplicate = baseHasDuplicate;
  3349. results.sort( sortOrder );
  3350. if ( hasDuplicate ) {
  3351. for ( var i = 1; i < results.length; i++ ) {
  3352. if ( results[i] === results[ i - 1 ] ) {
  3353. results.splice( i--, 1 );
  3354. }
  3355. }
  3356. }
  3357. }
  3358. return results;
  3359. };
  3360. Sizzle.matches = function( expr, set ) {
  3361. return Sizzle( expr, null, null, set );
  3362. };
  3363. Sizzle.matchesSelector = function( node, expr ) {
  3364. return Sizzle( expr, null, null, [node] ).length > 0;
  3365. };
  3366. Sizzle.find = function( expr, context, isXML ) {
  3367. var set, i, len, match, type, left;
  3368. if ( !expr ) {
  3369. return [];
  3370. }
  3371. for ( i = 0, len = Expr.order.length; i < len; i++ ) {
  3372. type = Expr.order[i];
  3373. if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
  3374. left = match[1];
  3375. match.splice( 1, 1 );
  3376. if ( left.substr( left.length - 1 ) !== "\\" ) {
  3377. match[1] = (match[1] || "").replace( rBackslash, "" );
  3378. set = Expr.find[ type ]( match, context, isXML );
  3379. if ( set != null ) {
  3380. expr = expr.replace( Expr.match[ type ], "" );
  3381. break;
  3382. }
  3383. }
  3384. }
  3385. }
  3386. if ( !set ) {
  3387. set = typeof context.getElementsByTagName !== "undefined" ?
  3388. context.getElementsByTagName( "*" ) :
  3389. [];
  3390. }
  3391. return { set: set, expr: expr };
  3392. };
  3393. Sizzle.filter = function( expr, set, inplace, not ) {
  3394. var match, anyFound,
  3395. type, found, item, filter, left,
  3396. i, pass,
  3397. old = expr,
  3398. result = [],
  3399. curLoop = set,
  3400. isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
  3401. while ( expr && set.length ) {
  3402. for ( type in Expr.filter ) {
  3403. if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
  3404. filter = Expr.filter[ type ];
  3405. left = match[1];
  3406. anyFound = false;
  3407. match.splice(1,1);
  3408. if ( left.substr( left.length - 1 ) === "\\" ) {
  3409. continue;
  3410. }
  3411. if ( curLoop === result ) {
  3412. result = [];
  3413. }
  3414. if ( Expr.preFilter[ type ] ) {
  3415. match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
  3416. if ( !match ) {
  3417. anyFound = found = true;
  3418. } else if ( match === true ) {
  3419. continue;
  3420. }
  3421. }
  3422. if ( match ) {
  3423. for ( i = 0; (item = curLoop[i]) != null; i++ ) {
  3424. if ( item ) {
  3425. found = filter( item, match, i, curLoop );
  3426. pass = not ^ found;
  3427. if ( inplace && found != null ) {
  3428. if ( pass ) {
  3429. anyFound = true;
  3430. } else {
  3431. curLoop[i] = false;
  3432. }
  3433. } else if ( pass ) {
  3434. result.push( item );
  3435. anyFound = true;
  3436. }
  3437. }
  3438. }
  3439. }
  3440. if ( found !== undefined ) {
  3441. if ( !inplace ) {
  3442. curLoop = result;
  3443. }
  3444. expr = expr.replace( Expr.match[ type ], "" );
  3445. if ( !anyFound ) {
  3446. return [];
  3447. }
  3448. break;
  3449. }
  3450. }
  3451. }
  3452. // Improper expression
  3453. if ( expr === old ) {
  3454. if ( anyFound == null ) {
  3455. Sizzle.error( expr );
  3456. } else {
  3457. break;
  3458. }
  3459. }
  3460. old = expr;
  3461. }
  3462. return curLoop;
  3463. };
  3464. Sizzle.error = function( msg ) {
  3465. throw new Error( "Syntax error, unrecognized expression: " + msg );
  3466. };
  3467. /**
  3468. * Utility function for retreiving the text value of an array of DOM nodes
  3469. * @param {Array|Element} elem
  3470. */
  3471. var getText = Sizzle.getText = function( elem ) {
  3472. var i, node,
  3473. nodeType = elem.nodeType,
  3474. ret = "";
  3475. if ( nodeType ) {
  3476. if ( nodeType === 1 || nodeType === 9 ) {
  3477. // Use textContent || innerText for elements
  3478. if ( typeof elem.textContent === 'string' ) {
  3479. return elem.textContent;
  3480. } else if ( typeof elem.innerText === 'string' ) {
  3481. // Replace IE's carriage returns
  3482. return elem.innerText.replace( rReturn, '' );
  3483. } else {
  3484. // Traverse it's children
  3485. for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
  3486. ret += getText( elem );
  3487. }
  3488. }
  3489. } else if ( nodeType === 3 || nodeType === 4 ) {
  3490. return elem.nodeValue;
  3491. }
  3492. } else {
  3493. // If no nodeType, this is expected to be an array
  3494. for ( i = 0; (node = elem[i]); i++ ) {
  3495. // Do not traverse comment nodes
  3496. if ( node.nodeType !== 8 ) {
  3497. ret += getText( node );
  3498. }
  3499. }
  3500. }
  3501. return ret;
  3502. };
  3503. var Expr = Sizzle.selectors = {
  3504. order: [ "ID", "NAME", "TAG" ],
  3505. match: {
  3506. ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
  3507. CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
  3508. NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
  3509. ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
  3510. TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
  3511. CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
  3512. POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
  3513. PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
  3514. },
  3515. leftMatch: {},
  3516. attrMap: {
  3517. "class": "className",
  3518. "for": "htmlFor"
  3519. },
  3520. attrHandle: {
  3521. href: function( elem ) {
  3522. return elem.getAttribute( "href" );
  3523. },
  3524. type: function( elem ) {
  3525. return elem.getAttribute( "type" );
  3526. }
  3527. },
  3528. relative: {
  3529. "+": function(checkSet, part){
  3530. var isPartStr = typeof part === "string",
  3531. isTag = isPartStr && !rNonWord.test( part ),
  3532. isPartStrNotTag = isPartStr && !isTag;
  3533. if ( isTag ) {
  3534. part = part.toLowerCase();
  3535. }
  3536. for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
  3537. if ( (elem = checkSet[i]) ) {
  3538. while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
  3539. checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
  3540. elem || false :
  3541. elem === part;
  3542. }
  3543. }
  3544. if ( isPartStrNotTag ) {
  3545. Sizzle.filter( part, checkSet, true );
  3546. }
  3547. },
  3548. ">": function( checkSet, part ) {
  3549. var elem,
  3550. isPartStr = typeof part === "string",
  3551. i = 0,
  3552. l = checkSet.length;
  3553. if ( isPartStr && !rNonWord.test( part ) ) {
  3554. part = part.toLowerCase();
  3555. for ( ; i < l; i++ ) {
  3556. elem = checkSet[i];
  3557. if ( elem ) {
  3558. var parent = elem.parentNode;
  3559. checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
  3560. }
  3561. }
  3562. } else {
  3563. for ( ; i < l; i++ ) {
  3564. elem = checkSet[i];
  3565. if ( elem ) {
  3566. checkSet[i] = isPartStr ?
  3567. elem.parentNode :
  3568. elem.parentNode === part;
  3569. }
  3570. }
  3571. if ( isPartStr ) {
  3572. Sizzle.filter( part, checkSet, true );
  3573. }
  3574. }
  3575. },
  3576. "": function(checkSet, part, isXML){
  3577. var nodeCheck,
  3578. doneName = done++,
  3579. checkFn = dirCheck;
  3580. if ( typeof part === "string" && !rNonWord.test( part ) ) {
  3581. part = part.toLowerCase();
  3582. nodeCheck = part;
  3583. checkFn = dirNodeCheck;
  3584. }
  3585. checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
  3586. },
  3587. "~": function( checkSet, part, isXML ) {
  3588. var nodeCheck,
  3589. doneName = done++,
  3590. checkFn = dirCheck;
  3591. if ( typeof part === "string" && !rNonWord.test( part ) ) {
  3592. part = part.toLowerCase();
  3593. nodeCheck = part;
  3594. checkFn = dirNodeCheck;
  3595. }
  3596. checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
  3597. }
  3598. },
  3599. find: {
  3600. ID: function( match, context, isXML ) {
  3601. if ( typeof context.getElementById !== "undefined" && !isXML ) {
  3602. var m = context.getElementById(match[1]);
  3603. // Check parentNode to catch when Blackberry 4.6 returns
  3604. // nodes that are no longer in the document #6963
  3605. return m && m.parentNode ? [m] : [];
  3606. }
  3607. },
  3608. NAME: function( match, context ) {
  3609. if ( typeof context.getElementsByName !== "undefined" ) {
  3610. var ret = [],
  3611. results = context.getElementsByName( match[1] );
  3612. for ( var i = 0, l = results.length; i < l; i++ ) {
  3613. if ( results[i].getAttribute("name") === match[1] ) {
  3614. ret.push( results[i] );
  3615. }
  3616. }
  3617. return ret.length === 0 ? null : ret;
  3618. }
  3619. },
  3620. TAG: function( match, context ) {
  3621. if ( typeof context.getElementsByTagName !== "undefined" ) {
  3622. return context.getElementsByTagName( match[1] );
  3623. }
  3624. }
  3625. },
  3626. preFilter: {
  3627. CLASS: function( match, curLoop, inplace, result, not, isXML ) {
  3628. match = " " + match[1].replace( rBackslash, "" ) + " ";
  3629. if ( isXML ) {
  3630. return match;
  3631. }
  3632. for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
  3633. if ( elem ) {
  3634. if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
  3635. if ( !inplace ) {
  3636. result.push( elem );
  3637. }
  3638. } else if ( inplace ) {
  3639. curLoop[i] = false;
  3640. }
  3641. }
  3642. }
  3643. return false;
  3644. },
  3645. ID: function( match ) {
  3646. return match[1].replace( rBackslash, "" );
  3647. },
  3648. TAG: function( match, curLoop ) {
  3649. return match[1].replace( rBackslash, "" ).toLowerCase();
  3650. },
  3651. CHILD: function( match ) {
  3652. if ( match[1] === "nth" ) {
  3653. if ( !match[2] ) {
  3654. Sizzle.error( match[0] );
  3655. }
  3656. match[2] = match[2].replace(/^\+|\s*/g, '');
  3657. // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
  3658. var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
  3659. match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
  3660. !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
  3661. // calculate the numbers (first)n+(last) including if they are negative
  3662. match[2] = (test[1] + (test[2] || 1)) - 0;
  3663. match[3] = test[3] - 0;
  3664. }
  3665. else if ( match[2] ) {
  3666. Sizzle.error( match[0] );
  3667. }
  3668. // TODO: Move to normal caching system
  3669. match[0] = done++;
  3670. return match;
  3671. },
  3672. ATTR: function( match, curLoop, inplace, result, not, isXML ) {
  3673. var name = match[1] = match[1].replace( rBackslash, "" );
  3674. if ( !isXML && Expr.attrMap[name] ) {
  3675. match[1] = Expr.attrMap[name];
  3676. }
  3677. // Handle if an un-quoted value was used
  3678. match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
  3679. if ( match[2] === "~=" ) {
  3680. match[4] = " " + match[4] + " ";
  3681. }
  3682. return match;
  3683. },
  3684. PSEUDO: function( match, curLoop, inplace, result, not ) {
  3685. if ( match[1] === "not" ) {
  3686. // If we're dealing with a complex expression, or a simple one
  3687. if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
  3688. match[3] = Sizzle(match[3], null, null, curLoop);
  3689. } else {
  3690. var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
  3691. if ( !inplace ) {
  3692. result.push.apply( result, ret );
  3693. }
  3694. return false;
  3695. }
  3696. } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
  3697. return true;
  3698. }
  3699. return match;
  3700. },
  3701. POS: function( match ) {
  3702. match.unshift( true );
  3703. return match;
  3704. }
  3705. },
  3706. filters: {
  3707. enabled: function( elem ) {
  3708. return elem.disabled === false && elem.type !== "hidden";
  3709. },
  3710. disabled: function( elem ) {
  3711. return elem.disabled === true;
  3712. },
  3713. checked: function( elem ) {
  3714. return elem.checked === true;
  3715. },
  3716. selected: function( elem ) {
  3717. // Accessing this property makes selected-by-default
  3718. // options in Safari work properly
  3719. if ( elem.parentNode ) {
  3720. elem.parentNode.selectedIndex;
  3721. }
  3722. return elem.selected === true;
  3723. },
  3724. parent: function( elem ) {
  3725. return !!elem.firstChild;
  3726. },
  3727. empty: function( elem ) {
  3728. return !elem.firstChild;
  3729. },
  3730. has: function( elem, i, match ) {
  3731. return !!Sizzle( match[3], elem ).length;
  3732. },
  3733. header: function( elem ) {
  3734. return (/h\d/i).test( elem.nodeName );
  3735. },
  3736. text: function( elem ) {
  3737. var attr = elem.getAttribute( "type" ), type = elem.type;
  3738. // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
  3739. // use getAttribute instead to test this case
  3740. return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
  3741. },
  3742. radio: function( elem ) {
  3743. return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
  3744. },
  3745. checkbox: function( elem ) {
  3746. return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
  3747. },
  3748. file: function( elem ) {
  3749. return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
  3750. },
  3751. password: function( elem ) {
  3752. return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
  3753. },
  3754. submit: function( elem ) {
  3755. var name = elem.nodeName.toLowerCase();
  3756. return (name === "input" || name === "button") && "submit" === elem.type;
  3757. },
  3758. image: function( elem ) {
  3759. return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
  3760. },
  3761. reset: function( elem ) {
  3762. var name = elem.nodeName.toLowerCase();
  3763. return (name === "input" || name === "button") && "reset" === elem.type;
  3764. },
  3765. button: function( elem ) {
  3766. var name = elem.nodeName.toLowerCase();
  3767. return name === "input" && "button" === elem.type || name === "button";
  3768. },
  3769. input: function( elem ) {
  3770. return (/input|select|textarea|button/i).test( elem.nodeName );
  3771. },
  3772. focus: function( elem ) {
  3773. return elem === elem.ownerDocument.activeElement;
  3774. }
  3775. },
  3776. setFilters: {
  3777. first: function( elem, i ) {
  3778. return i === 0;
  3779. },
  3780. last: function( elem, i, match, array ) {
  3781. return i === array.length - 1;
  3782. },
  3783. even: function( elem, i ) {
  3784. return i % 2 === 0;
  3785. },
  3786. odd: function( elem, i ) {
  3787. return i % 2 === 1;
  3788. },
  3789. lt: function( elem, i, match ) {
  3790. return i < match[3] - 0;
  3791. },
  3792. gt: function( elem, i, match ) {
  3793. return i > match[3] - 0;
  3794. },
  3795. nth: function( elem, i, match ) {
  3796. return match[3] - 0 === i;
  3797. },
  3798. eq: function( elem, i, match ) {
  3799. return match[3] - 0 === i;
  3800. }
  3801. },
  3802. filter: {
  3803. PSEUDO: function( elem, match, i, array ) {
  3804. var name = match[1],
  3805. filter = Expr.filters[ name ];
  3806. if ( filter ) {
  3807. return filter( elem, i, match, array );
  3808. } else if ( name === "contains" ) {
  3809. return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
  3810. } else if ( name === "not" ) {
  3811. var not = match[3];
  3812. for ( var j = 0, l = not.length; j < l; j++ ) {
  3813. if ( not[j] === elem ) {
  3814. return false;
  3815. }
  3816. }
  3817. return true;
  3818. } else {
  3819. Sizzle.error( name );
  3820. }
  3821. },
  3822. CHILD: function( elem, match ) {
  3823. var first, last,
  3824. doneName, parent, cache,
  3825. count, diff,
  3826. type = match[1],
  3827. node = elem;
  3828. switch ( type ) {
  3829. case "only":
  3830. case "first":
  3831. while ( (node = node.previousSibling) ) {
  3832. if ( node.nodeType === 1 ) {
  3833. return false;
  3834. }
  3835. }
  3836. if ( type === "first" ) {
  3837. return true;
  3838. }
  3839. node = elem;
  3840. case "last":
  3841. while ( (node = node.nextSibling) ) {
  3842. if ( node.nodeType === 1 ) {
  3843. return false;
  3844. }
  3845. }
  3846. return true;
  3847. case "nth":
  3848. first = match[2];
  3849. last = match[3];
  3850. if ( first === 1 && last === 0 ) {
  3851. return true;
  3852. }
  3853. doneName = match[0];
  3854. parent = elem.parentNode;
  3855. if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
  3856. count = 0;
  3857. for ( node = parent.firstChild; node; node = node.nextSibling ) {
  3858. if ( node.nodeType === 1 ) {
  3859. node.nodeIndex = ++count;
  3860. }
  3861. }
  3862. parent[ expando ] = doneName;
  3863. }
  3864. diff = elem.nodeIndex - last;
  3865. if ( first === 0 ) {
  3866. return diff === 0;
  3867. } else {
  3868. return ( diff % first === 0 && diff / first >= 0 );
  3869. }
  3870. }
  3871. },
  3872. ID: function( elem, match ) {
  3873. return elem.nodeType === 1 && elem.getAttribute("id") === match;
  3874. },
  3875. TAG: function( elem, match ) {
  3876. return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
  3877. },
  3878. CLASS: function( elem, match ) {
  3879. return (" " + (elem.className || elem.getAttribute("class")) + " ")
  3880. .indexOf( match ) > -1;
  3881. },
  3882. ATTR: function( elem, match ) {
  3883. var name = match[1],
  3884. result = Sizzle.attr ?
  3885. Sizzle.attr( elem, name ) :
  3886. Expr.attrHandle[ name ] ?
  3887. Expr.attrHandle[ name ]( elem ) :
  3888. elem[ name ] != null ?
  3889. elem[ name ] :
  3890. elem.getAttribute( name ),
  3891. value = result + "",
  3892. type = match[2],
  3893. check = match[4];
  3894. return result == null ?
  3895. type === "!=" :
  3896. !type && Sizzle.attr ?
  3897. result != null :
  3898. type === "=" ?
  3899. value === check :
  3900. type === "*=" ?
  3901. value.indexOf(check) >= 0 :
  3902. type === "~=" ?
  3903. (" " + value + " ").indexOf(check) >= 0 :
  3904. !check ?
  3905. value && result !== false :
  3906. type === "!=" ?
  3907. value !== check :
  3908. type === "^=" ?
  3909. value.indexOf(check) === 0 :
  3910. type === "$=" ?
  3911. value.substr(value.length - check.length) === check :
  3912. type === "|=" ?
  3913. value === check || value.substr(0, check.length + 1) === check + "-" :
  3914. false;
  3915. },
  3916. POS: function( elem, match, i, array ) {
  3917. var name = match[2],
  3918. filter = Expr.setFilters[ name ];
  3919. if ( filter ) {
  3920. return filter( elem, i, match, array );
  3921. }
  3922. }
  3923. }
  3924. };
  3925. var origPOS = Expr.match.POS,
  3926. fescape = function(all, num){
  3927. return "\\" + (num - 0 + 1);
  3928. };
  3929. for ( var type in Expr.match ) {
  3930. Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
  3931. Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
  3932. }
  3933. var makeArray = function( array, results ) {
  3934. array = Array.prototype.slice.call( array, 0 );
  3935. if ( results ) {
  3936. results.push.apply( results, array );
  3937. return results;
  3938. }
  3939. return array;
  3940. };
  3941. // Perform a simple check to determine if the browser is capable of
  3942. // converting a NodeList to an array using builtin methods.
  3943. // Also verifies that the returned array holds DOM nodes
  3944. // (which is not the case in the Blackberry browser)
  3945. try {
  3946. Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
  3947. // Provide a fallback method if it does not work
  3948. } catch( e ) {
  3949. makeArray = function( array, results ) {
  3950. var i = 0,
  3951. ret = results || [];
  3952. if ( toString.call(array) === "[object Array]" ) {
  3953. Array.prototype.push.apply( ret, array );
  3954. } else {
  3955. if ( typeof array.length === "number" ) {
  3956. for ( var l = array.length; i < l; i++ ) {
  3957. ret.push( array[i] );
  3958. }
  3959. } else {
  3960. for ( ; array[i]; i++ ) {
  3961. ret.push( array[i] );
  3962. }
  3963. }
  3964. }
  3965. return ret;
  3966. };
  3967. }
  3968. var sortOrder, siblingCheck;
  3969. if ( document.documentElement.compareDocumentPosition ) {
  3970. sortOrder = function( a, b ) {
  3971. if ( a === b ) {
  3972. hasDuplicate = true;
  3973. return 0;
  3974. }
  3975. if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
  3976. return a.compareDocumentPosition ? -1 : 1;
  3977. }
  3978. return a.compareDocumentPosition(b) & 4 ? -1 : 1;
  3979. };
  3980. } else {
  3981. sortOrder = function( a, b ) {
  3982. // The nodes are identical, we can exit early
  3983. if ( a === b ) {
  3984. hasDuplicate = true;
  3985. return 0;
  3986. // Fallback to using sourceIndex (in IE) if it's available on both nodes
  3987. } else if ( a.sourceIndex && b.sourceIndex ) {
  3988. return a.sourceIndex - b.sourceIndex;
  3989. }
  3990. var al, bl,
  3991. ap = [],
  3992. bp = [],
  3993. aup = a.parentNode,
  3994. bup = b.parentNode,
  3995. cur = aup;
  3996. // If the nodes are siblings (or identical) we can do a quick check
  3997. if ( aup === bup ) {
  3998. return siblingCheck( a, b );
  3999. // If no parents were found then the nodes are disconnected
  4000. } else if ( !aup ) {
  4001. return -1;
  4002. } else if ( !bup ) {
  4003. return 1;
  4004. }
  4005. // Otherwise they're somewhere else in the tree so we need
  4006. // to build up a full list of the parentNodes for comparison
  4007. while ( cur ) {
  4008. ap.unshift( cur );
  4009. cur = cur.parentNode;
  4010. }
  4011. cur = bup;
  4012. while ( cur ) {
  4013. bp.unshift( cur );
  4014. cur = cur.parentNode;
  4015. }
  4016. al = ap.length;
  4017. bl = bp.length;
  4018. // Start walking down the tree looking for a discrepancy
  4019. for ( var i = 0; i < al && i < bl; i++ ) {
  4020. if ( ap[i] !== bp[i] ) {
  4021. return siblingCheck( ap[i], bp[i] );
  4022. }
  4023. }
  4024. // We ended someplace up the tree so do a sibling check
  4025. return i === al ?
  4026. siblingCheck( a, bp[i], -1 ) :
  4027. siblingCheck( ap[i], b, 1 );
  4028. };
  4029. siblingCheck = function( a, b, ret ) {
  4030. if ( a === b ) {
  4031. return ret;
  4032. var cur = a.nextSibling;
  4033. }
  4034. while ( cur ) {
  4035. if ( cur === b ) {
  4036. return -1;
  4037. }
  4038. cur = cur.nextSibling;
  4039. }
  4040. return 1;
  4041. };
  4042. }
  4043. // Check to see if the browser returns elements by name when
  4044. // querying by getElementById (and provide a workaround)
  4045. (function(){
  4046. // We're going to inject a fake input element with a specified name
  4047. var form = document.createElement("div"),
  4048. id = "script" + (new Date()).getTime(),
  4049. root = document.documentElement;
  4050. form.innerHTML = "<a name='" + id + "'/>";
  4051. // Inject it into the root element, check its status, and remove it quickly
  4052. root.insertBefore( form, root.firstChild );
  4053. // The workaround has to do additional checks after a getElementById
  4054. // Which slows things down for other browsers (hence the branching)
  4055. if ( document.getElementById( id ) ) {
  4056. Expr.find.ID = function( match, context, isXML ) {
  4057. if ( typeof context.getElementById !== "undefined" && !isXML ) {
  4058. var m = context.getElementById(match[1]);
  4059. return m ?
  4060. m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
  4061. [m] :
  4062. undefined :
  4063. [];
  4064. }
  4065. };
  4066. Expr.filter.ID = function( elem, match ) {
  4067. var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  4068. return elem.nodeType === 1 && node && node.nodeValue === match;
  4069. };
  4070. }
  4071. root.removeChild( form );
  4072. // release memory in IE
  4073. root = form = null;
  4074. })();
  4075. (function(){
  4076. // Check to see if the browser returns only elements
  4077. // when doing getElementsByTagName("*")
  4078. // Create a fake element
  4079. var div = document.createElement("div");
  4080. div.appendChild( document.createComment("") );
  4081. // Make sure no comments are found
  4082. if ( div.getElementsByTagName("*").length > 0 ) {
  4083. Expr.find.TAG = function( match, context ) {
  4084. var results = context.getElementsByTagName( match[1] );
  4085. // Filter out possible comments
  4086. if ( match[1] === "*" ) {
  4087. var tmp = [];
  4088. for ( var i = 0; results[i]; i++ ) {
  4089. if ( results[i].nodeType === 1 ) {
  4090. tmp.push( results[i] );
  4091. }
  4092. }
  4093. results = tmp;
  4094. }
  4095. return results;
  4096. };
  4097. }
  4098. // Check to see if an attribute returns normalized href attributes
  4099. div.innerHTML = "<a href='#'></a>";
  4100. if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
  4101. div.firstChild.getAttribute("href") !== "#" ) {
  4102. Expr.attrHandle.href = function( elem ) {
  4103. return elem.getAttribute( "href", 2 );
  4104. };
  4105. }
  4106. // release memory in IE
  4107. div = null;
  4108. })();
  4109. if ( document.querySelectorAll ) {
  4110. (function(){
  4111. var oldSizzle = Sizzle,
  4112. div = document.createElement("div"),
  4113. id = "__sizzle__";
  4114. div.innerHTML = "<p class='TEST'></p>";
  4115. // Safari can't handle uppercase or unicode characters when
  4116. // in quirks mode.
  4117. if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
  4118. return;
  4119. }
  4120. Sizzle = function( query, context, extra, seed ) {
  4121. context = context || document;
  4122. // Only use querySelectorAll on non-XML documents
  4123. // (ID selectors don't work in non-HTML documents)
  4124. if ( !seed && !Sizzle.isXML(context) ) {
  4125. // See if we find a selector to speed up
  4126. var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
  4127. if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
  4128. // Speed-up: Sizzle("TAG")
  4129. if ( match[1] ) {
  4130. return makeArray( context.getElementsByTagName( query ), extra );
  4131. // Speed-up: Sizzle(".CLASS")
  4132. } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
  4133. return makeArray( context.getElementsByClassName( match[2] ), extra );
  4134. }
  4135. }
  4136. if ( context.nodeType === 9 ) {
  4137. // Speed-up: Sizzle("body")
  4138. // The body element only exists once, optimize finding it
  4139. if ( query === "body" && context.body ) {
  4140. return makeArray( [ context.body ], extra );
  4141. // Speed-up: Sizzle("#ID")
  4142. } else if ( match && match[3] ) {
  4143. var elem = context.getElementById( match[3] );
  4144. // Check parentNode to catch when Blackberry 4.6 returns
  4145. // nodes that are no longer in the document #6963
  4146. if ( elem && elem.parentNode ) {
  4147. // Handle the case where IE and Opera return items
  4148. // by name instead of ID
  4149. if ( elem.id === match[3] ) {
  4150. return makeArray( [ elem ], extra );
  4151. }
  4152. } else {
  4153. return makeArray( [], extra );
  4154. }
  4155. }
  4156. try {
  4157. return makeArray( context.querySelectorAll(query), extra );
  4158. } catch(qsaError) {}
  4159. // qSA works strangely on Element-rooted queries
  4160. // We can work around this by specifying an extra ID on the root
  4161. // and working up from there (Thanks to Andrew Dupont for the technique)
  4162. // IE 8 doesn't work on object elements
  4163. } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
  4164. var oldContext = context,
  4165. old = context.getAttribute( "id" ),
  4166. nid = old || id,
  4167. hasParent = context.parentNode,
  4168. relativeHierarchySelector = /^\s*[+~]/.test( query );
  4169. if ( !old ) {
  4170. context.setAttribute( "id", nid );
  4171. } else {
  4172. nid = nid.replace( /'/g, "\\$&" );
  4173. }
  4174. if ( relativeHierarchySelector && hasParent ) {
  4175. context = context.parentNode;
  4176. }
  4177. try {
  4178. if ( !relativeHierarchySelector || hasParent ) {
  4179. return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
  4180. }
  4181. } catch(pseudoError) {
  4182. } finally {
  4183. if ( !old ) {
  4184. oldContext.removeAttribute( "id" );
  4185. }
  4186. }
  4187. }
  4188. }
  4189. return oldSizzle(query, context, extra, seed);
  4190. };
  4191. for ( var prop in oldSizzle ) {
  4192. Sizzle[ prop ] = oldSizzle[ prop ];
  4193. }
  4194. // release memory in IE
  4195. div = null;
  4196. })();
  4197. }
  4198. (function(){
  4199. var html = document.documentElement,
  4200. matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
  4201. if ( matches ) {
  4202. // Check to see if it's possible to do matchesSelector
  4203. // on a disconnected node (IE 9 fails this)
  4204. var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
  4205. pseudoWorks = false;
  4206. try {
  4207. // This should fail with an exception
  4208. // Gecko does not error, returns false instead
  4209. matches.call( document.documentElement, "[test!='']:sizzle" );
  4210. } catch( pseudoError ) {
  4211. pseudoWorks = true;
  4212. }
  4213. Sizzle.matchesSelector = function( node, expr ) {
  4214. // Make sure that attribute selectors are quoted
  4215. expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
  4216. if ( !Sizzle.isXML( node ) ) {
  4217. try {
  4218. if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
  4219. var ret = matches.call( node, expr );
  4220. // IE 9's matchesSelector returns false on disconnected nodes
  4221. if ( ret || !disconnectedMatch ||
  4222. // As well, disconnected nodes are said to be in a document
  4223. // fragment in IE 9, so check for that
  4224. node.document && node.document.nodeType !== 11 ) {
  4225. return ret;
  4226. }
  4227. }
  4228. } catch(e) {}
  4229. }
  4230. return Sizzle(expr, null, null, [node]).length > 0;
  4231. };
  4232. }
  4233. })();
  4234. (function(){
  4235. var div = document.createElement("div");
  4236. div.innerHTML = "<div class='test e'></div><div class='test'></div>";
  4237. // Opera can't find a second classname (in 9.6)
  4238. // Also, make sure that getElementsByClassName actually exists
  4239. if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
  4240. return;
  4241. }
  4242. // Safari caches class attributes, doesn't catch changes (in 3.2)
  4243. div.lastChild.className = "e";
  4244. if ( div.getElementsByClassName("e").length === 1 ) {
  4245. return;
  4246. }
  4247. Expr.order.splice(1, 0, "CLASS");
  4248. Expr.find.CLASS = function( match, context, isXML ) {
  4249. if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
  4250. return context.getElementsByClassName(match[1]);
  4251. }
  4252. };
  4253. // release memory in IE
  4254. div = null;
  4255. })();
  4256. function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
  4257. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  4258. var elem = checkSet[i];
  4259. if ( elem ) {
  4260. var match = false;
  4261. elem = elem[dir];
  4262. while ( elem ) {
  4263. if ( elem[ expando ] === doneName ) {
  4264. match = checkSet[elem.sizset];
  4265. break;
  4266. }
  4267. if ( elem.nodeType === 1 && !isXML ){
  4268. elem[ expando ] = doneName;
  4269. elem.sizset = i;
  4270. }
  4271. if ( elem.nodeName.toLowerCase() === cur ) {
  4272. match = elem;
  4273. break;
  4274. }
  4275. elem = elem[dir];
  4276. }
  4277. checkSet[i] = match;
  4278. }
  4279. }
  4280. }
  4281. function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
  4282. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  4283. var elem = checkSet[i];
  4284. if ( elem ) {
  4285. var match = false;
  4286. elem = elem[dir];
  4287. while ( elem ) {
  4288. if ( elem[ expando ] === doneName ) {
  4289. match = checkSet[elem.sizset];
  4290. break;
  4291. }
  4292. if ( elem.nodeType === 1 ) {
  4293. if ( !isXML ) {
  4294. elem[ expando ] = doneName;
  4295. elem.sizset = i;
  4296. }
  4297. if ( typeof cur !== "string" ) {
  4298. if ( elem === cur ) {
  4299. match = true;
  4300. break;
  4301. }
  4302. } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
  4303. match = elem;
  4304. break;
  4305. }
  4306. }
  4307. elem = elem[dir];
  4308. }
  4309. checkSet[i] = match;
  4310. }
  4311. }
  4312. }
  4313. if ( document.documentElement.contains ) {
  4314. Sizzle.contains = function( a, b ) {
  4315. return a !== b && (a.contains ? a.contains(b) : true);
  4316. };
  4317. } else if ( document.documentElement.compareDocumentPosition ) {
  4318. Sizzle.contains = function( a, b ) {
  4319. return !!(a.compareDocumentPosition(b) & 16);
  4320. };
  4321. } else {
  4322. Sizzle.contains = function() {
  4323. return false;
  4324. };
  4325. }
  4326. Sizzle.isXML = function( elem ) {
  4327. // documentElement is verified for cases where it doesn't yet exist
  4328. // (such as loading iframes in IE - #4833)
  4329. var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
  4330. return documentElement ? documentElement.nodeName !== "HTML" : false;
  4331. };
  4332. var posProcess = function( selector, context, seed ) {
  4333. var match,
  4334. tmpSet = [],
  4335. later = "",
  4336. root = context.nodeType ? [context] : context;
  4337. // Position selectors must be done after the filter
  4338. // And so must :not(positional) so we move all PSEUDOs to the end
  4339. while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
  4340. later += match[0];
  4341. selector = selector.replace( Expr.match.PSEUDO, "" );
  4342. }
  4343. selector = Expr.relative[selector] ? selector + "*" : selector;
  4344. for ( var i = 0, l = root.length; i < l; i++ ) {
  4345. Sizzle( selector, root[i], tmpSet, seed );
  4346. }
  4347. return Sizzle.filter( later, tmpSet );
  4348. };
  4349. // EXPOSE
  4350. // Override sizzle attribute retrieval
  4351. Sizzle.attr = jQuery.attr;
  4352. Sizzle.selectors.attrMap = {};
  4353. jQuery.find = Sizzle;
  4354. jQuery.expr = Sizzle.selectors;
  4355. jQuery.expr[":"] = jQuery.expr.filters;
  4356. jQuery.unique = Sizzle.uniqueSort;
  4357. jQuery.text = Sizzle.getText;
  4358. jQuery.isXMLDoc = Sizzle.isXML;
  4359. jQuery.contains = Sizzle.contains;
  4360. })();
  4361. var runtil = /Until$/,
  4362. rparentsprev = /^(?:parents|prevUntil|prevAll)/,
  4363. // Note: This RegExp should be improved, or likely pulled from Sizzle
  4364. rmultiselector = /,/,
  4365. isSimple = /^.[^:#\[\.,]*$/,
  4366. slice = Array.prototype.slice,
  4367. POS = jQuery.expr.match.POS,
  4368. // methods guaranteed to produce a unique set when starting from a unique set
  4369. guaranteedUnique = {
  4370. children: true,
  4371. contents: true,
  4372. next: true,
  4373. prev: true
  4374. };
  4375. jQuery.fn.extend({
  4376. find: function( selector ) {
  4377. var self = this,
  4378. i, l;
  4379. if ( typeof selector !== "string" ) {
  4380. return jQuery( selector ).filter(function() {
  4381. for ( i = 0, l = self.length; i < l; i++ ) {
  4382. if ( jQuery.contains( self[ i ], this ) ) {
  4383. return true;
  4384. }
  4385. }
  4386. });
  4387. }
  4388. var ret = this.pushStack( "", "find", selector ),
  4389. length, n, r;
  4390. for ( i = 0, l = this.length; i < l; i++ ) {
  4391. length = ret.length;
  4392. jQuery.find( selector, this[i], ret );
  4393. if ( i > 0 ) {
  4394. // Make sure that the results are unique
  4395. for ( n = length; n < ret.length; n++ ) {
  4396. for ( r = 0; r < length; r++ ) {
  4397. if ( ret[r] === ret[n] ) {
  4398. ret.splice(n--, 1);
  4399. break;
  4400. }
  4401. }
  4402. }
  4403. }
  4404. }
  4405. return ret;
  4406. },
  4407. has: function( target ) {
  4408. var targets = jQuery( target );
  4409. return this.filter(function() {
  4410. for ( var i = 0, l = targets.length; i < l; i++ ) {
  4411. if ( jQuery.contains( this, targets[i] ) ) {
  4412. return true;
  4413. }
  4414. }
  4415. });
  4416. },
  4417. not: function( selector ) {
  4418. return this.pushStack( winnow(this, selector, false), "not", selector);
  4419. },
  4420. filter: function( selector ) {
  4421. return this.pushStack( winnow(this, selector, true), "filter", selector );
  4422. },
  4423. is: function( selector ) {
  4424. return !!selector && (
  4425. typeof selector === "string" ?
  4426. // If this is a positional selector, check membership in the returned set
  4427. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  4428. POS.test( selector ) ?
  4429. jQuery( selector, this.context ).index( this[0] ) >= 0 :
  4430. jQuery.filter( selector, this ).length > 0 :
  4431. this.filter( selector ).length > 0 );
  4432. },
  4433. closest: function( selectors, context ) {
  4434. var ret = [], i, l, cur = this[0];
  4435. // Array (deprecated as of jQuery 1.7)
  4436. if ( jQuery.isArray( selectors ) ) {
  4437. var level = 1;
  4438. while ( cur && cur.ownerDocument && cur !== context ) {
  4439. for ( i = 0; i < selectors.length; i++ ) {
  4440. if ( jQuery( cur ).is( selectors[ i ] ) ) {
  4441. ret.push({ selector: selectors[ i ], elem: cur, level: level });
  4442. }
  4443. }
  4444. cur = cur.parentNode;
  4445. level++;
  4446. }
  4447. return ret;
  4448. }
  4449. // String
  4450. var pos = POS.test( selectors ) || typeof selectors !== "string" ?
  4451. jQuery( selectors, context || this.context ) :
  4452. 0;
  4453. for ( i = 0, l = this.length; i < l; i++ ) {
  4454. cur = this[i];
  4455. while ( cur ) {
  4456. if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
  4457. ret.push( cur );
  4458. break;
  4459. } else {
  4460. cur = cur.parentNode;
  4461. if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
  4462. break;
  4463. }
  4464. }
  4465. }
  4466. }
  4467. ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
  4468. return this.pushStack( ret, "closest", selectors );
  4469. },
  4470. // Determine the position of an element within
  4471. // the matched set of elements
  4472. index: function( elem ) {
  4473. // No argument, return index in parent
  4474. if ( !elem ) {
  4475. return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
  4476. }
  4477. // index in selector
  4478. if ( typeof elem === "string" ) {
  4479. return jQuery.inArray( this[0], jQuery( elem ) );
  4480. }
  4481. // Locate the position of the desired element
  4482. return jQuery.inArray(
  4483. // If it receives a jQuery object, the first element is used
  4484. elem.jquery ? elem[0] : elem, this );
  4485. },
  4486. add: function( selector, context ) {
  4487. var set = typeof selector === "string" ?
  4488. jQuery( selector, context ) :
  4489. jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
  4490. all = jQuery.merge( this.get(), set );
  4491. return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
  4492. all :
  4493. jQuery.unique( all ) );
  4494. },
  4495. andSelf: function() {
  4496. return this.add( this.prevObject );
  4497. }
  4498. });
  4499. // A painfully simple check to see if an element is disconnected
  4500. // from a document (should be improved, where feasible).
  4501. function isDisconnected( node ) {
  4502. return !node || !node.parentNode || node.parentNode.nodeType === 11;
  4503. }
  4504. jQuery.each({
  4505. parent: function( elem ) {
  4506. var parent = elem.parentNode;
  4507. return parent && parent.nodeType !== 11 ? parent : null;
  4508. },
  4509. parents: function( elem ) {
  4510. return jQuery.dir( elem, "parentNode" );
  4511. },
  4512. parentsUntil: function( elem, i, until ) {
  4513. return jQuery.dir( elem, "parentNode", until );
  4514. },
  4515. next: function( elem ) {
  4516. return jQuery.nth( elem, 2, "nextSibling" );
  4517. },
  4518. prev: function( elem ) {
  4519. return jQuery.nth( elem, 2, "previousSibling" );
  4520. },
  4521. nextAll: function( elem ) {
  4522. return jQuery.dir( elem, "nextSibling" );
  4523. },
  4524. prevAll: function( elem ) {
  4525. return jQuery.dir( elem, "previousSibling" );
  4526. },
  4527. nextUntil: function( elem, i, until ) {
  4528. return jQuery.dir( elem, "nextSibling", until );
  4529. },
  4530. prevUntil: function( elem, i, until ) {
  4531. return jQuery.dir( elem, "previousSibling", until );
  4532. },
  4533. siblings: function( elem ) {
  4534. return jQuery.sibling( elem.parentNode.firstChild, elem );
  4535. },
  4536. children: function( elem ) {
  4537. return jQuery.sibling( elem.firstChild );
  4538. },
  4539. contents: function( elem ) {
  4540. return jQuery.nodeName( elem, "iframe" ) ?
  4541. elem.contentDocument || elem.contentWindow.document :
  4542. jQuery.makeArray( elem.childNodes );
  4543. }
  4544. }, function( name, fn ) {
  4545. jQuery.fn[ name ] = function( until, selector ) {
  4546. var ret = jQuery.map( this, fn, until );
  4547. if ( !runtil.test( name ) ) {
  4548. selector = until;
  4549. }
  4550. if ( selector && typeof selector === "string" ) {
  4551. ret = jQuery.filter( selector, ret );
  4552. }
  4553. ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
  4554. if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
  4555. ret = ret.reverse();
  4556. }
  4557. return this.pushStack( ret, name, slice.call( arguments ).join(",") );
  4558. };
  4559. });
  4560. jQuery.extend({
  4561. filter: function( expr, elems, not ) {
  4562. if ( not ) {
  4563. expr = ":not(" + expr + ")";
  4564. }
  4565. return elems.length === 1 ?
  4566. jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
  4567. jQuery.find.matches(expr, elems);
  4568. },
  4569. dir: function( elem, dir, until ) {
  4570. var matched = [],
  4571. cur = elem[ dir ];
  4572. while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
  4573. if ( cur.nodeType === 1 ) {
  4574. matched.push( cur );
  4575. }
  4576. cur = cur[dir];
  4577. }
  4578. return matched;
  4579. },
  4580. nth: function( cur, result, dir, elem ) {
  4581. result = result || 1;
  4582. var num = 0;
  4583. for ( ; cur; cur = cur[dir] ) {
  4584. if ( cur.nodeType === 1 && ++num === result ) {
  4585. break;
  4586. }
  4587. }
  4588. return cur;
  4589. },
  4590. sibling: function( n, elem ) {
  4591. var r = [];
  4592. for ( ; n; n = n.nextSibling ) {
  4593. if ( n.nodeType === 1 && n !== elem ) {
  4594. r.push( n );
  4595. }
  4596. }
  4597. return r;
  4598. }
  4599. });
  4600. // Implement the identical functionality for filter and not
  4601. function winnow( elements, qualifier, keep ) {
  4602. // Can't pass null or undefined to indexOf in Firefox 4
  4603. // Set to 0 to skip string check
  4604. qualifier = qualifier || 0;
  4605. if ( jQuery.isFunction( qualifier ) ) {
  4606. return jQuery.grep(elements, function( elem, i ) {
  4607. var retVal = !!qualifier.call( elem, i, elem );
  4608. return retVal === keep;
  4609. });
  4610. } else if ( qualifier.nodeType ) {
  4611. return jQuery.grep(elements, function( elem, i ) {
  4612. return ( elem === qualifier ) === keep;
  4613. });
  4614. } else if ( typeof qualifier === "string" ) {
  4615. var filtered = jQuery.grep(elements, function( elem ) {
  4616. return elem.nodeType === 1;
  4617. });
  4618. if ( isSimple.test( qualifier ) ) {
  4619. return jQuery.filter(qualifier, filtered, !keep);
  4620. } else {
  4621. qualifier = jQuery.filter( qualifier, filtered );
  4622. }
  4623. }
  4624. return jQuery.grep(elements, function( elem, i ) {
  4625. return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
  4626. });
  4627. }
  4628. function createSafeFragment( document ) {
  4629. var list = nodeNames.split( "|" ),
  4630. safeFrag = document.createDocumentFragment();
  4631. if ( safeFrag.createElement ) {
  4632. while ( list.length ) {
  4633. safeFrag.createElement(
  4634. list.pop()
  4635. );
  4636. }
  4637. }
  4638. return safeFrag;
  4639. }
  4640. var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" +
  4641. "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
  4642. rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
  4643. rleadingWhitespace = /^\s+/,
  4644. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
  4645. rtagName = /<([\w:]+)/,
  4646. rtbody = /<tbody/i,
  4647. rhtml = /<|&#?\w+;/,
  4648. rnoInnerhtml = /<(?:script|style)/i,
  4649. rnocache = /<(?:script|object|embed|option|style)/i,
  4650. rnoshimcache = new RegExp("<(?:" + nodeNames + ")", "i"),
  4651. // checked="checked" or checked
  4652. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4653. rscriptType = /\/(java|ecma)script/i,
  4654. rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
  4655. wrapMap = {
  4656. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  4657. legend: [ 1, "<fieldset>", "</fieldset>" ],
  4658. thead: [ 1, "<table>", "</table>" ],
  4659. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  4660. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  4661. col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
  4662. area: [ 1, "<map>", "</map>" ],
  4663. _default: [ 0, "", "" ]
  4664. },
  4665. safeFragment = createSafeFragment( document );
  4666. wrapMap.optgroup = wrapMap.option;
  4667. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  4668. wrapMap.th = wrapMap.td;
  4669. // IE can't serialize <link> and <script> tags normally
  4670. if ( !jQuery.support.htmlSerialize ) {
  4671. wrapMap._default = [ 1, "div<div>", "</div>" ];
  4672. }
  4673. jQuery.fn.extend({
  4674. text: function( text ) {
  4675. if ( jQuery.isFunction(text) ) {
  4676. return this.each(function(i) {
  4677. var self = jQuery( this );
  4678. self.text( text.call(this, i, self.text()) );
  4679. });
  4680. }
  4681. if ( typeof text !== "object" && text !== undefined ) {
  4682. return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
  4683. }
  4684. return jQuery.text( this );
  4685. },
  4686. wrapAll: function( html ) {
  4687. if ( jQuery.isFunction( html ) ) {
  4688. return this.each(function(i) {
  4689. jQuery(this).wrapAll( html.call(this, i) );
  4690. });
  4691. }
  4692. if ( this[0] ) {
  4693. // The elements to wrap the target around
  4694. var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
  4695. if ( this[0].parentNode ) {
  4696. wrap.insertBefore( this[0] );
  4697. }
  4698. wrap.map(function() {
  4699. var elem = this;
  4700. while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
  4701. elem = elem.firstChild;
  4702. }
  4703. return elem;
  4704. }).append( this );
  4705. }
  4706. return this;
  4707. },
  4708. wrapInner: function( html ) {
  4709. if ( jQuery.isFunction( html ) ) {
  4710. return this.each(function(i) {
  4711. jQuery(this).wrapInner( html.call(this, i) );
  4712. });
  4713. }
  4714. return this.each(function() {
  4715. var self = jQuery( this ),
  4716. contents = self.contents();
  4717. if ( contents.length ) {
  4718. contents.wrapAll( html );
  4719. } else {
  4720. self.append( html );
  4721. }
  4722. });
  4723. },
  4724. wrap: function( html ) {
  4725. var isFunction = jQuery.isFunction( html );
  4726. return this.each(function(i) {
  4727. jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
  4728. });
  4729. },
  4730. unwrap: function() {
  4731. return this.parent().each(function() {
  4732. if ( !jQuery.nodeName( this, "body" ) ) {
  4733. jQuery( this ).replaceWith( this.childNodes );
  4734. }
  4735. }).end();
  4736. },
  4737. append: function() {
  4738. return this.domManip(arguments, true, function( elem ) {
  4739. if ( this.nodeType === 1 ) {
  4740. this.appendChild( elem );
  4741. }
  4742. });
  4743. },
  4744. prepend: function() {
  4745. return this.domManip(arguments, true, function( elem ) {
  4746. if ( this.nodeType === 1 ) {
  4747. this.insertBefore( elem, this.firstChild );
  4748. }
  4749. });
  4750. },
  4751. before: function() {
  4752. if ( this[0] && this[0].parentNode ) {
  4753. return this.domManip(arguments, false, function( elem ) {
  4754. this.parentNode.insertBefore( elem, this );
  4755. });
  4756. } else if ( arguments.length ) {
  4757. var set = jQuery.clean( arguments );
  4758. set.push.apply( set, this.toArray() );
  4759. return this.pushStack( set, "before", arguments );
  4760. }
  4761. },
  4762. after: function() {
  4763. if ( this[0] && this[0].parentNode ) {
  4764. return this.domManip(arguments, false, function( elem ) {
  4765. this.parentNode.insertBefore( elem, this.nextSibling );
  4766. });
  4767. } else if ( arguments.length ) {
  4768. var set = this.pushStack( this, "after", arguments );
  4769. set.push.apply( set, jQuery.clean(arguments) );
  4770. return set;
  4771. }
  4772. },
  4773. // keepData is for internal use only--do not document
  4774. remove: function( selector, keepData ) {
  4775. for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
  4776. if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
  4777. if ( !keepData && elem.nodeType === 1 ) {
  4778. jQuery.cleanData( elem.getElementsByTagName("*") );
  4779. jQuery.cleanData( [ elem ] );
  4780. }
  4781. if ( elem.parentNode ) {
  4782. elem.parentNode.removeChild( elem );
  4783. }
  4784. }
  4785. }
  4786. return this;
  4787. },
  4788. empty: function() {
  4789. for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
  4790. // Remove element nodes and prevent memory leaks
  4791. if ( elem.nodeType === 1 ) {
  4792. jQuery.cleanData( elem.getElementsByTagName("*") );
  4793. }
  4794. // Remove any remaining nodes
  4795. while ( elem.firstChild ) {
  4796. elem.removeChild( elem.firstChild );
  4797. }
  4798. }
  4799. return this;
  4800. },
  4801. clone: function( dataAndEvents, deepDataAndEvents ) {
  4802. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  4803. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  4804. return this.map( function () {
  4805. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  4806. });
  4807. },
  4808. html: function( value ) {
  4809. if ( value === undefined ) {
  4810. return this[0] && this[0].nodeType === 1 ?
  4811. this[0].innerHTML.replace(rinlinejQuery, "") :
  4812. null;
  4813. // See if we can take a shortcut and just use innerHTML
  4814. } else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  4815. (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
  4816. !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
  4817. value = value.replace(rxhtmlTag, "<$1></$2>");
  4818. try {
  4819. for ( var i = 0, l = this.length; i < l; i++ ) {
  4820. // Remove element nodes and prevent memory leaks
  4821. if ( this[i].nodeType === 1 ) {
  4822. jQuery.cleanData( this[i].getElementsByTagName("*") );
  4823. this[i].innerHTML = value;
  4824. }
  4825. }
  4826. // If using innerHTML throws an exception, use the fallback method
  4827. } catch(e) {
  4828. this.empty().append( value );
  4829. }
  4830. } else if ( jQuery.isFunction( value ) ) {
  4831. this.each(function(i){
  4832. var self = jQuery( this );
  4833. self.html( value.call(this, i, self.html()) );
  4834. });
  4835. } else {
  4836. this.empty().append( value );
  4837. }
  4838. return this;
  4839. },
  4840. replaceWith: function( value ) {
  4841. if ( this[0] && this[0].parentNode ) {
  4842. // Make sure that the elements are removed from the DOM before they are inserted
  4843. // this can help fix replacing a parent with child elements
  4844. if ( jQuery.isFunction( value ) ) {
  4845. return this.each(function(i) {
  4846. var self = jQuery(this), old = self.html();
  4847. self.replaceWith( value.call( this, i, old ) );
  4848. });
  4849. }
  4850. if ( typeof value !== "string" ) {
  4851. value = jQuery( value ).detach();
  4852. }
  4853. return this.each(function() {
  4854. var next = this.nextSibling,
  4855. parent = this.parentNode;
  4856. jQuery( this ).remove();
  4857. if ( next ) {
  4858. jQuery(next).before( value );
  4859. } else {
  4860. jQuery(parent).append( value );
  4861. }
  4862. });
  4863. } else {
  4864. return this.length ?
  4865. this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
  4866. this;
  4867. }
  4868. },
  4869. detach: function( selector ) {
  4870. return this.remove( selector, true );
  4871. },
  4872. domManip: function( args, table, callback ) {
  4873. var results, first, fragment, parent,
  4874. value = args[0],
  4875. scripts = [];
  4876. // We can't cloneNode fragments that contain checked, in WebKit
  4877. if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
  4878. return this.each(function() {
  4879. jQuery(this).domManip( args, table, callback, true );
  4880. });
  4881. }
  4882. if ( jQuery.isFunction(value) ) {
  4883. return this.each(function(i) {
  4884. var self = jQuery(this);
  4885. args[0] = value.call(this, i, table ? self.html() : undefined);
  4886. self.domManip( args, table, callback );
  4887. });
  4888. }
  4889. if ( this[0] ) {
  4890. parent = value && value.parentNode;
  4891. // If we're in a fragment, just use that instead of building a new one
  4892. if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
  4893. results = { fragment: parent };
  4894. } else {
  4895. results = jQuery.buildFragment( args, this, scripts );
  4896. }
  4897. fragment = results.fragment;
  4898. if ( fragment.childNodes.length === 1 ) {
  4899. first = fragment = fragment.firstChild;
  4900. } else {
  4901. first = fragment.firstChild;
  4902. }
  4903. if ( first ) {
  4904. table = table && jQuery.nodeName( first, "tr" );
  4905. for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
  4906. callback.call(
  4907. table ?
  4908. root(this[i], first) :
  4909. this[i],
  4910. // Make sure that we do not leak memory by inadvertently discarding
  4911. // the original fragment (which might have attached data) instead of
  4912. // using it; in addition, use the original fragment object for the last
  4913. // item instead of first because it can end up being emptied incorrectly
  4914. // in certain situations (Bug #8070).
  4915. // Fragments from the fragment cache must always be cloned and never used
  4916. // in place.
  4917. results.cacheable || ( l > 1 && i < lastIndex ) ?
  4918. jQuery.clone( fragment, true, true ) :
  4919. fragment
  4920. );
  4921. }
  4922. }
  4923. if ( scripts.length ) {
  4924. jQuery.each( scripts, evalScript );
  4925. }
  4926. }
  4927. return this;
  4928. }
  4929. });
  4930. function root( elem, cur ) {
  4931. return jQuery.nodeName(elem, "table") ?
  4932. (elem.getElementsByTagName("tbody")[0] ||
  4933. elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
  4934. elem;
  4935. }
  4936. function cloneCopyEvent( src, dest ) {
  4937. if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
  4938. return;
  4939. }
  4940. var type, i, l,
  4941. oldData = jQuery._data( src ),
  4942. curData = jQuery._data( dest, oldData ),
  4943. events = oldData.events;
  4944. if ( events ) {
  4945. delete curData.handle;
  4946. curData.events = {};
  4947. for ( type in events ) {
  4948. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4949. jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
  4950. }
  4951. }
  4952. }
  4953. // make the cloned public data object a copy from the original
  4954. if ( curData.data ) {
  4955. curData.data = jQuery.extend( {}, curData.data );
  4956. }
  4957. }
  4958. function cloneFixAttributes( src, dest ) {
  4959. var nodeName;
  4960. // We do not need to do anything for non-Elements
  4961. if ( dest.nodeType !== 1 ) {
  4962. return;
  4963. }
  4964. // clearAttributes removes the attributes, which we don't want,
  4965. // but also removes the attachEvent events, which we *do* want
  4966. if ( dest.clearAttributes ) {
  4967. dest.clearAttributes();
  4968. }
  4969. // mergeAttributes, in contrast, only merges back on the
  4970. // original attributes, not the events
  4971. if ( dest.mergeAttributes ) {
  4972. dest.mergeAttributes( src );
  4973. }
  4974. nodeName = dest.nodeName.toLowerCase();
  4975. // IE6-8 fail to clone children inside object elements that use
  4976. // the proprietary classid attribute value (rather than the type
  4977. // attribute) to identify the type of content to display
  4978. if ( nodeName === "object" ) {
  4979. dest.outerHTML = src.outerHTML;
  4980. } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
  4981. // IE6-8 fails to persist the checked state of a cloned checkbox
  4982. // or radio button. Worse, IE6-7 fail to give the cloned element
  4983. // a checked appearance if the defaultChecked value isn't also set
  4984. if ( src.checked ) {
  4985. dest.defaultChecked = dest.checked = src.checked;
  4986. }
  4987. // IE6-7 get confused and end up setting the value of a cloned
  4988. // checkbox/radio button to an empty string instead of "on"
  4989. if ( dest.value !== src.value ) {
  4990. dest.value = src.value;
  4991. }
  4992. // IE6-8 fails to return the selected option to the default selected
  4993. // state when cloning options
  4994. } else if ( nodeName === "option" ) {
  4995. dest.selected = src.defaultSelected;
  4996. // IE6-8 fails to set the defaultValue to the correct value when
  4997. // cloning other types of input fields
  4998. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4999. dest.defaultValue = src.defaultValue;
  5000. }
  5001. // Event data gets referenced instead of copied if the expando
  5002. // gets copied too
  5003. dest.removeAttribute( jQuery.expando );
  5004. }
  5005. jQuery.buildFragment = function( args, nodes, scripts ) {
  5006. var fragment, cacheable, cacheresults, doc,
  5007. first = args[ 0 ];
  5008. // nodes may contain either an explicit document object,
  5009. // a jQuery collection or context object.
  5010. // If nodes[0] contains a valid object to assign to doc
  5011. if ( nodes && nodes[0] ) {
  5012. doc = nodes[0].ownerDocument || nodes[0];
  5013. }
  5014. // Ensure that an attr object doesn't incorrectly stand in as a document object
  5015. // Chrome and Firefox seem to allow this to occur and will throw exception
  5016. // Fixes #8950
  5017. if ( !doc.createDocumentFragment ) {
  5018. doc = document;
  5019. }
  5020. // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
  5021. // Cloning options loses the selected state, so don't cache them
  5022. // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
  5023. // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
  5024. // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
  5025. if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
  5026. first.charAt(0) === "<" && !rnocache.test( first ) &&
  5027. (jQuery.support.checkClone || !rchecked.test( first )) &&
  5028. (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
  5029. cacheable = true;
  5030. cacheresults = jQuery.fragments[ first ];
  5031. if ( cacheresults && cacheresults !== 1 ) {
  5032. fragment = cacheresults;
  5033. }
  5034. }
  5035. if ( !fragment ) {
  5036. fragment = doc.createDocumentFragment();
  5037. jQuery.clean( args, doc, fragment, scripts );
  5038. }
  5039. if ( cacheable ) {
  5040. jQuery.fragments[ first ] = cacheresults ? fragment : 1;
  5041. }
  5042. return { fragment: fragment, cacheable: cacheable };
  5043. };
  5044. jQuery.fragments = {};
  5045. jQuery.each({
  5046. appendTo: "append",
  5047. prependTo: "prepend",
  5048. insertBefore: "before",
  5049. insertAfter: "after",
  5050. replaceAll: "replaceWith"
  5051. }, function( name, original ) {
  5052. jQuery.fn[ name ] = function( selector ) {
  5053. var ret = [],
  5054. insert = jQuery( selector ),
  5055. parent = this.length === 1 && this[0].parentNode;
  5056. if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
  5057. insert[ original ]( this[0] );
  5058. return this;
  5059. } else {
  5060. for ( var i = 0, l = insert.length; i < l; i++ ) {
  5061. var elems = ( i > 0 ? this.clone(true) : this ).get();
  5062. jQuery( insert[i] )[ original ]( elems );
  5063. ret = ret.concat( elems );
  5064. }
  5065. return this.pushStack( ret, name, insert.selector );
  5066. }
  5067. };
  5068. });
  5069. function getAll( elem ) {
  5070. if ( typeof elem.getElementsByTagName !== "undefined" ) {
  5071. return elem.getElementsByTagName( "*" );
  5072. } else if ( typeof elem.querySelectorAll !== "undefined" ) {
  5073. return elem.querySelectorAll( "*" );
  5074. } else {
  5075. return [];
  5076. }
  5077. }
  5078. // Used in clean, fixes the defaultChecked property
  5079. function fixDefaultChecked( elem ) {
  5080. if ( elem.type === "checkbox" || elem.type === "radio" ) {
  5081. elem.defaultChecked = elem.checked;
  5082. }
  5083. }
  5084. // Finds all inputs and passes them to fixDefaultChecked
  5085. function findInputs( elem ) {
  5086. var nodeName = ( elem.nodeName || "" ).toLowerCase();
  5087. if ( nodeName === "input" ) {
  5088. fixDefaultChecked( elem );
  5089. // Skip scripts, get other children
  5090. } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
  5091. jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
  5092. }
  5093. }
  5094. // Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
  5095. function shimCloneNode( elem ) {
  5096. var div = document.createElement( "div" );
  5097. safeFragment.appendChild( div );
  5098. div.innerHTML = elem.outerHTML;
  5099. return div.firstChild;
  5100. }
  5101. jQuery.extend({
  5102. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  5103. var srcElements,
  5104. destElements,
  5105. i,
  5106. // IE<=8 does not properly clone detached, unknown element nodes
  5107. clone = jQuery.support.html5Clone || !rnoshimcache.test( "<" + elem.nodeName ) ?
  5108. elem.cloneNode( true ) :
  5109. shimCloneNode( elem );
  5110. if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
  5111. (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
  5112. // IE copies events bound via attachEvent when using cloneNode.
  5113. // Calling detachEvent on the clone will also remove the events
  5114. // from the original. In order to get around this, we use some
  5115. // proprietary methods to clear the events. Thanks to MooTools
  5116. // guys for this hotness.
  5117. cloneFixAttributes( elem, clone );
  5118. // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
  5119. srcElements = getAll( elem );
  5120. destElements = getAll( clone );
  5121. // Weird iteration because IE will replace the length property
  5122. // with an element if you are cloning the body and one of the
  5123. // elements on the page has a name or id of "length"
  5124. for ( i = 0; srcElements[i]; ++i ) {
  5125. // Ensure that the destination node is not null; Fixes #9587
  5126. if ( destElements[i] ) {
  5127. cloneFixAttributes( srcElements[i], destElements[i] );
  5128. }
  5129. }
  5130. }
  5131. // Copy the events from the original to the clone
  5132. if ( dataAndEvents ) {
  5133. cloneCopyEvent( elem, clone );
  5134. if ( deepDataAndEvents ) {
  5135. srcElements = getAll( elem );
  5136. destElements = getAll( clone );
  5137. for ( i = 0; srcElements[i]; ++i ) {
  5138. cloneCopyEvent( srcElements[i], destElements[i] );
  5139. }
  5140. }
  5141. }
  5142. srcElements = destElements = null;
  5143. // Return the cloned set
  5144. return clone;
  5145. },
  5146. clean: function( elems, context, fragment, scripts ) {
  5147. var checkScriptType;
  5148. context = context || document;
  5149. // !context.createElement fails in IE with an error but returns typeof 'object'
  5150. if ( typeof context.createElement === "undefined" ) {
  5151. context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
  5152. }
  5153. var ret = [], j;
  5154. for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
  5155. if ( typeof elem === "number" ) {
  5156. elem += "";
  5157. }
  5158. if ( !elem ) {
  5159. continue;
  5160. }
  5161. // Convert html string into DOM nodes
  5162. if ( typeof elem === "string" ) {
  5163. if ( !rhtml.test( elem ) ) {
  5164. elem = context.createTextNode( elem );
  5165. } else {
  5166. // Fix "XHTML"-style tags in all browsers
  5167. elem = elem.replace(rxhtmlTag, "<$1></$2>");
  5168. // Trim whitespace, otherwise indexOf won't work as expected
  5169. var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
  5170. wrap = wrapMap[ tag ] || wrapMap._default,
  5171. depth = wrap[0],
  5172. div = context.createElement("div");
  5173. // Append wrapper element to unknown element safe doc fragment
  5174. if ( context === document ) {
  5175. // Use the fragment we've already created for this document
  5176. safeFragment.appendChild( div );
  5177. } else {
  5178. // Use a fragment created with the owner document
  5179. createSafeFragment( context ).appendChild( div );
  5180. }
  5181. // Go to html and back, then peel off extra wrappers
  5182. div.innerHTML = wrap[1] + elem + wrap[2];
  5183. // Move to the right depth
  5184. while ( depth-- ) {
  5185. div = div.lastChild;
  5186. }
  5187. // Remove IE's autoinserted <tbody> from table fragments
  5188. if ( !jQuery.support.tbody ) {
  5189. // String was a <table>, *may* have spurious <tbody>
  5190. var hasBody = rtbody.test(elem),
  5191. tbody = tag === "table" && !hasBody ?
  5192. div.firstChild && div.firstChild.childNodes :
  5193. // String was a bare <thead> or <tfoot>
  5194. wrap[1] === "<table>" && !hasBody ?
  5195. div.childNodes :
  5196. [];
  5197. for ( j = tbody.length - 1; j >= 0 ; --j ) {
  5198. if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
  5199. tbody[ j ].parentNode.removeChild( tbody[ j ] );
  5200. }
  5201. }
  5202. }
  5203. // IE completely kills leading whitespace when innerHTML is used
  5204. if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
  5205. div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
  5206. }
  5207. elem = div.childNodes;
  5208. }
  5209. }
  5210. // Resets defaultChecked for any radios and checkboxes
  5211. // about to be appended to the DOM in IE 6/7 (#8060)
  5212. var len;
  5213. if ( !jQuery.support.appendChecked ) {
  5214. if ( elem[0] && typeof (len = elem.length) === "number" ) {
  5215. for ( j = 0; j < len; j++ ) {
  5216. findInputs( elem[j] );
  5217. }
  5218. } else {
  5219. findInputs( elem );
  5220. }
  5221. }
  5222. if ( elem.nodeType ) {
  5223. ret.push( elem );
  5224. } else {
  5225. ret = jQuery.merge( ret, elem );
  5226. }
  5227. }
  5228. if ( fragment ) {
  5229. checkScriptType = function( elem ) {
  5230. return !elem.type || rscriptType.test( elem.type );
  5231. };
  5232. for ( i = 0; ret[i]; i++ ) {
  5233. if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
  5234. scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
  5235. } else {
  5236. if ( ret[i].nodeType === 1 ) {
  5237. var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
  5238. ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
  5239. }
  5240. fragment.appendChild( ret[i] );
  5241. }
  5242. }
  5243. }
  5244. return ret;
  5245. },
  5246. cleanData: function( elems ) {
  5247. var data, id,
  5248. cache = jQuery.cache,
  5249. special = jQuery.event.special,
  5250. deleteExpando = jQuery.support.deleteExpando;
  5251. for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
  5252. if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
  5253. continue;
  5254. }
  5255. id = elem[ jQuery.expando ];
  5256. if ( id ) {
  5257. data = cache[ id ];
  5258. if ( data && data.events ) {
  5259. for ( var type in data.events ) {
  5260. if ( special[ type ] ) {
  5261. jQuery.event.remove( elem, type );
  5262. // This is a shortcut to avoid jQuery.event.remove's overhead
  5263. } else {
  5264. jQuery.removeEvent( elem, type, data.handle );
  5265. }
  5266. }
  5267. // Null the DOM reference to avoid IE6/7/8 leak (#7054)
  5268. if ( data.handle ) {
  5269. data.handle.elem = null;
  5270. }
  5271. }
  5272. if ( deleteExpando ) {
  5273. delete elem[ jQuery.expando ];
  5274. } else if ( elem.removeAttribute ) {
  5275. elem.removeAttribute( jQuery.expando );
  5276. }
  5277. delete cache[ id ];
  5278. }
  5279. }
  5280. }
  5281. });
  5282. function evalScript( i, elem ) {
  5283. if ( elem.src ) {
  5284. jQuery.ajax({
  5285. url: elem.src,
  5286. async: false,
  5287. dataType: "script"
  5288. });
  5289. } else {
  5290. jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
  5291. }
  5292. if ( elem.parentNode ) {
  5293. elem.parentNode.removeChild( elem );
  5294. }
  5295. }
  5296. var ralpha = /alpha\([^)]*\)/i,
  5297. ropacity = /opacity=([^)]*)/,
  5298. // fixed for IE9, see #8346
  5299. rupper = /([A-Z]|^ms)/g,
  5300. rnumpx = /^-?\d+(?:px)?$/i,
  5301. rnum = /^-?\d/,
  5302. rrelNum = /^([\-+])=([\-+.\de]+)/,
  5303. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  5304. cssWidth = [ "Left", "Right" ],
  5305. cssHeight = [ "Top", "Bottom" ],
  5306. curCSS,
  5307. getComputedStyle,
  5308. currentStyle;
  5309. jQuery.fn.css = function( name, value ) {
  5310. // Setting 'undefined' is a no-op
  5311. if ( arguments.length === 2 && value === undefined ) {
  5312. return this;
  5313. }
  5314. return jQuery.access( this, name, value, true, function( elem, name, value ) {
  5315. return value !== undefined ?
  5316. jQuery.style( elem, name, value ) :
  5317. jQuery.css( elem, name );
  5318. });
  5319. };
  5320. jQuery.extend({
  5321. // Add in style property hooks for overriding the default
  5322. // behavior of getting and setting a style property
  5323. cssHooks: {
  5324. opacity: {
  5325. get: function( elem, computed ) {
  5326. if ( computed ) {
  5327. // We should always get a number back from opacity
  5328. var ret = curCSS( elem, "opacity", "opacity" );
  5329. return ret === "" ? "1" : ret;
  5330. } else {
  5331. return elem.style.opacity;
  5332. }
  5333. }
  5334. }
  5335. },
  5336. // Exclude the following css properties to add px
  5337. cssNumber: {
  5338. "fillOpacity": true,
  5339. "fontWeight": true,
  5340. "lineHeight": true,
  5341. "opacity": true,
  5342. "orphans": true,
  5343. "widows": true,
  5344. "zIndex": true,
  5345. "zoom": true
  5346. },
  5347. // Add in properties whose names you wish to fix before
  5348. // setting or getting the value
  5349. cssProps: {
  5350. // normalize float css property
  5351. "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
  5352. },
  5353. // Get and set the style property on a DOM Node
  5354. style: function( elem, name, value, extra ) {
  5355. // Don't set styles on text and comment nodes
  5356. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5357. return;
  5358. }
  5359. // Make sure that we're working with the right name
  5360. var ret, type, origName = jQuery.camelCase( name ),
  5361. style = elem.style, hooks = jQuery.cssHooks[ origName ];
  5362. name = jQuery.cssProps[ origName ] || origName;
  5363. // Check if we're setting a value
  5364. if ( value !== undefined ) {
  5365. type = typeof value;
  5366. // convert relative number strings (+= or -=) to relative numbers. #7345
  5367. if ( type === "string" && (ret = rrelNum.exec( value )) ) {
  5368. value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
  5369. // Fixes bug #9237
  5370. type = "number";
  5371. }
  5372. // Make sure that NaN and null values aren't set. See: #7116
  5373. if ( value == null || type === "number" && isNaN( value ) ) {
  5374. return;
  5375. }
  5376. // If a number was passed in, add 'px' to the (except for certain CSS properties)
  5377. if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
  5378. value += "px";
  5379. }
  5380. // If a hook was provided, use that value, otherwise just set the specified value
  5381. if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
  5382. // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
  5383. // Fixes bug #5509
  5384. try {
  5385. style[ name ] = value;
  5386. } catch(e) {}
  5387. }
  5388. } else {
  5389. // If a hook was provided get the non-computed value from there
  5390. if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
  5391. return ret;
  5392. }
  5393. // Otherwise just get the value from the style object
  5394. return style[ name ];
  5395. }
  5396. },
  5397. css: function( elem, name, extra ) {
  5398. var ret, hooks;
  5399. // Make sure that we're working with the right name
  5400. name = jQuery.camelCase( name );
  5401. hooks = jQuery.cssHooks[ name ];
  5402. name = jQuery.cssProps[ name ] || name;
  5403. // cssFloat needs a special treatment
  5404. if ( name === "cssFloat" ) {
  5405. name = "float";
  5406. }
  5407. // If a hook was provided get the computed value from there
  5408. if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
  5409. return ret;
  5410. // Otherwise, if a way to get the computed value exists, use that
  5411. } else if ( curCSS ) {
  5412. return curCSS( elem, name );
  5413. }
  5414. },
  5415. // A method for quickly swapping in/out CSS properties to get correct calculations
  5416. swap: function( elem, options, callback ) {
  5417. var old = {};
  5418. // Remember the old values, and insert the new ones
  5419. for ( var name in options ) {
  5420. old[ name ] = elem.style[ name ];
  5421. elem.style[ name ] = options[ name ];
  5422. }
  5423. callback.call( elem );
  5424. // Revert the old values
  5425. for ( name in options ) {
  5426. elem.style[ name ] = old[ name ];
  5427. }
  5428. }
  5429. });
  5430. // DEPRECATED, Use jQuery.css() instead
  5431. jQuery.curCSS = jQuery.css;
  5432. jQuery.each(["height", "width"], function( i, name ) {
  5433. jQuery.cssHooks[ name ] = {
  5434. get: function( elem, computed, extra ) {
  5435. var val;
  5436. if ( computed ) {
  5437. if ( elem.offsetWidth !== 0 ) {
  5438. return getWH( elem, name, extra );
  5439. } else {
  5440. jQuery.swap( elem, cssShow, function() {
  5441. val = getWH( elem, name, extra );
  5442. });
  5443. }
  5444. return val;
  5445. }
  5446. },
  5447. set: function( elem, value ) {
  5448. if ( rnumpx.test( value ) ) {
  5449. // ignore negative width and height values #1599
  5450. value = parseFloat( value );
  5451. if ( value >= 0 ) {
  5452. return value + "px";
  5453. }
  5454. } else {
  5455. return value;
  5456. }
  5457. }
  5458. };
  5459. });
  5460. if ( !jQuery.support.opacity ) {
  5461. jQuery.cssHooks.opacity = {
  5462. get: function( elem, computed ) {
  5463. // IE uses filters for opacity
  5464. return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
  5465. ( parseFloat( RegExp.$1 ) / 100 ) + "" :
  5466. computed ? "1" : "";
  5467. },
  5468. set: function( elem, value ) {
  5469. var style = elem.style,
  5470. currentStyle = elem.currentStyle,
  5471. opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
  5472. filter = currentStyle && currentStyle.filter || style.filter || "";
  5473. // IE has trouble with opacity if it does not have layout
  5474. // Force it by setting the zoom level
  5475. style.zoom = 1;
  5476. // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
  5477. if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
  5478. // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
  5479. // if "filter:" is present at all, clearType is disabled, we want to avoid this
  5480. // style.removeAttribute is IE Only, but so apparently is this code path...
  5481. style.removeAttribute( "filter" );
  5482. // if there there is no filter style applied in a css rule, we are done
  5483. if ( currentStyle && !currentStyle.filter ) {
  5484. return;
  5485. }
  5486. }
  5487. // otherwise, set new filter values
  5488. style.filter = ralpha.test( filter ) ?
  5489. filter.replace( ralpha, opacity ) :
  5490. filter + " " + opacity;
  5491. }
  5492. };
  5493. }
  5494. jQuery(function() {
  5495. // This hook cannot be added until DOM ready because the support test
  5496. // for it is not run until after DOM ready
  5497. if ( !jQuery.support.reliableMarginRight ) {
  5498. jQuery.cssHooks.marginRight = {
  5499. get: function( elem, computed ) {
  5500. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  5501. // Work around by temporarily setting element display to inline-block
  5502. var ret;
  5503. jQuery.swap( elem, { "display": "inline-block" }, function() {
  5504. if ( computed ) {
  5505. ret = curCSS( elem, "margin-right", "marginRight" );
  5506. } else {
  5507. ret = elem.style.marginRight;
  5508. }
  5509. });
  5510. return ret;
  5511. }
  5512. };
  5513. }
  5514. });
  5515. if ( document.defaultView && document.defaultView.getComputedStyle ) {
  5516. getComputedStyle = function( elem, name ) {
  5517. var ret, defaultView, computedStyle;
  5518. name = name.replace( rupper, "-$1" ).toLowerCase();
  5519. if ( (defaultView = elem.ownerDocument.defaultView) &&
  5520. (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
  5521. ret = computedStyle.getPropertyValue( name );
  5522. if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
  5523. ret = jQuery.style( elem, name );
  5524. }
  5525. }
  5526. return ret;
  5527. };
  5528. }
  5529. if ( document.documentElement.currentStyle ) {
  5530. currentStyle = function( elem, name ) {
  5531. var left, rsLeft, uncomputed,
  5532. ret = elem.currentStyle && elem.currentStyle[ name ],
  5533. style = elem.style;
  5534. // Avoid setting ret to empty string here
  5535. // so we don't default to auto
  5536. if ( ret === null && style && (uncomputed = style[ name ]) ) {
  5537. ret = uncomputed;
  5538. }
  5539. // From the awesome hack by Dean Edwards
  5540. // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
  5541. // If we're not dealing with a regular pixel number
  5542. // but a number that has a weird ending, we need to convert it to pixels
  5543. if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
  5544. // Remember the original values
  5545. left = style.left;
  5546. rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
  5547. // Put in the new values to get a computed value out
  5548. if ( rsLeft ) {
  5549. elem.runtimeStyle.left = elem.currentStyle.left;
  5550. }
  5551. style.left = name === "fontSize" ? "1em" : ( ret || 0 );
  5552. ret = style.pixelLeft + "px";
  5553. // Revert the changed values
  5554. style.left = left;
  5555. if ( rsLeft ) {
  5556. elem.runtimeStyle.left = rsLeft;
  5557. }
  5558. }
  5559. return ret === "" ? "auto" : ret;
  5560. };
  5561. }
  5562. curCSS = getComputedStyle || currentStyle;
  5563. function getWH( elem, name, extra ) {
  5564. // Start with offset property
  5565. var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
  5566. which = name === "width" ? cssWidth : cssHeight,
  5567. i = 0,
  5568. len = which.length;
  5569. if ( val > 0 ) {
  5570. if ( extra !== "border" ) {
  5571. for ( ; i < len; i++ ) {
  5572. if ( !extra ) {
  5573. val -= parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
  5574. }
  5575. if ( extra === "margin" ) {
  5576. val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
  5577. } else {
  5578. val -= parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
  5579. }
  5580. }
  5581. }
  5582. return val + "px";
  5583. }
  5584. // Fall back to computed then uncomputed css if necessary
  5585. val = curCSS( elem, name, name );
  5586. if ( val < 0 || val == null ) {
  5587. val = elem.style[ name ] || 0;
  5588. }
  5589. // Normalize "", auto, and prepare for extra
  5590. val = parseFloat( val ) || 0;
  5591. // Add padding, border, margin
  5592. if ( extra ) {
  5593. for ( ; i < len; i++ ) {
  5594. val += parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
  5595. if ( extra !== "padding" ) {
  5596. val += parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
  5597. }
  5598. if ( extra === "margin" ) {
  5599. val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
  5600. }
  5601. }
  5602. }
  5603. return val + "px";
  5604. }
  5605. if ( jQuery.expr && jQuery.expr.filters ) {
  5606. jQuery.expr.filters.hidden = function( elem ) {
  5607. var width = elem.offsetWidth,
  5608. height = elem.offsetHeight;
  5609. return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
  5610. };
  5611. jQuery.expr.filters.visible = function( elem ) {
  5612. return !jQuery.expr.filters.hidden( elem );
  5613. };
  5614. }
  5615. var r20 = /%20/g,
  5616. rbracket = /\[\]$/,
  5617. rCRLF = /\r?\n/g,
  5618. rhash = /#.*$/,
  5619. rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
  5620. rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
  5621. // #7653, #8125, #8152: local protocol detection
  5622. rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
  5623. rnoContent = /^(?:GET|HEAD)$/,
  5624. rprotocol = /^\/\//,
  5625. rquery = /\?/,
  5626. rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
  5627. rselectTextarea = /^(?:select|textarea)/i,
  5628. rspacesAjax = /\s+/,
  5629. rts = /([?&])_=[^&]*/,
  5630. rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
  5631. // Keep a copy of the old load method
  5632. _load = jQuery.fn.load,
  5633. /* Prefilters
  5634. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  5635. * 2) These are called:
  5636. * - BEFORE asking for a transport
  5637. * - AFTER param serialization (s.data is a string if s.processData is true)
  5638. * 3) key is the dataType
  5639. * 4) the catchall symbol "*" can be used
  5640. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  5641. */
  5642. prefilters = {},
  5643. /* Transports bindings
  5644. * 1) key is the dataType
  5645. * 2) the catchall symbol "*" can be used
  5646. * 3) selection will start with transport dataType and THEN go to "*" if needed
  5647. */
  5648. transports = {},
  5649. // Document location
  5650. ajaxLocation,
  5651. // Document location segments
  5652. ajaxLocParts,
  5653. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  5654. allTypes = ["*/"] + ["*"];
  5655. // #8138, IE may throw an exception when accessing
  5656. // a field from window.location if document.domain has been set
  5657. try {
  5658. ajaxLocation = location.href;
  5659. } catch( e ) {
  5660. // Use the href attribute of an A element
  5661. // since IE will modify it given document.location
  5662. ajaxLocation = document.createElement( "a" );
  5663. ajaxLocation.href = "";
  5664. ajaxLocation = ajaxLocation.href;
  5665. }
  5666. // Segment location into parts
  5667. ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
  5668. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  5669. function addToPrefiltersOrTransports( structure ) {
  5670. // dataTypeExpression is optional and defaults to "*"
  5671. return function( dataTypeExpression, func ) {
  5672. if ( typeof dataTypeExpression !== "string" ) {
  5673. func = dataTypeExpression;
  5674. dataTypeExpression = "*";
  5675. }
  5676. if ( jQuery.isFunction( func ) ) {
  5677. var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
  5678. i = 0,
  5679. length = dataTypes.length,
  5680. dataType,
  5681. list,
  5682. placeBefore;
  5683. // For each dataType in the dataTypeExpression
  5684. for ( ; i < length; i++ ) {
  5685. dataType = dataTypes[ i ];
  5686. // We control if we're asked to add before
  5687. // any existing element
  5688. placeBefore = /^\+/.test( dataType );
  5689. if ( placeBefore ) {
  5690. dataType = dataType.substr( 1 ) || "*";
  5691. }
  5692. list = structure[ dataType ] = structure[ dataType ] || [];
  5693. // then we add to the structure accordingly
  5694. list[ placeBefore ? "unshift" : "push" ]( func );
  5695. }
  5696. }
  5697. };
  5698. }
  5699. // Base inspection function for prefilters and transports
  5700. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
  5701. dataType /* internal */, inspected /* internal */ ) {
  5702. dataType = dataType || options.dataTypes[ 0 ];
  5703. inspected = inspected || {};
  5704. inspected[ dataType ] = true;
  5705. var list = structure[ dataType ],
  5706. i = 0,
  5707. length = list ? list.length : 0,
  5708. executeOnly = ( structure === prefilters ),
  5709. selection;
  5710. for ( ; i < length && ( executeOnly || !selection ); i++ ) {
  5711. selection = list[ i ]( options, originalOptions, jqXHR );
  5712. // If we got redirected to another dataType
  5713. // we try there if executing only and not done already
  5714. if ( typeof selection === "string" ) {
  5715. if ( !executeOnly || inspected[ selection ] ) {
  5716. selection = undefined;
  5717. } else {
  5718. options.dataTypes.unshift( selection );
  5719. selection = inspectPrefiltersOrTransports(
  5720. structure, options, originalOptions, jqXHR, selection, inspected );
  5721. }
  5722. }
  5723. }
  5724. // If we're only executing or nothing was selected
  5725. // we try the catchall dataType if not done already
  5726. if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
  5727. selection = inspectPrefiltersOrTransports(
  5728. structure, options, originalOptions, jqXHR, "*", inspected );
  5729. }
  5730. // unnecessary when only executing (prefilters)
  5731. // but it'll be ignored by the caller in that case
  5732. return selection;
  5733. }
  5734. // A special extend for ajax options
  5735. // that takes "flat" options (not to be deep extended)
  5736. // Fixes #9887
  5737. function ajaxExtend( target, src ) {
  5738. var key, deep,
  5739. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  5740. for ( key in src ) {
  5741. if ( src[ key ] !== undefined ) {
  5742. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  5743. }
  5744. }
  5745. if ( deep ) {
  5746. jQuery.extend( true, target, deep );
  5747. }
  5748. }
  5749. jQuery.fn.extend({
  5750. load: function( url, params, callback ) {
  5751. if ( typeof url !== "string" && _load ) {
  5752. return _load.apply( this, arguments );
  5753. // Don't do a request if no elements are being requested
  5754. } else if ( !this.length ) {
  5755. return this;
  5756. }
  5757. var off = url.indexOf( " " );
  5758. if ( off >= 0 ) {
  5759. var selector = url.slice( off, url.length );
  5760. url = url.slice( 0, off );
  5761. }
  5762. // Default to a GET request
  5763. var type = "GET";
  5764. // If the second parameter was provided
  5765. if ( params ) {
  5766. // If it's a function
  5767. if ( jQuery.isFunction( params ) ) {
  5768. // We assume that it's the callback
  5769. callback = params;
  5770. params = undefined;
  5771. // Otherwise, build a param string
  5772. } else if ( typeof params === "object" ) {
  5773. params = jQuery.param( params, jQuery.ajaxSettings.traditional );
  5774. type = "POST";
  5775. }
  5776. }
  5777. var self = this;
  5778. // Request the remote document
  5779. jQuery.ajax({
  5780. url: url,
  5781. type: type,
  5782. dataType: "html",
  5783. data: params,
  5784. // Complete callback (responseText is used internally)
  5785. complete: function( jqXHR, status, responseText ) {
  5786. // Store the response as specified by the jqXHR object
  5787. responseText = jqXHR.responseText;
  5788. // If successful, inject the HTML into all the matched elements
  5789. if ( jqXHR.isResolved() ) {
  5790. // #4825: Get the actual response in case
  5791. // a dataFilter is present in ajaxSettings
  5792. jqXHR.done(function( r ) {
  5793. responseText = r;
  5794. });
  5795. // See if a selector was specified
  5796. self.html( selector ?
  5797. // Create a dummy div to hold the results
  5798. jQuery("<div>")
  5799. // inject the contents of the document in, removing the scripts
  5800. // to avoid any 'Permission Denied' errors in IE
  5801. .append(responseText.replace(rscript, ""))
  5802. // Locate the specified elements
  5803. .find(selector) :
  5804. // If not, just inject the full result
  5805. responseText );
  5806. }
  5807. if ( callback ) {
  5808. self.each( callback, [ responseText, status, jqXHR ] );
  5809. }
  5810. }
  5811. });
  5812. return this;
  5813. },
  5814. serialize: function() {
  5815. return jQuery.param( this.serializeArray() );
  5816. },
  5817. serializeArray: function() {
  5818. return this.map(function(){
  5819. return this.elements ? jQuery.makeArray( this.elements ) : this;
  5820. })
  5821. .filter(function(){
  5822. return this.name && !this.disabled &&
  5823. ( this.checked || rselectTextarea.test( this.nodeName ) ||
  5824. rinput.test( this.type ) );
  5825. })
  5826. .map(function( i, elem ){
  5827. var val = jQuery( this ).val();
  5828. return val == null ?
  5829. null :
  5830. jQuery.isArray( val ) ?
  5831. jQuery.map( val, function( val, i ){
  5832. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  5833. }) :
  5834. { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  5835. }).get();
  5836. }
  5837. });
  5838. // Attach a bunch of functions for handling common AJAX events
  5839. jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
  5840. jQuery.fn[ o ] = function( f ){
  5841. return this.on( o, f );
  5842. };
  5843. });
  5844. jQuery.each( [ "get", "post" ], function( i, method ) {
  5845. jQuery[ method ] = function( url, data, callback, type ) {
  5846. // shift arguments if data argument was omitted
  5847. if ( jQuery.isFunction( data ) ) {
  5848. type = type || callback;
  5849. callback = data;
  5850. data = undefined;
  5851. }
  5852. return jQuery.ajax({
  5853. type: method,
  5854. url: url,
  5855. data: data,
  5856. success: callback,
  5857. dataType: type
  5858. });
  5859. };
  5860. });
  5861. jQuery.extend({
  5862. getScript: function( url, callback ) {
  5863. return jQuery.get( url, undefined, callback, "script" );
  5864. },
  5865. getJSON: function( url, data, callback ) {
  5866. return jQuery.get( url, data, callback, "json" );
  5867. },
  5868. // Creates a full fledged settings object into target
  5869. // with both ajaxSettings and settings fields.
  5870. // If target is omitted, writes into ajaxSettings.
  5871. ajaxSetup: function( target, settings ) {
  5872. if ( settings ) {
  5873. // Building a settings object
  5874. ajaxExtend( target, jQuery.ajaxSettings );
  5875. } else {
  5876. // Extending ajaxSettings
  5877. settings = target;
  5878. target = jQuery.ajaxSettings;
  5879. }
  5880. ajaxExtend( target, settings );
  5881. return target;
  5882. },
  5883. ajaxSettings: {
  5884. url: ajaxLocation,
  5885. isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
  5886. global: true,
  5887. type: "GET",
  5888. contentType: "application/x-www-form-urlencoded",
  5889. processData: true,
  5890. async: true,
  5891. /*
  5892. timeout: 0,
  5893. data: null,
  5894. dataType: null,
  5895. username: null,
  5896. password: null,
  5897. cache: null,
  5898. traditional: false,
  5899. headers: {},
  5900. */
  5901. accepts: {
  5902. xml: "application/xml, text/xml",
  5903. html: "text/html",
  5904. text: "text/plain",
  5905. json: "application/json, text/javascript",
  5906. "*": allTypes
  5907. },
  5908. contents: {
  5909. xml: /xml/,
  5910. html: /html/,
  5911. json: /json/
  5912. },
  5913. responseFields: {
  5914. xml: "responseXML",
  5915. text: "responseText"
  5916. },
  5917. // List of data converters
  5918. // 1) key format is "source_type destination_type" (a single space in-between)
  5919. // 2) the catchall symbol "*" can be used for source_type
  5920. converters: {
  5921. // Convert anything to text
  5922. "* text": window.String,
  5923. // Text to html (true = no transformation)
  5924. "text html": true,
  5925. // Evaluate text as a json expression
  5926. "text json": jQuery.parseJSON,
  5927. // Parse text as xml
  5928. "text xml": jQuery.parseXML
  5929. },
  5930. // For options that shouldn't be deep extended:
  5931. // you can add your own custom options here if
  5932. // and when you create one that shouldn't be
  5933. // deep extended (see ajaxExtend)
  5934. flatOptions: {
  5935. context: true,
  5936. url: true
  5937. }
  5938. },
  5939. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  5940. ajaxTransport: addToPrefiltersOrTransports( transports ),
  5941. // Main method
  5942. ajax: function( url, options ) {
  5943. // If url is an object, simulate pre-1.5 signature
  5944. if ( typeof url === "object" ) {
  5945. options = url;
  5946. url = undefined;
  5947. }
  5948. // Force options to be an object
  5949. options = options || {};
  5950. var // Create the final options object
  5951. s = jQuery.ajaxSetup( {}, options ),
  5952. // Callbacks context
  5953. callbackContext = s.context || s,
  5954. // Context for global events
  5955. // It's the callbackContext if one was provided in the options
  5956. // and if it's a DOM node or a jQuery collection
  5957. globalEventContext = callbackContext !== s &&
  5958. ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
  5959. jQuery( callbackContext ) : jQuery.event,
  5960. // Deferreds
  5961. deferred = jQuery.Deferred(),
  5962. completeDeferred = jQuery.Callbacks( "once memory" ),
  5963. // Status-dependent callbacks
  5964. statusCode = s.statusCode || {},
  5965. // ifModified key
  5966. ifModifiedKey,
  5967. // Headers (they are sent all at once)
  5968. requestHeaders = {},
  5969. requestHeadersNames = {},
  5970. // Response headers
  5971. responseHeadersString,
  5972. responseHeaders,
  5973. // transport
  5974. transport,
  5975. // timeout handle
  5976. timeoutTimer,
  5977. // Cross-domain detection vars
  5978. parts,
  5979. // The jqXHR state
  5980. state = 0,
  5981. // To know if global events are to be dispatched
  5982. fireGlobals,
  5983. // Loop variable
  5984. i,
  5985. // Fake xhr
  5986. jqXHR = {
  5987. readyState: 0,
  5988. // Caches the header
  5989. setRequestHeader: function( name, value ) {
  5990. if ( !state ) {
  5991. var lname = name.toLowerCase();
  5992. name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
  5993. requestHeaders[ name ] = value;
  5994. }
  5995. return this;
  5996. },
  5997. // Raw string
  5998. getAllResponseHeaders: function() {
  5999. return state === 2 ? responseHeadersString : null;
  6000. },
  6001. // Builds headers hashtable if needed
  6002. getResponseHeader: function( key ) {
  6003. var match;
  6004. if ( state === 2 ) {
  6005. if ( !responseHeaders ) {
  6006. responseHeaders = {};
  6007. while( ( match = rheaders.exec( responseHeadersString ) ) ) {
  6008. responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
  6009. }
  6010. }
  6011. match = responseHeaders[ key.toLowerCase() ];
  6012. }
  6013. return match === undefined ? null : match;
  6014. },
  6015. // Overrides response content-type header
  6016. overrideMimeType: function( type ) {
  6017. if ( !state ) {
  6018. s.mimeType = type;
  6019. }
  6020. return this;
  6021. },
  6022. // Cancel the request
  6023. abort: function( statusText ) {
  6024. statusText = statusText || "abort";
  6025. if ( transport ) {
  6026. transport.abort( statusText );
  6027. }
  6028. done( 0, statusText );
  6029. return this;
  6030. }
  6031. };
  6032. // Callback for when everything is done
  6033. // It is defined here because jslint complains if it is declared
  6034. // at the end of the function (which would be more logical and readable)
  6035. function done( status, nativeStatusText, responses, headers ) {
  6036. // Called once
  6037. if ( state === 2 ) {
  6038. return;
  6039. }
  6040. // State is "done" now
  6041. state = 2;
  6042. // Clear timeout if it exists
  6043. if ( timeoutTimer ) {
  6044. clearTimeout( timeoutTimer );
  6045. }
  6046. // Dereference transport for early garbage collection
  6047. // (no matter how long the jqXHR object will be used)
  6048. transport = undefined;
  6049. // Cache response headers
  6050. responseHeadersString = headers || "";
  6051. // Set readyState
  6052. jqXHR.readyState = status > 0 ? 4 : 0;
  6053. var isSuccess,
  6054. success,
  6055. error,
  6056. statusText = nativeStatusText,
  6057. response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
  6058. lastModified,
  6059. etag;
  6060. // If successful, handle type chaining
  6061. if ( status >= 200 && status < 300 || status === 304 ) {
  6062. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  6063. if ( s.ifModified ) {
  6064. if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
  6065. jQuery.lastModified[ ifModifiedKey ] = lastModified;
  6066. }
  6067. if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
  6068. jQuery.etag[ ifModifiedKey ] = etag;
  6069. }
  6070. }
  6071. // If not modified
  6072. if ( status === 304 ) {
  6073. statusText = "notmodified";
  6074. isSuccess = true;
  6075. // If we have data
  6076. } else {
  6077. try {
  6078. success = ajaxConvert( s, response );
  6079. statusText = "success";
  6080. isSuccess = true;
  6081. } catch(e) {
  6082. // We have a parsererror
  6083. statusText = "parsererror";
  6084. error = e;
  6085. }
  6086. }
  6087. } else {
  6088. // We extract error from statusText
  6089. // then normalize statusText and status for non-aborts
  6090. error = statusText;
  6091. if ( !statusText || status ) {
  6092. statusText = "error";
  6093. if ( status < 0 ) {
  6094. status = 0;
  6095. }
  6096. }
  6097. }
  6098. // Set data for the fake xhr object
  6099. jqXHR.status = status;
  6100. jqXHR.statusText = "" + ( nativeStatusText || statusText );
  6101. // Success/Error
  6102. if ( isSuccess ) {
  6103. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  6104. } else {
  6105. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  6106. }
  6107. // Status-dependent callbacks
  6108. jqXHR.statusCode( statusCode );
  6109. statusCode = undefined;
  6110. if ( fireGlobals ) {
  6111. globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
  6112. [ jqXHR, s, isSuccess ? success : error ] );
  6113. }
  6114. // Complete
  6115. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  6116. if ( fireGlobals ) {
  6117. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  6118. // Handle the global AJAX counter
  6119. if ( !( --jQuery.active ) ) {
  6120. jQuery.event.trigger( "ajaxStop" );
  6121. }
  6122. }
  6123. }
  6124. // Attach deferreds
  6125. deferred.promise( jqXHR );
  6126. jqXHR.success = jqXHR.done;
  6127. jqXHR.error = jqXHR.fail;
  6128. jqXHR.complete = completeDeferred.add;
  6129. // Status-dependent callbacks
  6130. jqXHR.statusCode = function( map ) {
  6131. if ( map ) {
  6132. var tmp;
  6133. if ( state < 2 ) {
  6134. for ( tmp in map ) {
  6135. statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
  6136. }
  6137. } else {
  6138. tmp = map[ jqXHR.status ];
  6139. jqXHR.then( tmp, tmp );
  6140. }
  6141. }
  6142. return this;
  6143. };
  6144. // Remove hash character (#7531: and string promotion)
  6145. // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
  6146. // We also use the url parameter if available
  6147. s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
  6148. // Extract dataTypes list
  6149. s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
  6150. // Determine if a cross-domain request is in order
  6151. if ( s.crossDomain == null ) {
  6152. parts = rurl.exec( s.url.toLowerCase() );
  6153. s.crossDomain = !!( parts &&
  6154. ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
  6155. ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
  6156. ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
  6157. );
  6158. }
  6159. // Convert data if not already a string
  6160. if ( s.data && s.processData && typeof s.data !== "string" ) {
  6161. s.data = jQuery.param( s.data, s.traditional );
  6162. }
  6163. // Apply prefilters
  6164. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  6165. // If request was aborted inside a prefiler, stop there
  6166. if ( state === 2 ) {
  6167. return false;
  6168. }
  6169. // We can fire global events as of now if asked to
  6170. fireGlobals = s.global;
  6171. // Uppercase the type
  6172. s.type = s.type.toUpperCase();
  6173. // Determine if request has content
  6174. s.hasContent = !rnoContent.test( s.type );
  6175. // Watch for a new set of requests
  6176. if ( fireGlobals && jQuery.active++ === 0 ) {
  6177. jQuery.event.trigger( "ajaxStart" );
  6178. }
  6179. // More options handling for requests with no content
  6180. if ( !s.hasContent ) {
  6181. // If data is available, append data to url
  6182. if ( s.data ) {
  6183. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
  6184. // #9682: remove data so that it's not used in an eventual retry
  6185. delete s.data;
  6186. }
  6187. // Get ifModifiedKey before adding the anti-cache parameter
  6188. ifModifiedKey = s.url;
  6189. // Add anti-cache in url if needed
  6190. if ( s.cache === false ) {
  6191. var ts = jQuery.now(),
  6192. // try replacing _= if it is there
  6193. ret = s.url.replace( rts, "$1_=" + ts );
  6194. // if nothing was replaced, add timestamp to the end
  6195. s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
  6196. }
  6197. }
  6198. // Set the correct header, if data is being sent
  6199. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  6200. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  6201. }
  6202. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  6203. if ( s.ifModified ) {
  6204. ifModifiedKey = ifModifiedKey || s.url;
  6205. if ( jQuery.lastModified[ ifModifiedKey ] ) {
  6206. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
  6207. }
  6208. if ( jQuery.etag[ ifModifiedKey ] ) {
  6209. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
  6210. }
  6211. }
  6212. // Set the Accepts header for the server, depending on the dataType
  6213. jqXHR.setRequestHeader(
  6214. "Accept",
  6215. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
  6216. s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  6217. s.accepts[ "*" ]
  6218. );
  6219. // Check for headers option
  6220. for ( i in s.headers ) {
  6221. jqXHR.setRequestHeader( i, s.headers[ i ] );
  6222. }
  6223. // Allow custom headers/mimetypes and early abort
  6224. if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
  6225. // Abort if not done already
  6226. jqXHR.abort();
  6227. return false;
  6228. }
  6229. // Install callbacks on deferreds
  6230. for ( i in { success: 1, error: 1, complete: 1 } ) {
  6231. jqXHR[ i ]( s[ i ] );
  6232. }
  6233. // Get transport
  6234. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  6235. // If no transport, we auto-abort
  6236. if ( !transport ) {
  6237. done( -1, "No Transport" );
  6238. } else {
  6239. jqXHR.readyState = 1;
  6240. // Send global event
  6241. if ( fireGlobals ) {
  6242. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  6243. }
  6244. // Timeout
  6245. if ( s.async && s.timeout > 0 ) {
  6246. timeoutTimer = setTimeout( function(){
  6247. jqXHR.abort( "timeout" );
  6248. }, s.timeout );
  6249. }
  6250. try {
  6251. state = 1;
  6252. transport.send( requestHeaders, done );
  6253. } catch (e) {
  6254. // Propagate exception as error if not done
  6255. if ( state < 2 ) {
  6256. done( -1, e );
  6257. // Simply rethrow otherwise
  6258. } else {
  6259. throw e;
  6260. }
  6261. }
  6262. }
  6263. return jqXHR;
  6264. },
  6265. // Serialize an array of form elements or a set of
  6266. // key/values into a query string
  6267. param: function( a, traditional ) {
  6268. var s = [],
  6269. add = function( key, value ) {
  6270. // If value is a function, invoke it and return its value
  6271. value = jQuery.isFunction( value ) ? value() : value;
  6272. s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
  6273. };
  6274. // Set traditional to true for jQuery <= 1.3.2 behavior.
  6275. if ( traditional === undefined ) {
  6276. traditional = jQuery.ajaxSettings.traditional;
  6277. }
  6278. // If an array was passed in, assume that it is an array of form elements.
  6279. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  6280. // Serialize the form elements
  6281. jQuery.each( a, function() {
  6282. add( this.name, this.value );
  6283. });
  6284. } else {
  6285. // If traditional, encode the "old" way (the way 1.3.2 or older
  6286. // did it), otherwise encode params recursively.
  6287. for ( var prefix in a ) {
  6288. buildParams( prefix, a[ prefix ], traditional, add );
  6289. }
  6290. }
  6291. // Return the resulting serialization
  6292. return s.join( "&" ).replace( r20, "+" );
  6293. }
  6294. });
  6295. function buildParams( prefix, obj, traditional, add ) {
  6296. if ( jQuery.isArray( obj ) ) {
  6297. // Serialize array item.
  6298. jQuery.each( obj, function( i, v ) {
  6299. if ( traditional || rbracket.test( prefix ) ) {
  6300. // Treat each array item as a scalar.
  6301. add( prefix, v );
  6302. } else {
  6303. // If array item is non-scalar (array or object), encode its
  6304. // numeric index to resolve deserialization ambiguity issues.
  6305. // Note that rack (as of 1.0.0) can't currently deserialize
  6306. // nested arrays properly, and attempting to do so may cause
  6307. // a server error. Possible fixes are to modify rack's
  6308. // deserialization algorithm or to provide an option or flag
  6309. // to force array serialization to be shallow.
  6310. buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
  6311. }
  6312. });
  6313. } else if ( !traditional && obj != null && typeof obj === "object" ) {
  6314. // Serialize object item.
  6315. for ( var name in obj ) {
  6316. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  6317. }
  6318. } else {
  6319. // Serialize scalar item.
  6320. add( prefix, obj );
  6321. }
  6322. }
  6323. // This is still on the jQuery object... for now
  6324. // Want to move this to jQuery.ajax some day
  6325. jQuery.extend({
  6326. // Counter for holding the number of active queries
  6327. active: 0,
  6328. // Last-Modified header cache for next request
  6329. lastModified: {},
  6330. etag: {}
  6331. });
  6332. /* Handles responses to an ajax request:
  6333. * - sets all responseXXX fields accordingly
  6334. * - finds the right dataType (mediates between content-type and expected dataType)
  6335. * - returns the corresponding response
  6336. */
  6337. function ajaxHandleResponses( s, jqXHR, responses ) {
  6338. var contents = s.contents,
  6339. dataTypes = s.dataTypes,
  6340. responseFields = s.responseFields,
  6341. ct,
  6342. type,
  6343. finalDataType,
  6344. firstDataType;
  6345. // Fill responseXXX fields
  6346. for ( type in responseFields ) {
  6347. if ( type in responses ) {
  6348. jqXHR[ responseFields[type] ] = responses[ type ];
  6349. }
  6350. }
  6351. // Remove auto dataType and get content-type in the process
  6352. while( dataTypes[ 0 ] === "*" ) {
  6353. dataTypes.shift();
  6354. if ( ct === undefined ) {
  6355. ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
  6356. }
  6357. }
  6358. // Check if we're dealing with a known content-type
  6359. if ( ct ) {
  6360. for ( type in contents ) {
  6361. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  6362. dataTypes.unshift( type );
  6363. break;
  6364. }
  6365. }
  6366. }
  6367. // Check to see if we have a response for the expected dataType
  6368. if ( dataTypes[ 0 ] in responses ) {
  6369. finalDataType = dataTypes[ 0 ];
  6370. } else {
  6371. // Try convertible dataTypes
  6372. for ( type in responses ) {
  6373. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
  6374. finalDataType = type;
  6375. break;
  6376. }
  6377. if ( !firstDataType ) {
  6378. firstDataType = type;
  6379. }
  6380. }
  6381. // Or just use first one
  6382. finalDataType = finalDataType || firstDataType;
  6383. }
  6384. // If we found a dataType
  6385. // We add the dataType to the list if needed
  6386. // and return the corresponding response
  6387. if ( finalDataType ) {
  6388. if ( finalDataType !== dataTypes[ 0 ] ) {
  6389. dataTypes.unshift( finalDataType );
  6390. }
  6391. return responses[ finalDataType ];
  6392. }
  6393. }
  6394. // Chain conversions given the request and the original response
  6395. function ajaxConvert( s, response ) {
  6396. // Apply the dataFilter if provided
  6397. if ( s.dataFilter ) {
  6398. response = s.dataFilter( response, s.dataType );
  6399. }
  6400. var dataTypes = s.dataTypes,
  6401. converters = {},
  6402. i,
  6403. key,
  6404. length = dataTypes.length,
  6405. tmp,
  6406. // Current and previous dataTypes
  6407. current = dataTypes[ 0 ],
  6408. prev,
  6409. // Conversion expression
  6410. conversion,
  6411. // Conversion function
  6412. conv,
  6413. // Conversion functions (transitive conversion)
  6414. conv1,
  6415. conv2;
  6416. // For each dataType in the chain
  6417. for ( i = 1; i < length; i++ ) {
  6418. // Create converters map
  6419. // with lowercased keys
  6420. if ( i === 1 ) {
  6421. for ( key in s.converters ) {
  6422. if ( typeof key === "string" ) {
  6423. converters[ key.toLowerCase() ] = s.converters[ key ];
  6424. }
  6425. }
  6426. }
  6427. // Get the dataTypes
  6428. prev = current;
  6429. current = dataTypes[ i ];
  6430. // If current is auto dataType, update it to prev
  6431. if ( current === "*" ) {
  6432. current = prev;
  6433. // If no auto and dataTypes are actually different
  6434. } else if ( prev !== "*" && prev !== current ) {
  6435. // Get the converter
  6436. conversion = prev + " " + current;
  6437. conv = converters[ conversion ] || converters[ "* " + current ];
  6438. // If there is no direct converter, search transitively
  6439. if ( !conv ) {
  6440. conv2 = undefined;
  6441. for ( conv1 in converters ) {
  6442. tmp = conv1.split( " " );
  6443. if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
  6444. conv2 = converters[ tmp[1] + " " + current ];
  6445. if ( conv2 ) {
  6446. conv1 = converters[ conv1 ];
  6447. if ( conv1 === true ) {
  6448. conv = conv2;
  6449. } else if ( conv2 === true ) {
  6450. conv = conv1;
  6451. }
  6452. break;
  6453. }
  6454. }
  6455. }
  6456. }
  6457. // If we found no converter, dispatch an error
  6458. if ( !( conv || conv2 ) ) {
  6459. jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
  6460. }
  6461. // If found converter is not an equivalence
  6462. if ( conv !== true ) {
  6463. // Convert with 1 or 2 converters accordingly
  6464. response = conv ? conv( response ) : conv2( conv1(response) );
  6465. }
  6466. }
  6467. }
  6468. return response;
  6469. }
  6470. var jsc = jQuery.now(),
  6471. jsre = /(\=)\?(&|$)|\?\?/i;
  6472. // Default jsonp settings
  6473. jQuery.ajaxSetup({
  6474. jsonp: "callback",
  6475. jsonpCallback: function() {
  6476. return jQuery.expando + "_" + ( jsc++ );
  6477. }
  6478. });
  6479. // Detect, normalize options and install callbacks for jsonp requests
  6480. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  6481. var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
  6482. ( typeof s.data === "string" );
  6483. if ( s.dataTypes[ 0 ] === "jsonp" ||
  6484. s.jsonp !== false && ( jsre.test( s.url ) ||
  6485. inspectData && jsre.test( s.data ) ) ) {
  6486. var responseContainer,
  6487. jsonpCallback = s.jsonpCallback =
  6488. jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
  6489. previous = window[ jsonpCallback ],
  6490. url = s.url,
  6491. data = s.data,
  6492. replace = "$1" + jsonpCallback + "$2";
  6493. if ( s.jsonp !== false ) {
  6494. url = url.replace( jsre, replace );
  6495. if ( s.url === url ) {
  6496. if ( inspectData ) {
  6497. data = data.replace( jsre, replace );
  6498. }
  6499. if ( s.data === data ) {
  6500. // Add callback manually
  6501. url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
  6502. }
  6503. }
  6504. }
  6505. s.url = url;
  6506. s.data = data;
  6507. // Install callback
  6508. window[ jsonpCallback ] = function( response ) {
  6509. responseContainer = [ response ];
  6510. };
  6511. // Clean-up function
  6512. jqXHR.always(function() {
  6513. // Set callback back to previous value
  6514. window[ jsonpCallback ] = previous;
  6515. // Call if it was a function and we have a response
  6516. if ( responseContainer && jQuery.isFunction( previous ) ) {
  6517. window[ jsonpCallback ]( responseContainer[ 0 ] );
  6518. }
  6519. });
  6520. // Use data converter to retrieve json after script execution
  6521. s.converters["script json"] = function() {
  6522. if ( !responseContainer ) {
  6523. jQuery.error( jsonpCallback + " was not called" );
  6524. }
  6525. return responseContainer[ 0 ];
  6526. };
  6527. // force json dataType
  6528. s.dataTypes[ 0 ] = "json";
  6529. // Delegate to script
  6530. return "script";
  6531. }
  6532. });
  6533. // Install script dataType
  6534. jQuery.ajaxSetup({
  6535. accepts: {
  6536. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  6537. },
  6538. contents: {
  6539. script: /javascript|ecmascript/
  6540. },
  6541. converters: {
  6542. "text script": function( text ) {
  6543. jQuery.globalEval( text );
  6544. return text;
  6545. }
  6546. }
  6547. });
  6548. // Handle cache's special case and global
  6549. jQuery.ajaxPrefilter( "script", function( s ) {
  6550. if ( s.cache === undefined ) {
  6551. s.cache = false;
  6552. }
  6553. if ( s.crossDomain ) {
  6554. s.type = "GET";
  6555. s.global = false;
  6556. }
  6557. });
  6558. // Bind script tag hack transport
  6559. jQuery.ajaxTransport( "script", function(s) {
  6560. // This transport only deals with cross domain requests
  6561. if ( s.crossDomain ) {
  6562. var script,
  6563. head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
  6564. return {
  6565. send: function( _, callback ) {
  6566. script = document.createElement( "script" );
  6567. script.async = "async";
  6568. if ( s.scriptCharset ) {
  6569. script.charset = s.scriptCharset;
  6570. }
  6571. script.src = s.url;
  6572. // Attach handlers for all browsers
  6573. script.onload = script.onreadystatechange = function( _, isAbort ) {
  6574. if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
  6575. // Handle memory leak in IE
  6576. script.onload = script.onreadystatechange = null;
  6577. // Remove the script
  6578. if ( head && script.parentNode ) {
  6579. head.removeChild( script );
  6580. }
  6581. // Dereference the script
  6582. script = undefined;
  6583. // Callback if not abort
  6584. if ( !isAbort ) {
  6585. callback( 200, "success" );
  6586. }
  6587. }
  6588. };
  6589. // Use insertBefore instead of appendChild to circumvent an IE6 bug.
  6590. // This arises when a base node is used (#2709 and #4378).
  6591. head.insertBefore( script, head.firstChild );
  6592. },
  6593. abort: function() {
  6594. if ( script ) {
  6595. script.onload( 0, 1 );
  6596. }
  6597. }
  6598. };
  6599. }
  6600. });
  6601. var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
  6602. xhrOnUnloadAbort = window.ActiveXObject ? function() {
  6603. // Abort all pending requests
  6604. for ( var key in xhrCallbacks ) {
  6605. xhrCallbacks[ key ]( 0, 1 );
  6606. }
  6607. } : false,
  6608. xhrId = 0,
  6609. xhrCallbacks;
  6610. // Functions to create xhrs
  6611. function createStandardXHR() {
  6612. try {
  6613. return new window.XMLHttpRequest();
  6614. } catch( e ) {}
  6615. }
  6616. function createActiveXHR() {
  6617. try {
  6618. return new window.ActiveXObject( "Microsoft.XMLHTTP" );
  6619. } catch( e ) {}
  6620. }
  6621. // Create the request object
  6622. // (This is still attached to ajaxSettings for backward compatibility)
  6623. jQuery.ajaxSettings.xhr = window.ActiveXObject ?
  6624. /* Microsoft failed to properly
  6625. * implement the XMLHttpRequest in IE7 (can't request local files),
  6626. * so we use the ActiveXObject when it is available
  6627. * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
  6628. * we need a fallback.
  6629. */
  6630. function() {
  6631. return !this.isLocal && createStandardXHR() || createActiveXHR();
  6632. } :
  6633. // For all other browsers, use the standard XMLHttpRequest object
  6634. createStandardXHR;
  6635. // Determine support properties
  6636. (function( xhr ) {
  6637. jQuery.extend( jQuery.support, {
  6638. ajax: !!xhr,
  6639. cors: !!xhr && ( "withCredentials" in xhr )
  6640. });
  6641. })( jQuery.ajaxSettings.xhr() );
  6642. // Create transport if the browser can provide an xhr
  6643. if ( jQuery.support.ajax ) {
  6644. jQuery.ajaxTransport(function( s ) {
  6645. // Cross domain only allowed if supported through XMLHttpRequest
  6646. if ( !s.crossDomain || jQuery.support.cors ) {
  6647. var callback;
  6648. return {
  6649. send: function( headers, complete ) {
  6650. // Get a new xhr
  6651. var xhr = s.xhr(),
  6652. handle,
  6653. i;
  6654. // Open the socket
  6655. // Passing null username, generates a login popup on Opera (#2865)
  6656. if ( s.username ) {
  6657. xhr.open( s.type, s.url, s.async, s.username, s.password );
  6658. } else {
  6659. xhr.open( s.type, s.url, s.async );
  6660. }
  6661. // Apply custom fields if provided
  6662. if ( s.xhrFields ) {
  6663. for ( i in s.xhrFields ) {
  6664. xhr[ i ] = s.xhrFields[ i ];
  6665. }
  6666. }
  6667. // Override mime type if needed
  6668. if ( s.mimeType && xhr.overrideMimeType ) {
  6669. xhr.overrideMimeType( s.mimeType );
  6670. }
  6671. // X-Requested-With header
  6672. // For cross-domain requests, seeing as conditions for a preflight are
  6673. // akin to a jigsaw puzzle, we simply never set it to be sure.
  6674. // (it can always be set on a per-request basis or even using ajaxSetup)
  6675. // For same-domain requests, won't change header if already provided.
  6676. if ( !s.crossDomain && !headers["X-Requested-With"] ) {
  6677. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  6678. }
  6679. // Need an extra try/catch for cross domain requests in Firefox 3
  6680. try {
  6681. for ( i in headers ) {
  6682. xhr.setRequestHeader( i, headers[ i ] );
  6683. }
  6684. } catch( _ ) {}
  6685. // Do send the request
  6686. // This may raise an exception which is actually
  6687. // handled in jQuery.ajax (so no try/catch here)
  6688. xhr.send( ( s.hasContent && s.data ) || null );
  6689. // Listener
  6690. callback = function( _, isAbort ) {
  6691. var status,
  6692. statusText,
  6693. responseHeaders,
  6694. responses,
  6695. xml;
  6696. // Firefox throws exceptions when accessing properties
  6697. // of an xhr when a network error occured
  6698. // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
  6699. try {
  6700. // Was never called and is aborted or complete
  6701. if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
  6702. // Only called once
  6703. callback = undefined;
  6704. // Do not keep as active anymore
  6705. if ( handle ) {
  6706. xhr.onreadystatechange = jQuery.noop;
  6707. if ( xhrOnUnloadAbort ) {
  6708. delete xhrCallbacks[ handle ];
  6709. }
  6710. }
  6711. // If it's an abort
  6712. if ( isAbort ) {
  6713. // Abort it manually if needed
  6714. if ( xhr.readyState !== 4 ) {
  6715. xhr.abort();
  6716. }
  6717. } else {
  6718. status = xhr.status;
  6719. responseHeaders = xhr.getAllResponseHeaders();
  6720. responses = {};
  6721. xml = xhr.responseXML;
  6722. // Construct response list
  6723. if ( xml && xml.documentElement /* #4958 */ ) {
  6724. responses.xml = xml;
  6725. }
  6726. responses.text = xhr.responseText;
  6727. // Firefox throws an exception when accessing
  6728. // statusText for faulty cross-domain requests
  6729. try {
  6730. statusText = xhr.statusText;
  6731. } catch( e ) {
  6732. // We normalize with Webkit giving an empty statusText
  6733. statusText = "";
  6734. }
  6735. // Filter status for non standard behaviors
  6736. // If the request is local and we have data: assume a success
  6737. // (success with no data won't get notified, that's the best we
  6738. // can do given current implementations)
  6739. if ( !status && s.isLocal && !s.crossDomain ) {
  6740. status = responses.text ? 200 : 404;
  6741. // IE - #1450: sometimes returns 1223 when it should be 204
  6742. } else if ( status === 1223 ) {
  6743. status = 204;
  6744. }
  6745. }
  6746. }
  6747. } catch( firefoxAccessException ) {
  6748. if ( !isAbort ) {
  6749. complete( -1, firefoxAccessException );
  6750. }
  6751. }
  6752. // Call complete if needed
  6753. if ( responses ) {
  6754. complete( status, statusText, responses, responseHeaders );
  6755. }
  6756. };
  6757. // if we're in sync mode or it's in cache
  6758. // and has been retrieved directly (IE6 & IE7)
  6759. // we need to manually fire the callback
  6760. if ( !s.async || xhr.readyState === 4 ) {
  6761. callback();
  6762. } else {
  6763. handle = ++xhrId;
  6764. if ( xhrOnUnloadAbort ) {
  6765. // Create the active xhrs callbacks list if needed
  6766. // and attach the unload handler
  6767. if ( !xhrCallbacks ) {
  6768. xhrCallbacks = {};
  6769. jQuery( window ).unload( xhrOnUnloadAbort );
  6770. }
  6771. // Add to list of active xhrs callbacks
  6772. xhrCallbacks[ handle ] = callback;
  6773. }
  6774. xhr.onreadystatechange = callback;
  6775. }
  6776. },
  6777. abort: function() {
  6778. if ( callback ) {
  6779. callback(0,1);
  6780. }
  6781. }
  6782. };
  6783. }
  6784. });
  6785. }
  6786. var elemdisplay = {},
  6787. iframe, iframeDoc,
  6788. rfxtypes = /^(?:toggle|show|hide)$/,
  6789. rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
  6790. timerId,
  6791. fxAttrs = [
  6792. // height animations
  6793. [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
  6794. // width animations
  6795. [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
  6796. // opacity animations
  6797. [ "opacity" ]
  6798. ],
  6799. fxNow;
  6800. jQuery.fn.extend({
  6801. show: function( speed, easing, callback ) {
  6802. var elem, display;
  6803. if ( speed || speed === 0 ) {
  6804. return this.animate( genFx("show", 3), speed, easing, callback );
  6805. } else {
  6806. for ( var i = 0, j = this.length; i < j; i++ ) {
  6807. elem = this[ i ];
  6808. if ( elem.style ) {
  6809. display = elem.style.display;
  6810. // Reset the inline display of this element to learn if it is
  6811. // being hidden by cascaded rules or not
  6812. if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
  6813. display = elem.style.display = "";
  6814. }
  6815. // Set elements which have been overridden with display: none
  6816. // in a stylesheet to whatever the default browser style is
  6817. // for such an element
  6818. if ( display === "" && jQuery.css(elem, "display") === "none" ) {
  6819. jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
  6820. }
  6821. }
  6822. }
  6823. // Set the display of most of the elements in a second loop
  6824. // to avoid the constant reflow
  6825. for ( i = 0; i < j; i++ ) {
  6826. elem = this[ i ];
  6827. if ( elem.style ) {
  6828. display = elem.style.display;
  6829. if ( display === "" || display === "none" ) {
  6830. elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
  6831. }
  6832. }
  6833. }
  6834. return this;
  6835. }
  6836. },
  6837. hide: function( speed, easing, callback ) {
  6838. if ( speed || speed === 0 ) {
  6839. return this.animate( genFx("hide", 3), speed, easing, callback);
  6840. } else {
  6841. var elem, display,
  6842. i = 0,
  6843. j = this.length;
  6844. for ( ; i < j; i++ ) {
  6845. elem = this[i];
  6846. if ( elem.style ) {
  6847. display = jQuery.css( elem, "display" );
  6848. if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
  6849. jQuery._data( elem, "olddisplay", display );
  6850. }
  6851. }
  6852. }
  6853. // Set the display of the elements in a second loop
  6854. // to avoid the constant reflow
  6855. for ( i = 0; i < j; i++ ) {
  6856. if ( this[i].style ) {
  6857. this[i].style.display = "none";
  6858. }
  6859. }
  6860. return this;
  6861. }
  6862. },
  6863. // Save the old toggle function
  6864. _toggle: jQuery.fn.toggle,
  6865. toggle: function( fn, fn2, callback ) {
  6866. var bool = typeof fn === "boolean";
  6867. if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
  6868. this._toggle.apply( this, arguments );
  6869. } else if ( fn == null || bool ) {
  6870. this.each(function() {
  6871. var state = bool ? fn : jQuery(this).is(":hidden");
  6872. jQuery(this)[ state ? "show" : "hide" ]();
  6873. });
  6874. } else {
  6875. this.animate(genFx("toggle", 3), fn, fn2, callback);
  6876. }
  6877. return this;
  6878. },
  6879. fadeTo: function( speed, to, easing, callback ) {
  6880. return this.filter(":hidden").css("opacity", 0).show().end()
  6881. .animate({opacity: to}, speed, easing, callback);
  6882. },
  6883. animate: function( prop, speed, easing, callback ) {
  6884. var optall = jQuery.speed( speed, easing, callback );
  6885. if ( jQuery.isEmptyObject( prop ) ) {
  6886. return this.each( optall.complete, [ false ] );
  6887. }
  6888. // Do not change referenced properties as per-property easing will be lost
  6889. prop = jQuery.extend( {}, prop );
  6890. function doAnimation() {
  6891. // XXX 'this' does not always have a nodeName when running the
  6892. // test suite
  6893. if ( optall.queue === false ) {
  6894. jQuery._mark( this );
  6895. }
  6896. var opt = jQuery.extend( {}, optall ),
  6897. isElement = this.nodeType === 1,
  6898. hidden = isElement && jQuery(this).is(":hidden"),
  6899. name, val, p, e,
  6900. parts, start, end, unit,
  6901. method;
  6902. // will store per property easing and be used to determine when an animation is complete
  6903. opt.animatedProperties = {};
  6904. for ( p in prop ) {
  6905. // property name normalization
  6906. name = jQuery.camelCase( p );
  6907. if ( p !== name ) {
  6908. prop[ name ] = prop[ p ];
  6909. delete prop[ p ];
  6910. }
  6911. val = prop[ name ];
  6912. // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
  6913. if ( jQuery.isArray( val ) ) {
  6914. opt.animatedProperties[ name ] = val[ 1 ];
  6915. val = prop[ name ] = val[ 0 ];
  6916. } else {
  6917. opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
  6918. }
  6919. if ( val === "hide" && hidden || val === "show" && !hidden ) {
  6920. return opt.complete.call( this );
  6921. }
  6922. if ( isElement && ( name === "height" || name === "width" ) ) {
  6923. // Make sure that nothing sneaks out
  6924. // Record all 3 overflow attributes because IE does not
  6925. // change the overflow attribute when overflowX and
  6926. // overflowY are set to the same value
  6927. opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
  6928. // Set display property to inline-block for height/width
  6929. // animations on inline elements that are having width/height animated
  6930. if ( jQuery.css( this, "display" ) === "inline" &&
  6931. jQuery.css( this, "float" ) === "none" ) {
  6932. // inline-level elements accept inline-block;
  6933. // block-level elements need to be inline with layout
  6934. if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
  6935. this.style.display = "inline-block";
  6936. } else {
  6937. this.style.zoom = 1;
  6938. }
  6939. }
  6940. }
  6941. }
  6942. if ( opt.overflow != null ) {
  6943. this.style.overflow = "hidden";
  6944. }
  6945. for ( p in prop ) {
  6946. e = new jQuery.fx( this, opt, p );
  6947. val = prop[ p ];
  6948. if ( rfxtypes.test( val ) ) {
  6949. // Tracks whether to show or hide based on private
  6950. // data attached to the element
  6951. method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
  6952. if ( method ) {
  6953. jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
  6954. e[ method ]();
  6955. } else {
  6956. e[ val ]();
  6957. }
  6958. } else {
  6959. parts = rfxnum.exec( val );
  6960. start = e.cur();
  6961. if ( parts ) {
  6962. end = parseFloat( parts[2] );
  6963. unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
  6964. // We need to compute starting value
  6965. if ( unit !== "px" ) {
  6966. jQuery.style( this, p, (end || 1) + unit);
  6967. start = ( (end || 1) / e.cur() ) * start;
  6968. jQuery.style( this, p, start + unit);
  6969. }
  6970. // If a +=/-= token was provided, we're doing a relative animation
  6971. if ( parts[1] ) {
  6972. end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
  6973. }
  6974. e.custom( start, end, unit );
  6975. } else {
  6976. e.custom( start, val, "" );
  6977. }
  6978. }
  6979. }
  6980. // For JS strict compliance
  6981. return true;
  6982. }
  6983. return optall.queue === false ?
  6984. this.each( doAnimation ) :
  6985. this.queue( optall.queue, doAnimation );
  6986. },
  6987. stop: function( type, clearQueue, gotoEnd ) {
  6988. if ( typeof type !== "string" ) {
  6989. gotoEnd = clearQueue;
  6990. clearQueue = type;
  6991. type = undefined;
  6992. }
  6993. if ( clearQueue && type !== false ) {
  6994. this.queue( type || "fx", [] );
  6995. }
  6996. return this.each(function() {
  6997. var index,
  6998. hadTimers = false,
  6999. timers = jQuery.timers,
  7000. data = jQuery._data( this );
  7001. // clear marker counters if we know they won't be
  7002. if ( !gotoEnd ) {
  7003. jQuery._unmark( true, this );
  7004. }
  7005. function stopQueue( elem, data, index ) {
  7006. var hooks = data[ index ];
  7007. jQuery.removeData( elem, index, true );
  7008. hooks.stop( gotoEnd );
  7009. }
  7010. if ( type == null ) {
  7011. for ( index in data ) {
  7012. if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
  7013. stopQueue( this, data, index );
  7014. }
  7015. }
  7016. } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
  7017. stopQueue( this, data, index );
  7018. }
  7019. for ( index = timers.length; index--; ) {
  7020. if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
  7021. if ( gotoEnd ) {
  7022. // force the next step to be the last
  7023. timers[ index ]( true );
  7024. } else {
  7025. timers[ index ].saveState();
  7026. }
  7027. hadTimers = true;
  7028. timers.splice( index, 1 );
  7029. }
  7030. }
  7031. // start the next in the queue if the last step wasn't forced
  7032. // timers currently will call their complete callbacks, which will dequeue
  7033. // but only if they were gotoEnd
  7034. if ( !( gotoEnd && hadTimers ) ) {
  7035. jQuery.dequeue( this, type );
  7036. }
  7037. });
  7038. }
  7039. });
  7040. // Animations created synchronously will run synchronously
  7041. function createFxNow() {
  7042. setTimeout( clearFxNow, 0 );
  7043. return ( fxNow = jQuery.now() );
  7044. }
  7045. function clearFxNow() {
  7046. fxNow = undefined;
  7047. }
  7048. // Generate parameters to create a standard animation
  7049. function genFx( type, num ) {
  7050. var obj = {};
  7051. jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
  7052. obj[ this ] = type;
  7053. });
  7054. return obj;
  7055. }
  7056. // Generate shortcuts for custom animations
  7057. jQuery.each({
  7058. slideDown: genFx( "show", 1 ),
  7059. slideUp: genFx( "hide", 1 ),
  7060. slideToggle: genFx( "toggle", 1 ),
  7061. fadeIn: { opacity: "show" },
  7062. fadeOut: { opacity: "hide" },
  7063. fadeToggle: { opacity: "toggle" }
  7064. }, function( name, props ) {
  7065. jQuery.fn[ name ] = function( speed, easing, callback ) {
  7066. return this.animate( props, speed, easing, callback );
  7067. };
  7068. });
  7069. jQuery.extend({
  7070. speed: function( speed, easing, fn ) {
  7071. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  7072. complete: fn || !fn && easing ||
  7073. jQuery.isFunction( speed ) && speed,
  7074. duration: speed,
  7075. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  7076. };
  7077. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  7078. opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
  7079. // normalize opt.queue - true/undefined/null -> "fx"
  7080. if ( opt.queue == null || opt.queue === true ) {
  7081. opt.queue = "fx";
  7082. }
  7083. // Queueing
  7084. opt.old = opt.complete;
  7085. opt.complete = function( noUnmark ) {
  7086. if ( jQuery.isFunction( opt.old ) ) {
  7087. opt.old.call( this );
  7088. }
  7089. if ( opt.queue ) {
  7090. jQuery.dequeue( this, opt.queue );
  7091. } else if ( noUnmark !== false ) {
  7092. jQuery._unmark( this );
  7093. }
  7094. };
  7095. return opt;
  7096. },
  7097. easing: {
  7098. linear: function( p, n, firstNum, diff ) {
  7099. return firstNum + diff * p;
  7100. },
  7101. swing: function( p, n, firstNum, diff ) {
  7102. return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum;
  7103. }
  7104. },
  7105. timers: [],
  7106. fx: function( elem, options, prop ) {
  7107. this.options = options;
  7108. this.elem = elem;
  7109. this.prop = prop;
  7110. options.orig = options.orig || {};
  7111. }
  7112. });
  7113. jQuery.fx.prototype = {
  7114. // Simple function for setting a style value
  7115. update: function() {
  7116. if ( this.options.step ) {
  7117. this.options.step.call( this.elem, this.now, this );
  7118. }
  7119. ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
  7120. },
  7121. // Get the current size
  7122. cur: function() {
  7123. if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
  7124. return this.elem[ this.prop ];
  7125. }
  7126. var parsed,
  7127. r = jQuery.css( this.elem, this.prop );
  7128. // Empty strings, null, undefined and "auto" are converted to 0,
  7129. // complex values such as "rotate(1rad)" are returned as is,
  7130. // simple values such as "10px" are parsed to Float.
  7131. return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
  7132. },
  7133. // Start an animation from one number to another
  7134. custom: function( from, to, unit ) {
  7135. var self = this,
  7136. fx = jQuery.fx;
  7137. this.startTime = fxNow || createFxNow();
  7138. this.end = to;
  7139. this.now = this.start = from;
  7140. this.pos = this.state = 0;
  7141. this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
  7142. function t( gotoEnd ) {
  7143. return self.step( gotoEnd );
  7144. }
  7145. t.queue = this.options.queue;
  7146. t.elem = this.elem;
  7147. t.saveState = function() {
  7148. if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
  7149. jQuery._data( self.elem, "fxshow" + self.prop, self.start );
  7150. }
  7151. };
  7152. if ( t() && jQuery.timers.push(t) && !timerId ) {
  7153. timerId = setInterval( fx.tick, fx.interval );
  7154. }
  7155. },
  7156. // Simple 'show' function
  7157. show: function() {
  7158. var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
  7159. // Remember where we started, so that we can go back to it later
  7160. this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
  7161. this.options.show = true;
  7162. // Begin the animation
  7163. // Make sure that we start at a small width/height to avoid any flash of content
  7164. if ( dataShow !== undefined ) {
  7165. // This show is picking up where a previous hide or show left off
  7166. this.custom( this.cur(), dataShow );
  7167. } else {
  7168. this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
  7169. }
  7170. // Start by showing the element
  7171. jQuery( this.elem ).show();
  7172. },
  7173. // Simple 'hide' function
  7174. hide: function() {
  7175. // Remember where we started, so that we can go back to it later
  7176. this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
  7177. this.options.hide = true;
  7178. // Begin the animation
  7179. this.custom( this.cur(), 0 );
  7180. },
  7181. // Each step of an animation
  7182. step: function( gotoEnd ) {
  7183. var p, n, complete,
  7184. t = fxNow || createFxNow(),
  7185. done = true,
  7186. elem = this.elem,
  7187. options = this.options;
  7188. if ( gotoEnd || t >= options.duration + this.startTime ) {
  7189. this.now = this.end;
  7190. this.pos = this.state = 1;
  7191. this.update();
  7192. options.animatedProperties[ this.prop ] = true;
  7193. for ( p in options.animatedProperties ) {
  7194. if ( options.animatedProperties[ p ] !== true ) {
  7195. done = false;
  7196. }
  7197. }
  7198. if ( done ) {
  7199. // Reset the overflow
  7200. if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
  7201. jQuery.each( [ "", "X", "Y" ], function( index, value ) {
  7202. elem.style[ "overflow" + value ] = options.overflow[ index ];
  7203. });
  7204. }
  7205. // Hide the element if the "hide" operation was done
  7206. if ( options.hide ) {
  7207. jQuery( elem ).hide();
  7208. }
  7209. // Reset the properties, if the item has been hidden or shown
  7210. if ( options.hide || options.show ) {
  7211. for ( p in options.animatedProperties ) {
  7212. jQuery.style( elem, p, options.orig[ p ] );
  7213. jQuery.removeData( elem, "fxshow" + p, true );
  7214. // Toggle data is no longer needed
  7215. jQuery.removeData( elem, "toggle" + p, true );
  7216. }
  7217. }
  7218. // Execute the complete function
  7219. // in the event that the complete function throws an exception
  7220. // we must ensure it won't be called twice. #5684
  7221. complete = options.complete;
  7222. if ( complete ) {
  7223. options.complete = false;
  7224. complete.call( elem );
  7225. }
  7226. }
  7227. return false;
  7228. } else {
  7229. // classical easing cannot be used with an Infinity duration
  7230. if ( options.duration == Infinity ) {
  7231. this.now = t;
  7232. } else {
  7233. n = t - this.startTime;
  7234. this.state = n / options.duration;
  7235. // Perform the easing function, defaults to swing
  7236. this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
  7237. this.now = this.start + ( (this.end - this.start) * this.pos );
  7238. }
  7239. // Perform the next step of the animation
  7240. this.update();
  7241. }
  7242. return true;
  7243. }
  7244. };
  7245. jQuery.extend( jQuery.fx, {
  7246. tick: function() {
  7247. var timer,
  7248. timers = jQuery.timers,
  7249. i = 0;
  7250. for ( ; i < timers.length; i++ ) {
  7251. timer = timers[ i ];
  7252. // Checks the timer has not already been removed
  7253. if ( !timer() && timers[ i ] === timer ) {
  7254. timers.splice( i--, 1 );
  7255. }
  7256. }
  7257. if ( !timers.length ) {
  7258. jQuery.fx.stop();
  7259. }
  7260. },
  7261. interval: 13,
  7262. stop: function() {
  7263. clearInterval( timerId );
  7264. timerId = null;
  7265. },
  7266. speeds: {
  7267. slow: 600,
  7268. fast: 200,
  7269. // Default speed
  7270. _default: 400
  7271. },
  7272. step: {
  7273. opacity: function( fx ) {
  7274. jQuery.style( fx.elem, "opacity", fx.now );
  7275. },
  7276. _default: function( fx ) {
  7277. if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
  7278. fx.elem.style[ fx.prop ] = fx.now + fx.unit;
  7279. } else {
  7280. fx.elem[ fx.prop ] = fx.now;
  7281. }
  7282. }
  7283. }
  7284. });
  7285. // Adds width/height step functions
  7286. // Do not set anything below 0
  7287. jQuery.each([ "width", "height" ], function( i, prop ) {
  7288. jQuery.fx.step[ prop ] = function( fx ) {
  7289. jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
  7290. };
  7291. });
  7292. if ( jQuery.expr && jQuery.expr.filters ) {
  7293. jQuery.expr.filters.animated = function( elem ) {
  7294. return jQuery.grep(jQuery.timers, function( fn ) {
  7295. return elem === fn.elem;
  7296. }).length;
  7297. };
  7298. }
  7299. // Try to restore the default display value of an element
  7300. function defaultDisplay( nodeName ) {
  7301. if ( !elemdisplay[ nodeName ] ) {
  7302. var body = document.body,
  7303. elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
  7304. display = elem.css( "display" );
  7305. elem.remove();
  7306. // If the simple way fails,
  7307. // get element's real default display by attaching it to a temp iframe
  7308. if ( display === "none" || display === "" ) {
  7309. // No iframe to use yet, so create it
  7310. if ( !iframe ) {
  7311. iframe = document.createElement( "iframe" );
  7312. iframe.frameBorder = iframe.width = iframe.height = 0;
  7313. }
  7314. body.appendChild( iframe );
  7315. // Create a cacheable copy of the iframe document on first call.
  7316. // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
  7317. // document to it; WebKit & Firefox won't allow reusing the iframe document.
  7318. if ( !iframeDoc || !iframe.createElement ) {
  7319. iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
  7320. iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
  7321. iframeDoc.close();
  7322. }
  7323. elem = iframeDoc.createElement( nodeName );
  7324. iframeDoc.body.appendChild( elem );
  7325. display = jQuery.css( elem, "display" );
  7326. body.removeChild( iframe );
  7327. }
  7328. // Store the correct default display
  7329. elemdisplay[ nodeName ] = display;
  7330. }
  7331. return elemdisplay[ nodeName ];
  7332. }
  7333. var rtable = /^t(?:able|d|h)$/i,
  7334. rroot = /^(?:body|html)$/i;
  7335. if ( "getBoundingClientRect" in document.documentElement ) {
  7336. jQuery.fn.offset = function( options ) {
  7337. var elem = this[0], box;
  7338. if ( options ) {
  7339. return this.each(function( i ) {
  7340. jQuery.offset.setOffset( this, options, i );
  7341. });
  7342. }
  7343. if ( !elem || !elem.ownerDocument ) {
  7344. return null;
  7345. }
  7346. if ( elem === elem.ownerDocument.body ) {
  7347. return jQuery.offset.bodyOffset( elem );
  7348. }
  7349. try {
  7350. box = elem.getBoundingClientRect();
  7351. } catch(e) {}
  7352. var doc = elem.ownerDocument,
  7353. docElem = doc.documentElement;
  7354. // Make sure we're not dealing with a disconnected DOM node
  7355. if ( !box || !jQuery.contains( docElem, elem ) ) {
  7356. return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
  7357. }
  7358. var body = doc.body,
  7359. win = getWindow(doc),
  7360. clientTop = docElem.clientTop || body.clientTop || 0,
  7361. clientLeft = docElem.clientLeft || body.clientLeft || 0,
  7362. scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
  7363. scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
  7364. top = box.top + scrollTop - clientTop,
  7365. left = box.left + scrollLeft - clientLeft;
  7366. return { top: top, left: left };
  7367. };
  7368. } else {
  7369. jQuery.fn.offset = function( options ) {
  7370. var elem = this[0];
  7371. if ( options ) {
  7372. return this.each(function( i ) {
  7373. jQuery.offset.setOffset( this, options, i );
  7374. });
  7375. }
  7376. if ( !elem || !elem.ownerDocument ) {
  7377. return null;
  7378. }
  7379. if ( elem === elem.ownerDocument.body ) {
  7380. return jQuery.offset.bodyOffset( elem );
  7381. }
  7382. var computedStyle,
  7383. offsetParent = elem.offsetParent,
  7384. prevOffsetParent = elem,
  7385. doc = elem.ownerDocument,
  7386. docElem = doc.documentElement,
  7387. body = doc.body,
  7388. defaultView = doc.defaultView,
  7389. prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
  7390. top = elem.offsetTop,
  7391. left = elem.offsetLeft;
  7392. while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
  7393. if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
  7394. break;
  7395. }
  7396. computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
  7397. top -= elem.scrollTop;
  7398. left -= elem.scrollLeft;
  7399. if ( elem === offsetParent ) {
  7400. top += elem.offsetTop;
  7401. left += elem.offsetLeft;
  7402. if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
  7403. top += parseFloat( computedStyle.borderTopWidth ) || 0;
  7404. left += parseFloat( computedStyle.borderLeftWidth ) || 0;
  7405. }
  7406. prevOffsetParent = offsetParent;
  7407. offsetParent = elem.offsetParent;
  7408. }
  7409. if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
  7410. top += parseFloat( computedStyle.borderTopWidth ) || 0;
  7411. left += parseFloat( computedStyle.borderLeftWidth ) || 0;
  7412. }
  7413. prevComputedStyle = computedStyle;
  7414. }
  7415. if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
  7416. top += body.offsetTop;
  7417. left += body.offsetLeft;
  7418. }
  7419. if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
  7420. top += Math.max( docElem.scrollTop, body.scrollTop );
  7421. left += Math.max( docElem.scrollLeft, body.scrollLeft );
  7422. }
  7423. return { top: top, left: left };
  7424. };
  7425. }
  7426. jQuery.offset = {
  7427. bodyOffset: function( body ) {
  7428. var top = body.offsetTop,
  7429. left = body.offsetLeft;
  7430. if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
  7431. top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
  7432. left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
  7433. }
  7434. return { top: top, left: left };
  7435. },
  7436. setOffset: function( elem, options, i ) {
  7437. var position = jQuery.css( elem, "position" );
  7438. // set position first, in-case top/left are set even on static elem
  7439. if ( position === "static" ) {
  7440. elem.style.position = "relative";
  7441. }
  7442. var curElem = jQuery( elem ),
  7443. curOffset = curElem.offset(),
  7444. curCSSTop = jQuery.css( elem, "top" ),
  7445. curCSSLeft = jQuery.css( elem, "left" ),
  7446. calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
  7447. props = {}, curPosition = {}, curTop, curLeft;
  7448. // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
  7449. if ( calculatePosition ) {
  7450. curPosition = curElem.position();
  7451. curTop = curPosition.top;
  7452. curLeft = curPosition.left;
  7453. } else {
  7454. curTop = parseFloat( curCSSTop ) || 0;
  7455. curLeft = parseFloat( curCSSLeft ) || 0;
  7456. }
  7457. if ( jQuery.isFunction( options ) ) {
  7458. options = options.call( elem, i, curOffset );
  7459. }
  7460. if ( options.top != null ) {
  7461. props.top = ( options.top - curOffset.top ) + curTop;
  7462. }
  7463. if ( options.left != null ) {
  7464. props.left = ( options.left - curOffset.left ) + curLeft;
  7465. }
  7466. if ( "using" in options ) {
  7467. options.using.call( elem, props );
  7468. } else {
  7469. curElem.css( props );
  7470. }
  7471. }
  7472. };
  7473. jQuery.fn.extend({
  7474. position: function() {
  7475. if ( !this[0] ) {
  7476. return null;
  7477. }
  7478. var elem = this[0],
  7479. // Get *real* offsetParent
  7480. offsetParent = this.offsetParent(),
  7481. // Get correct offsets
  7482. offset = this.offset(),
  7483. parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
  7484. // Subtract element margins
  7485. // note: when an element has margin: auto the offsetLeft and marginLeft
  7486. // are the same in Safari causing offset.left to incorrectly be 0
  7487. offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
  7488. offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
  7489. // Add offsetParent borders
  7490. parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
  7491. parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
  7492. // Subtract the two offsets
  7493. return {
  7494. top: offset.top - parentOffset.top,
  7495. left: offset.left - parentOffset.left
  7496. };
  7497. },
  7498. offsetParent: function() {
  7499. return this.map(function() {
  7500. var offsetParent = this.offsetParent || document.body;
  7501. while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
  7502. offsetParent = offsetParent.offsetParent;
  7503. }
  7504. return offsetParent;
  7505. });
  7506. }
  7507. });
  7508. // Create scrollLeft and scrollTop methods
  7509. jQuery.each( ["Left", "Top"], function( i, name ) {
  7510. var method = "scroll" + name;
  7511. jQuery.fn[ method ] = function( val ) {
  7512. var elem, win;
  7513. if ( val === undefined ) {
  7514. elem = this[ 0 ];
  7515. if ( !elem ) {
  7516. return null;
  7517. }
  7518. win = getWindow( elem );
  7519. // Return the scroll offset
  7520. return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
  7521. jQuery.support.boxModel && win.document.documentElement[ method ] ||
  7522. win.document.body[ method ] :
  7523. elem[ method ];
  7524. }
  7525. // Set the scroll offset
  7526. return this.each(function() {
  7527. win = getWindow( this );
  7528. if ( win ) {
  7529. win.scrollTo(
  7530. !i ? val : jQuery( win ).scrollLeft(),
  7531. i ? val : jQuery( win ).scrollTop()
  7532. );
  7533. } else {
  7534. this[ method ] = val;
  7535. }
  7536. });
  7537. };
  7538. });
  7539. function getWindow( elem ) {
  7540. return jQuery.isWindow( elem ) ?
  7541. elem :
  7542. elem.nodeType === 9 ?
  7543. elem.defaultView || elem.parentWindow :
  7544. false;
  7545. }
  7546. // Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
  7547. jQuery.each([ "Height", "Width" ], function( i, name ) {
  7548. var type = name.toLowerCase();
  7549. // innerHeight and innerWidth
  7550. jQuery.fn[ "inner" + name ] = function() {
  7551. var elem = this[0];
  7552. return elem ?
  7553. elem.style ?
  7554. parseFloat( jQuery.css( elem, type, "padding" ) ) :
  7555. this[ type ]() :
  7556. null;
  7557. };
  7558. // outerHeight and outerWidth
  7559. jQuery.fn[ "outer" + name ] = function( margin ) {
  7560. var elem = this[0];
  7561. return elem ?
  7562. elem.style ?
  7563. parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
  7564. this[ type ]() :
  7565. null;
  7566. };
  7567. jQuery.fn[ type ] = function( size ) {
  7568. // Get window width or height
  7569. var elem = this[0];
  7570. if ( !elem ) {
  7571. return size == null ? null : this;
  7572. }
  7573. if ( jQuery.isFunction( size ) ) {
  7574. return this.each(function( i ) {
  7575. var self = jQuery( this );
  7576. self[ type ]( size.call( this, i, self[ type ]() ) );
  7577. });
  7578. }
  7579. if ( jQuery.isWindow( elem ) ) {
  7580. // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
  7581. // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
  7582. var docElemProp = elem.document.documentElement[ "client" + name ],
  7583. body = elem.document.body;
  7584. return elem.document.compatMode === "CSS1Compat" && docElemProp ||
  7585. body && body[ "client" + name ] || docElemProp;
  7586. // Get document width or height
  7587. } else if ( elem.nodeType === 9 ) {
  7588. // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
  7589. return Math.max(
  7590. elem.documentElement["client" + name],
  7591. elem.body["scroll" + name], elem.documentElement["scroll" + name],
  7592. elem.body["offset" + name], elem.documentElement["offset" + name]
  7593. );
  7594. // Get or set width or height on the element
  7595. } else if ( size === undefined ) {
  7596. var orig = jQuery.css( elem, type ),
  7597. ret = parseFloat( orig );
  7598. return jQuery.isNumeric( ret ) ? ret : orig;
  7599. // Set the width or height on the element (default to pixels if value is unitless)
  7600. } else {
  7601. return this.css( type, typeof size === "string" ? size : size + "px" );
  7602. }
  7603. };
  7604. });
  7605. // Expose jQuery to the global object
  7606. window.jQuery = window.$ = jQuery;
  7607. // Expose jQuery as an AMD module, but only for AMD loaders that
  7608. // understand the issues with loading multiple versions of jQuery
  7609. // in a page that all might call define(). The loader will indicate
  7610. // they have special allowances for multiple jQuery versions by
  7611. // specifying define.amd.jQuery = true. Register as a named module,
  7612. // since jQuery can be concatenated with other files that may use define,
  7613. // but not use a proper concatenation script that understands anonymous
  7614. // AMD modules. A named AMD is safest and most robust way to register.
  7615. // Lowercase jquery is used because AMD module names are derived from
  7616. // file names, and jQuery is normally delivered in a lowercase file name.
  7617. // Do this after creating the global so that if an AMD module wants to call
  7618. // noConflict to hide this version of jQuery, it will work.
  7619. if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
  7620. define( "jquery", [], function () { return jQuery; } );
  7621. }
  7622. })( window );