1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368 |
- (function(j, m) {
- function s(e) {
- return c.isWindow(e) ? e: 9 === e.nodeType ? e.defaultView || e.parentWindow: !1
- }
- function x(e) {
- if (!Xa[e]) {
- var n = o.body,
- b = c("<" + e + ">").appendTo(n),
- a = b.css("display");
- b.remove();
- if ("none" === a || "" === a) {
- da || (da = o.createElement("iframe"), da.frameBorder = da.width = da.height = 0);
- n.appendChild(da);
- if (!na || !da.createElement) na = (da.contentWindow || da.contentDocument).document,
- na.write(("CSS1Compat" === o.compatMode ? "<!doctype html>": "") + "<html><body>"),
- na.close();
- b = na.createElement(e);
- na.body.appendChild(b);
- a = c.css(b, "display");
- n.removeChild(da)
- }
- Xa[e] = a
- }
- return Xa[e]
- }
- function y(e, n) {
- var b = {};
- c.each(mb.concat.apply([], mb.slice(0, n)),
- function() {
- b[this] = e
- });
- return b
- }
- function u() {
- Da = m
- }
- function r() {
- setTimeout(u, 0);
- return Da = c.now()
- }
- function q() {
- try {
- return new j.XMLHttpRequest
- } catch(e) {}
- }
- function N(e, n, b, a) {
- if (c.isArray(n)) c.each(n,
- function(n, d) {
- b || Sb.test(e) ? a(e, d) : N(e + "[" + ("object" == typeof d || c.isArray(d) ? n: "") + "]", d, b, a)
- });
- else if (!b && null != n && "object" == typeof n) for (var d in n) N(e + "[" + d + "]", n[d], b, a);
- else a(e, n)
- }
- function L(e, n) {
- var b, a, d = c.ajaxSettings.flatOptions || {};
- for (b in n) n[b] !== m && ((d[b] ? e: a || (a = {}))[b] = n[b]);
- a && c.extend(!0, e, a)
- }
- function J(e, n, c, b, a, d) {
- a = a || n.dataTypes[0];
- d = d || {};
- d[a] = !0;
- for (var a = e[a], h = 0, g = a ? a.length: 0, l = e === Ya, f; h < g && (l || !f); h++) f = a[h](n, c, b),
- "string" == typeof f && (!l || d[f] ? f = m: (n.dataTypes.unshift(f), f = J(e, n, c, b, f, d))); (l || !f) && !d["*"] && (f = J(e, n, c, b, "*", d));
- return f
- }
- function K(e) {
- return function(n, b) {
- "string" != typeof n && (b = n, n = "*");
- if (c.isFunction(b)) for (var a = n.toLowerCase().split(nb), d = 0, h = a.length, g, l; d < h; d++) g = a[d],
- (l = /^\+/.test(g)) && (g = g.substr(1) || "*"),
- g = e[g] = e[g] || [],
- g[l ? "unshift": "push"](b)
- }
- }
- function Q(e, n, b) {
- var a = "width" === n ? e.offsetWidth: e.offsetHeight,
- d = "width" === n ? Tb: Ub;
- if (0 < a) return "border" !== b && c.each(d,
- function() {
- b || (a -= parseFloat(c.css(e, "padding" + this)) || 0);
- "margin" === b ? a += parseFloat(c.css(e, b + this)) || 0 : a -= parseFloat(c.css(e, "border" + this + "Width")) || 0
- }),
- a + "px";
- a = oa(e, n, n);
- if (0 > a || null == a) a = e.style[n] || 0;
- a = parseFloat(a) || 0;
- b && c.each(d,
- function() {
- a += parseFloat(c.css(e, "padding" + this)) || 0;
- "padding" !== b && (a += parseFloat(c.css(e, "border" + this + "Width")) || 0);
- "margin" === b && (a += parseFloat(c.css(e, b + this)) || 0)
- });
- return a + "px"
- }
- function Y(e, n) {
- n.src ? c.ajax({
- url: n.src,
- async: !1,
- dataType: "script"
- }) : c.globalEval((n.text || n.textContent || n.innerHTML || "").replace(Vb, "/*$0*/"));
- n.parentNode && n.parentNode.removeChild(n)
- }
- function ea(e) {
- var n = (e.nodeName || "").toLowerCase();
- "input" === n ? S(e) : "script" !== n && "undefined" != typeof e.getElementsByTagName && c.grep(e.getElementsByTagName("input"), S)
- }
- function S(e) {
- if ("checkbox" === e.type || "radio" === e.type) e.defaultChecked = e.checked
- }
- function C(e) {
- return "undefined" != typeof e.getElementsByTagName ? e.getElementsByTagName("*") : "undefined" != typeof e.querySelectorAll ? e.querySelectorAll("*") : []
- }
- function V(e, n) {
- var a;
- if (1 === n.nodeType) {
- n.clearAttributes && n.clearAttributes();
- n.mergeAttributes && n.mergeAttributes(e);
- a = n.nodeName.toLowerCase();
- if ("object" === a) n.outerHTML = e.outerHTML;
- else if ("input" !== a || "checkbox" !== e.type && "radio" !== e.type) if ("option" === a) n.selected = e.defaultSelected;
- else {
- if ("input" === a || "textarea" === a) n.defaultValue = e.defaultValue
- } else e.checked && (n.defaultChecked = n.checked = e.checked),
- n.value !== e.value && (n.value = e.value);
- n.removeAttribute(c.expando)
- }
- }
- function D(e, n) {
- if (1 === n.nodeType && c.hasData(e)) {
- var a, b, d;
- b = c._data(e);
- var h = c._data(n, b),
- g = b.events;
- if (g) for (a in delete h.handle, h.events = {},
- g) {
- b = 0;
- for (d = g[a].length; b < d; b++) c.event.add(n, a + (g[a][b].namespace ? ".": "") + g[a][b].namespace, g[a][b], g[a][b].data)
- }
- h.data && (h.data = c.extend({},
- h.data))
- }
- }
- function w(e) {
- var n = ob.split(" "),
- e = e.createDocumentFragment();
- if (e.createElement) for (; n.length;) e.createElement(n.pop());
- return e
- }
- function aa(e, n, a) {
- n = n || 0;
- if (c.isFunction(n)) return c.grep(e,
- function(e, b) {
- return !! n.call(e, b, e) === a
- });
- if (n.nodeType) return c.grep(e,
- function(e) {
- return e === n === a
- });
- if ("string" == typeof n) {
- var b = c.grep(e,
- function(e) {
- return 1 === e.nodeType
- });
- if (Wb.test(n)) return c.filter(n, b, !a);
- n = c.filter(n, b)
- }
- return c.grep(e,
- function(e) {
- return 0 <= c.inArray(e, n) === a
- })
- }
- function k() {
- return ! 0
- }
- function B() {
- return ! 1
- }
- function U(e, n, a) {
- var b = n + "defer",
- d = n + "queue",
- h = n + "mark",
- g = c._data(e, b);
- g && ("queue" === a || !c._data(e, d)) && ("mark" === a || !c._data(e, h)) && setTimeout(function() { ! c._data(e, d) && !c._data(e, h) && (c.removeData(e, b, !0), g.fire())
- },
- 0)
- }
- function R(e) {
- for (var n in e) if (! ("data" === n && c.isEmptyObject(e[n])) && "toJSON" !== n) return ! 1;
- return ! 0
- }
- function M(e, n, a) {
- if (a === m && 1 === e.nodeType) if (a = "data-" + n.replace(Xb, "-$1").toLowerCase(), a = e.getAttribute(a), "string" == typeof a) {
- try {
- a = "true" === a ? !0 : "false" === a ? !1 : "null" === a ? null: c.isNumeric(a) ? parseFloat(a) : Yb.test(a) ? c.parseJSON(a) : a
- } catch(b) {}
- c.data(e, n, a)
- } else a = m;
- return a
- }
- var o = j.document,
- F = j.location,
- c, i = function() {
- if (!f.isReady) {
- try {
- o.documentElement.doScroll("left")
- } catch(e) {
- setTimeout(i, 1);
- return
- }
- f.ready()
- }
- },
- f = function(e, n) {
- return new f.fn.init(e, n, b)
- },
- p = j.jQuery,
- v = j.$,
- b,
- d = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
- a = /\S/,
- h = /^\s+/,
- g = /\s+$/,
- l = /\d/,
- t = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
- z = /^[\],:{}\s]*$/,
- ya = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
- ja = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
- I = /(?:^|:|,)(?:\s*\[)+/g,
- Zb = /(webkit)[ \/]([\w.]+)/,
- $b = /(opera)(?:.*version)?[ \/]([\w.]+)/,
- ac = /(msie) ([\w.]+)/,
- bc = /(mozilla)(?:.*? rv:([\w.]+))?/,
- cc = /-([a-z]|[0-9])/ig,
- E = /^-ms-/,
- dc = function(e, n) {
- return (n + "").toUpperCase()
- },
- ec = j.navigator.userAgent,
- Ea,
- Fa,
- O,
- fc = Object.prototype.toString,
- Za = Object.prototype.hasOwnProperty,
- P = Array.prototype.push,
- fa = Array.prototype.slice,
- ha = String.prototype.trim,
- pa = Array.prototype.indexOf,
- ga = {};
- f.fn = f.prototype = {
- constructor: f,
- init: function(e, n, a) {
- var b, c;
- if (!e) return this;
- if (e.nodeType) return this.context = this[0] = e,
- this.length = 1,
- this;
- if ("body" === e && !n && o.body) return this.context = o,
- this[0] = o.body,
- this.selector = e,
- this.length = 1,
- this;
- if ("string" == typeof e) {
- "<" !== e.charAt(0) || ">" !== e.charAt(e.length - 1) || 3 > e.length ? b = d.exec(e) : b = [null, e, null];
- if (b && (b[1] || !n)) {
- if (b[1]) return c = (n = n instanceof f ? n[0] : n) ? n.ownerDocument || n: o,
- (a = t.exec(e)) ? f.isPlainObject(n) ? (e = [o.createElement(a[1])], f.fn.attr.call(e, n, !0)) : e = [c.createElement(a[1])] : (a = f.buildFragment([b[1]], [c]), e = (a.cacheable ? f.clone(a.fragment) : a.fragment).childNodes),
- f.merge(this, e);
- if ((n = o.getElementById(b[2])) && n.parentNode) {
- if (n.id !== b[2]) return a.find(e);
- this.length = 1;
- this[0] = n
- }
- this.context = o;
- this.selector = e;
- return this
- }
- return ! n || n.jquery ? (n || a).find(e) : this.constructor(n).find(e)
- }
- if (f.isFunction(e)) return a.ready(e);
- e.selector !== m && (this.selector = e.selector, this.context = e.context);
- return f.makeArray(e, this)
- },
- selector: "",
- jquery: "1.7",
- length: 0,
- size: function() {
- return this.length
- },
- toArray: function() {
- return fa.call(this, 0)
- },
- get: function(e) {
- return null == e ? this.toArray() : 0 > e ? this[this.length + e] : this[e]
- },
- pushStack: function(e, n, a) {
- var b = this.constructor();
- f.isArray(e) ? P.apply(b, e) : f.merge(b, e);
- b.prevObject = this;
- b.context = this.context;
- "find" === n ? b.selector = this.selector + (this.selector ? " ": "") + a: n && (b.selector = this.selector + "." + n + "(" + a + ")");
- return b
- },
- each: function(e, n) {
- return f.each(this, e, n)
- },
- ready: function(e) {
- f.bindReady();
- Fa.add(e);
- return this
- },
- eq: function(e) {
- return - 1 === e ? this.slice(e) : this.slice(e, +e + 1)
- },
- first: function() {
- return this.eq(0)
- },
- last: function() {
- return this.eq( - 1)
- },
- slice: function() {
- return this.pushStack(fa.apply(this, arguments), "slice", fa.call(arguments).join(","))
- },
- map: function(e) {
- return this.pushStack(f.map(this,
- function(n, a) {
- return e.call(n, a, n)
- }))
- },
- end: function() {
- return this.prevObject || this.constructor(null)
- },
- push: P,
- sort: [].sort,
- splice: [].splice
- };
- f.fn.init.prototype = f.fn;
- f.extend = f.fn.extend = function() {
- var e, n, a, b, c, d, h = arguments[0] || {},
- g = 1,
- l = arguments.length,
- i = !1;
- "boolean" == typeof h && (i = h, h = arguments[1] || {},
- g = 2);
- "object" != typeof h && !f.isFunction(h) && (h = {});
- for (l === g && (h = this, --g); g < l; g++) if (null != (e = arguments[g])) for (n in e) a = h[n],
- b = e[n],
- h !== b && (i && b && (f.isPlainObject(b) || (c = f.isArray(b))) ? (c ? (c = !1, d = a && f.isArray(a) ? a: []) : d = a && f.isPlainObject(a) ? a: {},
- h[n] = f.extend(i, d, b)) : b !== m && (h[n] = b));
- return h
- };
- f.extend({
- noConflict: function(e) {
- j.$ === f && (j.$ = v);
- e && j.jQuery === f && (j.jQuery = p);
- return f
- },
- isReady: !1,
- readyWait: 1,
- holdReady: function(e) {
- e ? f.readyWait++:f.ready(!0)
- },
- ready: function(e) {
- if (!0 === e && !--f.readyWait || !0 !== e && !f.isReady) {
- if (!o.body) return setTimeout(f.ready, 1);
- f.isReady = !0; ! 0 !== e && 0 < --f.readyWait || (Fa.fireWith(o, [f]), f.fn.trigger && f(o).trigger("ready").unbind("ready"))
- }
- },
- bindReady: function() {
- if (!Fa) {
- Fa = f.Callbacks("once memory");
- if ("complete" === o.readyState) return setTimeout(f.ready, 1);
- if (o.addEventListener) o.addEventListener("DOMContentLoaded", O, !1),
- j.addEventListener("load", f.ready, !1);
- else if (o.attachEvent) {
- o.attachEvent("onreadystatechange", O);
- j.attachEvent("onload", f.ready);
- var e = !1;
- try {
- e = null == j.frameElement
- } catch(n) {}
- o.documentElement.doScroll && e && i()
- }
- }
- },
- isFunction: function(e) {
- return "function" === f.type(e)
- },
- isArray: Array.isArray ||
- function(e) {
- return "array" === f.type(e)
- },
- isWindow: function(e) {
- return e && "object" == typeof e && "setInterval" in e
- },
- isNumeric: function(e) {
- return null != e && l.test(e) && !isNaN(e)
- },
- type: function(e) {
- return null == e ? String(e) : ga[fc.call(e)] || "object"
- },
- isPlainObject: function(e) {
- if (!e || "object" !== f.type(e) || e.nodeType || f.isWindow(e)) return ! 1;
- try {
- if (e.constructor && !Za.call(e, "constructor") && !Za.call(e.constructor.prototype, "isPrototypeOf")) return ! 1
- } catch(n) {
- return ! 1
- }
- for (var a in e);
- return a === m || Za.call(e, a)
- },
- isEmptyObject: function(e) {
- for (var n in e) return ! 1;
- return ! 0
- },
- error: function(e) {
- throw e;
- },
- parseJSON: function(e) {
- if ("string" != typeof e || !e) return null;
- e = f.trim(e);
- if (j.JSON && j.JSON.parse) return j.JSON.parse(e);
- if (z.test(e.replace(ya, "@").replace(ja, "]").replace(I, ""))) return (new Function("return " + e))();
- f.error("Invalid JSON: " + e)
- },
- parseXML: function(e) {
- var n, a;
- try {
- j.DOMParser ? (a = new DOMParser, n = a.parseFromString(e, "text/xml")) : (n = new ActiveXObject("Microsoft.XMLDOM"), n.async = "false", n.loadXML(e))
- } catch(b) {
- n = m
- } (!n || !n.documentElement || n.getElementsByTagName("parsererror").length) && f.error("Invalid XML: " + e);
- return n
- },
- noop: function() {},
- globalEval: function(e) {
- e && a.test(e) && (j.execScript ||
- function(e) {
- j.eval.call(j, e)
- })(e)
- },
- camelCase: function(e) {
- return e.replace(E, "ms-").replace(cc, dc)
- },
- nodeName: function(e, n) {
- return e.nodeName && e.nodeName.toUpperCase() === n.toUpperCase()
- },
- each: function(e, n, a) {
- var b, c = 0,
- d = e.length,
- h = d === m || f.isFunction(e);
- if (a) if (h) for (b in e) {
- if (!1 === n.apply(e[b], a)) break
- } else for (; c < d && !1 !== n.apply(e[c++], a););
- else if (h) for (b in e) {
- if (!1 === n.call(e[b], b, e[b])) break
- } else for (; c < d && !1 !== n.call(e[c], c, e[c++]););
- return e
- },
- trim: ha ?
- function(e) {
- return null == e ? "": ha.call(e)
- }: function(e) {
- return null == e ? "": (e + "").replace(h, "").replace(g, "")
- },
- makeArray: function(e, n) {
- var a = n || [];
- if (null != e) {
- var b = f.type(e);
- null == e.length || "string" === b || "function" === b || "regexp" === b || f.isWindow(e) ? P.call(a, e) : f.merge(a, e)
- }
- return a
- },
- inArray: function(e, n, a) {
- var b;
- if (n) {
- if (pa) return pa.call(n, e, a);
- b = n.length;
- for (a = a ? 0 > a ? Math.max(0, b + a) : a: 0; a < b; a++) if (a in n && n[a] === e) return a
- }
- return - 1
- },
- merge: function(e, a) {
- var b = e.length,
- c = 0;
- if ("number" == typeof a.length) for (var d = a.length; c < d; c++) e[b++] = a[c];
- else for (; a[c] !== m;) e[b++] = a[c++];
- e.length = b;
- return e
- },
- grep: function(e, a, b) {
- for (var c = [], d, b = !!b, h = 0, g = e.length; h < g; h++) d = !!a(e[h], h),
- b !== d && c.push(e[h]);
- return c
- },
- map: function(e, a, b) {
- var c, d, h = [],
- g = 0,
- l = e.length;
- if (e instanceof f || l !== m && "number" == typeof l && (0 < l && e[0] && e[l - 1] || 0 === l || f.isArray(e))) for (; g < l; g++) c = a(e[g], g, b),
- null != c && (h[h.length] = c);
- else for (d in e) c = a(e[d], d, b),
- null != c && (h[h.length] = c);
- return h.concat.apply([], h)
- },
- guid: 1,
- proxy: function(e, a) {
- if ("string" == typeof a) var b = e[a],
- a = e,
- e = b;
- if (!f.isFunction(e)) return m;
- var c = fa.call(arguments, 2),
- b = function() {
- return e.apply(a, c.concat(fa.call(arguments)))
- };
- b.guid = e.guid = e.guid || b.guid || f.guid++;
- return b
- },
- access: function(e, a, b, c, d, h) {
- var g = e.length;
- if ("object" == typeof a) {
- for (var l in a) f.access(e, l, a[l], c, d, b);
- return e
- }
- if (b !== m) {
- c = !h && c && f.isFunction(b);
- for (l = 0; l < g; l++) d(e[l], a, c ? b.call(e[l], l, d(e[l], a)) : b, h);
- return e
- }
- return g ? d(e[0], a) : m
- },
- now: function() {
- return (new Date).getTime()
- },
- uaMatch: function(e) {
- e = e.toLowerCase();
- e = Zb.exec(e) || $b.exec(e) || ac.exec(e) || 0 > e.indexOf("compatible") && bc.exec(e) || [];
- return {
- browser: e[1] || "",
- version: e[2] || "0"
- }
- },
- sub: function() {
- function e(a, b) {
- return new e.fn.init(a, b)
- }
- f.extend(!0, e, this);
- e.superclass = this;
- e.fn = e.prototype = this();
- e.fn.constructor = e;
- e.sub = this.sub;
- e.fn.init = function(b, c) {
- c && c instanceof f && !(c instanceof e) && (c = e(c));
- return f.fn.init.call(this, b, c, a)
- };
- e.fn.init.prototype = e.fn;
- var a = e(o);
- return e
- },
- browser: {}
- });
- f.each("Boolean Number String Function Array Date RegExp Object".split(" "),
- function(e, a) {
- ga["[object " + a + "]"] = a.toLowerCase()
- });
- Ea = f.uaMatch(ec);
- Ea.browser && (f.browser[Ea.browser] = !0, f.browser.version = Ea.version);
- f.browser.webkit && (f.browser.safari = !0);
- a.test("\u00a0") && (h = /^[\s\xA0]+/, g = /[\s\xA0]+$/);
- b = f(o);
- o.addEventListener ? O = function() {
- o.removeEventListener("DOMContentLoaded", O, !1);
- f.ready()
- }: o.attachEvent && (O = function() {
- "complete" === o.readyState && (o.detachEvent("onreadystatechange", O), f.ready())
- });
- "function" == typeof define && define.amd && define.amd.jQuery && define("jquery", [],
- function() {
- return f
- });
- c = f;
- var pb = {};
- c.Callbacks = function(e) {
- var a;
- if (e) {
- if (! (a = pb[e])) {
- a = e;
- var b = pb[a] = {},
- d,
- h;
- a = a.split(/\s+/);
- d = 0;
- for (h = a.length; d < h; d++) b[a[d]] = !0;
- a = b
- }
- } else a = {};
- var e = a,
- g = [],
- l = [],
- f,
- i,
- j,
- t,
- k,
- z = function(a) {
- var b, n, d, h;
- b = 0;
- for (n = a.length; b < n; b++) d = a[b],
- h = c.type(d),
- "array" === h ? z(d) : "function" === h && (!e.unique || !v.has(d)) && g.push(d)
- },
- p = function(a, b) {
- b = b || [];
- f = !e.memory || [a, b];
- i = !0;
- k = j || 0;
- j = 0;
- for (t = g.length; g && k < t; k++) if (!1 === g[k].apply(a, b) && e.stopOnFalse) {
- f = !0;
- break
- }
- i = !1;
- g && (e.once ? !0 === f ? v.disable() : g = [] : l && l.length && (f = l.shift(), v.fireWith(f[0], f[1])))
- },
- v = {
- add: function() {
- if (g) {
- var e = g.length;
- z(arguments);
- i ? t = g.length: f && !0 !== f && (j = e, p(f[0], f[1]))
- }
- return this
- },
- remove: function() {
- if (g) for (var a = arguments,
- b = 0,
- n = a.length; b < n; b++) for (var c = 0; c < g.length && !(a[b] === g[c] && (i && c <= t && (t--, c <= k && k--), g.splice(c--, 1), e.unique)); c++);
- return this
- },
- has: function(e) {
- if (g) for (var a = 0,
- b = g.length; a < b; a++) if (e === g[a]) return ! 0;
- return ! 1
- },
- empty: function() {
- g = [];
- return this
- },
- disable: function() {
- g = l = f = m;
- return this
- },
- disabled: function() {
- return ! g
- },
- lock: function() {
- l = m; (!f || !0 === f) && v.disable();
- return this
- },
- locked: function() {
- return ! l
- },
- fireWith: function(a, b) {
- l && (i ? e.once || l.push([a, b]) : (!e.once || !f) && p(a, b));
- return this
- },
- fire: function() {
- v.fireWith(this, arguments);
- return this
- },
- fired: function() {
- return !! f
- }
- };
- return v
- };
- var $a = [].slice;
- c.extend({
- Deferred: function(e) {
- var a = c.Callbacks("once memory"),
- b = c.Callbacks("once memory"),
- d = c.Callbacks("memory"),
- h = "pending",
- g = {
- resolve: a,
- reject: b,
- notify: d
- },
- l = {
- done: a.add,
- fail: b.add,
- progress: d.add,
- state: function() {
- return h
- },
- isResolved: a.fired,
- isRejected: b.fired,
- then: function(e, a, b) {
- f.done(e).fail(a).progress(b);
- return this
- },
- always: function() {
- return f.done.apply(f, arguments).fail.apply(f, arguments)
- },
- pipe: function(e, a, b) {
- return c.Deferred(function(n) {
- c.each({
- done: [e, "resolve"],
- fail: [a, "reject"],
- progress: [b, "notify"]
- },
- function(e, a) {
- var b = a[0],
- d = a[1],
- h;
- c.isFunction(b) ? f[e](function() { (h = b.apply(this, arguments)) && c.isFunction(h.promise) ? h.promise().then(n.resolve, n.reject, n.notify) : n[d + "With"](this === f ? n: this, [h])
- }) : f[e](n[d])
- })
- }).promise()
- },
- promise: function(e) {
- if (null == e) e = l;
- else for (var a in l) e[a] = l[a];
- return e
- }
- },
- f = l.promise({}),
- i;
- for (i in g) f[i] = g[i].fire,
- f[i + "With"] = g[i].fireWith;
- f.done(function() {
- h = "resolved"
- },
- b.disable, d.lock).fail(function() {
- h = "rejected"
- },
- a.disable, d.lock);
- e && e.call(f, f);
- return f
- },
- when: function(e) {
- function a(e) {
- return function(a) {
- l[e] = 1 < arguments.length ? $a.call(arguments, 0) : a;
- i.notifyWith(j, l)
- }
- }
- function b(e) {
- return function(a) {
- d[e] = 1 < arguments.length ? $a.call(arguments, 0) : a; --f || i.resolveWith(i, d)
- }
- }
- var d = $a.call(arguments, 0),
- h = 0,
- g = d.length,
- l = Array(g),
- f = g,
- i = 1 >= g && e && c.isFunction(e.promise) ? e: c.Deferred(),
- j = i.promise();
- if (1 < g) {
- for (; h < g; h++) d[h] && d[h].promise && c.isFunction(d[h].promise) ? d[h].promise().then(b(h), i.reject, a(h)) : --f;
- f || i.resolveWith(i, d)
- } else i !== e && i.resolveWith(i, g ? [e] : []);
- return j
- }
- });
- var gc = c,
- ab;
- var G = o.createElement("div"),
- hc = o.documentElement,
- bb,
- qa,
- Ga,
- Ha,
- Z,
- ra,
- T,
- Ia,
- ba,
- Ja,
- W,
- Ka,
- za,
- La,
- sa,
- Aa;
- G.setAttribute("className", "t");
- G.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/><nav></nav>";
- bb = G.getElementsByTagName("*");
- qa = G.getElementsByTagName("a")[0];
- if (!bb || !bb.length || !qa) ab = {};
- else {
- Ga = o.createElement("select");
- Ha = Ga.appendChild(o.createElement("option"));
- Z = G.getElementsByTagName("input")[0];
- T = {
- leadingWhitespace: 3 === G.firstChild.nodeType,
- tbody: !G.getElementsByTagName("tbody").length,
- htmlSerialize: !!G.getElementsByTagName("link").length,
- style: /top/.test(qa.getAttribute("style")),
- hrefNormalized: "/a" === qa.getAttribute("href"),
- opacity: /^0.55/.test(qa.style.opacity),
- cssFloat: !!qa.style.cssFloat,
- unknownElems: !!G.getElementsByTagName("nav").length,
- checkOn: "on" === Z.value,
- optSelected: Ha.selected,
- getSetAttribute: "t" !== G.className,
- enctype: !!o.createElement("form").enctype,
- submitBubbles: !0,
- changeBubbles: !0,
- focusinBubbles: !1,
- deleteExpando: !0,
- noCloneEvent: !0,
- inlineBlockNeedsLayout: !1,
- shrinkWrapBlocks: !1,
- reliableMarginRight: !0
- };
- Z.checked = !0;
- T.noCloneChecked = Z.cloneNode(!0).checked;
- Ga.disabled = !0;
- T.optDisabled = !Ha.disabled;
- try {
- delete G.test
- } catch($c) {
- T.deleteExpando = !1
- } ! G.addEventListener && G.attachEvent && G.fireEvent && (G.attachEvent("onclick",
- function() {
- T.noCloneEvent = !1
- }), G.cloneNode(!0).fireEvent("onclick"));
- Z = o.createElement("input");
- Z.value = "t";
- Z.setAttribute("type", "radio");
- T.radioValue = "t" === Z.value;
- Z.setAttribute("checked", "checked");
- G.appendChild(Z);
- Ia = o.createDocumentFragment();
- Ia.appendChild(G.lastChild);
- T.checkClone = Ia.cloneNode(!0).cloneNode(!0).lastChild.checked;
- G.innerHTML = "";
- G.style.width = G.style.paddingLeft = "1px";
- ba = o.getElementsByTagName("body")[0];
- W = o.createElement(ba ? "div": "body");
- Ka = {
- visibility: "hidden",
- width: 0,
- height: 0,
- border: 0,
- margin: 0,
- background: "none"
- };
- ba && c.extend(Ka, {
- position: "absolute",
- left: "-999px",
- top: "-999px"
- });
- for (sa in Ka) W.style[sa] = Ka[sa];
- W.appendChild(G);
- Ja = ba || hc;
- Ja.insertBefore(W, Ja.firstChild);
- T.appendChecked = Z.checked;
- T.boxModel = 2 === G.offsetWidth;
- "zoom" in G.style && (G.style.display = "inline", G.style.zoom = 1, T.inlineBlockNeedsLayout = 2 === G.offsetWidth, G.style.display = "", G.innerHTML = "<div style='width:4px;'></div>", T.shrinkWrapBlocks = 2 !== G.offsetWidth);
- G.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
- za = G.getElementsByTagName("td");
- Aa = 0 === za[0].offsetHeight;
- za[0].style.display = "";
- za[1].style.display = "none";
- T.reliableHiddenOffsets = Aa && 0 === za[0].offsetHeight;
- G.innerHTML = "";
- o.defaultView && o.defaultView.getComputedStyle && (ra = o.createElement("div"), ra.style.width = "0", ra.style.marginRight = "0", G.appendChild(ra), T.reliableMarginRight = 0 === (parseInt((o.defaultView.getComputedStyle(ra, null) || {
- marginRight: 0
- }).marginRight, 10) || 0));
- if (G.attachEvent) for (sa in {
- submit: 1,
- change: 1,
- focusin: 1
- }) La = "on" + sa,
- (Aa = La in G) || (G.setAttribute(La, "return;"), Aa = "function" == typeof G[La]),
- T[sa + "Bubbles"] = Aa;
- c(function() {
- var e, a, b, d, h;
- ba = o.getElementsByTagName("body")[0]; ! ba || (e = o.createElement("div"), e.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px", ba.insertBefore(e, ba.firstChild), W = o.createElement("div"), W.style.cssText = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;visibility:hidden;border:0;", W.innerHTML = "<div style='position:absolute;top:0;left:0;width:1px;height:1px;margin:0;border:5px solid #000;padding:0;'><div></div></div><table style='position:absolute;top:0;left:0;width:1px;height:1px;margin:0;border:5px solid #000;padding:0;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>", e.appendChild(W), a = W.firstChild, b = a.firstChild, d = a.nextSibling.firstChild.firstChild, h = {
- doesNotAddBorder: 5 !== b.offsetTop,
- doesAddBorderForTableAndCells: 5 === d.offsetTop
- },
- b.style.position = "fixed", b.style.top = "20px", h.fixedPosition = 20 === b.offsetTop || 15 === b.offsetTop, b.style.position = b.style.top = "", a.style.overflow = "hidden", a.style.position = "relative", h.subtractsBorderForOverflowNotVisible = -5 === b.offsetTop, h.doesNotIncludeMarginInBodyOffset = 1 !== ba.offsetTop, ba.removeChild(e), W = null, c.extend(T, h))
- });
- W.innerHTML = "";
- Ja.removeChild(W);
- W = Ia = Ga = Ha = ba = ra = G = Z = null;
- ab = T
- }
- gc.support = ab;
- c.boxModel = c.support.boxModel;
- var Yb = /^(?:\{.*\}|\[.*\])$/,
- Xb = /([A-Z])/g;
- c.extend({
- cache: {},
- uuid: 0,
- expando: "jQuery" + (c.fn.jquery + Math.random()).replace(/\D/g, ""),
- noData: {
- embed: !0,
- object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
- applet: !0
- },
- hasData: function(e) {
- e = e.nodeType ? c.cache[e[c.expando]] : e[c.expando];
- return !! e && !R(e)
- },
- data: function(e, a, b, d) {
- if (c.acceptData(e)) {
- var h, g, l = "string" == typeof a,
- f = (h = e.nodeType) ? c.cache: e,
- i = h ? e[c.expando] : e[c.expando] && c.expando,
- j = "events" === a;
- if (i && f[i] && (j || d || f[i].data) || !(l && b === m)) {
- i || (h ? e[c.expando] = i = ++c.uuid: i = c.expando);
- f[i] || (f[i] = {},
- h || (f[i].toJSON = c.noop));
- if ("object" == typeof a || "function" == typeof a) d ? f[i] = c.extend(f[i], a) : f[i].data = c.extend(f[i].data, a);
- e = h = f[i];
- d || (h.data || (h.data = {}), h = h.data);
- b !== m && (h[c.camelCase(a)] = b);
- if (j && !h[a]) return e.events;
- l ? (g = h[a], null == g && (g = h[c.camelCase(a)])) : g = h;
- return g
- }
- }
- },
- removeData: function(e, a, b) {
- if (c.acceptData(e)) {
- var d, h, g, l = e.nodeType,
- f = l ? c.cache: e,
- i = l ? e[c.expando] : c.expando;
- if (f[i]) {
- if (a && (d = b ? f[i] : f[i].data)) {
- c.isArray(a) || (a in d ? a = [a] : (a = c.camelCase(a), a in d ? a = [a] : a = a.split(" ")));
- h = 0;
- for (g = a.length; h < g; h++) delete d[a[h]];
- if (! (b ? R: c.isEmptyObject)(d)) return
- }
- if (!b && (delete f[i].data, !R(f[i]))) return;
- c.support.deleteExpando || !f.setInterval ? delete f[i] : f[i] = null;
- l && (c.support.deleteExpando ? delete e[c.expando] : e.removeAttribute ? e.removeAttribute(c.expando) : e[c.expando] = null)
- }
- }
- },
- _data: function(e, a, b) {
- return c.data(e, a, b, !0)
- },
- acceptData: function(e) {
- if (e.nodeName) {
- var a = c.noData[e.nodeName.toLowerCase()];
- if (a) return ! 0 !== a && e.getAttribute("classid") === a
- }
- return ! 0
- }
- });
- c.fn.extend({
- data: function(e, a) {
- var b, d, h, g = null;
- if ("undefined" == typeof e) {
- if (this.length && (g = c.data(this[0]), 1 === this[0].nodeType && !c._data(this[0], "parsedAttrs"))) {
- d = this[0].attributes;
- for (var l = 0,
- f = d.length; l < f; l++) h = d[l].name,
- 0 === h.indexOf("data-") && (h = c.camelCase(h.substring(5)), M(this[0], h, g[h]));
- c._data(this[0], "parsedAttrs", !0)
- }
- return g
- }
- if ("object" == typeof e) return this.each(function() {
- c.data(this, e)
- });
- b = e.split(".");
- b[1] = b[1] ? "." + b[1] : "";
- return a === m ? (g = this.triggerHandler("getData" + b[1] + "!", [b[0]]), g === m && this.length && (g = c.data(this[0], e), g = M(this[0], e, g)), g === m && b[1] ? this.data(b[0]) : g) : this.each(function() {
- var d = c(this),
- h = [b[0], a];
- d.triggerHandler("setData" + b[1] + "!", h);
- c.data(this, e, a);
- d.triggerHandler("changeData" + b[1] + "!", h)
- })
- },
- removeData: function(e) {
- return this.each(function() {
- c.removeData(this, e)
- })
- }
- });
- c.extend({
- _mark: function(e, a) {
- e && (a = (a || "fx") + "mark", c._data(e, a, (c._data(e, a) || 0) + 1))
- },
- _unmark: function(e, a, b) { ! 0 !== e && (b = a, a = e, e = !1);
- if (a) {
- var b = b || "fx",
- d = b + "mark"; (e = e ? 0 : (c._data(a, d) || 1) - 1) ? c._data(a, d, e) : (c.removeData(a, d, !0), U(a, b, "mark"))
- }
- },
- queue: function(e, a, b) {
- var d;
- if (e) return a = (a || "fx") + "queue",
- d = c._data(e, a),
- b && (!d || c.isArray(b) ? d = c._data(e, a, c.makeArray(b)) : d.push(b)),
- d || []
- },
- dequeue: function(e, a) {
- var a = a || "fx",
- b = c.queue(e, a),
- d = b.shift(),
- h = {};
- "inprogress" === d && (d = b.shift());
- d && ("fx" === a && b.unshift("inprogress"), c._data(e, a + ".run", h), d.call(e,
- function() {
- c.dequeue(e, a)
- },
- h));
- b.length || (c.removeData(e, a + "queue " + a + ".run", !0), U(e, a, "queue"))
- }
- });
- c.fn.extend({
- queue: function(e, a) {
- "string" != typeof e && (a = e, e = "fx");
- return a === m ? c.queue(this[0], e) : this.each(function() {
- var b = c.queue(this, e, a);
- "fx" === e && "inprogress" !== b[0] && c.dequeue(this, e)
- })
- },
- dequeue: function(e) {
- return this.each(function() {
- c.dequeue(this, e)
- })
- },
- delay: function(e, a) {
- e = c.fx ? c.fx.speeds[e] || e: e;
- return this.queue(a || "fx",
- function(a, b) {
- var c = setTimeout(a, e);
- b.stop = function() {
- clearTimeout(c)
- }
- })
- },
- clearQueue: function(e) {
- return this.queue(e || "fx", [])
- },
- promise: function(e) {
- function a() {--g || b.resolveWith(d, [d])
- }
- "string" != typeof e && (e = m);
- for (var e = e || "fx",
- b = c.Deferred(), d = this, h = d.length, g = 1, l = e + "defer", f = e + "queue", e = e + "mark", i; h--;) if (i = c.data(d[h], l, m, !0) || (c.data(d[h], f, m, !0) || c.data(d[h], e, m, !0)) && c.data(d[h], l, c.Callbacks("once memory"), !0)) g++,
- i.add(a);
- a();
- return b.promise()
- }
- });
- var qb = /[\n\t\r]/g,
- Ma = /\s+/,
- ic = /\r/g,
- jc = /^(?:button|input)$/i,
- kc = /^(?:button|input|object|select|textarea)$/i,
- lc = /^a(?:rea)?$/i,
- rb = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
- sb = c.support.getSetAttribute,
- ia, tb, ub;
- c.fn.extend({
- attr: function(e, a) {
- return c.access(this, e, a, !0, c.attr)
- },
- removeAttr: function(e) {
- return this.each(function() {
- c.removeAttr(this, e)
- })
- },
- prop: function(e, a) {
- return c.access(this, e, a, !0, c.prop)
- },
- removeProp: function(e) {
- e = c.propFix[e] || e;
- return this.each(function() {
- try {
- this[e] = m,
- delete this[e]
- } catch(a) {}
- })
- },
- addClass: function(e) {
- var a, b, d, h, g, l, f;
- if (c.isFunction(e)) return this.each(function(a) {
- c(this).addClass(e.call(this, a, this.className))
- });
- if (e && "string" == typeof e) {
- a = e.split(Ma);
- b = 0;
- for (d = this.length; b < d; b++) if (h = this[b], 1 === h.nodeType) if (!h.className && 1 === a.length) h.className = e;
- else {
- g = " " + h.className + " ";
- l = 0;
- for (f = a.length; l < f; l++)~g.indexOf(" " + a[l] + " ") || (g += a[l] + " ");
- h.className = c.trim(g)
- }
- }
- return this
- },
- removeClass: function(e) {
- var a, b, d, h, g, l, f;
- if (c.isFunction(e)) return this.each(function(a) {
- c(this).removeClass(e.call(this, a, this.className))
- });
- if (e && "string" == typeof e || e === m) {
- a = (e || "").split(Ma);
- b = 0;
- for (d = this.length; b < d; b++) if (h = this[b], 1 === h.nodeType && h.className) if (e) {
- g = (" " + h.className + " ").replace(qb, " ");
- l = 0;
- for (f = a.length; l < f; l++) g = g.replace(" " + a[l] + " ", " ");
- h.className = c.trim(g)
- } else h.className = ""
- }
- return this
- },
- toggleClass: function(e, a) {
- var b = typeof e,
- d = "boolean" == typeof a;
- return c.isFunction(e) ? this.each(function(b) {
- c(this).toggleClass(e.call(this, b, this.className, a), a)
- }) : this.each(function() {
- if ("string" === b) for (var h, g = 0,
- l = c(this), f = a, i = e.split(Ma); h = i[g++];) f = d ? f: !l.hasClass(h),
- l[f ? "addClass": "removeClass"](h);
- else if ("undefined" === b || "boolean" === b) this.className && c._data(this, "__className__", this.className),
- this.className = this.className || !1 === e ? "": c._data(this, "__className__") || ""
- })
- },
- hasClass: function(e) {
- for (var e = " " + e + " ",
- a = 0,
- b = this.length; a < b; a++) if (1 === this[a].nodeType && -1 < (" " + this[a].className + " ").replace(qb, " ").indexOf(e)) return ! 0;
- return ! 1
- },
- val: function(e) {
- var a, b, d, h = this[0];
- if (!arguments.length) {
- if (h) {
- if ((a = c.valHooks[h.nodeName.toLowerCase()] || c.valHooks[h.type]) && "get" in a && (b = a.get(h, "value")) !== m) return b;
- b = h.value;
- return "string" == typeof b ? b.replace(ic, "") : null == b ? "": b
- }
- return m
- }
- d = c.isFunction(e);
- return this.each(function(b) {
- var h = c(this),
- g;
- if (1 === this.nodeType && (d ? g = e.call(this, b, h.val()) : g = e, null == g ? g = "": "number" == typeof g ? g += "": c.isArray(g) && (g = c.map(g,
- function(e) {
- return e == null ? "": e + ""
- })), a = c.valHooks[this.nodeName.toLowerCase()] || c.valHooks[this.type], !a || !("set" in a) || a.set(this, g, "value") === m)) this.value = g
- })
- }
- });
- c.extend({
- valHooks: {
- option: {
- get: function(e) {
- var a = e.attributes.value;
- return ! a || a.specified ? e.value: e.text
- }
- },
- select: {
- get: function(e) {
- var a, b, d = e.selectedIndex,
- h = [],
- g = e.options,
- l = "select-one" === e.type;
- if (0 > d) return null;
- e = l ? d: 0;
- for (b = l ? d + 1 : g.length; e < b; e++) if (a = g[e], a.selected && (c.support.optDisabled ? !a.disabled: null === a.getAttribute("disabled")) && (!a.parentNode.disabled || !c.nodeName(a.parentNode, "optgroup"))) {
- a = c(a).val();
- if (l) return a;
- h.push(a)
- }
- return l && !h.length && g.length ? c(g[d]).val() : h
- },
- set: function(e, a) {
- var b = c.makeArray(a);
- c(e).find("option").each(function() {
- this.selected = 0 <= c.inArray(c(this).val(), b)
- });
- b.length || (e.selectedIndex = -1);
- return b
- }
- }
- },
- attrFn: {
- val: !0,
- css: !0,
- html: !0,
- text: !0,
- data: !0,
- width: !0,
- height: !0,
- offset: !0
- },
- attr: function(e, a, b, d) {
- var h, g, l = e.nodeType;
- if (!e || 3 === l || 8 === l || 2 === l) return m;
- if (d && a in c.attrFn) return c(e)[a](b);
- if (! ("getAttribute" in e)) return c.prop(e, a, b); (d = 1 !== l || !c.isXMLDoc(e)) && (a = a.toLowerCase(), g = c.attrHooks[a] || (rb.test(a) ? tb: ia));
- if (b !== m) {
- if (null === b) return c.removeAttr(e, a),
- m;
- if (g && "set" in g && d && (h = g.set(e, b, a)) !== m) return h;
- e.setAttribute(a, "" + b);
- return b
- }
- if (g && "get" in g && d && null !== (h = g.get(e, a))) return h;
- h = e.getAttribute(a);
- return null === h ? m: h
- },
- removeAttr: function(e, a) {
- var b, d, h, g, l = 0;
- if (1 === e.nodeType) {
- d = (a || "").split(Ma);
- for (g = d.length; l < g; l++) h = d[l].toLowerCase(),
- b = c.propFix[h] || h,
- c.attr(e, h, ""),
- e.removeAttribute(sb ? h: b),
- rb.test(h) && b in e && (e[b] = !1)
- }
- },
- attrHooks: {
- type: {
- set: function(e, a) {
- if (jc.test(e.nodeName) && e.parentNode) c.error("type property can't be changed");
- else if (!c.support.radioValue && "radio" === a && c.nodeName(e, "input")) {
- var b = e.value;
- e.setAttribute("type", a);
- b && (e.value = b);
- return a
- }
- }
- },
- value: {
- get: function(e, a) {
- return ia && c.nodeName(e, "button") ? ia.get(e, a) : a in e ? e.value: null
- },
- set: function(e, a, b) {
- if (ia && c.nodeName(e, "button")) return ia.set(e, a, b);
- e.value = a
- }
- }
- },
- propFix: {
- tabindex: "tabIndex",
- readonly: "readOnly",
- "for": "htmlFor",
- "class": "className",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- cellpadding: "cellPadding",
- rowspan: "rowSpan",
- colspan: "colSpan",
- usemap: "useMap",
- frameborder: "frameBorder",
- contenteditable: "contentEditable"
- },
- prop: function(e, a, b) {
- var d, h, g = e.nodeType;
- if (!e || 3 === g || 8 === g || 2 === g) return m; (1 !== g || !c.isXMLDoc(e)) && (a = c.propFix[a] || a, h = c.propHooks[a]);
- return b !== m ? h && "set" in h && (d = h.set(e, b, a)) !== m ? d: e[a] = b: h && "get" in h && null !== (d = h.get(e, a)) ? d: e[a]
- },
- propHooks: {
- tabIndex: {
- get: function(e) {
- var a = e.getAttributeNode("tabindex");
- return a && a.specified ? parseInt(a.value, 10) : kc.test(e.nodeName) || lc.test(e.nodeName) && e.href ? 0 : m
- }
- }
- }
- });
- c.attrHooks.tabindex = c.propHooks.tabIndex;
- tb = {
- get: function(e, a) {
- var b, d = c.prop(e, a);
- return ! 0 === d || "boolean" != typeof d && (b = e.getAttributeNode(a)) && !1 !== b.nodeValue ? a.toLowerCase() : m
- },
- set: function(e, a, b) {
- var d; ! 1 === a ? c.removeAttr(e, b) : (d = c.propFix[b] || b, d in e && (e[d] = !0), e.setAttribute(b, b.toLowerCase()));
- return b
- }
- };
- sb || (ub = {
- name: !0,
- id: !0
- },
- ia = c.valHooks.button = {
- get: function(e, a) {
- var b;
- return (b = e.getAttributeNode(a)) && (ub[a] ? "" !== b.nodeValue: b.specified) ? b.nodeValue: m
- },
- set: function(e, a, b) {
- var c = e.getAttributeNode(b);
- c || (c = o.createAttribute(b), e.setAttributeNode(c));
- return c.nodeValue = a + ""
- }
- },
- c.attrHooks.tabindex.set = ia.set, c.each(["width", "height"],
- function(e, a) {
- c.attrHooks[a] = c.extend(c.attrHooks[a], {
- set: function(e, b) {
- if ("" === b) return e.setAttribute(a, "auto"),
- b
- }
- })
- }), c.attrHooks.contenteditable = {
- get: ia.get,
- set: function(e, a, b) {
- "" === a && (a = "false");
- ia.set(e, a, b)
- }
- });
- c.support.hrefNormalized || c.each(["href", "src", "width", "height"],
- function(e, a) {
- c.attrHooks[a] = c.extend(c.attrHooks[a], {
- get: function(e) {
- e = e.getAttribute(a, 2);
- return null === e ? m: e
- }
- })
- });
- c.support.style || (c.attrHooks.style = {
- get: function(e) {
- return e.style.cssText.toLowerCase() || m
- },
- set: function(e, a) {
- return e.style.cssText = "" + a
- }
- });
- c.support.optSelected || (c.propHooks.selected = c.extend(c.propHooks.selected, {
- get: function(e) {
- e = e.parentNode;
- e && (e.selectedIndex, e.parentNode && e.parentNode.selectedIndex);
- return null
- }
- }));
- c.support.enctype || (c.propFix.enctype = "encoding");
- c.support.checkOn || c.each(["radio", "checkbox"],
- function() {
- c.valHooks[this] = {
- get: function(e) {
- return null === e.getAttribute("value") ? "on": e.value
- }
- }
- });
- c.each(["radio", "checkbox"],
- function() {
- c.valHooks[this] = c.extend(c.valHooks[this], {
- set: function(e, a) {
- if (c.isArray(a)) return e.checked = 0 <= c.inArray(c(e).val(), a)
- }
- })
- });
- var cb = /^(?:textarea|input|select)$/i,
- vb = /^([^\.]*)?(?:\.(.+))?$/,
- mc = /\bhover(\.\S+)?/,
- nc = /^key/,
- oc = /^(?:mouse|contextmenu)|click/,
- pc = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
- wb = function(e) {
- return c.event.special.hover ? e: e.replace(mc, "mouseenter$1 mouseleave$1")
- };
- c.event = {
- add: function(e, a, b, d, h) {
- var g, l, f, i, j, t, k, z, p;
- if (! (3 === e.nodeType || 8 === e.nodeType || !a || !b || !(g = c._data(e)))) {
- b.handler && (k = b, b = k.handler);
- b.guid || (b.guid = c.guid++); (f = g.events) || (g.events = f = {}); (l = g.handle) || (g.handle = l = function(e) {
- return "undefined" != typeof c && (!e || c.event.triggered !== e.type) ? c.event.dispatch.apply(l.elem, arguments) : m
- },
- l.elem = e);
- a = wb(a).split(" ");
- for (g = 0; g < a.length; g++) {
- i = vb.exec(a[g]) || [];
- j = i[1];
- t = (i[2] || "").split(".").sort();
- p = c.event.special[j] || {};
- j = (h ? p.delegateType: p.bindType) || j;
- p = c.event.special[j] || {};
- i = c.extend({
- type: j,
- origType: i[1],
- data: d,
- handler: b,
- guid: b.guid,
- selector: h,
- namespace: t.join(".")
- },
- k);
- if (h) {
- z = i;
- var v = pc.exec(h);
- v && (v[1] = (v[1] || "").toLowerCase(), v[3] = v[3] && RegExp("(?:^|\\s)" + v[3] + "(?:\\s|$)"));
- z.quick = v; ! i.quick && c.expr.match.POS.test(h) && (i.isPositional = !0)
- }
- z = f[j];
- if (!z && (z = f[j] = [], z.delegateCount = 0, !p.setup || !1 === p.setup.call(e, d, t, l))) e.addEventListener ? e.addEventListener(j, l, !1) : e.attachEvent && e.attachEvent("on" + j, l);
- p.add && (p.add.call(e, i), i.handler.guid || (i.handler.guid = b.guid));
- h ? z.splice(z.delegateCount++, 0, i) : z.push(i);
- c.event.global[j] = !0
- }
- e = null
- }
- },
- global: {},
- remove: function(e, a, b, d) {
- var h = c.hasData(e) && c._data(e),
- g,
- l,
- f,
- i,
- j,
- t,
- k,
- z,
- p,
- m;
- if (h && (t = h.events)) {
- a = wb(a || "").split(" ");
- for (g = 0; g < a.length; g++) {
- l = vb.exec(a[g]) || [];
- f = l[1];
- l = l[2];
- if (!f) {
- l = l ? "." + l: "";
- for (j in t) c.event.remove(e, j + l, b, d);
- return
- }
- k = c.event.special[f] || {};
- f = (d ? k.delegateType: k.bindType) || f;
- p = t[f] || [];
- i = p.length;
- l = l ? RegExp("(^|\\.)" + l.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
- if (b || l || d || k.remove) for (j = 0; j < p.length; j++) {
- if (m = p[j], !b || b.guid === m.guid) if (!l || l.test(m.namespace)) if (!d || d === m.selector || "**" === d && m.selector) p.splice(j--, 1),
- m.selector && p.delegateCount--,
- k.remove && k.remove.call(e, m)
- } else p.length = 0;
- 0 === p.length && i !== p.length && ((!k.teardown || !1 === k.teardown.call(e, l)) && c.removeEvent(e, f, h.handle), delete t[f])
- }
- c.isEmptyObject(t) && (z = h.handle, z && (z.elem = null), c.removeData(e, ["events", "handle"], !0))
- }
- },
- customEvent: {
- getData: !0,
- setData: !0,
- changeData: !0
- },
- trigger: function(e, a, b, d) {
- if (!b || 3 !== b.nodeType && 8 !== b.nodeType) {
- var h = e.type || e,
- g = [],
- l,
- f,
- i,
- t,
- k;
- 0 <= h.indexOf("!") && (h = h.slice(0, -1), l = !0);
- 0 <= h.indexOf(".") && (g = h.split("."), h = g.shift(), g.sort());
- if (b && !c.event.customEvent[h] || c.event.global[h]) if (e = "object" == typeof e ? e[c.expando] ? e: new c.Event(h, e) : new c.Event(h), e.type = h, e.isTrigger = !0, e.exclusive = l, e.namespace = g.join("."), e.namespace_re = e.namespace ? RegExp("(^|\\.)" + g.join("\\.(?:.*\\.)?") + "(\\.|$)") : null, g = 0 > h.indexOf(":") ? "on" + h: "", (d || !b) && e.preventDefault(), b) {
- if (e.result = m, e.target || (e.target = b), a = null != a ? c.makeArray(a) : [], a.unshift(e), l = c.event.special[h] || {},
- !(l.trigger && !1 === l.trigger.apply(b, a))) {
- k = [[b, l.bindType || h]];
- if (!d && !l.noBubble && !c.isWindow(b)) {
- f = l.delegateType || h;
- i = null;
- for (d = b.parentNode; d; d = d.parentNode) k.push([d, f]),
- i = d;
- i && i === b.ownerDocument && k.push([i.defaultView || i.parentWindow || j, f])
- }
- for (f = 0; f < k.length && !(d = k[f][0], e.type = k[f][1], (t = (c._data(d, "events") || {})[e.type] && c._data(d, "handle")) && t.apply(d, a), (t = g && d[g]) && c.acceptData(d) && t.apply(d, a), e.isPropagationStopped()); f++);
- e.type = h;
- e.isDefaultPrevented() || (!l._default || !1 === l._default.apply(b.ownerDocument, a)) && ("click" !== h || !c.nodeName(b, "a")) && c.acceptData(b) && g && b[h] && ("focus" !== h && "blur" !== h || 0 !== e.target.offsetWidth) && !c.isWindow(b) && (i = b[g], i && (b[g] = null), c.event.triggered = h, b[h](), c.event.triggered = m, i && (b[g] = i));
- return e.result
- }
- } else for (f in b = c.cache, b) b[f].events && b[f].events[h] && c.event.trigger(e, a, b[f].handle.elem, !0)
- }
- },
- dispatch: function(e) {
- var e = c.event.fix(e || j.event),
- a = (c._data(this, "events") || {})[e.type] || [],
- b = a.delegateCount,
- d = [].slice.call(arguments, 0),
- h = !e.exclusive && !e.namespace,
- g = (c.event.special[e.type] || {}).handle,
- l = [],
- f,
- i,
- t,
- k,
- z,
- p,
- v;
- d[0] = e;
- e.delegateTarget = this;
- if (b && !e.target.disabled && (!e.button || "click" !== e.type)) for (i = e.target; i != this; i = i.parentNode || this) {
- k = {};
- z = [];
- for (f = 0; f < b; f++) t = a[f],
- p = t.selector,
- v = k[p],
- t.isPositional ? v = 0 <= (v || (k[p] = c(p))).index(i) : v === m && (v = k[p] = t.quick ? (!t.quick[1] || i.nodeName.toLowerCase() === t.quick[1]) && (!t.quick[2] || i.id === t.quick[2]) && (!t.quick[3] || t.quick[3].test(i.className)) : c(i).is(p)),
- v && z.push(t);
- z.length && l.push({
- elem: i,
- matches: z
- })
- }
- a.length > b && l.push({
- elem: this,
- matches: a.slice(b)
- });
- for (f = 0; f < l.length && !e.isPropagationStopped(); f++) {
- b = l[f];
- e.currentTarget = b.elem;
- for (a = 0; a < b.matches.length && !e.isImmediatePropagationStopped(); a++) if (t = b.matches[a], h || !e.namespace && !t.namespace || e.namespace_re && e.namespace_re.test(t.namespace)) e.data = t.data,
- e.handleObj = t,
- t = (g || t.handler).apply(b.elem, d),
- t !== m && (e.result = t, !1 === t && (e.preventDefault(), e.stopPropagation()))
- }
- return e.result
- },
- props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
- fixHooks: {},
- keyHooks: {
- props: ["char", "charCode", "key", "keyCode"],
- filter: function(e, a) {
- null == e.which && (e.which = null != a.charCode ? a.charCode: a.keyCode);
- return e
- }
- },
- mouseHooks: {
- props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "),
- filter: function(e, a) {
- var b, c, d, h = a.button,
- g = a.fromElement;
- null == e.pageX && null != a.clientX && (b = e.target.ownerDocument || o, c = b.documentElement, d = b.body, e.pageX = a.clientX + (c && c.scrollLeft || d && d.scrollLeft || 0) - (c && c.clientLeft || d && d.clientLeft || 0), e.pageY = a.clientY + (c && c.scrollTop || d && d.scrollTop || 0) - (c && c.clientTop || d && d.clientTop || 0)); ! e.relatedTarget && g && (e.relatedTarget = g === e.target ? a.toElement: g); ! e.which && h !== m && (e.which = h & 1 ? 1 : h & 2 ? 3 : h & 4 ? 2 : 0);
- return e
- }
- },
- fix: function(e) {
- if (e[c.expando]) return e;
- var a, b, d = e,
- h = c.event.fixHooks[e.type] || {},
- g = h.props ? this.props.concat(h.props) : this.props,
- e = c.Event(d);
- for (a = g.length; a;) b = g[--a],
- e[b] = d[b];
- e.target || (e.target = d.srcElement || o);
- 3 === e.target.nodeType && (e.target = e.target.parentNode);
- e.metaKey === m && (e.metaKey = e.ctrlKey);
- return h.filter ? h.filter(e, d) : e
- },
- special: {
- ready: {
- setup: c.bindReady
- },
- focus: {
- delegateType: "focusin",
- noBubble: !0
- },
- blur: {
- delegateType: "focusout",
- noBubble: !0
- },
- beforeunload: {
- setup: function(e, a, b) {
- c.isWindow(this) && (this.onbeforeunload = b)
- },
- teardown: function(e, a) {
- this.onbeforeunload === a && (this.onbeforeunload = null)
- }
- }
- },
- simulate: function(e, a, b, d) {
- e = c.extend(new c.Event, b, {
- type: e,
- isSimulated: !0,
- originalEvent: {}
- });
- d ? c.event.trigger(e, null, a) : c.event.dispatch.call(a, e);
- e.isDefaultPrevented() && b.preventDefault()
- }
- };
- c.event.handle = c.event.dispatch;
- c.removeEvent = o.removeEventListener ?
- function(e, a, b) {
- e.removeEventListener && e.removeEventListener(a, b, !1)
- }: function(e, a, b) {
- e.detachEvent && e.detachEvent("on" + a, b)
- };
- c.Event = function(e, a) {
- if (! (this instanceof c.Event)) return new c.Event(e, a);
- e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || !1 === e.returnValue || e.getPreventDefault && e.getPreventDefault() ? k: B) : this.type = e;
- a && c.extend(this, a);
- this.timeStamp = e && e.timeStamp || c.now();
- this[c.expando] = !0
- };
- c.Event.prototype = {
- preventDefault: function() {
- this.isDefaultPrevented = k;
- var e = this.originalEvent; ! e || (e.preventDefault ? e.preventDefault() : e.returnValue = !1)
- },
- stopPropagation: function() {
- this.isPropagationStopped = k;
- var e = this.originalEvent; ! e || (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0)
- },
- stopImmediatePropagation: function() {
- this.isImmediatePropagationStopped = k;
- this.stopPropagation()
- },
- isDefaultPrevented: B,
- isPropagationStopped: B,
- isImmediatePropagationStopped: B
- };
- c.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
- },
- function(e, a) {
- c.event.special[e] = c.event.special[a] = {
- delegateType: a,
- bindType: a,
- handle: function(e) {
- var a = e.relatedTarget,
- b = e.handleObj,
- d;
- if (!a || b.origType === e.type || a !== this && !c.contains(this, a)) a = e.type,
- e.type = b.origType,
- d = b.handler.apply(this, arguments),
- e.type = a;
- return d
- }
- }
- });
- c.support.submitBubbles || (c.event.special.submit = {
- setup: function() {
- if (c.nodeName(this, "form")) return ! 1;
- c.event.add(this, "click._submit keypress._submit",
- function(e) {
- e = e.target; (e = c.nodeName(e, "input") || c.nodeName(e, "button") ? e.form: m) && !e._submit_attached && (c.event.add(e, "submit._submit",
- function(e) {
- this.parentNode && c.event.simulate("submit", this.parentNode, e, !0)
- }), e._submit_attached = !0)
- })
- },
- teardown: function() {
- if (c.nodeName(this, "form")) return ! 1;
- c.event.remove(this, "._submit")
- }
- });
- c.support.changeBubbles || (c.event.special.change = {
- setup: function() {
- if (cb.test(this.nodeName)) {
- if ("checkbox" === this.type || "radio" === this.type) c.event.add(this, "propertychange._change",
- function(e) {
- "checked" === e.originalEvent.propertyName && (this._just_changed = !0)
- }),
- c.event.add(this, "click._change",
- function(e) {
- this._just_changed && (this._just_changed = !1, c.event.simulate("change", this, e, !0))
- });
- return ! 1
- }
- c.event.add(this, "beforeactivate._change",
- function(e) {
- e = e.target;
- cb.test(e.nodeName) && !e._change_attached && (c.event.add(e, "change._change",
- function(e) {
- this.parentNode && !e.isSimulated && c.event.simulate("change", this.parentNode, e, !0)
- }), e._change_attached = !0)
- })
- },
- handle: function(e) {
- var a = e.target;
- if (this !== a || e.isSimulated || e.isTrigger || "radio" !== a.type && "checkbox" !== a.type) return e.handleObj.handler.apply(this, arguments)
- },
- teardown: function() {
- c.event.remove(this, "._change");
- return cb.test(this.nodeName)
- }
- });
- c.support.focusinBubbles || c.each({
- focus: "focusin",
- blur: "focusout"
- },
- function(e, a) {
- var b = 0,
- d = function(e) {
- c.event.simulate(a, e.target, c.event.fix(e), !0)
- };
- c.event.special[a] = {
- setup: function() {
- 0 === b++&&o.addEventListener(e, d, !0)
- },
- teardown: function() {
- 0 === --b && o.removeEventListener(e, d, !0)
- }
- }
- });
- c.fn.extend({
- on: function(e, a, b, d, h) {
- var g, l;
- if ("object" == typeof e) {
- "string" != typeof a && (b = a, a = m);
- for (l in e) this.on(l, a, b, e[l], h);
- return this
- }
- null == b && null == d ? (d = a, b = a = m) : null == d && ("string" == typeof a ? (d = b, b = m) : (d = b, b = a, a = m));
- if (!1 === d) d = B;
- else if (!d) return this;
- 1 === h && (g = d, d = function(e) {
- c().off(e);
- return g.apply(this, arguments)
- },
- d.guid = g.guid || (g.guid = c.guid++));
- return this.each(function() {
- c.event.add(this, e, d, b, a)
- })
- },
- one: function(e, a, b, d) {
- return this.on.call(this, e, a, b, d, 1)
- },
- off: function(e, a, b) {
- if (e && e.preventDefault && e.handleObj) {
- var d = e.handleObj;
- c(e.delegateTarget).off(d.namespace ? d.type + "." + d.namespace: d.type, d.selector, d.handler);
- return this
- }
- if ("object" == typeof e) {
- for (d in e) this.off(d, a, e[d]);
- return this
- }
- if (!1 === a || "function" == typeof a) b = a,
- a = m; ! 1 === b && (b = B);
- return this.each(function() {
- c.event.remove(this, e, b, a)
- })
- },
- bind: function(e, a, b) {
- return this.on(e, null, a, b)
- },
- unbind: function(e, a) {
- return this.off(e, null, a)
- },
- live: function(e, a, b) {
- c(this.context).on(e, this.selector, a, b);
- return this
- },
- die: function(e, a) {
- c(this.context).off(e, this.selector || "**", a);
- return this
- },
- delegate: function(e, a, b, d) {
- return this.on(a, e, b, d)
- },
- undelegate: function(e, a, b) {
- return 1 == arguments.length ? this.off(e, "**") : this.off(a, e, b)
- },
- trigger: function(e, a) {
- return this.each(function() {
- c.event.trigger(e, a, this)
- })
- },
- triggerHandler: function(e, a) {
- if (this[0]) return c.event.trigger(e, a, this[0], !0)
- },
- toggle: function(e) {
- var a = arguments,
- b = e.guid || c.guid++,
- d = 0,
- h = function(b) {
- var h = (c._data(this, "lastToggle" + e.guid) || 0) % d;
- c._data(this, "lastToggle" + e.guid, h + 1);
- b.preventDefault();
- return a[h].apply(this, arguments) || !1
- };
- for (h.guid = b; d < a.length;) a[d++].guid = b;
- return this.click(h)
- },
- hover: function(e, a) {
- return this.mouseenter(e).mouseleave(a || e)
- }
- });
- c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),
- function(e, a) {
- c.fn[a] = function(e, b) {
- b == null && (b = e, e = null);
- return arguments.length > 0 ? this.bind(a, e, b) : this.trigger(a)
- };
- c.attrFn && (c.attrFn[a] = true);
- nc.test(a) && (c.event.fixHooks[a] = c.event.keyHooks);
- oc.test(a) && (c.event.fixHooks[a] = c.event.mouseHooks)
- });
- var xb = function(e, a, b, d, c, h) {
- for (var c = 0,
- g = d.length; c < g; c++) {
- var l = d[c];
- if (l) {
- for (var f = !1,
- l = l[e]; l;) {
- if (l[ta] === b) {
- f = d[l.sizset];
- break
- }
- if (1 === l.nodeType) if (h || (l[ta] = b, l.sizset = c), "string" != typeof a) {
- if (l === a) {
- f = !0;
- break
- }
- } else if (0 < A.filter(a, [l]).length) {
- f = l;
- break
- }
- l = l[e]
- }
- d[c] = f
- }
- }
- },
- yb = function(e, a, b, d, c, h) {
- for (var c = 0,
- g = d.length; c < g; c++) {
- var l = d[c];
- if (l) {
- for (var f = !1,
- l = l[e]; l;) {
- if (l[ta] === b) {
- f = d[l.sizset];
- break
- }
- 1 === l.nodeType && !h && (l[ta] = b, l.sizset = c);
- if (l.nodeName.toLowerCase() === a) {
- f = l;
- break
- }
- l = l[e]
- }
- d[c] = f
- }
- }
- },
- db = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
- ta = "sizcache" + (Math.random() + "").replace(".", ""),
- eb = 0,
- zb = Object.prototype.toString,
- Na = !1,
- Ab = !0,
- ua = /\\/g,
- qc = /\r\n/g,
- Oa = /\W/; [0, 0].sort(function() {
- Ab = !1;
- return 0
- });
- var A = function(e, a, b, d) {
- var b = b || [],
- c = a = a || o;
- if (1 !== a.nodeType && 9 !== a.nodeType) return [];
- if (!e || "string" != typeof e) return b;
- var h, g, l, f, i, t, j = !0,
- k = A.isXML(a),
- z = [],
- p = e;
- do
- if (db.exec(""), h = db.exec(p)) if (p = h[3], z.push(h[1]), h[2]) {
- f = h[3];
- break
- }
- while (h);
- if (1 < z.length && rc.exec(e)) if (2 === z.length && H.relative[z[0]]) g = Bb(z[0] + z[1], a, d);
- else for (g = H.relative[z[0]] ? [a] : A(z.shift(), a); z.length;) e = z.shift(),
- H.relative[e] && (e += z.shift()),
- g = Bb(e, g, d);
- else if (!d && 1 < z.length && 9 === a.nodeType && !k && H.match.ID.test(z[0]) && !H.match.ID.test(z[z.length - 1]) && (i = A.find(z.shift(), a, k), a = i.expr ? A.filter(i.expr, i.set)[0] : i.set[0]), a) {
- i = d ? {
- expr: z.pop(),
- set: ca(d)
- }: A.find(z.pop(), 1 === z.length && ("~" === z[0] || "+" === z[0]) && a.parentNode ? a.parentNode: a, k);
- g = i.expr ? A.filter(i.expr, i.set) : i.set;
- for (0 < z.length ? l = ca(g) : j = !1; z.length;) h = t = z.pop(),
- H.relative[t] ? h = z.pop() : t = "",
- null == h && (h = a),
- H.relative[t](l, h, k)
- } else l = [];
- l || (l = g);
- l || A.error(t || e);
- if ("[object Array]" === zb.call(l)) if (j) if (a && 1 === a.nodeType) for (e = 0; null != l[e]; e++) l[e] && (!0 === l[e] || 1 === l[e].nodeType && A.contains(a, l[e])) && b.push(g[e]);
- else for (e = 0; null != l[e]; e++) l[e] && 1 === l[e].nodeType && b.push(g[e]);
- else b.push.apply(b, l);
- else ca(l, b);
- f && (A(f, c, b, d), A.uniqueSort(b));
- return b
- };
- A.uniqueSort = function(e) {
- if (Pa && (Na = Ab, e.sort(Pa), Na)) for (var a = 1; a < e.length; a++) e[a] === e[a - 1] && e.splice(a--, 1);
- return e
- };
- A.matches = function(e, a) {
- return A(e, null, null, a)
- };
- A.matchesSelector = function(e, a) {
- return 0 < A(a, null, null, [e]).length
- };
- A.find = function(e, a, b) {
- var d, c, h, g, l, f;
- if (!e) return [];
- c = 0;
- for (h = H.order.length; c < h; c++) if (l = H.order[c], g = H.leftMatch[l].exec(e)) if (f = g[1], g.splice(1, 1), "\\" !== f.substr(f.length - 1) && (g[1] = (g[1] || "").replace(ua, ""), d = H.find[l](g, a, b), null != d)) {
- e = e.replace(H.match[l], "");
- break
- }
- d || (d = "undefined" != typeof a.getElementsByTagName ? a.getElementsByTagName("*") : []);
- return {
- set: d,
- expr: e
- }
- };
- A.filter = function(e, a, b, d) {
- for (var c, h, g, l, f, i, t, j, k = e,
- z = [], p = a, v = a && a[0] && A.isXML(a[0]); e && a.length;) {
- for (g in H.filter) if (null != (c = H.leftMatch[g].exec(e)) && c[2]) if (i = H.filter[g], f = c[1], h = !1, c.splice(1, 1), "\\" !== f.substr(f.length - 1)) {
- p === z && (z = []);
- if (H.preFilter[g]) if (c = H.preFilter[g](c, p, b, z, d, v)) {
- if (!0 === c) continue
- } else h = l = !0;
- if (c) for (t = 0; null != (f = p[t]); t++) f && (l = i(f, c, t, p), j = d ^ l, b && null != l ? j ? h = !0 : p[t] = !1 : j && (z.push(f), h = !0));
- if (l !== m) {
- b || (p = z);
- e = e.replace(H.match[g], "");
- if (!h) return [];
- break
- }
- }
- if (e === k) if (null == h) A.error(e);
- else break;
- k = e
- }
- return p
- };
- A.error = function(e) {
- throw "Syntax error, unrecognized expression: " + e;
- };
- var fb = A.getText = function(e) {
- var a, b;
- a = e.nodeType;
- var d = "";
- if (a) if (1 === a) {
- if ("string" == typeof e.textContent) return e.textContent;
- if ("string" == typeof e.innerText) return e.innerText.replace(qc, "");
- for (e = e.firstChild; e; e = e.nextSibling) d += fb(e)
- } else {
- if (3 === a || 4 === a) return e.nodeValue
- } else for (a = 0; b = e[a]; a++) 8 !== b.nodeType && (d += fb(b));
- return d
- },
- H = A.selectors = {
- order: ["ID", "NAME", "TAG"],
- match: {
- ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
- CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
- NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
- TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
- CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
- POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
- PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
- },
- leftMatch: {},
- attrMap: {
- "class": "className",
- "for": "htmlFor"
- },
- attrHandle: {
- href: function(e) {
- return e.getAttribute("href")
- },
- type: function(e) {
- return e.getAttribute("type")
- }
- },
- relative: {
- "+": function(e, a) {
- var b = "string" == typeof a,
- d = b && !Oa.test(a),
- b = b && !d;
- d && (a = a.toLowerCase());
- for (var d = 0,
- c = e.length,
- h; d < c; d++) if (h = e[d]) {
- for (; (h = h.previousSibling) && 1 !== h.nodeType;);
- e[d] = b || h && h.nodeName.toLowerCase() === a ? h || !1 : h === a
- }
- b && A.filter(a, e, !0)
- },
- ">": function(e, a) {
- var b, d = "string" == typeof a,
- c = 0,
- h = e.length;
- if (d && !Oa.test(a)) for (a = a.toLowerCase(); c < h; c++) {
- if (b = e[c]) b = b.parentNode,
- e[c] = b.nodeName.toLowerCase() === a ? b: !1
- } else {
- for (; c < h; c++)(b = e[c]) && (e[c] = d ? b.parentNode: b.parentNode === a);
- d && A.filter(a, e, !0)
- }
- },
- "": function(e, a, b) {
- var d, c = eb++,
- h = xb;
- "string" == typeof a && !Oa.test(a) && (a = a.toLowerCase(), d = a, h = yb);
- h("parentNode", a, c, e, d, b)
- },
- "~": function(e, a, b) {
- var d, c = eb++,
- h = xb;
- "string" == typeof a && !Oa.test(a) && (a = a.toLowerCase(), d = a, h = yb);
- h("previousSibling", a, c, e, d, b)
- }
- },
- find: {
- ID: function(e, a, b) {
- if ("undefined" != typeof a.getElementById && !b) return (e = a.getElementById(e[1])) && e.parentNode ? [e] : []
- },
- NAME: function(e, a) {
- if ("undefined" != typeof a.getElementsByName) {
- for (var b = [], d = a.getElementsByName(e[1]), c = 0, h = d.length; c < h; c++) d[c].getAttribute("name") === e[1] && b.push(d[c]);
- return 0 === b.length ? null: b
- }
- },
- TAG: function(e, a) {
- if ("undefined" != typeof a.getElementsByTagName) return a.getElementsByTagName(e[1])
- }
- },
- preFilter: {
- CLASS: function(e, a, b, d, c, h) {
- e = " " + e[1].replace(ua, "") + " ";
- if (h) return e;
- for (var h = 0,
- g; null != (g = a[h]); h++) g && (c ^ (g.className && 0 <= (" " + g.className + " ").replace(/[\t\n\r]/g, " ").indexOf(e)) ? b || d.push(g) : b && (a[h] = !1));
- return ! 1
- },
- ID: function(e) {
- return e[1].replace(ua, "")
- },
- TAG: function(e) {
- return e[1].replace(ua, "").toLowerCase()
- },
- CHILD: function(e) {
- if ("nth" === e[1]) {
- e[2] || A.error(e[0]);
- e[2] = e[2].replace(/^\+|\s*/g, "");
- var a = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even" === e[2] && "2n" || "odd" === e[2] && "2n+1" || !/\D/.test(e[2]) && "0n+" + e[2] || e[2]);
- e[2] = a[1] + (a[2] || 1) - 0;
- e[3] = a[3] - 0
- } else e[2] && A.error(e[0]);
- e[0] = eb++;
- return e
- },
- ATTR: function(e, a, b, d, c, h) {
- a = e[1] = e[1].replace(ua, ""); ! h && H.attrMap[a] && (e[1] = H.attrMap[a]);
- e[4] = (e[4] || e[5] || "").replace(ua, "");
- "~=" === e[2] && (e[4] = " " + e[4] + " ");
- return e
- },
- PSEUDO: function(e, a, b, d, c) {
- if ("not" === e[1]) if (1 < (db.exec(e[3]) || "").length || /^\w/.test(e[3])) e[3] = A(e[3], null, null, a);
- else return e = A.filter(e[3], a, b, 1 ^ c),
- b || d.push.apply(d, e),
- !1;
- else if (H.match.POS.test(e[0]) || H.match.CHILD.test(e[0])) return ! 0;
- return e
- },
- POS: function(e) {
- e.unshift(!0);
- return e
- }
- },
- filters: {
- enabled: function(e) {
- return ! 1 === e.disabled && "hidden" !== e.type
- },
- disabled: function(e) {
- return ! 0 === e.disabled
- },
- checked: function(e) {
- return ! 0 === e.checked
- },
- selected: function(e) {
- e.parentNode && e.parentNode.selectedIndex;
- return ! 0 === e.selected
- },
- parent: function(e) {
- return !! e.firstChild
- },
- empty: function(e) {
- return ! e.firstChild
- },
- has: function(e, a, b) {
- return !! A(b[3], e).length
- },
- header: function(e) {
- return /h\d/i.test(e.nodeName)
- },
- text: function(e) {
- var a = e.getAttribute("type"),
- b = e.type;
- return "input" === e.nodeName.toLowerCase() && "text" === b && (a === b || null === a)
- },
- radio: function(e) {
- return "input" === e.nodeName.toLowerCase() && "radio" === e.type
- },
- checkbox: function(e) {
- return "input" === e.nodeName.toLowerCase() && "checkbox" === e.type
- },
- file: function(e) {
- return "input" === e.nodeName.toLowerCase() && "file" === e.type
- },
- password: function(e) {
- return "input" === e.nodeName.toLowerCase() && "password" === e.type
- },
- submit: function(e) {
- var a = e.nodeName.toLowerCase();
- return ("input" === a || "button" === a) && "submit" === e.type
- },
- image: function(e) {
- return "input" === e.nodeName.toLowerCase() && "image" === e.type
- },
- reset: function(e) {
- var a = e.nodeName.toLowerCase();
- return ("input" === a || "button" === a) && "reset" === e.type
- },
- button: function(e) {
- var a = e.nodeName.toLowerCase();
- return "input" === a && "button" === e.type || "button" === a
- },
- input: function(e) {
- return /input|select|textarea|button/i.test(e.nodeName)
- },
- focus: function(e) {
- return e === e.ownerDocument.activeElement
- }
- },
- setFilters: {
- first: function(e, a) {
- return 0 === a
- },
- last: function(a, b, d, c) {
- return b === c.length - 1
- },
- even: function(a, b) {
- return 0 === b % 2
- },
- odd: function(a, b) {
- return 1 === b % 2
- },
- lt: function(a, b, d) {
- return b < d[3] - 0
- },
- gt: function(a, b, d) {
- return b > d[3] - 0
- },
- nth: function(a, b, d) {
- return d[3] - 0 === b
- },
- eq: function(a, b, d) {
- return d[3] - 0 === b
- }
- },
- filter: {
- PSEUDO: function(a, b, d, c) {
- var h = b[1],
- g = H.filters[h];
- if (g) return g(a, d, b, c);
- if ("contains" === h) return 0 <= (a.textContent || a.innerText || fb([a]) || "").indexOf(b[3]);
- if ("not" === h) {
- b = b[3];
- d = 0;
- for (c = b.length; d < c; d++) if (b[d] === a) return ! 1;
- return ! 0
- }
- A.error(h)
- },
- CHILD: function(a, b) {
- var d, c, h, g, l, f;
- d = b[1];
- f = a;
- switch (d) {
- case "only":
- case "first":
- for (; f = f.previousSibling;) if (1 === f.nodeType) return ! 1;
- if ("first" === d) return ! 0;
- f = a;
- case "last":
- for (; f = f.nextSibling;) if (1 === f.nodeType) return ! 1;
- return ! 0;
- case "nth":
- d = b[2];
- c = b[3];
- if (1 === d && 0 === c) return ! 0;
- h = b[0];
- if ((g = a.parentNode) && (g[ta] !== h || !a.nodeIndex)) {
- l = 0;
- for (f = g.firstChild; f; f = f.nextSibling) 1 === f.nodeType && (f.nodeIndex = ++l);
- g[ta] = h
- }
- f = a.nodeIndex - c;
- return 0 === d ? 0 === f: 0 === f % d && 0 <= f / d
- }
- },
- ID: function(a, b) {
- return 1 === a.nodeType && a.getAttribute("id") === b
- },
- TAG: function(a, b) {
- return "*" === b && 1 === a.nodeType || !!a.nodeName && a.nodeName.toLowerCase() === b
- },
- CLASS: function(a, b) {
- return - 1 < (" " + (a.className || a.getAttribute("class")) + " ").indexOf(b)
- },
- ATTR: function(a, b) {
- var d = b[1],
- d = A.attr ? A.attr(a, d) : H.attrHandle[d] ? H.attrHandle[d](a) : null != a[d] ? a[d] : a.getAttribute(d),
- c = d + "",
- h = b[2],
- g = b[4];
- return null == d ? "!=" === h: !h && A.attr ? null != d: "=" === h ? c === g: "*=" === h ? 0 <= c.indexOf(g) : "~=" === h ? 0 <= (" " + c + " ").indexOf(g) : g ? "!=" === h ? c !== g: "^=" === h ? 0 === c.indexOf(g) : "$=" === h ? c.substr(c.length - g.length) === g: "|=" === h ? c === g || c.substr(0, g.length + 1) === g + "-": !1 : c && !1 !== d
- },
- POS: function(a, b, d, c) {
- var h = H.setFilters[b[2]];
- if (h) return h(a, d, b, c)
- }
- }
- },
- rc = H.match.POS,
- sc = function(a, b) {
- return "\\" + (b - 0 + 1)
- },
- Ba;
- for (Ba in H.match) H.match[Ba] = RegExp(H.match[Ba].source + /(?![^\[]*\])(?![^\(]*\))/.source),
- H.leftMatch[Ba] = RegExp(/(^(?:.|\r|\n)*?)/.source + H.match[Ba].source.replace(/\\(\d+)/g, sc));
- var ca = function(a, b) {
- a = Array.prototype.slice.call(a, 0);
- return b ? (b.push.apply(b, a), b) : a
- };
- try {
- Array.prototype.slice.call(o.documentElement.childNodes, 0)[0].nodeType
- } catch(ad) {
- ca = function(a, b) {
- var d = 0,
- c = b || [];
- if ("[object Array]" === zb.call(a)) Array.prototype.push.apply(c, a);
- else if ("number" == typeof a.length) for (var h = a.length; d < h; d++) c.push(a[d]);
- else for (; a[d]; d++) c.push(a[d]);
- return c
- }
- }
- var Pa, Ca;
- o.documentElement.compareDocumentPosition ? Pa = function(a, b) {
- return a === b ? (Na = !0, 0) : !a.compareDocumentPosition || !b.compareDocumentPosition ? a.compareDocumentPosition ? -1 : 1 : a.compareDocumentPosition(b) & 4 ? -1 : 1
- }: (Pa = function(a, b) {
- if (a === b) return Na = !0,
- 0;
- if (a.sourceIndex && b.sourceIndex) return a.sourceIndex - b.sourceIndex;
- var d, c, h = [],
- g = [];
- d = a.parentNode;
- c = b.parentNode;
- var l = d;
- if (d === c) return Ca(a, b);
- if (!d) return - 1;
- if (!c) return 1;
- for (; l;) h.unshift(l),
- l = l.parentNode;
- for (l = c; l;) g.unshift(l),
- l = l.parentNode;
- d = h.length;
- c = g.length;
- for (l = 0; l < d && l < c; l++) if (h[l] !== g[l]) return Ca(h[l], g[l]);
- return l === d ? Ca(a, g[l], -1) : Ca(h[l], b, 1)
- },
- Ca = function(a, b, d) {
- if (a === b) return d;
- for (a = a.nextSibling; a;) {
- if (a === b) return - 1;
- a = a.nextSibling
- }
- return 1
- });
- var Qa = o.createElement("div"),
- Cb = "script" + (new Date).getTime(),
- Ra = o.documentElement;
- Qa.innerHTML = "<a name='" + Cb + "'/>";
- Ra.insertBefore(Qa, Ra.firstChild);
- o.getElementById(Cb) && (H.find.ID = function(a, b, d) {
- if ("undefined" != typeof b.getElementById && !d) return (b = b.getElementById(a[1])) ? b.id === a[1] || "undefined" != typeof b.getAttributeNode && b.getAttributeNode("id").nodeValue === a[1] ? [b] : m: []
- },
- H.filter.ID = function(a, b) {
- var d = "undefined" != typeof a.getAttributeNode && a.getAttributeNode("id");
- return 1 === a.nodeType && d && d.nodeValue === b
- });
- Ra.removeChild(Qa);
- var Ra = Qa = null,
- ka = o.createElement("div");
- ka.appendChild(o.createComment(""));
- 0 < ka.getElementsByTagName("*").length && (H.find.TAG = function(a, b) {
- var d = b.getElementsByTagName(a[1]);
- if ("*" === a[1]) {
- for (var c = [], h = 0; d[h]; h++) 1 === d[h].nodeType && c.push(d[h]);
- d = c
- }
- return d
- });
- ka.innerHTML = "<a href='#'></a>";
- ka.firstChild && "undefined" != typeof ka.firstChild.getAttribute && "#" !== ka.firstChild.getAttribute("href") && (H.attrHandle.href = function(a) {
- return a.getAttribute("href", 2)
- });
- ka = null;
- if (o.querySelectorAll) {
- var gb = A,
- Sa = o.createElement("div");
- Sa.innerHTML = "<p class='TEST'></p>";
- if (!Sa.querySelectorAll || 0 !== Sa.querySelectorAll(".TEST").length) {
- var A = function(a, b, d, c) {
- b = b || o;
- if (!c && !A.isXML(b)) {
- var h = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(a);
- if (h && (1 === b.nodeType || 9 === b.nodeType)) {
- if (h[1]) return ca(b.getElementsByTagName(a), d);
- if (h[2] && H.find.CLASS && b.getElementsByClassName) return ca(b.getElementsByClassName(h[2]), d)
- }
- if (9 === b.nodeType) {
- if ("body" === a && b.body) return ca([b.body], d);
- if (h && h[3]) {
- var g = b.getElementById(h[3]);
- if (!g || !g.parentNode) return ca([], d);
- if (g.id === h[3]) return ca([g], d)
- }
- try {
- return ca(b.querySelectorAll(a), d)
- } catch(l) {}
- } else if (1 === b.nodeType && "object" !== b.nodeName.toLowerCase()) {
- var h = b,
- f = (g = b.getAttribute("id")) || "__sizzle__",
- i = b.parentNode,
- t = /^\s*[+~]/.test(a);
- g ? f = f.replace(/'/g, "\\$&") : b.setAttribute("id", f);
- t && i && (b = b.parentNode);
- try {
- if (!t || i) return ca(b.querySelectorAll("[id='" + f + "'] " + a), d)
- } catch(j) {} finally {
- g || h.removeAttribute("id")
- }
- }
- }
- return gb(a, b, d, c)
- },
- hb;
- for (hb in gb) A[hb] = gb[hb];
- Sa = null
- }
- }
- var Ta = o.documentElement,
- Ua = Ta.matchesSelector || Ta.mozMatchesSelector || Ta.webkitMatchesSelector || Ta.msMatchesSelector;
- if (Ua) {
- var tc = !Ua.call(o.createElement("div"), "div"),
- Db = !1;
- try {
- Ua.call(o.documentElement, "[test!='']:sizzle")
- } catch(bd) {
- Db = !0
- }
- A.matchesSelector = function(a, b) {
- b = b.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
- if (!A.isXML(a)) try {
- if (Db || !H.match.PSEUDO.test(b) && !/!=/.test(b)) {
- var d = Ua.call(a, b);
- if (d || !tc || a.document && 11 !== a.document.nodeType) return d
- }
- } catch(c) {}
- return 0 < A(b, null, null, [a]).length
- }
- }
- var va = o.createElement("div");
- va.innerHTML = "<div class='test e'></div><div class='test'></div>";
- va.getElementsByClassName && 0 !== va.getElementsByClassName("e").length && (va.lastChild.className = "e", 1 !== va.getElementsByClassName("e").length && (H.order.splice(1, 0, "CLASS"), H.find.CLASS = function(a, b, d) {
- if ("undefined" != typeof b.getElementsByClassName && !d) return b.getElementsByClassName(a[1])
- },
- va = null));
- o.documentElement.contains ? A.contains = function(a, b) {
- return a !== b && (a.contains ? a.contains(b) : true)
- }: o.documentElement.compareDocumentPosition ? A.contains = function(a, b) {
- return !! (a.compareDocumentPosition(b) & 16)
- }: A.contains = function() {
- return false
- };
- A.isXML = function(a) {
- return (a = (a ? a.ownerDocument || a: 0).documentElement) ? a.nodeName !== "HTML": false
- };
- var Bb = function(a, b, d) {
- for (var c, h = [], g = "", b = b.nodeType ? [b] : b; c = H.match.PSEUDO.exec(a);) {
- g = g + c[0];
- a = a.replace(H.match.PSEUDO, "")
- }
- a = H.relative[a] ? a + "*": a;
- c = 0;
- for (var l = b.length; c < l; c++) A(a, b[c], h, d);
- return A.filter(g, h)
- };
- A.attr = c.attr;
- A.selectors.attrMap = {};
- c.find = A;
- c.expr = A.selectors;
- c.expr[":"] = c.expr.filters;
- c.unique = A.uniqueSort;
- c.text = A.getText;
- c.isXMLDoc = A.isXML;
- c.contains = A.contains;
- var uc = /Until$/,
- vc = /^(?:parents|prevUntil|prevAll)/,
- wc = /,/,
- Wb = /^.[^:#\[\.,]*$/,
- xc = Array.prototype.slice,
- Eb = c.expr.match.POS,
- yc = {
- children: !0,
- contents: !0,
- next: !0,
- prev: !0
- };
- c.fn.extend({
- find: function(a) {
- var b = this,
- d, h;
- if (typeof a != "string") return c(a).filter(function() {
- d = 0;
- for (h = b.length; d < h; d++) if (c.contains(b[d], this)) return true
- });
- var g = this.pushStack("", "find", a),
- l,
- f,
- i;
- d = 0;
- for (h = this.length; d < h; d++) {
- l = g.length;
- c.find(a, this[d], g);
- if (d > 0) for (f = l; f < g.length; f++) for (i = 0; i < l; i++) if (g[i] === g[f]) {
- g.splice(f--, 1);
- break
- }
- }
- return g
- },
- has: function(a) {
- var b = c(a);
- return this.filter(function() {
- for (var a = 0,
- e = b.length; a < e; a++) if (c.contains(this, b[a])) return true
- })
- },
- not: function(a) {
- return this.pushStack(aa(this, a, false), "not", a)
- },
- filter: function(a) {
- return this.pushStack(aa(this, a, true), "filter", a)
- },
- is: function(a) {
- return !! a && (typeof a == "string" ? Eb.test(a) ? c(a, this.context).index(this[0]) >= 0 : c.filter(a, this).length > 0 : this.filter(a).length > 0)
- },
- closest: function(a, b) {
- var d = [],
- h,
- g,
- l = this[0];
- if (c.isArray(a)) {
- for (g = 1; l && l.ownerDocument && l !== b;) {
- for (h = 0; h < a.length; h++) c(l).is(a[h]) && d.push({
- selector: a[h],
- elem: l,
- level: g
- });
- l = l.parentNode;
- g++
- }
- return d
- }
- var f = Eb.test(a) || typeof a != "string" ? c(a, b || this.context) : 0;
- h = 0;
- for (g = this.length; h < g; h++) for (l = this[h]; l;) {
- if (f ? f.index(l) > -1 : c.find.matchesSelector(l, a)) {
- d.push(l);
- break
- }
- l = l.parentNode;
- if (!l || !l.ownerDocument || l === b || l.nodeType === 11) break
- }
- d = d.length > 1 ? c.unique(d) : d;
- return this.pushStack(d, "closest", a)
- },
- index: function(a) {
- return ! a ? this[0] && this[0].parentNode ? this.prevAll().length: -1 : typeof a == "string" ? c.inArray(this[0], c(a)) : c.inArray(a.jquery ? a[0] : a, this)
- },
- add: function(a, b) {
- var d = typeof a == "string" ? c(a, b) : c.makeArray(a && a.nodeType ? [a] : a),
- h = c.merge(this.get(), d);
- return this.pushStack(!d[0] || !d[0].parentNode || d[0].parentNode.nodeType === 11 || !h[0] || !h[0].parentNode || h[0].parentNode.nodeType === 11 ? h: c.unique(h))
- },
- andSelf: function() {
- return this.add(this.prevObject)
- }
- });
- c.each({
- parent: function(a) {
- return (a = a.parentNode) && a.nodeType !== 11 ? a: null
- },
- parents: function(a) {
- return c.dir(a, "parentNode")
- },
- parentsUntil: function(a, b, d) {
- return c.dir(a, "parentNode", d)
- },
- next: function(a) {
- return c.nth(a, 2, "nextSibling")
- },
- prev: function(a) {
- return c.nth(a, 2, "previousSibling")
- },
- nextAll: function(a) {
- return c.dir(a, "nextSibling")
- },
- prevAll: function(a) {
- return c.dir(a, "previousSibling")
- },
- nextUntil: function(a, b, d) {
- return c.dir(a, "nextSibling", d)
- },
- prevUntil: function(a, b, d) {
- return c.dir(a, "previousSibling", d)
- },
- siblings: function(a) {
- return c.sibling(a.parentNode.firstChild, a)
- },
- children: function(a) {
- return c.sibling(a.firstChild)
- },
- contents: function(a) {
- return c.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document: c.makeArray(a.childNodes)
- }
- },
- function(a, b) {
- c.fn[a] = function(d, h) {
- var g = c.map(this, b, d),
- l = xc.call(arguments);
- uc.test(a) || (h = d);
- h && typeof h == "string" && (g = c.filter(h, g));
- g = this.length > 1 && !yc[a] ? c.unique(g) : g; (this.length > 1 || wc.test(h)) && vc.test(a) && (g = g.reverse());
- return this.pushStack(g, a, l.join(","))
- }
- });
- c.extend({
- filter: function(a, b, d) {
- d && (a = ":not(" + a + ")");
- return b.length === 1 ? c.find.matchesSelector(b[0], a) ? [b[0]] : [] : c.find.matches(a, b)
- },
- dir: function(a, b, d) {
- for (var h = [], a = a[b]; a && a.nodeType !== 9 && (d === m || a.nodeType !== 1 || !c(a).is(d));) {
- a.nodeType === 1 && h.push(a);
- a = a[b]
- }
- return h
- },
- nth: function(a, b, d) {
- for (var b = b || 1,
- c = 0; a; a = a[d]) if (a.nodeType === 1 && ++c === b) break;
- return a
- },
- sibling: function(a, b) {
- for (var d = []; a; a = a.nextSibling) a.nodeType === 1 && a !== b && d.push(a);
- return d
- }
- });
- var ob = "abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",
- zc = / jQuery\d+="(?:\d+|null)"/g,
- ib = /^\s+/,
- Fb = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
- Gb = /<([\w:]+)/,
- Ac = /<tbody/i,
- Bc = /<|&#?\w+;/,
- Cc = /<(?:script|style)/i,
- Dc = /<(?:script|object|embed|option|style)/i,
- Ec = RegExp("<(?:" + ob.replace(" ", "|") + ")", "i"),
- Hb = /checked\s*(?:[^=]|=\s*.checked.)/i,
- Fc = /\/(java|ecma)script/i,
- Vb = /^\s*<!(?:\[CDATA\[|\-\-)/,
- X = {
- option: [1, "<select multiple='multiple'>", "</select>"],
- legend: [1, "<fieldset>", "</fieldset>"],
- thead: [1, "<table>", "</table>"],
- tr: [2, "<table><tbody>", "</tbody></table>"],
- td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
- col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
- area: [1, "<map>", "</map>"],
- _default: [0, "", ""]
- },
- Gc = w(o);
- X.optgroup = X.option;
- X.tbody = X.tfoot = X.colgroup = X.caption = X.thead;
- X.th = X.td;
- c.support.htmlSerialize || (X._default = [1, "div<div>", "</div>"]);
- c.fn.extend({
- text: function(a) {
- return c.isFunction(a) ? this.each(function(b) {
- var d = c(this);
- d.text(a.call(this, b, d.text()))
- }) : typeof a != "object" && a !== m ? this.empty().append((this[0] && this[0].ownerDocument || o).createTextNode(a)) : c.text(this)
- },
- wrapAll: function(a) {
- if (c.isFunction(a)) return this.each(function(b) {
- c(this).wrapAll(a.call(this, b))
- });
- if (this[0]) {
- var b = c(a, this[0].ownerDocument).eq(0).clone(true);
- this[0].parentNode && b.insertBefore(this[0]);
- b.map(function() {
- for (var a = this; a.firstChild && a.firstChild.nodeType === 1;) a = a.firstChild;
- return a
- }).append(this)
- }
- return this
- },
- wrapInner: function(a) {
- return c.isFunction(a) ? this.each(function(b) {
- c(this).wrapInner(a.call(this, b))
- }) : this.each(function() {
- var b = c(this),
- d = b.contents();
- d.length ? d.wrapAll(a) : b.append(a)
- })
- },
- wrap: function(a) {
- return this.each(function() {
- c(this).wrapAll(a)
- })
- },
- unwrap: function() {
- return this.parent().each(function() {
- c.nodeName(this, "body") || c(this).replaceWith(this.childNodes)
- }).end()
- },
- append: function() {
- return this.domManip(arguments, true,
- function(a) {
- this.nodeType === 1 && this.appendChild(a)
- })
- },
- prepend: function() {
- return this.domManip(arguments, true,
- function(a) {
- this.nodeType === 1 && this.insertBefore(a, this.firstChild)
- })
- },
- before: function() {
- if (this[0] && this[0].parentNode) return this.domManip(arguments, false,
- function(a) {
- this.parentNode.insertBefore(a, this)
- });
- if (arguments.length) {
- var a = c(arguments[0]);
- a.push.apply(a, this.toArray());
- return this.pushStack(a, "before", arguments)
- }
- },
- after: function() {
- if (this[0] && this[0].parentNode) return this.domManip(arguments, false,
- function(a) {
- this.parentNode.insertBefore(a, this.nextSibling)
- });
- if (arguments.length) {
- var a = this.pushStack(this, "after", arguments);
- a.push.apply(a, c(arguments[0]).toArray());
- return a
- }
- },
- remove: function(a, b) {
- for (var d = 0,
- h; (h = this[d]) != null; d++) if (!a || c.filter(a, [h]).length) { ! b && h.nodeType === 1 && (c.cleanData(h.getElementsByTagName("*")), c.cleanData([h]));
- h.parentNode && h.parentNode.removeChild(h)
- }
- return this
- },
- empty: function() {
- for (var a = 0,
- b; (b = this[a]) != null; a++) for (b.nodeType === 1 && c.cleanData(b.getElementsByTagName("*")); b.firstChild;) b.removeChild(b.firstChild);
- return this
- },
- clone: function(a, b) {
- a = a == null ? false: a;
- b = b == null ? a: b;
- return this.map(function() {
- return c.clone(this, a, b)
- })
- },
- html: function(a) {
- if (a === m) return this[0] && this[0].nodeType === 1 ? this[0].innerHTML.replace(zc, "") : null;
- if (typeof a == "string" && !Cc.test(a) && (c.support.leadingWhitespace || !ib.test(a)) && !X[(Gb.exec(a) || ["", ""])[1].toLowerCase()]) {
- a = a.replace(Fb, "<$1></$2>");
- try {
- for (var b = 0,
- d = this.length; b < d; b++) this[b].nodeType === 1 && (c.cleanData(this[b].getElementsByTagName("*")), this[b].innerHTML = a)
- } catch(h) {
- this.empty().append(a)
- }
- } else c.isFunction(a) ? this.each(function(b) {
- var d = c(this);
- d.html(a.call(this, b, d.html()))
- }) : this.empty().append(a);
- return this
- },
- replaceWith: function(a) {
- if (this[0] && this[0].parentNode) {
- if (c.isFunction(a)) return this.each(function(b) {
- var d = c(this),
- h = d.html();
- d.replaceWith(a.call(this, b, h))
- });
- typeof a != "string" && (a = c(a).detach());
- return this.each(function() {
- var b = this.nextSibling,
- d = this.parentNode;
- c(this).remove();
- b ? c(b).before(a) : c(d).append(a)
- })
- }
- return this.length ? this.pushStack(c(c.isFunction(a) ? a() : a), "replaceWith", a) : this
- },
- detach: function(a) {
- return this.remove(a, true)
- },
- domManip: function(a, b, d) {
- var h, g, l, f = a[0],
- i = [];
- if (!c.support.checkClone && arguments.length === 3 && typeof f == "string" && Hb.test(f)) return this.each(function() {
- c(this).domManip(a, b, d, true)
- });
- if (c.isFunction(f)) return this.each(function(h) {
- var g = c(this);
- a[0] = f.call(this, h, b ? g.html() : m);
- g.domManip(a, b, d)
- });
- if (this[0]) {
- l = f && f.parentNode;
- c.support.parentNode && l && l.nodeType === 11 && l.childNodes.length === this.length ? h = {
- fragment: l
- }: h = c.buildFragment(a, this, i);
- l = h.fragment;
- l.childNodes.length === 1 ? g = l = l.firstChild: g = l.firstChild;
- if (g) {
- b = b && c.nodeName(g, "tr");
- g = 0;
- for (var t = this.length,
- j = t - 1; g < t; g++) d.call(b ? c.nodeName(this[g], "table") ? this[g].getElementsByTagName("tbody")[0] || this[g].appendChild(this[g].ownerDocument.createElement("tbody")) : this[g] : this[g], h.cacheable || t > 1 && g < j ? c.clone(l, true, true) : l)
- }
- i.length && c.each(i, Y)
- }
- return this
- }
- });
- c.buildFragment = function(a, b, d) {
- var h, g, l, f, i = a[0];
- b && b[0] && (f = b[0].ownerDocument || b[0]);
- f.createDocumentFragment || (f = o);
- a.length === 1 && typeof i == "string" && i.length < 512 && f === o && i.charAt(0) === "<" && !Dc.test(i) && (c.support.checkClone || !Hb.test(i)) && !c.support.unknownElems && Ec.test(i) && (g = true, l = c.fragments[i], l && l !== 1 && (h = l));
- h || (h = f.createDocumentFragment(), c.clean(a, f, h, d));
- g && (c.fragments[i] = l ? h: 1);
- return {
- fragment: h,
- cacheable: g
- }
- };
- c.fragments = {};
- c.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
- },
- function(a, b) {
- c.fn[a] = function(d) {
- var h = [],
- d = c(d),
- g = this.length === 1 && this[0].parentNode;
- if (g && g.nodeType === 11 && g.childNodes.length === 1 && d.length === 1) {
- d[b](this[0]);
- return this
- }
- for (var g = 0,
- l = d.length; g < l; g++) {
- var f = (g > 0 ? this.clone(true) : this).get();
- c(d[g])[b](f);
- h = h.concat(f)
- }
- return this.pushStack(h, a, d.selector)
- }
- });
- c.extend({
- clone: function(a, b, d) {
- var h = a.cloneNode(true),
- g,
- l,
- f;
- if ((!c.support.noCloneEvent || !c.support.noCloneChecked) && (a.nodeType === 1 || a.nodeType === 11) && !c.isXMLDoc(a)) {
- V(a, h);
- g = C(a);
- l = C(h);
- for (f = 0; g[f]; ++f) l[f] && V(g[f], l[f])
- }
- if (b) {
- D(a, h);
- if (d) {
- g = C(a);
- l = C(h);
- for (f = 0; g[f]; ++f) D(g[f], l[f])
- }
- }
- return h
- },
- clean: function(a, b, d, h) {
- b = b || o;
- typeof b.createElement == "undefined" && (b = b.ownerDocument || b[0] && b[0].ownerDocument || o);
- for (var g = [], l, f = 0, i; (i = a[f]) != null; f++) {
- typeof i == "number" && (i = i + "");
- if (i) {
- if (typeof i == "string") if (Bc.test(i)) {
- i = i.replace(Fb, "<$1></$2>");
- l = (Gb.exec(i) || ["", ""])[1].toLowerCase();
- var t = X[l] || X._default,
- j = t[0],
- k = b.createElement("div");
- b === o ? Gc.appendChild(k) : w(b).appendChild(k);
- for (k.innerHTML = t[1] + i + t[2]; j--;) k = k.lastChild;
- if (!c.support.tbody) {
- j = Ac.test(i);
- t = l === "table" && !j ? k.firstChild && k.firstChild.childNodes: t[1] === "<table>" && !j ? k.childNodes: [];
- for (l = t.length - 1; l >= 0; --l) c.nodeName(t[l], "tbody") && !t[l].childNodes.length && t[l].parentNode.removeChild(t[l])
- } ! c.support.leadingWhitespace && ib.test(i) && k.insertBefore(b.createTextNode(ib.exec(i)[0]), k.firstChild);
- i = k.childNodes
- } else i = b.createTextNode(i);
- var z;
- if (!c.support.appendChecked) if (i[0] && typeof(z = i.length) == "number") for (l = 0; l < z; l++) ea(i[l]);
- else ea(i);
- i.nodeType ? g.push(i) : g = c.merge(g, i)
- }
- }
- if (d) {
- a = function(a) {
- return ! a.type || Fc.test(a.type)
- };
- for (f = 0; g[f]; f++) if (h && c.nodeName(g[f], "script") && (!g[f].type || g[f].type.toLowerCase() === "text/javascript")) h.push(g[f].parentNode ? g[f].parentNode.removeChild(g[f]) : g[f]);
- else {
- if (g[f].nodeType === 1) {
- b = c.grep(g[f].getElementsByTagName("script"), a);
- g.splice.apply(g, [f + 1, 0].concat(b))
- }
- d.appendChild(g[f])
- }
- }
- return g
- },
- cleanData: function(a) {
- for (var b, d, h = c.cache,
- g = c.event.special,
- l = c.support.deleteExpando,
- f = 0,
- i; (i = a[f]) != null; f++) if (!i.nodeName || !c.noData[i.nodeName.toLowerCase()]) if (d = i[c.expando]) {
- if ((b = h[d]) && b.events) {
- for (var t in b.events) g[t] ? c.event.remove(i, t) : c.removeEvent(i, t, b.handle);
- b.handle && (b.handle.elem = null)
- }
- l ? delete i[c.expando] : i.removeAttribute && i.removeAttribute(c.expando);
- delete h[d]
- }
- }
- });
- var jb = /alpha\([^)]*\)/i,
- Hc = /opacity=([^)]*)/,
- Ic = /([A-Z]|^ms)/g,
- Ib = /^-?\d+(?:px)?$/i,
- Jc = /^-?\d/,
- Kc = /^([\-+])=([\-+.\de]+)/,
- Lc = {
- position: "absolute",
- visibility: "hidden",
- display: "block"
- },
- Tb = ["Left", "Right"],
- Ub = ["Top", "Bottom"],
- oa,
- Jb,
- Kb;
- c.fn.css = function(a, b) {
- return arguments.length === 2 && b === m ? this: c.access(this, a, b, true,
- function(a, b, d) {
- return d !== m ? c.style(a, b, d) : c.css(a, b)
- })
- };
- c.extend({
- cssHooks: {
- opacity: {
- get: function(a, b) {
- if (b) {
- var d = oa(a, "opacity", "opacity");
- return d === "" ? "1": d
- }
- return a.style.opacity
- }
- }
- },
- cssNumber: {
- fillOpacity: !0,
- fontWeight: !0,
- lineHeight: !0,
- opacity: !0,
- orphans: !0,
- widows: !0,
- zIndex: !0,
- zoom: !0
- },
- cssProps: {
- "float": c.support.cssFloat ? "cssFloat": "styleFloat"
- },
- style: function(a, b, d, h) {
- if (a && a.nodeType !== 3 && a.nodeType !== 8 && a.style) {
- var g, l = c.camelCase(b),
- f = a.style,
- i = c.cssHooks[l],
- b = c.cssProps[l] || l;
- if (d === m) return i && "get" in i && (g = i.get(a, false, h)) !== m ? g: f[b];
- h = typeof d;
- h === "string" && (g = Kc.exec(d)) && (d = +(g[1] + 1) * +g[2] + parseFloat(c.css(a, b)), h = "number");
- if (! (d == null || h === "number" && isNaN(d))) {
- h === "number" && !c.cssNumber[l] && (d = d + "px");
- if (!i || !("set" in i) || (d = i.set(a, d)) !== m) try {
- f[b] = d
- } catch(t) {}
- }
- }
- },
- css: function(a, b, d) {
- var h, g, b = c.camelCase(b);
- g = c.cssHooks[b];
- b = c.cssProps[b] || b;
- b === "cssFloat" && (b = "float");
- if (g && "get" in g && (h = g.get(a, true, d)) !== m) return h;
- if (oa) return oa(a, b)
- },
- swap: function(a, b, d) {
- var c = {},
- h;
- for (h in b) {
- c[h] = a.style[h];
- a.style[h] = b[h]
- }
- d.call(a);
- for (h in b) a.style[h] = c[h]
- }
- });
- c.curCSS = c.css;
- c.each(["height", "width"],
- function(a, b) {
- c.cssHooks[b] = {
- get: function(a, d, e) {
- var h;
- if (d) {
- if (a.offsetWidth !== 0) return Q(a, b, e);
- c.swap(a, Lc,
- function() {
- h = Q(a, b, e)
- });
- return h
- }
- },
- set: function(a, b) {
- if (!Ib.test(b)) return b;
- b = parseFloat(b);
- if (b >= 0) return b + "px"
- }
- }
- });
- c.support.opacity || (c.cssHooks.opacity = {
- get: function(a, b) {
- return Hc.test((b && a.currentStyle ? a.currentStyle.filter: a.style.filter) || "") ? parseFloat(RegExp.$1) / 100 + "": b ? "1": ""
- },
- set: function(a, b) {
- var d = a.style,
- h = a.currentStyle,
- g = c.isNumeric(b) ? "alpha(opacity=" + b * 100 + ")": "",
- l = h && h.filter || d.filter || "";
- d.zoom = 1;
- if (b >= 1 && c.trim(l.replace(jb, "")) === "") {
- d.removeAttribute("filter");
- if (h && !h.filter) return
- }
- d.filter = jb.test(l) ? l.replace(jb, g) : l + " " + g
- }
- });
- c(function() {
- c.support.reliableMarginRight || (c.cssHooks.marginRight = {
- get: function(a, b) {
- var d;
- c.swap(a, {
- display: "inline-block"
- },
- function() {
- b ? d = oa(a, "margin-right", "marginRight") : d = a.style.marginRight
- });
- return d
- }
- })
- });
- o.defaultView && o.defaultView.getComputedStyle && (Jb = function(a, b) {
- var d, h, b = b.replace(Ic, "-$1").toLowerCase();
- if (! (h = a.ownerDocument.defaultView)) return m;
- if (h = h.getComputedStyle(a, null)) {
- d = h.getPropertyValue(b);
- d === "" && !c.contains(a.ownerDocument.documentElement, a) && (d = c.style(a, b))
- }
- return d
- });
- o.documentElement.currentStyle && (Kb = function(a, b) {
- var d, c, h, g = a.currentStyle && a.currentStyle[b],
- l = a.style;
- g === null && l && (h = l[b]) && (g = h); ! Ib.test(g) && Jc.test(g) && (d = l.left, c = a.runtimeStyle && a.runtimeStyle.left, c && (a.runtimeStyle.left = a.currentStyle.left), l.left = b === "fontSize" ? "1em": g || 0, g = l.pixelLeft + "px", l.left = d, c && (a.runtimeStyle.left = c));
- return g === "" ? "auto": g
- });
- oa = Jb || Kb;
- c.expr && c.expr.filters && (c.expr.filters.hidden = function(a) {
- var b = a.offsetHeight;
- return a.offsetWidth === 0 && b === 0 || !c.support.reliableHiddenOffsets && (a.style && a.style.display || c.css(a, "display")) === "none"
- },
- c.expr.filters.visible = function(a) {
- return ! c.expr.filters.hidden(a)
- });
- var Mc = /%20/g,
- Sb = /\[\]$/,
- Lb = /\r?\n/g,
- Nc = /#.*$/,
- Oc = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
- Pc = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
- Qc = /^(?:GET|HEAD)$/,
- Rc = /^\/\//,
- Mb = /\?/,
- Sc = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
- Tc = /^(?:select|textarea)/i,
- nb = /\s+/,
- Uc = /([?&])_=[^&]*/,
- Nb = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
- Ob = c.fn.load,
- Ya = {},
- Pb = {},
- la, ma, Qb = ["*/"] + ["*"];
- try {
- la = F.href
- } catch(cd) {
- la = o.createElement("a"),
- la.href = "",
- la = la.href
- }
- ma = Nb.exec(la.toLowerCase()) || [];
- c.fn.extend({
- load: function(a, b, d) {
- if (typeof a != "string" && Ob) return Ob.apply(this, arguments);
- if (!this.length) return this;
- var h = a.indexOf(" ");
- if (h >= 0) var g = a.slice(h, a.length),
- a = a.slice(0, h);
- h = "GET";
- b && (c.isFunction(b) ? (d = b, b = m) : typeof b == "object" && (b = c.param(b, c.ajaxSettings.traditional), h = "POST"));
- var l = this;
- c.ajax({
- url: a,
- type: h,
- dataType: "html",
- data: b,
- complete: function(a, b, e) {
- e = a.responseText;
- a.isResolved() && (a.done(function(a) {
- e = a
- }), l.html(g ? c("<div>").append(e.replace(Sc, "")).find(g) : e));
- d && l.each(d, [e, b, a])
- }
- });
- return this
- },
- serialize: function() {
- return c.param(this.serializeArray())
- },
- serializeArray: function() {
- return this.map(function() {
- return this.elements ? c.makeArray(this.elements) : this
- }).filter(function() {
- return this.name && !this.disabled && (this.checked || Tc.test(this.nodeName) || Pc.test(this.type))
- }).map(function(a, b) {
- var d = c(this).val();
- return d == null ? null: c.isArray(d) ? c.map(d,
- function(a) {
- return {
- name: b.name,
- value: a.replace(Lb, "\r\n")
- }
- }) : {
- name: b.name,
- value: d.replace(Lb, "\r\n")
- }
- }).get()
- }
- });
- c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
- function(a, b) {
- c.fn[b] = function(a) {
- return this.bind(b, a)
- }
- });
- c.each(["get", "post"],
- function(a, b) {
- c[b] = function(a, d, e, h) {
- c.isFunction(d) && (h = h || e, e = d, d = m);
- return c.ajax({
- type: b,
- url: a,
- data: d,
- success: e,
- dataType: h
- })
- }
- });
- c.extend({
- getScript: function(a, b) {
- return c.get(a, m, b, "script")
- },
- getJSON: function(a, b, d) {
- return c.get(a, b, d, "json")
- },
- ajaxSetup: function(a, b) {
- b ? L(a, c.ajaxSettings) : (b = a, a = c.ajaxSettings);
- L(a, b);
- return a
- },
- ajaxSettings: {
- url: la,
- isLocal: /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(ma[1]),
- global: !0,
- type: "GET",
- contentType: "application/x-www-form-urlencoded",
- processData: !0,
- async: !0,
- accepts: {
- xml: "application/xml, text/xml",
- html: "text/html",
- text: "text/plain",
- json: "application/json, text/javascript",
- "*": Qb
- },
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
- responseFields: {
- xml: "responseXML",
- text: "responseText"
- },
- converters: {
- "* text": j.String,
- "text html": !0,
- "text json": c.parseJSON,
- "text xml": c.parseXML
- },
- flatOptions: {
- context: !0,
- url: !0
- }
- },
- ajaxPrefilter: K(Ya),
- ajaxTransport: K(Pb),
- ajax: function(a, b) {
- function d(a, b, e, n) {
- if (r !== 2) {
- r = 2;
- ya && clearTimeout(ya);
- o = m;
- p = n || "";
- I.readyState = a > 0 ? 4 : 0;
- var k, z, v, n = b;
- if (e) {
- var xa = h,
- q = I,
- s = xa.contents,
- u = xa.dataTypes,
- K = xa.responseFields,
- A, w, x, Q;
- for (w in K) w in e && (q[K[w]] = e[w]);
- for (; u[0] === "*";) {
- u.shift();
- A === m && (A = xa.mimeType || q.getResponseHeader("content-type"))
- }
- if (A) for (w in s) if (s[w] && s[w].test(A)) {
- u.unshift(w);
- break
- }
- if (u[0] in e) x = u[0];
- else {
- for (w in e) {
- if (!u[0] || xa.converters[w + " " + u[0]]) {
- x = w;
- break
- }
- Q || (Q = w)
- }
- x = x || Q
- }
- if (x) {
- x !== u[0] && u.unshift(x);
- e = e[x]
- } else e = void 0
- } else e = m;
- if (a >= 200 && a < 300 || a === 304) {
- if (h.ifModified) {
- if (A = I.getResponseHeader("Last-Modified")) c.lastModified[j] = A;
- if (A = I.getResponseHeader("Etag")) c.etag[j] = A
- }
- if (a === 304) {
- n = "notmodified";
- k = true
- } else try {
- A = h;
- A.dataFilter && (e = A.dataFilter(e, A.dataType));
- var C = A.dataTypes;
- w = {};
- var G, fa, H = C.length,
- B, E = C[0],
- y,
- pa,
- D,
- ga,
- ha;
- for (G = 1; G < H; G++) {
- if (G === 1) for (fa in A.converters) typeof fa == "string" && (w[fa.toLowerCase()] = A.converters[fa]);
- y = E;
- E = C[G];
- if (E === "*") E = y;
- else if (y !== "*" && y !== E) {
- pa = y + " " + E;
- D = w[pa] || w["* " + E];
- if (!D) {
- ha = m;
- for (ga in w) {
- B = ga.split(" ");
- if (B[0] === y || B[0] === "*") if (ha = w[B[1] + " " + E]) {
- ga = w[ga];
- ga === true ? D = ha: ha === true && (D = ga);
- break
- }
- }
- } ! D && !ha && c.error("No conversion from " + pa.replace(" ", " to "));
- D !== true && (e = D ? D(e) : ha(ga(e)))
- }
- }
- z = e;
- n = "success";
- k = true
- } catch(Y) {
- n = "parsererror";
- v = Y
- }
- } else {
- v = n;
- if (!n || a) {
- n = "error";
- a < 0 && (a = 0)
- }
- }
- I.status = a;
- I.statusText = "" + (b || n);
- k ? f.resolveWith(g, [z, n, I]) : f.rejectWith(g, [I, n, v]);
- I.statusCode(t);
- t = m;
- ja && l.trigger("ajax" + (k ? "Success": "Error"), [I, h, k ? z: v]);
- i.fireWith(g, [I, n]);
- ja && (l.trigger("ajaxComplete", [I, h]), --c.active || c.event.trigger("ajaxStop"))
- }
- }
- typeof a == "object" && (b = a, a = m);
- var b = b || {},
- h = c.ajaxSetup({},
- b),
- g = h.context || h,
- l = g !== h && (g.nodeType || g instanceof c) ? c(g) : c.event,
- f = c.Deferred(),
- i = c.Callbacks("once memory"),
- t = h.statusCode || {},
- j,
- k = {},
- z = {},
- p,
- v,
- o,
- ya,
- q,
- r = 0,
- ja,
- s,
- I = {
- readyState: 0,
- setRequestHeader: function(a, b) {
- if (!r) {
- var d = a.toLowerCase(),
- a = z[d] = z[d] || a;
- k[a] = b
- }
- return this
- },
- getAllResponseHeaders: function() {
- return r === 2 ? p: null
- },
- getResponseHeader: function(a) {
- var b;
- if (r === 2) {
- if (!v) for (v = {}; b = Oc.exec(p);) v[b[1].toLowerCase()] = b[2];
- b = v[a.toLowerCase()]
- }
- return b === m ? null: b
- },
- overrideMimeType: function(a) {
- r || (h.mimeType = a);
- return this
- },
- abort: function(a) {
- a = a || "abort";
- o && o.abort(a);
- d(0, a);
- return this
- }
- };
- f.promise(I);
- I.success = I.done;
- I.error = I.fail;
- I.complete = i.add;
- I.statusCode = function(a) {
- if (a) {
- var b;
- if (r < 2) for (b in a) t[b] = [t[b], a[b]];
- else {
- b = a[I.status];
- I.then(b, b)
- }
- }
- return this
- };
- h.url = ((a || h.url) + "").replace(Nc, "").replace(Rc, ma[1] + "//");
- h.dataTypes = c.trim(h.dataType || "*").toLowerCase().split(nb);
- h.crossDomain == null && (q = Nb.exec(h.url.toLowerCase()), h.crossDomain = !(!q || q[1] == ma[1] && q[2] == ma[2] && (q[3] || (q[1] === "http:" ? 80 : 443)) == (ma[3] || (ma[1] === "http:" ? 80 : 443))));
- h.data && h.processData && typeof h.data != "string" && (h.data = c.param(h.data, h.traditional));
- J(Ya, h, b, I);
- if (r === 2) return false;
- ja = h.global;
- h.type = h.type.toUpperCase();
- h.hasContent = !Qc.test(h.type);
- ja && c.active++===0 && c.event.trigger("ajaxStart");
- if (!h.hasContent) {
- h.data && (h.url = h.url + ((Mb.test(h.url) ? "&": "?") + h.data), delete h.data);
- j = h.url;
- if (h.cache === false) {
- q = c.now();
- var u = h.url.replace(Uc, "$1_=" + q);
- h.url = u + (u === h.url ? (Mb.test(h.url) ? "&": "?") + "_=" + q: "")
- }
- } (h.data && h.hasContent && h.contentType !== false || b.contentType) && I.setRequestHeader("Content-Type", h.contentType);
- h.ifModified && (j = j || h.url, c.lastModified[j] && I.setRequestHeader("If-Modified-Since", c.lastModified[j]), c.etag[j] && I.setRequestHeader("If-None-Match", c.etag[j]));
- I.setRequestHeader("Accept", h.dataTypes[0] && h.accepts[h.dataTypes[0]] ? h.accepts[h.dataTypes[0]] + (h.dataTypes[0] !== "*" ? ", " + Qb + "; q=0.01": "") : h.accepts["*"]);
- for (s in h.headers) I.setRequestHeader(s, h.headers[s]);
- if (h.beforeSend && (h.beforeSend.call(g, I, h) === false || r === 2)) {
- I.abort();
- return false
- }
- for (s in {
- success: 1,
- error: 1,
- complete: 1
- }) I[s](h[s]);
- if (o = J(Pb, h, b, I)) {
- I.readyState = 1;
- ja && l.trigger("ajaxSend", [I, h]);
- h.async && h.timeout > 0 && (ya = setTimeout(function() {
- I.abort("timeout")
- },
- h.timeout));
- try {
- r = 1;
- o.send(k, d)
- } catch(K) {
- r < 2 ? d( - 1, K) : c.error(K)
- }
- } else d( - 1, "No Transport");
- return I
- },
- param: function(a, b) {
- var d = [],
- h = function(a, b) {
- b = c.isFunction(b) ? b() : b;
- d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b)
- };
- b === m && (b = c.ajaxSettings.traditional);
- if (c.isArray(a) || a.jquery && !c.isPlainObject(a)) c.each(a,
- function() {
- h(this.name, this.value)
- });
- else for (var g in a) N(g, a[g], b, h);
- return d.join("&").replace(Mc, "+")
- }
- });
- c.extend({
- active: 0,
- lastModified: {},
- etag: {}
- });
- var Vc = c.now(),
- Va = /(\=)\?(&|$)|\?\?/i;
- c.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- return c.expando + "_" + Vc++
- }
- });
- c.ajaxPrefilter("json jsonp",
- function(a, b, d) {
- b = a.contentType === "application/x-www-form-urlencoded" && typeof a.data == "string";
- if (a.dataTypes[0] === "jsonp" || a.jsonp !== false && (Va.test(a.url) || b && Va.test(a.data))) {
- var h, g = a.jsonpCallback = c.isFunction(a.jsonpCallback) ? a.jsonpCallback() : a.jsonpCallback,
- l = j[g],
- f = a.url,
- i = a.data,
- t = "$1" + g + "$2";
- a.jsonp !== false && (f = f.replace(Va, t), a.url === f && (b && (i = i.replace(Va, t)), a.data === i && (f = f + ((/\?/.test(f) ? "&": "?") + a.jsonp + "=" + g))));
- a.url = f;
- a.data = i;
- j[g] = function(a) {
- h = [a]
- };
- d.always(function() {
- j[g] = l;
- h && c.isFunction(l) && j[g](h[0])
- });
- a.converters["script json"] = function() {
- h || c.error(g + " was not called");
- return h[0]
- };
- a.dataTypes[0] = "json";
- return "script"
- }
- });
- c.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /javascript|ecmascript/
- },
- converters: {
- "text script": function(a) {
- c.globalEval(a);
- return a
- }
- }
- });
- c.ajaxPrefilter("script",
- function(a) {
- a.cache === m && (a.cache = false);
- a.crossDomain && (a.type = "GET", a.global = false)
- });
- c.ajaxTransport("script",
- function(a) {
- if (a.crossDomain) {
- var b, d = o.head || o.getElementsByTagName("head")[0] || o.documentElement;
- return {
- send: function(h, c) {
- b = o.createElement("script");
- b.async = "async";
- a.scriptCharset && (b.charset = a.scriptCharset);
- b.src = a.url;
- b.onload = b.onreadystatechange = function(a, h) {
- if (h || !b.readyState || /loaded|complete/.test(b.readyState)) {
- b.onload = b.onreadystatechange = null;
- d && b.parentNode && d.removeChild(b);
- b = m;
- h || c(200, "success")
- }
- };
- d.insertBefore(b, d.firstChild)
- },
- abort: function() {
- b && b.onload(0, 1)
- }
- }
- }
- });
- var kb = j.ActiveXObject ?
- function() {
- for (var a in wa) wa[a](0, 1)
- }: !1,
- Wc = 0,
- wa;
- c.ajaxSettings.xhr = j.ActiveXObject ?
- function() {
- var a;
- if (! (a = !this.isLocal && q())) a: {
- try {
- a = new j.ActiveXObject("Microsoft.XMLHTTP");
- break a
- } catch(b) {}
- a = void 0
- }
- return a
- }: q;
- var lb = c.ajaxSettings.xhr();
- c.extend(c.support, {
- ajax: !!lb,
- cors: !!lb && "withCredentials" in lb
- });
- c.support.ajax && c.ajaxTransport(function(a) {
- if (!a.crossDomain || c.support.cors) {
- var b;
- return {
- send: function(d, h) {
- var g = a.xhr(),
- l,
- f;
- a.username ? g.open(a.type, a.url, a.async, a.username, a.password) : g.open(a.type, a.url, a.async);
- if (a.xhrFields) for (f in a.xhrFields) g[f] = a.xhrFields[f];
- a.mimeType && g.overrideMimeType && g.overrideMimeType(a.mimeType); ! a.crossDomain && !d["X-Requested-With"] && (d["X-Requested-With"] = "XMLHttpRequest");
- try {
- for (f in d) g.setRequestHeader(f, d[f])
- } catch(i) {}
- g.send(a.hasContent && a.data || null);
- b = function(d, f) {
- var i, t, j, k, z;
- try {
- if (b && (f || g.readyState === 4)) {
- b = m;
- l && (g.onreadystatechange = c.noop, kb && delete wa[l]);
- if (f) g.readyState !== 4 && g.abort();
- else {
- i = g.status;
- j = g.getAllResponseHeaders();
- k = {}; (z = g.responseXML) && z.documentElement && (k.xml = z);
- k.text = g.responseText;
- try {
- t = g.statusText
- } catch(p) {
- t = ""
- } ! i && a.isLocal && !a.crossDomain ? i = k.text ? 200 : 404 : i === 1223 && (i = 204)
- }
- }
- } catch(v) {
- f || h( - 1, v)
- }
- k && h(i, t, k, j)
- }; ! a.async || g.readyState === 4 ? b() : (l = ++Wc, kb && (wa || (wa = {},
- c(j).unload(kb)), wa[l] = b), g.onreadystatechange = b)
- },
- abort: function() {
- b && b(0, 1)
- }
- }
- }
- });
- var Xa = {},
- da, na, Xc = /^(?:toggle|show|hide)$/,
- Yc = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
- Wa, mb = [["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"], ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"], ["opacity"]],
- Da;
- c.fn.extend({
- show: function(a, b, d) {
- var h;
- if (a || a === 0) return this.animate(y("show", 3), a, b, d);
- b = 0;
- for (d = this.length; b < d; b++) {
- a = this[b];
- a.style && (h = a.style.display, !c._data(a, "olddisplay") && h === "none" && (h = a.style.display = ""), h === "" && c.css(a, "display") === "none" && c._data(a, "olddisplay", x(a.nodeName)))
- }
- for (b = 0; b < d; b++) {
- a = this[b];
- if (a.style) {
- h = a.style.display;
- if (h === "" || h === "none") a.style.display = c._data(a, "olddisplay") || ""
- }
- }
- return this
- },
- hide: function(a, b, d) {
- if (a || a === 0) return this.animate(y("hide", 3), a, b, d);
- for (var h, b = 0,
- d = this.length; b < d; b++) {
- a = this[b];
- a.style && (h = c.css(a, "display"), h !== "none" && !c._data(a, "olddisplay") && c._data(a, "olddisplay", h))
- }
- for (b = 0; b < d; b++) this[b].style && (this[b].style.display = "none");
- return this
- },
- _toggle: c.fn.toggle,
- toggle: function(a, b, d) {
- var h = typeof a == "boolean";
- c.isFunction(a) && c.isFunction(b) ? this._toggle.apply(this, arguments) : a == null || h ? this.each(function() {
- var b = h ? a: c(this).is(":hidden");
- c(this)[b ? "show": "hide"]()
- }) : this.animate(y("toggle", 3), a, b, d);
- return this
- },
- fadeTo: function(a, b, d, h) {
- return this.filter(":hidden").css("opacity", 0).show().end().animate({
- opacity: b
- },
- a, d, h)
- },
- animate: function(a, b, d, h) {
- function g() {
- l.queue === false && c._mark(this);
- var b = c.extend({},
- l),
- d = this.nodeType === 1,
- h = d && c(this).is(":hidden"),
- f,
- i,
- t,
- j,
- k,
- n,
- z,
- p;
- b.animatedProperties = {};
- for (t in a) {
- f = c.camelCase(t);
- t !== f && (a[f] = a[t], delete a[t]);
- i = a[f];
- c.isArray(i) ? (b.animatedProperties[f] = i[1], i = a[f] = i[0]) : b.animatedProperties[f] = b.specialEasing && b.specialEasing[f] || b.easing || "swing";
- if (i === "hide" && h || i === "show" && !h) return b.complete.call(this);
- d && (f === "height" || f === "width") && (b.overflow = [this.style.overflow, this.style.overflowX, this.style.overflowY], c.css(this, "display") === "inline" && c.css(this, "float") === "none" && (!c.support.inlineBlockNeedsLayout || x(this.nodeName) === "inline" ? this.style.display = "inline-block": this.style.zoom = 1))
- }
- b.overflow != null && (this.style.overflow = "hidden");
- for (t in a) {
- d = new c.fx(this, b, t);
- i = a[t];
- Xc.test(i) ? (p = c._data(this, "toggle" + t) || (i === "toggle" ? h ? "show": "hide": 0), p ? (c._data(this, "toggle" + t, p === "show" ? "hide": "show"), d[p]()) : d[i]()) : (j = Yc.exec(i), k = d.cur(), j ? (n = parseFloat(j[2]), z = j[3] || (c.cssNumber[t] ? "": "px"), z !== "px" && (c.style(this, t, (n || 1) + z), k = (n || 1) / d.cur() * k, c.style(this, t, k + z)), j[1] && (n = (j[1] === "-=" ? -1 : 1) * n + k), d.custom(k, n, z)) : d.custom(k, i, ""))
- }
- return true
- }
- var l = c.speed(b, d, h);
- if (c.isEmptyObject(a)) return this.each(l.complete, [false]);
- a = c.extend({},
- a);
- return l.queue === false ? this.each(g) : this.queue(l.queue, g)
- },
- stop: function(a, b, d) {
- typeof a != "string" && (d = b, b = a, a = m);
- b && a !== false && this.queue(a || "fx", []);
- return this.each(function() {
- var b, h = false,
- g = c.timers,
- l = c._data(this);
- d || c._unmark(true, this);
- if (a == null) for (b in l) {
- if (l[b].stop && b.indexOf(".run") === b.length - 4) {
- var f = l[b];
- c.removeData(this, b, true);
- f.stop(d)
- }
- } else if (l[b = a + ".run"] && l[b].stop) {
- l = l[b];
- c.removeData(this, b, true);
- l.stop(d)
- }
- for (b = g.length; b--;) g[b].elem === this && (a == null || g[b].queue === a) && (d ? g[b](true) : g[b].saveState(), h = true, g.splice(b, 1)); (!d || !h) && c.dequeue(this, a)
- })
- }
- });
- c.each({
- slideDown: y("show", 1),
- slideUp: y("hide", 1),
- slideToggle: y("toggle", 1),
- fadeIn: {
- opacity: "show"
- },
- fadeOut: {
- opacity: "hide"
- },
- fadeToggle: {
- opacity: "toggle"
- }
- },
- function(a, b) {
- c.fn[a] = function(a, d, h) {
- return this.animate(b, a, d, h)
- }
- });
- c.extend({
- speed: function(a, b, d) {
- var h = a && typeof a == "object" ? c.extend({},
- a) : {
- complete: d || !d && b || c.isFunction(a) && a,
- duration: a,
- easing: d && b || b && !c.isFunction(b) && b
- };
- h.duration = c.fx.off ? 0 : typeof h.duration == "number" ? h.duration: h.duration in c.fx.speeds ? c.fx.speeds[h.duration] : c.fx.speeds._default;
- if (h.queue == null || h.queue === true) h.queue = "fx";
- h.old = h.complete;
- h.complete = function(a) {
- c.isFunction(h.old) && h.old.call(this);
- h.queue ? c.dequeue(this, h.queue) : a !== false && c._unmark(this)
- };
- return h
- },
- easing: {
- linear: function(a, b, d, h) {
- return d + h * a
- },
- swing: function(a, b, d, h) {
- return ( - Math.cos(a * Math.PI) / 2 + 0.5) * h + d
- }
- },
- timers: [],
- fx: function(a, b, d) {
- this.options = b;
- this.elem = a;
- this.prop = d;
- b.orig = b.orig || {}
- }
- });
- c.fx.prototype = {
- update: function() {
- this.options.step && this.options.step.call(this.elem, this.now, this); (c.fx.step[this.prop] || c.fx.step._default)(this)
- },
- cur: function() {
- if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) return this.elem[this.prop];
- var a, b = c.css(this.elem, this.prop);
- return isNaN(a = parseFloat(b)) ? !b || b === "auto" ? 0 : b: a
- },
- custom: function(a, b, d) {
- function h(a) {
- return g.step(a)
- }
- var g = this,
- l = c.fx;
- this.startTime = Da || r();
- this.end = b;
- this.now = this.start = a;
- this.pos = this.state = 0;
- this.unit = d || this.unit || (c.cssNumber[this.prop] ? "": "px");
- h.queue = this.options.queue;
- h.elem = this.elem;
- h.saveState = function() {
- g.options.hide && c._data(g.elem, "fxshow" + g.prop) === m && c._data(g.elem, "fxshow" + g.prop, g.start)
- };
- h() && c.timers.push(h) && !Wa && (Wa = setInterval(l.tick, l.interval))
- },
- show: function() {
- var a = c._data(this.elem, "fxshow" + this.prop);
- this.options.orig[this.prop] = a || c.style(this.elem, this.prop);
- this.options.show = true;
- a !== m ? this.custom(this.cur(), a) : this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
- c(this.elem).show()
- },
- hide: function() {
- this.options.orig[this.prop] = c._data(this.elem, "fxshow" + this.prop) || c.style(this.elem, this.prop);
- this.options.hide = true;
- this.custom(this.cur(), 0)
- },
- step: function(a) {
- var b, d, h = Da || r(),
- g = true,
- l = this.elem,
- f = this.options;
- if (a || h >= f.duration + this.startTime) {
- this.now = this.end;
- this.pos = this.state = 1;
- this.update();
- f.animatedProperties[this.prop] = true;
- for (b in f.animatedProperties) f.animatedProperties[b] !== true && (g = false);
- if (g) {
- f.overflow != null && !c.support.shrinkWrapBlocks && c.each(["", "X", "Y"],
- function(a, b) {
- l.style["overflow" + b] = f.overflow[a]
- });
- f.hide && c(l).hide();
- if (f.hide || f.show) for (b in f.animatedProperties) {
- c.style(l, b, f.orig[b]);
- c.removeData(l, "fxshow" + b, true);
- c.removeData(l, "toggle" + b, true)
- } (a = f.complete) && (f.complete = false, a.call(l))
- }
- return false
- }
- f.duration == Infinity ? this.now = h: (d = h - this.startTime, this.state = d / f.duration, this.pos = c.easing[f.animatedProperties[this.prop]](this.state, d, 0, 1, f.duration), this.now = this.start + (this.end - this.start) * this.pos);
- this.update();
- return true
- }
- };
- c.extend(c.fx, {
- tick: function() {
- for (var a, b = c.timers,
- d = 0; d < b.length; d++) {
- a = b[d]; ! a() && b[d] === a && b.splice(d--, 1)
- }
- b.length || c.fx.stop()
- },
- interval: 13,
- stop: function() {
- clearInterval(Wa);
- Wa = null
- },
- speeds: {
- slow: 600,
- fast: 200,
- _default: 400
- },
- step: {
- opacity: function(a) {
- c.style(a.elem, "opacity", a.now)
- },
- _default: function(a) {
- a.elem.style && a.elem.style[a.prop] != null ? a.elem.style[a.prop] = a.now + a.unit: a.elem[a.prop] = a.now
- }
- }
- });
- c.each(["width", "height"],
- function(a, b) {
- c.fx.step[b] = function(a) {
- c.style(a.elem, b, Math.max(0, a.now))
- }
- });
- c.expr && c.expr.filters && (c.expr.filters.animated = function(a) {
- return c.grep(c.timers,
- function(b) {
- return a === b.elem
- }).length
- });
- var Zc = /^t(?:able|d|h)$/i,
- Rb = /^(?:body|html)$/i;
- "getBoundingClientRect" in o.documentElement ? c.fn.offset = function(a) {
- var b = this[0],
- d;
- if (a) return this.each(function(b) {
- c.offset.setOffset(this, a, b)
- });
- if (!b || !b.ownerDocument) return null;
- if (b === b.ownerDocument.body) return c.offset.bodyOffset(b);
- try {
- d = b.getBoundingClientRect()
- } catch(h) {}
- var g = b.ownerDocument,
- l = g.documentElement;
- if (!d || !c.contains(l, b)) return d ? {
- top: d.top,
- left: d.left
- }: {
- top: 0,
- left: 0
- };
- b = g.body;
- g = s(g);
- return {
- top: d.top + (g.pageYOffset || c.support.boxModel && l.scrollTop || b.scrollTop) - (l.clientTop || b.clientTop || 0),
- left: d.left + (g.pageXOffset || c.support.boxModel && l.scrollLeft || b.scrollLeft) - (l.clientLeft || b.clientLeft || 0)
- }
- }: c.fn.offset = function(a) {
- var b = this[0];
- if (a) return this.each(function(b) {
- c.offset.setOffset(this, a, b)
- });
- if (!b || !b.ownerDocument) return null;
- if (b === b.ownerDocument.body) return c.offset.bodyOffset(b);
- var d, h = b.offsetParent,
- g = b.ownerDocument,
- l = g.documentElement,
- f = g.body;
- d = (g = g.defaultView) ? g.getComputedStyle(b, null) : b.currentStyle;
- for (var i = b.offsetTop,
- t = b.offsetLeft; (b = b.parentNode) && b !== f && b !== l;) {
- if (c.support.fixedPosition && d.position === "fixed") break;
- d = g ? g.getComputedStyle(b, null) : b.currentStyle;
- i = i - b.scrollTop;
- t = t - b.scrollLeft;
- b === h && (i = i + b.offsetTop, t = t + b.offsetLeft, c.support.doesNotAddBorder && (!c.support.doesAddBorderForTableAndCells || !Zc.test(b.nodeName)) && (i = i + (parseFloat(d.borderTopWidth) || 0), t = t + (parseFloat(d.borderLeftWidth) || 0)), h = b.offsetParent);
- c.support.subtractsBorderForOverflowNotVisible && d.overflow !== "visible" && (i = i + (parseFloat(d.borderTopWidth) || 0), t = t + (parseFloat(d.borderLeftWidth) || 0))
- }
- if (d.position === "relative" || d.position === "static") {
- i = i + f.offsetTop;
- t = t + f.offsetLeft
- }
- c.support.fixedPosition && d.position === "fixed" && (i = i + Math.max(l.scrollTop, f.scrollTop), t = t + Math.max(l.scrollLeft, f.scrollLeft));
- return {
- top: i,
- left: t
- }
- };
- c.offset = {
- bodyOffset: function(a) {
- var b = a.offsetTop,
- d = a.offsetLeft;
- c.support.doesNotIncludeMarginInBodyOffset && (b = b + (parseFloat(c.css(a, "marginTop")) || 0), d = d + (parseFloat(c.css(a, "marginLeft")) || 0));
- return {
- top: b,
- left: d
- }
- },
- setOffset: function(a, b, d) {
- var h = c.css(a, "position");
- h === "static" && (a.style.position = "relative");
- var g = c(a),
- l = g.offset(),
- f = c.css(a, "top"),
- i = c.css(a, "left"),
- t = {},
- j = {},
- k,
- z; (h === "absolute" || h === "fixed") && c.inArray("auto", [f, i]) > -1 ? (j = g.position(), k = j.top, z = j.left) : (k = parseFloat(f) || 0, z = parseFloat(i) || 0);
- c.isFunction(b) && (b = b.call(a, d, l));
- b.top != null && (t.top = b.top - l.top + k);
- b.left != null && (t.left = b.left - l.left + z);
- "using" in b ? b.using.call(a, t) : g.css(t)
- }
- };
- c.fn.extend({
- position: function() {
- if (!this[0]) return null;
- var a = this[0],
- b = this.offsetParent(),
- d = this.offset(),
- h = Rb.test(b[0].nodeName) ? {
- top: 0,
- left: 0
- }: b.offset();
- d.top = d.top - (parseFloat(c.css(a, "marginTop")) || 0);
- d.left = d.left - (parseFloat(c.css(a, "marginLeft")) || 0);
- h.top = h.top + (parseFloat(c.css(b[0], "borderTopWidth")) || 0);
- h.left = h.left + (parseFloat(c.css(b[0], "borderLeftWidth")) || 0);
- return {
- top: d.top - h.top,
- left: d.left - h.left
- }
- },
- offsetParent: function() {
- return this.map(function() {
- for (var a = this.offsetParent || o.body; a && !Rb.test(a.nodeName) && c.css(a, "position") === "static";) a = a.offsetParent;
- return a
- })
- }
- });
- c.each(["Left", "Top"],
- function(a, b) {
- var d = "scroll" + b;
- c.fn[d] = function(b) {
- var h, g;
- if (b === m) {
- h = this[0];
- if (!h) return null;
- return (g = s(h)) ? "pageXOffset" in g ? g[a ? "pageYOffset": "pageXOffset"] : c.support.boxModel && g.document.documentElement[d] || g.document.body[d] : h[d]
- }
- return this.each(function() { (g = s(this)) ? g.scrollTo(a ? c(g).scrollLeft() : b, a ? b: c(g).scrollTop()) : this[d] = b
- })
- }
- });
- c.each(["Height", "Width"],
- function(a, b) {
- var d = b.toLowerCase();
- c.fn["inner" + b] = function() {
- var a = this[0];
- return a ? a.style ? parseFloat(c.css(a, d, "padding")) : this[d]() : null
- };
- c.fn["outer" + b] = function(a) {
- var b = this[0];
- return b ? b.style ? parseFloat(c.css(b, d, a ? "margin": "border")) : this[d]() : null
- };
- c.fn[d] = function(a) {
- var h = this[0];
- if (!h) return a == null ? null: this;
- if (c.isFunction(a)) return this.each(function(b) {
- var h = c(this);
- h[d](a.call(this, b, h[d]()))
- });
- if (c.isWindow(h)) {
- var e = h.document.documentElement["client" + b],
- g = h.document.body;
- return h.document.compatMode === "CSS1Compat" && e || g && g["client" + b] || e
- }
- if (h.nodeType === 9) return Math.max(h.documentElement["client" + b], h.body["scroll" + b], h.documentElement["scroll" + b], h.body["offset" + b], h.documentElement["offset" + b]);
- if (a === m) {
- h = c.css(h, d);
- e = parseFloat(h);
- return c.isNumeric(e) ? e: h
- }
- return this.css(d, typeof a == "string" ? a: a + "px")
- }
- });
- j.jQuery = j.$ = c
- })(window); (function(j) {
- function m(j) {
- var m = this.data("tEvents");
- m || (m = {
- dispatch: {}
- },
- Object.defineProperty(this.data(), "tEvents", {
- value: m,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }));
- m.events = m.events || 0;
- m.dispatch[j] = !0;
- 0 === m.events && (N ? (this.bind("touchstart", x), this.bind("touchmove", y)) : (this.bind("mousedown", x), this.bind("mousemove", y)));
- m.events += 1
- }
- function s() {
- var m = this.data("tEvents");
- m && (m.events = Math.max(0, m.events - 1), 0 === m.events && (N ? (this.unbind("touchstart", x), this.unbind("touchmove", y), m.eventUpHandler && j("body").unbind("touchend", m.eventUpHandler)) : (this.unbind("mousedown", x), this.unbind("mousemove", y), m.eventUpHandler && j("body").unbind("mouseup", m.eventUpHandler))))
- }
- function x(m) {
- var r = j(this),
- s = r.data("tEvents"),
- u = q(m),
- x = r.offset(),
- C = !1;
- x && (C = (C = (C = (C = u.x > x.left) && u.y > x.top) && u.x < x.left + r.width()) && u.y < x.top + r.height());
- if (C || this == document) s.currentEvent = u,
- s.initialEvent = u,
- -1 == L.indexOf(this) && L.push(this),
- s.dispatch.press && (r = j.event.fix(m), r.type = "press", j(m.target).trigger(r))
- }
- function y(m) {
- var r = j(this),
- s = r.data("tEvents"),
- u;
- if (s.currentEvent) {
- u = j(s.currentEvent.target || r);
- var x = j.extend({},
- s.currentEvent);
- s.currentEvent = q(m);
- s.prevEvent = x;
- if (s.dispatch.pinching && N) {
- var C = m.originalEvent.touches;
- if (2 == C.length) {
- var x = C[1].pageX / 2 + C[0].pageX / 2,
- y = C[1].pageY / 2 + C[0].pageY / 2,
- D = j.Event("pinching"),
- w = C[1].pageX - C[0].pageX,
- C = C[1].pageY - C[0].pageY,
- w = Math.sqrt(w * w + C * C);
- s.fingerDistance || (s.fingerDistance = w);
- D.pageX = x;
- D.pageY = y;
- D.target = m.target;
- D.factor = w / s.fingerDistance;
- u.trigger(D)
- }
- }
- }
- s.dispatch.moving && (m = j.event.fix(m), m.type = "moving", r.trigger(m))
- }
- function u(m) {
- for (var q = !0,
- r = !0,
- s = !0,
- u = !0,
- x = 0; x < L.length; x++) {
- var y = L[x],
- D = j(y),
- w = D.data("tEvents");
- if (w.currentEvent) {
- var J = !1,
- k = (D = j(w.currentEvent.target || D)) ? D.offset() : null;
- if (w.prevEvent && w.dispatch.swipe) {
- var B = (w.currentEvent.x - w.prevEvent.x) / (w.currentEvent.time - w.prevEvent.time);
- if (q && ( - 1 > B || 1 < B)) {
- var U = j.Event("swipe"),
- q = !1;
- D.trigger(U, [B])
- }
- }
- w.dispatch.unpress && u && (B = j.event.fix(m), B.type = "unpress", u = !1, j(w.initialEvent.target).trigger(B));
- k && (J = (J = (J = (J = w.currentEvent.x >= k.left) && w.currentEvent.y >= k.top) && w.currentEvent.x <= k.left + D.width()) && w.currentEvent.y <= k.top + D.height());
- if (!w.prevEvent && (J || y == document)) if (w.dispatch.tap && s && (y = j.event.fix(m), y.type = "tap", s = !1, y.pageX = w.currentEvent.x, y.pageY = w.currentEvent.y, D.trigger(y)), w.dispatch.doubleTap && r) if (w.taps || (w.taps = [0, 0]), w.taps.splice(0, 1), w.taps.push((new Date).getTime()), 300 > w.taps[1] - w.taps[0]) y = j.event.fix(m),
- y.type = "doubleTap",
- r = !1,
- y.pageX = w.currentEvent.x,
- y.pageY = w.currentEvent.y,
- D.trigger(y);
- N ? j("body").unbind("touchend", w.eventUpHandler) : j("body").unbind("mouseup", w.eventUpHandler);
- delete w.eventUpHandler;
- delete w.currentEvent;
- delete w.prevEvent;
- delete w.initialEvent;
- delete w.fingerDistance
- }
- L.slice(x, 1)
- }
- }
- function r(q) {
- j.event.special[q] = {
- setup: function() {
- m.call(j(this), q)
- },
- teardown: function() {
- s.call(j(this))
- }
- }
- }
- function q(j) {
- var m = N ? {
- x: j.originalEvent.touches[0].pageX,
- y: j.originalEvent.touches[0].pageY
- }: {
- x: j.pageX,
- y: j.pageY
- };
- m.time = (new Date).getTime();
- m.target = j.target;
- return m
- }
- var N = j.isTouch || "ontouchstart" in window,
- L = [];
- Object.defineProperty || (Object.prototype.defineProperty = function(j, m, q) {
- j[m] = q.value
- });
- N ? j(document).bind("touchend", u) : j(document).bind("mouseup", u);
- for (var J = "swipe tap doubleTap pinching press unpress moving".split(" "); J.length;) r(J.pop())
- })(jQuery); (function() {
- var j = this,
- m = j._,
- s = {},
- x = Array.prototype,
- y = Object.prototype,
- u = x.push,
- r = x.slice,
- q = x.concat,
- N = y.toString,
- L = y.hasOwnProperty,
- J = x.forEach,
- K = x.map,
- Q = x.reduce,
- Y = x.reduceRight,
- ea = x.filter,
- S = x.every,
- C = x.some,
- V = x.indexOf,
- D = x.lastIndexOf,
- y = Array.isArray,
- w = Object.keys,
- aa = Function.prototype.bind,
- k = function(a) {
- return a instanceof k ? a: this instanceof k ? (this._wrapped = a, void 0) : new k(a)
- };
- "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = k), exports._ = k) : j._ = k;
- k.VERSION = "1.4.3";
- var B = k.each = k.forEach = function(a, b, d) {
- if (null != a) if (J && a.forEach === J) a.forEach(b, d);
- else if (a.length === +a.length) for (var c = 0,
- f = a.length; f > c && b.call(d, a[c], c, a) !== s; c++);
- else for (c in a) if (k.has(a, c) && b.call(d, a[c], c, a) === s) break
- };
- k.map = k.collect = function(a, b, d) {
- var c = [];
- return null == a ? c: K && a.map === K ? a.map(b, d) : (B(a,
- function(a, f, i) {
- c[c.length] = b.call(d, a, f, i)
- }), c)
- };
- k.reduce = k.foldl = k.inject = function(a, b, d, c) {
- var f = 2 < arguments.length;
- if (null == a && (a = []), Q && a.reduce === Q) return c && (b = k.bind(b, c)),
- f ? a.reduce(b, d) : a.reduce(b);
- if (B(a,
- function(a, i, j) {
- f ? d = b.call(c, d, a, i, j) : (d = a, f = !0)
- }), !f) throw new TypeError("Reduce of empty array with no initial value");
- return d
- };
- k.reduceRight = k.foldr = function(a, b, d, c) {
- var f = 2 < arguments.length;
- if (null == a && (a = []), Y && a.reduceRight === Y) return c && (b = k.bind(b, c)),
- f ? a.reduceRight(b, d) : a.reduceRight(b);
- var i = a.length;
- if (i !== +i) var j = k.keys(a),
- i = j.length;
- if (B(a,
- function(k, p, m) {
- p = j ? j[--i] : --i;
- f ? d = b.call(c, d, a[p], p, m) : (d = a[p], f = !0)
- }), !f) throw new TypeError("Reduce of empty array with no initial value");
- return d
- };
- k.find = k.detect = function(a, b, d) {
- var c;
- return U(a,
- function(a, f, i) {
- return b.call(d, a, f, i) ? (c = a, !0) : void 0
- }),
- c
- };
- k.filter = k.select = function(a, b, d) {
- var c = [];
- return null == a ? c: ea && a.filter === ea ? a.filter(b, d) : (B(a,
- function(a, f, i) {
- b.call(d, a, f, i) && (c[c.length] = a)
- }), c)
- };
- k.reject = function(a, b, d) {
- return k.filter(a,
- function(a, c, f) {
- return ! b.call(d, a, c, f)
- },
- d)
- };
- k.every = k.all = function(a, b, d) {
- b || (b = k.identity);
- var c = !0;
- return null == a ? c: S && a.every === S ? a.every(b, d) : (B(a,
- function(a, f, i) {
- return (c = c && b.call(d, a, f, i)) ? void 0 : s
- }), !!c)
- };
- var U = k.some = k.any = function(a, b, d) {
- b || (b = k.identity);
- var c = !1;
- return null == a ? c: C && a.some === C ? a.some(b, d) : (B(a,
- function(a, f, i) {
- return c || (c = b.call(d, a, f, i)) ? s: void 0
- }), !!c)
- };
- k.contains = k.include = function(a, b) {
- return null == a ? !1 : V && a.indexOf === V ? -1 != a.indexOf(b) : U(a,
- function(a) {
- return a === b
- })
- };
- k.invoke = function(a, b) {
- var d = r.call(arguments, 2);
- return k.map(a,
- function(a) {
- return (k.isFunction(b) ? b: a[b]).apply(a, d)
- })
- };
- k.pluck = function(a, b) {
- return k.map(a,
- function(a) {
- return a[b]
- })
- };
- k.where = function(a, b) {
- return k.isEmpty(b) ? [] : k.filter(a,
- function(a) {
- for (var d in b) if (b[d] !== a[d]) return ! 1;
- return ! 0
- })
- };
- k.max = function(a, b, d) {
- if (!b && k.isArray(a) && a[0] === +a[0] && 65535 > a.length) return Math.max.apply(Math, a);
- if (!b && k.isEmpty(a)) return - 1 / 0;
- var c = {
- computed: -1 / 0,
- value: -1 / 0
- };
- return B(a,
- function(a, f, i) {
- f = b ? b.call(d, a, f, i) : a;
- f >= c.computed && (c = {
- value: a,
- computed: f
- })
- }),
- c.value
- };
- k.min = function(a, b, d) {
- if (!b && k.isArray(a) && a[0] === +a[0] && 65535 > a.length) return Math.min.apply(Math, a);
- if (!b && k.isEmpty(a)) return 1 / 0;
- var c = {
- computed: 1 / 0,
- value: 1 / 0
- };
- return B(a,
- function(a, f, i) {
- f = b ? b.call(d, a, f, i) : a;
- c.computed > f && (c = {
- value: a,
- computed: f
- })
- }),
- c.value
- };
- k.shuffle = function(a) {
- var b, d = 0,
- c = [];
- return B(a,
- function(a) {
- b = k.random(d++);
- c[d - 1] = c[b];
- c[b] = a
- }),
- c
- };
- var R = function(a) {
- return k.isFunction(a) ? a: function(b) {
- return b[a]
- }
- };
- k.sortBy = function(a, b, d) {
- var c = R(b);
- return k.pluck(k.map(a,
- function(a, b, h) {
- return {
- value: a,
- index: b,
- criteria: c.call(d, a, b, h)
- }
- }).sort(function(a, b) {
- var d = a.criteria,
- h = b.criteria;
- if (d !== h) {
- if (d > h || void 0 === d) return 1;
- if (h > d || void 0 === h) return - 1
- }
- return a.index < b.index ? -1 : 1
- }), "value")
- };
- var M = function(a, b, d, c) {
- var f = {},
- i = R(b || k.identity);
- return B(a,
- function(b, h) {
- var j = i.call(d, b, h, a);
- c(f, j, b)
- }),
- f
- };
- k.groupBy = function(a, b, d) {
- return M(a, b, d,
- function(a, b, d) { (k.has(a, b) ? a[b] : a[b] = []).push(d)
- })
- };
- k.countBy = function(a, b, d) {
- return M(a, b, d,
- function(a, b) {
- k.has(a, b) || (a[b] = 0);
- a[b]++
- })
- };
- k.sortedIndex = function(a, b, d, c) {
- for (var d = null == d ? k.identity: R(d), b = d.call(c, b), f = 0, i = a.length; i > f;) {
- var j = f + i >>> 1;
- b > d.call(c, a[j]) ? f = j + 1 : i = j
- }
- return f
- };
- k.toArray = function(a) {
- return a ? k.isArray(a) ? r.call(a) : a.length === +a.length ? k.map(a, k.identity) : k.values(a) : []
- };
- k.size = function(a) {
- return null == a ? 0 : a.length === +a.length ? a.length: k.keys(a).length
- };
- k.first = k.head = k.take = function(a, b, d) {
- return null == a ? void 0 : null == b || d ? a[0] : r.call(a, 0, b)
- };
- k.initial = function(a, b, d) {
- return r.call(a, 0, a.length - (null == b || d ? 1 : b))
- };
- k.last = function(a, b, d) {
- return null == a ? void 0 : null == b || d ? a[a.length - 1] : r.call(a, Math.max(a.length - b, 0))
- };
- k.rest = k.tail = k.drop = function(a, b, d) {
- return r.call(a, null == b || d ? 1 : b)
- };
- k.compact = function(a) {
- return k.filter(a, k.identity)
- };
- var o = function(a, b, d) {
- return B(a,
- function(a) {
- k.isArray(a) ? b ? u.apply(d, a) : o(a, b, d) : d.push(a)
- }),
- d
- };
- k.flatten = function(a, b) {
- return o(a, b, [])
- };
- k.without = function(a) {
- return k.difference(a, r.call(arguments, 1))
- };
- k.uniq = k.unique = function(a, b, d, c) {
- k.isFunction(b) && (c = d, d = b, b = !1);
- var d = d ? k.map(a, d, c) : a,
- f = [],
- i = [];
- return B(d,
- function(d, c) { (b ? c && i[i.length - 1] === d: k.contains(i, d)) || (i.push(d), f.push(a[c]))
- }),
- f
- };
- k.union = function() {
- return k.uniq(q.apply(x, arguments))
- };
- k.intersection = function(a) {
- var b = r.call(arguments, 1);
- return k.filter(k.uniq(a),
- function(a) {
- return k.every(b,
- function(b) {
- return 0 <= k.indexOf(b, a)
- })
- })
- };
- k.difference = function(a) {
- var b = q.apply(x, r.call(arguments, 1));
- return k.filter(a,
- function(a) {
- return ! k.contains(b, a)
- })
- };
- k.zip = function() {
- for (var a = r.call(arguments), b = k.max(k.pluck(a, "length")), d = Array(b), c = 0; b > c; c++) d[c] = k.pluck(a, "" + c);
- return d
- };
- k.object = function(a, b) {
- if (null == a) return {};
- for (var d = {},
- c = 0,
- f = a.length; f > c; c++) b ? d[a[c]] = b[c] : d[a[c][0]] = a[c][1];
- return d
- };
- k.indexOf = function(a, b, d) {
- if (null == a) return - 1;
- var c = 0,
- f = a.length;
- if (d) {
- if ("number" != typeof d) return c = k.sortedIndex(a, b),
- a[c] === b ? c: -1;
- c = 0 > d ? Math.max(0, f + d) : d
- }
- if (V && a.indexOf === V) return a.indexOf(b, d);
- for (; f > c; c++) if (a[c] === b) return c;
- return - 1
- };
- k.lastIndexOf = function(a, b, d) {
- if (null == a) return - 1;
- var c = null != d;
- if (D && a.lastIndexOf === D) return c ? a.lastIndexOf(b, d) : a.lastIndexOf(b);
- for (d = c ? d: a.length; d--;) if (a[d] === b) return d;
- return - 1
- };
- k.range = function(a, b, d) {
- 1 >= arguments.length && (b = a || 0, a = 0);
- for (var d = arguments[2] || 1, c = Math.max(Math.ceil((b - a) / d), 0), f = 0, i = Array(c); c > f;) i[f++] = a,
- a += d;
- return i
- };
- var F = function() {};
- k.bind = function(a, b) {
- var d, c;
- if (a.bind === aa && aa) return aa.apply(a, r.call(arguments, 1));
- if (!k.isFunction(a)) throw new TypeError;
- return d = r.call(arguments, 2),
- c = function() {
- if (! (this instanceof c)) return a.apply(b, d.concat(r.call(arguments)));
- F.prototype = a.prototype;
- var f = new F;
- F.prototype = null;
- var i = a.apply(f, d.concat(r.call(arguments)));
- return Object(i) === i ? i: f
- }
- };
- k.bindAll = function(a) {
- var b = r.call(arguments, 1);
- return 0 == b.length && (b = k.functions(a)),
- B(b,
- function(b) {
- a[b] = k.bind(a[b], a)
- }),
- a
- };
- k.memoize = function(a, b) {
- var d = {};
- return b || (b = k.identity),
- function() {
- var c = b.apply(this, arguments);
- return k.has(d, c) ? d[c] : d[c] = a.apply(this, arguments)
- }
- };
- k.delay = function(a, b) {
- var d = r.call(arguments, 2);
- return setTimeout(function() {
- return a.apply(null, d)
- },
- b)
- };
- k.defer = function(a) {
- return k.delay.apply(k, [a, 1].concat(r.call(arguments, 1)))
- };
- k.throttle = function(a, b) {
- var d, c, f, i, j = 0,
- k = function() {
- j = new Date;
- f = null;
- i = a.apply(d, c)
- };
- return function() {
- var p = new Date,
- m = b - (p - j);
- return d = this,
- c = arguments,
- 0 >= m ? (clearTimeout(f), f = null, j = p, i = a.apply(d, c)) : f || (f = setTimeout(k, m)),
- i
- }
- };
- k.debounce = function(a, b, d) {
- var c, f;
- return function() {
- var i = this,
- j = arguments,
- k = d && !c;
- return clearTimeout(c),
- c = setTimeout(function() {
- c = null;
- d || (f = a.apply(i, j))
- },
- b),
- k && (f = a.apply(i, j)),
- f
- }
- };
- k.once = function(a) {
- var b, d = !1;
- return function() {
- return d ? b: (d = !0, b = a.apply(this, arguments), a = null, b)
- }
- };
- k.wrap = function(a, b) {
- return function() {
- var d = [a];
- return u.apply(d, arguments),
- b.apply(this, d)
- }
- };
- k.compose = function() {
- var a = arguments;
- return function() {
- for (var b = arguments,
- d = a.length - 1; 0 <= d; d--) b = [a[d].apply(this, b)];
- return b[0]
- }
- };
- k.after = function(a, b) {
- return 0 >= a ? b() : function() {
- return 1 > --a ? b.apply(this, arguments) : void 0
- }
- };
- k.keys = w ||
- function(a) {
- if (a !== Object(a)) throw new TypeError("Invalid object");
- var b = [],
- d;
- for (d in a) k.has(a, d) && (b[b.length] = d);
- return b
- };
- k.values = function(a) {
- var b = [],
- d;
- for (d in a) k.has(a, d) && b.push(a[d]);
- return b
- };
- k.pairs = function(a) {
- var b = [],
- d;
- for (d in a) k.has(a, d) && b.push([d, a[d]]);
- return b
- };
- k.invert = function(a) {
- var b = {},
- d;
- for (d in a) k.has(a, d) && (b[a[d]] = d);
- return b
- };
- k.functions = k.methods = function(a) {
- var b = [],
- d;
- for (d in a) k.isFunction(a[d]) && b.push(d);
- return b.sort()
- };
- k.extend = function(a) {
- return B(r.call(arguments, 1),
- function(b) {
- if (b) for (var d in b) a[d] = b[d]
- }),
- a
- };
- k.pick = function(a) {
- var b = {},
- d = q.apply(x, r.call(arguments, 1));
- return B(d,
- function(d) {
- d in a && (b[d] = a[d])
- }),
- b
- };
- k.omit = function(a) {
- var b = {},
- d = q.apply(x, r.call(arguments, 1)),
- c;
- for (c in a) k.contains(d, c) || (b[c] = a[c]);
- return b
- };
- k.defaults = function(a) {
- return B(r.call(arguments, 1),
- function(b) {
- if (b) for (var d in b) null == a[d] && (a[d] = b[d])
- }),
- a
- };
- k.clone = function(a) {
- return k.isObject(a) ? k.isArray(a) ? a.slice() : k.extend({},
- a) : a
- };
- k.tap = function(a, b) {
- return b(a),
- a
- };
- var c = function(a, b, d, f) {
- if (a === b) return 0 !== a || 1 / a == 1 / b;
- if (null == a || null == b) return a === b;
- a instanceof k && (a = a._wrapped);
- b instanceof k && (b = b._wrapped);
- var i = N.call(a);
- if (i != N.call(b)) return ! 1;
- switch (i) {
- case "[object String]":
- return a == b + "";
- case "[object Number]":
- return a != +a ? b != +b: 0 == a ? 1 / a == 1 / b: a == +b;
- case "[object Date]":
- case "[object Boolean]":
- return + a == +b;
- case "[object RegExp]":
- return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase
- }
- if ("object" != typeof a || "object" != typeof b) return ! 1;
- for (var j = d.length; j--;) if (d[j] == a) return f[j] == b;
- d.push(a);
- f.push(b);
- var j = 0,
- p = !0;
- if ("[object Array]" == i) {
- if (j = a.length, p = j == b.length) for (; j--&&(p = c(a[j], b[j], d, f)););
- } else {
- var i = a.constructor,
- m = b.constructor;
- if (i !== m && (!k.isFunction(i) || !(i instanceof i && k.isFunction(m) && m instanceof m))) return ! 1;
- for (var v in a) if (k.has(a, v) && (j++, !(p = k.has(b, v) && c(a[v], b[v], d, f)))) break;
- if (p) {
- for (v in b) if (k.has(b, v) && !j--) break;
- p = !j
- }
- }
- return d.pop(),
- f.pop(),
- p
- };
- k.isEqual = function(a, b) {
- return c(a, b, [], [])
- };
- k.isEmpty = function(a) {
- if (null == a) return ! 0;
- if (k.isArray(a) || k.isString(a)) return 0 === a.length;
- for (var b in a) if (k.has(a, b)) return ! 1;
- return ! 0
- };
- k.isElement = function(a) {
- return ! (!a || 1 !== a.nodeType)
- };
- k.isArray = y ||
- function(a) {
- return "[object Array]" == N.call(a)
- };
- k.isObject = function(a) {
- return a === Object(a)
- };
- B("Arguments Function String Number Date RegExp".split(" "),
- function(a) {
- k["is" + a] = function(b) {
- return N.call(b) == "[object " + a + "]"
- }
- });
- k.isArguments(arguments) || (k.isArguments = function(a) {
- return ! (!a || !k.has(a, "callee"))
- });
- k.isFunction = function(a) {
- return "function" == typeof a
- };
- k.isFinite = function(a) {
- return isFinite(a) && !isNaN(parseFloat(a))
- };
- k.isNaN = function(a) {
- return k.isNumber(a) && a != +a
- };
- k.isBoolean = function(a) {
- return ! 0 === a || !1 === a || "[object Boolean]" == N.call(a)
- };
- k.isNull = function(a) {
- return null === a
- };
- k.isUndefined = function(a) {
- return void 0 === a
- };
- k.has = function(a, b) {
- return L.call(a, b)
- };
- k.noConflict = function() {
- return j._ = m,
- this
- };
- k.identity = function(a) {
- return a
- };
- k.times = function(a, b, d) {
- for (var c = Array(a), f = 0; a > f; f++) c[f] = b.call(d, f);
- return c
- };
- k.random = function(a, b) {
- return null == b && (b = a, a = 0),
- a + (0 | Math.random() * (b - a + 1))
- };
- var i = {
- escape: {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'",
- "/": "/"
- }
- };
- i.unescape = k.invert(i.escape);
- var f = {
- escape: RegExp("[" + k.keys(i.escape).join("") + "]", "g"),
- unescape: RegExp("(" + k.keys(i.unescape).join("|") + ")", "g")
- };
- k.each(["escape", "unescape"],
- function(a) {
- k[a] = function(b) {
- return null == b ? "": ("" + b).replace(f[a],
- function(b) {
- return i[a][b]
- })
- }
- });
- k.result = function(a, b) {
- if (null == a) return null;
- var d = a[b];
- return k.isFunction(d) ? d.call(a) : d
- };
- k.mixin = function(a) {
- B(k.functions(a),
- function(b) {
- var d = k[b] = a[b];
- k.prototype[b] = function() {
- var a = [this._wrapped];
- u.apply(a, arguments);
- a = d.apply(k, a);
- return this._chain ? k(a).chain() : a
- }
- })
- };
- var p = 0;
- k.uniqueId = function(a) {
- var b = "" + ++p;
- return a ? a + b: b
- };
- k.templateSettings = {
- evaluate: /<%([\s\S]+?)%>/g,
- interpolate: /<%=([\s\S]+?)%>/g,
- escape: /<%-([\s\S]+?)%>/g
- };
- var v = /(.)^/,
- b = {
- "'": "'",
- "\\": "\\",
- "\r": "r",
- "\n": "n",
- "\t": "t",
- "\u2028": "u2028",
- "\u2029": "u2029"
- },
- d = /\\|'|\r|\n|\t|\u2028|\u2029/g;
- k.template = function(a, c, g) {
- var g = k.defaults({},
- g, k.templateSettings),
- f = RegExp([(g.escape || v).source, (g.interpolate || v).source, (g.evaluate || v).source].join("|") + "|$", "g"),
- i = 0,
- j = "__p+='";
- a.replace(f,
- function(c, h, g, f, l) {
- return j += a.slice(i, l).replace(d,
- function(a) {
- return "\\" + b[a]
- }),
- h && (j += "'+\n((__t=(" + h + "))==null?'':_.escape(__t))+\n'"),
- g && (j += "'+\n((__t=(" + g + "))==null?'':__t)+\n'"),
- f && (j += "';\n" + f + "\n__p+='"),
- i = l + c.length,
- c
- });
- j += "';\n";
- g.variable || (j = "with(obj||{}){\n" + j + "}\n");
- j = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + j + "return __p;\n";
- try {
- var p = Function(g.variable || "obj", "_", j)
- } catch(m) {
- throw m.source = j,
- m;
- }
- if (c) return p(c, k);
- c = function(a) {
- return p.call(this, a, k)
- };
- return c.source = "function(" + (g.variable || "obj") + "){\n" + j + "}",
- c
- };
- k.chain = function(a) {
- return k(a).chain()
- };
- k.mixin(k);
- B("pop push reverse shift sort splice unshift".split(" "),
- function(a) {
- var b = x[a];
- k.prototype[a] = function() {
- var d = this._wrapped;
- return b.apply(d, arguments),
- "shift" != a && "splice" != a || 0 !== d.length || delete d[0],
- this._chain ? k(d).chain() : d
- }
- });
- B(["concat", "join", "slice"],
- function(a) {
- var b = x[a];
- k.prototype[a] = function() {
- var a = b.apply(this._wrapped, arguments);
- return this._chain ? k(a).chain() : a
- }
- });
- k.extend(k.prototype, {
- chain: function() {
- return this._chain = !0,
- this
- },
- value: function() {
- return this._wrapped
- }
- })
- }).call(this); (function() {
- var j = this,
- m = j.Backbone,
- s = [],
- x = s.push,
- y = s.slice,
- u = s.splice,
- r;
- r = "undefined" !== typeof exports ? exports: j.Backbone = {};
- r.VERSION = "0.9.10";
- var q = j._; ! q && "undefined" !== typeof require && (q = require("underscore"));
- r.$ = j.jQuery || j.Zepto || j.ender;
- r.noConflict = function() {
- j.Backbone = m;
- return this
- };
- r.emulateHTTP = !1;
- r.emulateJSON = !1;
- var N = /\s+/,
- L = function(c, i, f, j) {
- if (!f) return ! 0;
- if ("object" === typeof f) for (var k in f) c[i].apply(c, [k, f[k]].concat(j));
- else if (N.test(f)) {
- f = f.split(N);
- k = 0;
- for (var b = f.length; k < b; k++) c[i].apply(c, [f[k]].concat(j))
- } else return ! 0
- },
- J = function(c, i) {
- var f, j = -1,
- k = c.length;
- switch (i.length) {
- case 0:
- for (; ++j < k;)(f = c[j]).callback.call(f.ctx);
- break;
- case 1:
- for (; ++j < k;)(f = c[j]).callback.call(f.ctx, i[0]);
- break;
- case 2:
- for (; ++j < k;)(f = c[j]).callback.call(f.ctx, i[0], i[1]);
- break;
- case 3:
- for (; ++j < k;)(f = c[j]).callback.call(f.ctx, i[0], i[1], i[2]);
- break;
- default:
- for (; ++j < k;)(f = c[j]).callback.apply(f.ctx, i)
- }
- },
- s = r.Events = {
- on: function(c, i, f) {
- if (!L(this, "on", c, [i, f]) || !i) return this;
- this._events || (this._events = {}); (this._events[c] || (this._events[c] = [])).push({
- callback: i,
- context: f,
- ctx: f || this
- });
- return this
- },
- once: function(c, i, f) {
- if (!L(this, "once", c, [i, f]) || !i) return this;
- var j = this,
- k = q.once(function() {
- j.off(c, k);
- i.apply(this, arguments)
- });
- k._callback = i;
- this.on(c, k, f);
- return this
- },
- off: function(c, i, f) {
- var j, k, b, d, a, h, g, l;
- if (!this._events || !L(this, "off", c, [i, f])) return this;
- if (!c && !i && !f) return this._events = {},
- this;
- d = c ? [c] : q.keys(this._events);
- a = 0;
- for (h = d.length; a < h; a++) if (c = d[a], j = this._events[c]) {
- b = [];
- if (i || f) {
- g = 0;
- for (l = j.length; g < l; g++) k = j[g],
- (i && i !== k.callback && i !== k.callback._callback || f && f !== k.context) && b.push(k)
- }
- this._events[c] = b
- }
- return this
- },
- trigger: function(c) {
- if (!this._events) return this;
- var i = y.call(arguments, 1);
- if (!L(this, "trigger", c, i)) return this;
- var f = this._events[c],
- j = this._events.all;
- f && J(f, i);
- j && J(j, arguments);
- return this
- },
- listenTo: function(c, i, f) {
- var j = this._listeners || (this._listeners = {}),
- k = c._listenerId || (c._listenerId = q.uniqueId("l"));
- j[k] = c;
- c.on(i, "object" === typeof i ? this: f, this);
- return this
- },
- stopListening: function(c, i, f) {
- var j = this._listeners;
- if (j) {
- if (c) c.off(i, "object" === typeof i ? this: f, this),
- !i && !f && delete j[c._listenerId];
- else {
- "object" === typeof i && (f = this);
- for (var k in j) j[k].off(i, f, this);
- this._listeners = {}
- }
- return this
- }
- }
- };
- s.bind = s.on;
- s.unbind = s.off;
- q.extend(r, s);
- var K = r.Model = function(c, i) {
- var f, j = c || {};
- this.cid = q.uniqueId("c");
- this.attributes = {};
- i && i.collection && (this.collection = i.collection);
- i && i.parse && (j = this.parse(j, i) || {});
- if (f = q.result(this, "defaults")) j = q.defaults({},
- j, f);
- this.set(j, i);
- this.changed = {};
- this.initialize.apply(this, arguments)
- };
- q.extend(K.prototype, s, {
- changed: null,
- idAttribute: "id",
- initialize: function() {},
- toJSON: function() {
- return q.clone(this.attributes)
- },
- sync: function() {
- return r.sync.apply(this, arguments)
- },
- get: function(c) {
- return this.attributes[c]
- },
- escape: function(c) {
- return q.escape(this.get(c))
- },
- has: function(c) {
- return null != this.get(c)
- },
- set: function(c, i, f) {
- var j, k, b, d, a, h, g;
- if (null == c) return this;
- "object" === typeof c ? (k = c, f = i) : (k = {})[c] = i;
- f || (f = {});
- if (!this._validate(k, f)) return ! 1;
- b = f.unset;
- d = f.silent;
- c = [];
- a = this._changing;
- this._changing = !0;
- a || (this._previousAttributes = q.clone(this.attributes), this.changed = {});
- g = this.attributes;
- h = this._previousAttributes;
- this.idAttribute in k && (this.id = k[this.idAttribute]);
- for (j in k) i = k[j],
- q.isEqual(g[j], i) || c.push(j),
- q.isEqual(h[j], i) ? delete this.changed[j] : this.changed[j] = i,
- b ? delete g[j] : g[j] = i;
- if (!d) {
- c.length && (this._pending = !0);
- i = 0;
- for (j = c.length; i < j; i++) this.trigger("change:" + c[i], this, g[c[i]], f)
- }
- if (a) return this;
- if (!d) for (; this._pending;) this._pending = !1,
- this.trigger("change", this, f);
- this._changing = this._pending = !1;
- return this
- },
- unset: function(c, i) {
- return this.set(c, void 0, q.extend({},
- i, {
- unset: !0
- }))
- },
- clear: function(c) {
- var i = {},
- f;
- for (f in this.attributes) i[f] = void 0;
- return this.set(i, q.extend({},
- c, {
- unset: !0
- }))
- },
- hasChanged: function(c) {
- return null == c ? !q.isEmpty(this.changed) : q.has(this.changed, c)
- },
- changedAttributes: function(c) {
- if (!c) return this.hasChanged() ? q.clone(this.changed) : !1;
- var i, f = !1,
- j = this._changing ? this._previousAttributes: this.attributes,
- k;
- for (k in c) if (!q.isEqual(j[k], i = c[k]))(f || (f = {}))[k] = i;
- return f
- },
- previous: function(c) {
- return null == c || !this._previousAttributes ? null: this._previousAttributes[c]
- },
- previousAttributes: function() {
- return q.clone(this._previousAttributes)
- },
- fetch: function(c) {
- c = c ? q.clone(c) : {};
- void 0 === c.parse && (c.parse = !0);
- var i = c.success;
- c.success = function(c, j, k) {
- if (!c.set(c.parse(j, k), k)) return ! 1;
- i && i(c, j, k)
- };
- return this.sync("read", this, c)
- },
- save: function(c, i, f) {
- var j, k, b = this.attributes;
- null == c || "object" === typeof c ? (j = c, f = i) : (j = {})[c] = i;
- if (j && (!f || !f.wait) && !this.set(j, f)) return ! 1;
- f = q.extend({
- validate: !0
- },
- f);
- if (!this._validate(j, f)) return ! 1;
- j && f.wait && (this.attributes = q.extend({},
- b, j));
- void 0 === f.parse && (f.parse = !0);
- k = f.success;
- f.success = function(d, a, c) {
- d.attributes = b;
- var g = d.parse(a, c);
- c.wait && (g = q.extend(j || {},
- g));
- if (q.isObject(g) && !d.set(g, c)) return ! 1;
- k && k(d, a, c)
- };
- c = this.isNew() ? "create": f.patch ? "patch": "update";
- "patch" === c && (f.attrs = j);
- c = this.sync(c, this, f);
- j && f.wait && (this.attributes = b);
- return c
- },
- destroy: function(c) {
- var c = c ? q.clone(c) : {},
- i = this,
- f = c.success,
- j = function() {
- i.trigger("destroy", i, i.collection, c)
- };
- c.success = function(b, d, a) { (a.wait || b.isNew()) && j();
- f && f(b, d, a)
- };
- if (this.isNew()) return c.success(this, null, c),
- !1;
- var k = this.sync("delete", this, c);
- c.wait || j();
- return k
- },
- url: function() {
- var c = q.result(this, "urlRoot") || q.result(this.collection, "url") || F();
- return this.isNew() ? c: c + ("/" === c.charAt(c.length - 1) ? "": "/") + encodeURIComponent(this.id)
- },
- parse: function(c) {
- return c
- },
- clone: function() {
- return new this.constructor(this.attributes)
- },
- isNew: function() {
- return null == this.id
- },
- isValid: function(c) {
- return ! this.validate || !this.validate(this.attributes, c)
- },
- _validate: function(c, i) {
- if (!i.validate || !this.validate) return ! 0;
- var c = q.extend({},
- this.attributes, c),
- f = this.validationError = this.validate(c, i) || null;
- if (!f) return ! 0;
- this.trigger("invalid", this, f, i || {});
- return ! 1
- }
- });
- var Q = r.Collection = function(c, i) {
- i || (i = {});
- i.model && (this.model = i.model);
- void 0 !== i.comparator && (this.comparator = i.comparator);
- this.models = [];
- this._reset();
- this.initialize.apply(this, arguments);
- c && this.reset(c, q.extend({
- silent: !0
- },
- i))
- };
- q.extend(Q.prototype, s, {
- model: K,
- initialize: function() {},
- toJSON: function(c) {
- return this.map(function(i) {
- return i.toJSON(c)
- })
- },
- sync: function() {
- return r.sync.apply(this, arguments)
- },
- add: function(c, i) {
- c = q.isArray(c) ? c.slice() : [c];
- i || (i = {});
- var f, j, k, b, d, a, h, g, l, t;
- h = [];
- g = i.at;
- l = this.comparator && null == g && !1 != i.sort;
- t = q.isString(this.comparator) ? this.comparator: null;
- f = 0;
- for (j = c.length; f < j; f++)(k = this._prepareModel(b = c[f], i)) ? (d = this.get(k)) ? i.merge && (d.set(b === k ? k.attributes: b, i), l && !a && d.hasChanged(t) && (a = !0)) : (h.push(k), k.on("all", this._onModelEvent, this), this._byId[k.cid] = k, null != k.id && (this._byId[k.id] = k)) : this.trigger("invalid", this, b, i);
- h.length && (l && (a = !0), this.length += h.length, null != g ? u.apply(this.models, [g, 0].concat(h)) : x.apply(this.models, h));
- a && this.sort({
- silent: !0
- });
- if (i.silent) return this;
- f = 0;
- for (j = h.length; f < j; f++)(k = h[f]).trigger("add", k, this, i);
- a && this.trigger("sort", this, i);
- return this
- },
- remove: function(c, i) {
- c = q.isArray(c) ? c.slice() : [c];
- i || (i = {});
- var f, j, k, b;
- f = 0;
- for (j = c.length; f < j; f++) if (b = this.get(c[f])) delete this._byId[b.id],
- delete this._byId[b.cid],
- k = this.indexOf(b),
- this.models.splice(k, 1),
- this.length--,
- i.silent || (i.index = k, b.trigger("remove", b, this, i)),
- this._removeReference(b);
- return this
- },
- push: function(c, i) {
- c = this._prepareModel(c, i);
- this.add(c, q.extend({
- at: this.length
- },
- i));
- return c
- },
- pop: function(c) {
- var i = this.at(this.length - 1);
- this.remove(i, c);
- return i
- },
- unshift: function(c, i) {
- c = this._prepareModel(c, i);
- this.add(c, q.extend({
- at: 0
- },
- i));
- return c
- },
- shift: function(c) {
- var i = this.at(0);
- this.remove(i, c);
- return i
- },
- slice: function(c, i) {
- return this.models.slice(c, i)
- },
- get: function(c) {
- if (null != c) return this._idAttr || (this._idAttr = this.model.prototype.idAttribute),
- this._byId[c.id || c.cid || c[this._idAttr] || c]
- },
- at: function(c) {
- return this.models[c]
- },
- where: function(c) {
- return q.isEmpty(c) ? [] : this.filter(function(i) {
- for (var f in c) if (c[f] !== i.get(f)) return ! 1;
- return ! 0
- })
- },
- sort: function(c) {
- if (!this.comparator) throw Error("Cannot sort a set without a comparator");
- c || (c = {});
- q.isString(this.comparator) || 1 === this.comparator.length ? this.models = this.sortBy(this.comparator, this) : this.models.sort(q.bind(this.comparator, this));
- c.silent || this.trigger("sort", this, c);
- return this
- },
- pluck: function(c) {
- return q.invoke(this.models, "get", c)
- },
- update: function(c, i) {
- i = q.extend({
- add: !0,
- merge: !0,
- remove: !0
- },
- i);
- i.parse && (c = this.parse(c, i));
- var f, j, k, b, d = [],
- a = [],
- h = {};
- q.isArray(c) || (c = c ? [c] : []);
- if (i.add && !i.remove) return this.add(c, i);
- j = 0;
- for (k = c.length; j < k; j++) f = c[j],
- b = this.get(f),
- i.remove && b && (h[b.cid] = !0),
- (i.add && !b || i.merge && b) && d.push(f);
- if (i.remove) {
- j = 0;
- for (k = this.models.length; j < k; j++) f = this.models[j],
- h[f.cid] || a.push(f)
- }
- a.length && this.remove(a, i);
- d.length && this.add(d, i);
- return this
- },
- reset: function(c, i) {
- i || (i = {});
- i.parse && (c = this.parse(c, i));
- for (var f = 0,
- j = this.models.length; f < j; f++) this._removeReference(this.models[f]);
- i.previousModels = this.models.slice();
- this._reset();
- c && this.add(c, q.extend({
- silent: !0
- },
- i));
- i.silent || this.trigger("reset", this, i);
- return this
- },
- fetch: function(c) {
- c = c ? q.clone(c) : {};
- void 0 === c.parse && (c.parse = !0);
- var i = c.success;
- c.success = function(c, j, k) {
- c[k.update ? "update": "reset"](j, k);
- i && i(c, j, k)
- };
- return this.sync("read", this, c)
- },
- create: function(c, i) {
- i = i ? q.clone(i) : {};
- if (! (c = this._prepareModel(c, i))) return ! 1;
- i.wait || this.add(c, i);
- var f = this,
- j = i.success;
- i.success = function(c, b, d) {
- d.wait && f.add(c, d);
- j && j(c, b, d)
- };
- c.save(null, i);
- return c
- },
- parse: function(c) {
- return c
- },
- clone: function() {
- return new this.constructor(this.models)
- },
- _reset: function() {
- this.length = 0;
- this.models.length = 0;
- this._byId = {}
- },
- _prepareModel: function(c, i) {
- if (c instanceof K) return c.collection || (c.collection = this),
- c;
- i || (i = {});
- i.collection = this;
- var f = new this.model(c, i);
- return ! f._validate(c, i) ? !1 : f
- },
- _removeReference: function(c) {
- this === c.collection && delete c.collection;
- c.off("all", this._onModelEvent, this)
- },
- _onModelEvent: function(c, i, f, j) { ("add" === c || "remove" === c) && f !== this || ("destroy" === c && this.remove(i, j), i && c === "change:" + i.idAttribute && (delete this._byId[i.previous(i.idAttribute)], null != i.id && (this._byId[i.id] = i)), this.trigger.apply(this, arguments))
- },
- sortedIndex: function(c, i, f) {
- i || (i = this.comparator);
- var j = q.isFunction(i) ? i: function(c) {
- return c.get(i)
- };
- return q.sortedIndex(this.models, c, j, f)
- }
- });
- q.each("forEach each map collect reduce foldl inject reduceRight foldr find detect filter select reject every all some any include contains invoke max min toArray size first head take initial rest tail drop last without indexOf shuffle lastIndexOf isEmpty chain".split(" "),
- function(c) {
- Q.prototype[c] = function() {
- var i = y.call(arguments);
- i.unshift(this.models);
- return q[c].apply(q, i)
- }
- });
- q.each(["groupBy", "countBy", "sortBy"],
- function(c) {
- Q.prototype[c] = function(i, f) {
- var j = q.isFunction(i) ? i: function(c) {
- return c.get(i)
- };
- return q[c](this.models, j, f)
- }
- });
- var Y = r.Router = function(c) {
- c || (c = {});
- c.routes && (this.routes = c.routes);
- this._bindRoutes();
- this.initialize.apply(this, arguments)
- },
- ea = /\((.*?)\)/g,
- S = /(\(\?)?:\w+/g,
- C = /\*\w+/g,
- V = /[\-{}\[\]+?.,\\\^$|#\s]/g;
- q.extend(Y.prototype, s, {
- initialize: function() {},
- route: function(c, i, f) {
- q.isRegExp(c) || (c = this._routeToRegExp(c));
- f || (f = this[i]);
- r.history.route(c, q.bind(function(j) {
- j = this._extractParameters(c, j);
- f && f.apply(this, j);
- this.trigger.apply(this, ["route:" + i].concat(j));
- this.trigger("route", i, j);
- r.history.trigger("route", this, i, j)
- },
- this));
- return this
- },
- navigate: function(c, i) {
- r.history.navigate(c, i);
- return this
- },
- _bindRoutes: function() {
- if (this.routes) for (var c, i = q.keys(this.routes); null != (c = i.pop());) this.route(c, this.routes[c])
- },
- _routeToRegExp: function(c) {
- c = c.replace(V, "\\$&").replace(ea, "(?:$1)?").replace(S,
- function(c, f) {
- return f ? c: "([^/]+)"
- }).replace(C, "(.*?)");
- return RegExp("^" + c + "$")
- },
- _extractParameters: function(c, i) {
- return c.exec(i).slice(1)
- }
- });
- var D = r.History = function() {
- this.handlers = [];
- q.bindAll(this, "checkUrl");
- "undefined" !== typeof window && (this.location = window.location, this.history = window.history)
- },
- w = /^[#\/]|\s+$/g,
- aa = /^\/+|\/+$/g,
- k = /msie [\w.]+/,
- B = /\/$/;
- D.started = !1;
- q.extend(D.prototype, s, {
- interval: 50,
- getHash: function(c) {
- return (c = (c || this).location.href.match(/#(.*)$/)) ? c[1] : ""
- },
- getFragment: function(c, i) {
- if (null == c) if (this._hasPushState || !this._wantsHashChange || i) {
- var c = this.location.pathname,
- f = this.root.replace(B, "");
- c.indexOf(f) || (c = c.substr(f.length))
- } else c = this.getHash();
- return c.replace(w, "")
- },
- start: function(c) {
- if (D.started) throw Error("Backbone.history has already been started");
- D.started = !0;
- this.options = q.extend({},
- {
- root: "/"
- },
- this.options, c);
- this.root = this.options.root;
- this._wantsHashChange = !1 !== this.options.hashChange;
- this._wantsPushState = !!this.options.pushState;
- this._hasPushState = !(!this.options.pushState || !this.history || !this.history.pushState);
- var c = this.getFragment(),
- i = document.documentMode,
- i = k.exec(navigator.userAgent.toLowerCase()) && (!i || 7 >= i);
- this.root = ("/" + this.root + "/").replace(aa, "/");
- i && this._wantsHashChange && (this.iframe = r.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow, this.navigate(c));
- if (this._hasPushState) r.$(window).on("popstate", this.checkUrl);
- else if (this._wantsHashChange && "onhashchange" in window && !i) r.$(window).on("hashchange", this.checkUrl);
- else this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval));
- this.fragment = c;
- c = this.location;
- i = c.pathname.replace(/[^\/]$/, "$&/") === this.root;
- if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !i) return this.fragment = this.getFragment(null, !0),
- this.location.replace(this.root + this.location.search + "#" + this.fragment),
- !0;
- this._wantsPushState && this._hasPushState && (i && c.hash) && (this.fragment = this.getHash().replace(w, ""), this.history.replaceState({},
- document.title, this.root + this.fragment + c.search));
- if (!this.options.silent) return this.loadUrl()
- },
- stop: function() {
- r.$(window).off("popstate", this.checkUrl).off("hashchange", this.checkUrl);
- clearInterval(this._checkUrlInterval);
- D.started = !1
- },
- route: function(c, i) {
- this.handlers.unshift({
- route: c,
- callback: i
- })
- },
- checkUrl: function() {
- var c = this.getFragment();
- c === this.fragment && this.iframe && (c = this.getFragment(this.getHash(this.iframe)));
- if (c === this.fragment) return ! 1;
- this.iframe && this.navigate(c);
- this.loadUrl() || this.loadUrl(this.getHash())
- },
- loadUrl: function(c) {
- var i = this.fragment = this.getFragment(c);
- return q.any(this.handlers,
- function(c) {
- if (c.route.test(i)) return c.callback(i),
- !0
- })
- },
- navigate: function(c, i) {
- if (!D.started) return ! 1;
- if (!i || !0 === i) i = {
- trigger: i
- };
- c = this.getFragment(c || "");
- if (this.fragment !== c) {
- this.fragment = c;
- var f = this.root + c;
- if (this._hasPushState) this.history[!i.replace ? "replaceState": "pushState"]({},
- document.title, f);
- else if (this._wantsHashChange) this._updateHash(this.location, c, i.replace),
- this.iframe && c !== this.getFragment(this.getHash(this.iframe)) && (i.replace || this.iframe.document.open().close(), this._updateHash(this.iframe.location, c, i.replace));
- else return this.location.assign(f);
- i.trigger && this.loadUrl(c)
- }
- },
- _updateHash: function(c, i, f) {
- f ? (f = c.href.replace(/(javascript:|#).*$/, ""), c.replace(f + "#" + i)) : c.hash = "#" + i
- }
- });
- r.history = new D;
- var U = r.View = function(c) {
- this.cid = q.uniqueId("view");
- this._configure(c || {});
- this._ensureElement();
- this.initialize.apply(this, arguments);
- this.delegateEvents()
- },
- R = /^(\S+)\s*(.*)$/,
- M = "model collection el id attributes className tagName events".split(" ");
- q.extend(U.prototype, s, {
- tagName: "div",
- $: function(c) {
- return this.$el.find(c)
- },
- initialize: function() {},
- render: function() {
- return this
- },
- remove: function() {
- this.$el.remove();
- this.stopListening();
- return this
- },
- setElement: function(c, i) {
- this.$el && this.undelegateEvents();
- this.$el = c instanceof r.$ ? c: r.$(c);
- this.el = this.$el[0]; ! 1 !== i && this.delegateEvents();
- return this
- },
- delegateEvents: function(c) {
- if (c || (c = q.result(this, "events"))) {
- this.undelegateEvents();
- for (var i in c) {
- var f = c[i];
- q.isFunction(f) || (f = this[c[i]]);
- if (!f) throw Error('Method "' + c[i] + '" does not exist');
- var j = i.match(R),
- k = j[1],
- j = j[2],
- f = q.bind(f, this),
- k = k + (".delegateEvents" + this.cid);
- if ("" === j) this.$el.on(k, f);
- else this.$el.on(k, j, f)
- }
- }
- },
- undelegateEvents: function() {
- this.$el.off(".delegateEvents" + this.cid)
- },
- _configure: function(c) {
- this.options && (c = q.extend({},
- q.result(this, "options"), c));
- q.extend(this, q.pick(c, M));
- this.options = c
- },
- _ensureElement: function() {
- if (this.el) this.setElement(q.result(this, "el"), !1);
- else {
- var c = q.extend({},
- q.result(this, "attributes"));
- this.id && (c.id = q.result(this, "id"));
- this.className && (c["class"] = q.result(this, "className"));
- c = r.$("<" + q.result(this, "tagName") + ">").attr(c);
- this.setElement(c, !1)
- }
- }
- });
- var o = {
- create: "POST",
- update: "PUT",
- patch: "PATCH",
- "delete": "DELETE",
- read: "GET"
- };
- r.sync = function(c, i, f) {
- var j = o[c];
- q.defaults(f || (f = {}), {
- emulateHTTP: r.emulateHTTP,
- emulateJSON: r.emulateJSON
- });
- var k = {
- type: j,
- dataType: "json"
- };
- f.url || (k.url = q.result(i, "url") || F());
- if (null == f.data && i && ("create" === c || "update" === c || "patch" === c)) k.contentType = "application/json",
- k.data = JSON.stringify(f.attrs || i.toJSON(f));
- f.emulateJSON && (k.contentType = "application/x-www-form-urlencoded", k.data = k.data ? {
- model: k.data
- }: {});
- if (f.emulateHTTP && ("PUT" === j || "DELETE" === j || "PATCH" === j)) {
- k.type = "POST";
- f.emulateJSON && (k.data._method = j);
- var b = f.beforeSend;
- f.beforeSend = function(a) {
- a.setRequestHeader("X-HTTP-Method-Override", j);
- if (b) return b.apply(this, arguments)
- }
- }
- "GET" !== k.type && !f.emulateJSON && (k.processData = !1);
- var d = f.success;
- f.success = function(a) {
- d && d(i, a, f);
- i.trigger("sync", i, a, f)
- };
- var a = f.error;
- f.error = function(b) {
- a && a(i, b, f);
- i.trigger("error", i, b, f)
- };
- c = f.xhr = r.ajax(q.extend(k, f));
- i.trigger("request", i, c, f);
- return c
- };
- r.ajax = function() {
- return r.$.ajax.apply(r.$, arguments)
- };
- K.extend = Q.extend = Y.extend = U.extend = D.extend = function(c, i) {
- var f = this,
- j;
- j = c && q.has(c, "constructor") ? c.constructor: function() {
- return f.apply(this, arguments)
- };
- q.extend(j, f, i);
- var k = function() {
- this.constructor = j
- };
- k.prototype = f.prototype;
- j.prototype = new k;
- c && q.extend(j.prototype, c);
- j.__super__ = f.prototype;
- return j
- };
- var F = function() {
- throw Error('A "url" property or function must be specified');
- }
- }).call(this); (function(j) {
- function m(b, d, a) {
- if (!a[0] || "object" == typeof a[0]) return d.init.apply(b, a);
- if (d[a[0]]) return d[a[0]].apply(b, Array.prototype.slice.call(a, 1));
- throw C(a[0] + " is not a method or property");
- }
- function s(b, d, a, c) {
- return {
- css: {
- position: "absolute",
- top: b,
- left: d,
- overflow: c || "hidden",
- zIndex: a || "auto"
- }
- }
- }
- function x(b, d, a) {
- var c = 1 - d,
- g = c * c * c,
- f = d * d * d;
- return y(a, Math.round(g * b[0].x + 3 * d * c * c * b[1].x + 3 * d * d * c * b[2].x + f * b[3].x), Math.round(g * b[0].y + 3 * d * c * c * b[1].y + 3 * d * d * c * b[2].y + f * b[3].y))
- }
- function y(b, d, a) {
- return {
- corner: b,
- x: d,
- y: a
- }
- }
- function u(b, d) {
- return {
- x: b,
- y: d
- }
- }
- function r(b, d, a) {
- return w && a ? " translate3d(" + b + "px," + d + "px, 0px) ": " translate(" + b + "px, " + d + "px) "
- }
- function q(b, d, a) {
- return w && a ? " scale3d(" + b + "," + d + ", 1) ": " scale(" + b + ", " + d + ") "
- }
- function N(b) {
- return " rotate(" + b + "deg) "
- }
- function L(b, d) {
- return Object.prototype.hasOwnProperty.call(d, b)
- }
- function J() {
- for (var b = ["Moz", "Webkit", "Khtml", "O", "ms"], d = b.length, a = ""; d--;) b[d] + "Transform" in document.body.style && (a = "-" + b[d].toLowerCase() + "-");
- return a
- }
- function K(b) {
- var d = R ? u(b.originalEvent.touches[0].pageX, b.originalEvent.touches[0].pageY) : u(b.pageX, b.pageY);
- d.time = (new Date).getTime();
- d.target = b.target;
- return d
- }
- function Q() {
- return "WebKitCSSMatrix" in window || "MozPerspective" in document.body.style
- }
- function Y(b, d) {
- var a, c, g = document.createElement("fakeelement"),
- f = {
- transition: "transitionend",
- OTransition: "oTransitionEnd",
- MSTransition: "transitionend",
- MozTransition: "transitionend",
- WebkitTransition: "webkitTransitionEnd"
- };
- for (a in f) if (void 0 !== g.style[a]) {
- c = f[a];
- break
- }
- b && (c ? b.bind(c,
- function() {
- b.unbind(c);
- d.call(b)
- }) : setTimeout(function() {
- d.call(b)
- },
- Math.ceil(1E3 * parseFloat(b.css(J() + "transition-duration")))));
- return c
- }
- function ea(b) {
- var d;
- "-webkit-" == k ? d = b ? "-webkit-gradient(linear, left top, right top,color-stop(0, rgba(0,0,0,0)),color-stop(0.3, rgba(0,0,0, 0.3)),color-stop(0.5, rgba(0,0,0, 0.8))": "-webkit-gradient(linear, left top, right top,color-stop(0, rgba(0,0,0,0)),color-stop(0.2, rgba(0,0,0,0.5)),color-stop(0.2, rgba(0,0,0,0.6)),color-stop(0.4, rgba(0,0,0,0.2)),color-stop(1, rgba(0,0,0,0))": (d = k + "linear-gradient(left, ", d = b ? d + "rgba(0,0,0,0) 0%,rgba(0,0,0,0.3) 30%,rgba(0,0,0,0.8) 50%": d + "rgba(0,0,0,0) 0%,rgba(0,0,0,0.2) 20%,rgba(0,0,0,0.6) 20%,rgba(0,0,0,0.2) 40%,rgba(0,0,0,0) 100%");
- return d + ")"
- }
- function S(b, d, a) {
- b = j.Event(b);
- d.trigger(b, a);
- return b.isDefaultPrevented() ? c.prevented: b.isPropagationStopped() ? c.stopped: ""
- }
- function C(b) {
- function d(a) {
- this.name = "TurnJsError";
- this.message = a
- }
- d.prototype = Error();
- d.prototype.constructor = d;
- return new d(b)
- }
- function V(b) {
- var d = {
- width: b.width,
- height: b.height
- };
- if (d.width > b.boundWidth || d.height > b.boundHeight) {
- var a = d.width / d.height;
- b.boundWidth / a > b.boundHeight && b.boundHeight * a <= b.boundWidth ? (d.width = Math.round(b.boundHeight * a), d.height = b.boundHeight) : (d.width = b.boundWidth, d.height = Math.round(b.boundWidth / a))
- }
- return d
- }
- function D(b, d, a) {
- var c = b.data("events")[d],
- g = [];
- j.each(c,
- function(a, b) {
- g.push(b.handler)
- });
- a && b.unbind(d);
- return g
- }
- var w, aa, k, B = Math.PI,
- U = B / 2,
- R = "ontouchstart" in window,
- M = {
- backward: ["bl", "tl", "l"],
- forward: ["br", "tr", "r"],
- all: "tl bl tr br l r".split(" ")
- },
- o = {
- single: 1,
- "double": 2
- },
- F = {
- ltr: 1,
- rtl: 2
- },
- c = {
- prevented: 1,
- stopped: 2
- },
- i = {
- acceleration: !0,
- autoScroll: !0,
- cacheSize: 6,
- cornerSize: 50,
- cornerPosition: "50px 50px",
- defaultZoomMargin: "0px 0px",
- display: "double",
- duration: 600,
- easing: function(b, d, a, c) {
- var c = (b /= c) * b,
- g = c * b;
- return d + a * ( - 1.95 * g * c + 7.8 * c * c + -10.7 * g + 4.8 * c + 1.05 * b)
- },
- elevation: "10%",
- hover: !0,
- ignoreElements: "[ignore=1]",
- page: 1,
- smartFlip: !1,
- swipe: !0,
- responsive: !1,
- gradients: !0,
- turnCorners: "bl,br",
- events: null
- },
- f = {
- init: function(b) {
- if (this.turn("is")) return this.turn("options", b);
- w = Q();
- var d;
- aa = (d = /AppleWebkit\/([0-9\.]+)/i.exec(navigator.userAgent)) ? 534.3 < parseFloat(d[1]) : !0;
- k = J();
- d = {};
- var a = this.children(),
- c = 0,
- b = j.extend({
- width: this.width(),
- height: this.height(),
- direction: this.attr("dir") || this.css("direction") || "ltr",
- viewer: this.parent()
- },
- i, b),
- g = b.cornerPosition.split(" ");
- b.cornerPosition = u(parseInt(g[0], 10), parseInt(g[1], 10));
- d.options = b;
- d.dynamicMode = !1;
- d.turningPage = !1;
- d.pageObjs = {};
- d.pages = {};
- d.pageWrap = {};
- d.pageMv = [];
- d.front = [];
- d.scroll = {
- left: 0,
- top: 0
- };
- d.margins = [0, 0, 0, 0];
- d.zoom = 1;
- d.totalPages = b.pages || 0;
- d.eventHandlers = {
- touchMove: j.proxy(f._touchMove, this),
- touchEnd: j.proxy(f._touchEnd, this),
- start: j.proxy(f._eventStart, this)
- };
- this.data("t", d);
- b.when && (b.events = b.when);
- if (b.events) for (var l in b.events) L(l, b.events) && this.bind(l, b.events[l]);
- this.css({
- position: "relative",
- width: b.width,
- height: b.height
- });
- R ? this.addClass("touch") : this.addClass("no-touch");
- this.turn("display", b.display);
- "" !== b.direction && this.turn("direction", b.direction);
- for (l = 0; l < a.length; l++) j(a[l]).is(b.ignoreElements) || this.turn("addPage", a[l], ++c);
- d.dynamicMode = 0 === c;
- this.bind("press", f._touchStart).bind("end", f._eventEnd).bind("swipe", f._eventSwipe).bind("flip", f._eventFlip);
- this.parent().bind("start", d.eventHandlers.start);
- j(document).bind("moving", d.eventHandlers.touchMove).bind("unpress", d.eventHandlers.touchEnd);
- f._resizeObserver.call(this);
- this.turn("page", b.page);
- d.done = !0;
- b.slider && (b.events && b.events.newThumbnail && (j(b.slider).bind("newThumbnail", b.events.newThumbnail), delete b.events.newThumbnail), d.slider = b.slider, j(b.slider).tslider({
- flipbook: this
- }));
- return this
- },
- addPage: function(b, d, a) {
- var c, g = !1,
- l = this.data("t"),
- i = l.totalPages + 1;
- if (l.destroying) return null;
- if (c = /\bp([0-9]+)\b/.exec(j(b).attr("class"))) d = parseInt(c[1], 10);
- if (d) if (d == i) g = !0;
- else {
- if (d > i) throw C('Page "' + d + '" cannot be inserted');
- } else d = i,
- g = !0;
- 1 <= d && d <= i && (c = l.display == o["double"] ? d % 2 ? " odd": " even": " odd", d in l.pageObjs && f._movePages.call(this, d, 1), g && (l.totalPages = i), l.pageObjs[d] = j(b).css({
- "float": "left"
- }).addClass("page p" + d + c), a && l.pageObjs[d].data({
- f: a
- }), -1 != navigator.userAgent.indexOf("MSIE 9.0") && l.pageObjs[d].hasClass("hard") && l.pageObjs[d].removeClass("hard"), f._addPage.call(this, d), f._removeFromDOM.call(this));
- return this
- },
- _backPage: function(b) {
- var d = this.data("t");
- b ? d.pageObjs[0] || (b = j("<div />"), d.pageObjs[0] = j(b).css({
- "float": "left"
- }).addClass("page p0"), f._addPage.call(this, 0)) : d.pageObjs[0] && f._removePageFromDOM.call(this, 0, !0)
- },
- _addPage: function(b) {
- var d = this.data("t"),
- a = d.pageObjs[b];
- if (a && f._necessPage.call(this, b)) {
- if (!d.pageWrap[b]) {
- d.pageWrap[b] = j("<div/>", {
- "class": "page-wrapper",
- page: b,
- css: {
- position: "absolute",
- overflow: "hidden"
- }
- });
- this.append(d.pageWrap[b]);
- d.pageObjs[b].appendTo(d.pageWrap[b]);
- var c = f._pageSize.call(this, b, !0);
- a.css({
- width: c.width,
- height: c.height
- });
- d.pageWrap[b].css(c)
- }
- f._makeFlip.call(this, b)
- }
- },
- addHtml: function() {
- if (!window.Regions) throw C("Regions has not been loaded yet");
- },
- hasPage: function(b) {
- return L(b, this.data("t").pageObjs)
- },
- center: function(b) {
- var d = this.data("t"),
- a = j(this).turn("size"),
- c = 0;
- d.noCenter || (d.display == o["double"] && (b = this.turn("view", b || d.tpage || d.page), d.direction == F.ltr ? b[0] ? b[1] || (c += a.width / 4) : c -= a.width / 4 : b[0] ? b[1] || (c -= a.width / 4) : c += a.width / 4), j(this).css({
- marginLeft: c
- }));
- return this
- },
- destroy: function() {
- var b = this,
- d = this.data("t"),
- a = "end first flip last start turning turned zooming missing".split(" ");
- if (S("destroy", this) != c.prevented) {
- d.destroying = !0;
- j.each(a,
- function(a, d) {
- b.unbind(d)
- });
- this.unbind("press", f._touchStart);
- this.parent().unbind("start", d.eventHandlers.start);
- for (j(document).unbind("moving", d.eventHandlers.touchMove).unbind("unpress", d.eventHandlers.touchEnd); 0 !== d.totalPages;) this.turn("removePage", d.totalPages);
- d.fparent && d.fparent.remove();
- d.shadow && d.shadow.remove();
- this.removeData();
- d = null
- }
- return this
- },
- effect: function(b, d) {
- var a = this.data("t"),
- c;
- if (c = a.pageObjs[b]) {
- if (void 0 === d) return c.hasClass("hard") ? "hard": "sheet";
- var g = a.dynamicMode;
- a.dynamicMode = !1;
- switch (d) {
- case "hard":
- c.removeClass("sheet");
- c.addClass("hard");
- f._removePageFromDOM.call(this, b);
- break;
- case "sheet":
- c.removeClass("hard"),
- c.addClass("sheet"),
- f._removePageFromDOM.call(this, b)
- }
- a.dynamicMode = g;
- f._necessPage.call(this, b) && f._addPage.call(this, b);
- return this
- }
- throw C('Page "' + b + '" is not loaded yet');
- },
- is: function() {
- return "object" == typeof this.data("t")
- },
- _pageSize: function(b, d) {
- var a = this.data("t"),
- c = {};
- if (a.display == o.single) c.width = this.width(),
- c.height = this.height(),
- d && (c.top = 0, c.left = 0, c.right = "auto");
- else {
- var g = Math.floor(this.width() / 2),
- f = this.height();
- a.pageObjs[b].hasClass("own-size") ? (c.width = a.pageObjs[b].width(), c.height = a.pageObjs[b].height()) : (c.width = g, c.height = f);
- if (d) {
- var i = b % 2;
- c.top = (f - c.height) / 2;
- a.direction == F.ltr ? (c[i ? "right": "left"] = g - c.width, c[i ? "left": "right"] = "auto") : (c[i ? "left": "right"] = g - c.width, c[i ? "right": "left"] = "auto")
- }
- }
- return c
- },
- _makeFlip: function(b) {
- var d = this.data("t");
- if (!d.pages[b]) {
- var a = d.display == o.single,
- c = b % 2;
- d.pages[b] = d.pageObjs[b].css(f._pageSize.call(this, b)).flip({
- page: b,
- next: c || a ? b + 1 : b - 1
- });
- d.disabled && d.pages[b].flip("disable", !0);
- f._setPageLoc.call(this, b)
- }
- return d.pages[b]
- },
- _makeRange: function() {
- var b, d;
- if (! (1 > this.data("t").totalPages)) {
- d = this.turn("range");
- for (b = d[0]; b <= d[1]; b++) f._addPage.call(this, b)
- }
- },
- range: function(b) {
- var d, a, c, g = this.data("t"),
- b = b || g.tpage || g.page || 1;
- c = f._view.call(this, b);
- if (1 > b || b > g.totalPages) throw C('"' + b + '" is not a valid page');
- c[1] = c[1] || c[0];
- 1 <= c[0] && c[1] <= g.totalPages ? (b = Math.floor((g.options.cacheSize - 2) / 2), g.totalPages - c[1] > c[0] ? (d = Math.min(c[0] - 1, b), a = 2 * b - d) : (a = Math.min(g.totalPages - c[1], b), d = 2 * b - a)) : (d = g.options.cacheSize - 1, a = g.options.cacheSize - 1);
- return [Math.max(1, c[0] - d), Math.min(g.totalPages, c[1] + a)]
- },
- _necessPage: function(b) {
- if (0 === b) return ! 0;
- var d = this.data("t"),
- a = d.range || this.turn("range");
- return d.pageObjs[b].hasClass("fixed") || -1 != d.pageMv.indexOf(b) || -1 != d.front.indexOf(b) || b >= a[0] && b <= a[1]
- },
- _removeFromDOM: function() {
- if (!this.turn("animating")) {
- var b = this.data("t"),
- d;
- for (d in b.pageWrap) L(d, b.pageWrap) && (f._necessPage.call(this, parseInt(d, 10)) || f._removePageFromDOM.call(this, d))
- }
- },
- pageData: function(b, d) {
- var a = this.data("t");
- if (void 0 === d) return a.pageObjs[b].data("f");
- a.pageObjs[b].data("f", d)
- },
- _removePageFromDOM: function(b, d) {
- var a = this.data("t"),
- h = a.pageObjs,
- g = a.pages;
- if (!b || S("removePage", this, [b, h[b]]) != c.prevented) {
- if (a.pages[b]) {
- p._bringClipToFront.call(g[b], !1);
- var f = a.pages[b].data();
- f.f && f.f.clip && f.f.clip.remove();
- g[b].removeData();
- g[b].detach();
- delete g[b]
- }
- h[b] && h[b].detach();
- a.pageWrap[b] && (a.pageWrap[b].remove(), delete a.pageWrap[b]); (a.dynamicMode || d) && delete h[b];
- return ! 0
- }
- return ! 1
- },
- removePage: function(b) {
- var d = this.data("t");
- if ("*" == b) for (; 0 !== d.totalPages;) this.turn("removePage", d.totalPages);
- else {
- if (1 > b || b > d.totalPages) throw C("The page " + b + " doesn't exist");
- if (d.pageObjs[b] && (this.turn("stop"), !f._removePageFromDOM.call(this, b, !0))) return ! 1;
- f._movePages.call(this, b, -1);
- d.totalPages -= 1;
- d.page > d.totalPages ? (d.page = null, f._fitPage.call(this, d.totalPages)) : (f._makeRange.call(this), this.turn("update"))
- }
- return this
- },
- _movePages: function(b, d) {
- var a, c = this,
- g = this.data("t"),
- l = g.display == o.single,
- i = function(a) {
- var b = a + d,
- i = b % 2,
- j = i ? " odd ": " even ";
- g.pageObjs[a] && (g.pageObjs[b] = g.pageObjs[a].removeClass("p" + a + " odd even").addClass("p" + b + j));
- if (g.pageWrap[a] && (g.pageWrap[b] = g.pageObjs[b].hasClass("fixed") ? g.pageWrap[a].attr("page", b) : g.pageWrap[a].css(f._pageSize.call(c, b, !0)).attr("page", b), g.pages[a] && (g.pages[b] = g.pages[a], g.pages[b].data("f").page = b, g.pages[b].data("f").next = l || i ? b + 1 : b - 1), d)) delete g.pages[a],
- delete g.pageObjs[a],
- delete g.pageWrap[a]
- };
- if (0 < d) for (a = g.totalPages; a >= b; a--) i(a);
- else for (a = b; a <= g.totalPages; a++) i(a)
- },
- display: function(b) {
- var d = this.data("t"),
- a;
- d.display && (a = 1 == d.display ? "single": "double");
- if (void 0 === b) return a;
- if (1 == d.zoom && b != a) {
- if (!o[b]) throw C('"' + b + '" is not a value for display');
- var h = S("changeDisplay", this, [b, a]);
- if (!d.done || h != c.prevented) {
- switch (b) {
- case "single":
- f._backPage.call(this, !0);
- this.addClass("shadow");
- break;
- case "double":
- f._backPage.call(this, !1),
- this.removeClass("shadow")
- }
- d.display = o[b];
- a && (h = this.turn("size"), f._movePages.call(this, 1, 0), this.turn("size", h.width, h.height), this.turn("update"), this.removeClass(a))
- }
- this.addClass(b);
- f._cloneView.call(this, !1);
- d.slider && v._resize.call(j(d.slider));
- return this
- }
- },
- direction: function(b) {
- var d = this.data("t"),
- a;
- d.direction && (a = 1 == d.direction ? "ltr": "rtl");
- if (void 0 === b) return a;
- b = b.toLowerCase();
- if (!F[b]) throw C('"' + b + '" is not a value for direction');
- "rtl" == b && j(this).attr("dir", "ltr").css({
- direction: "ltr"
- });
- d.direction = F[b];
- d.done && this.turn("size", j(this).width(), j(this).height());
- return this
- },
- animating: function() {
- var b = this.data("t");
- return 0 < b.pageMv.length || "turning" == b.status
- },
- isFlipping: function() {
- var b = this.data("t"),
- d;
- for (d in b.pages) if (L(d, b.pages) && b.pages[d].flip("isTurning")) return ! 0;
- return ! 1
- },
- corner: function() {
- return this.data("t").corner || null
- },
- data: function() {
- return this.data("t")
- },
- disable: function(b) {
- var d, a = this.data("t"),
- c = this.turn("view");
- a.disabled = void 0 === b || !0 === b;
- for (d in a.pages) L(d, a.pages) && a.pages[d].flip("disable", a.disabled ? !0 : -1 == j.inArray(parseInt(d, 10), c));
- return this
- },
- disabled: function(b) {
- return void 0 === b ? !0 === this.data("t").disabled: this.turn("disable", b)
- },
- viewSize: function() {
- var b = this.turn("size");
- if (this.turn("display") == o["double"]) {
- var d = this.turn("view");
- if (!d[0] || !d[1]) b.width = Math.floor(b.width / 2)
- }
- return b
- },
- size: function(b, d) {
- if (void 0 === b || void 0 === d) return {
- width: this.width(),
- height: this.height()
- };
- var a = this.data("t"),
- c,
- g;
- this.turn("stop");
- this.css({
- width: b,
- height: d
- });
- if (1 < a.zoom) for (var l = this.turn("view"), i = 0; i < l.length; i++) {
- if (c = l[i]) g = f._pageSize.call(this, c, !0),
- a.pageObjs[c].css({
- width: g.width,
- height: g.height
- }),
- a.pageWrap[c].css(g),
- a.pages[c] && (p._restoreClip.call(a.pages[c], !1, !0), a.pages[c].flip("resize").css({
- width: g.width,
- height: g.height
- }))
- } else for (c in a.pageWrap) L(c, a.pageWrap) && (g = f._pageSize.call(this, c, !0), a.pageObjs[c].css({
- width: g.width,
- height: g.height
- }), a.pageWrap[c].css(g), a.pages[c] && (p._restoreClip.call(a.pages[c]), a.pages[c].flip("resize").css({
- width: g.width,
- height: g.height
- })));
- a.pages[0] && (a.pageWrap[0].css({
- left: -this.width()
- }), a.pages[0].flip("resize"));
- f._updateShadow.call(this);
- a.options.autoCenter && this.turn("center");
- this.css(f._position.call(this));
- a.pages[0] && (c = a.pages[0].data("f").tPage) && a.pageObjs[0].children().eq(0).css({
- width: a.pageObjs[c].width(),
- height: a.pageObjs[c].height()
- });
- a.peel && this.turn("peel", a.peel.corner, a.peel.x, a.peel.y, !1);
- return this
- },
- _size: function(b, d) {
- var a = f._defaultSize.call(this);
- a.width *= b;
- a.height *= b;
- d && f._halfWidth.call(this) && (a.width = Math.floor(a.width / 2));
- return a
- },
- _position: function(b) {
- var d = this.data("t"),
- a = b ? f._size.call(this, b) : this.turn("size"),
- c = {
- top: 0,
- left: 0
- };
- if (d.options.responsive && (c.top = d.viewerHeight / 2 - a.height / 2, c.left = d.viewerWidth / 2 - a.width / 2, 1 == (b || d.zoom))) {
- b = d.margins;
- if (c.top < b[0] || c.top + a.height > d.viewerHeight - b[2]) c.top = b[0];
- if (c.left < b[1] || c.left + a.width > d.viewerWidth - b[3]) c.left = b[1]
- }
- return c
- },
- _view: function(b) {
- var d = this.data("t"),
- b = b || d.page;
- return d.display == o["double"] ? b % 2 ? [b - 1, b] : [b, b + 1] : [b]
- },
- view: function(b, d) {
- var a = this.data("t"),
- c = f._view.call(this, b),
- g = [];
- a.display == o["double"] ? d ? (0 < c[0] && g.push(c[0]), c[1] <= a.totalPages && g.push(c[1])) : (0 < c[0] ? g.push(c[0]) : g.push(0), c[1] <= a.totalPages ? g.push(c[1]) : g.push(0)) : d ? 0 < c[0] && c[0] <= a.totalPages && g.push(c[0]) : 0 < c[0] && c[0] <= a.totalPages ? g.push(c[0]) : g.push(0);
- return g
- },
- stop: function() {
- var b = this.data("t"),
- d,
- a;
- if (this.turn("animating")) {
- var c = b.display == o.single;
- b.tpage && (b.page = b.tpage, delete b.tpage);
- for (; 0 < b.pageMv.length;) if (a = b.pages[b.pageMv[0]], d = a.data("f")) {
- var g = d.peel;
- d.peel = null;
- a.flip("hideFoldedPage");
- d.peel = g;
- d.next = c ? d.page + 1 : 0 === d.page % 2 ? d.page - 1 : d.page + 1;
- p._bringClipToFront.call(a, !1)
- }
- b.status = "";
- this.turn("update")
- }
- return this
- },
- pages: function(b) {
- var d = this.data("t");
- if (b) {
- if (b < d.totalPages) for (var a = d.totalPages; a > b; a--) this.turn("removePage", a);
- d.totalPages = b;
- f._fitPage.call(this, d.page);
- return this
- }
- return d.totalPages
- },
- _missing: function(b) {
- var d = this.data("t");
- if (! (1 > d.totalPages)) {
- for (var a = this.turn("range", b), c = [], b = a[0]; b <= a[1]; b++) d.pageObjs[b] || c.push(b);
- 0 < c.length && this.trigger("missing", [c])
- }
- },
- _fitPage: function(b) {
- var d = this.data("t"),
- a = this.turn("view", b);
- d.range = this.turn("range", b);
- f._missing.call(this, b);
- d.pageObjs[b] && ( - 1 != j.inArray(1, a) ? this.addClass("first-page") : this.removeClass("first-page"), -1 != j.inArray(d.totalPages, a) ? this.addClass("last-page") : this.removeClass("last-page"), d.status = "", d.peel = null, d.page = b, d.display != o.single && this.turn("stop"), f._removeFromDOM.call(this), f._makeRange.call(this), f._updateShadow.call(this), f._cloneView.call(this, !1), this.trigger("turned", [b, a]), this.turn("update"), d.options.autoCenter && this.turn("center"))
- },
- _turnPage: function(b, d) {
- var a, h, g = this.data("t"),
- l = this.turn("view"),
- i = this.turn("view", b);
- g.display == o.single ? (a = l[0], h = i[0]) : l[1] && b > l[1] ? (a = l[1], h = i[0]) : l[0] && b < l[0] && (a = l[0], h = i[1]);
- var k = g.options.turnCorners.split(","),
- m = g.pages[a].data("f"),
- p = m.dpoint;
- d || (d = "hard" == m.effect ? g.direction == F.ltr ? b > a ? "r": "l": b > a ? "l": "r": g.direction == F.ltr ? j.trim(k[b > a ? 1 : 0]) : j.trim(k[b > a ? 0 : 1]));
- if (g.page != b) {
- if (S("turning", this, [b, i, d]) == c.prevented) { - 1 != j.inArray(a, g.pageMv) && g.pages[a].flip("hideFoldedPage", !0);
- return
- } - 1 != j.inArray(1, i) ? (this.addClass("first-page"), this.trigger("first")) : this.removeClass("first-page"); - 1 != j.inArray(g.totalPages, i) ? (this.addClass("last-page"), this.trigger("last")) : this.removeClass("last-page")
- }
- g.status = "turning";
- g.range = this.turn("range", b);
- f._missing.call(this, b);
- g.pageObjs[b] && (f._cloneView.call(this, !1), Math.abs((g.tpage || g.page) - b) > l.length && this.turn("stop"), g.page = b, f._makeRange.call(this), g.tpage = h, m.dpoint = m.next != h ? null: p, m.next = h, -1 == g.pageMv.indexOf(h) ? g.pages[a].flip("turnPage", d) : (g.options.autoCenter && this.turn("center", h), g.status = "", g.pages[h].flip("hideFoldedPage", !0)), this.turn("update"))
- },
- page: function(b) {
- var d = this.data("t");
- if (void 0 === b) return d.page;
- 1 < this.turn("zoom") && this.turn("zoomOut", {
- animate: !1
- });
- if (!d.disabled && !d.destroying) {
- b = parseInt(b, 10);
- if (0 < b && b <= d.totalPages) return b != d.page && (!d.done || -1 != j.inArray(b, this.turn("view")) ? f._fitPage.call(this, b) : f._turnPage.call(this, b)),
- this;
- throw C("The page " + b + " does not exist");
- }
- },
- pageElement: function(b) {
- return this.data("t").pageObjs[b]
- },
- next: function() {
- return this.turn("page", Math.min(this.data("t").totalPages, f._view.call(this, this.data("t").page).pop() + 1))
- },
- previous: function() {
- return this.turn("page", Math.max(1, f._view.call(this, this.data("t").page).shift() - 1))
- },
- peel: function(b, d, a, c) {
- var g = this.data("t");
- if (b) {
- if (1 == this.turn("zoom")) if (c = void 0 !== c ? c: !0, g.display == o.single) g.peel = y(b, d, a),
- g.pages[g.page].flip("peel", y(b, d, a), c);
- else {
- var f = this.turn("view"),
- f = -1 != j.inArray(b, M.backward) ? f[0] : f[1];
- g.pages[f] && (g.peel = y(b, d, a), g.pages[f].flip("peel", g.peel, c))
- }
- } else g.peel = null,
- this.turn("stop", !0);
- return this
- },
- _eventStart: function(b, d, a) {
- d = j(b.target).data("f");
- b.isDefaultPrevented() || (b = d.turnData, b.display == o.single && a && (d.next = "l" == a.charAt(1) && b.direction == F.ltr || "r" == a.charAt(1) && b.direction == F.rtl ? d.next < d.page ? d.next: d.page - 1 : d.next > d.page ? d.next: d.page + 1));
- f._updateShadow.call(d.turn)
- },
- _eventEnd: function(b, d, a) {
- var c = j(b.target),
- b = c.data("f"),
- g = b.turn,
- l = b.turnData;
- if (a || !b.peel || b.peel.corner != b.dpoint.corner) c.flip("hide"),
- l.front.splice(l.front.indexOf(parseInt(b.next, 10)), 1),
- l.pageMv.splice(l.pageMv.indexOf(parseInt(b.page, 10)), 1),
- 0 === l.front.length && (l.corner = null);
- a ? (d = l.tpage || l.page, d == b.next || d == b.page ? (delete l.tpage, f._fitPage.call(g, d || b.next, !0)) : l.pageWrap[b.page].hide()) : l.display == o.single && d == l.tpage ? (delete l.tpage, f._fitPage.call(g, d, !0)) : (g.turn("update"), f._updateShadow.call(g))
- },
- _eventFlip: function(b) {
- var d = j(b.target).data("f");
- b.stopPropagation();
- d.turn.trigger("turn", [d.next]);
- d.turnData.options.autoCenter && d.turn.turn("center", d.next)
- },
- _touchStart: function(b) {
- var d = j(this),
- a = d.data("t");
- j(b.target);
- a.finger = K(b);
- a.fingerZoom = a.zoom;
- for (var c in a.pages) if (L(c, a.pages) && p._start.call(a.pages[c], b)) {
- a.tmpListeners || (a.tmpListeners = {},
- a.tmpListeners.tap = D(d, "tap", !0), a.tmpListeners.doubleTap = D(d, "doubleTap", !0));
- b.preventDefault();
- return
- }
- a.options.smartFlip && b.preventDefault()
- },
- _touchMove: function(b) {
- var d = this.data("t"),
- a;
- for (a in d.pages) L(a, d.pages) && p._move.call(d.pages[a], b);
- if (d.finger) a = j.extend({},
- d.finger),
- d.tmpListeners || (d.tmpListeners = {},
- d.tmpListeners.tap = D(this, "tap", !0), d.tmpListeners.doubleTap = D(this, "doubleTap", !0)),
- d.finger = K(b),
- d.finger.prev = a,
- 1 < d.zoom && (!R || R && 1 == b.originalEvent.touches.length) && this.turn("scroll", d.scroll.left + a.x - d.finger.x, d.scroll.top + a.y - d.finger.y);
- else if (!R && 1 < d.zoom && d.options.autoScroll) {
- d.initScroll || (d.initScroll = this.turn("scroll"), d.initCursor = K(b));
- b = K(b);
- a = u(d.initScroll.x, d.initScroll.y);
- var c = this.turn("scrollSize");
- b.x < d.initCursor.x ? a.x = d.initScroll.left * (b.x / d.initCursor.x) : b.x > d.initCursor.x && (a.x = d.initScroll.left + (c.width - d.initScroll.left) * ((b.x - d.initCursor.x) / (d.viewerWidth - d.initCursor.x)));
- b.y < d.initCursor.y ? a.y = d.initScroll.top * (b.y / d.initCursor.y) : b.y > d.initCursor.y && (a.y = d.initScroll.top + (c.height - d.initScroll.top) * ((b.y - d.initCursor.y) / (d.viewerHeight - d.initCursor.y)));
- this.turn("scroll", a.x, a.y)
- }
- },
- _touchEnd: function(b) {
- var d = this.data("t"),
- a = this;
- setTimeout(function() {
- if (d.tmpListeners) {
- for (var b = d.tmpListeners.tap,
- c = 0; c < b.length; c++) a.bind("tap", b[c]);
- b = d.tmpListeners.doubleTap;
- for (c = 0; c < b.length; c++) a.bind("doubleTap", b[c]);
- delete d.tmpListeners
- }
- },
- 1);
- if (d.finger) {
- for (var c in d.pages) L(c, d.pages) && p._end.call(d.pages[c], b);
- delete d.finger;
- delete d.fingerZoom;
- d.zoomed && (f.zoom.apply(this, d.zoomed), delete d.zoomed)
- }
- },
- _eventSwipe: function(b, d) {
- var a = j(this),
- c = a.data("t");
- if (!a.turn("isFlipping") && 1 == c.zoom) {
- var g = c.direction == F.ltr,
- f;
- if ( - 0.5 > d) if (f = a.turn("view").pop(), c.display == o["double"]) {
- if (a.turn("animating")) if (g) {
- if (0 === c.pageMv[0] % 2) return
- } else if (0 !== c.pageMv[0] % 2) return;
- a.turn("next")
- } else - 1 != j.inArray(c.corner, M.forward) ? a.turn("next") : 1 < f && c.pages[f - 1] && (c.pages[f].data("f").status = "swiped", c.pages[f - 1].flip("turnPage", c.pages[f - 1].data("f").point.corner));
- else if (0.5 < d) if (f = a.turn("view").shift(), c.display == o["double"]) {
- if (a.turn("animating")) if (g) {
- if (0 !== c.pageMv[0] % 2) return
- } else if (0 === c.pageMv[0] % 2) return;
- a.turn("previous")
- } else - 1 != j.inArray(c.corner, M.backward) ? a.turn("previous") : (c.pages[f].data("f").status = "swiped", c.pages[f].flip("hideFoldedPage", !0))
- }
- },
- _resizeObserver: function() {
- if (this.turn("is")) {
- var b = this.data("t"),
- d = b.options.viewer;
- if (b.viewerWidth != d.width() || b.viewerHeight != d.height()) b.viewerWidth = d.width(),
- b.viewerHeight = d.height(),
- f._resize.call(this);
- setTimeout(j.proxy(f._resizeObserver, this), 10)
- }
- },
- _defaultSize: function(b) {
- var d = this.data("t"),
- a = d.viewerWidth - d.margins[1] - d.margins[3],
- c = d.viewerHeight - d.margins[0] - d.margins[2],
- g = V({
- width: d.options.width,
- height: d.options.height,
- boundWidth: Math.min(d.options.width, a),
- boundHeight: Math.min(d.options.height, c)
- });
- if (d.options.responsive) {
- a = V({
- width: d.options.width / 2,
- height: d.options.height,
- boundWidth: Math.min(d.options.width / 2, a),
- boundHeight: Math.min(d.options.height, c)
- });
- d = d.viewerWidth * d.viewerHeight;
- if (d - a.width * a.height < d - g.width * g.height && !b || b == o.single) return {
- width: a.width,
- height: a.height,
- display: "single"
- };
- 0 !== g.width % 2 && (g.width -= 1)
- }
- return {
- width: g.width,
- height: g.height,
- display: "double"
- }
- },
- _resize: function() {
- var b, d, a, c = this.data("t");
- if (c.options.responsive) {
- var g = this.turn("view");
- if (1 == c.zoom) {
- a = c.options.defaultZoomMargin;
- b = c.options.viewer;
- if (a) {
- var i;
- d = function(a, b) {
- c.margins[(a - 1) / 2] = "%" == i[a + 1] ? Math.max(0, i[a] / 100 * b) : Math.max(0, parseInt(i[a], 10))
- };
- if (i = /^(\d+)(px|%)\s+(\d+)(px|%)$/.exec(a)) d(1, b.height()),
- d(3, b.width()),
- c.margins[2] = c.margins[0],
- c.margins[3] = c.margins[1];
- else if (i = /^(\d+)(px|%)\s+(\d+)(px|%)\s+(\d+)(px|%)\s+(\d+)(px|%)$/.exec(a)) d(1, b.height()),
- d(3, b.width()),
- d(5, b.height()),
- d(7, b.width())
- }
- b = c.slider;
- c.slider = null;
- a = f._defaultSize.call(this);
- this.turn("display", a.display);
- c.slider = b;
- a.display != c.display && (a = f._defaultSize.call(this, c.display));
- this.turn("size", a.width * c.zoom, a.height * c.zoom)
- } else this.turn("scroll", c.scroll.left, c.scroll.top);
- if (c.zoomer) {
- a = f._defaultSize.call(this, c.display);
- c.zoomer.css({
- width: a.width,
- height: a.height
- });
- d = c.zoomer.children();
- for (b = 0; b < d.length; b++) j(d[b]).css({
- width: a.width / g.length,
- height: a.height
- })
- }
- c.slider && v._resize.call(j(c.slider))
- }
- },
- focusPoint: function() {
- var b = this.data("t");
- if (b.focusPoint) return b.focusPoint;
- b = this.turn("view");
- return b[0] ? b[1] ? u(this.width() / 2, this.height() / 2) : u(3 * this.width() / 4, this.height() / 2) : u(this.width() / 4, this.height() / 2)
- },
- maxZoom: function() {
- var b = this.data("t");
- if (b.options.responsive) {
- var d = b.viewerHeight - b.margins[0] - b.margins[2];
- return b.options.width / V({
- width: b.options.width,
- height: b.options.height,
- boundWidth: Math.min(b.options.width, b.viewerWidth - b.margins[1] - b.margins[3]),
- boundHeight: Math.min(b.options.height, d)
- }).width
- }
- return b.options.zoom
- },
- zoomIn: function(b) {
- this.data("t");
- return this.turn("zoom", this.turn("maxZoom"), b)
- },
- zoomOut: function(b) {
- return this.turn("zoom", 1, b)
- },
- _halfWidth: function() {
- var b = this.data("t"),
- d = this.turn("view");
- return b.display == o["double"] && b.options.autoCenter && (!d[0] || !d[1])
- },
- scrollSize: function() {
- var b = this.data("t"),
- d = this.turn("size"),
- a = f._halfWidth.call(this) ? d.width / 2 : d.width;
- return {
- width: Math.max(0, a - b.viewerWidth),
- height: Math.max(0, d.height - b.viewerHeight)
- }
- },
- scroll: function(b, d) {
- var a = this.data("t");
- if (void 0 === d && void 0 === b) return a.scroll;
- if (1 < a.zoom && !a.zooming) {
- var h = this.turn("size");
- this.turn("view");
- var g = this.turn("scrollSize"),
- h = u(a.viewerWidth / 2 - h.width / 2, a.viewerHeight / 2 - h.height / 2),
- d = Math.min(g.height, Math.max(0, d)),
- b = Math.min(g.width, Math.max(0, b));
- S("scrolling", this, [b, d]) != c.prevented && (h.x = h.x + g.width / 2 - b, h.y = h.y + g.height / 2 - d, this.css({
- left: h.x,
- top: h.y
- }), a.scroll = {
- top: d,
- left: b
- })
- }
- return this
- },
- _mouseRel: function(b) {
- var d = this.offset(),
- a = this.data("t"),
- c = this.turn("size"),
- b = u(b.pageX - d.left, b.pageY - d.top);
- if (a.display == o["double"] && a.options.autoCenter) if (a = this.turn("view"), a[0]) if (a[1]) {
- if (0 > b.x || b.x > c.width) return null
- } else {
- if (b.x = b.x, 0 > b.x || b.x > c.width / 2) return null
- } else if (b.x -= c.width / 2, 0 > b.x || b.x > c.width / 2) return null;
- return b
- },
- zoom: function(b, d) {
- var a = this.data("t");
- if (void 0 === b) return a.zoom;
- var d = d || {},
- h = this.turn("size"),
- g = f._halfWidth.call(this);
- if ("pageX" in d && "pageY" in d) {
- var i = f._mouseRel.call(this, d);
- if (null === i) return this;
- d = j.extend(d, i);
- "factor" in d && (b = d.factor * a.fingerZoom, d.animate = !1)
- } else "x" in d && "y" in d || (d.x = g ? h.width / 4 : h.width / 2, d.y = h.height / 2);
- if (a.zooming || S("zooming", this, [b, a.zoom]) != c.prevented) {
- var t, m = this,
- i = a.zoom,
- p = this.turn("view"),
- s = parseFloat(Math.min(this.turn("maxZoom"), Math.max(1, b)), 10),
- v = f._position.call(this, s),
- w = k + "transition",
- x = void 0 === d.animate ? !0 : d.animate,
- y = this.offset(),
- D = a.options.viewer.offset(),
- B = f._size.call(this, s, !0),
- E = s > a.zoom ? s: 1 / a.zoom * s,
- C = a.display == o["double"] && a.options.autoCenter,
- L = u(Math.max(0, B.width - a.viewerWidth), Math.max(0, B.height - a.viewerHeight)),
- E = u(d.x * E - y.left - d.x, d.y * E - d.y - y.top);
- C && !p[0] && (E.x -= h.width / 2);
- E = u(Math.min(L.x, Math.max(0, E.x)), Math.min(L.y, Math.max(0, E.y)));
- g && (v.left += B.width / 2);
- g = u(D.left - y.left + Math.max(0, v.left), D.top - y.top + Math.max(0, v.top));
- C && !p[0] && (g.x -= B.width);
- var N = r(g.x - E.x, g.y - E.y) + q(s, s, !0);
- this.turn("stop");
- this.turn("disable", !0);
- f._cloneView.call(this, !0);
- a.zoomer.css({
- visibility: "visible"
- });
- if (x) {
- if (s < i) for (t in a.pageWrap) a.pageWrap[t].css({
- visibility: "hidden"
- });
- a.zooming = !0;
- t = h.width / a.zoomer.width();
- a.zoomer.transform(q(t, t, !0), "0% 0%");
- setTimeout(function() {
- var b = {};
- b[w] = k + "transform 0.5s ease-in-out";
- a.zoomer.css(b);
- a.zoomer.transform(N, "0% 0%")
- },
- 0);
- Y(a.zoomer,
- function() {
- a.finger || m.turn("zoom", b, {
- animate: false,
- x: d.x,
- y: d.y
- })
- })
- } else if (B = {},
- h = a.peel, B[w] = "", a.zoomer.css(B), a.zoomer.transform(N, "0% 0%"), "factor" in d) {
- if (s < i) for (t in a.pageWrap) a.pageWrap[t].css({
- visibility: "hidden"
- });
- a.zoomed = [b, {
- x: d.x,
- y: d.y,
- animate: !1
- }]
- } else {
- for (t in a.pageWrap) a.pageWrap[t].css({
- visibility: ""
- });
- a.zoom = b;
- B = f._defaultSize.call(this);
- B.width *= s;
- B.height *= s;
- a.zoom = s;
- a.zooming = !1;
- delete a.initScroll;
- delete a.initCursor;
- a.peel = null;
- this.turn("display", B.display);
- this.turn("size", B.width, B.height);
- this.turn("scroll", E.x, E.y);
- 1 == s ? (this.turn("disable", !1), h && this.turn("peel", h.corner, h.x, h.y, !0)) : a.peel = h;
- a.options.autoScaleContent && this.turn("scaleContent", s);
- S("zoomed", this, [s, i]);
- a.zoomer.css({
- visibility: "hidden"
- })
- }
- }
- return this
- },
- calculateZ: function() {
- var b = this.data("t"),
- d = {
- pageZ: {},
- pageV: {}
- },
- a = b.pageMv.length,
- c = b.front.length,
- g,
- f,
- i;
- if (b.display == o.single) {
- for (g = 0; g < a; g++) d.pageV[b.pageMv[g]] = !0,
- d.pageV[b.pages[b.pageMv[g]].data("f").next] = !0,
- d.pageZ[b.pageMv[g]] = 3 + (a - g);
- d.pageV[0] = !0;
- d.pageZ[0] = 3 + a + 1
- } else {
- for (g = 0; g < a; g++) {
- i = this.turn("view", b.pageMv[g]);
- for (f = 0; f < i.length; f++) d.pageV[i[f]] = !0;
- d.pageZ[b.pageMv[g]] = 3 + (a - g)
- }
- for (g = 0; g < c; g++) {
- i = this.turn("view", b.front[g]);
- d.pageZ[b.front[g]] = 3 + a + 1 + g;
- for (f = 0; f < i.length; f++) d.pageV[i[f]] = !0
- }
- }
- return d
- },
- scaleContent: function(b) {
- for (var d = this.data("t"), a = this.turn("view"), c = 0; c < a.length; c++) a[c] && d.pageObjs[a[c]].transform("scale(" + b + ")", "0% 0%")
- },
- update: function() {
- var b, d, a = this.data("t");
- if (this.turn("animating") && 0 !== a.pageMv[0]) {
- var c, g = this.turn("calculateZ"),
- i = this.turn("view"),
- k = this.turn("view", a.tpage);
- d = "" === a.status ? a.options.hover: !1;
- for (b in a.pageWrap) L(b, a.pageWrap) && (c = a.pageObjs[b].hasClass("fixed"), a.pageWrap[b].css({
- display: g.pageV[b] || c ? "": "none",
- zIndex: g.pageZ[b] || (c ? -1 : 0)
- }), a.tpage ? a.pages[b].flip("hover", !1).flip("disable", -1 == j.inArray(parseInt(b, 10), a.pageMv) && b != k[0] && b != k[1]) : a.pages[b].flip("hover", d).flip("disable", b != i[0] && b != i[1]))
- } else for (b in d = a.options.hover, a.pageWrap) L(b, a.pageWrap) && (c = f._setPageLoc.call(this, b), a.pages[b] && a.pages[b].flip("disable", a.disabled || 1 != c).flip("hover", d));
- return this
- },
- _updateShadow: function() {
- var b, d = this.data("t"),
- a = this.width(),
- c = this.height(),
- g = d.display == o.single ? a: a / 2,
- f = this.turn("view");
- d.shadow || (d.shadow = j("<div />", {
- "class": "shadow",
- css: s(0, 0, 0).css
- }).appendTo(this));
- for (var i = 0; i < d.pageMv.length && f[0] && f[1]; i++) f = this.turn("view", d.pages[d.pageMv[i]].data("f").next),
- b = this.turn("view", d.pageMv[i]),
- f[0] = f[0] && b[0],
- f[1] = f[1] && b[1];
- switch (f[0] ? f[1] ? 3 : d.direction == F.ltr ? 2 : 1 : d.direction == F.ltr ? 1 : 2) {
- case 1:
- d.shadow.css({
- width:
- g,
- height: c,
- top: 0,
- left: g
- });
- break;
- case 2:
- d.shadow.css({
- width:
- g,
- height: c,
- top: 0,
- left: 0
- });
- break;
- case 3:
- d.shadow.css({
- width:
- a,
- height: c,
- top: 0,
- left: 0
- })
- }
- },
- _setPageLoc: function(b) {
- var d = this.data("t"),
- a = this.turn("view"),
- c = this.turn("animating");
- if (b == a[0] || b == a[1]) return c || d.pageWrap[b].css({
- zIndex: 2,
- display: ""
- }),
- 1;
- if (d.display == o.single && b == a[0] + 1 || d.display == o["double"] && b == a[0] - 2 || b == a[1] + 2) return c || d.pageWrap[b].css({
- zIndex: 1,
- display: ""
- }),
- 2; ! c && -1 == d.front.indexOf(parseInt(b, 10)) && (d.pageWrap[b].css({
- zIndex: 0,
- display: d.pageObjs[b].hasClass("fixed") ? "": "none"
- }), d.pages[b] && (d.pages[b].data("f").visible = !1));
- return 0
- },
- options: function(b) {
- if (void 0 === b) return this.data("t").options;
- var d = this.data("t");
- j.extend(d.options, b);
- b.pages && this.turn("pages", b.pages);
- b.page && this.turn("page", b.page);
- b.display && this.turn("display", b.display);
- b.direction && this.turn("direction", b.direction);
- b.width && b.height && this.turn("size", b.width, b.height);
- if (b.cornerPosition) {
- var a = b.cornerPosition.split(" ");
- d.options.cornerPosition = u(parseInt(a[0], 10), parseInt(a[1], 10))
- }
- b.defaultZoomMargin && f._resize.call(this);
- if (b.events) for (var c in b.events) L(c, b.events) && this.unbind(c).bind(c, b.events[c]);
- return this
- },
- version: function() {
- return "5"
- },
- _cloneView: function(b) {
- var d = this.data("t");
- if (d.zoomer) b ? d.zoomer.show() : (d.zoomer.remove(), delete d.zoomer);
- else if (b) {
- var a, c = this.turn("view"),
- g = j("<div />");
- g.css({
- position: "absolute",
- top: 0,
- left: 0,
- zIndex: 1E5,
- width: this.width(),
- height: this.height()
- });
- for (var i = 0; i < c.length; i++) c[i] && (b = f._pageSize.call(this, c[i], !0), b.position = "absolute", a = d.pageObjs[c[i]].clone(), a.css(b), a.appendTo(g));
- g.appendTo(this);
- d.zoomer = g
- }
- }
- },
- p = {
- init: function(b) {
- var d = this.parent().parent(),
- b = b || {};
- b.disabled = !1;
- b.hover = !1;
- b.effect = this.hasClass("hard") ? "hard": "sheet";
- b.turn = d;
- b.turnData = d.data("t");
- this.data("f", j.extend(this.data("f") || {},
- b));
- p._addPageWrapper.call(this);
- return this
- },
- _cornerAllowed: function() {
- var b = this.data("f"),
- d = b.page,
- a = b.turnData,
- c = a.direction == F.ltr,
- g = d % 2;
- switch (b.effect) {
- case "hard":
- return c ? [g ? "r": "l"] : [g ? "l": "r"];
- case "sheet":
- return a.display == o.single ? 1 == d ? c ? M.forward: M.backward: d == a.totalPages ? c ? M.backward: M.forward: "tapping" == b.status ? M.all: c ? M.forward: M.backward: c ? M[g ? "forward": "backward"] : M[g ? "backward": "forward"]
- }
- },
- _cornerActivated: function(b) {
- var d = this.width(),
- a = this.height(),
- b = y("", b.x, b.y);
- if (0 >= b.x || 0 >= b.y || b.x >= d || b.y >= a) return ! 1;
- var c = this.data("f"),
- g = c.turnData.options.cornerSize,
- f = p._cornerAllowed.call(this);
- switch (c.effect) {
- case "hard":
- if (b.x > d - g) b.corner = "r";
- else if (b.x < g) b.corner = "l";
- else return ! 1;
- break;
- case "sheet":
- (b.y < g ? b.corner += "t": b.y >= a - g && (b.corner += "b"), b.x <= g) ? b.corner += "l": b.x >= d - g && (b.corner += "r")
- }
- return ! b.corner || -1 == j.inArray(b.corner, f) ? !1 : b
- },
- _isIArea: function(b) {
- var b = K(b),
- d = this.data("f"),
- d = (d.clip || d.ipage).parent().offset();
- return p._cornerActivated.call(this, u(b.x - d.left, b.y - d.top))
- },
- _startPoint: function(b, d) {
- var a, d = d || u(0, 0);
- switch (b) {
- case "tr":
- d.x = this.width() - d.x;
- break;
- case "bl":
- d.y = this.height() - d.y;
- break;
- case "br":
- d.x = this.width() - d.x;
- d.y = this.height() - d.y;
- break;
- case "l":
- a = this.data("f");
- a.startPoint && (d.y = a.startPoint.y);
- break;
- case "r":
- d.x = this.width() - d.x,
- a = this.data("f"),
- a.startPoint && (d.y = a.startPoint.y)
- }
- return d
- },
- _endPoint: function(b, d) {
- var a, d = d || u(0, 0);
- switch (b) {
- case "tl":
- d.x = 2 * this.width() - d.x;
- break;
- case "tr":
- d.x = -this.width() + d.x;
- break;
- case "bl":
- d.x = 2 * this.width() - d.x;
- d.y = this.height() - d.y;
- break;
- case "br":
- d.x = -this.width() + d.x;
- d.y = this.height() - d.y;
- break;
- case "l":
- d.x = 2 * this.width() - d.x;
- a = this.data("f");
- a.startPoint && (d.y = a.startPoint.y);
- break;
- case "r":
- d.x = -this.width() - d.x,
- a = this.data("f"),
- a.startPoint && (d.y = a.startPoint.y)
- }
- return d
- },
- _foldingPage: function(b) {
- var d = this.data("f");
- if (d) {
- var a = d.turnData,
- b = b || "pageObjs";
- return a.display == o.single ? a[b][0] : d.over ? a[b][d.over] : a[b][d.next]
- }
- return ! 1
- },
- resize: function() {
- var b = this.data("f"),
- d = this.width(),
- a = this.height();
- switch (b.effect) {
- case "hard":
- b.ipage.css({
- width:
- d,
- height: a
- });
- b.igradient.css({
- width: d,
- height: a
- });
- b.ogradient.css({
- width: d,
- height: a
- });
- break;
- case "sheet":
- var c = Math.round(Math.sqrt(d * d + a * a));
- b.clip.css({
- width: c,
- height: c
- });
- b.ipage.css({
- width: d,
- height: a
- });
- b.igradient.css({
- width: 100,
- height: 2 * a,
- top: -a / 2
- });
- b.ogradient.css({
- width: 100,
- height: 2 * a,
- top: -a / 2
- })
- }
- return this
- },
- _addPageWrapper: function() {
- var b = this.data("f"),
- d = this.parent(),
- a;
- if (!b.ipage) {
- var c = j("<div />", {
- "class": "inner-page"
- }),
- g = j("<div />", {
- "class": "inner-gradient"
- }),
- f = j("<div />", {
- "class": "outer-gradient"
- });
- switch (b.effect) {
- case "hard":
- a = s(0, 0, 2).css;
- a[k + "transform-style"] = "preserve-3d";
- a[k + "backface-visibility"] = "hidden";
- c.css(a).appendTo(d).prepend(this);
- g.css(s(0, 0, 0).css).appendTo(c);
- f.css(s(0, 0, 0));
- b.ipage = c;
- b.igradient = g;
- b.ogradient = f;
- break;
- case "sheet":
- var i = j("<div />", {
- "class": "clip"
- });
- a = s(0, 0, 0).css;
- i.css(j.extend({
- "pointer-events": "none"
- },
- a));
- c.css(j.extend({
- cursor: "default"
- },
- a));
- a.zIndex = 1;
- g.css(j.extend({
- background: ea(!0),
- display: "none",
- visibility: "hidden"
- },
- a));
- f.css(j.extend({
- background: ea(!1),
- visibility: "hidden"
- },
- a));
- g.appendTo(c);
- c.appendTo(i).prepend(this);
- f.appendTo(d);
- i.appendTo(d);
- b.clip = i;
- b.ipage = c;
- b.igradient = g;
- b.ogradient = f
- }
- }
- p.resize.call(this)
- },
- _hard: function(b) {
- var d = this.data("f"),
- a = d.turnData,
- c = this.width();
- this.height();
- var g = "l" == b.corner,
- f = p._startPoint.call(this, b.corner),
- i = a.totalPages,
- j = d.options["z-index"] || i,
- m = {
- overflow: "visible"
- },
- o,
- q,
- s,
- r;
- b.x = g ? Math.min(Math.max(b.x, 0), 2 * c) : Math.max(Math.min(b.x, c), -c);
- var c = f.x ? (f.x - b.x) / c: b.x / c,
- v = 90 * c,
- w = 90 > v,
- x = a.pages[d.next].data("f");
- g ? (q = "0% 50%", s = "100% 50%", w ? (g = 0, r = d.next - 1, o = 0 < r, f = d.page, i = 1) : (g = "100%", r = d.page + 1, o = r < i, f = d.next, i = 0)) : (q = "100% 50%", s = "0% 50%", v = -v, w ? (g = 0, r = d.next + 1, f = d.page, o = r < i, i = 0) : (g = "-100%", r = d.page - 1, f = d.next, o = 0 < r, i = 1));
- m[k + "perspective-origin"] = s;
- a.pageWrap[d.page].css(m);
- d.ipage.transform("rotateY(" + v + "deg)translate3d(0px, 0px, " + (this.attr("depth") || 0) + "px)", s);
- x.ipage.transform("rotateY(" + (180 + v) + "deg)", q);
- w ? (c = -c + 1, d.ipage.css({
- zIndex: j + 1
- }), x.ipage.css({
- zIndex: j
- })) : (c -= 1, d.ipage.css({
- zIndex: j
- }), x.ipage.css({
- zIndex: j + 1
- }));
- if (a.options.gradients && (o ? (j = a.pages[r].data("f"), d.ogradient.parent()[0] != j.ipage[0] && d.ogradient.appendTo(j.ipage), d.ogradient.css({
- left: g,
- backgroundColor: "black",
- opacity: 0.5 * c
- }).transform("rotateY(0deg)")) : d.ogradient.css({
- opacity: 0
- }), a = a.pages[f].data("f"), d.igradient.parent()[0] != a.ipage[0] && d.igradient.appendTo(a.ipage), d.igradient.css({
- opacity: -c + 1
- }), a = d.igradient, j = u(100 * i, 0), m = u(100 * ( - i + 1), 0), i = [[0, "rgba(0,0,0,0.3)"], [1, "rgba(0,0,0,0)"]], g = [], "-webkit-" == k)) {
- for (c = 0; 2 > c; c++) g.push("color-stop(" + i[c][0] + ", " + i[c][1] + ")");
- a.css({
- "background-image": "-webkit-gradient(linear, " + j.x + "% " + j.y + "%," + m.x + "% " + m.y + "%, " + g.join(",") + " )"
- })
- }
- d.point = y(b.corner, b.x, b.y)
- },
- _pageCURL: function(b) {
- var d = this.data("f"),
- a = d.turnData,
- c = this.width(),
- g = this.height(),
- f,
- i,
- j,
- k,
- m = this,
- o = 0,
- s,
- v,
- w,
- x = u(0, 0),
- D = u(0, 0),
- E = u(0, 0);
- p._foldingPage.call(this);
- var C = a.options.acceleration,
- L = d.clip.height(),
- K = function() {
- f = p._startPoint.call(m, b.corner);
- var d;
- d = c - f.x - b.x;
- var q = f.y - b.y,
- r = Math.atan2(q, d);
- d = Math.sqrt(d * d + q * q);
- r = u(c - f.x - Math.cos(r) * c, f.y - Math.sin(r) * c);
- d > c && (b.x = r.x, b.y = r.y);
- var q = u(0, 0),
- y = u(0, 0);
- q.x = f.x ? f.x - b.x: b.x;
- q.y = aa ? f.y ? f.y - b.y: b.y: 0;
- y.x = j ? c - q.x / 2 : b.x + q.x / 2;
- y.y = q.y / 2;
- r = U - Math.atan2(q.y, q.x);
- d = r - Math.atan2(y.y, y.x);
- d = Math.sin(d) * Math.sqrt(y.x * y.x + y.y * y.y);
- E = u(d * Math.sin(r), d * Math.cos(r));
- if (r > U) {
- E.x += Math.abs(E.y * q.y / q.x);
- E.y = 0;
- if (Math.round(E.x * Math.tan(B - r)) < g) return b.y = Math.sqrt(Math.pow(g, 2) + 2 * y.x * q.x),
- i && (b.y = g - b.y),
- K();
- d = B - r;
- q = L - g / Math.sin(d);
- x = u(Math.round(q * Math.cos(d)), Math.round(q * Math.sin(d)));
- j && (x.x = -x.x);
- i && (x.y = -x.y)
- }
- o = Math.round(18E3 * (r / B)) / 100;
- k = Math.round(E.y / Math.tan(r) + E.x);
- d = c - k;
- q = Math.min(g, d * Math.tan(r));
- 0 > q && (q = g);
- var y = d * Math.cos(2 * r),
- C = d * Math.sin(2 * r);
- D = u(Math.round(j ? d - y: k + y), Math.round(i ? C: g - C));
- a.options.gradients && (y = p._endPoint.call(m, b.corner), w = Math.sqrt(Math.pow(y.x - b.x, 2) + Math.pow(y.y - b.y, 2)) / c, s = Math.min(100, d * Math.sin(r)), v = 1.3 * Math.min(d, q));
- E.x = Math.round(E.x);
- E.y = Math.round(E.y);
- return ! 0
- },
- M = function(b, f, l, m) {
- var o = ["0", "auto"],
- p = (c - L) * l[0] / 100,
- u = (g - L) * l[1] / 100,
- o = {
- left: o[f[0]],
- top: o[f[1]],
- right: o[f[2]],
- bottom: o[f[3]]
- },
- y = 90 != m && -90 != m ? j ? -1 : 1 : 0,
- B = l[0] + "% " + l[1] + "%",
- f = a.pages[d.over].data("f"),
- I = d.clip.parent().position().left - a.pageWrap[d.over].position().left;
- d.ipage.css(o).transform(N(m) + r(b.x + y, b.y, C), B);
- f.ipage.css(o).transform(N(m) + r(b.x + D.x - x.x - c * l[0] / 100, b.y + D.y - x.y - g * l[1] / 100, C) + N(Math.round(100 * (180 / m - 2) * m) / 100), B);
- d.clip.transform(r( - b.x + p - y, -b.y + u, C) + N( - m), B);
- f.clip.transform(r(I - b.x + x.x + p, -b.y + x.y + u, C) + N( - m), B);
- a.options.gradients && (i ? (j ? (l = m - 90, p = k - 50, s = -s) : (l = m - 270, p = c - k - 50), b = "50% 25%") : (j ? (p = k - 50, l = m - 270, s = -s) : (p = c - k - 50, l = m - 90), b = "50% 75%"), u = Math.max(0.5, 2 - w), 1 < u && (u = 1.7 <= u ? (2 - u) / 0.3 : 1), f.igradient.css({
- opacity: Math.round(100 * u) / 100
- }).transform(r(p, 0, C) + N(l) + q(s / 100, 1, C), b), i ? (j ? (l = -270 - m, v = -v, p = c - k - 20) : (l = -90 - m, p = k - 20), b = "20% 25%") : (j ? (l = -90 - m, p = c - k - 20, v = -v) : (l = 90 - m, p = k - 20), b = "20% 75%"), u = 0.3 > w ? w / 0.3 : 1, d.ogradient.css({
- opacity: Math.round(100 * u) / 100
- }).transform(r(p, 0, C) + N(l) + q( - v / 100, 1, C), b))
- },
- O,
- F,
- J,
- P;
- d.point = y(b.corner, b.x, b.y);
- switch (b.corner) {
- case "l":
- F = b.y - d.startPoint.y;
- J = b.x;
- P = Math.atan2(F, J);
- 0 < P ? (O = d.startPoint.y, F = Math.sqrt(J * J + F * F), O = 2 * O * Math.sin(P) + F, b.x = O * Math.cos(P), b.y = O * Math.sin(P), b.corner = "tl", i = j = !0, K(), M(E, [1, 0, 0, 1], [100, 0], o)) : (P = -P, O = g - d.startPoint.y, F = Math.sqrt(J * J + F * F), O = 2 * O * Math.cos(U - P) + F, b.x = O * Math.cos(P), b.y = g - O * Math.sin(P), b.corner = "bl", j = !0, K(), M(u(E.x, -E.y), [1, 1, 0, 0], [100, 100], -o));
- break;
- case "r":
- F = d.startPoint.y - b.y;
- J = c - b.x;
- P = Math.atan2(F, J);
- 0 > P ? (O = d.startPoint.y, P = -P, F = Math.sqrt(J * J + F * F), O = 2 * O * Math.sin(P) + F, b.x = c - O * Math.cos(P), b.y = O * Math.sin(P), b.corner = "tr", i = !0, K(), M(u( - E.x, E.y), [0, 0, 0, 1], [0, 0], -o)) : (O = g - d.startPoint.y, F = Math.sqrt(J * J + F * F), O = 2 * O * Math.cos(U - P) + F, b.x = c - O * Math.cos(P), b.y = g - O * Math.sin(P), b.corner = "br", K(), M(u( - E.x, -E.y), [0, 1, 1, 0], [0, 100], o));
- break;
- case "tl":
- j = i = !0;
- b.x = Math.max(b.x, 1);
- d.point.x = b.x;
- f = p._startPoint.call(this, "tl");
- K();
- M(E, [1, 0, 0, 1], [100, 0], o);
- break;
- case "tr":
- i = !0;
- b.x = Math.min(b.x, c - 1);
- d.point.x = b.x;
- K();
- M(u( - E.x, E.y), [0, 0, 0, 1], [0, 0], -o);
- break;
- case "bl":
- j = !0;
- b.x = Math.max(b.x, 1);
- d.point.x = b.x;
- K();
- M(u(E.x, -E.y), [1, 1, 0, 0], [100, 100], -o);
- break;
- case "br":
- b.x = Math.min(b.x, c - 1),
- d.point.x = b.x,
- K(),
- M(u( - E.x, -E.y), [0, 1, 1, 0], [0, 100], o)
- }
- },
- _fold: function(b) {
- var d = this.data("f");
- if (!d.dpoint || d.dpoint.corner != b.corner || d.dpoint.x != b.x || d.dpoint.y != b.y) {
- switch (d.effect) {
- case "hard":
- p._hard.call(this, b);
- break;
- case "sheet":
- p._pageCURL.call(this, b)
- }
- d.dpoint = y(b.corner, b.x, b.y);
- return ! 0
- }
- return ! 1
- },
- _bringClipToFront: function(b) {
- var d = this.data("f"),
- a = d.turnData,
- c = a.display == o.single;
- if (b) {
- b = c ? 0 : d.next;
- d.over && d.over != b && p._bringClipToFront.call(this, !1);
- if ("hard" == d.effect) d.igradient.show();
- else if ("sheet" == d.effect) {
- var g = a.pageWrap[b],
- f = a.pages[b].data("f"),
- i = g.width(),
- j = g.height();
- g.css({
- overflow: "visible",
- zIndex: 3 + a.front.length
- });
- f.ipage.css({
- overflow: "hidden",
- position: "absolute",
- width: i,
- height: j
- });
- f.igradient.show().css({
- visibility: "visible"
- });
- d.ipage.css({
- "z-index": 1
- });
- d.ogradient.show().css({
- zIndex: 2,
- visibility: "visible"
- });
- c && f.tPage != d.page && (a.pageObjs[0].find("*").remove(), a.pageObjs[d.page].clone(!1).css({
- opacity: "0.2",
- overflow: "hidden"
- }).transform("rotateY(180deg)", "50% 50%").appendTo(a.pageObjs[0]), f.tPage = d.page)
- }
- d.over = b
- } else d.over && ((a = a.pageWrap[d.over]) && a.css({
- overflow: "hidden",
- display: "none",
- zIndex: 0
- }), p._restoreClip.call(this, !0), delete d.over)
- },
- _restoreClip: function(b, d) {
- var a = this.data("f"),
- c = a.turnData,
- f = b ? r(0, 0, c.options.acceleration) : "",
- i;
- d ? i = a: c.pages[a.over] && (i = c.pages[a.over].data("f"));
- i && (i.clip && i.clip.transform(f), i.ipage.transform(f).css({
- top: 0,
- left: 0,
- right: "auto",
- bottom: "auto"
- }), i.igradient.hide())
- },
- _setFoldedPagePosition: function(b, d) {
- var a = this.data(),
- c = a.f,
- f = c.turnData;
- if (d) {
- var i = this,
- j = b.corner,
- a = c.point && c.point.corner == j ? c.point: p._startPoint.call(this, j, u(1, 1));
- this.animatef({
- from: [a.x, a.y],
- to: [b.x, b.y],
- duration: 500,
- easing: f.options.easing,
- frame: function(a) {
- b.x = Math.round(a[0]);
- b.y = Math.round(a[1]);
- b.corner = j;
- p._fold.call(i, b)
- }
- })
- } else p._fold.call(this, b),
- a.effect && !a.effect.turning && this.animatef(!1)
- },
- _showFoldedPage: function(b, d) {
- var a = this.data().f,
- h = p._foldingPage.call(this);
- if (a && h) {
- var h = a.visible,
- f = b.corner,
- i = a.turn,
- j = a.turnData;
- if (!h || !a.point || a.point.corner != b.corner) {
- var k = void 0 === j.tpage ? b.corner: null;
- j.corner = f;
- if (S("start", this, [a.page, k]) == c.prevented || a.effect != j.pages[a.next].data("f").effect) return ! 1;
- if ("hard" == a.effect && "turning" == j.status) for (f = 0; f < j.front.length; f++) if (!j.pages[j.front[f]].hasClass("hard")) {
- i.turn("stop");
- break
- }
- h || (j.front.push(j.display == o.single ? 0 : a.next), j.pageMv.push(a.page));
- a.startPoint = a.startPoint || u(b.x, b.y);
- a.visible = !0;
- p._bringClipToFront.call(this, !0);
- i.turn("update")
- }
- p._setFoldedPagePosition.call(this, b, d);
- return ! 0
- }
- return ! 1
- },
- hide: function() {
- var b = this.data("f"),
- d = b.turn,
- a = b.turnData,
- c = r(0, 0, a.options.acceleration);
- switch (b.effect) {
- case "hard":
- var g = a.pages[b.over];
- b.ogradient.remove();
- b.igradient.remove();
- b.ipage.transform(c);
- g && g.data("f").ipage.transform(c);
- break;
- case "sheet":
- (g = a.pageWrap[b.over]) && g.css({
- overflow: "hidden"
- }),
- b.ipage.css({
- left: 0,
- top: 0,
- right: "auto",
- bottom: "auto"
- }).transform(c),
- b.clip.transform(c),
- b.ogradient.css({
- visibility: "hidden"
- })
- }
- b.visible && 0 === a.front.length && f._removeFromDOM.call(d);
- b.status = "";
- b.visible = !1;
- delete b.point;
- delete b.dpoint;
- delete b.startPoint;
- return this
- },
- hideFoldedPage: function(b) {
- var d = this.data("f"),
- a = this,
- c = d.status,
- f = d.turnData,
- i = d.peel && d.peel.corner == d.dpoint.corner,
- j = function() {
- b && "moving" == c && i ? d.status = "peel": a.trigger("end", [d.page, !1])
- };
- if (b) {
- var k = [d.dpoint, 0, 0, 0];
- k[3] = i ? p._startPoint.call(this, k[0].corner, u(d.peel.x, d.peel.y)) : p._startPoint.call(this, k[0].corner, u(0, 1));
- var m = k[0].y - k[3].y,
- m = "tr" == k[0].corner || "tl" == k[0].corner ? Math.min(0, m) / 2 : Math.max(0, m) / 2;
- k[1] = u(k[0].x, k[0].y + m);
- k[2] = u(k[3].x, k[3].y - m);
- this.animatef(!1);
- this.animatef({
- from: 0,
- to: 1,
- frame: function(b) {
- p._fold.call(a, x(k, b, k[0].corner))
- },
- complete: j,
- easing: f.options.easing,
- duration: 800,
- hiding: !0
- })
- } else this.animatef(!1),
- j()
- },
- turnPage: function(b) {
- var d, a = this,
- c = this.data("f"),
- f = c.turnData,
- i = [0, 0, 0, 0];
- w = Q();
- if (f.display == o.single && -1 == j.inArray(b, M.forward)) {
- var k = f.pages[c.next],
- m = k.data("f"),
- q = m.peel,
- r = parseInt(f.pageWrap[c.page].css("zIndex"), 10) || 0,
- b = m.dpoint ? m.dpoint.corner: b;
- d = y(f.direction == F.ltr ? b.replace("l", "r") : b.replace("r", "l"));
- a = k;
- f.pageWrap[c.page - 1].show().css({
- zIndex: r + 1
- });
- i[0] = m.dpoint ? u(m.dpoint.x, m.dpoint.y) : p._endPoint.call(this, d.corner);
- i[1] = i[0];
- i[2] = p._startPoint.call(this, d.corner, u(0, 20));
- i[3] = q ? p._startPoint.call(this, d.corner, u(q.x, q.y)) : p._startPoint.call(this, d.corner)
- } else {
- k = f.options.elevation;
- if ("string" == typeof k && (m = /^(\d+)(px|%)$/.exec(k)))"px" == m[2] ? k = parseInt(m[1], 10) : "%" == m[2] && (k = parseInt(m[1], 10) / 100 * this.height());
- b = c.dpoint ? c.dpoint.corner: b;
- d = y(b || p._cornerAllowed.call(this)[0]);
- i[0] = c.dpoint || p._startPoint.call(this, d.corner);
- i[1] = c.dpoint ? i[0] : p._startPoint.call(this, d.corner, u(0, k));
- if (0 > i[0].x || i[0].x > this.width()) k = 0;
- i[2] = p._endPoint.call(this, d.corner, u(0, k));
- i[3] = p._endPoint.call(this, d.corner)
- }
- a.animatef(!1).trigger("flip");
- p._showFoldedPage.call(a, i[0]) ? a.animatef({
- from: 0,
- to: 1,
- easing: f.options.easing,
- frame: function(b) {
- p._fold.call(a, x(i, b, d.corner))
- },
- complete: function() {
- a.trigger("end", [c.page, !0])
- },
- duration: f.options.duration,
- turning: !0
- }) : a.trigger("end", [c.page, !0]);
- c.corner = null
- },
- isTurning: function() {
- return this.data("effect") && this.data("effect").turning
- },
- _showWhenHolding: function() {
- var b, d = this.data("f"),
- a = d.turn,
- c = d.turnData;
- if (d.holdingPoint && (b = window.getSelection ? window.getSelection().toString() : document.selection.createRange ? document.selection.createRange().text: void 0, !b)) {
- b = c.display == o.single;
- var f = p._cornerAllowed.call(this);
- b = c.direction == F.ltr ? b ? d.holdingPoint.x > this.width() / 2 ? "r": "l": 0 === d.page % 2 ? "l": "r": b ? d.holdingPoint.x > this.width() / 2 ? "l": "r": 0 === d.page % 2 ? "r": "l";
- a.turn("stop");
- this.animatef(!1); - 1 != j.inArray(b, f) && ((c.tmpListeners || (c.tmpListeners = {},
- c.tmpListeners.tap = D(a, "tap", !0), c.tmpListeners.doubleTap = D(a, "doubleTap", !0)), a = y(b, d.holdingPoint.x, d.holdingPoint.y), c.display == o.single) ? p._detectSinglePage.call(this, a, a, !0) && (d.corner = y(b, d.holdingPoint.x, d.holdingPoint.y)) : p._showFoldedPage.call(this, a, !0) && (d.corner = y(b, d.holdingPoint.x, d.holdingPoint.y)))
- }
- },
- _start: function(b) {
- var d = this.data("f"),
- a = d.turn;
- if (!d.corner && !d.disabled && !this.flip("isTurning")) {
- var c = d.turnData,
- f = p._isIArea.call(this, b);
- if (c.options.hover || d.peel && d.peel.corner == f.corner) {
- c.status = "tapping";
- d.status = "tapping";
- d.corner = f;
- d.startPoint = null;
- w = Q();
- if (d.corner && p._foldingPage.call(this)) return a.turn("update"),
- !0;
- d.corner = null;
- b = K(b);
- f = c.pageWrap[d.page].offset();
- b.x -= f.left;
- b.y -= f.top;
- c.options.smartFlip && -1 != j.inArray(d.page, a.turn("view")) && (0 < b.x && 0 < b.y && b.x < this.width() && b.y < this.height()) && (d.holdingPoint = b, d.startPoint = b, d.holding = setTimeout(j.proxy(p._showWhenHolding, this), 100))
- }
- }
- },
- _move: function(b) {
- var d, a, c = this.data("f");
- if (!c.disabled) {
- b.preventDefault();
- if (c.corner) return a = c.turnData,
- d = a.pageWrap[c.page].offset(),
- c.status = "moving",
- b = K(b),
- b.x -= d.left,
- b.y -= d.top,
- b.corner = c.corner.corner,
- a.display == o.single ? p._detectSinglePage.call(this, b, c.corner) : p._showFoldedPage.call(this, b),
- c.holdingPoint && (window.getSelection().empty ? window.getSelection().empty() : window.getSelection().removeAllRanges ? window.getSelection().removeAllRanges() : document.selection && document.selection.empty()),
- !0;
- if (c.hover && !this.data("effect") && this.is(":visible")) if (b = p._isIArea.call(this, b)) {
- if ("sheet" == c.effect && 2 != b.corner.length) return ! 1;
- if ("peel" != c.status || !c.peel || c.peel.corner != b.corner) {
- a = c.turnData;
- if (a.display == o.single && a.page == a.totalPages) return ! 1; ! R && navigator.userAgent.indexOf("Chrome");
- d = a.options.cornerPosition;
- d = p._startPoint.call(this, b.corner, u(d.x, d.y));
- c.status = "peel";
- b.x = d.x;
- b.y = d.y;
- p._showFoldedPage.call(this, b, !0)
- }
- } else if ("peel" == c.status && (!c.peel || c.peel.corner != c.dpoint.corner)) c.status = "",
- p.hideFoldedPage.call(this, !0);
- return ! 1
- }
- },
- _end: function() {
- var b = this.data("f"),
- d = b.corner,
- a = b.turn,
- c = b.turnData,
- g = b.point || d,
- i = b.page,
- k = this.width(); ! b.disabled && d && (c.display == o.single ? "swiped" != b.status ? 1 == i ? "tapping" == b.status || g.x < k / 2 ? f._turnPage.call(a, b.next, g.corner) : p.hideFoldedPage.call(this, !0) : -1 != j.inArray(g.corner, M.forward) ? "tapping" == b.status || g.x < k / 2 ? f._turnPage.call(a, b.next, g.corner) : p.hideFoldedPage.call(this, !0) : (d = c.pages[b.page - 1], g = d.data("f").point, "tapping" == b.status || g.x > 0.1 * k ? f._turnPage.call(a, b.page - 1, g.corner) : p.turnPage.call(d, g.corner)) : b.status = "": "tapping" == b.status || 0 > g.x || g.x > k ? f._turnPage.call(a, b.next, g.corner) : p.hideFoldedPage.call(this, !0));
- b.holdingPoint && (clearInterval(b.holding), delete b.holdingPoint, delete b.holding);
- c.status = "";
- b.status = "";
- b.corner = null
- },
- _detectSinglePage: function(b, d, a) {
- var c = this.data("f"),
- f = c.turn,
- i = c.turnData;
- i.pageWrap[c.page].offset();
- if ( - 1 == j.inArray(d.corner, M.forward)) {
- a = i.pages[c.page - 1];
- c = a.data("f");
- b.corner = i.direction == F.ltr ? b.corner.replace("l", "r") : b.corner.replace("r", "l");
- if (c.visible) b = p._showFoldedPage.call(a, b, !1);
- else {
- var k = p._endPoint.call(a, b.corner);
- c.point = y(b.corner, k.x, k.y);
- f.turn("stop");
- b = p._showFoldedPage.call(a, b, !0)
- }
- i.corner = d.corner;
- return b
- }
- return p._showFoldedPage.call(this, b, a)
- },
- disable: function(b) {
- this.data("f").disabled = b;
- return this
- },
- hover: function(b) {
- this.data("f").hover = b;
- return this
- },
- peel: function(b, d) {
- var a = this.data("f");
- if (b.corner) {
- if ( - 1 == j.inArray(b.corner, M.all)) throw C("Corner " + b.corner + " is not permitted");
- if ( - 1 != j.inArray(b.corner, p._cornerAllowed.call(this))) {
- var c = a.turnData.options.cornerPosition;
- b.x = b.x || c.x;
- b.y = b.y || c.y;
- c = p._startPoint.call(this, b.corner, u(b.x, b.y));
- a.peel = b;
- a.status = "peel";
- p._showFoldedPage.call(this, y(b.corner, c.x, c.y), d)
- }
- } else a.status = "",
- p.hideFoldedPage.call(this, d);
- return this
- }
- },
- v = {
- init: function(b) {
- if (!b.flipbook) throw C("Slider: Flipbook required");
- var d = {
- pages: {}
- };
- d.options = j.extend({
- pageMargin: 10,
- duration: 500
- },
- b);
- d.flipbook = j(b.flipbook);
- d.previous = j("<div />", {
- "class": "previous-button"
- }).bind("tap", j.proxy(v.previous, this)).appendTo(this);
- d.next = j("<div />", {
- "class": "next-button"
- }).bind("tap", j.proxy(v.next, this)).appendTo(this);
- d.viewer = j("<div />", {
- "class": "viewer"
- }).bind("press", j.proxy(v._viewerPress, this)).bind("moving", j.proxy(v._viewerMoving, this)).bind("unpress", j.proxy(v._viewerUnpress, this)).bind("swipe", j.proxy(v._viewerSwipe, this)).bind("tap", j.proxy(v._viewerTap, this)).appendTo(this);
- d.flipbook.bind("turned", j.proxy(v._pageTurned, this));
- this.data({
- s: d
- });
- v._resize.call(this)
- },
- next: function() {
- v._moveSlide.call(this, 1);
- return this
- },
- previous: function() {
- v._moveSlide.call(this, -1);
- return this
- },
- totalSlides: function() {
- return this.data("s").slides.length
- },
- slide: function(b) {
- var d = this.data("s");
- if (void 0 === b) return d.currentSlide;
- var a;
- if (b == d.currentSlide + 1) this.tslider("next");
- else if (b == d.currentSlide - 1) this.tslider("previous");
- // else if (d.currentSlide != b && (a = d.slides[b])) {
- // var c = d.viewer.width(),
- // f = {};
- // f[k + "transition"] = "none";
- // console.log(v._newSlide)
- // a.element || v._newSlide.call(this, b);
- // d.currentSlide = b;
- // for (b = 0; b < d.slides.length; b++) if (a = d.slides[b]) {
- // var i = b - d.currentSlide;
- // f.visibility = 0 === i ? "visible": "hidden";
- // a.x = i * c;
- // console.dir(a)
- // a.element.css(f).transform(r(a.x, 0, !0))
- // }
- // }
- return this
- },
- _moveSlide: function(b) {
- var d = this.data("s"),
- a = d.slides[d.currentSlide],
- c,
- f = d.viewer.width(),
- i = {
- visibility: "visible"
- };
- i[k + "transition"] = k + "transform " + d.options.duration + "ms";
- if (1 == b) {
- if (! (c = d.slides[d.currentSlide + 1]) || !c.element) {
- delete d.drag;
- a.element.css(i).transform(r(a.x, 0, !0));
- return
- }
- a.element.css(i).transform(r( - f, 0, !0));
- d.currentSlide = Math.min(d.slides.length - 1, d.currentSlide + 1);
- a.x = -f;
- v._newSlide.call(this, d.currentSlide + 1)
- } else {
- if (! (c = d.slides[d.currentSlide - 1]) || !c.element) {
- delete d.drag;
- a.element.css(i).transform(r(a.x, 0, !0));
- return
- }
- a.element.css(i).transform(r(f, 0, !0));
- d.currentSlide = Math.max(0, d.currentSlide - 1);
- a.x = f;
- v._newSlide.call(this, d.currentSlide - 1)
- }
- c.element.css(i).transform(r(0, 0, !0));
- c.x = 0;
- delete d.drag
- },
- _viewerPress: function(b) {
- this.data("s").drag = {
- point: K(b)
- };
- b.preventDefault()
- },
- _viewerMoving: function(b) {
- var d = this.data("s");
- if (d.drag) {
- var a = d.slides[d.currentSlide],
- c = {
- visibility: "visible"
- },
- b = K(b).x - d.drag.point.x,
- f = 0 < b ? d.slides[d.currentSlide - 1] : d.slides[d.currentSlide + 1];
- c[k + "transition"] = "none";
- d.drag.dx = b;
- a.element.css(c).transform(r(a.x + b, 0, !0));
- f && f.element && f.element.css(c).transform(r(f.x + b, 0, !0))
- }
- },
- _viewerUnpress: function() {
- var b = this.data("s");
- if (b.drag) {
- var c = b.slides[b.currentSlide],
- a = 0 < b.drag.dx ? b.slides[b.currentSlide - 1] : b.slides[b.currentSlide + 1];
- if (Math.abs(b.drag.dx) > 0.25 * b.viewer.width()) b.noswipe = !0,
- setTimeout(j.proxy(v._resetSwipe, this), 100),
- 0 < b.drag.dx ? this.tslider("previous") : this.tslider("next");
- else {
- var f = {};
- f[k + "transition"] = k + "transform " + b.options.duration + "ms";
- c.element.css(f).transform(r(c.x, 0, !0));
- a && a.element && a.element.css(f).transform(r(a.x, 0, !0));
- delete b.drag
- }
- }
- },
- _viewerTap: function(b) {
- var c = this.data("s"),
- b = j(b.target),
- a; ((a = b.attr("page")) || (a = b.parent().attr("page"))) && c.flipbook.turn("page", a)
- },
- _viewerSwipe: function(b, c) {
- var a = this.data("s");
- a.noswipe || (0 > c ? this.tslider("next") : this.tslider("previous"), a.noswipe = !1)
- },
- _resetSwipe: function() {
- this.data("s").noswipe = !1
- },
- _setCurrentClass: function() {
- var b = this.data("s"),
- c;
- if (c = b.currentView) b.pages[c[0]] && b.pages[c[0]].removeClass("current"),
- b.pages[c[1]] && b.pages[c[1]].removeClass("current");
- c = b.flipbook.turn("view");
- b.pages[c[0]] && b.pages[c[0]].addClass("current");
- b.pages[c[1]] && b.pages[c[1]].addClass("current");
- b.currentView = c
- },
- _pageTurned: function() {
- var b = this.data("s");
- v._setCurrentClass.call(this);
- this.tslider("slide", v._getCurrentSlide.call(this, b.slides))
- },
- _calculateSlides: function() {
- for (var b = this.data("s"), c = [], a = b.flipbook, f = a.turn("size"), g = a.turn("view"), i = b.viewer.width(), j = b.viewer.height(), f = V({
- width: f.width,
- height: f.height,
- boundWidth: i,
- boundHeight: j
- }), j = f.width / g.length, k = a.turn("pages"), m = 0, o, p = 1; p <= k && (g = a.turn("view", p, !0));) o = g.length * j + 2 * b.options.pageMargin,
- m + o >= i && (c.push({
- lastPage: p - 1,
- width: m,
- pageWidth: j,
- pageHeight: f.height
- }), m = 0),
- m += o,
- p = g[g.length - 1] + 1;
- c.push({
- lastPage: p - 1,
- width: m,
- pageWidth: j,
- pageHeight: f.height
- });
- return c
- },
- _newSlide: function(b) {
- var c = this.data("s"),
- a = c.slides[b];
- console.log(a, 'hello')
- if (a) {
- var f = c.flipbook,
- g = c.viewer.width();
- if (!a.element) {
- a.pages = {};
- a.element = j("<div />", {
- "class": "slide"
- }).css({
- position: "absolute",
- width: a.width,
- height: a.pageHeight,
- top: 0,
- left: c.viewer.width() / 2 - a.width / 2
- });
- for (var i = 0 < b ? c.slides[b - 1].lastPage + 1 : 1, k = c.options.pageMargin, m, p; i <= a.lastPage && (m = f.turn("view", i, !0));) {
- for (var i = 2 == m.length,
- o = 0; o < m.length; o++) c.pages[m[o]] || (c.pages[m[o]] = j("<div />", {
- page: m[o]
- }), this.trigger("newThumbnail", [m[o], c.pages[m[o]]])),
- p = i ? 0 === o ? "page double-even": "page double-odd": "page single",
- c.pages[m[o]].appendTo(a.element).attr("class", p).css({
- position: "absolute",
- width: a.pageWidth,
- height: a.pageHeight,
- left: k,
- top: 0
- }),
- k += a.pageWidth;
- i = m[m.length - 1] + 1;
- k += 2 * c.options.pageMargin
- }
- a.x = (b - c.currentSlide) * g;
- a.element.transform(r(a.x, 0, !0)).appendTo(c.viewer);
- 0 !== a.x && a.element.css({
- visibility: "hidden"
- })
- }
- }
- },
- _resizeSlide: function(b) {
- var c = this.data("s"),
- a = c.flipbook,
- f = c.slides[b],
- g = c.viewer.width(),
- i;
- if (f.element) {
- var m = f.lastPage,
- o, p, q = c.options.pageMargin;
- for (i = 0 < b ? c.slides[b - 1].lastPage + 1 : 1; i <= m && (o = a.turn("view", i, !0));) {
- p = 2 == o.length;
- for (var s = 0; s < o.length; s++) c.pages[o[s]] || (c.pages[o[s]] = j("<div />", {
- page: o[s],
- css: {
- position: "absolute"
- }
- }), this.trigger("newThumbnail", [o[s], c.pages[o[s]]])),
- f.element[0] != c.pages[o[s]].parent()[0] && c.pages[o[s]].appendTo(f.element),
- i = p ? 0 === s ? "page double-even": "page double-odd": "page single",
- c.pages[o[s]].attr("class", i).css({
- width: f.pageWidth,
- height: f.pageHeight,
- left: q,
- top: 0
- }),
- q += f.pageWidth;
- i = o[o.length - 1] + 1;
- q += 2 * c.options.pageMargin
- }
- a = {
- width: f.width,
- height: f.pageHeight,
- top: 0,
- left: c.viewer.width() / 2 - f.width / 2
- };
- f.x = (b - c.currentSlide) * g;
- a[k + "transition"] = "none";
- a.visibility = 0 === f.x ? "visible": "hidden";
- f.element.css(a);
- f.element.transform(r(f.x, 0, !0))
- }
- f.currentLastPage = f.lastPage
- },
- _removeSlide: function(b, c) {
- var a = this.data("s"),
- f = a.slides[b];
- f && f.element && (f.element.remove(), delete f.element);
- c && delete a.slides[b]
- },
- _resize: function() {
- var b = this.data("s");
- b.flipbook.turn("page");
- var c = b.slides || (b.slides = {}),
- a = v._calculateSlides.call(this);
- b.currentSlide = v._getCurrentSlide.call(this, a);
- for (var f = 0; f < a.length; f++) c[f] || (c[f] = {}),
- c[f].currentLastPage || (c[f].currentLastPage = a[f].lastPage),
- j.extend(c[f], a[f]),
- 2 > Math.abs(b.currentSlide - f) ? c[f].element ? v._resizeSlide.call(this, f) : v._newSlide.call(this, f) : v._removeSlide.call(this, f);
- for (f = a.length; f < b.slides.length; f++) v._removeSlide.call(this, f, !0);
- b.slides.length = a.length;
- v._setCurrentClass.call(this)
- },
- _getCurrentSlide: function(b) {
- for (var c = this.data("s").flipbook.turn("page"), a = 0, f = b.length - 1; a <= f;) {
- var g = Math.floor((a + f) / 2);
- if (0 < g && c <= b[g - 1].lastPage) f = g - 1;
- else if (c > b[g].lastPage) a = g + 1;
- else return g
- }
- return - 1
- }
- };
- window.requestAnim = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
- function(b) {
- setTimeout(b, 1E3 / 60)
- };
- j.extend(j.fn, {
- flip: function() {
- return m(j(this[0]), p, arguments)
- },
- turn: function() {
- return m(j(this[0]), f, arguments)
- },
- tslider: function() {
- return m(j(this[0]), v, arguments)
- },
- transform: function(b, c) {
- var a = {};
- c && (a[k + "transform-origin"] = c);
- a[k + "transform"] = b;
- return this.css(a)
- },
- animatef: function(b) {
- var c = this.data();
- if (!b) return c.effect && c.effect.stop(),
- this;
- if (c.effect) {
- c.effect._time = (new Date).getTime();
- for (var a = 0; a < c.effect._elements; a++) c.effect.from[a] = c.effect.current[a],
- c.effect.to[a] = b.to[a] - c.effect.from[a];
- return this
- }
- b.to.length || (b.to = [b.to]);
- b.from.length || (b.from = [b.from]);
- var f = !0;
- c.effect = j.extend({
- current: [],
- _elements: b.to.length,
- _time: (new Date).getTime(),
- stop: function() {
- f = false;
- delete c.effect
- },
- _frame: function() {
- if (f && c.effect) {
- for (var a = this,
- b = Math.min(this.duration, (new Date).getTime() - this._time), i = 0; i < this._elements; i++) this.current[i] = this.easing(b, this.from[i], this.to[i], this.duration);
- f = true;
- this.frame(this._elements == 1 ? this.current[0] : this.current);
- if (b == this.duration) {
- this.stop();
- this.complete && this.complete()
- } else window.requestAnim(function() {
- a._frame()
- })
- }
- }
- },
- b);
- for (b = 0; b < c.effect._elements; b++) c.effect.to[b] -= c.effect.from[b];
- c.effect._frame();
- return this
- }
- });
- j.isTouch = R;
- j.cssPrefix = J;
- j.cssTransitionEnd = Y;
- j.findPos = function(b) {
- var c = {
- top: 0,
- left: 0
- };
- do c.left += b.offsetLeft,
- c.top += b.offsetTop;
- while (b = b.offsetParent);
- return c
- };
- j.turnVerion = "5"
- })(jQuery);
- Issue = Backbone.Model.extend({
- defaults: {
- pages: 1,
- path: "statics/issue/",
- prefixes: !1
- },
- initialize: function() {}
- });
- Page = Backbone.Model.extend({
- idAttribute: "page",
- fetchRegions: function() {
- this.set({
- regions: [{
- i: 0,
- t: "0",
- x: 0,
- y: 0,
- w: 0,
- h: 0,
- url: "www.google.com"
- }]
- })
- },
- fetchDictionary: function() {},
- getResource: function(j) {
-
- var m = this.get("issue"),
- s = m.get("prefixes")
- s = s ? s[this.get("page")] + "/": this.get("page") + "/";
-
- console.log(m.get("path") + s, )
- // return m.get("path") + s + j
- const r = Number(s.split('/')[0])
- console.log(r, '我是r');
- const index = r < 10 ? '0' + (r ): r
- // return `https://cdn.temp.luojigou.vip/turn_temp_${r - 2}.jpg`
- return `https://img.luojigou.vip/6.30%E6%B8%B8%E6%88%8F%E5%AE%A4%E6%89%8B%E5%86%8C%E5%91%A8%E5%9B%9B-${index}.jpg`
-
- }
- });
- var PageList = Backbone.Collection.extend({
- model: Page
- });
- PageView = Backbone.View.extend({
- tagName: "div",
- initialize: function() {
- this.listenTo(this.model, "destroy", this.remove);
- this.listenTo(this.model, "change:regions", this.showRegions);
- this.render()
- },
- render: function() {
- this.$el.html('<div class="gradient"></div><div class="loader"><i></i></div>')
- },
- loadPage: function() {
- var j = this,
- m = $("<img />");
- m.load(function() {
- j.$el.find(".loader").remove();
- $(this).css({
- width: "100%",
- height: "100%"
- });
- $(this).appendTo(j.$el);
- "single" == $("#magazine").turn("display") && $("#magazine .p0").data("f").tPage == j.model.get("page") && ($("#magazine .p0").find("*").remove(), j.$el.clone(!1).css({
- opacity: "0.2",
- overflow: "hidden"
- }).transform("rotateY(180deg)", "50% 50%").appendTo($("#magazine .p0")))
- });
- m.attr("src", this.model.getResource("large.jpg"));
- this.model.fetchRegions()
- },
- showRegions: function() {}
- });
- Magazine = Backbone.View.extend({
- el: $("#magazine"),
- events: {
- turning: "turning",
- turned: "turned",
- tap: "tap",
- doubleTap: "doubleTap",
- pinching: "pinching",
- scrolling: "scrolling",
- zooming: "zooming",
- zoomed: "zoomed",
- missing: "missing",
- removePage: "removePage"
- },
- initialize: function(j) {
- this.app = j.app;
- this.pages = new PageList
- },
- render: function() {
- this.$el.turn({
- view: this,
- width: this.model.get("pageWidth"),
- height: this.model.get("pageHeight"),
- pages: this.model.get("pages"),
- duration: 500,
- responsive: !0,
- autoCenter: !0,
- smartFlip: !0,
- swipe: !0,
- slider: ".thumbnails",
- cornerPosition: "50px 20px",
- events: {
- newThumbnail: $.proxy(this.newThumbnail, this)
- }
- })
- },
- turning: function() {
- $.isTouch ? this.$el.removeClass("animated") : this.$el.addClass("animated")
- },
- turned: function(j, m) {
- $.isTouch || this.$el.removeClass("animated");
- 1 == m && this.$el.turn("peel", "br")
- },
- tap: function(j) { ! $.isTouch && !$("html").hasClass("touch") && ($(j.target).hasClass("region") || (1 == this.$el.turn("zoom") ? this.$el.turn("zoomIn", j) : this.$el.turn("zoomOut")))
- },
- doubleTap: function(j) {
- var m = $(".magazine-viewport").data();
- m.navTimer && (clearInterval(m.navTimer), delete m.navTimer);
- if ($.isTouch || $("html").hasClass("touch")) 1 == this.$el.turn("zoom") ? this.$el.turn("zoomIn", j) : this.$el.turn("zoomOut")
- },
- pinching: function(j) {
- this.$el.turn("zoom", 1, j)
- },
- scrolling: function() {},
- zooming: function() {
- this.$el.removeClass("animated")
- },
- zoomed: function() {
- $("html").removeClass("navigation")
- },
- missing: function(j, m) {
- for (var s = 0; s < m.length; s++) this.addPage(m[s])
- },
- newThumbnail: function(j, m, s) {
- j = (j = this.model.get("prefixes")) ? j[m] + "/": m + "/";
- $("<img />", {
- src: this.model.get("path") + j + "thumb.jpg"
- }).appendTo(s)
- },
- addPage: function(j) {
- var m = this.pages.get(j);
- m || (m = new Page({
- page: j,
- issue: this.model
- }), this.pages.add(m));
- m = new PageView({
- model: m
- });
- this.$el.turn("addPage", m.$el, j, {
- view: m
- }) && m.loadPage()
- },
- removePage: function(j, m) {
- this.$el.turn("pageData", m).view.stopListening()
- }
- });
- Flipfiy = Backbone.View.extend({
- el: $("#viewer"),
- events: {
- "tap .control-next-page": "nextPage",
- "tap .control-previous-page": "previousPage"
- },
- initialize: function() {
- var j = this;
- this.router = new AppRouter({
- app: this
- });
- $(document).keydown(function(m) {
- switch (m.keyCode) {
- case 37:
- j.magazine.$el.turn("previous");
- m.preventDefault();
- break;
- case 39:
- j.magazine.$el.turn("next");
- m.preventDefault();
- break;
- case 27:
- j.magazine.$el.zoom("zoomOut"),
- m.preventDefault()
- }
- });
- $(".magazine-viewport").bind("tap",
- function() {
- if ($("html").hasClass("navigation")) $("html").removeClass("navigation");
- else {
- var j = $(this).data();
- j.navTimer || (j.navTimer = setTimeout(function() {
- delete j.navTimer;
- $(".magazine").turn("isFlipping") || $("html").addClass("navigation")
- },
- 300))
- }
- })
- },
- loadIssue: function(j) {
- this.magazine || (j = new Issue(j), this.magazine = new Magazine({
- model: j
- }), this.magazine.render(), this.magazine.$el.bind("turned", $.proxy(this.pageTurned, this)), Backbone.history.start())
- },
- nextPage: function() {
- this.magazine.$el.turn("next")
- },
- previousPage: function() {
- this.magazine.$el.turn("previous")
- },
- pageTurned: function(j, m) {
- this.router.navigate("page/" + m)
- }
- });
- AppRouter = Backbone.Router.extend({
- routes: {
- "page/:number": "setPage",
- issues: "issues"
- },
- initialize: function(j) {
- this.app = j.app
- },
- setPage: function(j) {
- this.app.magazine.$el.turn("page", j)
- }
- });
- function flipify(j) { (new Flipfiy).loadIssue(j)
- }
- function addPage(j, m) {
- m.turn("pages");
- var s = $("<div />", {
- "class": ""
- });
- m.turn("addPage", s, j) && (s.html('<div class="gradient"></div><div class="loader"><i></i></div>'), loadPage(j, s))
- }
- function loadPage(j, m) {
- var s = $("<img />");
- s.mousedown(function(j) {
- j.preventDefault()
- });
- s.load(function() {
- $(this).css({
- width: "100%",
- height: "100%"
- });
- $(this).appendTo(m);
- m.find(".loader").remove()
- });
- s.attr("src", "statics/issue/imgs/" + j + "-large.jpg");
- loadRegions(j, m)
- }
- function loadRegions(j, m) {
- $.getJSON("pages/" + j + "-regions.json").done(function(j) {
- $.each(j,
- function(j, s) {
- addRegion(s, m)
- })
- })
- }
- function addRegion(j, m) {
- var s = $("<div />", {
- "class": "region " + j["class"]
- }),
- x = $(".magazine").turn("options"),
- y = x.width / 2,
- x = x.height;
- s.css({
- top: Math.round(100 * (j.y / x)) + "%",
- left: Math.round(100 * (j.x / y)) + "%",
- width: Math.round(100 * (j.width / y)) + "%",
- height: Math.round(100 * (j.height / x)) + "%"
- }).attr("region-data", $.param(j.data || ""));
- s.appendTo(m)
- }
- function regionClick(j) {
- j = $(j.target);
- if (j.hasClass("region")) {
- var m = $.trim(j.attr("class").replace("region", ""));
- return processRegion(j, m)
- }
- }
- function processRegion(j, m) {
- data = decodeParams(j.attr("region-data"));
- switch (m) {
- case "link":
- window.open(data.url);
- break;
- case "zoom":
- var s = j.offset(),
- x = $(".magazine-viewport").offset(),
- s = {
- x: s.left - x.left,
- y: s.top - x.top
- };
- $(".magazine-viewport").zoom("zoomIn", s);
- break;
- case "to-page":
- $(".magazine").turn("page", data.page)
- }
- }
- function loadLargePage(j, m) {
- var s = $("<img />");
- s.load(function() {
- var j = m.find("img");
- $(this).css({
- width: "100%",
- height: "100%"
- });
- $(this).appendTo(m);
- j.remove()
- });
- s.attr("src", "pages/" + j + "-large.jpg")
- }
- function loadSmallPage(j, m) {
- var s = m.find("img");
- s.css({
- width: "100%",
- height: "100%"
- });
- s.unbind("load");
- s.attr("src", "pages/" + j + "-large.jpg")
- }
- function isChrome() {
- return - 1 != navigator.userAgent.indexOf("Chrome")
- }
- function disableControls(j) {
- 1 == j ? $(".previous-button").hide() : $(".previous-button").show();
- j == $(".magazine").turn("pages") ? $(".next-button").hide() : $(".next-button").show()
- }
- function resizeViewport() {}
- function zoomTo(j) {
- 1 == $(this).zoom("value") && $(this).zoom("in", j)
- }
- function largeMagazineWidth() {
- return 2214
- }
- function decodeParams(j) {
- for (var j = j.split("&"), m, s = {},
- x = 0; x < j.length; x++) m = j[x].split("="),
- s[decodeURIComponent(m[0])] = decodeURIComponent(m[1]);
- return s
- };
|