jquery.js 242 KB

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