jquery.1.11.1.js 276 KB

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