No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

jquery-1.9.1.js 264KB

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