jquery-1.7.1-vsdoc.js 215 KB

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