Digital Office Automation System Backend
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

jquery.js 242KB

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