jquery-1.10.0.js 267 KB

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