5b57851b09022c5e5f3a5fd08152b2dc12671974.svn-base 278 KB

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