a1e5eb205485a421c90b1dface8d231d80fbd5c7.svn-base 278 KB

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