Brak opisu
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-vsdoc.js 250KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747
  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. * This file has been generated to support Visual Studio IntelliSense.
  21. * You should not use this file at runtime inside the browser--it is only
  22. * intended to be used only for design-time IntelliSense. Please use the
  23. * standard jQuery library for all runtime use.
  24. *
  25. * Comment version: 1.9.1
  26. */
  27. /*!
  28. * jQuery JavaScript Library v1.9.1
  29. * http://jquery.com/
  30. *
  31. * Includes Sizzle.js
  32. * http://sizzlejs.com/
  33. *
  34. * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
  35. * Released under the MIT license
  36. * http://jquery.org/license
  37. *
  38. */
  39. (function (window, undefined) {
  40. var jQuery = function (selector, context) {
  41. /// <summary>
  42. /// 1: Accepts a string containing a CSS selector which is then used to match a set of elements.
  43. /// &#10; 1.1 - $(selector, context)
  44. /// &#10; 1.2 - $(element)
  45. /// &#10; 1.3 - $(elementArray)
  46. /// &#10; 1.4 - $(object)
  47. /// &#10; 1.5 - $(jQuery object)
  48. /// &#10; 1.6 - $()
  49. /// &#10;2: Creates DOM elements on the fly from the provided string of raw HTML.
  50. /// &#10; 2.1 - $(html, ownerDocument)
  51. /// &#10; 2.2 - $(html, attributes)
  52. /// &#10;3: Binds a function to be executed when the DOM has finished loading.
  53. /// &#10; 3.1 - $(callback)
  54. /// </summary>
  55. /// <param name="selector" type="String">
  56. /// A string containing a selector expression
  57. /// </param>
  58. /// <param name="context" type="jQuery">
  59. /// A DOM Element, Document, or jQuery to use as context
  60. /// </param>
  61. /// <returns type="jQuery" />
  62. // The jQuery object is actually just the init constructor 'enhanced'
  63. return new jQuery.fn.init(selector, context, rootjQuery);
  64. };
  65. jQuery.Animation = function Animation(elem, properties, options) {
  66. var result,
  67. stopped,
  68. index = 0,
  69. length = animationPrefilters.length,
  70. deferred = jQuery.Deferred().always(function () {
  71. // don't match elem in the :animated selector
  72. delete tick.elem;
  73. }),
  74. tick = function () {
  75. if (stopped) {
  76. return false;
  77. }
  78. var currentTime = fxNow || createFxNow(),
  79. remaining = Math.max(0, animation.startTime + animation.duration - currentTime),
  80. // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
  81. temp = remaining / animation.duration || 0,
  82. percent = 1 - temp,
  83. index = 0,
  84. length = animation.tweens.length;
  85. for (; index < length ; index++) {
  86. animation.tweens[index].run(percent);
  87. }
  88. deferred.notifyWith(elem, [animation, percent, remaining]);
  89. if (percent < 1 && length) {
  90. return remaining;
  91. } else {
  92. deferred.resolveWith(elem, [animation]);
  93. return false;
  94. }
  95. },
  96. animation = deferred.promise({
  97. elem: elem,
  98. props: jQuery.extend({}, properties),
  99. opts: jQuery.extend(true, { specialEasing: {} }, options),
  100. originalProperties: properties,
  101. originalOptions: options,
  102. startTime: fxNow || createFxNow(),
  103. duration: options.duration,
  104. tweens: [],
  105. createTween: function (prop, end) {
  106. var tween = jQuery.Tween(elem, animation.opts, prop, end,
  107. animation.opts.specialEasing[prop] || animation.opts.easing);
  108. animation.tweens.push(tween);
  109. return tween;
  110. },
  111. stop: function (gotoEnd) {
  112. var index = 0,
  113. // if we are going to the end, we want to run all the tweens
  114. // otherwise we skip this part
  115. length = gotoEnd ? animation.tweens.length : 0;
  116. if (stopped) {
  117. return this;
  118. }
  119. stopped = true;
  120. for (; index < length ; index++) {
  121. animation.tweens[index].run(1);
  122. }
  123. // resolve when we played the last frame
  124. // otherwise, reject
  125. if (gotoEnd) {
  126. deferred.resolveWith(elem, [animation, gotoEnd]);
  127. } else {
  128. deferred.rejectWith(elem, [animation, gotoEnd]);
  129. }
  130. return this;
  131. }
  132. }),
  133. props = animation.props;
  134. propFilter(props, animation.opts.specialEasing);
  135. for (; index < length ; index++) {
  136. result = animationPrefilters[index].call(animation, elem, props, animation.opts);
  137. if (result) {
  138. return result;
  139. }
  140. }
  141. createTweens(animation, props);
  142. if (jQuery.isFunction(animation.opts.start)) {
  143. animation.opts.start.call(elem, animation);
  144. }
  145. jQuery.fx.timer(
  146. jQuery.extend(tick, {
  147. elem: elem,
  148. anim: animation,
  149. queue: animation.opts.queue
  150. })
  151. );
  152. // attach callbacks from options
  153. return animation.progress(animation.opts.progress)
  154. .done(animation.opts.done, animation.opts.complete)
  155. .fail(animation.opts.fail)
  156. .always(animation.opts.always);
  157. };
  158. jQuery.Callbacks = function (options) {
  159. /// <summary>
  160. /// A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
  161. /// </summary>
  162. /// <param name="options" type="String">
  163. /// An optional list of space-separated flags that change how the callback list behaves.
  164. /// </param>
  165. /// <returns type="Callbacks" />
  166. // Convert options from String-formatted to Object-formatted if needed
  167. // (we check in cache first)
  168. options = typeof options === "string" ?
  169. (optionsCache[options] || createOptions(options)) :
  170. jQuery.extend({}, options);
  171. var // Flag to know if list is currently firing
  172. firing,
  173. // Last fire value (for non-forgettable lists)
  174. memory,
  175. // Flag to know if list was already fired
  176. fired,
  177. // End of the loop when firing
  178. firingLength,
  179. // Index of currently firing callback (modified by remove if needed)
  180. firingIndex,
  181. // First callback to fire (used internally by add and fireWith)
  182. firingStart,
  183. // Actual callback list
  184. list = [],
  185. // Stack of fire calls for repeatable lists
  186. stack = !options.once && [],
  187. // Fire callbacks
  188. fire = function (data) {
  189. memory = options.memory && data;
  190. fired = true;
  191. firingIndex = firingStart || 0;
  192. firingStart = 0;
  193. firingLength = list.length;
  194. firing = true;
  195. for (; list && firingIndex < firingLength; firingIndex++) {
  196. if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
  197. memory = false; // To prevent further calls using add
  198. break;
  199. }
  200. }
  201. firing = false;
  202. if (list) {
  203. if (stack) {
  204. if (stack.length) {
  205. fire(stack.shift());
  206. }
  207. } else if (memory) {
  208. list = [];
  209. } else {
  210. self.disable();
  211. }
  212. }
  213. },
  214. // Actual Callbacks object
  215. self = {
  216. // Add a callback or a collection of callbacks to the list
  217. add: function () {
  218. if (list) {
  219. // First, we save the current length
  220. var start = list.length;
  221. (function add(args) {
  222. jQuery.each(args, function (_, arg) {
  223. var type = jQuery.type(arg);
  224. if (type === "function") {
  225. if (!options.unique || !self.has(arg)) {
  226. list.push(arg);
  227. }
  228. } else if (arg && arg.length && type !== "string") {
  229. // Inspect recursively
  230. add(arg);
  231. }
  232. });
  233. })(arguments);
  234. // Do we need to add the callbacks to the
  235. // current firing batch?
  236. if (firing) {
  237. firingLength = list.length;
  238. // With memory, if we're not firing then
  239. // we should call right away
  240. } else if (memory) {
  241. firingStart = start;
  242. fire(memory);
  243. }
  244. }
  245. return this;
  246. },
  247. // Remove a callback from the list
  248. remove: function () {
  249. if (list) {
  250. jQuery.each(arguments, function (_, arg) {
  251. var index;
  252. while ((index = jQuery.inArray(arg, list, index)) > -1) {
  253. list.splice(index, 1);
  254. // Handle firing indexes
  255. if (firing) {
  256. if (index <= firingLength) {
  257. firingLength--;
  258. }
  259. if (index <= firingIndex) {
  260. firingIndex--;
  261. }
  262. }
  263. }
  264. });
  265. }
  266. return this;
  267. },
  268. // Check if a given callback is in the list.
  269. // If no argument is given, return whether or not list has callbacks attached.
  270. has: function (fn) {
  271. return fn ? jQuery.inArray(fn, list) > -1 : !!(list && list.length);
  272. },
  273. // Remove all callbacks from the list
  274. empty: function () {
  275. list = [];
  276. return this;
  277. },
  278. // Have the list do nothing anymore
  279. disable: function () {
  280. list = stack = memory = undefined;
  281. return this;
  282. },
  283. // Is it disabled?
  284. disabled: function () {
  285. return !list;
  286. },
  287. // Lock the list in its current state
  288. lock: function () {
  289. stack = undefined;
  290. if (!memory) {
  291. self.disable();
  292. }
  293. return this;
  294. },
  295. // Is it locked?
  296. locked: function () {
  297. return !stack;
  298. },
  299. // Call all callbacks with the given context and arguments
  300. fireWith: function (context, args) {
  301. args = args || [];
  302. args = [context, args.slice ? args.slice() : args];
  303. if (list && (!fired || stack)) {
  304. if (firing) {
  305. stack.push(args);
  306. } else {
  307. fire(args);
  308. }
  309. }
  310. return this;
  311. },
  312. // Call all the callbacks with the given arguments
  313. fire: function () {
  314. self.fireWith(this, arguments);
  315. return this;
  316. },
  317. // To know if the callbacks have already been called at least once
  318. fired: function () {
  319. return !!fired;
  320. }
  321. };
  322. return self;
  323. };
  324. jQuery.Deferred = function (func) {
  325. /// <summary>
  326. /// A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.
  327. /// </summary>
  328. /// <param name="func" type="Function">
  329. /// A function that is called just before the constructor returns.
  330. /// </param>
  331. /// <returns type="Deferred" />
  332. var tuples = [
  333. // action, add listener, listener list, final state
  334. ["resolve", "done", jQuery.Callbacks("once memory"), "resolved"],
  335. ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"],
  336. ["notify", "progress", jQuery.Callbacks("memory")]
  337. ],
  338. state = "pending",
  339. promise = {
  340. state: function () {
  341. return state;
  342. },
  343. always: function () {
  344. deferred.done(arguments).fail(arguments);
  345. return this;
  346. },
  347. then: function ( /* fnDone, fnFail, fnProgress */) {
  348. var fns = arguments;
  349. return jQuery.Deferred(function (newDefer) {
  350. jQuery.each(tuples, function (i, tuple) {
  351. var action = tuple[0],
  352. fn = jQuery.isFunction(fns[i]) && fns[i];
  353. // deferred[ done | fail | progress ] for forwarding actions to newDefer
  354. deferred[tuple[1]](function () {
  355. var returned = fn && fn.apply(this, arguments);
  356. if (returned && jQuery.isFunction(returned.promise)) {
  357. returned.promise()
  358. .done(newDefer.resolve)
  359. .fail(newDefer.reject)
  360. .progress(newDefer.notify);
  361. } else {
  362. newDefer[action + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);
  363. }
  364. });
  365. });
  366. fns = null;
  367. }).promise();
  368. },
  369. // Get a promise for this deferred
  370. // If obj is provided, the promise aspect is added to the object
  371. promise: function (obj) {
  372. return obj != null ? jQuery.extend(obj, promise) : promise;
  373. }
  374. },
  375. deferred = {};
  376. // Keep pipe for back-compat
  377. promise.pipe = promise.then;
  378. // Add list-specific methods
  379. jQuery.each(tuples, function (i, tuple) {
  380. var list = tuple[2],
  381. stateString = tuple[3];
  382. // promise[ done | fail | progress ] = list.add
  383. promise[tuple[1]] = list.add;
  384. // Handle state
  385. if (stateString) {
  386. list.add(function () {
  387. // state = [ resolved | rejected ]
  388. state = stateString;
  389. // [ reject_list | resolve_list ].disable; progress_list.lock
  390. }, tuples[i ^ 1][2].disable, tuples[2][2].lock);
  391. }
  392. // deferred[ resolve | reject | notify ]
  393. deferred[tuple[0]] = function () {
  394. deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments);
  395. return this;
  396. };
  397. deferred[tuple[0] + "With"] = list.fireWith;
  398. });
  399. // Make the deferred a promise
  400. promise.promise(deferred);
  401. // Call given func if any
  402. if (func) {
  403. func.call(deferred, deferred);
  404. }
  405. // All done!
  406. return deferred;
  407. };
  408. jQuery.Event = function (src, props) {
  409. // Allow instantiation without the 'new' keyword
  410. if (!(this instanceof jQuery.Event)) {
  411. return new jQuery.Event(src, props);
  412. }
  413. // Event object
  414. if (src && src.type) {
  415. this.originalEvent = src;
  416. this.type = src.type;
  417. // Events bubbling up the document may have been marked as prevented
  418. // by a handler lower down the tree; reflect the correct value.
  419. this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
  420. src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
  421. // Event type
  422. } else {
  423. this.type = src;
  424. }
  425. // Put explicitly provided properties onto the event object
  426. if (props) {
  427. jQuery.extend(this, props);
  428. }
  429. // Create a timestamp if incoming event doesn't have one
  430. this.timeStamp = src && src.timeStamp || jQuery.now();
  431. // Mark it as fixed
  432. this[jQuery.expando] = true;
  433. };
  434. jQuery.Tween = function Tween(elem, options, prop, end, easing) {
  435. return new Tween.prototype.init(elem, options, prop, end, easing);
  436. };
  437. jQuery._data = function (elem, name, data) {
  438. return internalData(elem, name, data, true);
  439. };
  440. jQuery._queueHooks = function (elem, type) {
  441. var key = type + "queueHooks";
  442. return jQuery._data(elem, key) || jQuery._data(elem, key, {
  443. empty: jQuery.Callbacks("once memory").add(function () {
  444. jQuery._removeData(elem, type + "queue");
  445. jQuery._removeData(elem, key);
  446. })
  447. });
  448. };
  449. jQuery._removeData = function (elem, name) {
  450. return internalRemoveData(elem, name, true);
  451. };
  452. jQuery.acceptData = function (elem) {
  453. // Do not set data on non-element because it will not be cleared (#8335).
  454. if (elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9) {
  455. return false;
  456. }
  457. var noData = elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()];
  458. // nodes accept data unless otherwise specified; rejection can be conditional
  459. return !noData || noData !== true && elem.getAttribute("classid") === noData;
  460. };
  461. jQuery.access = function (elems, fn, key, value, chainable, emptyGet, raw) {
  462. var i = 0,
  463. length = elems.length,
  464. bulk = key == null;
  465. // Sets many values
  466. if (jQuery.type(key) === "object") {
  467. chainable = true;
  468. for (i in key) {
  469. jQuery.access(elems, fn, i, key[i], true, emptyGet, raw);
  470. }
  471. // Sets one value
  472. } else if (value !== undefined) {
  473. chainable = true;
  474. if (!jQuery.isFunction(value)) {
  475. raw = true;
  476. }
  477. if (bulk) {
  478. // Bulk operations run against the entire set
  479. if (raw) {
  480. fn.call(elems, value);
  481. fn = null;
  482. // ...except when executing function values
  483. } else {
  484. bulk = fn;
  485. fn = function (elem, key, value) {
  486. return bulk.call(jQuery(elem), value);
  487. };
  488. }
  489. }
  490. if (fn) {
  491. for (; i < length; i++) {
  492. fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
  493. }
  494. }
  495. }
  496. return chainable ?
  497. elems :
  498. // Gets
  499. bulk ?
  500. fn.call(elems) :
  501. length ? fn(elems[0], key) : emptyGet;
  502. };
  503. jQuery.active = 0;
  504. jQuery.ajax = function (url, options) {
  505. /// <summary>
  506. /// Perform an asynchronous HTTP (Ajax) request.
  507. /// &#10;1 - jQuery.ajax(url, settings)
  508. /// &#10;2 - jQuery.ajax(settings)
  509. /// </summary>
  510. /// <param name="url" type="String">
  511. /// A string containing the URL to which the request is sent.
  512. /// </param>
  513. /// <param name="options" type="PlainObject">
  514. /// A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings.
  515. /// </param>
  516. // If url is an object, simulate pre-1.5 signature
  517. if (typeof url === "object") {
  518. options = url;
  519. url = undefined;
  520. }
  521. // Force options to be an object
  522. options = options || {};
  523. var // Cross-domain detection vars
  524. parts,
  525. // Loop variable
  526. i,
  527. // URL without anti-cache param
  528. cacheURL,
  529. // Response headers as string
  530. responseHeadersString,
  531. // timeout handle
  532. timeoutTimer,
  533. // To know if global events are to be dispatched
  534. fireGlobals,
  535. transport,
  536. // Response headers
  537. responseHeaders,
  538. // Create the final options object
  539. s = jQuery.ajaxSetup({}, options),
  540. // Callbacks context
  541. callbackContext = s.context || s,
  542. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  543. globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ?
  544. jQuery(callbackContext) :
  545. jQuery.event,
  546. // Deferreds
  547. deferred = jQuery.Deferred(),
  548. completeDeferred = jQuery.Callbacks("once memory"),
  549. // Status-dependent callbacks
  550. statusCode = s.statusCode || {},
  551. // Headers (they are sent all at once)
  552. requestHeaders = {},
  553. requestHeadersNames = {},
  554. // The jqXHR state
  555. state = 0,
  556. // Default abort message
  557. strAbort = "canceled",
  558. // Fake xhr
  559. jqXHR = {
  560. readyState: 0,
  561. // Builds headers hashtable if needed
  562. getResponseHeader: function (key) {
  563. var match;
  564. if (state === 2) {
  565. if (!responseHeaders) {
  566. responseHeaders = {};
  567. while ((match = rheaders.exec(responseHeadersString))) {
  568. responseHeaders[match[1].toLowerCase()] = match[2];
  569. }
  570. }
  571. match = responseHeaders[key.toLowerCase()];
  572. }
  573. return match == null ? null : match;
  574. },
  575. // Raw string
  576. getAllResponseHeaders: function () {
  577. return state === 2 ? responseHeadersString : null;
  578. },
  579. // Caches the header
  580. setRequestHeader: function (name, value) {
  581. var lname = name.toLowerCase();
  582. if (!state) {
  583. name = requestHeadersNames[lname] = requestHeadersNames[lname] || name;
  584. requestHeaders[name] = value;
  585. }
  586. return this;
  587. },
  588. // Overrides response content-type header
  589. overrideMimeType: function (type) {
  590. if (!state) {
  591. s.mimeType = type;
  592. }
  593. return this;
  594. },
  595. // Status-dependent callbacks
  596. statusCode: function (map) {
  597. var code;
  598. if (map) {
  599. if (state < 2) {
  600. for (code in map) {
  601. // Lazy-add the new callback in a way that preserves old ones
  602. statusCode[code] = [statusCode[code], map[code]];
  603. }
  604. } else {
  605. // Execute the appropriate callbacks
  606. jqXHR.always(map[jqXHR.status]);
  607. }
  608. }
  609. return this;
  610. },
  611. // Cancel the request
  612. abort: function (statusText) {
  613. var finalText = statusText || strAbort;
  614. if (transport) {
  615. transport.abort(finalText);
  616. }
  617. done(0, finalText);
  618. return this;
  619. }
  620. };
  621. // Attach deferreds
  622. deferred.promise(jqXHR).complete = completeDeferred.add;
  623. jqXHR.success = jqXHR.done;
  624. jqXHR.error = jqXHR.fail;
  625. // Remove hash character (#7531: and string promotion)
  626. // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
  627. // Handle falsy url in the settings object (#10093: consistency with old signature)
  628. // We also use the url parameter if available
  629. s.url = ((url || s.url || ajaxLocation) + "").replace(rhash, "").replace(rprotocol, ajaxLocParts[1] + "//");
  630. // Alias method option to type as per ticket #12004
  631. s.type = options.method || options.type || s.method || s.type;
  632. // Extract dataTypes list
  633. s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(core_rnotwhite) || [""];
  634. // A cross-domain request is in order when we have a protocol:host:port mismatch
  635. if (s.crossDomain == null) {
  636. parts = rurl.exec(s.url.toLowerCase());
  637. s.crossDomain = !!(parts &&
  638. (parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] ||
  639. (parts[3] || (parts[1] === "http:" ? 80 : 443)) !=
  640. (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? 80 : 443)))
  641. );
  642. }
  643. // Convert data if not already a string
  644. if (s.data && s.processData && typeof s.data !== "string") {
  645. s.data = jQuery.param(s.data, s.traditional);
  646. }
  647. // Apply prefilters
  648. inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
  649. // If request was aborted inside a prefilter, stop there
  650. if (state === 2) {
  651. return jqXHR;
  652. }
  653. // We can fire global events as of now if asked to
  654. fireGlobals = s.global;
  655. // Watch for a new set of requests
  656. if (fireGlobals && jQuery.active++ === 0) {
  657. jQuery.event.trigger("ajaxStart");
  658. }
  659. // Uppercase the type
  660. s.type = s.type.toUpperCase();
  661. // Determine if request has content
  662. s.hasContent = !rnoContent.test(s.type);
  663. // Save the URL in case we're toying with the If-Modified-Since
  664. // and/or If-None-Match header later on
  665. cacheURL = s.url;
  666. // More options handling for requests with no content
  667. if (!s.hasContent) {
  668. // If data is available, append data to url
  669. if (s.data) {
  670. cacheURL = (s.url += (ajax_rquery.test(cacheURL) ? "&" : "?") + s.data);
  671. // #9682: remove data so that it's not used in an eventual retry
  672. delete s.data;
  673. }
  674. // Add anti-cache in url if needed
  675. if (s.cache === false) {
  676. s.url = rts.test(cacheURL) ?
  677. // If there is already a '_' parameter, set its value
  678. cacheURL.replace(rts, "$1_=" + ajax_nonce++) :
  679. // Otherwise add one to the end
  680. cacheURL + (ajax_rquery.test(cacheURL) ? "&" : "?") + "_=" + ajax_nonce++;
  681. }
  682. }
  683. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  684. if (s.ifModified) {
  685. if (jQuery.lastModified[cacheURL]) {
  686. jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
  687. }
  688. if (jQuery.etag[cacheURL]) {
  689. jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
  690. }
  691. }
  692. // Set the correct header, if data is being sent
  693. if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
  694. jqXHR.setRequestHeader("Content-Type", s.contentType);
  695. }
  696. // Set the Accepts header for the server, depending on the dataType
  697. jqXHR.setRequestHeader(
  698. "Accept",
  699. s.dataTypes[0] && s.accepts[s.dataTypes[0]] ?
  700. s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") :
  701. s.accepts["*"]
  702. );
  703. // Check for headers option
  704. for (i in s.headers) {
  705. jqXHR.setRequestHeader(i, s.headers[i]);
  706. }
  707. // Allow custom headers/mimetypes and early abort
  708. if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2)) {
  709. // Abort if not done already and return
  710. return jqXHR.abort();
  711. }
  712. // aborting is no longer a cancellation
  713. strAbort = "abort";
  714. // Install callbacks on deferreds
  715. for (i in { success: 1, error: 1, complete: 1 }) {
  716. jqXHR[i](s[i]);
  717. }
  718. // Get transport
  719. transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
  720. // If no transport, we auto-abort
  721. if (!transport) {
  722. done(-1, "No Transport");
  723. } else {
  724. jqXHR.readyState = 1;
  725. // Send global event
  726. if (fireGlobals) {
  727. globalEventContext.trigger("ajaxSend", [jqXHR, s]);
  728. }
  729. // Timeout
  730. if (s.async && s.timeout > 0) {
  731. timeoutTimer = setTimeout(function () {
  732. jqXHR.abort("timeout");
  733. }, s.timeout);
  734. }
  735. try {
  736. state = 1;
  737. transport.send(requestHeaders, done);
  738. } catch (e) {
  739. // Propagate exception as error if not done
  740. if (state < 2) {
  741. done(-1, e);
  742. // Simply rethrow otherwise
  743. } else {
  744. throw e;
  745. }
  746. }
  747. }
  748. // Callback for when everything is done
  749. function done(status, nativeStatusText, responses, headers) {
  750. var isSuccess, success, error, response, modified,
  751. statusText = nativeStatusText;
  752. // Called once
  753. if (state === 2) {
  754. return;
  755. }
  756. // State is "done" now
  757. state = 2;
  758. // Clear timeout if it exists
  759. if (timeoutTimer) {
  760. clearTimeout(timeoutTimer);
  761. }
  762. // Dereference transport for early garbage collection
  763. // (no matter how long the jqXHR object will be used)
  764. transport = undefined;
  765. // Cache response headers
  766. responseHeadersString = headers || "";
  767. // Set readyState
  768. jqXHR.readyState = status > 0 ? 4 : 0;
  769. // Get response data
  770. if (responses) {
  771. response = ajaxHandleResponses(s, jqXHR, responses);
  772. }
  773. // If successful, handle type chaining
  774. if (status >= 200 && status < 300 || status === 304) {
  775. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  776. if (s.ifModified) {
  777. modified = jqXHR.getResponseHeader("Last-Modified");
  778. if (modified) {
  779. jQuery.lastModified[cacheURL] = modified;
  780. }
  781. modified = jqXHR.getResponseHeader("etag");
  782. if (modified) {
  783. jQuery.etag[cacheURL] = modified;
  784. }
  785. }
  786. // if no content
  787. if (status === 204) {
  788. isSuccess = true;
  789. statusText = "nocontent";
  790. // if not modified
  791. } else if (status === 304) {
  792. isSuccess = true;
  793. statusText = "notmodified";
  794. // If we have data, let's convert it
  795. } else {
  796. isSuccess = ajaxConvert(s, response);
  797. statusText = isSuccess.state;
  798. success = isSuccess.data;
  799. error = isSuccess.error;
  800. isSuccess = !error;
  801. }
  802. } else {
  803. // We extract error from statusText
  804. // then normalize statusText and status for non-aborts
  805. error = statusText;
  806. if (status || !statusText) {
  807. statusText = "error";
  808. if (status < 0) {
  809. status = 0;
  810. }
  811. }
  812. }
  813. // Set data for the fake xhr object
  814. jqXHR.status = status;
  815. jqXHR.statusText = (nativeStatusText || statusText) + "";
  816. // Success/Error
  817. if (isSuccess) {
  818. deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
  819. } else {
  820. deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
  821. }
  822. // Status-dependent callbacks
  823. jqXHR.statusCode(statusCode);
  824. statusCode = undefined;
  825. if (fireGlobals) {
  826. globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError",
  827. [jqXHR, s, isSuccess ? success : error]);
  828. }
  829. // Complete
  830. completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
  831. if (fireGlobals) {
  832. globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
  833. // Handle the global AJAX counter
  834. if (!(--jQuery.active)) {
  835. jQuery.event.trigger("ajaxStop");
  836. }
  837. }
  838. }
  839. return jqXHR;
  840. };
  841. jQuery.ajaxPrefilter = function (dataTypeExpression, func) {
  842. /// <summary>
  843. /// Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
  844. /// </summary>
  845. /// <param name="dataTypeExpression" type="String">
  846. /// An optional string containing one or more space-separated dataTypes
  847. /// </param>
  848. /// <param name="func" type="Function">
  849. /// A handler to set default values for future Ajax requests.
  850. /// </param>
  851. /// <returns type="undefined" />
  852. if (typeof dataTypeExpression !== "string") {
  853. func = dataTypeExpression;
  854. dataTypeExpression = "*";
  855. }
  856. var dataType,
  857. i = 0,
  858. dataTypes = dataTypeExpression.toLowerCase().match(core_rnotwhite) || [];
  859. if (jQuery.isFunction(func)) {
  860. // For each dataType in the dataTypeExpression
  861. while ((dataType = dataTypes[i++])) {
  862. // Prepend if requested
  863. if (dataType[0] === "+") {
  864. dataType = dataType.slice(1) || "*";
  865. (structure[dataType] = structure[dataType] || []).unshift(func);
  866. // Otherwise append
  867. } else {
  868. (structure[dataType] = structure[dataType] || []).push(func);
  869. }
  870. }
  871. }
  872. };
  873. jQuery.ajaxSettings = {
  874. "url": 'http://localhost:25812/',
  875. "type": 'GET',
  876. "isLocal": false,
  877. "global": true,
  878. "processData": true,
  879. "async": true,
  880. "contentType": 'application/x-www-form-urlencoded; charset=UTF-8',
  881. "accepts": {},
  882. "contents": {},
  883. "responseFields": {},
  884. "converters": {},
  885. "flatOptions": {},
  886. "jsonp": 'callback'
  887. };
  888. jQuery.ajaxSetup = function (target, settings) {
  889. /// <summary>
  890. /// Set default values for future Ajax requests.
  891. /// </summary>
  892. /// <param name="target" type="PlainObject">
  893. /// A set of key/value pairs that configure the default Ajax request. All options are optional.
  894. /// </param>
  895. return settings ?
  896. // Building a settings object
  897. ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) :
  898. // Extending ajaxSettings
  899. ajaxExtend(jQuery.ajaxSettings, target);
  900. };
  901. jQuery.ajaxTransport = function (dataTypeExpression, func) {
  902. /// <summary>
  903. /// Creates an object that handles the actual transmission of Ajax data.
  904. /// </summary>
  905. /// <param name="dataTypeExpression" type="String">
  906. /// A string identifying the data type to use
  907. /// </param>
  908. /// <param name="func" type="Function">
  909. /// A handler to return the new transport object to use with the data type provided in the first argument.
  910. /// </param>
  911. /// <returns type="undefined" />
  912. if (typeof dataTypeExpression !== "string") {
  913. func = dataTypeExpression;
  914. dataTypeExpression = "*";
  915. }
  916. var dataType,
  917. i = 0,
  918. dataTypes = dataTypeExpression.toLowerCase().match(core_rnotwhite) || [];
  919. if (jQuery.isFunction(func)) {
  920. // For each dataType in the dataTypeExpression
  921. while ((dataType = dataTypes[i++])) {
  922. // Prepend if requested
  923. if (dataType[0] === "+") {
  924. dataType = dataType.slice(1) || "*";
  925. (structure[dataType] = structure[dataType] || []).unshift(func);
  926. // Otherwise append
  927. } else {
  928. (structure[dataType] = structure[dataType] || []).push(func);
  929. }
  930. }
  931. }
  932. };
  933. jQuery.attr = function (elem, name, value) {
  934. var hooks, notxml, ret,
  935. nType = elem.nodeType;
  936. // don't get/set attributes on text, comment and attribute nodes
  937. if (!elem || nType === 3 || nType === 8 || nType === 2) {
  938. return;
  939. }
  940. // Fallback to prop when attributes are not supported
  941. if (typeof elem.getAttribute === core_strundefined) {
  942. return jQuery.prop(elem, name, value);
  943. }
  944. notxml = nType !== 1 || !jQuery.isXMLDoc(elem);
  945. // All attributes are lowercase
  946. // Grab necessary hook if one is defined
  947. if (notxml) {
  948. name = name.toLowerCase();
  949. hooks = jQuery.attrHooks[name] || (rboolean.test(name) ? boolHook : nodeHook);
  950. }
  951. if (value !== undefined) {
  952. if (value === null) {
  953. jQuery.removeAttr(elem, name);
  954. } else if (hooks && notxml && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
  955. return ret;
  956. } else {
  957. elem.setAttribute(name, value + "");
  958. return value;
  959. }
  960. } else if (hooks && notxml && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
  961. return ret;
  962. } else {
  963. // In IE9+, Flash objects don't have .getAttribute (#12945)
  964. // Support: IE9+
  965. if (typeof elem.getAttribute !== core_strundefined) {
  966. ret = elem.getAttribute(name);
  967. }
  968. // Non-existent attributes return null, we normalize to undefined
  969. return ret == null ?
  970. undefined :
  971. ret;
  972. }
  973. };
  974. jQuery.attrHooks = { "type": {} };
  975. jQuery.buildFragment = function (elems, context, scripts, selection) {
  976. var j, elem, contains,
  977. tmp, tag, tbody, wrap,
  978. l = elems.length,
  979. // Ensure a safe fragment
  980. safe = createSafeFragment(context),
  981. nodes = [],
  982. i = 0;
  983. for (; i < l; i++) {
  984. elem = elems[i];
  985. if (elem || elem === 0) {
  986. // Add nodes directly
  987. if (jQuery.type(elem) === "object") {
  988. jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
  989. // Convert non-html into a text node
  990. } else if (!rhtml.test(elem)) {
  991. nodes.push(context.createTextNode(elem));
  992. // Convert html into DOM nodes
  993. } else {
  994. tmp = tmp || safe.appendChild(context.createElement("div"));
  995. // Deserialize a standard representation
  996. tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
  997. wrap = wrapMap[tag] || wrapMap._default;
  998. tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2];
  999. // Descend through wrappers to the right content
  1000. j = wrap[0];
  1001. while (j--) {
  1002. tmp = tmp.lastChild;
  1003. }
  1004. // Manually add leading whitespace removed by IE
  1005. if (!jQuery.support.leadingWhitespace && rleadingWhitespace.test(elem)) {
  1006. nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0]));
  1007. }
  1008. // Remove IE's autoinserted <tbody> from table fragments
  1009. if (!jQuery.support.tbody) {
  1010. // String was a <table>, *may* have spurious <tbody>
  1011. elem = tag === "table" && !rtbody.test(elem) ?
  1012. tmp.firstChild :
  1013. // String was a bare <thead> or <tfoot>
  1014. wrap[1] === "<table>" && !rtbody.test(elem) ?
  1015. tmp :
  1016. 0;
  1017. j = elem && elem.childNodes.length;
  1018. while (j--) {
  1019. if (jQuery.nodeName((tbody = elem.childNodes[j]), "tbody") && !tbody.childNodes.length) {
  1020. elem.removeChild(tbody);
  1021. }
  1022. }
  1023. }
  1024. jQuery.merge(nodes, tmp.childNodes);
  1025. // Fix #12392 for WebKit and IE > 9
  1026. tmp.textContent = "";
  1027. // Fix #12392 for oldIE
  1028. while (tmp.firstChild) {
  1029. tmp.removeChild(tmp.firstChild);
  1030. }
  1031. // Remember the top-level container for proper cleanup
  1032. tmp = safe.lastChild;
  1033. }
  1034. }
  1035. }
  1036. // Fix #11356: Clear elements from fragment
  1037. if (tmp) {
  1038. safe.removeChild(tmp);
  1039. }
  1040. // Reset defaultChecked for any radios and checkboxes
  1041. // about to be appended to the DOM in IE 6/7 (#8060)
  1042. if (!jQuery.support.appendChecked) {
  1043. jQuery.grep(getAll(nodes, "input"), fixDefaultChecked);
  1044. }
  1045. i = 0;
  1046. while ((elem = nodes[i++])) {
  1047. // #4087 - If origin and destination elements are the same, and this is
  1048. // that element, do not do anything
  1049. if (selection && jQuery.inArray(elem, selection) !== -1) {
  1050. continue;
  1051. }
  1052. contains = jQuery.contains(elem.ownerDocument, elem);
  1053. // Append to fragment
  1054. tmp = getAll(safe.appendChild(elem), "script");
  1055. // Preserve script evaluation history
  1056. if (contains) {
  1057. setGlobalEval(tmp);
  1058. }
  1059. // Capture executables
  1060. if (scripts) {
  1061. j = 0;
  1062. while ((elem = tmp[j++])) {
  1063. if (rscriptType.test(elem.type || "")) {
  1064. scripts.push(elem);
  1065. }
  1066. }
  1067. }
  1068. }
  1069. tmp = null;
  1070. return safe;
  1071. };
  1072. jQuery.cache = {};
  1073. jQuery.camelCase = function (string) {
  1074. return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
  1075. };
  1076. jQuery.cleanData = function (elems, /* internal */ acceptData) {
  1077. var elem, type, id, data,
  1078. i = 0,
  1079. internalKey = jQuery.expando,
  1080. cache = jQuery.cache,
  1081. deleteExpando = jQuery.support.deleteExpando,
  1082. special = jQuery.event.special;
  1083. for (; (elem = elems[i]) != null; i++) {
  1084. if (acceptData || jQuery.acceptData(elem)) {
  1085. id = elem[internalKey];
  1086. data = id && cache[id];
  1087. if (data) {
  1088. if (data.events) {
  1089. for (type in data.events) {
  1090. if (special[type]) {
  1091. jQuery.event.remove(elem, type);
  1092. // This is a shortcut to avoid jQuery.event.remove's overhead
  1093. } else {
  1094. jQuery.removeEvent(elem, type, data.handle);
  1095. }
  1096. }
  1097. }
  1098. // Remove cache only if it was not already removed by jQuery.event.remove
  1099. if (cache[id]) {
  1100. delete cache[id];
  1101. // IE does not allow us to delete expando properties from nodes,
  1102. // nor does it have a removeAttribute function on Document nodes;
  1103. // we must handle all of these cases
  1104. if (deleteExpando) {
  1105. delete elem[internalKey];
  1106. } else if (typeof elem.removeAttribute !== core_strundefined) {
  1107. elem.removeAttribute(internalKey);
  1108. } else {
  1109. elem[internalKey] = null;
  1110. }
  1111. core_deletedIds.push(id);
  1112. }
  1113. }
  1114. }
  1115. }
  1116. };
  1117. jQuery.clone = function (elem, dataAndEvents, deepDataAndEvents) {
  1118. var destElements, node, clone, i, srcElements,
  1119. inPage = jQuery.contains(elem.ownerDocument, elem);
  1120. if (jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test("<" + elem.nodeName + ">")) {
  1121. clone = elem.cloneNode(true);
  1122. // IE<=8 does not properly clone detached, unknown element nodes
  1123. } else {
  1124. fragmentDiv.innerHTML = elem.outerHTML;
  1125. fragmentDiv.removeChild(clone = fragmentDiv.firstChild);
  1126. }
  1127. if ((!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
  1128. (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
  1129. // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
  1130. destElements = getAll(clone);
  1131. srcElements = getAll(elem);
  1132. // Fix all IE cloning issues
  1133. for (i = 0; (node = srcElements[i]) != null; ++i) {
  1134. // Ensure that the destination node is not null; Fixes #9587
  1135. if (destElements[i]) {
  1136. fixCloneNodeIssues(node, destElements[i]);
  1137. }
  1138. }
  1139. }
  1140. // Copy the events from the original to the clone
  1141. if (dataAndEvents) {
  1142. if (deepDataAndEvents) {
  1143. srcElements = srcElements || getAll(elem);
  1144. destElements = destElements || getAll(clone);
  1145. for (i = 0; (node = srcElements[i]) != null; i++) {
  1146. cloneCopyEvent(node, destElements[i]);
  1147. }
  1148. } else {
  1149. cloneCopyEvent(elem, clone);
  1150. }
  1151. }
  1152. // Preserve script evaluation history
  1153. destElements = getAll(clone, "script");
  1154. if (destElements.length > 0) {
  1155. setGlobalEval(destElements, !inPage && getAll(elem, "script"));
  1156. }
  1157. destElements = srcElements = node = null;
  1158. // Return the cloned set
  1159. return clone;
  1160. };
  1161. jQuery.contains = function (context, elem) {
  1162. /// <summary>
  1163. /// Check to see if a DOM element is a descendant of another DOM element.
  1164. /// </summary>
  1165. /// <param name="context" domElement="true">
  1166. /// The DOM element that may contain the other element.
  1167. /// </param>
  1168. /// <param name="elem" domElement="true">
  1169. /// The DOM element that may be contained by (a descendant of) the other element.
  1170. /// </param>
  1171. /// <returns type="Boolean" />
  1172. // Set document vars if needed
  1173. if ((context.ownerDocument || context) !== document) {
  1174. setDocument(context);
  1175. }
  1176. return contains(context, elem);
  1177. };
  1178. jQuery.css = function (elem, name, extra, styles) {
  1179. var num, val, hooks,
  1180. origName = jQuery.camelCase(name);
  1181. // Make sure that we're working with the right name
  1182. name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName));
  1183. // gets hook for the prefixed version
  1184. // followed by the unprefixed version
  1185. hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
  1186. // If a hook was provided get the computed value from there
  1187. if (hooks && "get" in hooks) {
  1188. val = hooks.get(elem, true, extra);
  1189. }
  1190. // Otherwise, if a way to get the computed value exists, use that
  1191. if (val === undefined) {
  1192. val = curCSS(elem, name, styles);
  1193. }
  1194. //convert "normal" to computed value
  1195. if (val === "normal" && name in cssNormalTransform) {
  1196. val = cssNormalTransform[name];
  1197. }
  1198. // Return, converting to number if forced or a qualifier was provided and val looks numeric
  1199. if (extra === "" || extra) {
  1200. num = parseFloat(val);
  1201. return extra === true || jQuery.isNumeric(num) ? num || 0 : val;
  1202. }
  1203. return val;
  1204. };
  1205. jQuery.cssHooks = {
  1206. "opacity": {},
  1207. "height": {},
  1208. "width": {},
  1209. "margin": {},
  1210. "padding": {},
  1211. "borderWidth": {}
  1212. };
  1213. jQuery.cssNumber = {
  1214. "columnCount": true,
  1215. "fillOpacity": true,
  1216. "fontWeight": true,
  1217. "lineHeight": true,
  1218. "opacity": true,
  1219. "orphans": true,
  1220. "widows": true,
  1221. "zIndex": true,
  1222. "zoom": true
  1223. };
  1224. jQuery.cssProps = {
  1225. "float": 'cssFloat',
  1226. "display": 'display',
  1227. "visibility": 'visibility'
  1228. };
  1229. jQuery.data = function (elem, name, data) {
  1230. /// <summary>
  1231. /// 1: Store arbitrary data associated with the specified element. Returns the value that was set.
  1232. /// &#10; 1.1 - jQuery.data(element, key, value)
  1233. /// &#10;2: Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
  1234. /// &#10; 2.1 - jQuery.data(element, key)
  1235. /// &#10; 2.2 - jQuery.data(element)
  1236. /// </summary>
  1237. /// <param name="elem" domElement="true">
  1238. /// The DOM element to associate with the data.
  1239. /// </param>
  1240. /// <param name="name" type="String">
  1241. /// A string naming the piece of data to set.
  1242. /// </param>
  1243. /// <param name="data" type="Object">
  1244. /// The new data value.
  1245. /// </param>
  1246. /// <returns type="Object" />
  1247. return internalData(elem, name, data);
  1248. };
  1249. jQuery.dequeue = function (elem, type) {
  1250. /// <summary>
  1251. /// Execute the next function on the queue for the matched element.
  1252. /// </summary>
  1253. /// <param name="elem" domElement="true">
  1254. /// A DOM element from which to remove and execute a queued function.
  1255. /// </param>
  1256. /// <param name="type" type="String">
  1257. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  1258. /// </param>
  1259. /// <returns type="undefined" />
  1260. type = type || "fx";
  1261. var queue = jQuery.queue(elem, type),
  1262. startLength = queue.length,
  1263. fn = queue.shift(),
  1264. hooks = jQuery._queueHooks(elem, type),
  1265. next = function () {
  1266. jQuery.dequeue(elem, type);
  1267. };
  1268. // If the fx queue is dequeued, always remove the progress sentinel
  1269. if (fn === "inprogress") {
  1270. fn = queue.shift();
  1271. startLength--;
  1272. }
  1273. hooks.cur = fn;
  1274. if (fn) {
  1275. // Add a progress sentinel to prevent the fx queue from being
  1276. // automatically dequeued
  1277. if (type === "fx") {
  1278. queue.unshift("inprogress");
  1279. }
  1280. // clear up the last queue stop function
  1281. delete hooks.stop;
  1282. fn.call(elem, next, hooks);
  1283. }
  1284. if (!startLength && hooks) {
  1285. hooks.empty.fire();
  1286. }
  1287. };
  1288. jQuery.dir = function (elem, dir, until) {
  1289. var matched = [],
  1290. cur = elem[dir];
  1291. while (cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery(cur).is(until))) {
  1292. if (cur.nodeType === 1) {
  1293. matched.push(cur);
  1294. }
  1295. cur = cur[dir];
  1296. }
  1297. return matched;
  1298. };
  1299. jQuery.each = function (obj, callback, args) {
  1300. /// <summary>
  1301. /// A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
  1302. /// </summary>
  1303. /// <param name="obj" type="Object">
  1304. /// The object or array to iterate over.
  1305. /// </param>
  1306. /// <param name="callback" type="Function">
  1307. /// The function that will be executed on every object.
  1308. /// </param>
  1309. /// <returns type="Object" />
  1310. var value,
  1311. i = 0,
  1312. length = obj.length,
  1313. isArray = isArraylike(obj);
  1314. if (args) {
  1315. if (isArray) {
  1316. for (; i < length; i++) {
  1317. value = callback.apply(obj[i], args);
  1318. if (value === false) {
  1319. break;
  1320. }
  1321. }
  1322. } else {
  1323. for (i in obj) {
  1324. value = callback.apply(obj[i], args);
  1325. if (value === false) {
  1326. break;
  1327. }
  1328. }
  1329. }
  1330. // A special, fast, case for the most common use of each
  1331. } else {
  1332. if (isArray) {
  1333. for (; i < length; i++) {
  1334. value = callback.call(obj[i], i, obj[i]);
  1335. if (value === false) {
  1336. break;
  1337. }
  1338. }
  1339. } else {
  1340. for (i in obj) {
  1341. value = callback.call(obj[i], i, obj[i]);
  1342. if (value === false) {
  1343. break;
  1344. }
  1345. }
  1346. }
  1347. }
  1348. return obj;
  1349. };
  1350. jQuery.easing = {};
  1351. jQuery.error = function (msg) {
  1352. /// <summary>
  1353. /// Takes a string and throws an exception containing it.
  1354. /// </summary>
  1355. /// <param name="msg" type="String">
  1356. /// The message to send out.
  1357. /// </param>
  1358. throw new Error(msg);
  1359. };
  1360. jQuery.etag = {};
  1361. jQuery.event = {
  1362. "global": {},
  1363. "props": ['altKey', 'bubbles', 'cancelable', 'ctrlKey', 'currentTarget', 'eventPhase', 'metaKey', 'relatedTarget', 'shiftKey', 'target', 'timeStamp', 'view', 'which'],
  1364. "fixHooks": {},
  1365. "keyHooks": {},
  1366. "mouseHooks": {},
  1367. "special": {},
  1368. "triggered": {}
  1369. };
  1370. jQuery.expr = {
  1371. "cacheLength": 50,
  1372. "match": {},
  1373. "find": {},
  1374. "relative": {},
  1375. "preFilter": {},
  1376. "filter": {},
  1377. "pseudos": {},
  1378. "filters": {},
  1379. "setFilters": {},
  1380. "attrHandle": {},
  1381. ":": {}
  1382. };
  1383. jQuery.extend = function () {
  1384. /// <summary>
  1385. /// Merge the contents of two or more objects together into the first object.
  1386. /// &#10;1 - jQuery.extend(target, object1, objectN)
  1387. /// &#10;2 - jQuery.extend(deep, target, object1, objectN)
  1388. /// </summary>
  1389. /// <param name="" type="Boolean">
  1390. /// If true, the merge becomes recursive (aka. deep copy).
  1391. /// </param>
  1392. /// <param name="" type="Object">
  1393. /// The object to extend. It will receive the new properties.
  1394. /// </param>
  1395. /// <param name="" type="Object">
  1396. /// An object containing additional properties to merge in.
  1397. /// </param>
  1398. /// <param name="" type="Object">
  1399. /// Additional objects containing properties to merge in.
  1400. /// </param>
  1401. /// <returns type="Object" />
  1402. var src, copyIsArray, copy, name, options, clone,
  1403. target = arguments[0] || {},
  1404. i = 1,
  1405. length = arguments.length,
  1406. deep = false;
  1407. // Handle a deep copy situation
  1408. if (typeof target === "boolean") {
  1409. deep = target;
  1410. target = arguments[1] || {};
  1411. // skip the boolean and the target
  1412. i = 2;
  1413. }
  1414. // Handle case when target is a string or something (possible in deep copy)
  1415. if (typeof target !== "object" && !jQuery.isFunction(target)) {
  1416. target = {};
  1417. }
  1418. // extend jQuery itself if only one argument is passed
  1419. if (length === i) {
  1420. target = this;
  1421. --i;
  1422. }
  1423. for (; i < length; i++) {
  1424. // Only deal with non-null/undefined values
  1425. if ((options = arguments[i]) != null) {
  1426. // Extend the base object
  1427. for (name in options) {
  1428. src = target[name];
  1429. copy = options[name];
  1430. // Prevent never-ending loop
  1431. if (target === copy) {
  1432. continue;
  1433. }
  1434. // Recurse if we're merging plain objects or arrays
  1435. if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {
  1436. if (copyIsArray) {
  1437. copyIsArray = false;
  1438. clone = src && jQuery.isArray(src) ? src : [];
  1439. } else {
  1440. clone = src && jQuery.isPlainObject(src) ? src : {};
  1441. }
  1442. // Never move original objects, clone them
  1443. target[name] = jQuery.extend(deep, clone, copy);
  1444. // Don't bring in undefined values
  1445. } else if (copy !== undefined) {
  1446. target[name] = copy;
  1447. }
  1448. }
  1449. }
  1450. }
  1451. // Return the modified object
  1452. return target;
  1453. };
  1454. jQuery.filter = function (expr, elems, not) {
  1455. if (not) {
  1456. expr = ":not(" + expr + ")";
  1457. }
  1458. return elems.length === 1 ?
  1459. jQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [] :
  1460. jQuery.find.matches(expr, elems);
  1461. };
  1462. jQuery.find = function Sizzle(selector, context, results, seed) {
  1463. var match, elem, m, nodeType,
  1464. // QSA vars
  1465. i, groups, old, nid, newContext, newSelector;
  1466. if ((context ? context.ownerDocument || context : preferredDoc) !== document) {
  1467. setDocument(context);
  1468. }
  1469. context = context || document;
  1470. results = results || [];
  1471. if (!selector || typeof selector !== "string") {
  1472. return results;
  1473. }
  1474. if ((nodeType = context.nodeType) !== 1 && nodeType !== 9) {
  1475. return [];
  1476. }
  1477. if (!documentIsXML && !seed) {
  1478. // Shortcuts
  1479. if ((match = rquickExpr.exec(selector))) {
  1480. // Speed-up: Sizzle("#ID")
  1481. if ((m = match[1])) {
  1482. if (nodeType === 9) {
  1483. elem = context.getElementById(m);
  1484. // Check parentNode to catch when Blackberry 4.6 returns
  1485. // nodes that are no longer in the document #6963
  1486. if (elem && elem.parentNode) {
  1487. // Handle the case where IE, Opera, and Webkit return items
  1488. // by name instead of ID
  1489. if (elem.id === m) {
  1490. results.push(elem);
  1491. return results;
  1492. }
  1493. } else {
  1494. return results;
  1495. }
  1496. } else {
  1497. // Context is not a document
  1498. if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) &&
  1499. contains(context, elem) && elem.id === m) {
  1500. results.push(elem);
  1501. return results;
  1502. }
  1503. }
  1504. // Speed-up: Sizzle("TAG")
  1505. } else if (match[2]) {
  1506. push.apply(results, slice.call(context.getElementsByTagName(selector), 0));
  1507. return results;
  1508. // Speed-up: Sizzle(".CLASS")
  1509. } else if ((m = match[3]) && support.getByClassName && context.getElementsByClassName) {
  1510. push.apply(results, slice.call(context.getElementsByClassName(m), 0));
  1511. return results;
  1512. }
  1513. }
  1514. // QSA path
  1515. if (support.qsa && !rbuggyQSA.test(selector)) {
  1516. old = true;
  1517. nid = expando;
  1518. newContext = context;
  1519. newSelector = nodeType === 9 && selector;
  1520. // qSA works strangely on Element-rooted queries
  1521. // We can work around this by specifying an extra ID on the root
  1522. // and working up from there (Thanks to Andrew Dupont for the technique)
  1523. // IE 8 doesn't work on object elements
  1524. if (nodeType === 1 && context.nodeName.toLowerCase() !== "object") {
  1525. groups = tokenize(selector);
  1526. if ((old = context.getAttribute("id"))) {
  1527. nid = old.replace(rescape, "\\$&");
  1528. } else {
  1529. context.setAttribute("id", nid);
  1530. }
  1531. nid = "[id='" + nid + "'] ";
  1532. i = groups.length;
  1533. while (i--) {
  1534. groups[i] = nid + toSelector(groups[i]);
  1535. }
  1536. newContext = rsibling.test(selector) && context.parentNode || context;
  1537. newSelector = groups.join(",");
  1538. }
  1539. if (newSelector) {
  1540. try {
  1541. push.apply(results, slice.call(newContext.querySelectorAll(
  1542. newSelector
  1543. ), 0));
  1544. return results;
  1545. } catch (qsaError) {
  1546. } finally {
  1547. if (!old) {
  1548. context.removeAttribute("id");
  1549. }
  1550. }
  1551. }
  1552. }
  1553. }
  1554. // All others
  1555. return select(selector.replace(rtrim, "$1"), context, results, seed);
  1556. };
  1557. jQuery.fn = {
  1558. "jquery": '1.9.1',
  1559. "selector": '',
  1560. "length": 0
  1561. };
  1562. jQuery.fx = function (elem, options, prop, end, easing, unit) {
  1563. this.elem = elem;
  1564. this.prop = prop;
  1565. this.easing = easing || "swing";
  1566. this.options = options;
  1567. this.start = this.now = this.cur();
  1568. this.end = end;
  1569. this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
  1570. };
  1571. jQuery.get = function (url, data, callback, type) {
  1572. /// <summary>
  1573. /// Load data from the server using a HTTP GET request.
  1574. /// </summary>
  1575. /// <param name="url" type="String">
  1576. /// A string containing the URL to which the request is sent.
  1577. /// </param>
  1578. /// <param name="data" type="String">
  1579. /// A plain object or string that is sent to the server with the request.
  1580. /// </param>
  1581. /// <param name="callback" type="Function">
  1582. /// A callback function that is executed if the request succeeds.
  1583. /// </param>
  1584. /// <param name="type" type="String">
  1585. /// The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
  1586. /// </param>
  1587. // shift arguments if data argument was omitted
  1588. if (jQuery.isFunction(data)) {
  1589. type = type || callback;
  1590. callback = data;
  1591. data = undefined;
  1592. }
  1593. return jQuery.ajax({
  1594. url: url,
  1595. type: method,
  1596. dataType: type,
  1597. data: data,
  1598. success: callback
  1599. });
  1600. };
  1601. jQuery.getJSON = function (url, data, callback) {
  1602. /// <summary>
  1603. /// Load JSON-encoded data from the server using a GET HTTP request.
  1604. /// </summary>
  1605. /// <param name="url" type="String">
  1606. /// A string containing the URL to which the request is sent.
  1607. /// </param>
  1608. /// <param name="data" type="PlainObject">
  1609. /// A plain object or string that is sent to the server with the request.
  1610. /// </param>
  1611. /// <param name="callback" type="Function">
  1612. /// A callback function that is executed if the request succeeds.
  1613. /// </param>
  1614. return jQuery.get(url, data, callback, "json");
  1615. };
  1616. jQuery.getScript = function (url, callback) {
  1617. /// <summary>
  1618. /// Load a JavaScript file from the server using a GET HTTP request, then execute it.
  1619. /// </summary>
  1620. /// <param name="url" type="String">
  1621. /// A string containing the URL to which the request is sent.
  1622. /// </param>
  1623. /// <param name="callback" type="Function">
  1624. /// A callback function that is executed if the request succeeds.
  1625. /// </param>
  1626. return jQuery.get(url, undefined, callback, "script");
  1627. };
  1628. jQuery.globalEval = function (data) {
  1629. /// <summary>
  1630. /// Execute some JavaScript code globally.
  1631. /// </summary>
  1632. /// <param name="data" type="String">
  1633. /// The JavaScript code to execute.
  1634. /// </param>
  1635. if (data && jQuery.trim(data)) {
  1636. // We use execScript on Internet Explorer
  1637. // We use an anonymous function so that context is window
  1638. // rather than jQuery in Firefox
  1639. (window.execScript || function (data) {
  1640. window["eval"].call(window, data);
  1641. })(data);
  1642. }
  1643. };
  1644. jQuery.grep = function (elems, callback, inv) {
  1645. /// <summary>
  1646. /// Finds the elements of an array which satisfy a filter function. The original array is not affected.
  1647. /// </summary>
  1648. /// <param name="elems" type="Array">
  1649. /// The array to search through.
  1650. /// </param>
  1651. /// <param name="callback" type="Function">
  1652. /// The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object.
  1653. /// </param>
  1654. /// <param name="inv" type="Boolean">
  1655. /// If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.
  1656. /// </param>
  1657. /// <returns type="Array" />
  1658. var retVal,
  1659. ret = [],
  1660. i = 0,
  1661. length = elems.length;
  1662. inv = !!inv;
  1663. // Go through the array, only saving the items
  1664. // that pass the validator function
  1665. for (; i < length; i++) {
  1666. retVal = !!callback(elems[i], i);
  1667. if (inv !== retVal) {
  1668. ret.push(elems[i]);
  1669. }
  1670. }
  1671. return ret;
  1672. };
  1673. jQuery.guid = 1;
  1674. jQuery.hasData = function (elem) {
  1675. /// <summary>
  1676. /// Determine whether an element has any jQuery data associated with it.
  1677. /// </summary>
  1678. /// <param name="elem" domElement="true">
  1679. /// A DOM element to be checked for data.
  1680. /// </param>
  1681. /// <returns type="Boolean" />
  1682. elem = elem.nodeType ? jQuery.cache[elem[jQuery.expando]] : elem[jQuery.expando];
  1683. return !!elem && !isEmptyDataObject(elem);
  1684. };
  1685. jQuery.holdReady = function (hold) {
  1686. /// <summary>
  1687. /// Holds or releases the execution of jQuery's ready event.
  1688. /// </summary>
  1689. /// <param name="hold" type="Boolean">
  1690. /// Indicates whether the ready hold is being requested or released
  1691. /// </param>
  1692. /// <returns type="undefined" />
  1693. if (hold) {
  1694. jQuery.readyWait++;
  1695. } else {
  1696. jQuery.ready(true);
  1697. }
  1698. };
  1699. jQuery.inArray = function (elem, arr, i) {
  1700. /// <summary>
  1701. /// Search for a specified value within an array and return its index (or -1 if not found).
  1702. /// </summary>
  1703. /// <param name="elem" type="Anything">
  1704. /// The value to search for.
  1705. /// </param>
  1706. /// <param name="arr" type="Array">
  1707. /// An array through which to search.
  1708. /// </param>
  1709. /// <param name="i" type="Number">
  1710. /// The index of the array at which to begin the search. The default is 0, which will search the whole array.
  1711. /// </param>
  1712. /// <returns type="Number" />
  1713. var len;
  1714. if (arr) {
  1715. if (core_indexOf) {
  1716. return core_indexOf.call(arr, elem, i);
  1717. }
  1718. len = arr.length;
  1719. i = i ? i < 0 ? Math.max(0, len + i) : i : 0;
  1720. for (; i < len; i++) {
  1721. // Skip accessing in sparse arrays
  1722. if (i in arr && arr[i] === elem) {
  1723. return i;
  1724. }
  1725. }
  1726. }
  1727. return -1;
  1728. };
  1729. jQuery.isEmptyObject = function (obj) {
  1730. /// <summary>
  1731. /// Check to see if an object is empty (contains no enumerable properties).
  1732. /// </summary>
  1733. /// <param name="obj" type="Object">
  1734. /// The object that will be checked to see if it's empty.
  1735. /// </param>
  1736. /// <returns type="Boolean" />
  1737. var name;
  1738. for (name in obj) {
  1739. return false;
  1740. }
  1741. return true;
  1742. };
  1743. jQuery.isFunction = function (obj) {
  1744. /// <summary>
  1745. /// Determine if the argument passed is a Javascript function object.
  1746. /// </summary>
  1747. /// <param name="obj" type="PlainObject">
  1748. /// Object to test whether or not it is a function.
  1749. /// </param>
  1750. /// <returns type="boolean" />
  1751. return jQuery.type(obj) === "function";
  1752. };
  1753. jQuery.isNumeric = function (obj) {
  1754. /// <summary>
  1755. /// Determines whether its argument is a number.
  1756. /// </summary>
  1757. /// <param name="obj" type="PlainObject">
  1758. /// The value to be tested.
  1759. /// </param>
  1760. /// <returns type="Boolean" />
  1761. return !isNaN(parseFloat(obj)) && isFinite(obj);
  1762. };
  1763. jQuery.isPlainObject = function (obj) {
  1764. /// <summary>
  1765. /// Check to see if an object is a plain object (created using "{}" or "new Object").
  1766. /// </summary>
  1767. /// <param name="obj" type="PlainObject">
  1768. /// The object that will be checked to see if it's a plain object.
  1769. /// </param>
  1770. /// <returns type="Boolean" />
  1771. // Must be an Object.
  1772. // Because of IE, we also have to check the presence of the constructor property.
  1773. // Make sure that DOM nodes and window objects don't pass through, as well
  1774. if (!obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) {
  1775. return false;
  1776. }
  1777. try {
  1778. // Not own constructor property must be Object
  1779. if (obj.constructor &&
  1780. !core_hasOwn.call(obj, "constructor") &&
  1781. !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
  1782. return false;
  1783. }
  1784. } catch (e) {
  1785. // IE8,9 Will throw exceptions on certain host objects #9897
  1786. return false;
  1787. }
  1788. // Own properties are enumerated firstly, so to speed up,
  1789. // if last one is own, then all properties are own.
  1790. var key;
  1791. for (key in obj) { }
  1792. return key === undefined || core_hasOwn.call(obj, key);
  1793. };
  1794. jQuery.isReady = true;
  1795. jQuery.isWindow = function (obj) {
  1796. /// <summary>
  1797. /// Determine whether the argument is a window.
  1798. /// </summary>
  1799. /// <param name="obj" type="PlainObject">
  1800. /// Object to test whether or not it is a window.
  1801. /// </param>
  1802. /// <returns type="boolean" />
  1803. return obj != null && obj == obj.window;
  1804. };
  1805. jQuery.isXMLDoc = function (elem) {
  1806. /// <summary>
  1807. /// Check to see if a DOM node is within an XML document (or is an XML document).
  1808. /// </summary>
  1809. /// <param name="elem" domElement="true">
  1810. /// The DOM node that will be checked to see if it's in an XML document.
  1811. /// </param>
  1812. /// <returns type="Boolean" />
  1813. // documentElement is verified for cases where it doesn't yet exist
  1814. // (such as loading iframes in IE - #4833)
  1815. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  1816. return documentElement ? documentElement.nodeName !== "HTML" : false;
  1817. };
  1818. jQuery.lastModified = {};
  1819. jQuery.makeArray = function (arr, results) {
  1820. /// <summary>
  1821. /// Convert an array-like object into a true JavaScript array.
  1822. /// </summary>
  1823. /// <param name="arr" type="PlainObject">
  1824. /// Any object to turn into a native Array.
  1825. /// </param>
  1826. /// <returns type="Array" />
  1827. var ret = results || [];
  1828. if (arr != null) {
  1829. if (isArraylike(Object(arr))) {
  1830. jQuery.merge(ret,
  1831. typeof arr === "string" ?
  1832. [arr] : arr
  1833. );
  1834. } else {
  1835. core_push.call(ret, arr);
  1836. }
  1837. }
  1838. return ret;
  1839. };
  1840. jQuery.map = function (elems, callback, arg) {
  1841. /// <summary>
  1842. /// Translate all items in an array or object to new array of items.
  1843. /// &#10;1 - jQuery.map(array, callback(elementOfArray, indexInArray))
  1844. /// &#10;2 - jQuery.map(arrayOrObject, callback( value, indexOrKey ))
  1845. /// </summary>
  1846. /// <param name="elems" type="Array">
  1847. /// The Array to translate.
  1848. /// </param>
  1849. /// <param name="callback" type="Function">
  1850. /// The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object.
  1851. /// </param>
  1852. /// <returns type="Array" />
  1853. var value,
  1854. i = 0,
  1855. length = elems.length,
  1856. isArray = isArraylike(elems),
  1857. ret = [];
  1858. // Go through the array, translating each of the items to their
  1859. if (isArray) {
  1860. for (; i < length; i++) {
  1861. value = callback(elems[i], i, arg);
  1862. if (value != null) {
  1863. ret[ret.length] = value;
  1864. }
  1865. }
  1866. // Go through every key on the object,
  1867. } else {
  1868. for (i in elems) {
  1869. value = callback(elems[i], i, arg);
  1870. if (value != null) {
  1871. ret[ret.length] = value;
  1872. }
  1873. }
  1874. }
  1875. // Flatten any nested arrays
  1876. return core_concat.apply([], ret);
  1877. };
  1878. jQuery.merge = function (first, second) {
  1879. /// <summary>
  1880. /// Merge the contents of two arrays together into the first array.
  1881. /// </summary>
  1882. /// <param name="first" type="Array">
  1883. /// The first array to merge, the elements of second added.
  1884. /// </param>
  1885. /// <param name="second" type="Array">
  1886. /// The second array to merge into the first, unaltered.
  1887. /// </param>
  1888. /// <returns type="Array" />
  1889. var l = second.length,
  1890. i = first.length,
  1891. j = 0;
  1892. if (typeof l === "number") {
  1893. for (; j < l; j++) {
  1894. first[i++] = second[j];
  1895. }
  1896. } else {
  1897. while (second[j] !== undefined) {
  1898. first[i++] = second[j++];
  1899. }
  1900. }
  1901. first.length = i;
  1902. return first;
  1903. };
  1904. jQuery.noConflict = function (deep) {
  1905. /// <summary>
  1906. /// Relinquish jQuery's control of the $ variable.
  1907. /// </summary>
  1908. /// <param name="deep" type="Boolean">
  1909. /// A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
  1910. /// </param>
  1911. /// <returns type="Object" />
  1912. if (window.$ === jQuery) {
  1913. window.$ = _$;
  1914. }
  1915. if (deep && window.jQuery === jQuery) {
  1916. window.jQuery = _jQuery;
  1917. }
  1918. return jQuery;
  1919. };
  1920. jQuery.noData = {
  1921. "embed": true,
  1922. "object": 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',
  1923. "applet": true
  1924. };
  1925. jQuery.nodeName = function (elem, name) {
  1926. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  1927. };
  1928. jQuery.noop = function () {
  1929. /// <summary>
  1930. /// An empty function.
  1931. /// </summary>
  1932. /// <returns type="undefined" />
  1933. };
  1934. jQuery.now = function () {
  1935. /// <summary>
  1936. /// Return a number representing the current time.
  1937. /// </summary>
  1938. /// <returns type="Number" />
  1939. return (new Date()).getTime();
  1940. };
  1941. jQuery.offset = {};
  1942. jQuery.param = function (a, traditional) {
  1943. /// <summary>
  1944. /// Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
  1945. /// &#10;1 - jQuery.param(obj)
  1946. /// &#10;2 - jQuery.param(obj, traditional)
  1947. /// </summary>
  1948. /// <param name="a" type="Object">
  1949. /// An array or object to serialize.
  1950. /// </param>
  1951. /// <param name="traditional" type="Boolean">
  1952. /// A Boolean indicating whether to perform a traditional "shallow" serialization.
  1953. /// </param>
  1954. /// <returns type="String" />
  1955. var prefix,
  1956. s = [],
  1957. add = function (key, value) {
  1958. // If value is a function, invoke it and return its value
  1959. value = jQuery.isFunction(value) ? value() : (value == null ? "" : value);
  1960. s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
  1961. };
  1962. // Set traditional to true for jQuery <= 1.3.2 behavior.
  1963. if (traditional === undefined) {
  1964. traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
  1965. }
  1966. // If an array was passed in, assume that it is an array of form elements.
  1967. if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) {
  1968. // Serialize the form elements
  1969. jQuery.each(a, function () {
  1970. add(this.name, this.value);
  1971. });
  1972. } else {
  1973. // If traditional, encode the "old" way (the way 1.3.2 or older
  1974. // did it), otherwise encode params recursively.
  1975. for (prefix in a) {
  1976. buildParams(prefix, a[prefix], traditional, add);
  1977. }
  1978. }
  1979. // Return the resulting serialization
  1980. return s.join("&").replace(r20, "+");
  1981. };
  1982. jQuery.parseHTML = function (data, context, keepScripts) {
  1983. /// <summary>
  1984. /// Parses a string into an array of DOM nodes.
  1985. /// </summary>
  1986. /// <param name="data" type="String">
  1987. /// HTML string to be parsed
  1988. /// </param>
  1989. /// <param name="context" domElement="true">
  1990. /// DOM element to serve as the context in which the HTML fragment will be created
  1991. /// </param>
  1992. /// <param name="keepScripts" type="Boolean">
  1993. /// A Boolean indicating whether to include scripts passed in the HTML string
  1994. /// </param>
  1995. /// <returns type="Array" />
  1996. if (!data || typeof data !== "string") {
  1997. return null;
  1998. }
  1999. if (typeof context === "boolean") {
  2000. keepScripts = context;
  2001. context = false;
  2002. }
  2003. context = context || document;
  2004. var parsed = rsingleTag.exec(data),
  2005. scripts = !keepScripts && [];
  2006. // Single tag
  2007. if (parsed) {
  2008. return [context.createElement(parsed[1])];
  2009. }
  2010. parsed = jQuery.buildFragment([data], context, scripts);
  2011. if (scripts) {
  2012. jQuery(scripts).remove();
  2013. }
  2014. return jQuery.merge([], parsed.childNodes);
  2015. };
  2016. jQuery.parseJSON = function (data) {
  2017. /// <summary>
  2018. /// Takes a well-formed JSON string and returns the resulting JavaScript object.
  2019. /// </summary>
  2020. /// <param name="data" type="String">
  2021. /// The JSON string to parse.
  2022. /// </param>
  2023. /// <returns type="Object" />
  2024. // Attempt to parse using the native JSON parser first
  2025. if (window.JSON && window.JSON.parse) {
  2026. return window.JSON.parse(data);
  2027. }
  2028. if (data === null) {
  2029. return data;
  2030. }
  2031. if (typeof data === "string") {
  2032. // Make sure leading/trailing whitespace is removed (IE can't handle it)
  2033. data = jQuery.trim(data);
  2034. if (data) {
  2035. // Make sure the incoming data is actual JSON
  2036. // Logic borrowed from http://json.org/json2.js
  2037. if (rvalidchars.test(data.replace(rvalidescape, "@")
  2038. .replace(rvalidtokens, "]")
  2039. .replace(rvalidbraces, ""))) {
  2040. return (new Function("return " + data))();
  2041. }
  2042. }
  2043. }
  2044. jQuery.error("Invalid JSON: " + data);
  2045. };
  2046. jQuery.parseXML = function (data) {
  2047. /// <summary>
  2048. /// Parses a string into an XML document.
  2049. /// </summary>
  2050. /// <param name="data" type="String">
  2051. /// a well-formed XML string to be parsed
  2052. /// </param>
  2053. /// <returns type="XMLDocument" />
  2054. var xml, tmp;
  2055. if (!data || typeof data !== "string") {
  2056. return null;
  2057. }
  2058. try {
  2059. if (window.DOMParser) { // Standard
  2060. tmp = new DOMParser();
  2061. xml = tmp.parseFromString(data, "text/xml");
  2062. } else { // IE
  2063. xml = new ActiveXObject("Microsoft.XMLDOM");
  2064. xml.async = "false";
  2065. xml.loadXML(data);
  2066. }
  2067. } catch (e) {
  2068. xml = undefined;
  2069. }
  2070. if (!xml || !xml.documentElement || xml.getElementsByTagName("parsererror").length) {
  2071. jQuery.error("Invalid XML: " + data);
  2072. }
  2073. return xml;
  2074. };
  2075. jQuery.post = function (url, data, callback, type) {
  2076. /// <summary>
  2077. /// Load data from the server using a HTTP POST request.
  2078. /// </summary>
  2079. /// <param name="url" type="String">
  2080. /// A string containing the URL to which the request is sent.
  2081. /// </param>
  2082. /// <param name="data" type="String">
  2083. /// A plain object or string that is sent to the server with the request.
  2084. /// </param>
  2085. /// <param name="callback" type="Function">
  2086. /// A callback function that is executed if the request succeeds.
  2087. /// </param>
  2088. /// <param name="type" type="String">
  2089. /// The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
  2090. /// </param>
  2091. // shift arguments if data argument was omitted
  2092. if (jQuery.isFunction(data)) {
  2093. type = type || callback;
  2094. callback = data;
  2095. data = undefined;
  2096. }
  2097. return jQuery.ajax({
  2098. url: url,
  2099. type: method,
  2100. dataType: type,
  2101. data: data,
  2102. success: callback
  2103. });
  2104. };
  2105. jQuery.prop = function (elem, name, value) {
  2106. var ret, hooks, notxml,
  2107. nType = elem.nodeType;
  2108. // don't get/set properties on text, comment and attribute nodes
  2109. if (!elem || nType === 3 || nType === 8 || nType === 2) {
  2110. return;
  2111. }
  2112. notxml = nType !== 1 || !jQuery.isXMLDoc(elem);
  2113. if (notxml) {
  2114. // Fix name and attach hooks
  2115. name = jQuery.propFix[name] || name;
  2116. hooks = jQuery.propHooks[name];
  2117. }
  2118. if (value !== undefined) {
  2119. if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
  2120. return ret;
  2121. } else {
  2122. return (elem[name] = value);
  2123. }
  2124. } else {
  2125. if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
  2126. return ret;
  2127. } else {
  2128. return elem[name];
  2129. }
  2130. }
  2131. };
  2132. jQuery.propFix = {
  2133. "tabindex": 'tabIndex',
  2134. "readonly": 'readOnly',
  2135. "for": 'htmlFor',
  2136. "class": 'className',
  2137. "maxlength": 'maxLength',
  2138. "cellspacing": 'cellSpacing',
  2139. "cellpadding": 'cellPadding',
  2140. "rowspan": 'rowSpan',
  2141. "colspan": 'colSpan',
  2142. "usemap": 'useMap',
  2143. "frameborder": 'frameBorder',
  2144. "contenteditable": 'contentEditable'
  2145. };
  2146. jQuery.propHooks = {
  2147. "tabIndex": {},
  2148. "selected": {}
  2149. };
  2150. jQuery.proxy = function (fn, context) {
  2151. /// <summary>
  2152. /// Takes a function and returns a new one that will always have a particular context.
  2153. /// &#10;1 - jQuery.proxy(function, context)
  2154. /// &#10;2 - jQuery.proxy(context, name)
  2155. /// &#10;3 - jQuery.proxy(function, context, additionalArguments)
  2156. /// &#10;4 - jQuery.proxy(context, name, additionalArguments)
  2157. /// </summary>
  2158. /// <param name="fn" type="Function">
  2159. /// The function whose context will be changed.
  2160. /// </param>
  2161. /// <param name="context" type="PlainObject">
  2162. /// The object to which the context (this) of the function should be set.
  2163. /// </param>
  2164. /// <param name="" type="Anything">
  2165. /// Any number of arguments to be passed to the function referenced in the function argument.
  2166. /// </param>
  2167. /// <returns type="Function" />
  2168. var args, proxy, tmp;
  2169. if (typeof context === "string") {
  2170. tmp = fn[context];
  2171. context = fn;
  2172. fn = tmp;
  2173. }
  2174. // Quick check to determine if target is callable, in the spec
  2175. // this throws a TypeError, but we will just return undefined.
  2176. if (!jQuery.isFunction(fn)) {
  2177. return undefined;
  2178. }
  2179. // Simulated bind
  2180. args = core_slice.call(arguments, 2);
  2181. proxy = function () {
  2182. return fn.apply(context || this, args.concat(core_slice.call(arguments)));
  2183. };
  2184. // Set the guid of unique handler to the same of original handler, so it can be removed
  2185. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  2186. return proxy;
  2187. };
  2188. jQuery.queue = function (elem, type, data) {
  2189. /// <summary>
  2190. /// 1: Show the queue of functions to be executed on the matched element.
  2191. /// &#10; 1.1 - jQuery.queue(element, queueName)
  2192. /// &#10;2: Manipulate the queue of functions to be executed on the matched element.
  2193. /// &#10; 2.1 - jQuery.queue(element, queueName, newQueue)
  2194. /// &#10; 2.2 - jQuery.queue(element, queueName, callback())
  2195. /// </summary>
  2196. /// <param name="elem" domElement="true">
  2197. /// A DOM element where the array of queued functions is attached.
  2198. /// </param>
  2199. /// <param name="type" type="String">
  2200. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  2201. /// </param>
  2202. /// <param name="data" type="Array">
  2203. /// An array of functions to replace the current queue contents.
  2204. /// </param>
  2205. /// <returns type="jQuery" />
  2206. var queue;
  2207. if (elem) {
  2208. type = (type || "fx") + "queue";
  2209. queue = jQuery._data(elem, type);
  2210. // Speed up dequeue by getting out quickly if this is just a lookup
  2211. if (data) {
  2212. if (!queue || jQuery.isArray(data)) {
  2213. queue = jQuery._data(elem, type, jQuery.makeArray(data));
  2214. } else {
  2215. queue.push(data);
  2216. }
  2217. }
  2218. return queue || [];
  2219. }
  2220. };
  2221. jQuery.ready = function (wait) {
  2222. // Abort if there are pending holds or we're already ready
  2223. if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
  2224. return;
  2225. }
  2226. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  2227. if (!document.body) {
  2228. return setTimeout(jQuery.ready);
  2229. }
  2230. // Remember that the DOM is ready
  2231. jQuery.isReady = true;
  2232. // If a normal DOM Ready event fired, decrement, and wait if need be
  2233. if (wait !== true && --jQuery.readyWait > 0) {
  2234. return;
  2235. }
  2236. // If there are functions bound, to execute
  2237. readyList.resolveWith(document, [jQuery]);
  2238. // Trigger any bound ready events
  2239. if (jQuery.fn.trigger) {
  2240. jQuery(document).trigger("ready").off("ready");
  2241. }
  2242. };
  2243. jQuery.readyWait = 0;
  2244. jQuery.removeAttr = function (elem, value) {
  2245. var name, propName,
  2246. i = 0,
  2247. attrNames = value && value.match(core_rnotwhite);
  2248. if (attrNames && elem.nodeType === 1) {
  2249. while ((name = attrNames[i++])) {
  2250. propName = jQuery.propFix[name] || name;
  2251. // Boolean attributes get special treatment (#10870)
  2252. if (rboolean.test(name)) {
  2253. // Set corresponding property to false for boolean attributes
  2254. // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
  2255. if (!getSetAttribute && ruseDefault.test(name)) {
  2256. elem[jQuery.camelCase("default-" + name)] =
  2257. elem[propName] = false;
  2258. } else {
  2259. elem[propName] = false;
  2260. }
  2261. // See #9699 for explanation of this approach (setting first, then removal)
  2262. } else {
  2263. jQuery.attr(elem, name, "");
  2264. }
  2265. elem.removeAttribute(getSetAttribute ? name : propName);
  2266. }
  2267. }
  2268. };
  2269. jQuery.removeData = function (elem, name) {
  2270. /// <summary>
  2271. /// Remove a previously-stored piece of data.
  2272. /// </summary>
  2273. /// <param name="elem" domElement="true">
  2274. /// A DOM element from which to remove data.
  2275. /// </param>
  2276. /// <param name="name" type="String">
  2277. /// A string naming the piece of data to remove.
  2278. /// </param>
  2279. /// <returns type="jQuery" />
  2280. return internalRemoveData(elem, name);
  2281. };
  2282. jQuery.removeEvent = function (elem, type, handle) {
  2283. if (elem.removeEventListener) {
  2284. elem.removeEventListener(type, handle, false);
  2285. }
  2286. };
  2287. jQuery.sibling = function (n, elem) {
  2288. var r = [];
  2289. for (; n; n = n.nextSibling) {
  2290. if (n.nodeType === 1 && n !== elem) {
  2291. r.push(n);
  2292. }
  2293. }
  2294. return r;
  2295. };
  2296. jQuery.speed = function (speed, easing, fn) {
  2297. var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
  2298. complete: fn || !fn && easing ||
  2299. jQuery.isFunction(speed) && speed,
  2300. duration: speed,
  2301. easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
  2302. };
  2303. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  2304. opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
  2305. // normalize opt.queue - true/undefined/null -> "fx"
  2306. if (opt.queue == null || opt.queue === true) {
  2307. opt.queue = "fx";
  2308. }
  2309. // Queueing
  2310. opt.old = opt.complete;
  2311. opt.complete = function () {
  2312. if (jQuery.isFunction(opt.old)) {
  2313. opt.old.call(this);
  2314. }
  2315. if (opt.queue) {
  2316. jQuery.dequeue(this, opt.queue);
  2317. }
  2318. };
  2319. return opt;
  2320. };
  2321. jQuery.style = function (elem, name, value, extra) {
  2322. // Don't set styles on text and comment nodes
  2323. if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
  2324. return;
  2325. }
  2326. // Make sure that we're working with the right name
  2327. var ret, type, hooks,
  2328. origName = jQuery.camelCase(name),
  2329. style = elem.style;
  2330. name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName));
  2331. // gets hook for the prefixed version
  2332. // followed by the unprefixed version
  2333. hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
  2334. // Check if we're setting a value
  2335. if (value !== undefined) {
  2336. type = typeof value;
  2337. // convert relative number strings (+= or -=) to relative numbers. #7345
  2338. if (type === "string" && (ret = rrelNum.exec(value))) {
  2339. value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name));
  2340. // Fixes bug #9237
  2341. type = "number";
  2342. }
  2343. // Make sure that NaN and null values aren't set. See: #7116
  2344. if (value == null || type === "number" && isNaN(value)) {
  2345. return;
  2346. }
  2347. // If a number was passed in, add 'px' to the (except for certain CSS properties)
  2348. if (type === "number" && !jQuery.cssNumber[origName]) {
  2349. value += "px";
  2350. }
  2351. // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
  2352. // but it would mean to define eight (for every problematic property) identical functions
  2353. if (!jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
  2354. style[name] = "inherit";
  2355. }
  2356. // If a hook was provided, use that value, otherwise just set the specified value
  2357. if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {
  2358. // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
  2359. // Fixes bug #5509
  2360. try {
  2361. style[name] = value;
  2362. } catch (e) { }
  2363. }
  2364. } else {
  2365. // If a hook was provided get the non-computed value from there
  2366. if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {
  2367. return ret;
  2368. }
  2369. // Otherwise just get the value from the style object
  2370. return style[name];
  2371. }
  2372. };
  2373. jQuery.support = {
  2374. "getSetAttribute": true,
  2375. "leadingWhitespace": true,
  2376. "tbody": true,
  2377. "htmlSerialize": true,
  2378. "style": true,
  2379. "hrefNormalized": true,
  2380. "opacity": true,
  2381. "cssFloat": true,
  2382. "checkOn": true,
  2383. "optSelected": false,
  2384. "enctype": true,
  2385. "html5Clone": true,
  2386. "boxModel": true,
  2387. "deleteExpando": true,
  2388. "noCloneEvent": true,
  2389. "inlineBlockNeedsLayout": false,
  2390. "shrinkWrapBlocks": false,
  2391. "reliableMarginRight": true,
  2392. "boxSizingReliable": false,
  2393. "pixelPosition": true,
  2394. "noCloneChecked": false,
  2395. "optDisabled": true,
  2396. "input": true,
  2397. "radioValue": false,
  2398. "appendChecked": true,
  2399. "checkClone": true,
  2400. "submitBubbles": true,
  2401. "changeBubbles": true,
  2402. "focusinBubbles": true,
  2403. "clearCloneStyle": false,
  2404. "cors": true,
  2405. "ajax": true,
  2406. "reliableHiddenOffsets": true,
  2407. "boxSizing": true,
  2408. "doesNotIncludeMarginInBodyOffset": true
  2409. };
  2410. jQuery.swap = function (elem, options, callback, args) {
  2411. var ret, name,
  2412. old = {};
  2413. // Remember the old values, and insert the new ones
  2414. for (name in options) {
  2415. old[name] = elem.style[name];
  2416. elem.style[name] = options[name];
  2417. }
  2418. ret = callback.apply(elem, args || []);
  2419. // Revert the old values
  2420. for (name in options) {
  2421. elem.style[name] = old[name];
  2422. }
  2423. return ret;
  2424. };
  2425. jQuery.text = function (elem) {
  2426. var node,
  2427. ret = "",
  2428. i = 0,
  2429. nodeType = elem.nodeType;
  2430. if (!nodeType) {
  2431. // If no nodeType, this is expected to be an array
  2432. for (; (node = elem[i]) ; i++) {
  2433. // Do not traverse comment nodes
  2434. ret += getText(node);
  2435. }
  2436. } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
  2437. // Use textContent for elements
  2438. // innerText usage removed for consistency of new lines (see #11153)
  2439. if (typeof elem.textContent === "string") {
  2440. return elem.textContent;
  2441. } else {
  2442. // Traverse its children
  2443. for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
  2444. ret += getText(elem);
  2445. }
  2446. }
  2447. } else if (nodeType === 3 || nodeType === 4) {
  2448. return elem.nodeValue;
  2449. }
  2450. // Do not include comment or processing instruction nodes
  2451. return ret;
  2452. };
  2453. jQuery.trim = function (text) {
  2454. /// <summary>
  2455. /// Remove the whitespace from the beginning and end of a string.
  2456. /// </summary>
  2457. /// <param name="text" type="String">
  2458. /// The string to trim.
  2459. /// </param>
  2460. /// <returns type="String" />
  2461. return text == null ?
  2462. "" :
  2463. core_trim.call(text);
  2464. };
  2465. jQuery.type = function (obj) {
  2466. /// <summary>
  2467. /// Determine the internal JavaScript [[Class]] of an object.
  2468. /// </summary>
  2469. /// <param name="obj" type="PlainObject">
  2470. /// Object to get the internal JavaScript [[Class]] of.
  2471. /// </param>
  2472. /// <returns type="String" />
  2473. if (obj == null) {
  2474. return String(obj);
  2475. }
  2476. return typeof obj === "object" || typeof obj === "function" ?
  2477. class2type[core_toString.call(obj)] || "object" :
  2478. typeof obj;
  2479. };
  2480. jQuery.unique = function (results) {
  2481. /// <summary>
  2482. /// Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.
  2483. /// </summary>
  2484. /// <param name="results" type="Array">
  2485. /// The Array of DOM elements.
  2486. /// </param>
  2487. /// <returns type="Array" />
  2488. var elem,
  2489. duplicates = [],
  2490. i = 1,
  2491. j = 0;
  2492. // Unless we *know* we can detect duplicates, assume their presence
  2493. hasDuplicate = !support.detectDuplicates;
  2494. results.sort(sortOrder);
  2495. if (hasDuplicate) {
  2496. for (; (elem = results[i]) ; i++) {
  2497. if (elem === results[i - 1]) {
  2498. j = duplicates.push(i);
  2499. }
  2500. }
  2501. while (j--) {
  2502. results.splice(duplicates[j], 1);
  2503. }
  2504. }
  2505. return results;
  2506. };
  2507. jQuery.valHooks = {
  2508. "option": {},
  2509. "select": {},
  2510. "radio": {},
  2511. "checkbox": {}
  2512. };
  2513. jQuery.when = function (subordinate /* , ..., subordinateN */) {
  2514. /// <summary>
  2515. /// Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
  2516. /// </summary>
  2517. /// <param name="subordinate/*" type="Deferred">
  2518. /// One or more Deferred objects, or plain JavaScript objects.
  2519. /// </param>
  2520. /// <returns type="Promise" />
  2521. var i = 0,
  2522. resolveValues = core_slice.call(arguments),
  2523. length = resolveValues.length,
  2524. // the count of uncompleted subordinates
  2525. remaining = length !== 1 || (subordinate && jQuery.isFunction(subordinate.promise)) ? length : 0,
  2526. // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
  2527. deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
  2528. // Update function for both resolve and progress values
  2529. updateFunc = function (i, contexts, values) {
  2530. return function (value) {
  2531. contexts[i] = this;
  2532. values[i] = arguments.length > 1 ? core_slice.call(arguments) : value;
  2533. if (values === progressValues) {
  2534. deferred.notifyWith(contexts, values);
  2535. } else if (!(--remaining)) {
  2536. deferred.resolveWith(contexts, values);
  2537. }
  2538. };
  2539. },
  2540. progressValues, progressContexts, resolveContexts;
  2541. // add listeners to Deferred subordinates; treat others as resolved
  2542. if (length > 1) {
  2543. progressValues = new Array(length);
  2544. progressContexts = new Array(length);
  2545. resolveContexts = new Array(length);
  2546. for (; i < length; i++) {
  2547. if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {
  2548. resolveValues[i].promise()
  2549. .done(updateFunc(i, resolveContexts, resolveValues))
  2550. .fail(deferred.reject)
  2551. .progress(updateFunc(i, progressContexts, progressValues));
  2552. } else {
  2553. --remaining;
  2554. }
  2555. }
  2556. }
  2557. // if we're not waiting on anything, resolve the master
  2558. if (!remaining) {
  2559. deferred.resolveWith(resolveContexts, resolveValues);
  2560. }
  2561. return deferred.promise();
  2562. };
  2563. jQuery.Event.prototype.isDefaultPrevented = function returnFalse() {
  2564. /// <summary>
  2565. /// Returns whether event.preventDefault() was ever called on this event object.
  2566. /// </summary>
  2567. /// <returns type="Boolean" />
  2568. return false;
  2569. };
  2570. jQuery.Event.prototype.isImmediatePropagationStopped = function returnFalse() {
  2571. /// <summary>
  2572. /// Returns whether event.stopImmediatePropagation() was ever called on this event object.
  2573. /// </summary>
  2574. /// <returns type="Boolean" />
  2575. return false;
  2576. };
  2577. jQuery.Event.prototype.isPropagationStopped = function returnFalse() {
  2578. /// <summary>
  2579. /// Returns whether event.stopPropagation() was ever called on this event object.
  2580. /// </summary>
  2581. /// <returns type="Boolean" />
  2582. return false;
  2583. };
  2584. jQuery.Event.prototype.preventDefault = function () {
  2585. /// <summary>
  2586. /// If this method is called, the default action of the event will not be triggered.
  2587. /// </summary>
  2588. /// <returns type="undefined" />
  2589. var e = this.originalEvent;
  2590. this.isDefaultPrevented = returnTrue;
  2591. if (!e) {
  2592. return;
  2593. }
  2594. // If preventDefault exists, run it on the original event
  2595. if (e.preventDefault) {
  2596. e.preventDefault();
  2597. // Support: IE
  2598. // Otherwise set the returnValue property of the original event to false
  2599. } else {
  2600. e.returnValue = false;
  2601. }
  2602. };
  2603. jQuery.Event.prototype.stopImmediatePropagation = function () {
  2604. /// <summary>
  2605. /// Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree.
  2606. /// </summary>
  2607. this.isImmediatePropagationStopped = returnTrue;
  2608. this.stopPropagation();
  2609. };
  2610. jQuery.Event.prototype.stopPropagation = function () {
  2611. /// <summary>
  2612. /// Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
  2613. /// </summary>
  2614. var e = this.originalEvent;
  2615. this.isPropagationStopped = returnTrue;
  2616. if (!e) {
  2617. return;
  2618. }
  2619. // If stopPropagation exists, run it on the original event
  2620. if (e.stopPropagation) {
  2621. e.stopPropagation();
  2622. }
  2623. // Support: IE
  2624. // Set the cancelBubble property of the original event to true
  2625. e.cancelBubble = true;
  2626. };
  2627. jQuery.prototype.add = function (selector, context) {
  2628. /// <summary>
  2629. /// Add elements to the set of matched elements.
  2630. /// &#10;1 - add(selector)
  2631. /// &#10;2 - add(elements)
  2632. /// &#10;3 - add(html)
  2633. /// &#10;4 - add(jQuery object)
  2634. /// &#10;5 - add(selector, context)
  2635. /// </summary>
  2636. /// <param name="selector" type="String">
  2637. /// A string representing a selector expression to find additional elements to add to the set of matched elements.
  2638. /// </param>
  2639. /// <param name="context" domElement="true">
  2640. /// The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method.
  2641. /// </param>
  2642. /// <returns type="jQuery" />
  2643. var set = typeof selector === "string" ?
  2644. jQuery(selector, context) :
  2645. jQuery.makeArray(selector && selector.nodeType ? [selector] : selector),
  2646. all = jQuery.merge(this.get(), set);
  2647. return this.pushStack(jQuery.unique(all));
  2648. };
  2649. jQuery.prototype.addBack = function (selector) {
  2650. /// <summary>
  2651. /// Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
  2652. /// </summary>
  2653. /// <param name="selector" type="String">
  2654. /// A string containing a selector expression to match the current set of elements against.
  2655. /// </param>
  2656. /// <returns type="jQuery" />
  2657. return this.add(selector == null ?
  2658. this.prevObject : this.prevObject.filter(selector)
  2659. );
  2660. };
  2661. jQuery.prototype.addClass = function (value) {
  2662. /// <summary>
  2663. /// Adds the specified class(es) to each of the set of matched elements.
  2664. /// &#10;1 - addClass(className)
  2665. /// &#10;2 - addClass(function(index, currentClass))
  2666. /// </summary>
  2667. /// <param name="value" type="String">
  2668. /// One or more space-separated classes to be added to the class attribute of each matched element.
  2669. /// </param>
  2670. /// <returns type="jQuery" />
  2671. var classes, elem, cur, clazz, j,
  2672. i = 0,
  2673. len = this.length,
  2674. proceed = typeof value === "string" && value;
  2675. if (jQuery.isFunction(value)) {
  2676. return this.each(function (j) {
  2677. jQuery(this).addClass(value.call(this, j, this.className));
  2678. });
  2679. }
  2680. if (proceed) {
  2681. // The disjunction here is for better compressibility (see removeClass)
  2682. classes = (value || "").match(core_rnotwhite) || [];
  2683. for (; i < len; i++) {
  2684. elem = this[i];
  2685. cur = elem.nodeType === 1 && (elem.className ?
  2686. (" " + elem.className + " ").replace(rclass, " ") :
  2687. " "
  2688. );
  2689. if (cur) {
  2690. j = 0;
  2691. while ((clazz = classes[j++])) {
  2692. if (cur.indexOf(" " + clazz + " ") < 0) {
  2693. cur += clazz + " ";
  2694. }
  2695. }
  2696. elem.className = jQuery.trim(cur);
  2697. }
  2698. }
  2699. }
  2700. return this;
  2701. };
  2702. jQuery.prototype.after = function () {
  2703. /// <summary>
  2704. /// Insert content, specified by the parameter, after each element in the set of matched elements.
  2705. /// &#10;1 - after(content, content)
  2706. /// &#10;2 - after(function(index))
  2707. /// </summary>
  2708. /// <param name="" type="jQuery">
  2709. /// HTML string, DOM element, or jQuery object to insert after each element in the set of matched elements.
  2710. /// </param>
  2711. /// <param name="" type="jQuery">
  2712. /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.
  2713. /// </param>
  2714. /// <returns type="jQuery" />
  2715. return this.domManip(arguments, false, function (elem) {
  2716. if (this.parentNode) {
  2717. this.parentNode.insertBefore(elem, this.nextSibling);
  2718. }
  2719. });
  2720. };
  2721. jQuery.prototype.ajaxComplete = function (fn) {
  2722. /// <summary>
  2723. /// Register a handler to be called when Ajax requests complete. This is an AjaxEvent.
  2724. /// </summary>
  2725. /// <param name="fn" type="Function">
  2726. /// The function to be invoked.
  2727. /// </param>
  2728. /// <returns type="jQuery" />
  2729. return this.on(type, fn);
  2730. };
  2731. jQuery.prototype.ajaxError = function (fn) {
  2732. /// <summary>
  2733. /// Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
  2734. /// </summary>
  2735. /// <param name="fn" type="Function">
  2736. /// The function to be invoked.
  2737. /// </param>
  2738. /// <returns type="jQuery" />
  2739. return this.on(type, fn);
  2740. };
  2741. jQuery.prototype.ajaxSend = function (fn) {
  2742. /// <summary>
  2743. /// Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
  2744. /// </summary>
  2745. /// <param name="fn" type="Function">
  2746. /// The function to be invoked.
  2747. /// </param>
  2748. /// <returns type="jQuery" />
  2749. return this.on(type, fn);
  2750. };
  2751. jQuery.prototype.ajaxStart = function (fn) {
  2752. /// <summary>
  2753. /// Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
  2754. /// </summary>
  2755. /// <param name="fn" type="Function">
  2756. /// The function to be invoked.
  2757. /// </param>
  2758. /// <returns type="jQuery" />
  2759. return this.on(type, fn);
  2760. };
  2761. jQuery.prototype.ajaxStop = function (fn) {
  2762. /// <summary>
  2763. /// Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
  2764. /// </summary>
  2765. /// <param name="fn" type="Function">
  2766. /// The function to be invoked.
  2767. /// </param>
  2768. /// <returns type="jQuery" />
  2769. return this.on(type, fn);
  2770. };
  2771. jQuery.prototype.ajaxSuccess = function (fn) {
  2772. /// <summary>
  2773. /// Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
  2774. /// </summary>
  2775. /// <param name="fn" type="Function">
  2776. /// The function to be invoked.
  2777. /// </param>
  2778. /// <returns type="jQuery" />
  2779. return this.on(type, fn);
  2780. };
  2781. jQuery.prototype.andSelf = function (selector) {
  2782. /// <summary>
  2783. /// Add the previous set of elements on the stack to the current set.
  2784. /// </summary>
  2785. /// <returns type="jQuery" />
  2786. return this.add(selector == null ?
  2787. this.prevObject : this.prevObject.filter(selector)
  2788. );
  2789. };
  2790. jQuery.prototype.animate = function (prop, speed, easing, callback) {
  2791. /// <summary>
  2792. /// Perform a custom animation of a set of CSS properties.
  2793. /// &#10;1 - animate(properties, duration, easing, complete)
  2794. /// &#10;2 - animate(properties, options)
  2795. /// </summary>
  2796. /// <param name="prop" type="PlainObject">
  2797. /// An object of CSS properties and values that the animation will move toward.
  2798. /// </param>
  2799. /// <param name="speed" type="">
  2800. /// A string or number determining how long the animation will run.
  2801. /// </param>
  2802. /// <param name="easing" type="String">
  2803. /// A string indicating which easing function to use for the transition.
  2804. /// </param>
  2805. /// <param name="callback" type="Function">
  2806. /// A function to call once the animation is complete.
  2807. /// </param>
  2808. /// <returns type="jQuery" />
  2809. var empty = jQuery.isEmptyObject(prop),
  2810. optall = jQuery.speed(speed, easing, callback),
  2811. doAnimation = function () {
  2812. // Operate on a copy of prop so per-property easing won't be lost
  2813. var anim = Animation(this, jQuery.extend({}, prop), optall);
  2814. doAnimation.finish = function () {
  2815. anim.stop(true);
  2816. };
  2817. // Empty animations, or finishing resolves immediately
  2818. if (empty || jQuery._data(this, "finish")) {
  2819. anim.stop(true);
  2820. }
  2821. };
  2822. doAnimation.finish = doAnimation;
  2823. return empty || optall.queue === false ?
  2824. this.each(doAnimation) :
  2825. this.queue(optall.queue, doAnimation);
  2826. };
  2827. jQuery.prototype.append = function () {
  2828. /// <summary>
  2829. /// Insert content, specified by the parameter, to the end of each element in the set of matched elements.
  2830. /// &#10;1 - append(content, content)
  2831. /// &#10;2 - append(function(index, html))
  2832. /// </summary>
  2833. /// <param name="" type="jQuery">
  2834. /// DOM element, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
  2835. /// </param>
  2836. /// <param name="" type="jQuery">
  2837. /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.
  2838. /// </param>
  2839. /// <returns type="jQuery" />
  2840. return this.domManip(arguments, true, function (elem) {
  2841. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  2842. this.appendChild(elem);
  2843. }
  2844. });
  2845. };
  2846. jQuery.prototype.appendTo = function (selector) {
  2847. /// <summary>
  2848. /// Insert every element in the set of matched elements to the end of the target.
  2849. /// </summary>
  2850. /// <param name="selector" type="jQuery">
  2851. /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.
  2852. /// </param>
  2853. /// <returns type="jQuery" />
  2854. var elems,
  2855. i = 0,
  2856. ret = [],
  2857. insert = jQuery(selector),
  2858. last = insert.length - 1;
  2859. for (; i <= last; i++) {
  2860. elems = i === last ? this : this.clone(true);
  2861. jQuery(insert[i])[original](elems);
  2862. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  2863. core_push.apply(ret, elems.get());
  2864. }
  2865. return this.pushStack(ret);
  2866. };
  2867. jQuery.prototype.attr = function (name, value) {
  2868. /// <summary>
  2869. /// 1: Get the value of an attribute for the first element in the set of matched elements.
  2870. /// &#10; 1.1 - attr(attributeName)
  2871. /// &#10;2: Set one or more attributes for the set of matched elements.
  2872. /// &#10; 2.1 - attr(attributeName, value)
  2873. /// &#10; 2.2 - attr(attributes)
  2874. /// &#10; 2.3 - attr(attributeName, function(index, attr))
  2875. /// </summary>
  2876. /// <param name="name" type="String">
  2877. /// The name of the attribute to set.
  2878. /// </param>
  2879. /// <param name="value" type="Number">
  2880. /// A value to set for the attribute.
  2881. /// </param>
  2882. /// <returns type="jQuery" />
  2883. return jQuery.access(this, jQuery.attr, name, value, arguments.length > 1);
  2884. };
  2885. jQuery.prototype.before = function () {
  2886. /// <summary>
  2887. /// Insert content, specified by the parameter, before each element in the set of matched elements.
  2888. /// &#10;1 - before(content, content)
  2889. /// &#10;2 - before(function)
  2890. /// </summary>
  2891. /// <param name="" type="jQuery">
  2892. /// HTML string, DOM element, or jQuery object to insert before each element in the set of matched elements.
  2893. /// </param>
  2894. /// <param name="" type="jQuery">
  2895. /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements.
  2896. /// </param>
  2897. /// <returns type="jQuery" />
  2898. return this.domManip(arguments, false, function (elem) {
  2899. if (this.parentNode) {
  2900. this.parentNode.insertBefore(elem, this);
  2901. }
  2902. });
  2903. };
  2904. jQuery.prototype.bind = function (types, data, fn) {
  2905. /// <summary>
  2906. /// Attach a handler to an event for the elements.
  2907. /// &#10;1 - bind(eventType, eventData, handler(eventObject))
  2908. /// &#10;2 - bind(eventType, eventData, preventBubble)
  2909. /// &#10;3 - bind(events)
  2910. /// </summary>
  2911. /// <param name="types" type="String">
  2912. /// A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
  2913. /// </param>
  2914. /// <param name="data" type="Object">
  2915. /// An object containing data that will be passed to the event handler.
  2916. /// </param>
  2917. /// <param name="fn" type="Function">
  2918. /// A function to execute each time the event is triggered.
  2919. /// </param>
  2920. /// <returns type="jQuery" />
  2921. return this.on(types, null, data, fn);
  2922. };
  2923. jQuery.prototype.blur = function (data, fn) {
  2924. /// <summary>
  2925. /// Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
  2926. /// &#10;1 - blur(handler(eventObject))
  2927. /// &#10;2 - blur(eventData, handler(eventObject))
  2928. /// &#10;3 - blur()
  2929. /// </summary>
  2930. /// <param name="data" type="Object">
  2931. /// An object containing data that will be passed to the event handler.
  2932. /// </param>
  2933. /// <param name="fn" type="Function">
  2934. /// A function to execute each time the event is triggered.
  2935. /// </param>
  2936. /// <returns type="jQuery" />
  2937. return arguments.length > 0 ?
  2938. this.on(name, null, data, fn) :
  2939. this.trigger(name);
  2940. };
  2941. jQuery.prototype.change = function (data, fn) {
  2942. /// <summary>
  2943. /// Bind an event handler to the "change" JavaScript event, or trigger that event on an element.
  2944. /// &#10;1 - change(handler(eventObject))
  2945. /// &#10;2 - change(eventData, handler(eventObject))
  2946. /// &#10;3 - change()
  2947. /// </summary>
  2948. /// <param name="data" type="Object">
  2949. /// An object containing data that will be passed to the event handler.
  2950. /// </param>
  2951. /// <param name="fn" type="Function">
  2952. /// A function to execute each time the event is triggered.
  2953. /// </param>
  2954. /// <returns type="jQuery" />
  2955. return arguments.length > 0 ?
  2956. this.on(name, null, data, fn) :
  2957. this.trigger(name);
  2958. };
  2959. jQuery.prototype.children = function (until, selector) {
  2960. /// <summary>
  2961. /// Get the children of each element in the set of matched elements, optionally filtered by a selector.
  2962. /// </summary>
  2963. /// <param name="until" type="String">
  2964. /// A string containing a selector expression to match elements against.
  2965. /// </param>
  2966. /// <returns type="jQuery" />
  2967. var ret = jQuery.map(this, fn, until);
  2968. if (!runtil.test(name)) {
  2969. selector = until;
  2970. }
  2971. if (selector && typeof selector === "string") {
  2972. ret = jQuery.filter(selector, ret);
  2973. }
  2974. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  2975. if (this.length > 1 && rparentsprev.test(name)) {
  2976. ret = ret.reverse();
  2977. }
  2978. return this.pushStack(ret);
  2979. };
  2980. jQuery.prototype.clearQueue = function (type) {
  2981. /// <summary>
  2982. /// Remove from the queue all items that have not yet been run.
  2983. /// </summary>
  2984. /// <param name="type" type="String">
  2985. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  2986. /// </param>
  2987. /// <returns type="jQuery" />
  2988. return this.queue(type || "fx", []);
  2989. };
  2990. jQuery.prototype.click = function (data, fn) {
  2991. /// <summary>
  2992. /// Bind an event handler to the "click" JavaScript event, or trigger that event on an element.
  2993. /// &#10;1 - click(handler(eventObject))
  2994. /// &#10;2 - click(eventData, handler(eventObject))
  2995. /// &#10;3 - click()
  2996. /// </summary>
  2997. /// <param name="data" type="Object">
  2998. /// An object containing data that will be passed to the event handler.
  2999. /// </param>
  3000. /// <param name="fn" type="Function">
  3001. /// A function to execute each time the event is triggered.
  3002. /// </param>
  3003. /// <returns type="jQuery" />
  3004. return arguments.length > 0 ?
  3005. this.on(name, null, data, fn) :
  3006. this.trigger(name);
  3007. };
  3008. jQuery.prototype.clone = function (dataAndEvents, deepDataAndEvents) {
  3009. /// <summary>
  3010. /// Create a deep copy of the set of matched elements.
  3011. /// &#10;1 - clone(withDataAndEvents)
  3012. /// &#10;2 - clone(withDataAndEvents, deepWithDataAndEvents)
  3013. /// </summary>
  3014. /// <param name="dataAndEvents" type="Boolean">
  3015. /// A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. *In jQuery 1.5.0 the default value was incorrectly true; it was changed back to false in 1.5.1 and up.
  3016. /// </param>
  3017. /// <param name="deepDataAndEvents" type="Boolean">
  3018. /// A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false).
  3019. /// </param>
  3020. /// <returns type="jQuery" />
  3021. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  3022. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  3023. return this.map(function () {
  3024. return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
  3025. });
  3026. };
  3027. jQuery.prototype.closest = function (selectors, context) {
  3028. /// <summary>
  3029. /// 1: For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
  3030. /// &#10; 1.1 - closest(selector)
  3031. /// &#10; 1.2 - closest(selector, context)
  3032. /// &#10; 1.3 - closest(jQuery object)
  3033. /// &#10; 1.4 - closest(element)
  3034. /// &#10;2: Get an array of all the elements and selectors matched against the current element up through the DOM tree.
  3035. /// &#10; 2.1 - closest(selectors, context)
  3036. /// </summary>
  3037. /// <param name="selectors" type="String">
  3038. /// A string containing a selector expression to match elements against.
  3039. /// </param>
  3040. /// <param name="context" domElement="true">
  3041. /// A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
  3042. /// </param>
  3043. /// <returns type="jQuery" />
  3044. var cur,
  3045. i = 0,
  3046. l = this.length,
  3047. ret = [],
  3048. pos = rneedsContext.test(selectors) || typeof selectors !== "string" ?
  3049. jQuery(selectors, context || this.context) :
  3050. 0;
  3051. for (; i < l; i++) {
  3052. cur = this[i];
  3053. while (cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11) {
  3054. if (pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors)) {
  3055. ret.push(cur);
  3056. break;
  3057. }
  3058. cur = cur.parentNode;
  3059. }
  3060. }
  3061. return this.pushStack(ret.length > 1 ? jQuery.unique(ret) : ret);
  3062. };
  3063. jQuery.prototype.constructor = function (selector, context) {
  3064. // The jQuery object is actually just the init constructor 'enhanced'
  3065. return new jQuery.fn.init(selector, context, rootjQuery);
  3066. };
  3067. jQuery.prototype.contents = function (until, selector) {
  3068. /// <summary>
  3069. /// Get the children of each element in the set of matched elements, including text and comment nodes.
  3070. /// </summary>
  3071. /// <returns type="jQuery" />
  3072. var ret = jQuery.map(this, fn, until);
  3073. if (!runtil.test(name)) {
  3074. selector = until;
  3075. }
  3076. if (selector && typeof selector === "string") {
  3077. ret = jQuery.filter(selector, ret);
  3078. }
  3079. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  3080. if (this.length > 1 && rparentsprev.test(name)) {
  3081. ret = ret.reverse();
  3082. }
  3083. return this.pushStack(ret);
  3084. };
  3085. jQuery.prototype.contextmenu = function (data, fn) {
  3086. return arguments.length > 0 ?
  3087. this.on(name, null, data, fn) :
  3088. this.trigger(name);
  3089. };
  3090. jQuery.prototype.css = function (name, value) {
  3091. /// <summary>
  3092. /// 1: Get the value of style properties for the first element in the set of matched elements.
  3093. /// &#10; 1.1 - css(propertyName)
  3094. /// &#10; 1.2 - css(propertyNames)
  3095. /// &#10;2: Set one or more CSS properties for the set of matched elements.
  3096. /// &#10; 2.1 - css(propertyName, value)
  3097. /// &#10; 2.2 - css(propertyName, function(index, value))
  3098. /// &#10; 2.3 - css(properties)
  3099. /// </summary>
  3100. /// <param name="name" type="String">
  3101. /// A CSS property name.
  3102. /// </param>
  3103. /// <param name="value" type="Number">
  3104. /// A value to set for the property.
  3105. /// </param>
  3106. /// <returns type="jQuery" />
  3107. return jQuery.access(this, function (elem, name, value) {
  3108. var len, styles,
  3109. map = {},
  3110. i = 0;
  3111. if (jQuery.isArray(name)) {
  3112. styles = getStyles(elem);
  3113. len = name.length;
  3114. for (; i < len; i++) {
  3115. map[name[i]] = jQuery.css(elem, name[i], false, styles);
  3116. }
  3117. return map;
  3118. }
  3119. return value !== undefined ?
  3120. jQuery.style(elem, name, value) :
  3121. jQuery.css(elem, name);
  3122. }, name, value, arguments.length > 1);
  3123. };
  3124. jQuery.prototype.data = function (key, value) {
  3125. /// <summary>
  3126. /// 1: Store arbitrary data associated with the matched elements.
  3127. /// &#10; 1.1 - data(key, value)
  3128. /// &#10; 1.2 - data(obj)
  3129. /// &#10;2: Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
  3130. /// &#10; 2.1 - data(key)
  3131. /// &#10; 2.2 - data()
  3132. /// </summary>
  3133. /// <param name="key" type="String">
  3134. /// A string naming the piece of data to set.
  3135. /// </param>
  3136. /// <param name="value" type="Object">
  3137. /// The new data value; it can be any Javascript type including Array or Object.
  3138. /// </param>
  3139. /// <returns type="jQuery" />
  3140. var attrs, name,
  3141. elem = this[0],
  3142. i = 0,
  3143. data = null;
  3144. // Gets all values
  3145. if (key === undefined) {
  3146. if (this.length) {
  3147. data = jQuery.data(elem);
  3148. if (elem.nodeType === 1 && !jQuery._data(elem, "parsedAttrs")) {
  3149. attrs = elem.attributes;
  3150. for (; i < attrs.length; i++) {
  3151. name = attrs[i].name;
  3152. if (!name.indexOf("data-")) {
  3153. name = jQuery.camelCase(name.slice(5));
  3154. dataAttr(elem, name, data[name]);
  3155. }
  3156. }
  3157. jQuery._data(elem, "parsedAttrs", true);
  3158. }
  3159. }
  3160. return data;
  3161. }
  3162. // Sets multiple values
  3163. if (typeof key === "object") {
  3164. return this.each(function () {
  3165. jQuery.data(this, key);
  3166. });
  3167. }
  3168. return jQuery.access(this, function (value) {
  3169. if (value === undefined) {
  3170. // Try to fetch any internally stored data first
  3171. return elem ? dataAttr(elem, key, jQuery.data(elem, key)) : null;
  3172. }
  3173. this.each(function () {
  3174. jQuery.data(this, key, value);
  3175. });
  3176. }, null, value, arguments.length > 1, null, true);
  3177. };
  3178. jQuery.prototype.dblclick = function (data, fn) {
  3179. /// <summary>
  3180. /// Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element.
  3181. /// &#10;1 - dblclick(handler(eventObject))
  3182. /// &#10;2 - dblclick(eventData, handler(eventObject))
  3183. /// &#10;3 - dblclick()
  3184. /// </summary>
  3185. /// <param name="data" type="Object">
  3186. /// An object containing data that will be passed to the event handler.
  3187. /// </param>
  3188. /// <param name="fn" type="Function">
  3189. /// A function to execute each time the event is triggered.
  3190. /// </param>
  3191. /// <returns type="jQuery" />
  3192. return arguments.length > 0 ?
  3193. this.on(name, null, data, fn) :
  3194. this.trigger(name);
  3195. };
  3196. jQuery.prototype.delay = function (time, type) {
  3197. /// <summary>
  3198. /// Set a timer to delay execution of subsequent items in the queue.
  3199. /// </summary>
  3200. /// <param name="time" type="Number">
  3201. /// An integer indicating the number of milliseconds to delay execution of the next item in the queue.
  3202. /// </param>
  3203. /// <param name="type" type="String">
  3204. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  3205. /// </param>
  3206. /// <returns type="jQuery" />
  3207. time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
  3208. type = type || "fx";
  3209. return this.queue(type, function (next, hooks) {
  3210. var timeout = setTimeout(next, time);
  3211. hooks.stop = function () {
  3212. clearTimeout(timeout);
  3213. };
  3214. });
  3215. };
  3216. jQuery.prototype.delegate = function (selector, types, data, fn) {
  3217. /// <summary>
  3218. /// Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.
  3219. /// &#10;1 - delegate(selector, eventType, handler(eventObject))
  3220. /// &#10;2 - delegate(selector, eventType, eventData, handler(eventObject))
  3221. /// &#10;3 - delegate(selector, events)
  3222. /// </summary>
  3223. /// <param name="selector" type="String">
  3224. /// A selector to filter the elements that trigger the event.
  3225. /// </param>
  3226. /// <param name="types" type="String">
  3227. /// A string containing one or more space-separated JavaScript event types, such as "click" or "keydown," or custom event names.
  3228. /// </param>
  3229. /// <param name="data" type="Object">
  3230. /// An object containing data that will be passed to the event handler.
  3231. /// </param>
  3232. /// <param name="fn" type="Function">
  3233. /// A function to execute at the time the event is triggered.
  3234. /// </param>
  3235. /// <returns type="jQuery" />
  3236. return this.on(types, selector, data, fn);
  3237. };
  3238. jQuery.prototype.dequeue = function (type) {
  3239. /// <summary>
  3240. /// Execute the next function on the queue for the matched elements.
  3241. /// </summary>
  3242. /// <param name="type" type="String">
  3243. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  3244. /// </param>
  3245. /// <returns type="jQuery" />
  3246. return this.each(function () {
  3247. jQuery.dequeue(this, type);
  3248. });
  3249. };
  3250. jQuery.prototype.detach = function (selector) {
  3251. /// <summary>
  3252. /// Remove the set of matched elements from the DOM.
  3253. /// </summary>
  3254. /// <param name="selector" type="String">
  3255. /// A selector expression that filters the set of matched elements to be removed.
  3256. /// </param>
  3257. /// <returns type="jQuery" />
  3258. return this.remove(selector, true);
  3259. };
  3260. jQuery.prototype.domManip = function (args, table, callback) {
  3261. // Flatten any nested arrays
  3262. args = core_concat.apply([], args);
  3263. var first, node, hasScripts,
  3264. scripts, doc, fragment,
  3265. i = 0,
  3266. l = this.length,
  3267. set = this,
  3268. iNoClone = l - 1,
  3269. value = args[0],
  3270. isFunction = jQuery.isFunction(value);
  3271. // We can't cloneNode fragments that contain checked, in WebKit
  3272. if (isFunction || !(l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test(value))) {
  3273. return this.each(function (index) {
  3274. var self = set.eq(index);
  3275. if (isFunction) {
  3276. args[0] = value.call(this, index, table ? self.html() : undefined);
  3277. }
  3278. self.domManip(args, table, callback);
  3279. });
  3280. }
  3281. if (l) {
  3282. fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, this);
  3283. first = fragment.firstChild;
  3284. if (fragment.childNodes.length === 1) {
  3285. fragment = first;
  3286. }
  3287. if (first) {
  3288. table = table && jQuery.nodeName(first, "tr");
  3289. scripts = jQuery.map(getAll(fragment, "script"), disableScript);
  3290. hasScripts = scripts.length;
  3291. // Use the original fragment for the last item instead of the first because it can end up
  3292. // being emptied incorrectly in certain situations (#8070).
  3293. for (; i < l; i++) {
  3294. node = fragment;
  3295. if (i !== iNoClone) {
  3296. node = jQuery.clone(node, true, true);
  3297. // Keep references to cloned scripts for later restoration
  3298. if (hasScripts) {
  3299. jQuery.merge(scripts, getAll(node, "script"));
  3300. }
  3301. }
  3302. callback.call(
  3303. table && jQuery.nodeName(this[i], "table") ?
  3304. findOrAppend(this[i], "tbody") :
  3305. this[i],
  3306. node,
  3307. i
  3308. );
  3309. }
  3310. if (hasScripts) {
  3311. doc = scripts[scripts.length - 1].ownerDocument;
  3312. // Reenable scripts
  3313. jQuery.map(scripts, restoreScript);
  3314. // Evaluate executable scripts on first document insertion
  3315. for (i = 0; i < hasScripts; i++) {
  3316. node = scripts[i];
  3317. if (rscriptType.test(node.type || "") &&
  3318. !jQuery._data(node, "globalEval") && jQuery.contains(doc, node)) {
  3319. if (node.src) {
  3320. // Hope ajax is available...
  3321. jQuery.ajax({
  3322. url: node.src,
  3323. type: "GET",
  3324. dataType: "script",
  3325. async: false,
  3326. global: false,
  3327. "throws": true
  3328. });
  3329. } else {
  3330. jQuery.globalEval((node.text || node.textContent || node.innerHTML || "").replace(rcleanScript, ""));
  3331. }
  3332. }
  3333. }
  3334. }
  3335. // Fix #11809: Avoid leaking memory
  3336. fragment = first = null;
  3337. }
  3338. }
  3339. return this;
  3340. };
  3341. jQuery.prototype.each = function (callback, args) {
  3342. /// <summary>
  3343. /// Iterate over a jQuery object, executing a function for each matched element.
  3344. /// </summary>
  3345. /// <param name="callback" type="Function">
  3346. /// A function to execute for each matched element.
  3347. /// </param>
  3348. /// <returns type="jQuery" />
  3349. return jQuery.each(this, callback, args);
  3350. };
  3351. jQuery.prototype.empty = function () {
  3352. /// <summary>
  3353. /// Remove all child nodes of the set of matched elements from the DOM.
  3354. /// </summary>
  3355. /// <returns type="jQuery" />
  3356. var elem,
  3357. i = 0;
  3358. for (; (elem = this[i]) != null; i++) {
  3359. // Remove element nodes and prevent memory leaks
  3360. if (elem.nodeType === 1) {
  3361. jQuery.cleanData(getAll(elem, false));
  3362. }
  3363. // Remove any remaining nodes
  3364. while (elem.firstChild) {
  3365. elem.removeChild(elem.firstChild);
  3366. }
  3367. // If this is a select, ensure that it displays empty (#12336)
  3368. // Support: IE<9
  3369. if (elem.options && jQuery.nodeName(elem, "select")) {
  3370. elem.options.length = 0;
  3371. }
  3372. }
  3373. return this;
  3374. };
  3375. jQuery.prototype.end = function () {
  3376. /// <summary>
  3377. /// End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
  3378. /// </summary>
  3379. /// <returns type="jQuery" />
  3380. return this.prevObject || this.constructor(null);
  3381. };
  3382. jQuery.prototype.eq = function (i) {
  3383. /// <summary>
  3384. /// Reduce the set of matched elements to the one at the specified index.
  3385. /// &#10;1 - eq(index)
  3386. /// &#10;2 - eq(-index)
  3387. /// </summary>
  3388. /// <param name="i" type="Number">
  3389. /// An integer indicating the 0-based position of the element.
  3390. /// </param>
  3391. /// <returns type="jQuery" />
  3392. var len = this.length,
  3393. j = +i + (i < 0 ? len : 0);
  3394. return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
  3395. };
  3396. jQuery.prototype.error = function (data, fn) {
  3397. /// <summary>
  3398. /// Bind an event handler to the "error" JavaScript event.
  3399. /// &#10;1 - error(handler(eventObject))
  3400. /// &#10;2 - error(eventData, handler(eventObject))
  3401. /// </summary>
  3402. /// <param name="data" type="Object">
  3403. /// An object containing data that will be passed to the event handler.
  3404. /// </param>
  3405. /// <param name="fn" type="Function">
  3406. /// A function to execute each time the event is triggered.
  3407. /// </param>
  3408. /// <returns type="jQuery" />
  3409. return arguments.length > 0 ?
  3410. this.on(name, null, data, fn) :
  3411. this.trigger(name);
  3412. };
  3413. jQuery.prototype.extend = function () {
  3414. var src, copyIsArray, copy, name, options, clone,
  3415. target = arguments[0] || {},
  3416. i = 1,
  3417. length = arguments.length,
  3418. deep = false;
  3419. // Handle a deep copy situation
  3420. if (typeof target === "boolean") {
  3421. deep = target;
  3422. target = arguments[1] || {};
  3423. // skip the boolean and the target
  3424. i = 2;
  3425. }
  3426. // Handle case when target is a string or something (possible in deep copy)
  3427. if (typeof target !== "object" && !jQuery.isFunction(target)) {
  3428. target = {};
  3429. }
  3430. // extend jQuery itself if only one argument is passed
  3431. if (length === i) {
  3432. target = this;
  3433. --i;
  3434. }
  3435. for (; i < length; i++) {
  3436. // Only deal with non-null/undefined values
  3437. if ((options = arguments[i]) != null) {
  3438. // Extend the base object
  3439. for (name in options) {
  3440. src = target[name];
  3441. copy = options[name];
  3442. // Prevent never-ending loop
  3443. if (target === copy) {
  3444. continue;
  3445. }
  3446. // Recurse if we're merging plain objects or arrays
  3447. if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {
  3448. if (copyIsArray) {
  3449. copyIsArray = false;
  3450. clone = src && jQuery.isArray(src) ? src : [];
  3451. } else {
  3452. clone = src && jQuery.isPlainObject(src) ? src : {};
  3453. }
  3454. // Never move original objects, clone them
  3455. target[name] = jQuery.extend(deep, clone, copy);
  3456. // Don't bring in undefined values
  3457. } else if (copy !== undefined) {
  3458. target[name] = copy;
  3459. }
  3460. }
  3461. }
  3462. }
  3463. // Return the modified object
  3464. return target;
  3465. };
  3466. jQuery.prototype.fadeIn = function (speed, easing, callback) {
  3467. /// <summary>
  3468. /// Display the matched elements by fading them to opaque.
  3469. /// &#10;1 - fadeIn(duration, complete)
  3470. /// &#10;2 - fadeIn(options)
  3471. /// &#10;3 - fadeIn(duration, easing, complete)
  3472. /// </summary>
  3473. /// <param name="speed" type="">
  3474. /// A string or number determining how long the animation will run.
  3475. /// </param>
  3476. /// <param name="easing" type="String">
  3477. /// A string indicating which easing function to use for the transition.
  3478. /// </param>
  3479. /// <param name="callback" type="Function">
  3480. /// A function to call once the animation is complete.
  3481. /// </param>
  3482. /// <returns type="jQuery" />
  3483. return this.animate(props, speed, easing, callback);
  3484. };
  3485. jQuery.prototype.fadeOut = function (speed, easing, callback) {
  3486. /// <summary>
  3487. /// Hide the matched elements by fading them to transparent.
  3488. /// &#10;1 - fadeOut(duration, complete)
  3489. /// &#10;2 - fadeOut(options)
  3490. /// &#10;3 - fadeOut(duration, easing, complete)
  3491. /// </summary>
  3492. /// <param name="speed" type="">
  3493. /// A string or number determining how long the animation will run.
  3494. /// </param>
  3495. /// <param name="easing" type="String">
  3496. /// A string indicating which easing function to use for the transition.
  3497. /// </param>
  3498. /// <param name="callback" type="Function">
  3499. /// A function to call once the animation is complete.
  3500. /// </param>
  3501. /// <returns type="jQuery" />
  3502. return this.animate(props, speed, easing, callback);
  3503. };
  3504. jQuery.prototype.fadeTo = function (speed, to, easing, callback) {
  3505. /// <summary>
  3506. /// Adjust the opacity of the matched elements.
  3507. /// &#10;1 - fadeTo(duration, opacity, complete)
  3508. /// &#10;2 - fadeTo(duration, opacity, easing, complete)
  3509. /// </summary>
  3510. /// <param name="speed" type="Number">
  3511. /// A string or number determining how long the animation will run.
  3512. /// </param>
  3513. /// <param name="to" type="Number">
  3514. /// A number between 0 and 1 denoting the target opacity.
  3515. /// </param>
  3516. /// <param name="easing" type="String">
  3517. /// A string indicating which easing function to use for the transition.
  3518. /// </param>
  3519. /// <param name="callback" type="Function">
  3520. /// A function to call once the animation is complete.
  3521. /// </param>
  3522. /// <returns type="jQuery" />
  3523. // show any hidden elements after setting opacity to 0
  3524. return this.filter(isHidden).css("opacity", 0).show()
  3525. // animate to the value specified
  3526. .end().animate({ opacity: to }, speed, easing, callback);
  3527. };
  3528. jQuery.prototype.fadeToggle = function (speed, easing, callback) {
  3529. /// <summary>
  3530. /// Display or hide the matched elements by animating their opacity.
  3531. /// &#10;1 - fadeToggle(duration, easing, complete)
  3532. /// &#10;2 - fadeToggle(options)
  3533. /// </summary>
  3534. /// <param name="speed" type="">
  3535. /// A string or number determining how long the animation will run.
  3536. /// </param>
  3537. /// <param name="easing" type="String">
  3538. /// A string indicating which easing function to use for the transition.
  3539. /// </param>
  3540. /// <param name="callback" type="Function">
  3541. /// A function to call once the animation is complete.
  3542. /// </param>
  3543. /// <returns type="jQuery" />
  3544. return this.animate(props, speed, easing, callback);
  3545. };
  3546. jQuery.prototype.filter = function (selector) {
  3547. /// <summary>
  3548. /// Reduce the set of matched elements to those that match the selector or pass the function's test.
  3549. /// &#10;1 - filter(selector)
  3550. /// &#10;2 - filter(function(index))
  3551. /// &#10;3 - filter(element)
  3552. /// &#10;4 - filter(jQuery object)
  3553. /// </summary>
  3554. /// <param name="selector" type="String">
  3555. /// A string containing a selector expression to match the current set of elements against.
  3556. /// </param>
  3557. /// <returns type="jQuery" />
  3558. return this.pushStack(winnow(this, selector, true));
  3559. };
  3560. jQuery.prototype.find = function (selector) {
  3561. /// <summary>
  3562. /// Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
  3563. /// &#10;1 - find(selector)
  3564. /// &#10;2 - find(jQuery object)
  3565. /// &#10;3 - find(element)
  3566. /// </summary>
  3567. /// <param name="selector" type="String">
  3568. /// A string containing a selector expression to match elements against.
  3569. /// </param>
  3570. /// <returns type="jQuery" />
  3571. var i, ret, self,
  3572. len = this.length;
  3573. if (typeof selector !== "string") {
  3574. self = this;
  3575. return this.pushStack(jQuery(selector).filter(function () {
  3576. for (i = 0; i < len; i++) {
  3577. if (jQuery.contains(self[i], this)) {
  3578. return true;
  3579. }
  3580. }
  3581. }));
  3582. }
  3583. ret = [];
  3584. for (i = 0; i < len; i++) {
  3585. jQuery.find(selector, this[i], ret);
  3586. }
  3587. // Needed because $( selector, context ) becomes $( context ).find( selector )
  3588. ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret);
  3589. ret.selector = (this.selector ? this.selector + " " : "") + selector;
  3590. return ret;
  3591. };
  3592. jQuery.prototype.finish = function (type) {
  3593. /// <summary>
  3594. /// Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.
  3595. /// </summary>
  3596. /// <param name="type" type="String">
  3597. /// The name of the queue in which to stop animations.
  3598. /// </param>
  3599. /// <returns type="jQuery" />
  3600. if (type !== false) {
  3601. type = type || "fx";
  3602. }
  3603. return this.each(function () {
  3604. var index,
  3605. data = jQuery._data(this),
  3606. queue = data[type + "queue"],
  3607. hooks = data[type + "queueHooks"],
  3608. timers = jQuery.timers,
  3609. length = queue ? queue.length : 0;
  3610. // enable finishing flag on private data
  3611. data.finish = true;
  3612. // empty the queue first
  3613. jQuery.queue(this, type, []);
  3614. if (hooks && hooks.cur && hooks.cur.finish) {
  3615. hooks.cur.finish.call(this);
  3616. }
  3617. // look for any active animations, and finish them
  3618. for (index = timers.length; index--;) {
  3619. if (timers[index].elem === this && timers[index].queue === type) {
  3620. timers[index].anim.stop(true);
  3621. timers.splice(index, 1);
  3622. }
  3623. }
  3624. // look for any animations in the old queue and finish them
  3625. for (index = 0; index < length; index++) {
  3626. if (queue[index] && queue[index].finish) {
  3627. queue[index].finish.call(this);
  3628. }
  3629. }
  3630. // turn off finishing flag
  3631. delete data.finish;
  3632. });
  3633. };
  3634. jQuery.prototype.first = function () {
  3635. /// <summary>
  3636. /// Reduce the set of matched elements to the first in the set.
  3637. /// </summary>
  3638. /// <returns type="jQuery" />
  3639. return this.eq(0);
  3640. };
  3641. jQuery.prototype.focus = function (data, fn) {
  3642. /// <summary>
  3643. /// Bind an event handler to the "focus" JavaScript event, or trigger that event on an element.
  3644. /// &#10;1 - focus(handler(eventObject))
  3645. /// &#10;2 - focus(eventData, handler(eventObject))
  3646. /// &#10;3 - focus()
  3647. /// </summary>
  3648. /// <param name="data" type="Object">
  3649. /// An object containing data that will be passed to the event handler.
  3650. /// </param>
  3651. /// <param name="fn" type="Function">
  3652. /// A function to execute each time the event is triggered.
  3653. /// </param>
  3654. /// <returns type="jQuery" />
  3655. return arguments.length > 0 ?
  3656. this.on(name, null, data, fn) :
  3657. this.trigger(name);
  3658. };
  3659. jQuery.prototype.focusin = function (data, fn) {
  3660. /// <summary>
  3661. /// Bind an event handler to the "focusin" event.
  3662. /// &#10;1 - focusin(handler(eventObject))
  3663. /// &#10;2 - focusin(eventData, handler(eventObject))
  3664. /// </summary>
  3665. /// <param name="data" type="Object">
  3666. /// An object containing data that will be passed to the event handler.
  3667. /// </param>
  3668. /// <param name="fn" type="Function">
  3669. /// A function to execute each time the event is triggered.
  3670. /// </param>
  3671. /// <returns type="jQuery" />
  3672. return arguments.length > 0 ?
  3673. this.on(name, null, data, fn) :
  3674. this.trigger(name);
  3675. };
  3676. jQuery.prototype.focusout = function (data, fn) {
  3677. /// <summary>
  3678. /// Bind an event handler to the "focusout" JavaScript event.
  3679. /// &#10;1 - focusout(handler(eventObject))
  3680. /// &#10;2 - focusout(eventData, handler(eventObject))
  3681. /// </summary>
  3682. /// <param name="data" type="Object">
  3683. /// An object containing data that will be passed to the event handler.
  3684. /// </param>
  3685. /// <param name="fn" type="Function">
  3686. /// A function to execute each time the event is triggered.
  3687. /// </param>
  3688. /// <returns type="jQuery" />
  3689. return arguments.length > 0 ?
  3690. this.on(name, null, data, fn) :
  3691. this.trigger(name);
  3692. };
  3693. jQuery.prototype.get = function (num) {
  3694. /// <summary>
  3695. /// Retrieve the DOM elements matched by the jQuery object.
  3696. /// </summary>
  3697. /// <param name="num" type="Number">
  3698. /// A zero-based integer indicating which element to retrieve.
  3699. /// </param>
  3700. /// <returns type="Array" />
  3701. return num == null ?
  3702. // Return a 'clean' array
  3703. this.toArray() :
  3704. // Return just the object
  3705. (num < 0 ? this[this.length + num] : this[num]);
  3706. };
  3707. jQuery.prototype.has = function (target) {
  3708. /// <summary>
  3709. /// Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
  3710. /// &#10;1 - has(selector)
  3711. /// &#10;2 - has(contained)
  3712. /// </summary>
  3713. /// <param name="target" type="String">
  3714. /// A string containing a selector expression to match elements against.
  3715. /// </param>
  3716. /// <returns type="jQuery" />
  3717. var i,
  3718. targets = jQuery(target, this),
  3719. len = targets.length;
  3720. return this.filter(function () {
  3721. for (i = 0; i < len; i++) {
  3722. if (jQuery.contains(this, targets[i])) {
  3723. return true;
  3724. }
  3725. }
  3726. });
  3727. };
  3728. jQuery.prototype.hasClass = function (selector) {
  3729. /// <summary>
  3730. /// Determine whether any of the matched elements are assigned the given class.
  3731. /// </summary>
  3732. /// <param name="selector" type="String">
  3733. /// The class name to search for.
  3734. /// </param>
  3735. /// <returns type="Boolean" />
  3736. var className = " " + selector + " ",
  3737. i = 0,
  3738. l = this.length;
  3739. for (; i < l; i++) {
  3740. if (this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) >= 0) {
  3741. return true;
  3742. }
  3743. }
  3744. return false;
  3745. };
  3746. jQuery.prototype.height = function (margin, value) {
  3747. /// <summary>
  3748. /// 1: Get the current computed height for the first element in the set of matched elements.
  3749. /// &#10; 1.1 - height()
  3750. /// &#10;2: Set the CSS height of every matched element.
  3751. /// &#10; 2.1 - height(value)
  3752. /// &#10; 2.2 - height(function(index, height))
  3753. /// </summary>
  3754. /// <param name="margin" type="Number">
  3755. /// An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
  3756. /// </param>
  3757. /// <returns type="jQuery" />
  3758. var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
  3759. extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
  3760. return jQuery.access(this, function (elem, type, value) {
  3761. var doc;
  3762. if (jQuery.isWindow(elem)) {
  3763. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  3764. // isn't a whole lot we can do. See pull request at this URL for discussion:
  3765. // https://github.com/jquery/jquery/pull/764
  3766. return elem.document.documentElement["client" + name];
  3767. }
  3768. // Get document width or height
  3769. if (elem.nodeType === 9) {
  3770. doc = elem.documentElement;
  3771. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  3772. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  3773. return Math.max(
  3774. elem.body["scroll" + name], doc["scroll" + name],
  3775. elem.body["offset" + name], doc["offset" + name],
  3776. doc["client" + name]
  3777. );
  3778. }
  3779. return value === undefined ?
  3780. // Get width or height on the element, requesting but not forcing parseFloat
  3781. jQuery.css(elem, type, extra) :
  3782. // Set width or height on the element
  3783. jQuery.style(elem, type, value, extra);
  3784. }, type, chainable ? margin : undefined, chainable, null);
  3785. };
  3786. jQuery.prototype.hide = function (speed, easing, callback) {
  3787. /// <summary>
  3788. /// Hide the matched elements.
  3789. /// &#10;1 - hide()
  3790. /// &#10;2 - hide(duration, complete)
  3791. /// &#10;3 - hide(options)
  3792. /// &#10;4 - hide(duration, easing, complete)
  3793. /// </summary>
  3794. /// <param name="speed" type="">
  3795. /// A string or number determining how long the animation will run.
  3796. /// </param>
  3797. /// <param name="easing" type="String">
  3798. /// A string indicating which easing function to use for the transition.
  3799. /// </param>
  3800. /// <param name="callback" type="Function">
  3801. /// A function to call once the animation is complete.
  3802. /// </param>
  3803. /// <returns type="jQuery" />
  3804. return speed == null || typeof speed === "boolean" ?
  3805. cssFn.apply(this, arguments) :
  3806. this.animate(genFx(name, true), speed, easing, callback);
  3807. };
  3808. jQuery.prototype.hover = function (fnOver, fnOut) {
  3809. /// <summary>
  3810. /// 1: Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
  3811. /// &#10; 1.1 - hover(handlerIn(eventObject), handlerOut(eventObject))
  3812. /// &#10;2: Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.
  3813. /// &#10; 2.1 - hover(handlerInOut(eventObject))
  3814. /// </summary>
  3815. /// <param name="fnOver" type="Function">
  3816. /// A function to execute when the mouse pointer enters the element.
  3817. /// </param>
  3818. /// <param name="fnOut" type="Function">
  3819. /// A function to execute when the mouse pointer leaves the element.
  3820. /// </param>
  3821. /// <returns type="jQuery" />
  3822. return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
  3823. };
  3824. jQuery.prototype.html = function (value) {
  3825. /// <summary>
  3826. /// 1: Get the HTML contents of the first element in the set of matched elements.
  3827. /// &#10; 1.1 - html()
  3828. /// &#10;2: Set the HTML contents of each element in the set of matched elements.
  3829. /// &#10; 2.1 - html(htmlString)
  3830. /// &#10; 2.2 - html(function(index, oldhtml))
  3831. /// </summary>
  3832. /// <param name="value" type="String">
  3833. /// A string of HTML to set as the content of each matched element.
  3834. /// </param>
  3835. /// <returns type="jQuery" />
  3836. return jQuery.access(this, function (value) {
  3837. var elem = this[0] || {},
  3838. i = 0,
  3839. l = this.length;
  3840. if (value === undefined) {
  3841. return elem.nodeType === 1 ?
  3842. elem.innerHTML.replace(rinlinejQuery, "") :
  3843. undefined;
  3844. }
  3845. // See if we can take a shortcut and just use innerHTML
  3846. if (typeof value === "string" && !rnoInnerhtml.test(value) &&
  3847. (jQuery.support.htmlSerialize || !rnoshimcache.test(value)) &&
  3848. (jQuery.support.leadingWhitespace || !rleadingWhitespace.test(value)) &&
  3849. !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) {
  3850. value = value.replace(rxhtmlTag, "<$1></$2>");
  3851. try {
  3852. for (; i < l; i++) {
  3853. // Remove element nodes and prevent memory leaks
  3854. elem = this[i] || {};
  3855. if (elem.nodeType === 1) {
  3856. jQuery.cleanData(getAll(elem, false));
  3857. elem.innerHTML = value;
  3858. }
  3859. }
  3860. elem = 0;
  3861. // If using innerHTML throws an exception, use the fallback method
  3862. } catch (e) { }
  3863. }
  3864. if (elem) {
  3865. this.empty().append(value);
  3866. }
  3867. }, null, value, arguments.length);
  3868. };
  3869. jQuery.prototype.index = function (elem) {
  3870. /// <summary>
  3871. /// Search for a given element from among the matched elements.
  3872. /// &#10;1 - index()
  3873. /// &#10;2 - index(selector)
  3874. /// &#10;3 - index(element)
  3875. /// </summary>
  3876. /// <param name="elem" type="String">
  3877. /// A selector representing a jQuery collection in which to look for an element.
  3878. /// </param>
  3879. /// <returns type="Number" />
  3880. // No argument, return index in parent
  3881. if (!elem) {
  3882. return (this[0] && this[0].parentNode) ? this.first().prevAll().length : -1;
  3883. }
  3884. // index in selector
  3885. if (typeof elem === "string") {
  3886. return jQuery.inArray(this[0], jQuery(elem));
  3887. }
  3888. // Locate the position of the desired element
  3889. return jQuery.inArray(
  3890. // If it receives a jQuery object, the first element is used
  3891. elem.jquery ? elem[0] : elem, this);
  3892. };
  3893. jQuery.prototype.init = function (selector, context, rootjQuery) {
  3894. var match, elem;
  3895. // HANDLE: $(""), $(null), $(undefined), $(false)
  3896. if (!selector) {
  3897. return this;
  3898. }
  3899. // Handle HTML strings
  3900. if (typeof selector === "string") {
  3901. if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) {
  3902. // Assume that strings that start and end with <> are HTML and skip the regex check
  3903. match = [null, selector, null];
  3904. } else {
  3905. match = rquickExpr.exec(selector);
  3906. }
  3907. // Match html or make sure no context is specified for #id
  3908. if (match && (match[1] || !context)) {
  3909. // HANDLE: $(html) -> $(array)
  3910. if (match[1]) {
  3911. context = context instanceof jQuery ? context[0] : context;
  3912. // scripts is true for back-compat
  3913. jQuery.merge(this, jQuery.parseHTML(
  3914. match[1],
  3915. context && context.nodeType ? context.ownerDocument || context : document,
  3916. true
  3917. ));
  3918. // HANDLE: $(html, props)
  3919. if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
  3920. for (match in context) {
  3921. // Properties of context are called as methods if possible
  3922. if (jQuery.isFunction(this[match])) {
  3923. this[match](context[match]);
  3924. // ...and otherwise set as attributes
  3925. } else {
  3926. this.attr(match, context[match]);
  3927. }
  3928. }
  3929. }
  3930. return this;
  3931. // HANDLE: $(#id)
  3932. } else {
  3933. elem = document.getElementById(match[2]);
  3934. // Check parentNode to catch when Blackberry 4.6 returns
  3935. // nodes that are no longer in the document #6963
  3936. if (elem && elem.parentNode) {
  3937. // Handle the case where IE and Opera return items
  3938. // by name instead of ID
  3939. if (elem.id !== match[2]) {
  3940. return rootjQuery.find(selector);
  3941. }
  3942. // Otherwise, we inject the element directly into the jQuery object
  3943. this.length = 1;
  3944. this[0] = elem;
  3945. }
  3946. this.context = document;
  3947. this.selector = selector;
  3948. return this;
  3949. }
  3950. // HANDLE: $(expr, $(...))
  3951. } else if (!context || context.jquery) {
  3952. return (context || rootjQuery).find(selector);
  3953. // HANDLE: $(expr, context)
  3954. // (which is just equivalent to: $(context).find(expr)
  3955. } else {
  3956. return this.constructor(context).find(selector);
  3957. }
  3958. // HANDLE: $(DOMElement)
  3959. } else if (selector.nodeType) {
  3960. this.context = this[0] = selector;
  3961. this.length = 1;
  3962. return this;
  3963. // HANDLE: $(function)
  3964. // Shortcut for document ready
  3965. } else if (jQuery.isFunction(selector)) {
  3966. return rootjQuery.ready(selector);
  3967. }
  3968. if (selector.selector !== undefined) {
  3969. this.selector = selector.selector;
  3970. this.context = selector.context;
  3971. }
  3972. return jQuery.makeArray(selector, this);
  3973. };
  3974. jQuery.prototype.innerHeight = function (margin, value) {
  3975. /// <summary>
  3976. /// Get the current computed height for the first element in the set of matched elements, including padding but not border.
  3977. /// </summary>
  3978. /// <returns type="Number" />
  3979. var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
  3980. extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
  3981. return jQuery.access(this, function (elem, type, value) {
  3982. var doc;
  3983. if (jQuery.isWindow(elem)) {
  3984. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  3985. // isn't a whole lot we can do. See pull request at this URL for discussion:
  3986. // https://github.com/jquery/jquery/pull/764
  3987. return elem.document.documentElement["client" + name];
  3988. }
  3989. // Get document width or height
  3990. if (elem.nodeType === 9) {
  3991. doc = elem.documentElement;
  3992. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  3993. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  3994. return Math.max(
  3995. elem.body["scroll" + name], doc["scroll" + name],
  3996. elem.body["offset" + name], doc["offset" + name],
  3997. doc["client" + name]
  3998. );
  3999. }
  4000. return value === undefined ?
  4001. // Get width or height on the element, requesting but not forcing parseFloat
  4002. jQuery.css(elem, type, extra) :
  4003. // Set width or height on the element
  4004. jQuery.style(elem, type, value, extra);
  4005. }, type, chainable ? margin : undefined, chainable, null);
  4006. };
  4007. jQuery.prototype.innerWidth = function (margin, value) {
  4008. /// <summary>
  4009. /// Get the current computed width for the first element in the set of matched elements, including padding but not border.
  4010. /// </summary>
  4011. /// <returns type="Number" />
  4012. var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
  4013. extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
  4014. return jQuery.access(this, function (elem, type, value) {
  4015. var doc;
  4016. if (jQuery.isWindow(elem)) {
  4017. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  4018. // isn't a whole lot we can do. See pull request at this URL for discussion:
  4019. // https://github.com/jquery/jquery/pull/764
  4020. return elem.document.documentElement["client" + name];
  4021. }
  4022. // Get document width or height
  4023. if (elem.nodeType === 9) {
  4024. doc = elem.documentElement;
  4025. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  4026. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  4027. return Math.max(
  4028. elem.body["scroll" + name], doc["scroll" + name],
  4029. elem.body["offset" + name], doc["offset" + name],
  4030. doc["client" + name]
  4031. );
  4032. }
  4033. return value === undefined ?
  4034. // Get width or height on the element, requesting but not forcing parseFloat
  4035. jQuery.css(elem, type, extra) :
  4036. // Set width or height on the element
  4037. jQuery.style(elem, type, value, extra);
  4038. }, type, chainable ? margin : undefined, chainable, null);
  4039. };
  4040. jQuery.prototype.insertAfter = function (selector) {
  4041. /// <summary>
  4042. /// Insert every element in the set of matched elements after the target.
  4043. /// </summary>
  4044. /// <param name="selector" type="jQuery">
  4045. /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter.
  4046. /// </param>
  4047. /// <returns type="jQuery" />
  4048. var elems,
  4049. i = 0,
  4050. ret = [],
  4051. insert = jQuery(selector),
  4052. last = insert.length - 1;
  4053. for (; i <= last; i++) {
  4054. elems = i === last ? this : this.clone(true);
  4055. jQuery(insert[i])[original](elems);
  4056. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  4057. core_push.apply(ret, elems.get());
  4058. }
  4059. return this.pushStack(ret);
  4060. };
  4061. jQuery.prototype.insertBefore = function (selector) {
  4062. /// <summary>
  4063. /// Insert every element in the set of matched elements before the target.
  4064. /// </summary>
  4065. /// <param name="selector" type="jQuery">
  4066. /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter.
  4067. /// </param>
  4068. /// <returns type="jQuery" />
  4069. var elems,
  4070. i = 0,
  4071. ret = [],
  4072. insert = jQuery(selector),
  4073. last = insert.length - 1;
  4074. for (; i <= last; i++) {
  4075. elems = i === last ? this : this.clone(true);
  4076. jQuery(insert[i])[original](elems);
  4077. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  4078. core_push.apply(ret, elems.get());
  4079. }
  4080. return this.pushStack(ret);
  4081. };
  4082. jQuery.prototype.is = function (selector) {
  4083. /// <summary>
  4084. /// Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
  4085. /// &#10;1 - is(selector)
  4086. /// &#10;2 - is(function(index))
  4087. /// &#10;3 - is(jQuery object)
  4088. /// &#10;4 - is(element)
  4089. /// </summary>
  4090. /// <param name="selector" type="String">
  4091. /// A string containing a selector expression to match elements against.
  4092. /// </param>
  4093. /// <returns type="Boolean" />
  4094. return !!selector && (
  4095. typeof selector === "string" ?
  4096. // If this is a positional/relative selector, check membership in the returned set
  4097. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  4098. rneedsContext.test(selector) ?
  4099. jQuery(selector, this.context).index(this[0]) >= 0 :
  4100. jQuery.filter(selector, this).length > 0 :
  4101. this.filter(selector).length > 0);
  4102. };
  4103. jQuery.prototype.keydown = function (data, fn) {
  4104. /// <summary>
  4105. /// Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element.
  4106. /// &#10;1 - keydown(handler(eventObject))
  4107. /// &#10;2 - keydown(eventData, handler(eventObject))
  4108. /// &#10;3 - keydown()
  4109. /// </summary>
  4110. /// <param name="data" type="PlainObject">
  4111. /// An object containing data that will be passed to the event handler.
  4112. /// </param>
  4113. /// <param name="fn" type="Function">
  4114. /// A function to execute each time the event is triggered.
  4115. /// </param>
  4116. /// <returns type="jQuery" />
  4117. return arguments.length > 0 ?
  4118. this.on(name, null, data, fn) :
  4119. this.trigger(name);
  4120. };
  4121. jQuery.prototype.keypress = function (data, fn) {
  4122. /// <summary>
  4123. /// Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element.
  4124. /// &#10;1 - keypress(handler(eventObject))
  4125. /// &#10;2 - keypress(eventData, handler(eventObject))
  4126. /// &#10;3 - keypress()
  4127. /// </summary>
  4128. /// <param name="data" type="PlainObject">
  4129. /// An object containing data that will be passed to the event handler.
  4130. /// </param>
  4131. /// <param name="fn" type="Function">
  4132. /// A function to execute each time the event is triggered.
  4133. /// </param>
  4134. /// <returns type="jQuery" />
  4135. return arguments.length > 0 ?
  4136. this.on(name, null, data, fn) :
  4137. this.trigger(name);
  4138. };
  4139. jQuery.prototype.keyup = function (data, fn) {
  4140. /// <summary>
  4141. /// Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element.
  4142. /// &#10;1 - keyup(handler(eventObject))
  4143. /// &#10;2 - keyup(eventData, handler(eventObject))
  4144. /// &#10;3 - keyup()
  4145. /// </summary>
  4146. /// <param name="data" type="PlainObject">
  4147. /// An object containing data that will be passed to the event handler.
  4148. /// </param>
  4149. /// <param name="fn" type="Function">
  4150. /// A function to execute each time the event is triggered.
  4151. /// </param>
  4152. /// <returns type="jQuery" />
  4153. return arguments.length > 0 ?
  4154. this.on(name, null, data, fn) :
  4155. this.trigger(name);
  4156. };
  4157. jQuery.prototype.last = function () {
  4158. /// <summary>
  4159. /// Reduce the set of matched elements to the final one in the set.
  4160. /// </summary>
  4161. /// <returns type="jQuery" />
  4162. return this.eq(-1);
  4163. };
  4164. jQuery.prototype.length = 0;
  4165. jQuery.prototype.load = function (url, params, callback) {
  4166. /// <summary>
  4167. /// 1: Bind an event handler to the "load" JavaScript event.
  4168. /// &#10; 1.1 - load(handler(eventObject))
  4169. /// &#10; 1.2 - load(eventData, handler(eventObject))
  4170. /// &#10;2: Load data from the server and place the returned HTML into the matched element.
  4171. /// &#10; 2.1 - load(url, data, complete(responseText, textStatus, XMLHttpRequest))
  4172. /// </summary>
  4173. /// <param name="url" type="String">
  4174. /// A string containing the URL to which the request is sent.
  4175. /// </param>
  4176. /// <param name="params" type="String">
  4177. /// A plain object or string that is sent to the server with the request.
  4178. /// </param>
  4179. /// <param name="callback" type="Function">
  4180. /// A callback function that is executed when the request completes.
  4181. /// </param>
  4182. /// <returns type="jQuery" />
  4183. if (typeof url !== "string" && _load) {
  4184. return _load.apply(this, arguments);
  4185. }
  4186. var selector, response, type,
  4187. self = this,
  4188. off = url.indexOf(" ");
  4189. if (off >= 0) {
  4190. selector = url.slice(off, url.length);
  4191. url = url.slice(0, off);
  4192. }
  4193. // If it's a function
  4194. if (jQuery.isFunction(params)) {
  4195. // We assume that it's the callback
  4196. callback = params;
  4197. params = undefined;
  4198. // Otherwise, build a param string
  4199. } else if (params && typeof params === "object") {
  4200. type = "POST";
  4201. }
  4202. // If we have elements to modify, make the request
  4203. if (self.length > 0) {
  4204. jQuery.ajax({
  4205. url: url,
  4206. // if "type" variable is undefined, then "GET" method will be used
  4207. type: type,
  4208. dataType: "html",
  4209. data: params
  4210. }).done(function (responseText) {
  4211. // Save response for use in complete callback
  4212. response = arguments;
  4213. self.html(selector ?
  4214. // If a selector was specified, locate the right elements in a dummy div
  4215. // Exclude scripts to avoid IE 'Permission Denied' errors
  4216. jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) :
  4217. // Otherwise use the full result
  4218. responseText);
  4219. }).complete(callback && function (jqXHR, status) {
  4220. self.each(callback, response || [jqXHR.responseText, status, jqXHR]);
  4221. });
  4222. }
  4223. return this;
  4224. };
  4225. jQuery.prototype.map = function (callback) {
  4226. /// <summary>
  4227. /// Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.
  4228. /// </summary>
  4229. /// <param name="callback" type="Function">
  4230. /// A function object that will be invoked for each element in the current set.
  4231. /// </param>
  4232. /// <returns type="jQuery" />
  4233. return this.pushStack(jQuery.map(this, function (elem, i) {
  4234. return callback.call(elem, i, elem);
  4235. }));
  4236. };
  4237. jQuery.prototype.mousedown = function (data, fn) {
  4238. /// <summary>
  4239. /// Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element.
  4240. /// &#10;1 - mousedown(handler(eventObject))
  4241. /// &#10;2 - mousedown(eventData, handler(eventObject))
  4242. /// &#10;3 - mousedown()
  4243. /// </summary>
  4244. /// <param name="data" type="PlainObject">
  4245. /// An object containing data that will be passed to the event handler.
  4246. /// </param>
  4247. /// <param name="fn" type="Function">
  4248. /// A function to execute each time the event is triggered.
  4249. /// </param>
  4250. /// <returns type="jQuery" />
  4251. return arguments.length > 0 ?
  4252. this.on(name, null, data, fn) :
  4253. this.trigger(name);
  4254. };
  4255. jQuery.prototype.mouseenter = function (data, fn) {
  4256. /// <summary>
  4257. /// Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element.
  4258. /// &#10;1 - mouseenter(handler(eventObject))
  4259. /// &#10;2 - mouseenter(eventData, handler(eventObject))
  4260. /// &#10;3 - mouseenter()
  4261. /// </summary>
  4262. /// <param name="data" type="PlainObject">
  4263. /// An object containing data that will be passed to the event handler.
  4264. /// </param>
  4265. /// <param name="fn" type="Function">
  4266. /// A function to execute each time the event is triggered.
  4267. /// </param>
  4268. /// <returns type="jQuery" />
  4269. return arguments.length > 0 ?
  4270. this.on(name, null, data, fn) :
  4271. this.trigger(name);
  4272. };
  4273. jQuery.prototype.mouseleave = function (data, fn) {
  4274. /// <summary>
  4275. /// Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element.
  4276. /// &#10;1 - mouseleave(handler(eventObject))
  4277. /// &#10;2 - mouseleave(eventData, handler(eventObject))
  4278. /// &#10;3 - mouseleave()
  4279. /// </summary>
  4280. /// <param name="data" type="PlainObject">
  4281. /// An object containing data that will be passed to the event handler.
  4282. /// </param>
  4283. /// <param name="fn" type="Function">
  4284. /// A function to execute each time the event is triggered.
  4285. /// </param>
  4286. /// <returns type="jQuery" />
  4287. return arguments.length > 0 ?
  4288. this.on(name, null, data, fn) :
  4289. this.trigger(name);
  4290. };
  4291. jQuery.prototype.mousemove = function (data, fn) {
  4292. /// <summary>
  4293. /// Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element.
  4294. /// &#10;1 - mousemove(handler(eventObject))
  4295. /// &#10;2 - mousemove(eventData, handler(eventObject))
  4296. /// &#10;3 - mousemove()
  4297. /// </summary>
  4298. /// <param name="data" type="PlainObject">
  4299. /// An object containing data that will be passed to the event handler.
  4300. /// </param>
  4301. /// <param name="fn" type="Function">
  4302. /// A function to execute each time the event is triggered.
  4303. /// </param>
  4304. /// <returns type="jQuery" />
  4305. return arguments.length > 0 ?
  4306. this.on(name, null, data, fn) :
  4307. this.trigger(name);
  4308. };
  4309. jQuery.prototype.mouseout = function (data, fn) {
  4310. /// <summary>
  4311. /// Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element.
  4312. /// &#10;1 - mouseout(handler(eventObject))
  4313. /// &#10;2 - mouseout(eventData, handler(eventObject))
  4314. /// &#10;3 - mouseout()
  4315. /// </summary>
  4316. /// <param name="data" type="PlainObject">
  4317. /// An object containing data that will be passed to the event handler.
  4318. /// </param>
  4319. /// <param name="fn" type="Function">
  4320. /// A function to execute each time the event is triggered.
  4321. /// </param>
  4322. /// <returns type="jQuery" />
  4323. return arguments.length > 0 ?
  4324. this.on(name, null, data, fn) :
  4325. this.trigger(name);
  4326. };
  4327. jQuery.prototype.mouseover = function (data, fn) {
  4328. /// <summary>
  4329. /// Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element.
  4330. /// &#10;1 - mouseover(handler(eventObject))
  4331. /// &#10;2 - mouseover(eventData, handler(eventObject))
  4332. /// &#10;3 - mouseover()
  4333. /// </summary>
  4334. /// <param name="data" type="PlainObject">
  4335. /// An object containing data that will be passed to the event handler.
  4336. /// </param>
  4337. /// <param name="fn" type="Function">
  4338. /// A function to execute each time the event is triggered.
  4339. /// </param>
  4340. /// <returns type="jQuery" />
  4341. return arguments.length > 0 ?
  4342. this.on(name, null, data, fn) :
  4343. this.trigger(name);
  4344. };
  4345. jQuery.prototype.mouseup = function (data, fn) {
  4346. /// <summary>
  4347. /// Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element.
  4348. /// &#10;1 - mouseup(handler(eventObject))
  4349. /// &#10;2 - mouseup(eventData, handler(eventObject))
  4350. /// &#10;3 - mouseup()
  4351. /// </summary>
  4352. /// <param name="data" type="PlainObject">
  4353. /// An object containing data that will be passed to the event handler.
  4354. /// </param>
  4355. /// <param name="fn" type="Function">
  4356. /// A function to execute each time the event is triggered.
  4357. /// </param>
  4358. /// <returns type="jQuery" />
  4359. return arguments.length > 0 ?
  4360. this.on(name, null, data, fn) :
  4361. this.trigger(name);
  4362. };
  4363. jQuery.prototype.next = function (until, selector) {
  4364. /// <summary>
  4365. /// Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
  4366. /// </summary>
  4367. /// <param name="until" type="String">
  4368. /// A string containing a selector expression to match elements against.
  4369. /// </param>
  4370. /// <returns type="jQuery" />
  4371. var ret = jQuery.map(this, fn, until);
  4372. if (!runtil.test(name)) {
  4373. selector = until;
  4374. }
  4375. if (selector && typeof selector === "string") {
  4376. ret = jQuery.filter(selector, ret);
  4377. }
  4378. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  4379. if (this.length > 1 && rparentsprev.test(name)) {
  4380. ret = ret.reverse();
  4381. }
  4382. return this.pushStack(ret);
  4383. };
  4384. jQuery.prototype.nextAll = function (until, selector) {
  4385. /// <summary>
  4386. /// Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
  4387. /// </summary>
  4388. /// <param name="until" type="String">
  4389. /// A string containing a selector expression to match elements against.
  4390. /// </param>
  4391. /// <returns type="jQuery" />
  4392. var ret = jQuery.map(this, fn, until);
  4393. if (!runtil.test(name)) {
  4394. selector = until;
  4395. }
  4396. if (selector && typeof selector === "string") {
  4397. ret = jQuery.filter(selector, ret);
  4398. }
  4399. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  4400. if (this.length > 1 && rparentsprev.test(name)) {
  4401. ret = ret.reverse();
  4402. }
  4403. return this.pushStack(ret);
  4404. };
  4405. jQuery.prototype.nextUntil = function (until, selector) {
  4406. /// <summary>
  4407. /// Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
  4408. /// &#10;1 - nextUntil(selector, filter)
  4409. /// &#10;2 - nextUntil(element, filter)
  4410. /// </summary>
  4411. /// <param name="until" type="String">
  4412. /// A string containing a selector expression to indicate where to stop matching following sibling elements.
  4413. /// </param>
  4414. /// <param name="selector" type="String">
  4415. /// A string containing a selector expression to match elements against.
  4416. /// </param>
  4417. /// <returns type="jQuery" />
  4418. var ret = jQuery.map(this, fn, until);
  4419. if (!runtil.test(name)) {
  4420. selector = until;
  4421. }
  4422. if (selector && typeof selector === "string") {
  4423. ret = jQuery.filter(selector, ret);
  4424. }
  4425. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  4426. if (this.length > 1 && rparentsprev.test(name)) {
  4427. ret = ret.reverse();
  4428. }
  4429. return this.pushStack(ret);
  4430. };
  4431. jQuery.prototype.not = function (selector) {
  4432. /// <summary>
  4433. /// Remove elements from the set of matched elements.
  4434. /// &#10;1 - not(selector)
  4435. /// &#10;2 - not(elements)
  4436. /// &#10;3 - not(function(index))
  4437. /// &#10;4 - not(jQuery object)
  4438. /// </summary>
  4439. /// <param name="selector" type="String">
  4440. /// A string containing a selector expression to match elements against.
  4441. /// </param>
  4442. /// <returns type="jQuery" />
  4443. return this.pushStack(winnow(this, selector, false));
  4444. };
  4445. jQuery.prototype.off = function (types, selector, fn) {
  4446. /// <summary>
  4447. /// Remove an event handler.
  4448. /// &#10;1 - off(events, selector, handler(eventObject))
  4449. /// &#10;2 - off(events, selector)
  4450. /// </summary>
  4451. /// <param name="types" type="String">
  4452. /// One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
  4453. /// </param>
  4454. /// <param name="selector" type="String">
  4455. /// A selector which should match the one originally passed to .on() when attaching event handlers.
  4456. /// </param>
  4457. /// <param name="fn" type="Function">
  4458. /// A handler function previously attached for the event(s), or the special value false.
  4459. /// </param>
  4460. /// <returns type="jQuery" />
  4461. var handleObj, type;
  4462. if (types && types.preventDefault && types.handleObj) {
  4463. // ( event ) dispatched jQuery.Event
  4464. handleObj = types.handleObj;
  4465. jQuery(types.delegateTarget).off(
  4466. handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
  4467. handleObj.selector,
  4468. handleObj.handler
  4469. );
  4470. return this;
  4471. }
  4472. if (typeof types === "object") {
  4473. // ( types-object [, selector] )
  4474. for (type in types) {
  4475. this.off(type, selector, types[type]);
  4476. }
  4477. return this;
  4478. }
  4479. if (selector === false || typeof selector === "function") {
  4480. // ( types [, fn] )
  4481. fn = selector;
  4482. selector = undefined;
  4483. }
  4484. if (fn === false) {
  4485. fn = returnFalse;
  4486. }
  4487. return this.each(function () {
  4488. jQuery.event.remove(this, types, fn, selector);
  4489. });
  4490. };
  4491. jQuery.prototype.offset = function (options) {
  4492. /// <summary>
  4493. /// 1: Get the current coordinates of the first element in the set of matched elements, relative to the document.
  4494. /// &#10; 1.1 - offset()
  4495. /// &#10;2: Set the current coordinates of every element in the set of matched elements, relative to the document.
  4496. /// &#10; 2.1 - offset(coordinates)
  4497. /// &#10; 2.2 - offset(function(index, coords))
  4498. /// </summary>
  4499. /// <param name="options" type="PlainObject">
  4500. /// An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
  4501. /// </param>
  4502. /// <returns type="jQuery" />
  4503. if (arguments.length) {
  4504. return options === undefined ?
  4505. this :
  4506. this.each(function (i) {
  4507. jQuery.offset.setOffset(this, options, i);
  4508. });
  4509. }
  4510. var docElem, win,
  4511. box = { top: 0, left: 0 },
  4512. elem = this[0],
  4513. doc = elem && elem.ownerDocument;
  4514. if (!doc) {
  4515. return;
  4516. }
  4517. docElem = doc.documentElement;
  4518. // Make sure it's not a disconnected DOM node
  4519. if (!jQuery.contains(docElem, elem)) {
  4520. return box;
  4521. }
  4522. // If we don't have gBCR, just use 0,0 rather than error
  4523. // BlackBerry 5, iOS 3 (original iPhone)
  4524. if (typeof elem.getBoundingClientRect !== core_strundefined) {
  4525. box = elem.getBoundingClientRect();
  4526. }
  4527. win = getWindow(doc);
  4528. return {
  4529. top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),
  4530. left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)
  4531. };
  4532. };
  4533. jQuery.prototype.offsetParent = function () {
  4534. /// <summary>
  4535. /// Get the closest ancestor element that is positioned.
  4536. /// </summary>
  4537. /// <returns type="jQuery" />
  4538. return this.map(function () {
  4539. var offsetParent = this.offsetParent || document.documentElement;
  4540. while (offsetParent && (!jQuery.nodeName(offsetParent, "html") && jQuery.css(offsetParent, "position") === "static")) {
  4541. offsetParent = offsetParent.offsetParent;
  4542. }
  4543. return offsetParent || document.documentElement;
  4544. });
  4545. };
  4546. jQuery.prototype.on = function (types, selector, data, fn, /*INTERNAL*/ one) {
  4547. /// <summary>
  4548. /// Attach an event handler function for one or more events to the selected elements.
  4549. /// &#10;1 - on(events, selector, data, handler(eventObject))
  4550. /// &#10;2 - on(events, selector, data)
  4551. /// </summary>
  4552. /// <param name="types" type="String">
  4553. /// One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
  4554. /// </param>
  4555. /// <param name="selector" type="String">
  4556. /// A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
  4557. /// </param>
  4558. /// <param name="data" type="Anything">
  4559. /// Data to be passed to the handler in event.data when an event is triggered.
  4560. /// </param>
  4561. /// <param name="fn" type="Function">
  4562. /// A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
  4563. /// </param>
  4564. /// <returns type="jQuery" />
  4565. var type, origFn;
  4566. // Types can be a map of types/handlers
  4567. if (typeof types === "object") {
  4568. // ( types-Object, selector, data )
  4569. if (typeof selector !== "string") {
  4570. // ( types-Object, data )
  4571. data = data || selector;
  4572. selector = undefined;
  4573. }
  4574. for (type in types) {
  4575. this.on(type, selector, data, types[type], one);
  4576. }
  4577. return this;
  4578. }
  4579. if (data == null && fn == null) {
  4580. // ( types, fn )
  4581. fn = selector;
  4582. data = selector = undefined;
  4583. } else if (fn == null) {
  4584. if (typeof selector === "string") {
  4585. // ( types, selector, fn )
  4586. fn = data;
  4587. data = undefined;
  4588. } else {
  4589. // ( types, data, fn )
  4590. fn = data;
  4591. data = selector;
  4592. selector = undefined;
  4593. }
  4594. }
  4595. if (fn === false) {
  4596. fn = returnFalse;
  4597. } else if (!fn) {
  4598. return this;
  4599. }
  4600. if (one === 1) {
  4601. origFn = fn;
  4602. fn = function (event) {
  4603. // Can use an empty set, since event contains the info
  4604. jQuery().off(event);
  4605. return origFn.apply(this, arguments);
  4606. };
  4607. // Use same guid so caller can remove using origFn
  4608. fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
  4609. }
  4610. return this.each(function () {
  4611. jQuery.event.add(this, types, fn, data, selector);
  4612. });
  4613. };
  4614. jQuery.prototype.one = function (types, selector, data, fn) {
  4615. /// <summary>
  4616. /// Attach a handler to an event for the elements. The handler is executed at most once per element.
  4617. /// &#10;1 - one(events, data, handler(eventObject))
  4618. /// &#10;2 - one(events, selector, data, handler(eventObject))
  4619. /// &#10;3 - one(events, selector, data)
  4620. /// </summary>
  4621. /// <param name="types" type="String">
  4622. /// One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
  4623. /// </param>
  4624. /// <param name="selector" type="String">
  4625. /// A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
  4626. /// </param>
  4627. /// <param name="data" type="Anything">
  4628. /// Data to be passed to the handler in event.data when an event is triggered.
  4629. /// </param>
  4630. /// <param name="fn" type="Function">
  4631. /// A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
  4632. /// </param>
  4633. /// <returns type="jQuery" />
  4634. return this.on(types, selector, data, fn, 1);
  4635. };
  4636. jQuery.prototype.outerHeight = function (margin, value) {
  4637. /// <summary>
  4638. /// Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.
  4639. /// </summary>
  4640. /// <param name="margin" type="Boolean">
  4641. /// A Boolean indicating whether to include the element's margin in the calculation.
  4642. /// </param>
  4643. /// <returns type="Number" />
  4644. var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
  4645. extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
  4646. return jQuery.access(this, function (elem, type, value) {
  4647. var doc;
  4648. if (jQuery.isWindow(elem)) {
  4649. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  4650. // isn't a whole lot we can do. See pull request at this URL for discussion:
  4651. // https://github.com/jquery/jquery/pull/764
  4652. return elem.document.documentElement["client" + name];
  4653. }
  4654. // Get document width or height
  4655. if (elem.nodeType === 9) {
  4656. doc = elem.documentElement;
  4657. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  4658. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  4659. return Math.max(
  4660. elem.body["scroll" + name], doc["scroll" + name],
  4661. elem.body["offset" + name], doc["offset" + name],
  4662. doc["client" + name]
  4663. );
  4664. }
  4665. return value === undefined ?
  4666. // Get width or height on the element, requesting but not forcing parseFloat
  4667. jQuery.css(elem, type, extra) :
  4668. // Set width or height on the element
  4669. jQuery.style(elem, type, value, extra);
  4670. }, type, chainable ? margin : undefined, chainable, null);
  4671. };
  4672. jQuery.prototype.outerWidth = function (margin, value) {
  4673. /// <summary>
  4674. /// Get the current computed width for the first element in the set of matched elements, including padding and border.
  4675. /// </summary>
  4676. /// <param name="margin" type="Boolean">
  4677. /// A Boolean indicating whether to include the element's margin in the calculation.
  4678. /// </param>
  4679. /// <returns type="Number" />
  4680. var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
  4681. extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
  4682. return jQuery.access(this, function (elem, type, value) {
  4683. var doc;
  4684. if (jQuery.isWindow(elem)) {
  4685. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  4686. // isn't a whole lot we can do. See pull request at this URL for discussion:
  4687. // https://github.com/jquery/jquery/pull/764
  4688. return elem.document.documentElement["client" + name];
  4689. }
  4690. // Get document width or height
  4691. if (elem.nodeType === 9) {
  4692. doc = elem.documentElement;
  4693. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  4694. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  4695. return Math.max(
  4696. elem.body["scroll" + name], doc["scroll" + name],
  4697. elem.body["offset" + name], doc["offset" + name],
  4698. doc["client" + name]
  4699. );
  4700. }
  4701. return value === undefined ?
  4702. // Get width or height on the element, requesting but not forcing parseFloat
  4703. jQuery.css(elem, type, extra) :
  4704. // Set width or height on the element
  4705. jQuery.style(elem, type, value, extra);
  4706. }, type, chainable ? margin : undefined, chainable, null);
  4707. };
  4708. jQuery.prototype.parent = function (until, selector) {
  4709. /// <summary>
  4710. /// Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
  4711. /// </summary>
  4712. /// <param name="until" type="String">
  4713. /// A string containing a selector expression to match elements against.
  4714. /// </param>
  4715. /// <returns type="jQuery" />
  4716. var ret = jQuery.map(this, fn, until);
  4717. if (!runtil.test(name)) {
  4718. selector = until;
  4719. }
  4720. if (selector && typeof selector === "string") {
  4721. ret = jQuery.filter(selector, ret);
  4722. }
  4723. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  4724. if (this.length > 1 && rparentsprev.test(name)) {
  4725. ret = ret.reverse();
  4726. }
  4727. return this.pushStack(ret);
  4728. };
  4729. jQuery.prototype.parents = function (until, selector) {
  4730. /// <summary>
  4731. /// Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
  4732. /// </summary>
  4733. /// <param name="until" type="String">
  4734. /// A string containing a selector expression to match elements against.
  4735. /// </param>
  4736. /// <returns type="jQuery" />
  4737. var ret = jQuery.map(this, fn, until);
  4738. if (!runtil.test(name)) {
  4739. selector = until;
  4740. }
  4741. if (selector && typeof selector === "string") {
  4742. ret = jQuery.filter(selector, ret);
  4743. }
  4744. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  4745. if (this.length > 1 && rparentsprev.test(name)) {
  4746. ret = ret.reverse();
  4747. }
  4748. return this.pushStack(ret);
  4749. };
  4750. jQuery.prototype.parentsUntil = function (until, selector) {
  4751. /// <summary>
  4752. /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
  4753. /// &#10;1 - parentsUntil(selector, filter)
  4754. /// &#10;2 - parentsUntil(element, filter)
  4755. /// </summary>
  4756. /// <param name="until" type="String">
  4757. /// A string containing a selector expression to indicate where to stop matching ancestor elements.
  4758. /// </param>
  4759. /// <param name="selector" type="String">
  4760. /// A string containing a selector expression to match elements against.
  4761. /// </param>
  4762. /// <returns type="jQuery" />
  4763. var ret = jQuery.map(this, fn, until);
  4764. if (!runtil.test(name)) {
  4765. selector = until;
  4766. }
  4767. if (selector && typeof selector === "string") {
  4768. ret = jQuery.filter(selector, ret);
  4769. }
  4770. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  4771. if (this.length > 1 && rparentsprev.test(name)) {
  4772. ret = ret.reverse();
  4773. }
  4774. return this.pushStack(ret);
  4775. };
  4776. jQuery.prototype.position = function () {
  4777. /// <summary>
  4778. /// Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
  4779. /// </summary>
  4780. /// <returns type="Object" />
  4781. if (!this[0]) {
  4782. return;
  4783. }
  4784. var offsetParent, offset,
  4785. parentOffset = { top: 0, left: 0 },
  4786. elem = this[0];
  4787. // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
  4788. if (jQuery.css(elem, "position") === "fixed") {
  4789. // we assume that getBoundingClientRect is available when computed position is fixed
  4790. offset = elem.getBoundingClientRect();
  4791. } else {
  4792. // Get *real* offsetParent
  4793. offsetParent = this.offsetParent();
  4794. // Get correct offsets
  4795. offset = this.offset();
  4796. if (!jQuery.nodeName(offsetParent[0], "html")) {
  4797. parentOffset = offsetParent.offset();
  4798. }
  4799. // Add offsetParent borders
  4800. parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true);
  4801. parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true);
  4802. }
  4803. // Subtract parent offsets and element margins
  4804. // note: when an element has margin: auto the offsetLeft and marginLeft
  4805. // are the same in Safari causing offset.left to incorrectly be 0
  4806. return {
  4807. top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
  4808. left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
  4809. };
  4810. };
  4811. jQuery.prototype.prepend = function () {
  4812. /// <summary>
  4813. /// Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
  4814. /// &#10;1 - prepend(content, content)
  4815. /// &#10;2 - prepend(function(index, html))
  4816. /// </summary>
  4817. /// <param name="" type="jQuery">
  4818. /// DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
  4819. /// </param>
  4820. /// <param name="" type="jQuery">
  4821. /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
  4822. /// </param>
  4823. /// <returns type="jQuery" />
  4824. return this.domManip(arguments, true, function (elem) {
  4825. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  4826. this.insertBefore(elem, this.firstChild);
  4827. }
  4828. });
  4829. };
  4830. jQuery.prototype.prependTo = function (selector) {
  4831. /// <summary>
  4832. /// Insert every element in the set of matched elements to the beginning of the target.
  4833. /// </summary>
  4834. /// <param name="selector" type="jQuery">
  4835. /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.
  4836. /// </param>
  4837. /// <returns type="jQuery" />
  4838. var elems,
  4839. i = 0,
  4840. ret = [],
  4841. insert = jQuery(selector),
  4842. last = insert.length - 1;
  4843. for (; i <= last; i++) {
  4844. elems = i === last ? this : this.clone(true);
  4845. jQuery(insert[i])[original](elems);
  4846. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  4847. core_push.apply(ret, elems.get());
  4848. }
  4849. return this.pushStack(ret);
  4850. };
  4851. jQuery.prototype.prev = function (until, selector) {
  4852. /// <summary>
  4853. /// Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
  4854. /// </summary>
  4855. /// <param name="until" type="String">
  4856. /// A string containing a selector expression to match elements against.
  4857. /// </param>
  4858. /// <returns type="jQuery" />
  4859. var ret = jQuery.map(this, fn, until);
  4860. if (!runtil.test(name)) {
  4861. selector = until;
  4862. }
  4863. if (selector && typeof selector === "string") {
  4864. ret = jQuery.filter(selector, ret);
  4865. }
  4866. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  4867. if (this.length > 1 && rparentsprev.test(name)) {
  4868. ret = ret.reverse();
  4869. }
  4870. return this.pushStack(ret);
  4871. };
  4872. jQuery.prototype.prevAll = function (until, selector) {
  4873. /// <summary>
  4874. /// Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
  4875. /// </summary>
  4876. /// <param name="until" type="String">
  4877. /// A string containing a selector expression to match elements against.
  4878. /// </param>
  4879. /// <returns type="jQuery" />
  4880. var ret = jQuery.map(this, fn, until);
  4881. if (!runtil.test(name)) {
  4882. selector = until;
  4883. }
  4884. if (selector && typeof selector === "string") {
  4885. ret = jQuery.filter(selector, ret);
  4886. }
  4887. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  4888. if (this.length > 1 && rparentsprev.test(name)) {
  4889. ret = ret.reverse();
  4890. }
  4891. return this.pushStack(ret);
  4892. };
  4893. jQuery.prototype.prevUntil = function (until, selector) {
  4894. /// <summary>
  4895. /// Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
  4896. /// &#10;1 - prevUntil(selector, filter)
  4897. /// &#10;2 - prevUntil(element, filter)
  4898. /// </summary>
  4899. /// <param name="until" type="String">
  4900. /// A string containing a selector expression to indicate where to stop matching preceding sibling elements.
  4901. /// </param>
  4902. /// <param name="selector" type="String">
  4903. /// A string containing a selector expression to match elements against.
  4904. /// </param>
  4905. /// <returns type="jQuery" />
  4906. var ret = jQuery.map(this, fn, until);
  4907. if (!runtil.test(name)) {
  4908. selector = until;
  4909. }
  4910. if (selector && typeof selector === "string") {
  4911. ret = jQuery.filter(selector, ret);
  4912. }
  4913. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  4914. if (this.length > 1 && rparentsprev.test(name)) {
  4915. ret = ret.reverse();
  4916. }
  4917. return this.pushStack(ret);
  4918. };
  4919. jQuery.prototype.promise = function (type, obj) {
  4920. /// <summary>
  4921. /// Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
  4922. /// </summary>
  4923. /// <param name="type" type="String">
  4924. /// The type of queue that needs to be observed.
  4925. /// </param>
  4926. /// <param name="obj" type="PlainObject">
  4927. /// Object onto which the promise methods have to be attached
  4928. /// </param>
  4929. /// <returns type="Promise" />
  4930. var tmp,
  4931. count = 1,
  4932. defer = jQuery.Deferred(),
  4933. elements = this,
  4934. i = this.length,
  4935. resolve = function () {
  4936. if (!(--count)) {
  4937. defer.resolveWith(elements, [elements]);
  4938. }
  4939. };
  4940. if (typeof type !== "string") {
  4941. obj = type;
  4942. type = undefined;
  4943. }
  4944. type = type || "fx";
  4945. while (i--) {
  4946. tmp = jQuery._data(elements[i], type + "queueHooks");
  4947. if (tmp && tmp.empty) {
  4948. count++;
  4949. tmp.empty.add(resolve);
  4950. }
  4951. }
  4952. resolve();
  4953. return defer.promise(obj);
  4954. };
  4955. jQuery.prototype.prop = function (name, value) {
  4956. /// <summary>
  4957. /// 1: Get the value of a property for the first element in the set of matched elements.
  4958. /// &#10; 1.1 - prop(propertyName)
  4959. /// &#10;2: Set one or more properties for the set of matched elements.
  4960. /// &#10; 2.1 - prop(propertyName, value)
  4961. /// &#10; 2.2 - prop(properties)
  4962. /// &#10; 2.3 - prop(propertyName, function(index, oldPropertyValue))
  4963. /// </summary>
  4964. /// <param name="name" type="String">
  4965. /// The name of the property to set.
  4966. /// </param>
  4967. /// <param name="value" type="Boolean">
  4968. /// A value to set for the property.
  4969. /// </param>
  4970. /// <returns type="jQuery" />
  4971. return jQuery.access(this, jQuery.prop, name, value, arguments.length > 1);
  4972. };
  4973. jQuery.prototype.pushStack = function (elems) {
  4974. /// <summary>
  4975. /// Add a collection of DOM elements onto the jQuery stack.
  4976. /// &#10;1 - pushStack(elements)
  4977. /// &#10;2 - pushStack(elements, name, arguments)
  4978. /// </summary>
  4979. /// <param name="elems" type="Array">
  4980. /// An array of elements to push onto the stack and make into a new jQuery object.
  4981. /// </param>
  4982. /// <param name="" type="String">
  4983. /// The name of a jQuery method that generated the array of elements.
  4984. /// </param>
  4985. /// <param name="" type="Array">
  4986. /// The arguments that were passed in to the jQuery method (for serialization).
  4987. /// </param>
  4988. /// <returns type="jQuery" />
  4989. // Build a new jQuery matched element set
  4990. var ret = jQuery.merge(this.constructor(), elems);
  4991. // Add the old object onto the stack (as a reference)
  4992. ret.prevObject = this;
  4993. ret.context = this.context;
  4994. // Return the newly-formed element set
  4995. return ret;
  4996. };
  4997. jQuery.prototype.queue = function (type, data) {
  4998. /// <summary>
  4999. /// 1: Show the queue of functions to be executed on the matched elements.
  5000. /// &#10; 1.1 - queue(queueName)
  5001. /// &#10;2: Manipulate the queue of functions to be executed, once for each matched element.
  5002. /// &#10; 2.1 - queue(queueName, newQueue)
  5003. /// &#10; 2.2 - queue(queueName, callback( next ))
  5004. /// </summary>
  5005. /// <param name="type" type="String">
  5006. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  5007. /// </param>
  5008. /// <param name="data" type="Array">
  5009. /// An array of functions to replace the current queue contents.
  5010. /// </param>
  5011. /// <returns type="jQuery" />
  5012. var setter = 2;
  5013. if (typeof type !== "string") {
  5014. data = type;
  5015. type = "fx";
  5016. setter--;
  5017. }
  5018. if (arguments.length < setter) {
  5019. return jQuery.queue(this[0], type);
  5020. }
  5021. return data === undefined ?
  5022. this :
  5023. this.each(function () {
  5024. var queue = jQuery.queue(this, type, data);
  5025. // ensure a hooks for this queue
  5026. jQuery._queueHooks(this, type);
  5027. if (type === "fx" && queue[0] !== "inprogress") {
  5028. jQuery.dequeue(this, type);
  5029. }
  5030. });
  5031. };
  5032. jQuery.prototype.ready = function (fn) {
  5033. /// <summary>
  5034. /// Specify a function to execute when the DOM is fully loaded.
  5035. /// </summary>
  5036. /// <param name="fn" type="Function">
  5037. /// A function to execute after the DOM is ready.
  5038. /// </param>
  5039. /// <returns type="jQuery" />
  5040. // Add the callback
  5041. jQuery.ready.promise().done(fn);
  5042. return this;
  5043. };
  5044. jQuery.prototype.remove = function (selector, keepData) {
  5045. /// <summary>
  5046. /// Remove the set of matched elements from the DOM.
  5047. /// </summary>
  5048. /// <param name="selector" type="String">
  5049. /// A selector expression that filters the set of matched elements to be removed.
  5050. /// </param>
  5051. /// <returns type="jQuery" />
  5052. var elem,
  5053. i = 0;
  5054. for (; (elem = this[i]) != null; i++) {
  5055. if (!selector || jQuery.filter(selector, [elem]).length > 0) {
  5056. if (!keepData && elem.nodeType === 1) {
  5057. jQuery.cleanData(getAll(elem));
  5058. }
  5059. if (elem.parentNode) {
  5060. if (keepData && jQuery.contains(elem.ownerDocument, elem)) {
  5061. setGlobalEval(getAll(elem, "script"));
  5062. }
  5063. elem.parentNode.removeChild(elem);
  5064. }
  5065. }
  5066. }
  5067. return this;
  5068. };
  5069. jQuery.prototype.removeAttr = function (name) {
  5070. /// <summary>
  5071. /// Remove an attribute from each element in the set of matched elements.
  5072. /// </summary>
  5073. /// <param name="name" type="String">
  5074. /// An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
  5075. /// </param>
  5076. /// <returns type="jQuery" />
  5077. return this.each(function () {
  5078. jQuery.removeAttr(this, name);
  5079. });
  5080. };
  5081. jQuery.prototype.removeClass = function (value) {
  5082. /// <summary>
  5083. /// Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
  5084. /// &#10;1 - removeClass(className)
  5085. /// &#10;2 - removeClass(function(index, class))
  5086. /// </summary>
  5087. /// <param name="value" type="String">
  5088. /// One or more space-separated classes to be removed from the class attribute of each matched element.
  5089. /// </param>
  5090. /// <returns type="jQuery" />
  5091. var classes, elem, cur, clazz, j,
  5092. i = 0,
  5093. len = this.length,
  5094. proceed = arguments.length === 0 || typeof value === "string" && value;
  5095. if (jQuery.isFunction(value)) {
  5096. return this.each(function (j) {
  5097. jQuery(this).removeClass(value.call(this, j, this.className));
  5098. });
  5099. }
  5100. if (proceed) {
  5101. classes = (value || "").match(core_rnotwhite) || [];
  5102. for (; i < len; i++) {
  5103. elem = this[i];
  5104. // This expression is here for better compressibility (see addClass)
  5105. cur = elem.nodeType === 1 && (elem.className ?
  5106. (" " + elem.className + " ").replace(rclass, " ") :
  5107. ""
  5108. );
  5109. if (cur) {
  5110. j = 0;
  5111. while ((clazz = classes[j++])) {
  5112. // Remove *all* instances
  5113. while (cur.indexOf(" " + clazz + " ") >= 0) {
  5114. cur = cur.replace(" " + clazz + " ", " ");
  5115. }
  5116. }
  5117. elem.className = value ? jQuery.trim(cur) : "";
  5118. }
  5119. }
  5120. }
  5121. return this;
  5122. };
  5123. jQuery.prototype.removeData = function (key) {
  5124. /// <summary>
  5125. /// Remove a previously-stored piece of data.
  5126. /// &#10;1 - removeData(name)
  5127. /// &#10;2 - removeData(list)
  5128. /// </summary>
  5129. /// <param name="key" type="String">
  5130. /// A string naming the piece of data to delete.
  5131. /// </param>
  5132. /// <returns type="jQuery" />
  5133. return this.each(function () {
  5134. jQuery.removeData(this, key);
  5135. });
  5136. };
  5137. jQuery.prototype.removeProp = function (name) {
  5138. /// <summary>
  5139. /// Remove a property for the set of matched elements.
  5140. /// </summary>
  5141. /// <param name="name" type="String">
  5142. /// The name of the property to remove.
  5143. /// </param>
  5144. /// <returns type="jQuery" />
  5145. name = jQuery.propFix[name] || name;
  5146. return this.each(function () {
  5147. // try/catch handles cases where IE balks (such as removing a property on window)
  5148. try {
  5149. this[name] = undefined;
  5150. delete this[name];
  5151. } catch (e) { }
  5152. });
  5153. };
  5154. jQuery.prototype.replaceAll = function (selector) {
  5155. /// <summary>
  5156. /// Replace each target element with the set of matched elements.
  5157. /// </summary>
  5158. /// <param name="selector" type="String">
  5159. /// A selector expression indicating which element(s) to replace.
  5160. /// </param>
  5161. /// <returns type="jQuery" />
  5162. var elems,
  5163. i = 0,
  5164. ret = [],
  5165. insert = jQuery(selector),
  5166. last = insert.length - 1;
  5167. for (; i <= last; i++) {
  5168. elems = i === last ? this : this.clone(true);
  5169. jQuery(insert[i])[original](elems);
  5170. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  5171. core_push.apply(ret, elems.get());
  5172. }
  5173. return this.pushStack(ret);
  5174. };
  5175. jQuery.prototype.replaceWith = function (value) {
  5176. /// <summary>
  5177. /// Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
  5178. /// &#10;1 - replaceWith(newContent)
  5179. /// &#10;2 - replaceWith(function)
  5180. /// </summary>
  5181. /// <param name="value" type="jQuery">
  5182. /// The content to insert. May be an HTML string, DOM element, or jQuery object.
  5183. /// </param>
  5184. /// <returns type="jQuery" />
  5185. var isFunc = jQuery.isFunction(value);
  5186. // Make sure that the elements are removed from the DOM before they are inserted
  5187. // this can help fix replacing a parent with child elements
  5188. if (!isFunc && typeof value !== "string") {
  5189. value = jQuery(value).not(this).detach();
  5190. }
  5191. return this.domManip([value], true, function (elem) {
  5192. var next = this.nextSibling,
  5193. parent = this.parentNode;
  5194. if (parent) {
  5195. jQuery(this).remove();
  5196. parent.insertBefore(elem, next);
  5197. }
  5198. });
  5199. };
  5200. jQuery.prototype.resize = function (data, fn) {
  5201. /// <summary>
  5202. /// Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.
  5203. /// &#10;1 - resize(handler(eventObject))
  5204. /// &#10;2 - resize(eventData, handler(eventObject))
  5205. /// &#10;3 - resize()
  5206. /// </summary>
  5207. /// <param name="data" type="PlainObject">
  5208. /// An object containing data that will be passed to the event handler.
  5209. /// </param>
  5210. /// <param name="fn" type="Function">
  5211. /// A function to execute each time the event is triggered.
  5212. /// </param>
  5213. /// <returns type="jQuery" />
  5214. return arguments.length > 0 ?
  5215. this.on(name, null, data, fn) :
  5216. this.trigger(name);
  5217. };
  5218. jQuery.prototype.scroll = function (data, fn) {
  5219. /// <summary>
  5220. /// Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element.
  5221. /// &#10;1 - scroll(handler(eventObject))
  5222. /// &#10;2 - scroll(eventData, handler(eventObject))
  5223. /// &#10;3 - scroll()
  5224. /// </summary>
  5225. /// <param name="data" type="PlainObject">
  5226. /// An object containing data that will be passed to the event handler.
  5227. /// </param>
  5228. /// <param name="fn" type="Function">
  5229. /// A function to execute each time the event is triggered.
  5230. /// </param>
  5231. /// <returns type="jQuery" />
  5232. return arguments.length > 0 ?
  5233. this.on(name, null, data, fn) :
  5234. this.trigger(name);
  5235. };
  5236. jQuery.prototype.scrollLeft = function (val) {
  5237. /// <summary>
  5238. /// 1: Get the current horizontal position of the scroll bar for the first element in the set of matched elements.
  5239. /// &#10; 1.1 - scrollLeft()
  5240. /// &#10;2: Set the current horizontal position of the scroll bar for each of the set of matched elements.
  5241. /// &#10; 2.1 - scrollLeft(value)
  5242. /// </summary>
  5243. /// <param name="val" type="Number">
  5244. /// An integer indicating the new position to set the scroll bar to.
  5245. /// </param>
  5246. /// <returns type="jQuery" />
  5247. return jQuery.access(this, function (elem, method, val) {
  5248. var win = getWindow(elem);
  5249. if (val === undefined) {
  5250. return win ? (prop in win) ? win[prop] :
  5251. win.document.documentElement[method] :
  5252. elem[method];
  5253. }
  5254. if (win) {
  5255. win.scrollTo(
  5256. !top ? val : jQuery(win).scrollLeft(),
  5257. top ? val : jQuery(win).scrollTop()
  5258. );
  5259. } else {
  5260. elem[method] = val;
  5261. }
  5262. }, method, val, arguments.length, null);
  5263. };
  5264. jQuery.prototype.scrollTop = function (val) {
  5265. /// <summary>
  5266. /// 1: Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element.
  5267. /// &#10; 1.1 - scrollTop()
  5268. /// &#10;2: Set the current vertical position of the scroll bar for each of the set of matched elements.
  5269. /// &#10; 2.1 - scrollTop(value)
  5270. /// </summary>
  5271. /// <param name="val" type="Number">
  5272. /// An integer indicating the new position to set the scroll bar to.
  5273. /// </param>
  5274. /// <returns type="jQuery" />
  5275. return jQuery.access(this, function (elem, method, val) {
  5276. var win = getWindow(elem);
  5277. if (val === undefined) {
  5278. return win ? (prop in win) ? win[prop] :
  5279. win.document.documentElement[method] :
  5280. elem[method];
  5281. }
  5282. if (win) {
  5283. win.scrollTo(
  5284. !top ? val : jQuery(win).scrollLeft(),
  5285. top ? val : jQuery(win).scrollTop()
  5286. );
  5287. } else {
  5288. elem[method] = val;
  5289. }
  5290. }, method, val, arguments.length, null);
  5291. };
  5292. jQuery.prototype.select = function (data, fn) {
  5293. /// <summary>
  5294. /// Bind an event handler to the "select" JavaScript event, or trigger that event on an element.
  5295. /// &#10;1 - select(handler(eventObject))
  5296. /// &#10;2 - select(eventData, handler(eventObject))
  5297. /// &#10;3 - select()
  5298. /// </summary>
  5299. /// <param name="data" type="PlainObject">
  5300. /// An object containing data that will be passed to the event handler.
  5301. /// </param>
  5302. /// <param name="fn" type="Function">
  5303. /// A function to execute each time the event is triggered.
  5304. /// </param>
  5305. /// <returns type="jQuery" />
  5306. return arguments.length > 0 ?
  5307. this.on(name, null, data, fn) :
  5308. this.trigger(name);
  5309. };
  5310. jQuery.prototype.serialize = function () {
  5311. /// <summary>
  5312. /// Encode a set of form elements as a string for submission.
  5313. /// </summary>
  5314. /// <returns type="String" />
  5315. return jQuery.param(this.serializeArray());
  5316. };
  5317. jQuery.prototype.serializeArray = function () {
  5318. /// <summary>
  5319. /// Encode a set of form elements as an array of names and values.
  5320. /// </summary>
  5321. /// <returns type="Array" />
  5322. return this.map(function () {
  5323. // Can add propHook for "elements" to filter or add form elements
  5324. var elements = jQuery.prop(this, "elements");
  5325. return elements ? jQuery.makeArray(elements) : this;
  5326. })
  5327. .filter(function () {
  5328. var type = this.type;
  5329. // Use .is(":disabled") so that fieldset[disabled] works
  5330. return this.name && !jQuery(this).is(":disabled") &&
  5331. rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) &&
  5332. (this.checked || !manipulation_rcheckableType.test(type));
  5333. })
  5334. .map(function (i, elem) {
  5335. var val = jQuery(this).val();
  5336. return val == null ?
  5337. null :
  5338. jQuery.isArray(val) ?
  5339. jQuery.map(val, function (val) {
  5340. return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
  5341. }) :
  5342. { name: elem.name, value: val.replace(rCRLF, "\r\n") };
  5343. }).get();
  5344. };
  5345. jQuery.prototype.show = function (speed, easing, callback) {
  5346. /// <summary>
  5347. /// Display the matched elements.
  5348. /// &#10;1 - show()
  5349. /// &#10;2 - show(duration, complete)
  5350. /// &#10;3 - show(options)
  5351. /// &#10;4 - show(duration, easing, complete)
  5352. /// </summary>
  5353. /// <param name="speed" type="">
  5354. /// A string or number determining how long the animation will run.
  5355. /// </param>
  5356. /// <param name="easing" type="String">
  5357. /// A string indicating which easing function to use for the transition.
  5358. /// </param>
  5359. /// <param name="callback" type="Function">
  5360. /// A function to call once the animation is complete.
  5361. /// </param>
  5362. /// <returns type="jQuery" />
  5363. return speed == null || typeof speed === "boolean" ?
  5364. cssFn.apply(this, arguments) :
  5365. this.animate(genFx(name, true), speed, easing, callback);
  5366. };
  5367. jQuery.prototype.siblings = function (until, selector) {
  5368. /// <summary>
  5369. /// Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
  5370. /// </summary>
  5371. /// <param name="until" type="String">
  5372. /// A string containing a selector expression to match elements against.
  5373. /// </param>
  5374. /// <returns type="jQuery" />
  5375. var ret = jQuery.map(this, fn, until);
  5376. if (!runtil.test(name)) {
  5377. selector = until;
  5378. }
  5379. if (selector && typeof selector === "string") {
  5380. ret = jQuery.filter(selector, ret);
  5381. }
  5382. ret = this.length > 1 && !guaranteedUnique[name] ? jQuery.unique(ret) : ret;
  5383. if (this.length > 1 && rparentsprev.test(name)) {
  5384. ret = ret.reverse();
  5385. }
  5386. return this.pushStack(ret);
  5387. };
  5388. jQuery.prototype.size = function () {
  5389. /// <summary>
  5390. /// Return the number of elements in the jQuery object.
  5391. /// </summary>
  5392. /// <returns type="Number" />
  5393. return this.length;
  5394. };
  5395. jQuery.prototype.slice = function () {
  5396. /// <summary>
  5397. /// Reduce the set of matched elements to a subset specified by a range of indices.
  5398. /// </summary>
  5399. /// <param name="" type="Number">
  5400. /// An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set.
  5401. /// </param>
  5402. /// <param name="" type="Number">
  5403. /// An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set.
  5404. /// </param>
  5405. /// <returns type="jQuery" />
  5406. return this.pushStack(core_slice.apply(this, arguments));
  5407. };
  5408. jQuery.prototype.slideDown = function (speed, easing, callback) {
  5409. /// <summary>
  5410. /// Display the matched elements with a sliding motion.
  5411. /// &#10;1 - slideDown(duration, complete)
  5412. /// &#10;2 - slideDown(options)
  5413. /// &#10;3 - slideDown(duration, easing, complete)
  5414. /// </summary>
  5415. /// <param name="speed" type="">
  5416. /// A string or number determining how long the animation will run.
  5417. /// </param>
  5418. /// <param name="easing" type="String">
  5419. /// A string indicating which easing function to use for the transition.
  5420. /// </param>
  5421. /// <param name="callback" type="Function">
  5422. /// A function to call once the animation is complete.
  5423. /// </param>
  5424. /// <returns type="jQuery" />
  5425. return this.animate(props, speed, easing, callback);
  5426. };
  5427. jQuery.prototype.slideToggle = function (speed, easing, callback) {
  5428. /// <summary>
  5429. /// Display or hide the matched elements with a sliding motion.
  5430. /// &#10;1 - slideToggle(duration, complete)
  5431. /// &#10;2 - slideToggle(options)
  5432. /// &#10;3 - slideToggle(duration, easing, complete)
  5433. /// </summary>
  5434. /// <param name="speed" type="">
  5435. /// A string or number determining how long the animation will run.
  5436. /// </param>
  5437. /// <param name="easing" type="String">
  5438. /// A string indicating which easing function to use for the transition.
  5439. /// </param>
  5440. /// <param name="callback" type="Function">
  5441. /// A function to call once the animation is complete.
  5442. /// </param>
  5443. /// <returns type="jQuery" />
  5444. return this.animate(props, speed, easing, callback);
  5445. };
  5446. jQuery.prototype.slideUp = function (speed, easing, callback) {
  5447. /// <summary>
  5448. /// Hide the matched elements with a sliding motion.
  5449. /// &#10;1 - slideUp(duration, complete)
  5450. /// &#10;2 - slideUp(options)
  5451. /// &#10;3 - slideUp(duration, easing, complete)
  5452. /// </summary>
  5453. /// <param name="speed" type="">
  5454. /// A string or number determining how long the animation will run.
  5455. /// </param>
  5456. /// <param name="easing" type="String">
  5457. /// A string indicating which easing function to use for the transition.
  5458. /// </param>
  5459. /// <param name="callback" type="Function">
  5460. /// A function to call once the animation is complete.
  5461. /// </param>
  5462. /// <returns type="jQuery" />
  5463. return this.animate(props, speed, easing, callback);
  5464. };
  5465. jQuery.prototype.stop = function (type, clearQueue, gotoEnd) {
  5466. /// <summary>
  5467. /// Stop the currently-running animation on the matched elements.
  5468. /// &#10;1 - stop(clearQueue, jumpToEnd)
  5469. /// &#10;2 - stop(queue, clearQueue, jumpToEnd)
  5470. /// </summary>
  5471. /// <param name="type" type="String">
  5472. /// The name of the queue in which to stop animations.
  5473. /// </param>
  5474. /// <param name="clearQueue" type="Boolean">
  5475. /// A Boolean indicating whether to remove queued animation as well. Defaults to false.
  5476. /// </param>
  5477. /// <param name="gotoEnd" type="Boolean">
  5478. /// A Boolean indicating whether to complete the current animation immediately. Defaults to false.
  5479. /// </param>
  5480. /// <returns type="jQuery" />
  5481. var stopQueue = function (hooks) {
  5482. var stop = hooks.stop;
  5483. delete hooks.stop;
  5484. stop(gotoEnd);
  5485. };
  5486. if (typeof type !== "string") {
  5487. gotoEnd = clearQueue;
  5488. clearQueue = type;
  5489. type = undefined;
  5490. }
  5491. if (clearQueue && type !== false) {
  5492. this.queue(type || "fx", []);
  5493. }
  5494. return this.each(function () {
  5495. var dequeue = true,
  5496. index = type != null && type + "queueHooks",
  5497. timers = jQuery.timers,
  5498. data = jQuery._data(this);
  5499. if (index) {
  5500. if (data[index] && data[index].stop) {
  5501. stopQueue(data[index]);
  5502. }
  5503. } else {
  5504. for (index in data) {
  5505. if (data[index] && data[index].stop && rrun.test(index)) {
  5506. stopQueue(data[index]);
  5507. }
  5508. }
  5509. }
  5510. for (index = timers.length; index--;) {
  5511. if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
  5512. timers[index].anim.stop(gotoEnd);
  5513. dequeue = false;
  5514. timers.splice(index, 1);
  5515. }
  5516. }
  5517. // start the next in the queue if the last step wasn't forced
  5518. // timers currently will call their complete callbacks, which will dequeue
  5519. // but only if they were gotoEnd
  5520. if (dequeue || !gotoEnd) {
  5521. jQuery.dequeue(this, type);
  5522. }
  5523. });
  5524. };
  5525. jQuery.prototype.submit = function (data, fn) {
  5526. /// <summary>
  5527. /// Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.
  5528. /// &#10;1 - submit(handler(eventObject))
  5529. /// &#10;2 - submit(eventData, handler(eventObject))
  5530. /// &#10;3 - submit()
  5531. /// </summary>
  5532. /// <param name="data" type="PlainObject">
  5533. /// An object containing data that will be passed to the event handler.
  5534. /// </param>
  5535. /// <param name="fn" type="Function">
  5536. /// A function to execute each time the event is triggered.
  5537. /// </param>
  5538. /// <returns type="jQuery" />
  5539. return arguments.length > 0 ?
  5540. this.on(name, null, data, fn) :
  5541. this.trigger(name);
  5542. };
  5543. jQuery.prototype.text = function (value) {
  5544. /// <summary>
  5545. /// 1: Get the combined text contents of each element in the set of matched elements, including their descendants.
  5546. /// &#10; 1.1 - text()
  5547. /// &#10;2: Set the content of each element in the set of matched elements to the specified text.
  5548. /// &#10; 2.1 - text(textString)
  5549. /// &#10; 2.2 - text(function(index, text))
  5550. /// </summary>
  5551. /// <param name="value" type="String">
  5552. /// A string of text to set as the content of each matched element.
  5553. /// </param>
  5554. /// <returns type="jQuery" />
  5555. return jQuery.access(this, function (value) {
  5556. return value === undefined ?
  5557. jQuery.text(this) :
  5558. this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(value));
  5559. }, null, value, arguments.length);
  5560. };
  5561. jQuery.prototype.toArray = function () {
  5562. /// <summary>
  5563. /// Retrieve all the DOM elements contained in the jQuery set, as an array.
  5564. /// </summary>
  5565. /// <returns type="Array" />
  5566. return core_slice.call(this);
  5567. };
  5568. jQuery.prototype.toggle = function (speed, easing, callback) {
  5569. /// <summary>
  5570. /// 1: Bind two or more handlers to the matched elements, to be executed on alternate clicks.
  5571. /// &#10; 1.1 - toggle(handler(eventObject), handler(eventObject), handler(eventObject))
  5572. /// &#10;2: Display or hide the matched elements.
  5573. /// &#10; 2.1 - toggle(duration, complete)
  5574. /// &#10; 2.2 - toggle(options)
  5575. /// &#10; 2.3 - toggle(duration, easing, complete)
  5576. /// &#10; 2.4 - toggle(showOrHide)
  5577. /// </summary>
  5578. /// <param name="speed" type="Function">
  5579. /// A function to execute every even time the element is clicked.
  5580. /// </param>
  5581. /// <param name="easing" type="Function">
  5582. /// A function to execute every odd time the element is clicked.
  5583. /// </param>
  5584. /// <param name="callback" type="Function">
  5585. /// Additional handlers to cycle through after clicks.
  5586. /// </param>
  5587. /// <returns type="jQuery" />
  5588. return speed == null || typeof speed === "boolean" ?
  5589. cssFn.apply(this, arguments) :
  5590. this.animate(genFx(name, true), speed, easing, callback);
  5591. };
  5592. jQuery.prototype.toggleClass = function (value, stateVal) {
  5593. /// <summary>
  5594. /// Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
  5595. /// &#10;1 - toggleClass(className)
  5596. /// &#10;2 - toggleClass(className, switch)
  5597. /// &#10;3 - toggleClass(switch)
  5598. /// &#10;4 - toggleClass(function(index, class, switch), switch)
  5599. /// </summary>
  5600. /// <param name="value" type="String">
  5601. /// One or more class names (separated by spaces) to be toggled for each element in the matched set.
  5602. /// </param>
  5603. /// <param name="stateVal" type="Boolean">
  5604. /// A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
  5605. /// </param>
  5606. /// <returns type="jQuery" />
  5607. var type = typeof value,
  5608. isBool = typeof stateVal === "boolean";
  5609. if (jQuery.isFunction(value)) {
  5610. return this.each(function (i) {
  5611. jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal);
  5612. });
  5613. }
  5614. return this.each(function () {
  5615. if (type === "string") {
  5616. // toggle individual class names
  5617. var className,
  5618. i = 0,
  5619. self = jQuery(this),
  5620. state = stateVal,
  5621. classNames = value.match(core_rnotwhite) || [];
  5622. while ((className = classNames[i++])) {
  5623. // check each className given, space separated list
  5624. state = isBool ? state : !self.hasClass(className);
  5625. self[state ? "addClass" : "removeClass"](className);
  5626. }
  5627. // Toggle whole class name
  5628. } else if (type === core_strundefined || type === "boolean") {
  5629. if (this.className) {
  5630. // store className if set
  5631. jQuery._data(this, "__className__", this.className);
  5632. }
  5633. // If the element has a class name or if we're passed "false",
  5634. // then remove the whole classname (if there was one, the above saved it).
  5635. // Otherwise bring back whatever was previously saved (if anything),
  5636. // falling back to the empty string if nothing was stored.
  5637. this.className = this.className || value === false ? "" : jQuery._data(this, "__className__") || "";
  5638. }
  5639. });
  5640. };
  5641. jQuery.prototype.trigger = function (type, data) {
  5642. /// <summary>
  5643. /// Execute all handlers and behaviors attached to the matched elements for the given event type.
  5644. /// &#10;1 - trigger(eventType, extraParameters)
  5645. /// &#10;2 - trigger(event)
  5646. /// </summary>
  5647. /// <param name="type" type="String">
  5648. /// A string containing a JavaScript event type, such as click or submit.
  5649. /// </param>
  5650. /// <param name="data" type="PlainObject">
  5651. /// Additional parameters to pass along to the event handler.
  5652. /// </param>
  5653. /// <returns type="jQuery" />
  5654. return this.each(function () {
  5655. jQuery.event.trigger(type, data, this);
  5656. });
  5657. };
  5658. jQuery.prototype.triggerHandler = function (type, data) {
  5659. /// <summary>
  5660. /// Execute all handlers attached to an element for an event.
  5661. /// </summary>
  5662. /// <param name="type" type="String">
  5663. /// A string containing a JavaScript event type, such as click or submit.
  5664. /// </param>
  5665. /// <param name="data" type="Array">
  5666. /// An array of additional parameters to pass along to the event handler.
  5667. /// </param>
  5668. /// <returns type="Object" />
  5669. var elem = this[0];
  5670. if (elem) {
  5671. return jQuery.event.trigger(type, data, elem, true);
  5672. }
  5673. };
  5674. jQuery.prototype.unbind = function (types, fn) {
  5675. /// <summary>
  5676. /// Remove a previously-attached event handler from the elements.
  5677. /// &#10;1 - unbind(eventType, handler(eventObject))
  5678. /// &#10;2 - unbind(eventType, false)
  5679. /// &#10;3 - unbind(event)
  5680. /// </summary>
  5681. /// <param name="types" type="String">
  5682. /// A string containing a JavaScript event type, such as click or submit.
  5683. /// </param>
  5684. /// <param name="fn" type="Function">
  5685. /// The function that is to be no longer executed.
  5686. /// </param>
  5687. /// <returns type="jQuery" />
  5688. return this.off(types, null, fn);
  5689. };
  5690. jQuery.prototype.undelegate = function (selector, types, fn) {
  5691. /// <summary>
  5692. /// Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
  5693. /// &#10;1 - undelegate()
  5694. /// &#10;2 - undelegate(selector, eventType)
  5695. /// &#10;3 - undelegate(selector, eventType, handler(eventObject))
  5696. /// &#10;4 - undelegate(selector, events)
  5697. /// &#10;5 - undelegate(namespace)
  5698. /// </summary>
  5699. /// <param name="selector" type="String">
  5700. /// A selector which will be used to filter the event results.
  5701. /// </param>
  5702. /// <param name="types" type="String">
  5703. /// A string containing a JavaScript event type, such as "click" or "keydown"
  5704. /// </param>
  5705. /// <param name="fn" type="Function">
  5706. /// A function to execute at the time the event is triggered.
  5707. /// </param>
  5708. /// <returns type="jQuery" />
  5709. // ( namespace ) or ( selector, types [, fn] )
  5710. return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
  5711. };
  5712. jQuery.prototype.unload = function (data, fn) {
  5713. /// <summary>
  5714. /// Bind an event handler to the "unload" JavaScript event.
  5715. /// &#10;1 - unload(handler(eventObject))
  5716. /// &#10;2 - unload(eventData, handler(eventObject))
  5717. /// </summary>
  5718. /// <param name="data" type="Object">
  5719. /// A plain object of data that will be passed to the event handler.
  5720. /// </param>
  5721. /// <param name="fn" type="Function">
  5722. /// A function to execute each time the event is triggered.
  5723. /// </param>
  5724. /// <returns type="jQuery" />
  5725. return arguments.length > 0 ?
  5726. this.on(name, null, data, fn) :
  5727. this.trigger(name);
  5728. };
  5729. jQuery.prototype.unwrap = function () {
  5730. /// <summary>
  5731. /// Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
  5732. /// </summary>
  5733. /// <returns type="jQuery" />
  5734. return this.parent().each(function () {
  5735. if (!jQuery.nodeName(this, "body")) {
  5736. jQuery(this).replaceWith(this.childNodes);
  5737. }
  5738. }).end();
  5739. };
  5740. jQuery.prototype.val = function (value) {
  5741. /// <summary>
  5742. /// 1: Get the current value of the first element in the set of matched elements.
  5743. /// &#10; 1.1 - val()
  5744. /// &#10;2: Set the value of each element in the set of matched elements.
  5745. /// &#10; 2.1 - val(value)
  5746. /// &#10; 2.2 - val(function(index, value))
  5747. /// </summary>
  5748. /// <param name="value" type="Array">
  5749. /// A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
  5750. /// </param>
  5751. /// <returns type="jQuery" />
  5752. var ret, hooks, isFunction,
  5753. elem = this[0];
  5754. if (!arguments.length) {
  5755. if (elem) {
  5756. hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
  5757. if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
  5758. return ret;
  5759. }
  5760. ret = elem.value;
  5761. return typeof ret === "string" ?
  5762. // handle most common string cases
  5763. ret.replace(rreturn, "") :
  5764. // handle cases where value is null/undef or number
  5765. ret == null ? "" : ret;
  5766. }
  5767. return;
  5768. }
  5769. isFunction = jQuery.isFunction(value);
  5770. return this.each(function (i) {
  5771. var val,
  5772. self = jQuery(this);
  5773. if (this.nodeType !== 1) {
  5774. return;
  5775. }
  5776. if (isFunction) {
  5777. val = value.call(this, i, self.val());
  5778. } else {
  5779. val = value;
  5780. }
  5781. // Treat null/undefined as ""; convert numbers to string
  5782. if (val == null) {
  5783. val = "";
  5784. } else if (typeof val === "number") {
  5785. val += "";
  5786. } else if (jQuery.isArray(val)) {
  5787. val = jQuery.map(val, function (value) {
  5788. return value == null ? "" : value + "";
  5789. });
  5790. }
  5791. hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
  5792. // If set returns undefined, fall back to normal setting
  5793. if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) {
  5794. this.value = val;
  5795. }
  5796. });
  5797. };
  5798. jQuery.prototype.width = function (margin, value) {
  5799. /// <summary>
  5800. /// 1: Get the current computed width for the first element in the set of matched elements.
  5801. /// &#10; 1.1 - width()
  5802. /// &#10;2: Set the CSS width of each element in the set of matched elements.
  5803. /// &#10; 2.1 - width(value)
  5804. /// &#10; 2.2 - width(function(index, width))
  5805. /// </summary>
  5806. /// <param name="margin" type="Number">
  5807. /// An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
  5808. /// </param>
  5809. /// <returns type="jQuery" />
  5810. var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
  5811. extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
  5812. return jQuery.access(this, function (elem, type, value) {
  5813. var doc;
  5814. if (jQuery.isWindow(elem)) {
  5815. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  5816. // isn't a whole lot we can do. See pull request at this URL for discussion:
  5817. // https://github.com/jquery/jquery/pull/764
  5818. return elem.document.documentElement["client" + name];
  5819. }
  5820. // Get document width or height
  5821. if (elem.nodeType === 9) {
  5822. doc = elem.documentElement;
  5823. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  5824. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  5825. return Math.max(
  5826. elem.body["scroll" + name], doc["scroll" + name],
  5827. elem.body["offset" + name], doc["offset" + name],
  5828. doc["client" + name]
  5829. );
  5830. }
  5831. return value === undefined ?
  5832. // Get width or height on the element, requesting but not forcing parseFloat
  5833. jQuery.css(elem, type, extra) :
  5834. // Set width or height on the element
  5835. jQuery.style(elem, type, value, extra);
  5836. }, type, chainable ? margin : undefined, chainable, null);
  5837. };
  5838. jQuery.prototype.wrap = function (html) {
  5839. /// <summary>
  5840. /// Wrap an HTML structure around each element in the set of matched elements.
  5841. /// &#10;1 - wrap(wrappingElement)
  5842. /// &#10;2 - wrap(function(index))
  5843. /// </summary>
  5844. /// <param name="html" type="jQuery">
  5845. /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements.
  5846. /// </param>
  5847. /// <returns type="jQuery" />
  5848. var isFunction = jQuery.isFunction(html);
  5849. return this.each(function (i) {
  5850. jQuery(this).wrapAll(isFunction ? html.call(this, i) : html);
  5851. });
  5852. };
  5853. jQuery.prototype.wrapAll = function (html) {
  5854. /// <summary>
  5855. /// Wrap an HTML structure around all elements in the set of matched elements.
  5856. /// </summary>
  5857. /// <param name="html" type="jQuery">
  5858. /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements.
  5859. /// </param>
  5860. /// <returns type="jQuery" />
  5861. if (jQuery.isFunction(html)) {
  5862. return this.each(function (i) {
  5863. jQuery(this).wrapAll(html.call(this, i));
  5864. });
  5865. }
  5866. if (this[0]) {
  5867. // The elements to wrap the target around
  5868. var wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
  5869. if (this[0].parentNode) {
  5870. wrap.insertBefore(this[0]);
  5871. }
  5872. wrap.map(function () {
  5873. var elem = this;
  5874. while (elem.firstChild && elem.firstChild.nodeType === 1) {
  5875. elem = elem.firstChild;
  5876. }
  5877. return elem;
  5878. }).append(this);
  5879. }
  5880. return this;
  5881. };
  5882. jQuery.prototype.wrapInner = function (html) {
  5883. /// <summary>
  5884. /// Wrap an HTML structure around the content of each element in the set of matched elements.
  5885. /// &#10;1 - wrapInner(wrappingElement)
  5886. /// &#10;2 - wrapInner(function(index))
  5887. /// </summary>
  5888. /// <param name="html" type="String">
  5889. /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
  5890. /// </param>
  5891. /// <returns type="jQuery" />
  5892. if (jQuery.isFunction(html)) {
  5893. return this.each(function (i) {
  5894. jQuery(this).wrapInner(html.call(this, i));
  5895. });
  5896. }
  5897. return this.each(function () {
  5898. var self = jQuery(this),
  5899. contents = self.contents();
  5900. if (contents.length) {
  5901. contents.wrapAll(html);
  5902. } else {
  5903. self.append(html);
  5904. }
  5905. });
  5906. };
  5907. jQuery.fn = jQuery.prototype;
  5908. jQuery.fn.init.prototype = jQuery.fn;
  5909. window.jQuery = window.$ = jQuery;
  5910. })(window);