| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197 |
- /*!
- * Master Slider – Responsive Touch Swipe Slider
- * Copyright © 2015 All Rights Reserved.
- *
- * @author Averta [www.averta.net]
- * @version 2.15.1
- * @date Jul 2015
- */
- /* ================== bin-debug/js/pro/tools/base.js =================== */
- window.averta = {};
-
- ;(function($){
-
- //"use strict";
-
- window.package = function(name){
- if(!window[name]) window[name] = {};
- };
-
- var extend = function(target , object){
- for(var key in object) target[key] = object[key];
- };
-
- Function.prototype.extend = function(superclass){
- if(typeof superclass.prototype.constructor === "function"){
- extend(this.prototype , superclass.prototype);
- this.prototype.constructor = this;
- }else{
- this.prototype.extend(superclass);
- this.prototype.constructor = this;
- }
- };
-
- // Converts JS prefix to CSS prefix
- var trans = {
- 'Moz' : '-moz-',
- 'Webkit' : '-webkit-',
- 'Khtml' : '-khtml-' ,
- 'O' : '-o-',
- 'ms' : '-ms-',
- 'Icab' : '-icab-'
- };
-
- window._mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
- window._touch = 'ontouchstart' in document;
- $(document).ready(function(){
- window._jcsspfx = getVendorPrefix(); // JS CSS VendorPrefix
- window._csspfx = trans[window._jcsspfx]; // CSS VendorPrefix
- window._cssanim = supportsTransitions();
- window._css3d = supports3DTransforms();
- window._css2d = supportsTransforms();
- });
-
-
- // Thanks to LEA VEROU
- // http://lea.verou.me/2009/02/find-the-vendor-prefix-of-the-current-browser/
- function getVendorPrefix() {
-
- if('result' in arguments.callee) return arguments.callee.result;
-
- var regex = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/;
-
- var someScript = document.getElementsByTagName('script')[0];
-
- for(var prop in someScript.style){
- if(regex.test(prop)){
- return arguments.callee.result = prop.match(regex)[0];
- }
- }
-
- if('WebkitOpacity' in someScript.style) return arguments.callee.result = 'Webkit';
- if('KhtmlOpacity' in someScript.style) return arguments.callee.result = 'Khtml';
-
- return arguments.callee.result = '';
- }
-
-
- // Thanks to Steven Benner.
- // http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/
- window.parseQueryString = function(url){
- var queryString = {};
- url.replace(
- new RegExp("([^?=&]+)(=([^&]*))?", "g"),
- function($0, $1, $2, $3) { queryString[$1] = $3; }
- );
-
- return queryString;
- };
-
- function checkStyleValue(prop){
- var b = document.body || document.documentElement;
- var s = b.style;
- var p = prop;
- if(typeof s[p] == 'string') {return true; }
-
- // Tests for vendor specific prop
- v = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'],
- p = p.charAt(0).toUpperCase() + p.substr(1);
- for(var i=0; i<v.length; i++) {
- if(typeof s[v[i] + p] == 'string') { return true; }
- }
- return false;
- }
-
- function supportsTransitions() {
- return checkStyleValue('transition');
- }
-
- function supportsTransforms(){
- return checkStyleValue('transform');
- }
-
- function supports3DTransforms(){
- if(!supportsTransforms()) return false;
- var el = document.createElement('i'),
- has3d,
- transforms = {
- 'WebkitTransform':'-webkit-transform',
- 'OTransform':'-o-transform',
- 'MSTransform':'-ms-transform',
- 'msTransform':'-ms-transform',
- 'MozTransform':'-moz-transform',
- 'Transform':'transform',
- 'transform':'transform'
- };
-
- el.style.display = 'block';
-
- // Add it to the body to get the computed style
- document.body.insertBefore(el, null);
-
- for(var t in transforms){
- if( el.style[t] !== undefined ){
- el.style[t] = 'translate3d(1px,1px,1px)';
- has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
- }
- }
-
- document.body.removeChild(el);
-
- return (has3d != null && has3d.length > 0 && has3d !== "none");
- }
-
- /**
- * Provides requestAnimationFrame in a cross browser way.
- * @author paulirish / http://paulirish.com/
- */
- var fps60 = 50/3;
-
- if ( !window.requestAnimationFrame ) {
-
- window.requestAnimationFrame = ( function() {
-
- return window.webkitRequestAnimationFrame ||
- window.mozRequestAnimationFrame ||
- window.oRequestAnimationFrame ||
- window.msRequestAnimationFrame ||
- function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
-
- window.setTimeout( callback, fps60 );
-
- };
-
- } )();
-
- }
-
- if (!window.getComputedStyle) {
- window.getComputedStyle = function(el, pseudo) {
- this.el = el;
- this.getPropertyValue = function(prop) {
- var re = /(\-([a-z]){1})/g;
- if (prop == 'float') prop = 'styleFloat';
- if (re.test(prop)) {
- prop = prop.replace(re, function () {
- return arguments[2].toUpperCase();
- });
- }
- return el.currentStyle[prop] ? el.currentStyle[prop] : null;
- };
- return el.currentStyle;
- };
- }
-
- // IE8 Array indexOf fix
- if (!Array.prototype.indexOf) {
- Array.prototype.indexOf = function(elt /*, from*/) {
- var len = this.length >>> 0;
-
- var from = Number(arguments[1]) || 0;
- from = (from < 0)
- ? Math.ceil(from)
- : Math.floor(from);
- if (from < 0)
- from += len;
-
- for (; from < len; from++)
- {
- if (from in this &&
- this[from] === elt)
- return from;
- }
- return -1;
- };
- }
-
-
- /**
- * check ie browser
- * @param {Number | string} version
- * @return {Boolean}
- */
- window.isMSIE = function ( version ) {
- if ( !$.browser.msie ) {
- return false;
- } else if ( !version ) {
- return true;
- }
- var ieVer = $.browser.version.slice(0 , $.browser.version.indexOf('.'));
- if ( typeof version === 'string' ) {
- if ( version.indexOf('<') !== -1 || version.indexOf('>') !== -1) {
- return eval( ieVer + version );
- } else {
- return eval( version + '==' + ieVer );
- }
- } else {
- return version == ieVer;
- }
- }
-
- $.removeDataAttrs = function($target, exclude) {
- var i,
- attrName,
- dataAttrsToDelete = [],
- dataAttrs = $target[0].attributes,
- dataAttrsLen = dataAttrs.length;
-
- exclude = exclude || [];
-
- // loop through attributes and make a list of those
- // that begin with 'data-'
- for (i=0; i<dataAttrsLen; i++) {
- attrName = dataAttrs[i].name;
- if ( 'data-' === attrName.substring(0,5) && exclude.indexOf(attrName) === -1 ) {
- // Why don't you just delete the attributes here?
- // Deleting an attribute changes the indices of the
- // others wreaking havoc on the loop we are inside
- // b/c dataAttrs is a NamedNodeMap (not an array or obj)
- dataAttrsToDelete.push(dataAttrs[i].name);
- }
- }
- // delete each of the attributes we found above
- // i.e. those that start with "data-"
- $.each( dataAttrsToDelete, function( index, attrName ) {
- $target.removeAttr( attrName );
- })
- };
-
- if(jQuery){
- $.jqLoadFix = function(){
- if(this.complete){
- var that = this;
- setTimeout(function(){$(that).load();} , 1);
- }
- };
-
- jQuery.uaMatch = jQuery.uaMatch || function( ua ) {
- ua = ua.toLowerCase();
-
- var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
- /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
- /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
- /(msie) ([\w.]+)/.exec( ua ) ||
- ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
- [];
-
- return {
- browser: match[ 1 ] || "",
- version: match[ 2 ] || "0"
- };
- };
-
- // Don't clobber any existing jQuery.browser in case it's different
- //if ( !jQuery.browser ) {
- matched = jQuery.uaMatch( navigator.userAgent );
- browser = {};
-
- if ( matched.browser ) {
- browser[ matched.browser ] = true;
- browser.version = matched.version;
- }
-
- // Chrome is Webkit, but Webkit is also Safari.
- if ( browser.chrome ) {
- browser.webkit = true;
- } else if ( browser.webkit ) {
- browser.safari = true;
- }
-
- // hofix for IE11 detection
- var isIE11 = !!navigator.userAgent.match(/Trident\/7\./);
- if (isIE11) {
- browser.msie = "true";
- delete browser.mozilla;
- }
-
- jQuery.browser = browser;
-
- //}
-
- $.fn.preloadImg = function(src , _event){
- this.each(function(){
- var $this = $(this);
- var self = this;
- var img = new Image();
- img.onload = function(event){
- if(event == null) event = {}; // IE8
- $this.attr('src' , src);
- event.width = img.width;
- event.height = img.height;
- $this.data('width', img.width);
- $this.data('height', img.height);
- setTimeout(function(){_event.call(self , event);},50);
- img = null;
- };
- img.src = src;
- });
- return this;
- };
- }
- })(jQuery);
- /* ================== bin-debug/js/pro/tools/EventDispatcher.js =================== */
- ;(function(){
-
- "use strict";
-
- averta.EventDispatcher = function(){
- this.listeners = {};
- };
-
- averta.EventDispatcher.extend = function(_proto){
- var instance = new averta.EventDispatcher();
- for(var key in instance)
- if(key != 'constructor') _proto[key] = averta.EventDispatcher.prototype[key];
- };
-
- averta.EventDispatcher.prototype = {
-
- constructor : averta.EventDispatcher,
-
- addEventListener : function(event , listener , ref){
- if(!this.listeners[event]) this.listeners[event] = [];
- this.listeners[event].push({listener:listener , ref:ref});
-
- },
-
- removeEventListener : function(event , listener , ref){
- if(this.listeners[event]){
- for(var i = 0; i < this.listeners[event].length ; ++i){
-
- if(listener === this.listeners[event][i].listener && ref === this.listeners[event][i].ref){
- this.listeners[event].splice(i--,1);
- }
- }
-
- if (this.listeners[event].length === 0){
- this.listeners[event] = null;
- }
- }
- },
-
- dispatchEvent : function (event) {
- event.target = this;
- if(this.listeners[event.type]){
- for(var i = 0 , l = this.listeners[event.type].length; i < l ; ++i){
- this.listeners[event.type][i].listener.call(this.listeners[event.type][i].ref , event);
- }
- }
- }
- };
- })();
- /* ================== bin-debug/js/pro/tools/TouchSwipe.js =================== */
- ;(function($){
-
- "use strict";
-
- var isTouch = 'ontouchstart' in document,
- isPointer = window.navigator.pointerEnabled,
- isMSPoiner = !isPointer && window.navigator.msPointerEnabled,
- usePointer = isPointer || isMSPoiner,
- // Events
- ev_start = (isPointer ? 'pointerdown ' : '' ) + (isMSPoiner ? 'MSPointerDown ' : '' ) + (isTouch ? 'touchstart ' : '' ) + 'mousedown',
- ev_move = (isPointer ? 'pointermove ' : '' ) + (isMSPoiner ? 'MSPointerMove ' : '' ) + (isTouch ? 'touchmove ' : '' ) + 'mousemove',
- ev_end = (isPointer ? 'pointerup ' : '' ) + (isMSPoiner ? 'MSPointerUp ' : '' ) + (isTouch ? 'touchend ' : '' ) + 'mouseup',
- ev_cancel = (isPointer ? 'pointercancel ' : '' ) + (isMSPoiner ? 'MSPointerCancel ': '' ) + 'touchcancel';
-
-
- averta.TouchSwipe = function($element){
- this.$element = $element;
- this.enabled = true;
-
- $element.bind(ev_start , {target: this} , this.__touchStart);
-
- $element[0].swipe = this;
-
- this.onSwipe = null;
- this.swipeType = 'horizontal';
- this.noSwipeSelector = 'input, textarea, button, .no-swipe, .ms-no-swipe';
-
- this.lastStatus = {};
-
- };
-
- var p = averta.TouchSwipe.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.getDirection = function(new_x , new_y){
- switch(this.swipeType){
- case 'horizontal':
- return new_x <= this.start_x ? 'left' : 'right';
- break;
- case 'vertical':
- return new_y <= this.start_y ? 'up' : 'down';
- break;
- case 'all':
- if(Math.abs(new_x - this.start_x) > Math.abs(new_y - this.start_y))
- return new_x <= this.start_x ? 'left' : 'right';
- else
- return new_y <= this.start_y ? 'up' : 'down';
- break;
- }
- };
-
- p.priventDefultEvent = function(new_x , new_y){
- //if(this.priventEvt != null) return this.priventEvt;
- var dx = Math.abs(new_x - this.start_x);
- var dy = Math.abs(new_y - this.start_y);
-
- var horiz = dx > dy;
-
- return (this.swipeType === 'horizontal' && horiz) ||
- (this.swipeType === 'vertical' && !horiz);
-
- //return this.priventEvt;
- };
-
- p.createStatusObject = function(evt){
- var status_data = {} , temp_x , temp_y;
-
- temp_x = this.lastStatus.distanceX || 0;
- temp_y = this.lastStatus.distanceY || 0;
-
- status_data.distanceX = evt.pageX - this.start_x;
- status_data.distanceY = evt.pageY - this.start_y;
- status_data.moveX = status_data.distanceX - temp_x;
- status_data.moveY = status_data.distanceY - temp_y;
-
- status_data.distance = parseInt( Math.sqrt(Math.pow(status_data.distanceX , 2) + Math.pow(status_data.distanceY , 2)) );
-
- status_data.duration = new Date().getTime() - this.start_time;
- status_data.direction = this.getDirection(evt.pageX , evt.pageY);
-
- return status_data;
- };
-
-
- p.__reset = function(event , jqevt){
- this.reset = false;
- this.lastStatus = {};
- this.start_time = new Date().getTime();
- this.start_x = isTouch ? event.touches[0].pageX : (usePointer ? event.pageX : jqevt.pageX);
- this.start_y = isTouch ? event.touches[0].pageY : (usePointer ? event.pageY : jqevt.pageY);
- };
-
- p.__touchStart = function(event){
-
- var swipe = event.data.target;
- var jqevt = event;
- if(!swipe.enabled) return;
-
- if ( $(event.target).closest(swipe.noSwipeSelector, swipe.$element).length > 0 ) {
- return;
- }
-
- event = event.originalEvent;
-
- if( usePointer ) {
- $(this).css('-ms-touch-action', swipe.swipeType === 'horizontal' ? 'pan-y' : 'pan-x');
- }
-
- if(!swipe.onSwipe) {
- $.error('Swipe listener is undefined');
- return;
- }
-
- if(swipe.touchStarted) return;
-
- swipe.start_x = isTouch ? event.touches[0].pageX : (usePointer ? event.pageX : jqevt.pageX);
- swipe.start_y = isTouch ? event.touches[0].pageY : (usePointer ? event.pageY : jqevt.pageY);
-
- swipe.start_time = new Date().getTime();
-
- $(document).bind(ev_end , {target: swipe} , swipe.__touchEnd).
- bind(ev_move , {target: swipe} , swipe.__touchMove).
- bind(ev_cancel , {target: swipe} , swipe.__touchCancel);
-
- var evt = isTouch ? event.touches[0] : (usePointer ? event : jqevt);
- var status = swipe.createStatusObject(evt);
- status.phase = 'start';
-
- swipe.onSwipe.call(null , status);
-
- if(!isTouch)
- jqevt.preventDefault();
-
- swipe.lastStatus = status;
- swipe.touchStarted = true;
- };
-
- p.__touchMove = function(event){
- var swipe = event.data.target;
- var jqevt = event;
- event = event.originalEvent;
-
- if(!swipe.touchStarted) return;
-
- clearTimeout(swipe.timo);
- swipe.timo = setTimeout(function(){swipe.__reset(event , jqevt);} , 60);
-
- var evt = isTouch ? event.touches[0] : (usePointer ? event : jqevt);
-
- var status = swipe.createStatusObject(evt);
-
- if(swipe.priventDefultEvent(evt.pageX , evt.pageY))
- jqevt.preventDefault();
-
- status.phase = 'move';
-
- //if(swipe.lastStatus.direction !== status.direction) swipe.__reset(event , jqevt);
-
- swipe.lastStatus = status;
-
- swipe.onSwipe.call(null , status);
- };
-
- p.__touchEnd = function(event){
-
- var swipe = event.data.target;
- var jqevt = event;
- event = event.originalEvent;
-
- clearTimeout(swipe.timo);
-
- var evt = isTouch ? event.touches[0] : (usePointer ? event : jqevt);
-
- var status = swipe.lastStatus;
-
- if(!isTouch)
- jqevt.preventDefault();
-
- status.phase = 'end';
-
- swipe.touchStarted = false;
- swipe.priventEvt = null;
-
- $(document).unbind(ev_end , swipe.__touchEnd).
- unbind(ev_move , swipe.__touchMove).
- unbind(ev_cancel , swipe.__touchCancel);
-
- status.speed = status.distance / status.duration;
-
- swipe.onSwipe.call(null , status);
-
- };
-
- p.__touchCancel = function(event){
- var swipe = event.data.target;
- swipe.__touchEnd(event);
- };
-
- p.enable = function(){
- if(this.enabled) return;
- this.enabled = true;
- };
-
- p.disable = function(){
- if(!this.enabled) return;
- this.enabled = false;
- };
-
- })(jQuery);
- /* ================== bin-debug/js/pro/tools/Timer.js =================== */
- /**
- * Ticker Class
- * Author: Averta Ltd
- */
-
- ;(function(){
- "use strict";
-
- averta.Ticker = function(){};
-
- var st = averta.Ticker,
- list = [],
- len = 0,
- __stopped = true;
-
- st.add = function (listener , ref){
- list.push([listener , ref]);
-
- if(list.length === 1) st.start();
- len = list.length;
- return len;
- };
-
- st.remove = function (listener , ref) {
- for(var i = 0 , l = list.length ; i<l ; ++i){
- if(list[i] && list[i][0] === listener && list[i][1] === ref){
- list.splice(i , 1);
- }
- }
-
- len = list.length;
-
- if( len === 0 ){
- st.stop();
- }
- };
-
- st.start = function (){
- if(!__stopped) return;
- __stopped = false;
- __tick();
- };
-
- st.stop = function (){
- __stopped = true;
- };
-
- var __tick = function () {
- if(st.__stopped) return;
- var item;
- for(var i = 0; i!==len; i++){
- item = list[i];
- item[0].call(item[1]);
- }
-
- requestAnimationFrame(__tick);
- };
-
- })();
-
- /**
- * Timer Class
- * Author: Averta Ltd
- */
- ;(function(){
- "use strict";
-
- if(!Date.now){
- Date.now = function(){
- return new Date().getTime();
- };
- }
-
- averta.Timer = function(delay , autoStart) {
- this.delay = delay;
- this.currentCount = 0;
- this.paused = false;
- this.onTimer = null;
- this.refrence = null;
-
- if(autoStart) this.start();
-
- };
-
- averta.Timer.prototype = {
-
- constructor : averta.Timer,
-
- start : function(){
- this.paused = false;
- this.lastTime = Date.now();
- averta.Ticker.add(this.update , this);
- },
-
- stop : function(){
- this.paused = true;
- averta.Ticker.remove(this.update , this);
- },
-
- reset : function(){
- this.currentCount = 0;
- this.paused = true;
- this.lastTime = Date.now();
- },
-
- update : function(){
- if(this.paused || Date.now() - this.lastTime < this.delay) return;
- this.currentCount ++;
- this.lastTime = Date.now();
- if(this.onTimer)
- this.onTimer.call(this.refrence , this.getTime());
-
- } ,
-
- getTime : function(){
- return this.delay * this.currentCount;
- }
-
- };
- })();
- /* ================== bin-debug/js/pro/tools/CSSTweener.js =================== */
- ;(function(){
-
- "use strict";
-
- var evt = null;
-
- window.CSSTween = function(element , duration , delay , ease){
-
- this.$element = element;
- this.duration = duration || 1000;
- this.delay = delay || 0;
- this.ease = ease || 'linear';
-
- /*if(!evt){
- if(window._jcsspfx === 'O')
- evt = 'otransitionend';
- else if(window._jcsspfx == 'Webkit')
- evt = 'webkitTransitionEnd';
- else
- evt = 'transitionend' ;
- }*/
-
- };
-
- var p = CSSTween.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.to = function(callback , target){
- this.to_cb = callback;
- this.to_cb_target = target;
-
- return this;
- };
-
- p.from = function(callback , target ){
- this.fr_cb = callback;
- this.fr_cb_target = target;
-
- return this;
- };
-
- p.onComplete = function(callback ,target){
- this.oc_fb = callback;
- this.oc_fb_target = target;
-
- return this;
- };
-
- p.chain = function(csstween){
- this.chained_tween = csstween;
- return this;
- };
-
- p.reset = function(){
- //element.removeEventListener(evt , this.onTransComplete , true);
- clearTimeout(this.start_to);
- clearTimeout(this.end_to);
- };
-
- p.start = function(){
- var element = this.$element[0];
-
- clearTimeout(this.start_to);
- clearTimeout(this.end_to);
-
- this.fresh = true;
-
- if(this.fr_cb){
- element.style[window._jcsspfx + 'TransitionDuration'] = '0ms';
- this.fr_cb.call(this.fr_cb_target);
- }
-
- var that = this;
-
- this.onTransComplete = function(event){
-
- if(!that.fresh) return;
-
- //that.$element[0].removeEventListener(evt , this.onTransComplete, true);
- //event.stopPropagation();
-
-
- that.reset();
-
- element.style[window._jcsspfx + 'TransitionDuration'] = '';
- element.style[window._jcsspfx + 'TransitionProperty'] = '';
- element.style[window._jcsspfx + 'TransitionTimingFunction'] = '';
- element.style[window._jcsspfx + 'TransitionDelay'] = '';
-
- that.fresh = false;
- if(that.chained_tween) that.chained_tween.start();
- if(that.oc_fb) that.oc_fb.call(that.oc_fb_target);
-
- };
-
- this.start_to = setTimeout(function(){
- if ( !that.$element ) return;
- element.style[window._jcsspfx + 'TransitionDuration'] = that.duration + 'ms';
- element.style[window._jcsspfx + 'TransitionProperty'] = that.transProperty || 'all';
-
- if(that.delay > 0) element.style[window._jcsspfx + 'TransitionDelay'] = that.delay + 'ms';
- else element.style[window._jcsspfx + 'TransitionDelay'] = '';
-
- element.style[window._jcsspfx + 'TransitionTimingFunction'] = that.ease;
-
- if(that.to_cb) that.to_cb.call(that.to_cb_target);
-
- //that.$element[0].addEventListener(evt , that.onTransComplete , true );
-
- that.end_to = setTimeout(function(){that.onTransComplete();} , that.duration + (that.delay || 0));
- } , 100);
-
- return this;
- };
-
- })();
-
- /**
- * Cross Tween Class
- */
- ;(function(){
-
- "use strict";
-
- var _cssanim = null;
- window.CTween = {};
-
- function transPos(element, properties){
- if(properties.x !== undefined || properties.y !== undefined){
- if(_cssanim){
- var trans = window._jcsspfx+"Transform";
- if(properties.x !== undefined){
- properties[trans] = (properties[trans] || '') + ' translateX('+properties.x+'px)';
- delete properties.x;
- }
-
- if(properties.y !== undefined){
- properties[trans] = (properties[trans] || '') + ' translateY('+properties.y+'px)';
- delete properties.y;
- }
- }else{
- if(properties.x !== undefined){
- var posx = element.css('right') !== 'auto' ? 'right' : 'left';
- //if(!element[0].bx) element[0].bx = parseInt(element.css(posx));
- properties[posx] = /*element[0].bx + */properties.x + 'px';
- delete properties.x;
- }
-
- if(properties.y !== undefined){
- var posy = element.css('bottom') !== 'auto' ? 'bottom' : 'top';
- //if(!element[0].by) element[0].by = parseInt(element.css(posy));
- properties[posy] = /*element[0].by + */properties.y + 'px';
- delete properties.y;
- }
- }
- }
- return properties;
- }
-
- CTween.setPos = function(element , pos){
- element.css(transPos(element , pos));
- };
-
- CTween.animate = function(element , duration , properties , options){
- if(_cssanim == null) _cssanim = window._cssanim;
-
- options = options || {};
-
- transPos(element , properties);
-
- if(_cssanim){
- var tween = new CSSTween(element , duration , options.delay , EaseDic[options.ease]);
- if ( options.transProperty ) {
- tween.transProperty = options.transProperty;
- }
- tween.to(function(){ element.css(properties);});
- if(options.complete) tween.onComplete(options.complete , options.target);
- tween.start();
- tween.stop = tween.reset;
- return tween;
- }
-
- var onCl;
-
- if(options.delay) element.delay(options.delay);
- if(options.complete)
- onCl = function(){
- options.complete.call(options.target);
- };
-
- element.stop(true).animate(properties , duration , options.ease || 'linear' , onCl);
-
- return element;
- };
-
- CTween.fadeOut = function(target , duration , remove) {
- var options = {};
- if(remove === true) {
- options.complete = function(){target.remove();};
- } else if ( remove === 2 ) {
- options.complete = function(){target.css('display', 'none');};
- }
-
- CTween.animate(target , duration || 1000 , {opacity : 0} , options);
- };
-
- CTween.fadeIn = function(target , duration, reset){
- if( reset !== false ) {
- target.css('opacity' , 0).css('display', '');
- }
-
- CTween.animate(target , duration || 1000 , {opacity : 1});
- };
-
- })();
-
- ;(function(){
-
- // Thanks to matthewlein
- // https://github.com/matthewlein/Ceaser
-
- window.EaseDic = {
- 'linear' : 'linear',
- 'ease' : 'ease',
- 'easeIn' : 'ease-in',
- 'easeOut' : 'ease-out',
- 'easeInOut' : 'ease-in-out',
-
- 'easeInCubic' : 'cubic-bezier(.55,.055,.675,.19)',
- 'easeOutCubic' : 'cubic-bezier(.215,.61,.355,1)',
- 'easeInOutCubic' : 'cubic-bezier(.645,.045,.355,1)',
- 'easeInCirc' : 'cubic-bezier(.6,.04,.98,.335)',
- 'easeOutCirc' : 'cubic-bezier(.075,.82,.165,1)',
- 'easeInOutCirc' : 'cubic-bezier(.785,.135,.15,.86)',
- 'easeInExpo' : 'cubic-bezier(.95,.05,.795,.035)',
- 'easeOutExpo' : 'cubic-bezier(.19,1,.22,1)',
- 'easeInOutExpo' : 'cubic-bezier(1,0,0,1)',
- 'easeInQuad' : 'cubic-bezier(.55,.085,.68,.53)',
- 'easeOutQuad' : 'cubic-bezier(.25,.46,.45,.94)',
- 'easeInOutQuad' : 'cubic-bezier(.455,.03,.515,.955)',
- 'easeInQuart' : 'cubic-bezier(.895,.03,.685,.22)',
- 'easeOutQuart' : 'cubic-bezier(.165,.84,.44,1)',
- 'easeInOutQuart' : 'cubic-bezier(.77,0,.175,1)',
- 'easeInQuint' : 'cubic-bezier(.755,.05,.855,.06)',
- 'easeOutQuint' : 'cubic-bezier(.23,1,.32,1)',
- 'easeInOutQuint' : 'cubic-bezier(.86,0,.07,1)',
- 'easeInSine' : 'cubic-bezier(.47,0,.745,.715)',
- 'easeOutSine' : 'cubic-bezier(.39,.575,.565,1)',
- 'easeInOutSine' : 'cubic-bezier(.445,.05,.55,.95)',
- 'easeInBack' : 'cubic-bezier(.6,-.28,.735,.045)',
- 'easeOutBack' : 'cubic-bezier(.175, .885,.32,1.275)',
- 'easeInOutBack' : 'cubic-bezier(.68,-.55,.265,1.55)'
- };
- })();
- /* ================== bin-debug/js/pro/tools/Aligner.js =================== */
- ;(function(){
-
- "use strict";
-
- window.MSAligner = function(type , $container , $img ){
-
- this.$container = $container;
- this.$img = $img;
-
- this.type = type || 'stretch'; // fill , fit , stretch , tile , center
-
- this.widthOnly = false;
- this.heightOnly = false;
- };
-
- var p = MSAligner.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.init = function(w , h){
-
- this.baseWidth = w;
- this.baseHeight = h;
- this.imgRatio = w / h;
- this.imgRatio2 = h / w;
-
- switch(this.type){
- case 'tile':
- this.$container.css('background-image' , 'url('+ this.$img.attr('src') +')');
- this.$img.remove();
- break;
- case 'center':
- this.$container.css('background-image' , 'url('+ this.$img.attr('src') +')');
- this.$container.css({
- backgroundPosition : 'center center',
- backgroundRepeat : 'no-repeat'
- });
- this.$img.remove();
- break;
- case 'stretch':
- this.$img.css({
- width : '100%',
- height : '100%'
- });
- break;
- case 'fill':
- case 'fit' :
- this.needAlign = true;
- this.align();
- break;
- }
-
- };
-
- p.align = function(){
- if(!this.needAlign) return;
-
- var cont_w = this.$container.width();
- var cont_h = this.$container.height();
-
- var contRatio = cont_w / cont_h;
-
- if(this.type == 'fill'){
- if(this.imgRatio < contRatio ){
- this.$img.width(cont_w);
- this.$img.height(cont_w * this.imgRatio2);
- }else{
- this.$img.height(cont_h);
- this.$img.width(cont_h * this.imgRatio);
- }
-
- }else if(this.type == 'fit'){
-
- if(this.imgRatio < contRatio){
- this.$img.height(cont_h);
- this.$img.width(cont_h * this.imgRatio);
- }else{
- this.$img.width(cont_w);
- this.$img.height(cont_w * this.imgRatio2);
- }
- }
-
- this.setMargin();
-
- };
-
- p.setMargin = function(){
-
- var cont_w = this.$container.width();
- var cont_h = this.$container.height();
-
- this.$img.css('margin-top' , (cont_h - this.$img[0].offsetHeight) / 2 + 'px');
- this.$img.css('margin-left', (cont_w - this.$img[0].offsetWidth ) / 2 + 'px');
- }
-
- })();
- /* ================== bin-debug/js/pro/controls/controller.js =================== */
- /**
- * Touch List Control
- * version 1.1.2
- *
- * Copyright (C) 2014, Averta Ltd. All rights reserved.
- */
-
- ;(function(){
-
- "use strict";
-
- var _options = {
- bouncing : true,
- snapping : false,
- snapsize : null,
- friction : 0.05,
- outFriction : 0.05,
- outAcceleration : 0.09,
- minValidDist : 0.3,
- snappingMinSpeed : 2,
- paging : false,
- endless : false,
- maxSpeed : 160
- };
-
-
- var Controller = function(min , max , options){
-
- if(max === null || min === null) {
- throw new Error('Max and Min values are required.');
- }
-
- this.options = options || {};
-
- for(var key in _options){
- if(!(key in this.options))
- this.options[key] = _options[key];
- }
-
- this._max_value = max;
- this._min_value = min;
-
- this.value = min;
- this.end_loc = min;
-
- this.current_snap = this.getSnapNum(min);
-
- this.__extrStep = 0;
- this.__extraMove = 0;
-
- this.__animID = -1;
-
- };
-
- var p = Controller.prototype;
-
- /*
- ---------------------------------------------------
- PUBLIC METHODS
- ----------------------------------------------------
- */
-
-
- p.changeTo = function(value , animate , speed , snap_num , dispatch) {
- this.stopped = false;
- this._internalStop();
- value = this._checkLimits(value);
- speed = Math.abs(speed || 0);
-
- if(this.options.snapping){
- snap_num = snap_num || this.getSnapNum(value);
- if( dispatch !== false )this._callsnapChange(snap_num);
- this.current_snap = snap_num;
- }
-
- if(animate){
- this.animating = true;
-
- var self = this,
- active_id = ++self.__animID,
- amplitude = value - self.value,
- timeStep = 0,
- targetPosition = value,
- animFrict = 1 - self.options.friction,
- timeconst = animFrict + (speed - 20) * animFrict * 1.3 / self.options.maxSpeed;
-
- var tick = function(){
-
- if(active_id !== self.__animID) return;
-
- var dis = value - self.value;
-
- if( Math.abs(dis) > self.options.minValidDist && self.animating ){
- window.requestAnimationFrame(tick);
- } else {
-
- if( self.animating ){
- self.value = value;
- self._callrenderer();
- }
-
- self.animating = false;
-
- if( active_id !== self.__animID ){
- self.__animID = -1;
- }
-
- self._callonComplete('anim');
-
- return;
- }
-
- //self.value += dis * timeconst
- self.value = targetPosition - amplitude * Math.exp(-++timeStep * timeconst);
-
- self._callrenderer();
- };
-
- tick();
-
- return;
- }
-
- this.value = value;
- this._callrenderer();
- };
-
- p.drag = function(move){
-
- if(this.start_drag){
- this.drag_start_loc = this.value;
- this.start_drag = false;
- }
-
- this.animating = false;
- this._deceleration = false;
-
- this.value -= move;
-
- if ( !this.options.endless && (this.value > this._max_value || this.value < 0)) {
- if (this.options.bouncing) {
- this.__isout = true;
- this.value += move * 0.6;
- } else if (this.value > this._max_value) {
- this.value = this._max_value;
- } else {
- this.value = 0;
- }
- }else if(!this.options.endless && this.options.bouncing){
- this.__isout = false;
- }
-
- this._callrenderer();
-
- };
-
- p.push = function(speed){
- this.stopped = false;
- if(this.options.snapping && Math.abs(speed) <= this.options.snappingMinSpeed){
- this.cancel();
- return;
- }
-
- this.__speed = speed;
- this.__startSpeed = speed;
-
- this.end_loc = this._calculateEnd();
-
- if(this.options.snapping){
-
- var snap_loc = this.getSnapNum(this.value),
- end_snap = this.getSnapNum(this.end_loc);
-
- if(this.options.paging){
- snap_loc = this.getSnapNum(this.drag_start_loc);
-
- this.__isout = false;
- if(speed > 0){
- this.gotoSnap(snap_loc + 1 , true , speed);
- }else{
- this.gotoSnap(snap_loc - 1 , true , speed);
- }
- return;
- }else if(snap_loc === end_snap){
- this.cancel();
- return;
- }
-
- this._callsnapChange(end_snap);
- this.current_snap = end_snap;
-
- }
-
- this.animating = false;
-
- this.__needsSnap = this.options.endless || (this.end_loc > this._min_value && this.end_loc < this._max_value) ;
-
- if(this.options.snapping && this.__needsSnap)
- this.__extraMove = this._calculateExtraMove(this.end_loc);
-
-
- this._startDecelaration();
- };
-
- p.bounce = function(speed){
- if(this.animating) return;
- this.stopped = false;
- this.animating = false;
-
- this.__speed = speed;
- this.__startSpeed = speed;
-
- this.end_loc = this._calculateEnd();
-
- //if(this.options.paging){}
-
- this._startDecelaration();
- };
-
- p.stop = function(){
- this.stopped = true;
- this._internalStop();
- };
-
- p.cancel = function(){
- this.start_drag = true; // reset flag for next drag
- if(this.__isout){
- this.__speed = 0.0004;
- this._startDecelaration();
- }else if(this.options.snapping){
- this.gotoSnap(this.getSnapNum(this.value) , true);
- }
-
- };
-
- p.renderCallback = function(listener , ref){
- this.__renderHook = {fun:listener , ref:ref};
- };
-
- p.snappingCallback = function(listener , ref){
- this.__snapHook = {fun:listener , ref:ref};
- };
-
- p.snapCompleteCallback = function(listener , ref){
- this.__compHook = {fun:listener , ref:ref};
- };
-
- p.getSnapNum = function(value){
- return Math.floor(( value + this.options.snapsize / 2 ) / this.options.snapsize);
- };
-
- p.nextSnap = function(){
- this._internalStop();
-
- var curr_snap = this.getSnapNum(this.value);
-
- if(!this.options.endless && (curr_snap + 1) * this.options.snapsize > this._max_value){
- this.__speed = 8;
- this.__needsSnap = false;
- this._startDecelaration();
- }else{
- this.gotoSnap(curr_snap + 1 , true);
- }
-
- };
-
- p.prevSnap = function(){
- this._internalStop();
-
- var curr_snap = this.getSnapNum(this.value);
-
- if(!this.options.endless && (curr_snap - 1) * this.options.snapsize < this._min_value){
- this.__speed = -8;
- this.__needsSnap = false;
- this._startDecelaration();
- }else{
- this.gotoSnap(curr_snap - 1 , true);
- }
-
- };
-
- p.gotoSnap = function(snap_num , animate , speed){
- this.changeTo(snap_num * this.options.snapsize , animate , speed , snap_num);
- };
-
- p.destroy = function(){
- this._internalStop();
- this.__renderHook = null;
- this.__snapHook = null;
- this.__compHook = null;
- };
-
- /*
- ---------------------------------------------------
- PRIVATE METHODS
- ----------------------------------------------------
- */
-
- p._internalStop = function(){
- this.start_drag = true; // reset flag for next drag
- this.animating = false;
- this._deceleration = false;
- this.__extrStep = 0;
- };
-
- p._calculateExtraMove = function(value){
- var m = value % this.options.snapsize;
- return m < this.options.snapsize / 2 ? -m : this.options.snapsize - m;
- };
-
- p._calculateEnd = function(step){
- var temp_speed = this.__speed;
- var temp_value = this.value;
- var i = 0;
- while(Math.abs(temp_speed) > this.options.minValidDist){
- temp_value += temp_speed;
- temp_speed *= this.options.friction;
- i++;
- }
- if(step) return i;
- return temp_value;
- };
-
- p._checkLimits = function(value){
- if(this.options.endless) return value;
- if(value < this._min_value) return this._min_value;
- if(value > this._max_value) return this._max_value;
- return value;
- };
-
- p._callrenderer = function(){
- if(this.__renderHook) this.__renderHook.fun.call(this.__renderHook.ref , this , this.value);
- };
-
- p._callsnapChange = function(targetSnap){
- if(!this.__snapHook || targetSnap === this.current_snap) return;
- this.__snapHook.fun.call(this.__snapHook.ref , this , targetSnap , targetSnap - this.current_snap);
- };
-
- p._callonComplete = function(type){
- if(this.__compHook && !this.stopped){
- this.__compHook.fun.call(this.__compHook.ref , this , this.current_snap , type);
- }
-
- };
-
- p._computeDeceleration = function(){
-
- if(this.options.snapping && this.__needsSnap){
- var xtr_move = (this.__startSpeed - this.__speed) / this.__startSpeed * this.__extraMove;
- this.value += this.__speed + xtr_move - this.__extrStep;
- this.__extrStep = xtr_move;
- }else{
- this.value += this.__speed;
- }
-
- this.__speed *= this.options.friction; //* 10;
-
- if(!this.options.endless && !this.options.bouncing){
- if(this.value <= this._min_value){
- this.value = this._min_value;
- this.__speed = 0;
- }else if(this.value >= this._max_value){
- this.value = this._max_value;
- this.__speed = 0;
- }
- }
-
- this._callrenderer();
-
- if(!this.options.endless && this.options.bouncing){
-
- var out_value = 0;
-
- if(this.value < this._min_value){
- out_value = this._min_value - this.value;
- }else if(this.value > this._max_value){
- out_value = this._max_value - this.value;
- }
-
- this.__isout = Math.abs(out_value) >= this.options.minValidDist;
-
- if(this.__isout){
- if(this.__speed * out_value <= 0){
- this.__speed += out_value * this.options.outFriction;
- }else {
- this.__speed = out_value * this.options.outAcceleration;
- }
- }
- }
- };
-
- p._startDecelaration = function(){
- if(this._deceleration) return;
- this._deceleration = true;
-
- var self = this;
-
- var tick = function (){
-
- if(!self._deceleration) return;
-
- self._computeDeceleration();
-
- if(Math.abs(self.__speed) > self.options.minValidDist || self.__isout){
- window.requestAnimationFrame(tick);
- }else{
- self._deceleration = false;
- self.__isout = false;
-
- if(self.__needsSnap && self.options.snapping && !self.options.paging){
- self.value = self._checkLimits(self.end_loc + self.__extraMove);
- }else{
- self.value = Math.round(self.value);
- }
-
- self._callrenderer();
- self._callonComplete('decel');
- }
- };
-
- tick();
- };
-
- window.Controller = Controller;
-
- })();
- /* ================== bin-debug/js/pro/layers/LayerController.js =================== */
- /**
- * Master Slider Layer Controller
- * @author averta
- * @package Master Slider jQuery PRO
- * @since 2.11.1
- */
- ;(function(window, document, $){
- /**
- * Layer Controller constructor
- * @param {MSSlide} slide layer controller's slide.
- */
- window.MSLayerController = function (slide) {
- this.slide = slide;
- this.slider = slide.slider;
- this.layers = [];
- this.layersCount = 0;
- this.preloadCount = 0;
- this.$layers = $('<div></div>').addClass('ms-slide-layers');
- this.$staticLayers = $('<div></div>').addClass('ms-static-layers');
- this.$fixedLayers = $('<div></div>').addClass('ms-fixed-layers');
- this.$animLayers = $('<div></div>').addClass('ms-anim-layers');
- };
- var p = MSLayerController.prototype;
- /*-----------------------------------------*\
- Public Methods
- \*-----------------------------------------*/
- /**
- * Adds new layer to the controller and slide
- * @param {MSLayerElement} layer
- */
- p.addLayer = function (layer) {
- layer.slide = this.slide;
- layer.controller = this;
- // append layer element to the layers container based on `data-position` attribute.
- switch ( layer.$element.data('position') ) {
- case 'static':
- this.hasStaticLayer = true;
- layer.$element.appendTo(this.$staticLayers);
- break;
- case 'fixed':
- this.hasFixedLayer = true;
- layer.$element.appendTo(this.$fixedLayers);
- break;
- default:
- layer.$element.appendTo(this.$animLayers);
- break;
- }
-
- layer.create();
- this.layers.push(layer);
- this.layersCount ++;
- // @since 1.7.0
- if( layer.parallax ){
- this.hasParallaxLayer = true;
- }
- if ( layer.needPreload ) {
- this.preloadCount ++;
- }
- };
- /**
- * add layers over slide
- * it calls after addLayer
- */
- p.create = function () {
- this.slide.$element.append(this.$layers);
- this.$layers.append(this.$animLayers);
- if ( this.hasStaticLayer ) {
- this.$layers.append(this.$staticLayers);
- }
- if(this.slider.options.layersMode == 'center'){
- this.$layers.css('max-width' , this.slider.options.width + 'px');
- if ( this.hasFixedLayer ) {
- this.$fixedLayers.css('max-width' , this.slider.options.width + 'px');
- }
- }
- };
- /**
- * load layers that requires preloading
- * @param {Function} callback onload callback function
- */
- p.loadLayers = function (callback) {
- this._onReadyCallback = callback;
- if ( this.preloadCount === 0 ) {
- this._onlayersReady();
- return;
- }
- for(var i = 0 ; i !== this.layersCount; ++i){
- if(this.layers[i].needPreload) {
- this.layers[i].loadImage();
- }
- }
- };
- /**
- * prepare layers to show over slide, this method will be called via `prepareToSelect` method of slide.
- */
- p.prepareToShow = function () {
- if ( this.hasParallaxLayer ) {
- this._enableParallaxEffect();
- }
- if ( this.hasFixedLayer ) {
- this.$fixedLayers.prependTo(this.slide.view.$element);
- }
- };
- /**
- * show layers over slide
- */
- p.showLayers = function(){
- if ( this.layersHideTween ) {
- this.layersHideTween.stop(true);
- }
- if ( this.fixedLayersHideTween ) {
- this.fixedLayersHideTween.stop(true);
- }
- this._resetLayers();
- this.$animLayers.css('opacity', '').css('display', '');
- if ( this.hasFixedLayer ){
- this.$fixedLayers.css('opacity', '').css('display', '');
- }
- if ( this.ready ) {
- this._initLayers();
- this._locateLayers();
- this._startLayers();
- }
- };
- /**
- * hideLayers this method will be called via slide class.
- */
- p.hideLayers = function () {
-
- if( this.slide.selected || this.slider.options.instantStartLayers ){
- var that = this;
- that.layersHideTween = CTween.animate(this.$animLayers, 500, {opacity: 0}, {
- complete:function(){
- that._resetLayers();
- }
- });
- if ( this.hasFixedLayer ) {
- this.fixedLayersHideTween = CTween.animate(this.$fixedLayers, 500, {opacity: 0}, {
- complete:function(){
- that.$fixedLayers.detach();
- }
- });
- }
- // disables parallax effect
- // @since 1.6.0
- if ( this.hasParallaxLayer ) {
- this._disableParallaxEffect();
- }
- }
- };
- /**
- * hide layers from slide
- */
- p.animHideLayers = function(){
- if ( !this.ready ) {
- return;
- }
- for(var i = 0; i !== this.layersCount; ++i){
- this.layers[i].hide();
- }
- };
- /**
- * calculate new size of layers containers and locate layers
- * @param {Number} width slider width
- * @param {Number} height slider height
- * @param {Boolean} hard whether call init layers.
- */
- p.setSize = function (width, height, hard) {
- if ( this.ready && (this.slide.selected || this.hasStaticLayer) ) {
- if ( hard ) {
- this._initLayers(true);
- }
- this._locateLayers(!this.slide.selected);
- }
-
- if ( this.slider.options.autoHeight ) {
- this.updateHeight();
- }
- if ( this.slider.options.layersMode == 'center' ) {
- var left = Math.max( 0 , (width - this.slider.options.width) / 2 ) + 'px';
- this.$layers[0].style.left = left;
- this.$fixedLayers[0].style.left = left;
- }
-
- };
- /**
- * updates layers container height
- */
- p.updateHeight = function () {
- var h = this.slide.getHeight() + 'px';
- this.$layers[0].style.height = h;
- this.$fixedLayers[0].style.height = h;
- };
- /**
- * This method will be called by the last layer after loading all of layers.
- */
- p._onlayersReady = function(){
- this.ready = true;
- if ( this.hasStaticLayer && !this.slide.isSleeping ) {
- this._initLayers(false, true);
- }
- this._onReadyCallback.call(this.slide);
- };
- /**
- * this method will be called by slide when it starts sleeping
- */
- p.onSlideSleep = function () {
- };
- /**
- * this method will be called by slide after waking up
- */
- p.onSlideWakeup = function () {
- if ( this.hasStaticLayer && this.ready ) {
- this._initLayers(false, true);
- }
- };
- /**
- * destroy layer controller and stop layer animations
- */
- p.destroy = function () {
- if ( this.slide.selected && this.hasParallaxLayer ) {
- this._disableParallaxEffect();
- }
- for(var i = 0; i < this.layersCount; ++i){
- this.layers[i].$element.stop(true).remove();
- }
- this.$layers.remove();
- this.$staticLayers.remove();
- this.$fixedLayers.remove();
- this.$animLayers.remove();
- };
- /*-----------------------------------------*\
- Private Methods
- \*-----------------------------------------*/
- /**
- * start layer effect
- */
- p._startLayers = function(){
- for(var i = 0; i !== this.layersCount; ++i){
- this.layers[i].start();
- }
- };
-
- /**
- * call init method of all layers
- * @param {Boolean} force
- */
- p._initLayers = function(force, onlyStatics){
-
- if ( this.init && !force || this.slider.init_safemode ) {
- return;
- }
-
- this.init = onlyStatics !== true;
-
- var i = 0;
- if ( onlyStatics && !this.staticsInit ) { // init only static layers
- this.staticsInit = true;
- for ( ;i !== this.layersCount; ++i ) {
- if ( this.layers[i].staticLayer ) {
- this.layers[i].init();
- }
- }
- } else if ( this.staticsInit && !force ) { // statics are already initiated, init dynamics
- for ( ;i !== this.layersCount; ++i ) {
- if ( !this.layers[i].staticLayer ){
- this.layers[i].init();
- }
- }
- } else { // init all
- for ( ;i !== this.layersCount; ++i ) {
- this.layers[i].init();
- }
- }
- };
-
- /**
- * locate layers over slide
- */
- p._locateLayers = function (onlyStatics){
- var i = 0;
- if ( onlyStatics ) {
- for ( ;i !== this.layersCount; ++i ) {
- if ( this.layers[i].staticLayer ) {
- this.layers[i].locate();
- }
- }
- } else {
- for ( ;i !== this.layersCount; ++i ) {
- this.layers[i].locate();
- }
- }
- };
-
- /**
- * rest layers
- */
- p._resetLayers = function(){
- this.$animLayers.css('display', 'none').css('opacity', 1);
- for ( var i = 0; i !== this.layersCount; ++i ) {
- this.layers[i].reset();
- }
- };
- /**
- * moves layers based on x and y
- * @param {Number} x
- * @param {Number} y
- * @param {Boolean} fast whether animate or not
- */
- p._applyParallax = function(x, y, fast){
- for(var i = 0 ; i !== this.layersCount; ++i){
- if( this.layers[i].parallax != null ){
- this.layers[i].moveParallax(x, y, fast);
- }
- }
- };
- /**
- * enable parallax moving layers
- */
- p._enableParallaxEffect = function(){
- if( this.slider.options.parallaxMode === 'swipe' ){
- this.slide.view.addEventListener(MSViewEvents.SCROLL, this._swipeParallaxMove, this);
- } else {
- this.slide.$element.on('mousemove' , {that:this}, this._mouseParallaxMove)
- .on('mouseleave', {that:this}, this._resetParalax);
- /**
- * Calculates new position of parallax based on device orintation gamma and beta
- * @param {Event} e
- * @since 1.6.0
- */
- /*if( window._mobile && window.DeviceOrientationEvent ){
-
- var that = this;
- this.orientationParallaxMove = function(e){
- var beta = Math.round(e.beta),
- gamma = Math.round(e.gamma);
-
- that._applyParallax(beta * that.__width / 360 , -gamma * that.__height / 360);
- };
- window.addEventListener('deviceorientation', this.orientationParallaxMove, false);
- }*/
- }
- };
- /**
- * disable parallax effect
- */
- p._disableParallaxEffect = function(){
- if( this.slider.options.parallaxMode === 'swipe' ){
- this.slide.view.removeEventListener(MSViewEvents.SCROLL, this._swipeParallaxMove, this);
- } else {
- this.slide.$element.off('mousemove', this._mouseParallaxMove)
- .off('mouseleave', this._resetParalax);
-
- /*if( window._mobile && window.DeviceOrientationEvent ){
- window.removeEventListener('deviceorientation', this.orientationParallaxMove);
- }*/
- }
- };
- /**
- * reset layers parallax position to 0, 0
- */
- p._resetParalax = function(e){
- var that = e.data.that;
- that._applyParallax(0,0);
- };
- /**
- * Calculates new mouse position over slide and moves layers
- * @since 1.6.0
- */
- p._mouseParallaxMove = function(e){
- var that = e.data.that,
- os = that.slide.$element.offset(),
- slider = that.slider;
-
- if( slider.options.parallaxMode !== 'mouse:y-only' ){
- var x = e.pageX - os.left - that.slide.__width / 2;
- } else {
- var x = 0;
- }
- if( slider.options.parallaxMode !== 'mouse:x-only' ){
- var y = e.pageY - os.top - that.slide.__height / 2;
- } else {
- var y = 0;
- }
- that._applyParallax(-x, -y);
- };
- /**
- * Calculates new position of parallax based on slide position
- * @param {Event} e
- * @since 1.6.0
- */
- p._swipeParallaxMove = function(e){
- var value = this.slide.position - this.slide.view.__contPos;
-
- if ( this.slider.options.dir === 'v' ) {
- this._applyParallax(0, value, true);
- } else {
- this._applyParallax(value, 0, true);
- }
- };
- })(window, document, jQuery);
- /* ================== bin-debug/js/pro/layers/LayerEffects.js =================== */
- ;(function($){
-
- window.MSLayerEffects = {};
-
- var installed,
- _fade = {opacity:0};
-
- MSLayerEffects.setup = function(){
-
- if(installed) return;
- installed = true;
-
- var st = MSLayerEffects,
- transform_css = window._jcsspfx + 'Transform',
- transform_orig_css = window._jcsspfx + 'TransformOrigin',
- o = $.browser.opera; // Opera sucks :|
- _2d = window._css2d && window._cssanim && !o;
-
- st.defaultValues = {left : 0 , top: 0 , opacity:(isMSIE('<=9')?1:'') , right:0 , bottom:0};
- st.defaultValues[transform_css] = '';
- //st.defaultValues[transform_orig_css] = '';
- st.rf = 1;
-
- st.presetEffParams = {
- random: '30|300',
- long : 300,
- short : 30,
- 'false' :false,
- 'true' :true,
- tl : 'top left' , bl: 'bottom left',
- tr : 'top right' , br: 'bottom right',
- rt : 'top right' , lb: 'bottom left',
- lt : 'top left' , rb: 'bottom right',
- t : 'top' , b : 'bottom',
- r : 'right' , l : 'left',
- c : 'center'
- };
-
-
- /*
- ----------------------------------------
- 2D Effects
- ----------------------------------------
- */
-
- st.fade = function(){
- return _fade;
- };
-
- st.left = (_2d)? function(dist , fade){
- var r = fade === false ? {} : {opacity:0};
- r[transform_css] = 'translateX(' + -dist*st.rf + 'px)';
- return r;
- } : function (dist, fade){
- var r = fade === false ? {} : {opacity:0};
- r.left = -dist*st.rf + 'px';
- return r;
- };
-
- st.right = (_2d)? function(dist , fade){
- var r = fade === false ? {} : {opacity:0};
- r[transform_css] = 'translateX(' + dist*st.rf + 'px)';
- return r;
- } : function (dist, fade){
- var r = fade === false ? {} : {opacity:0};
- r.left = dist*st.rf + 'px';
- return r;
- };
-
- st.top = (_2d)? function(dist , fade){
- var r = fade === false ? {} : {opacity:0};
- r[transform_css] = 'translateY(' + -dist*st.rf + 'px)';
- return r;
- } : function (dist, fade){
- var r = fade === false ? {} : {opacity:0};
- r.top = -dist*st.rf + 'px';
- return r;
- };
-
- st.bottom = (_2d)? function(dist , fade){
- var r = fade === false ? {} : {opacity:0};
- r[transform_css] = 'translateY(' + dist*st.rf + 'px)';
- return r;
- } : function (dist, fade){
- var r = fade === false ? {} : {opacity:0};
- r.top = dist*st.rf + 'px';
- return r;
- };
-
- st.from = (_2d)? function(leftdis , topdis , fade){
- var r = fade === false ? {} : {opacity:0};
- r[transform_css] = 'translateX('+leftdis*st.rf+'px) translateY(' + topdis*st.rf + 'px)';
- return r;
- } : function (leftdis , topdis, fade){
- var r = fade === false ? {} : {opacity:0};
- r.top = topdis*st.rf + 'px';
- r.left = leftdis*st.rf + 'px';
- return r;
- };
-
-
- // --------------------------------------------------------------------
-
- st.rotate = (_2d)? function(deg , orig ){
- var r = {opacity: 0};
- r[transform_css] = ' rotate('+deg+'deg)';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (deg, orig){
- return _fade;
- };
-
- st.rotateleft = (_2d)? function(deg , dist , orig , fade){
- var r = st.left(dist , fade);
- r[transform_css] += ' rotate('+deg+'deg)';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (deg , dist , orig , fade){
- return st.left(dist , fade);
- };
-
- st.rotateright = (_2d)? function(deg , dist , orig , fade){
- var r = st.right(dist , fade);
- r[transform_css] += ' rotate('+deg+'deg)';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (deg , dist , orig , fade){
- return st.right(dist , fade);
- };
-
- st.rotatetop = (_2d)? function(deg , dist , orig , fade){
- var r = st.top(dist , fade);
- r[transform_css] += ' rotate('+deg+'deg)';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (deg , dist , orig , fade){
- return st.top(dist , fade);
- };
-
- st.rotatebottom = (_2d)? function(deg , dist , orig , fade){
- var r = st.bottom(dist , fade);
- r[transform_css] += ' rotate('+deg+'deg)';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (deg , dist , orig , fade){
- return st.bottom(dist , fade);
- };
-
- st.rotatefrom = (_2d)? function(deg , leftdis , topdis , orig , fade){
- var r = st.from(leftdis , topdis , fade);
- r[transform_css] += ' rotate('+deg+'deg)';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (deg , leftdis , topdis , orig , fade){
- return st.from(leftdis , topdis , fade);
- };
-
- st.skewleft = (_2d)? function(deg , dist , fade){
- var r = st.left(dist , fade);
- r[transform_css] += ' skewX(' + deg + 'deg)';
- return r;
- } : function (deg , dist , fade){
- return st.left(dist , fade);
- };
-
- st.skewright = (_2d)? function(deg , dist , fade){
- var r = st.right(dist , fade);
- r[transform_css] += ' skewX(' + -deg + 'deg)';
- return r;
- } : function (deg , dist , fade){
- return st.right(dist , fade);
- };
-
- st.skewtop = (_2d)? function(deg , dist , fade){
- var r = st.top(dist , fade);
- r[transform_css] += ' skewY(' + deg + 'deg)';
- return r;
- } : function (deg , dist , fade){
- return st.top(dist , fade);
- };
-
- st.skewbottom = (_2d)? function(deg , dist , fade){
- var r = st.bottom(dist , fade);
- r[transform_css] += ' skewY(' + -deg + 'deg)';
- return r;
- } : function (deg , dist , fade){
- return st.bottom(dist , fade);
- };
-
-
- st.scale = (_2d)? function(x , y , orig , fade){
- var r = fade === false ? {} : {opacity:0};
- r[transform_css] = ' scaleX('+x+') scaleY('+y+')';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (x , y , orig , fade){
- return fade === false ? {} : {opacity:0};
- };
-
- st.scaleleft = (_2d)? function(x , y , dist , orig , fade){
- var r = st.left(dist , fade);
- r[transform_css] = ' scaleX('+x+') scaleY('+y+')';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (x , y , dist , orig , fade){
- return st.left(dist , fade);
- };
-
- st.scaleright = (_2d)? function(x , y , dist , orig , fade){
- var r = st.right(dist , fade);
- r[transform_css] = ' scaleX('+x+') scaleY('+y+')';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (x , y , dist , orig , fade){
- return st.right(dist , fade);
- };
-
- st.scaletop = (_2d)? function(x , y , dist , orig , fade){
- var r = st.top(dist , fade);
- r[transform_css] = ' scaleX('+x+') scaleY('+y+')';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (x , y , dist , orig , fade){
- return st.top(dist , fade);
- };
-
- st.scalebottom = (_2d)? function(x , y , dist , orig , fade){
- var r = st.bottom(dist , fade);
- r[transform_css] = ' scaleX('+x+') scaleY('+y+')';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (x , y , dist , orig , fade){
- return st.bottom(dist , fade);
- };
-
- st.scalefrom = (_2d)? function(x , y , leftdis , topdis , orig , fade){
- var r = st.from(leftdis , topdis , fade);
- r[transform_css] += ' scaleX('+x+') scaleY('+y+')';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (x , y , leftdis , topdis , orig , fade){
- return st.from(leftdis , topdis , fade);
- };
-
- st.rotatescale = (_2d)? function(deg , x , y , orig , fade){
- var r = st.scale(x , y , orig , fade);
- r[transform_css] += ' rotate('+deg+'deg)';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (deg , x , y , orig , fade){
- return st.scale(x , y , orig , fade);
- };
-
-
- /*
- ----------------------------------------
- 3D Effects
- ----------------------------------------
- */
-
- st.front = (window._css3d)? function(dist , fade){
- var r = fade === false ? {} : {opacity:0};
- r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + dist + 'px ) rotate(0.001deg)';
- return r;
- } : function (dist){
- return _fade;
- };
-
- st.back = (window._css3d)? function(dist, fade){
- var r = fade === false ? {} : {opacity:0};
- r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + -dist + 'px ) rotate(0.001deg)';
- return r;
- } : function (dist){
- return _fade;
- };
-
- st.rotatefront = (window._css3d)? function(deg , dist , orig , fade ){
- var r = fade === false ? {} : {opacity:0};
- r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + dist + 'px ) rotate('+ (deg || 0.001) +'deg)';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (deg , dist , orig , fade ){
- return _fade;
- };
-
- st.rotateback = (window._css3d)? function(deg , dist , orig , fade ){
- var r = fade === false ? {} : {opacity:0};
- r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + -dist + 'px ) rotate('+ (deg || 0.001) +'deg)';
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (deg , dist , orig , fade ){
- return _fade;
- };
-
- st.rotate3dleft = (window._css3d)? function(x , y , z , dist , orig , fade){
- var r = st.left(dist , fade);
- r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
- if(orig) r[transform_orig_css] = orig;
- return r;
-
- } : function (x , y , z , dist , orig , fade){
- return st.left(dist , fade);;
- };
-
- st.rotate3dright = (window._css3d)? function(x , y , z , dist , orig , fade){
- var r = st.right(dist , fade);
- r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (x , y , z , dist , orig , fade){
- return st.right(dist , fade);;
- };
-
- st.rotate3dtop = (window._css3d)? function(x , y , z , dist , orig , fade){
- var r = st.top(dist , fade);
- r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (x , y , z , dist , orig , fade){
- return st.top(dist , fade);;
- };
-
- st.rotate3dbottom = (window._css3d)? function(x , y , z , dist , orig , fade){
- var r = st.bottom(dist , fade);
- r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (x , y , z , dist , orig , fade){
- return st.bottom(dist , fade);
- };
-
- st.rotate3dfront = (window._css3d)? function(x , y , z , dist , orig , fade){
- var r = st.front(dist , fade);
- r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (x , y , z , dist , orig , fade){
- return st.front(dist , fade);
- };
-
- st.rotate3dback = (window._css3d)? function(x , y , z , dist , orig , fade){
- var r = st.back(dist , fade);
- r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
- if(orig) r[transform_orig_css] = orig;
- return r;
- } : function (x , y , z , dist , orig , fade){
- return st.back(dist , fade);
- };
-
- // transform effect
- st.t = (window._css3d)? function(fade,tx,ty,tz,r,rx,ry,rz,scx,scy,skx,sky,ox,oy,oz){
- var _r = fade === false ? {} : {opacity:0};
- var transform = 'perspective(2000px) ';
-
- tx !== 'n' && (transform += 'translateX(' + tx * st.rf + 'px) ');
- ty !== 'n' && (transform += 'translateY(' + ty * st.rf + 'px) ');
- tz !== 'n' && (transform += 'translateZ(' + tz * st.rf + 'px) ');
- r !== 'n' && (transform += 'rotate(' + r + 'deg) ');
- rx !== 'n' && (transform += 'rotateX(' + rx + 'deg) ');
- ry !== 'n' && (transform += 'rotateY(' + ry + 'deg) ');
- rz !== 'n' && (transform += 'rotateZ(' + rz + 'deg) ');
- skx !== 'n' && (transform += 'skewX(' + skx + 'deg) ');
- sky !== 'n' && (transform += 'skewY(' + sky + 'deg) ');
- scx !== 'n' && (transform += 'scaleX(' + scx + ') ');
- scy !== 'n' && (transform += 'scaleY(' + scy + ')');
-
- _r[transform_css] = transform;
-
- var trans_origin = '';
-
- trans_origin += (ox !== 'n' ? ox + '% ' : '50% ');
- trans_origin += (oy !== 'n' ? oy + '% ' : '50% ');
- trans_origin += (oz !== 'n' ? oz + 'px' : '');
-
- _r[transform_orig_css] = trans_origin;
-
- return _r;
-
- } : function(fade,tx,ty,tz,r,rx,ry,rz,scx,scy,skx,sky,ox,oy,oz) {
-
- var r = fade === false ? {} : {opacity:0};
- tx !== 'n' && (r.left = tx * st.rf + 'px');
- ty !== 'n' && (r.top = ty * st.rf + 'px');
- return r;
- }
- };
- })(jQuery);
- /* ================== bin-debug/js/pro/layers/LayerElement.js =================== */
- /**
- * Master Slider Layer Element
- * @author Averta
- * @package Master Slider jQuery
- */
-
- ;(function($){
-
- /**
- * master slider layer element constructor
- */
- window.MSLayerElement = function(){
-
- // default layer start animation
- this.start_anim = {
- name : 'fade',
- duration : 1000,
- ease : 'linear',
- delay : 0
- };
-
- // default layer end animation
- this.end_anim = {
- duration : 1000,
- ease : 'linear'
- };
-
- // default layer type
- this.type = 'text'; // video , image
-
- //this.swipe = true;
- this.resizable = true;
- this.minWidth = -1;
- this.isVisible = true;
-
- // list of styles which should stores initial values and changes based on screen size for resizable layers
- this.__cssConfig = [
- 'margin-top' , 'padding-top' ,
- 'margin-bottom' , 'padding-left' ,
- 'margin-right' , 'padding-right' ,
- 'margin-left' , 'padding-bottom' ,
-
-
- 'font-size' , 'line-height' ,
- /*'height' , */ 'width' ,
- 'left' , 'right' ,
- 'top' , 'bottom'
- ];
-
- this.baseStyle = {};
- };
-
- var p = MSLayerElement.prototype;
-
- /*--------------------------------------------------*\
- Public Methods
- \*--------------------------------------------------*/
-
- /**
- * determine start animation for the layer
- * @param {Objec} anim
- */
- p.setStartAnim = function(anim){
- $.extend(this.start_anim , anim); $.extend(this.start_anim, this._parseEff(this.start_anim.name));
- this.$element.css('visibility' , 'hidden');
- };
-
- /**
- * determine end/hide animation for the layer
- * @param {Object} anim
- */
- p.setEndAnim = function(anim){
- $.extend(this.end_anim, anim);
- };
-
- /**
- * create layer object from layer element
- */
- p.create = function(){
- this.$element.css('display', 'none');
-
- // resizable layer
- this.resizable = this.$element.data('resize') !== false;
-
- // fixed positioning
- this.fixed = this.$element.data('fixed') === true;
-
- // hide under parameter
- if( this.$element.data('widthlimit') !== undefined ) {
- this.minWidth = this.$element.data('widthlimit');
- }
-
- if( !this.end_anim.name ) {
- this.end_anim.name = this.start_anim.name;
- }
-
- if( this.end_anim.time ) {
- this.autoHide = true;//this.end_anim.delay = this.slide.delay * 1000 - this.end_anim.duration;
- }
-
- // is this layer static?
- this.staticLayer = this.$element.data('position') === 'static';
- this.fixedLayer = this.$element.data('position') === 'fixed';
- this.layersCont = this.controller.$layers;
-
- // make it visible if it's static
- if ( this.staticLayer ) {
- this.$element.css('display', '')
- .css('visibility', '');
- }
-
- // create action event
- // @since v1.7.2
- if( this.$element.data('action') !== undefined ) {
- var slideController = this.slide.slider.slideController;
- this.$element.on('click', function(event){
- slideController.runAction($(this).data('action'));
- event.preventDefault();
- }).addClass('ms-action-layer');
- }
-
- $.extend(this.end_anim , this._parseEff(this.end_anim.name));
- this.slider = this.slide.slider;
-
- // new alignment method
- // @since v1.6.1
- var layerOrigin = this.layerOrigin = this.$element.data('origin');
- if ( layerOrigin ){
-
- var vOrigin = layerOrigin.charAt(0),
- hOrigin = layerOrigin.charAt(1),
- offsetX = this.$element.data('offset-x'),
- offsetY = this.$element.data('offset-y');
-
- if( offsetY === undefined ){
- offsetY = 0;
- }
-
- switch ( vOrigin ){
- case 't':
- this.$element[0].style.top = offsetY + 'px';
- break;
- case 'b':
- this.$element[0].style.bottom = offsetY + 'px';
- break;
- case 'm':
- this.$element[0].style.top = offsetY + 'px';
- this.middleAlign = true;
- }
-
- if( offsetX === undefined ){
- offsetX = 0;
- }
-
- switch ( hOrigin ){
- case 'l':
- this.$element[0].style.left = offsetX + 'px';
- break;
- case 'r':
- this.$element[0].style.right = offsetX + 'px';
- break;
- case 'c':
- this.$element[0].style.left = offsetX + 'px';
- this.centerAlign = true;
- }
- }
-
- // parallax effect
- // @since v1.6.0
- this.parallax = this.$element.data('parallax')
- if( this.parallax != null ) {
- this.parallax /= 100;
- this.$parallaxElement = $('<div></div>').addClass('ms-parallax-layer');
- if( this.link ) { // only for image layer
- this.link.wrap(this.$parallaxElement);
- this.$parallaxElement = this.link.parent();
- } else {
- this.$element.wrap(this.$parallaxElement);
- this.$parallaxElement = this.$element.parent();
- }
-
- this._lastParaX = 0;
- this._lastParaY = 0;
- this._paraX = 0;
- this._paraY = 0;
-
-
- // add bottom 0 to the parallax element if layer origin specified to the bottom
- this.alignedToBot = this.layerOrigin && this.layerOrigin.indexOf('b') !== -1;
- if( this.alignedToBot ) {
- this.$parallaxElement.css('bottom', 0);
- }
-
- if( window._css3d ){
- this.parallaxRender = this._parallaxCSS3DRenderer;
- } else if ( window._css2d ){
- this.parallaxRender = this._parallaxCSS2DRenderer;
- } else {
- this.parallaxRender = this._parallax2DRenderer;
- }
-
- if( this.slider.options.parallaxMode !== 'swipe' ){ // mouse mode
- averta.Ticker.add(this.parallaxRender, this);
- }
- }
-
- // remove all data- attributes excluding data-src
- $.removeDataAttrs(this.$element, ['data-src']);
- };
-
- /**
- * initialize layer
- */
- p.init = function(){
- //if(this.initialized) return;
- this.initialized = true;
-
- var value;
-
- this.$element.css('visibility' , '');
- // store initial layer styles
- for(var i = 0 , l = this.__cssConfig.length; i < l ; i ++){
- var key = this.__cssConfig[i];
- if( this.type === 'text' && key === 'width'){ // in some browsers using computed style for width in text layer causes unexpected word wrapping
- value = this.$element[0].style.width;
- } else {
- value = this.$element.css(key);
-
- // fix for Google Chrome in ios, sometimes image layers over first slide not showing correctly.
- if ( (key === 'width' || key === 'height') && value === '0px' ) {
- value = this.$element.data(key) + 'px';
- }
- }
-
- if( value != 'auto' && value != "" && value != "normal" ) {
- this.baseStyle[key] = parseInt(value);
- }
- }
-
- // @since v1.6.0
- if ( this.middleAlign ){
- this.baseHeight = this.$element.outerHeight(false);//this.$element.height();
- }
-
- if ( this.centerAlign ){
- // in some browsers using computed style for width in text layer causes unexpected word wrapping
- //if ( this.type === 'text' ){
- // this.baseWidth = parseInt(this.$element[0].style.width);
- //} else {
- this.baseWidth = this.$element.outerWidth(false);
- //}
- }
-
- };
-
- /**
- * locate layer over slider
- */
- p.locate = function(){
- // is slide ready?
- if ( !this.slide.ready ) {
- return;
- }
-
- var width = parseFloat(this.layersCont.css('width')),
- height = parseFloat(this.layersCont.css('height')),
- factor, isPosition;
-
- if( !this.staticLayer && this.$element.css('display') === 'none' && this.isVisible) {
- this.$element.css('display', '')
- .css('visibility', 'hidden');
- }
-
- factor = this.resizeFactor = width / this.slide.slider.options.width;
- // updated @since v1.6.1
- for (var key in this.baseStyle) {
-
- isPosition = key === 'top' || key === 'left' || key === 'bottom' || key === 'right';
-
- //switch resize/position factor
- if( this.fixed && isPosition ){
- factor = 1;
- } else {
- factor = this.resizeFactor;
- }
-
- if( !this.resizable && !isPosition ){
- continue;
- }
-
- if ( key === 'top' && this.middleAlign ){
- this.$element[0].style.top = '0px';
- this.baseHeight = this.$element.outerHeight(false);
- this.$element[0].style.top = this.baseStyle['top'] * factor + (height - this.baseHeight) / 2 + 'px';
- } else if ( key === 'left' && this.centerAlign ){
- this.$element[0].style.left = '0px';
- this.baseWidth = this.$element.outerWidth(false);
- this.$element[0].style.left = this.baseStyle['left'] * factor + (width - this.baseWidth) / 2 + 'px';
- } else {
- this.$element.css(key , this.baseStyle[key] * factor + 'px');
- }
- }
-
- this.visible(this.minWidth < width);
- };
-
- /**
- * start layer animation
- */
- p.start = function(){
-
- // is it already showing or is it a static layer?
- if ( this.isShowing || this.staticLayer ) {
- return;
- }
-
- this.isShowing = true;
-
- var key , base;
-
- // reads css value form LayerEffects
- MSLayerEffects.rf = this.resizeFactor;
- var effect_css = MSLayerEffects[this.start_anim.eff_name].apply(null , this._parseEffParams(this.start_anim.eff_params));
-
- // checkes effect css and defines TO css values
- var start_css_eff = {};
-
- // set from position
- for(key in effect_css){
-
- // check the position key (top, left, right or bottom) for animatin
- // It mostly will be used in old browsers
- // In effect left:100, layer base style right:300 -> effect changes to right:100
- if( this._checkPosKey(key , effect_css) ){
- continue;
- }
-
- // set default value from Layer Effects Class
- if( MSLayerEffects.defaultValues[key] != null ){
- start_css_eff[key] = MSLayerEffects.defaultValues[key];
- }
-
- if( key in this.baseStyle ){
- base = this.baseStyle[key];
-
- // updated @since v1.6.1
- if ( this.middleAlign && key === 'top' ){
- base += (parseInt(this.layersCont.height()) - this.$element.outerHeight(false)) / 2;
- }
-
- if ( this.centerAlign && key === 'left' ){
- base += (parseInt(this.layersCont.width()) - this.$element.outerWidth(false)) / 2;
- }
- //----------------------
-
- effect_css[key] = base + parseFloat(effect_css[key]) + 'px';
- start_css_eff[key] = base + 'px';
- }
-
- this.$element.css(key , effect_css[key]);
- }
-
- var that = this;
-
- clearTimeout(this.to);
- this.to = setTimeout(function(){
- //that.locate();
- that.$element.css('visibility', '');
- that._playAnimation(that.start_anim , start_css_eff);
- } , that.start_anim.delay || 0.01);
-
-
- this.clTo = setTimeout(function(){
- that.show_cl = true;
- },(this.start_anim.delay || 0.01) + this.start_anim.duration);
-
- if( this.autoHide ){
- clearTimeout(this.hto);
- this.hto = setTimeout(function(){that.hide();} , that.end_anim.time );
- }
-
- };
-
- /**
- * starts hide animation
- */
- p.hide = function(){
-
- // static layers doesn't support animations
- if ( this.staticLayer ) {
- return;
- }
-
- this.isShowing = false;
-
- // reads css value form LayerEffects
- var effect_css = MSLayerEffects[this.end_anim.eff_name].apply(null , this._parseEffParams(this.end_anim.eff_params));
-
- for(key in effect_css){
-
- if(this._checkPosKey(key , effect_css)) continue;
-
- if( key === window._jcsspfx + 'TransformOrigin' ){
- this.$element.css(key , effect_css[key]);
- }
-
- if(key in this.baseStyle){
- effect_css[key] = this.baseStyle[key] + parseFloat(effect_css[key]) + 'px';
- }
-
- }
-
- this._playAnimation(this.end_anim , effect_css);
-
- clearTimeout(this.to);
- clearTimeout(this.hto);
- clearTimeout(this.clTo);
- };
-
- /**
- * reset layer
- */
- p.reset = function(){
- if ( this.staticLayer ) {
- return;
- }
-
- this.isShowing = false;
- //this.$element.css(window._csspfx + 'animation-name', '' );
- this.$element[0].style.display = 'none';
- this.$element.css('opacity', '');
- this.$element[0].style['transitionDuration'] = '';
-
- if(this.show_tween)
- this.show_tween.stop(true);
-
- clearTimeout(this.to);
- clearTimeout(this.hto);
- };
-
- /**
- * destroy layer
- */
- p.destroy = function(){
- this.reset();
- this.$element.remove();
- };
-
- /**
- * change the visibility status
- * @param {Boolean} value
- */
- p.visible = function(value){
- if(this.isVisible == value) return;
-
- this.isVisible = value;
-
- this.$element.css('display' , (value ? '' : 'none'));
- };
-
- /**
- * Change the detestation of parallax position
- * @param {Number} x
- * @param {Number} y
- * @since 1.6.0
- */
- p.moveParallax = function(x, y , fast){
- this._paraX = x;
- this._paraY = y;
- if( fast ){
- this._lastParaX = x;
- this._lastParaY = y;
- this.parallaxRender();
- }
- };
-
- /*------------------------------------*\
- Private Methods
- \*------------------------------------*/
-
- /**
- * play layer animation
- * @param {Obeject} animation layer animation object
- * @param {Object} css animation css object
- */
- p._playAnimation = function(animation , css){
- var options = {};
-
- if(animation.ease){
- options.ease = animation.ease;
- }
-
- options.transProperty = window._csspfx + 'transform,opacity';
-
- this.show_tween = CTween.animate(this.$element, animation.duration , css , options);
- };
-
- /**
- * generate random value
- * @param {String} value the pattern value min|max
- * @return {Number}
- */
- p._randomParam = function(value){
- var min = Number(value.slice(0,value.indexOf('|')));
- var max = Number(value.slice(value.indexOf('|')+1));
-
- return min + Math.random() * (max - min);
- };
-
- /**
- * parse effect function
- * @param {String} eff_name effect function
- * @return {Object}
- */
- p._parseEff = function(eff_name){
-
- var eff_params = [];
-
- if ( eff_name.indexOf('(') !== -1 ) {
- var temp = eff_name.slice(0 , eff_name.indexOf('(')).toLowerCase();
- var value;
-
- eff_params = eff_name.slice(eff_name.indexOf('(') + 1 , -1).replace(/\"|\'|\s/g , '').split(',');
- eff_name = temp;
-
- for ( var i = 0, l = eff_params.length; i < l; ++i) {
- value = eff_params[i];
-
- if ( value in MSLayerEffects.presetEffParams) {
- value = MSLayerEffects.presetEffParams[value];
- }
-
- eff_params[i] = value;
- }
- }
-
- return {eff_name:eff_name , eff_params:eff_params};
- };
-
- /**
- * parse effect function parameters
- * @param {Aarray} params effect parameters
- * @return {Array}
- */
- p._parseEffParams = function(params){
- var eff_params = [];
- for(var i = 0 , l = params.length; i < l ; ++i){
- var value = params[i];
- if(typeof value === 'string' && value.indexOf('|') !== -1) value = this._randomParam(value);
-
- eff_params[i] = value;
- }
-
- return eff_params;
- };
-
- /**
- * calculates layer position based on initial positioning style and layer effect
- * @param {string} key positioning key
- * @param {Object} style style object
- * @return {Boolean}
- */
- p._checkPosKey = function(key , style){
- if(key === 'left' && !(key in this.baseStyle) && 'right' in this.baseStyle){
- style.right = -parseInt(style.left) + 'px';
- delete style.left;
- return true;
- }
-
- if(key === 'top' && !(key in this.baseStyle) && 'bottom' in this.baseStyle){
- style.bottom = -parseInt(style.top) + 'px';
- delete style.top;
- return true;
- }
-
- return false;
- };
-
- /**
- * calculate parallax position
- */
- p._parallaxCalc = function(){
- var x_def = this._paraX - this._lastParaX,
- y_def = this._paraY - this._lastParaY;
-
- this._lastParaX += x_def / 12;
- this._lastParaY += y_def / 12;
-
- if( Math.abs( x_def ) < 0.019 ) {
- this._lastParaX = this._paraX;
- }
-
- if( Math.abs( y_def ) < 0.019 ) {
- this._lastParaY = this._paraY;
- }
-
- }
-
- /**
- * Parallax move ticker function
- */
- p._parallaxCSS3DRenderer = function(){
- this._parallaxCalc();
- this.$parallaxElement[0].style[window._jcsspfx + 'Transform'] = 'translateX(' + this._lastParaX * this.parallax + 'px) translateY(' + this._lastParaY * this.parallax + 'px) translateZ(0)';
- };
-
- /**
- * parallax move ticker for CSS2 browsers
- * @return {[type]} [description]
- */
- p._parallaxCSS2DRenderer = function(){
- this._parallaxCalc();
- this.$parallaxElement[0].style[window._jcsspfx + 'Transform'] = 'translateX(' + this._lastParaX * this.parallax + 'px) translateY(' + this._lastParaY * this.parallax + 'px)';
- };
-
- /**
- * parallax move ticker for zombie browsers
- */
- p._parallax2DRenderer = function(){
- this._parallaxCalc();
-
- // change bottom instead of top if layer aligned to the bottom (origin)
- if( this.alignedToBot ) {
- this.$parallaxElement[0].style.bottom = this._lastParaY * this.parallax + 'px';
- } else {
- this.$parallaxElement[0].style.top = this._lastParaY * this.parallax + 'px';
- }
-
- this.$parallaxElement[0].style.left = this._lastParaX * this.parallax + 'px';
- };
-
- })(jQuery);
- /* ================== bin-debug/js/pro/layers/ImageLayerElement.js =================== */
- ;(function($){
-
- window.MSImageLayerElement = function(){
- MSLayerElement.call(this);
- this.needPreload = true;
-
- this.__cssConfig = [
- 'width' , 'height' ,
- 'margin-top' , 'padding-top' ,
- 'margin-bottom' , 'padding-left' ,
- 'margin-right' , 'padding-right' ,
- 'margin-left' , 'padding-bottom' ,
-
- 'left' , 'right' ,
- 'top' , 'bottom'
- ];
-
- this.type = 'image';
- };
-
- MSImageLayerElement.extend(MSLayerElement);
-
- var p = MSImageLayerElement.prototype;
- var _super = MSLayerElement.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.create = function(){
-
- if(this.link){
- var p = this.$element.parent();
- p.append(this.link);
- this.link.append(this.$element);
- this.link.removeClass('ms-layer');
- this.$element.addClass('ms-layer');
- p = null;
- }
-
- _super.create.call(this);
-
- if(this.$element.data('src') != undefined){
- this.img_src = this.$element.data('src');
- this.$element.removeAttr('data-src');
- }else{
- var that = this;
- this.$element.on('load', function(event){
- that.controller.preloadCount--;
- if(that.controller.preloadCount === 0)
- that.controller._onlayersReady();
- }).each($.jqLoadFix);
- }
-
- if($.browser.msie)
- this.$element.on('dragstart', function(event) { event.preventDefault(); }); // disable native dragging
- };
-
- p.loadImage = function(){
- var that = this;
-
- this.$element.preloadImg(this.img_src , function(event){
- //this.$element.width(event.width).height(event.height);
- that.controller.preloadCount--;
- if(that.controller.preloadCount === 0) that.controller._onlayersReady();
- });
- };
-
- })(jQuery);
- /* ================== bin-debug/js/pro/layers/VideoLayerElement.js =================== */
- ;(function($){
-
- window.MSVideoLayerElement = function(){
- MSLayerElement.call(this);
-
- this.__cssConfig.push(
- 'height'
- );
-
- this.type = 'video';
- };
-
- MSVideoLayerElement.extend(MSLayerElement);
-
- var p = MSVideoLayerElement.prototype;
- var _super = MSLayerElement.prototype;
-
- /*-------------- METHODS --------------*/
- p.__playVideo = function(){
- if(this.img)CTween.fadeOut(this.img , 500 , 2);
- CTween.fadeOut(this.video_btn , 500 , 2);
- this.video_frame.attr('src' , 'about:blank').css('display' , 'block');
- if(this.video_url.indexOf('?') == -1) this.video_url += '?';
- this.video_frame.attr('src' , this.video_url + '&autoplay=1');
- };
-
- p.start = function(){
- _super.start.call(this);
-
- if ( this.$element.data('autoplay') ) {
- this.__playVideo();
- }
- };
-
- p.reset = function(){
- _super.reset.call(this);
-
- if(this.needPreload || this.$element.data('btn')){
- this.video_btn.css('opacity' , 1).css('display', 'block');
- this.video_frame.attr('src' , 'about:blank').css('display' , 'none');
- }
-
- if(this.needPreload){
- this.img.css('opacity' , 1).css('display', 'block');
- return;
- }
-
- this.video_frame.attr('src' , this.video_url);
- };
-
- p.create = function(){
- _super.create.call(this);
-
- this.video_frame = this.$element.find('iframe').css({width:'100%' , height:'100%'});
- this.video_url = this.video_frame.attr('src');
-
- var has_img = this.$element.has('img').length != 0;
-
- if(!has_img && !this.$element.data('btn')) return;
-
- this.video_frame.attr('src' , 'about:blank').css('display' , 'none');
-
- var that = this;
-
- this.video_btn = $('<div></div>').appendTo(this.$element).addClass('ms-video-btn').click(function() {
- that.__playVideo();
- });
-
- //this.video_frame.attr('src' , 'about:blank');
-
- if(!has_img) return;
-
- this.needPreload = true;
- this.img = this.$element.find('img:first').addClass('ms-video-img');
-
- if(this.img.data('src') !== undefined){
- this.img_src = this.img.data('src');
- this.img.removeAttr('data-src');
- }else{
- var that = this;
- this.img.attr('src' , this.img_src).on('load', function(event) {
- that.controller.preloadCount--;
- if(that.controller.preloadCount === 0)
- that.controller._onlayersReady();
- }).each($.jqLoadFix);
- }
-
- if($.browser.msie)
- this.img.on('dragstart', function(event) { event.preventDefault(); }); // disables native dragging
- };
-
- p.loadImage = function(){
- var that = this;
- this.img.preloadImg(this.img_src, function(event) {
- that.controller.preloadCount--;
- if(that.controller.preloadCount === 0) that.controller._onlayersReady();
- });
- };
-
- })(jQuery);
- /* ================== bin-debug/js/pro/layers/HotspotLayer.js =================== */
- ;(function($){
-
- "use strict";
-
- window.MSHotspotLayer = function(){
- MSLayerElement.call(this);
-
- this.__cssConfig = [
- 'margin-top' , 'padding-top' ,
- 'margin-bottom' , 'padding-left' ,
- 'margin-right' , 'padding-right' ,
- 'margin-left' , 'padding-bottom' ,
-
- 'left' , 'right' ,
- 'top' , 'bottom'
- ];
-
-
- this.ease = 'Expo';
- this.hide_start = true;
- this.type = 'hotspot';
- };
-
- MSHotspotLayer.extend(MSLayerElement);
-
- var p = MSHotspotLayer.prototype;
- var _super = MSLayerElement.prototype;
-
- /*-------------- METHODS --------------*/
-
- p._showTT = function(){
- if(!this.show_cl) return;
-
- clearTimeout(this.hto);
- if(this._tween) this._tween.stop(true);
-
- if( this.hide_start ){
- this.align = this._orgAlign;
- this._locateTT();
-
- this.tt.css({display:'block'});
- this._tween = CTween.animate(this.tt , 900 , this.to , {ease:'easeOut'+this.ease});
- this.hide_start = false;
- }
-
- };
-
- p._hideTT = function(){
- if(!this.show_cl) return;
- if(this._tween) this._tween.stop(true);
-
- var that = this;
-
- clearTimeout(this.hto);
- this.hto = setTimeout(function(){
- that.hide_start = true;
- that._tween = CTween.animate(that.tt , 900 , that.from , {ease:'easeOut'+that.ease , complete:function(){that.tt.css('display' , 'none');}} );
- } , 200);
- };
-
- p._updateClassName = function(name){
- if(this._lastClass) this.tt.removeClass(this._lastClass);
- this.tt.addClass(name);
- this._lastClass = name;
- }
-
- p._alignPolicy = function(){
- var h = this.tt.outerHeight(false),
- w = Math.max(this.tt.outerWidth(false) , parseInt(this.tt.css('max-width'))),
- ww = window.innerWidth,
- wh = window.innerHeight;
-
- switch(this.align){
- case 'top':
- if(this.base_t < 0 )
- return 'bottom';
- break;
- case 'right':
- if(this.base_l + w > ww || this.base_t < 0)
- return 'bottom';
- break;
- case 'left':
- if(this.base_l < 0 || this.base_t < 0)
- return 'bottom';
- break;
- }
-
- return null;
- };
-
- p._locateTT = function(){
- var os = this.$element.offset(),
- os2 = this.slide.slider.$element.offset();
-
- var dist = 50,
- space = 15 //* this.factor;
-
- this.pos_x = os.left - os2.left - this.slide.slider.$element.scrollLeft();
- this.pos_y = os.top - os2.top - this.slide.slider.$element.scrollTop();
-
- this.from = {opacity:0};
- this.to = {opacity:1};
-
- this._updateClassName('ms-tooltip-'+this.align);
- this.tt_arrow.css('margin-left' , '');
-
- var arrow_w = 15,//parseInt(this.tt_arrow.css('border-left')) + parseInt(this.tt_arrow.css('border-right')),
- arrow_h = 15;//parseInt(this.tt_arrow.css('border-top')) + parseInt(this.tt_arrow.css('border-bottom'));
-
- //console.log(arrow_h,arrow_w);
- //
- switch(this.align){
- case 'top':
- var w = Math.min(this.tt.outerWidth(false) , parseInt(this.tt.css('max-width')));
- this.base_t = this.pos_y - this.tt.outerHeight(false) - arrow_h - space;
- this.base_l = this.pos_x - w/2;
-
- if(this.base_l + w > window.innerWidth){
- this.tt_arrow.css('margin-left' , -arrow_w/2 + this.base_l + w -window.innerWidth + 'px');
- this.base_l = window.innerWidth - w;
- }
-
- if(this.base_l < 0){
- this.base_l = 0;
- this.tt_arrow.css('margin-left' , -arrow_w/2 + this.pos_x - this.tt.outerWidth(false) / 2 + 'px');
- }
-
- if(window._css3d){
- this.from[window._jcsspfx+'Transform'] = 'translateY(-'+dist+'px)';
- this.to[window._jcsspfx+'Transform'] = '';
- }else{
- this.from.top = (this.base_t - dist) + 'px';
- this.to.top = this.base_t + 'px';
- }
-
- break;
- case 'bottom':
- var w = Math.min(this.tt.outerWidth(false) , parseInt(this.tt.css('max-width')));
-
- this.base_t = this.pos_y + arrow_h + space;
- this.base_l = this.pos_x - w/2;
-
- if(this.base_l + w > window.innerWidth){
- this.tt_arrow.css('margin-left' , -arrow_w/2 + this.base_l + w -window.innerWidth + 'px');
- this.base_l = window.innerWidth - w;
- }
-
- if(this.base_l < 0){
- this.base_l = 0;
- this.tt_arrow.css('margin-left' , -arrow_w/2 + this.pos_x - this.tt.outerWidth(false) / 2 + 'px');
- }
-
- if(window._css3d){
- this.from[window._jcsspfx+'Transform'] = 'translateY('+dist+'px)';
- this.to[window._jcsspfx+'Transform'] = '';
- }else{
- this.from.top = (this.base_t + dist) + 'px';
- this.to.top = this.base_t + 'px';
- }
-
- break;
-
- case 'right':
- this.base_l = this.pos_x + arrow_w + space;
- this.base_t = this.pos_y - this.tt.outerHeight(false) / 2;
-
- if(window._css3d){
- this.from[window._jcsspfx+'Transform'] = 'translateX('+dist+'px)';
- this.to[window._jcsspfx+'Transform'] = '';
- }else{
- this.from.left = (this.base_l + dist) + 'px';
- this.to.left = this.base_l + 'px';
- }
-
- break;
- case 'left':
- this.base_l = this.pos_x - arrow_w - this.tt.outerWidth(false) - space;
- this.base_t = this.pos_y - this.tt.outerHeight(false) / 2;
-
- if(window._css3d){
- this.from[window._jcsspfx+'Transform'] = 'translateX(-'+dist+'px)';
- this.to[window._jcsspfx+'Transform'] = '';
- }else{
- this.from.left = (this.base_l - dist) + 'px';
- this.to.left = this.base_l + 'px';
- }
-
- break;
- }
-
-
-
- var policyAlign = this._alignPolicy();
- if(policyAlign !== null){
- this.align = policyAlign;
- this._locateTT();
- return;
- }
-
- this.tt.css('top' ,parseInt(this.base_t)+'px').
- css('left' ,parseInt(this.base_l)+'px');
-
- this.tt.css(this.from);
-
- };
-
- p.start = function(){
- _super.start.call(this);
- this.tt.appendTo(this.slide.slider.$element);
- //this._locateTT();
- this.tt.css('display' , 'none');
- };
-
- p.reset = function(){
- _super.reset.call(this);
- this.tt.detach();
- };
-
- /**
- * locate hotspot over slide
- * @override LayerElement.locate
- * @since 2.2.0
- */
- /* p.locate = function(){
- _super.locate.call(this);
-
- if ( this.relativeToBG ) {
- console.log(this.baseOffsetX , this.slide.$bg_img.width() , this.slide.bgWidth)
- this.$element[0].style.left = this.baseOffsetX * this.slide.$bg_img.width() / this.slide.bgWidth + 'px';
- this.$element[0].style.top = this.baseOffsetY * this.slide.$bg_img.height() / this.slide.bgHeight + 'px';
- }
-
- };
- */
- p.create = function(){
- var that = this;
-
- //@since 2.2.0
- //chnage offset progin to top left
- /* this.relativeToBG = this.$element.data('relative') && (this.slide.fillMode === 'fill' || this.slide.fillMode === 'fit');
- if ( this.relativeToBG ) {
-
- var origin = this.$element.data('origin'),
- osy = this.$element.data('offset-y'),
- osx = this.$element.data('offset-x');
-
- if ( origin ) {
- if ( origin.charAt(0) === 'b' ){
- osy = this.slide.slider.options.height - this.$element.data('offset-y');
- this.$element.data('offset-y', osy);
- }
-
- if ( origin.charAt(1) === 'r' ){
- osx = this.slide.slider.options.width - this.$element.data('offset-x');
- this.$element.data('offset-x', osx);
- }
-
- }
-
- this.$element.data('origin', 'tl');
-
- this.baseOffsetX = osx;
- this.baseOffsetY = osy;
- }*/
-
-
- this._orgAlign = this.align = this.$element.data('align') !== undefined ? this.$element.data('align') : 'top';
-
- this.data = this.$element.html();
-
- this.$element.html('').on('mouseenter' , function(){that._showTT();}).on('mouseleave',function(){that._hideTT();});
-
- this.point = $('<div><div class="ms-point-center"></div><div class="ms-point-border"></div></div>')
- .addClass('ms-tooltip-point')
- .appendTo(this.$element);
-
- var link = this.$element.data('link'),
- target = this.$element.data('target');
-
- if( link ){
- this.point.on('click', function(){window.open(link , target || '_self');});
- }
-
- this.tt = $('<div></div>')
- .addClass('ms-tooltip')
- //.addClass('ms-tooltip-'+this.align)
- .css('display','hidden')
- .css('opacity' , 0);
-
- // @since v1.6.1
- if( this.$element.data('width') !== undefined ){
- this.tt.css('width', this.$element.data('width'))
- .css('max-width', this.$element.data('width'));
- }
-
- this.tt_arrow = $('<div></div>')
- .addClass('ms-tooltip-arrow')
- .appendTo(this.tt);
-
- this._updateClassName('ms-tooltip-'+this.align);
-
- this.ttcont = $('<div></div>')
- .addClass('ms-tooltip-cont')
- .html(this.data)
- .appendTo(this.tt)
-
-
- if( this.$element.data('stay-hover') === true ) {
- this.tt.on('mouseenter' , function(){
- if( that.hide_start ){
- return
- }
- clearTimeout(that.hto);
- that._tween.stop(true);
- that._showTT();
- }).on('mouseleave', function(){
- that._hideTT();
- });
- }
-
- _super.create.call(this);
- };
-
- })(jQuery);
- /* ================== bin-debug/js/pro/layers/ButtonLayer.js =================== */
- /**
- * Master Slider Button Layer
- * @author Averta
- * @since 1.7.2
- * @extends {MSLayerElement}
- */
- (function($){
-
- window.MSButtonLayer = function(){
- MSLayerElement.call(this);
-
- this.type = 'button';
- };
-
- MSButtonLayer.extend(MSLayerElement);
-
- var p = MSButtonLayer.prototype;
- var _super = MSLayerElement.prototype;
-
- var positionKies = ['top', 'left', 'bottom', 'right'];
-
- /*-------------- METHODS --------------*/
-
- p.create = function(){
- _super.create.call(this);
- this.$element.wrap('<div class="ms-btn-container"></div>').css('position', 'relative');
- this.$container = this.$element.parent();
- };
-
- p.locate = function(){
- _super.locate.call(this);
- var key, tempValue;
-
- for (var i=0; i<4; i++){
- key = positionKies[i];
- if ( key in this.baseStyle ) {
- tempValue = this.$element.css(key);
- this.$element.css(key, '');
- this.$container.css(key, tempValue);
- }
- }
-
- this.$container.width(this.$element.outerWidth(true))
- .height(this.$element.outerHeight(true));
- };
-
- })(jQuery);
- /* ================== bin-debug/js/pro/controls/SliderEvent.js =================== */
- window.MSSliderEvent = function (type){
- this.type = type;
- };
- MSSliderEvent.CHANGE_START = 'ms_changestart';
- MSSliderEvent.CHANGE_END = 'ms_changeend';
- MSSliderEvent.WAITING = 'ms_waiting';
- MSSliderEvent.AUTOPLAY_CHANGE = 'ms_autoplaychange';
- MSSliderEvent.VIDEO_PLAY = 'ms_videoPlay';
- MSSliderEvent.VIDEO_CLOSE = 'ms_videoclose';
- MSSliderEvent.INIT = 'ms_init';
- MSSliderEvent.HARD_UPDATE = 'ms_hard_update';
- MSSliderEvent.RESIZE = 'ms_resize';
- MSSliderEvent.RESERVED_SPACE_CHANGE = 'ms_rsc'; // internal use
- MSSliderEvent.DESTROY = 'ms_destroy';
- /* ================== bin-debug/js/pro/controls/Slide.js =================== */
- /**
- * Master Slider Slide Class
- * @author averta
- * @package Master Slider jQuery
- */
- ;(function(window, document, $){
-
- "use strict";
-
- window.MSSlide = function(){
-
- this.$element = null;
- this.$loading = $('<div></div>').addClass('ms-slide-loading');
-
- this.view = null;
- this.index = -1;
-
- this.__width = 0;
- this.__height = 0;
-
- this.fillMode = 'fill'; // fill , fit , stretch , tile , center
-
- this.selected = false;
- this.pselected = false;
- this.autoAppend = true;
- this.isSleeping = true;
-
- this.moz = $.browser.mozilla;
- };
-
- var p = MSSlide.prototype;
-
- /**
- * on swipe start handler
- */
- p.onSwipeStart = function(){
- //this.$layers.css(window._csspfx + 'transition-duration' , '0ms');
- if ( this.link ) {
- this.linkdis = true;
- }
-
- if ( this.video ) {
- this.videodis = true;
- }
- };
-
- /**
- * on swipe move handler
- */
- p.onSwipeMove = function (e) {
- var move = Math.max(Math.abs(e.data.distanceX), Math.abs(e.data.distanceY));
- this.swipeMoved = move > 4;
- };
-
- /**
- * on swipe cancel handler
- */
- p.onSwipeCancel = function(e){
- if ( this.swipeMoved ) {
- this.swipeMoved = false;
- return;
- }
-
- if ( this.link ) {
- this.linkdis = false;
- }
-
- if ( this.video ) {
- this.videodis = false;
- }
- //this.$layers.css(window._csspfx + 'transition-duration' , this.view.__slideDuration + 'ms');
- };
-
- /**
- * setup layer controller for the slide
- * @since 2.11.0
- */
- p.setupLayerController = function () {
- this.hasLayers = true;
- this.layerController = new MSLayerController(this);
- };
- /**
- * this method called after loading all assets related to this slide
- */
- p.assetsLoaded = function(){
- this.ready = true;
- this.slider.api._startTimer();
-
- if( this.selected || (this.pselected && this.slider.options.instantStartLayers) ){
-
- if ( this.hasLayers ) {
- this.layerController.showLayers();
- }
-
- if(this.vinit){
- this.bgvideo.play();
- if( !this.autoPauseBgVid ) {
- this.bgvideo.currentTime = 0;
- }
- }
-
- }
- if ( !this.isSleeping ) {
- this.setupBG();
- }
-
- CTween.fadeOut(this.$loading , 300 , true);
-
- //sequence loading
- if ( (this.slider.options.preload === 0 || this.slider.options.preload === 'all') && this.index < this.view.slideList.length - 1 ) {
- this.view.slideList[this.index + 1].loadImages();
- } else if ( this.slider.options.preload === 'all' && this.index === this.view.slideList.length - 1 ){
- this.slider._removeLoading();
- }
-
- };
-
- /**
- * adds backgroun image to the slider
- * @param {Element} img slide image element
- */
- p.setBG = function(img){
- this.hasBG = true;
- var that = this;
-
- this.$imgcont = $('<div></div>').addClass('ms-slide-bgcont');
-
- this.$element.append(this.$loading)
- .append(this.$imgcont);
-
- this.$bg_img = $(img).css('visibility' , 'hidden');
- this.$imgcont.append(this.$bg_img);
-
- this.bgAligner = new MSAligner(that.fillMode , that.$imgcont, that.$bg_img );
- this.bgAligner.widthOnly = this.slider.options.autoHeight;
-
- if ( that.slider.options.autoHeight && (that.pselected || that.selected) ) {
- that.slider.setHeight(that.slider.options.height);
- }
-
- if ( this.$bg_img.data('src') !== undefined ) {
- this.bg_src = this.$bg_img.data('src');
- this.$bg_img.removeAttr('data-src');
- } else {
- this.$bg_img.one('load', function(event) {that._onBGLoad(event);})
- .each($.jqLoadFix);
- }
-
- };
-
- /**
- * align and resize backgrund image over slide
- */
- p.setupBG = function(){
-
- //if(this.isSettedup) return;
- //this.isSettedup = true;
-
- if ( !this.initBG && this.bgLoaded ) {
- this.initBG = true;
- this.$bg_img.css('visibility' , '');
- this.bgWidth = this.bgNatrualWidth || this.$bg_img.width();
- this.bgHeight = this.bgNatrualHeight || this.$bg_img.height();
-
- CTween.fadeIn(this.$imgcont , 300);
-
- if(this.slider.options.autoHeight){
- this.$imgcont.height(this.bgHeight * this.ratio);
- }
-
- this.bgAligner.init(this.bgWidth , this.bgHeight);
- this.setSize(this.__width , this.__height);
-
- if(this.slider.options.autoHeight && (this.pselected || this.selected))
- this.slider.setHeight(this.getHeight());
- }
-
- };
-
-
-
- /**
- * start loading images
- */
- p.loadImages = function(){
- if ( this.ls ) {
- return;
- }
-
- this.ls = true;
-
- if ( this.bgvideo ) {
- this.bgvideo.load();
- }
- if ( this.hasBG && this.bg_src ) {
- var that = this;
- this.$bg_img.preloadImg(this.bg_src , function(event) {that._onBGLoad(event);});
- }
-
- if ( this.hasLayers ) {
- this.layerController.loadLayers(this._onLayersLoad);
- }
- // There is nothing to preload? so slide is ready to show.
- if( !this.hasBG && !this.hasLayers ) {
- this.assetsLoaded();
- }
-
- };
-
- /**
- * layerController on assets load callback
- */
- p._onLayersLoad = function () {
- this.layersLoaded = true;
- if ( !this.hasBG || this.bgLoaded ) {
- this.assetsLoaded();
- }
- };
- /**
- * on background image loaded
- * @param {Event} event
- */
- p._onBGLoad = function(event){
- this.bgNatrualWidth = event.width;
- this.bgNatrualHeight = event.height;
-
- this.bgLoaded = true;
-
- if ( $.browser.msie ) {
- this.$bg_img.on('dragstart', function(event) { event.preventDefault(); }); // disables native dragging
- }
-
- if ( !this.hasLayers || this.layerController.ready ) {
- this.assetsLoaded();
- }
- };
-
- /* -----------------------------------------------------*/
-
- /**
- * add video background to the slide
- * @param {jQuery Element} $video
- */
- p.setBGVideo = function($video){
-
- if ( !$video[0].play ) {
- return;
- }
-
- // disables video in mobile devices
- if ( window._mobile ) {
- $video.remove();
- return;
- }
-
- this.bgvideo = $video[0];
- var that = this;
-
- $video.addClass('ms-slide-bgvideo');
-
- if ( $video.data('loop') !== false ) {
- this.bgvideo.addEventListener('ended' , function(){
- //that.bgvideo.currentTime = -1;
- that.bgvideo.play();
- });
- }
-
- if ( $video.data('mute') !== false ) {
- this.bgvideo.muted = true;
- }
-
- if ( $video.data('autopause') === true ) {
- this.autoPauseBgVid = true;
- }
-
- this.bgvideo_fillmode = $video.data('fill-mode') || 'fill'; // fill , fit , none
-
- if ( this.bgvideo_fillmode !== 'none' ) {
- this.bgVideoAligner = new MSAligner(this.bgvideo_fillmode , this.$element, $video );
-
- this.bgvideo.addEventListener('loadedmetadata' , function(){
- if(that.vinit) return;
-
- that.vinit = true;
- that.video_aspect = that.bgVideoAligner.baseHeight/that.bgVideoAligner.baseWidth;
- that.bgVideoAligner.init(that.bgvideo.videoWidth , that.bgvideo.videoHeight);
- that._alignBGVideo();
- CTween.fadeIn($(that.bgvideo) , 200);
-
- if ( that.selected ) {
- that.bgvideo.play();
- }
- });
- }
-
- $video.css('opacity' , 0);
-
- this.$bgvideocont = $('<div></div>').addClass('ms-slide-bgvideocont').append($video);
-
- if ( this.hasBG ) {
- this.$imgcont.before(this.$bgvideocont);
- } else {
- this.$bgvideocont.appendTo(this.$element);
- }
- };
-
- /**
- * align video in slide
- */
- p._alignBGVideo = function () {
- if ( !this.bgvideo_fillmode || this.bgvideo_fillmode === 'none' ) {
- return;
- }
- this.bgVideoAligner.align();
- };
-
- /* -----------------------------------------------------*/
-
- /**
- * resize slide
- * @param {Number} width
- * @param {Number} height
- * @param {Boolean} hard after resizing reinitializes layers
- */
- p.setSize = function(width, height, hard) {
-
- this.__width = width;
-
- if ( this.slider.options.autoHeight ) {
- if ( this.bgLoaded ) {
- this.ratio = this.__width / this.bgWidth;
- height = Math.floor(this.ratio * this.bgHeight);
- this.$imgcont.height(height);
- } else {
- this.ratio = width / this.slider.options.width;
- height = this.slider.options.height * this.ratio;
- }
- }
-
- this.__height = height;
- this.$element.width(width).height(height);
-
- if(this.hasBG && this.bgLoaded)this.bgAligner.align();
-
- this._alignBGVideo();
-
- if ( this.hasLayers ) {
- this.layerController.setSize(width, height, hard);
- }
- };
-
- /**
- * calculates slide height
- * @return {Number} slide height
- */
- p.getHeight = function(){
-
- if ( this.hasBG && this.bgLoaded ) {
- return this.bgHeight * this.ratio;
- }
-
- return Math.max(this.$element[0].clientHeight, this.slider.options.height * this.ratio);
- };
-
- /* -----------------------------------------------------*/
- // YouTube and Vimeo videos
-
- /**
- * playe embeded video
- */
- p.__playVideo = function (){
-
- if ( this.vplayed || this.videodis ) {
- return;
- }
-
- this.vplayed = true;
-
- if ( !this.slider.api.paused ) {
- this.slider.api.pause();
- this.roc = true; // resume on close;
- }
-
- this.vcbtn.css('display' , '');
- CTween.fadeOut(this.vpbtn , 500 , false);
- CTween.fadeIn(this.vcbtn , 500);
- CTween.fadeIn(this.vframe , 500);
- this.vframe.css('display' , 'block').attr('src' , this.video + '&autoplay=1');
- this.view.$element.addClass('ms-def-cursor');
-
- // remove perspective style from view if it's Firefox.
- // it fixes video fullscreen issue in Firefox
- if ( this.moz ) {
- this.view.$element.css('perspective', 'none');
- }
-
- // if swipe navigation enabled
- if ( this.view.swipeControl ) {
- this.view.swipeControl.disable();
- }
-
- this.slider.slideController.dispatchEvent(new MSSliderEvent(MSSliderEvent.VIDEO_PLAY));
- };
-
- /**
- * close embeded video
- */
- p.__closeVideo = function(){
-
- if ( !this.vplayed ) {
- return;
- }
-
- this.vplayed = false;
-
- if(this.roc){
- this.slider.api.resume();
- }
-
- var that = this;
-
- CTween.fadeIn(this.vpbtn , 500);
- CTween.animate(this.vcbtn , 500 , {opacity:0} , {complete:function(){ that.vcbtn.css ('display' , 'none'); }});
- CTween.animate(this.vframe , 500 , {opacity:0} , {complete:function(){ that.vframe.attr('src' , 'about:blank').css('display' , 'none');}});
-
- // video fullscreen issue in Firefox
- if ( this.moz ) {
- this.view.$element.css('perspective', '');
- }
-
- // if swipe navigation enabled
- if ( this.view.swipeControl ) {
- this.view.swipeControl.enable();
- }
-
- this.view.$element.removeClass('ms-def-cursor');
- this.slider.slideController.dispatchEvent(new MSSliderEvent(MSSliderEvent.VIDEO_CLOSE));
- };
-
- /* -----------------------------------------------------*/
-
- /**
- * create slide - it adds requierd elements over slide
- */
- p.create = function(){
- var that = this;
-
- if ( this.hasLayers ) {
- this.layerController.create();
- }
-
- if ( this.link ) {
- this.link.addClass('ms-slide-link').html('').click(function(e){
- if ( that.linkdis ) {
- e.preventDefault();
- }
- });
-
- // this.$element.css('cursor' , 'pointer')
- // .click(function(){ if(!that.linkdis) window.open(that.link , that.link_targ || '_self'); });
- }
-
- if ( this.video ) {
-
- if ( this.video.indexOf('?') === -1 ) {
- this.video += '?';
- }
-
- this.vframe = $('<iframe></iframe>')
- .addClass('ms-slide-video')
- .css({width:'100%' , height:'100%' , display:'none'})
- .attr('src' , 'about:blank')
- .attr('allowfullscreen', 'true')
- .appendTo(this.$element);
-
- this.vpbtn = $('<div></div>')
- .addClass('ms-slide-vpbtn')
- .click(function(){that.__playVideo();})
- .appendTo(this.$element);
-
- this.vcbtn = $('<div></div>')
- .addClass('ms-slide-vcbtn')
- .click(function(){that.__closeVideo();})
- .appendTo(this.$element)
- .css('display','none');
-
- if ( window._touch ) {
- this.vcbtn.removeClass('ms-slide-vcbtn')
- .addClass('ms-slide-vcbtn-mobile')
- .append('<div class="ms-vcbtn-txt">Close video</div>')
- .appendTo(this.view.$element.parent());
- }
- }
-
- if ( !this.slider.options.autoHeight && this.hasBG ) {
- this.$imgcont.css('height' , '100%');
-
- if ( this.fillMode === 'center' || this.fillMode === 'stretch' ){
- this.fillMode = 'fill';
- }
- }
-
- if ( this.slider.options.autoHeight ) {
- this.$element.addClass('ms-slide-auto-height');
- }
-
- this.sleep(true);
- };
-
- /**
- * destory the slide
- */
- p.destroy = function(){
- if ( this.hasLayers ) {
- this.layerController.destroy();
- this.layerController = null;
- }
- this.$element.remove();
- this.$element = null;
- };
-
- /**
- * everything require to do before selecting slide
- */
- p.prepareToSelect = function(){
-
- if ( this.pselected || this.selected ) {
- return;
- }
-
- this.pselected = true;
-
- if ( this.link || this.video ) {
- this.view.addEventListener(MSViewEvents.SWIPE_START , this.onSwipeStart , this);
- this.view.addEventListener(MSViewEvents.SWIPE_MOVE , this.onSwipeMove , this);
- this.view.addEventListener(MSViewEvents.SWIPE_CANCEL , this.onSwipeCancel , this);
- this.linkdis = false;
- this.swipeMoved = false;
- }
-
- this.loadImages();
-
- if ( this.hasLayers ) {
- this.layerController.prepareToShow();
- }
-
- if ( this.ready ) {
- if( this.bgvideo ){
- this.bgvideo.play();
- }
-
- if ( this.hasLayers && this.slider.options.instantStartLayers ){
- this.layerController.showLayers();
- }
- }
- if( this.moz ){
- this.$element.css('margin-top' , '');
- }
-
-
- };
-
- /*p.prepareToUnselect = function(){
- if(!this.pselected || !this.selected) return;
-
- this.pselected = false;
-
- };*/
-
- /**
- * select slide
- */
- p.select = function(){
- if ( this.selected ) {
- return;
- }
-
- this.selected = true;
- this.pselected = false;
- this.$element.addClass('ms-sl-selected');
-
- if(this.hasLayers){
-
- if ( this.slider.options.autoHeight ) {
- this.layerController.updateHeight();
- }
-
- if( !this.slider.options.instantStartLayers ) {
- this.layerController.showLayers();
- }
-
- //this.view.addEventListener(MSViewEvents.SCROLL , this.updateLayers , this)
- }
-
-
- if( this.ready && this.bgvideo ) {
- this.bgvideo.play();
- }
-
- // @since 1.8.0
- // Autoplay iframe video
- if ( this.videoAutoPlay ) {
- this.videodis = false;
- this.vpbtn.trigger('click');
- }
-
- };
-
- /**
- * remove selected status
- */
- p.unselect = function(){
- this.pselected = false;
-
- if ( this.moz ) {
- this.$element.css('margin-top' , '0.1px');
- }
-
- if ( this.link || this.video ) {
- this.view.removeEventListener(MSViewEvents.SWIPE_START , this.onSwipeStart , this);
- this.view.removeEventListener(MSViewEvents.SWIPE_MOVE , this.onSwipeMove , this);
- this.view.removeEventListener(MSViewEvents.SWIPE_CANCEL , this.onSwipeCancel , this);
- }
-
- if (this.bgvideo ) {
- this.bgvideo.pause();
- if(!this.autoPauseBgVid && this.vinit)
- this.bgvideo.currentTime = 0;
- }
-
- // hide layers
- if ( this.hasLayers ) {
- this.layerController.hideLayers();
- }
-
- if ( !this.selected ) {
- return;
- }
-
- this.selected = false;
-
- this.$element.removeClass('ms-sl-selected');
- if(this.video && this.vplayed){
- this.__closeVideo();
- this.roc = false;
- }
-
- };
-
- /**
- * remove slide from DOM
- */
- p.sleep = function(force){
- if ( this.isSleeping && !force ) {
- return;
- }
-
- this.isSleeping = true;
-
- if ( this.autoAppend ) {
- this.$element.detach();
- }
-
- if ( this.hasLayers ) {
- this.layerController.onSlideSleep();
- }
- };
-
- /**
- * add slide to the DOM
- */
- p.wakeup = function(){
- if ( !this.isSleeping ) {
- return;
- }
-
- this.isSleeping = false;
-
- if ( this.autoAppend ) {
- this.view.$slideCont.append(this.$element);
- }
-
- if ( this.moz ){
- this.$element.css('margin-top' , '0.1px');
- }
-
- this.setupBG();
-
- // aling bg
- if ( this.hasBG ){
- this.bgAligner.align();
- }
-
- if ( this.hasLayers ) {
- this.layerController.onSlideWakeup();
- }
- };
-
- })(window, document, jQuery);
- /* ================== bin-debug/js/pro/controls/SlideController.js =================== */
- ;(function($){
-
- "use strict";
-
- var SliderViewList = {};
-
- window.MSSlideController = function(slider){
-
- this._delayProgress = 0;
-
- this._timer = new averta.Timer(100);
- this._timer.onTimer = this.onTimer;
- this._timer.refrence = this;
-
- this.currentSlide = null;
-
- this.slider = slider;
- this.so = slider.options;
-
- averta.EventDispatcher.call(this);
-
- };
-
- MSSlideController.registerView = function(name , _class){
- if(name in SliderViewList){
- throw new Error( name + ', is already registered.');
- return;
- }
-
- SliderViewList[name] = _class;
- };
-
- MSSlideController.SliderControlList = {};
- MSSlideController.registerControl = function(name , _class){
- if(name in MSSlideController.SliderControlList){
- throw new Error( name + ', is already registered.');
- return;
- }
-
- MSSlideController.SliderControlList[name] = _class;
- };
-
- var p = MSSlideController.prototype;
-
- /*-------------- METHODS --------------*/
-
-
- p.setupView = function(){
-
- var that = this;
- this.resize_listener = function(){that.__resize();};
-
- // in @version 1.5.7 it will be added in Masterslider.js _setupSliderLayout function
- //$(window).bind('resize', this.resize_listener);
-
- //if(this.so.smoothHeight) this.so.autoHeight = true;
-
- var viewOptions = {
- spacing: this.so.space,
- mouseSwipe: this.so.mouse,
- loop: this.so.loop,
- autoHeight: this.so.autoHeight,
- swipe: this.so.swipe,
- speed: this.so.speed,
- dir: this.so.dir,
- viewNum: this.so.inView,
- critMargin: this.so.critMargin
- };
-
- if(this.so.viewOptions)
- $.extend(viewOptions , this.so.viewOptions);
-
- if(this.so.autoHeight) this.so.heightLimit = false;
-
- //this.view.slideDuration = this.so.duration;
-
- var viewClass = SliderViewList[this.slider.options.view] || MSBasicView;
- if(viewClass._3dreq && (!window._css3d || $.browser.msie) ) viewClass = viewClass._fallback || MSBasicView;
-
- this.view = new viewClass(viewOptions);
-
- if(this.so.overPause){
- var that = this;
- this.slider.$element.mouseenter(function(){
- that.is_over = true;
- that._stopTimer();
- }).mouseleave(function(){
- that.is_over = false;
- that._startTimer();
- });
- }
- };
-
- p.onChangeStart = function(){
-
- this.change_started = true;
-
- if(this.currentSlide) this.currentSlide.unselect();
- this.currentSlide = this.view.currentSlide;
- this.currentSlide.prepareToSelect();
- //this.__appendSlides();
- if(this.so.endPause && this.currentSlide.index === this.slider.slides.length - 1){
- this.pause();
- //this._timer.reset();
- this.skipTimer();
- }
-
- if(this.so.autoHeight){
- this.slider.setHeight(this.currentSlide.getHeight());
- }
-
- if ( this.so.deepLink ) {
- this.__updateWindowHash();
- }
-
- this.dispatchEvent(new MSSliderEvent(MSSliderEvent.CHANGE_START));
- };
-
- p.onChangeEnd = function(){
- //if(!this.currentSlide.selected)
- // this._timer.reset();
- this.change_started = false;
-
- this._startTimer();
- this.currentSlide.select();
-
- if(this.so.preload > 1){
- var loc ,i , l = this.so.preload - 1, slide;
-
- // next slides
- for(i=1;i<=l;++i){
- loc = this.view.index + i;
-
- if(loc >= this.view.slideList.length) {
- if(this.so.loop){
- loc = loc - this.view.slideList.length;
- }else{
- i = l;
- continue;
- }
- }
-
- slide = this.view.slideList[loc];
- if ( slide ) {
- slide.loadImages();
- }
-
- }
-
- // previous slides
- if(l > this.view.slideList.length/2)
- l = Math.floor(this.view.slideList.length/2);
-
- for(i=1;i<=l;++i){
-
- loc = this.view.index - i;
-
- if(loc < 0){
- if(this.so.loop){
- loc = this.view.slideList.length + loc;
- }else{
- i = l;
- continue;
- }
- }
-
- slide = this.view.slideList[loc];
- if ( slide ) {
- slide.loadImages();
- }
-
- }
- }
-
- this.dispatchEvent(new MSSliderEvent(MSSliderEvent.CHANGE_END));
-
- };
-
- p.onSwipeStart = function(){
- //this._timer.reset();
- this.skipTimer();
- };
-
- p.skipTimer = function(){
- this._timer.reset();
- this._delayProgress = 0;
- this.dispatchEvent(new MSSliderEvent(MSSliderEvent.WAITING));
- };
-
- p.onTimer = function(time) {
-
- if(this._timer.getTime() >= this.view.currentSlide.delay * 1000){
- //this._timer.reset();
- this.skipTimer();
- this.view.next();
- this.hideCalled = false;
- }
- this._delayProgress = this._timer.getTime() / (this.view.currentSlide.delay * 10);
-
- if(this.so.hideLayers && !this.hideCalled && this.view.currentSlide.delay * 1000 - this._timer.getTime() <= 300){
- var currentSlide = this.view.currentSlide;
- if ( currentSlide.hasLayers ) {
- currentSlide.layerController.animHideLayers();
- }
- this.hideCalled = true;
- }
-
- this.dispatchEvent(new MSSliderEvent(MSSliderEvent.WAITING));
- };
-
- p._stopTimer = function(){
- if(this._timer)
- this._timer.stop();
- };
-
- p._startTimer = function(){
- if(!this.paused && !this.is_over && this.currentSlide && this.currentSlide.ready && !this.change_started)
- this._timer.start();
- };
-
- p.__appendSlides = function(){
- var slide , loc , i = 0 , l = this.view.slideList.length -1;
-
- // detach all
- for ( i ; i < l ; ++i){
- slide = this.view.slideList[i];
- if(!slide.detached){
- slide.$element.detach();
- slide.detached = true;
- }
- }
-
- // append current slide
- this.view.appendSlide(this.view.slideList[this.view.index]);
-
- l = 3;
-
- // next slides
- for(i=1;i<=l;++i){
- loc = this.view.index + i;
-
- if(loc >= this.view.slideList.length) {
- if(this.so.loop){
- loc = loc - this.view.slideList.length;
- }else{
- i = l;
- continue;
- }
- }
-
- slide = this.view.slideList[loc];
- slide.detached = false;
- this.view.appendSlide(slide);
-
- }
-
- // previous slides
- if(l > this.view.slideList.length/2)
- l = Math.floor(this.view.slideList.length/2);
-
- for(i=1;i<=l;++i){
-
- loc = this.view.index - i;
-
- if(loc < 0){
- if(this.so.loop){
- loc = this.view.slideList.length + loc;
- }else{
- i = l;
- continue;
- }
- }
-
- slide = this.view.slideList[loc];
- slide.detached = false;
- this.view.appendSlide(slide);
- }
-
- }
-
- p.__resize = function(hard){
- if(!this.created) return;
-
- this.width = this.slider.$element[0].clientWidth || this.so.width;
-
- if(!this.so.fullwidth){
- this.width = Math.min(this.width , this.so.width);
- //this.view.$element.css('left' , (this.slider.$element[0].clientWidth - this.width) / 2 + 'px');
- }
-
- if( this.so.fullheight ){
- this.so.heightLimit = false;
- this.so.autoHeight = false;
- this.height = this.slider.$element[0].clientHeight;
- } else {
- this.height = this.width / this.slider.aspect;
- }
- if( this.so.autoHeight ){
- this.currentSlide.setSize(this.width , null , hard);
- this.view.setSize(this.width , this.currentSlide.getHeight() , hard);
- } else {
- this.view.setSize(this.width , ( Math.max( this.so.minHeight, ( this.so.heightLimit ? Math.min(this.height , this.so.height) : this.height ) ) ) , hard);
- }
-
- if(this.slider.$controlsCont){
- if(this.so.centerControls && this.so.fullwidth) {
- this.view.$element.css('left' , Math.min(0,-(this.slider.$element[0].clientWidth - this.so.width) / 2) + 'px');
- }
- }
-
- this.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESIZE));
- };
-
- p.__dispatchInit = function(){
- this.dispatchEvent(new MSSliderEvent(MSSliderEvent.INIT));
- };
-
- /**
- * used by deep link feature, uptades window hash value on slide changes
- * @since 2.1.0
- */
- p.__updateWindowHash = function(){
- var hash = window.location.hash,
- dl = this.so.deepLink,
- dlt = this.so.deepLinkType,
- eq = dlt === 'path' ? '\/' : '=',
- sep = dlt === 'path' ? '\/' : '&',
- sliderHash = dl + eq + (this.view.index + 1),
- regTest = new RegExp( dl + eq + '[0-9]+', 'g');
-
- if ( hash === '' ) {
- window.location.hash = sep + sliderHash;
- } else if( regTest.test(hash) ) {
- window.location.hash = hash.replace(regTest, sliderHash);
- } else {
- window.location.hash = hash + sep + sliderHash;
- }
- };
-
- p.__curentSlideInHash = function(){
- var hash = window.location.hash,
- dl = this.so.deepLink,
- dlt = this.so.deepLinkType,
- eq = dlt === 'path' ? '\/' : '=',
- regTest = new RegExp( dl + eq + '[0-9]+', 'g' );
-
- if ( regTest.test(hash) ) {
- var index = Number(hash.match(regTest)[0].match(/[0-9]+/g).pop());
- if ( !isNaN(index) ) {
- return index - 1;
- }
- }
-
- return -1;
- };
-
- p.__onHashChanged = function(){
- var index = this.__curentSlideInHash();
- if ( index !== -1 ){
- this.gotoSlide(index);
- }
- };
-
- p.setup = function(){
-
- this.created = true;
- this.paused = !this.so.autoplay;
-
- //this.slider.$element.append(this.view.$element);
- this.view.addEventListener(MSViewEvents.CHANGE_START , this.onChangeStart , this);
- this.view.addEventListener(MSViewEvents.CHANGE_END , this.onChangeEnd , this);
- this.view.addEventListener(MSViewEvents.SWIPE_START , this.onSwipeStart , this);
-
- //this.currentSlide = this.view.slides[this.so.start - 1];
- this.currentSlide = this.view.slideList[this.so.start - 1];
- this.__resize();
-
- var slideInHash = this.__curentSlideInHash(),
- startSlide = slideInHash !== -1 ? slideInHash : this.so.start - 1;
- this.view.create(startSlide);
-
- if(this.so.preload === 0){
- this.view.slideList[0].loadImages();
- }
-
- this.scroller = this.view.controller;
-
- if(this.so.wheel){
- var that = this;
- var last_time = new Date().getTime();
- this.wheellistener = function(event){
-
- var e = window.event || event.orginalEvent || event;
- e.preventDefault();
-
- var current_time = new Date().getTime();
- if(current_time - last_time < 400) return;
- last_time = current_time;
-
- var delta = Math.abs(e.detail || e.wheelDelta);
-
- if ( $.browser.mozilla ) {
- delta *= 100;
- }
-
- var scrollThreshold = 15;
-
- // --- Scrolling up ---
- if (e.detail < 0 || e.wheelDelta > 0) {
- if ( delta >= scrollThreshold) {
- that.previous(true);
- }
- }
- // --- Scrolling down ---
- else {
- if (delta >= scrollThreshold) {
- that.next(true);
- }
- }
-
- return false;
- };
-
- if($.browser.mozilla) this.slider.$element[0].addEventListener('DOMMouseScroll' , this.wheellistener);
- else this.slider.$element.bind('mousewheel', this.wheellistener);
- }
-
- // if(this.so.wheel){
- // var that = this;
- // var last_time = new Date().getTime();
- // this.wheellistener = function(event){
- // var current_time = new Date().getTime();
- // if(current_time - last_time < 550) return;
- // last_time = current_time;
- // var e = window.event || event.orginalEvent || event;
- // var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
- // if(delta < 0) that.next();
- // else if(delta > 0) that.previous();
- // return false;
- // };
-
- // if($.browser.mozilla) this.slider.$element[0].addEventListener('DOMMouseScroll' , this.wheellistener);
- // else this.slider.$element.bind('mousewheel', this.wheellistener);
- // }
-
- if(this.slider.$element[0].clientWidth === 0)
- this.slider.init_safemode = true;
-
- this.__resize();
-
- var that = this;
- if( this.so.deepLink ) {
- $(window).on('hashchange', function() {
- that.__onHashChanged();
- });
- }
- };
-
- p.index = function(){
- return this.view.index;
- };
-
- p.count = function(){
- return this.view.slidesCount;
- };
-
- p.next = function(checkLoop){
- this.skipTimer();
- this.view.next(checkLoop);
- };
-
- p.previous = function(checkLoop){
- this.skipTimer();
- this.view.previous(checkLoop);
- };
-
- p.gotoSlide = function(index) {
- index = Math.min(index, this.count()-1);
- this.skipTimer();
- this.view.gotoSlide(index);
- };
-
- p.destroy = function(reset){
- this.dispatchEvent(new MSSliderEvent(MSSliderEvent.DESTROY));
- this.slider.destroy(reset);
- };
-
- p._destroy = function(){
- this._timer.reset();
- this._timer = null;
-
- $(window).unbind('resize', this.resize_listener);
- this.view.destroy();
- this.view = null;
-
- if(this.so.wheel){
- if($.browser.mozilla) this.slider.$element[0].removeEventListener('DOMMouseScroll' , this.wheellistener);
- else this.slider.$element.unbind('mousewheel', this.wheellistener);
- this.wheellistener = null;
- }
-
- this.so = null;
- };
-
- /**
- * run layer actions like next, previous,...
- * @param {String} action
- * @since v1.7.2
- */
- p.runAction = function(action){
- var actionParams = [];
-
- if( action.indexOf('(') !== -1 ){
- var temp = action.slice(0 , action.indexOf('('));
- actionParams = action.slice(action.indexOf('(') + 1 , -1).replace(/\"|\'|\s/g , '').split(',');
- action = temp;
- }
-
- if ( action in this ){
- this[action].apply(this, actionParams);
- } else if ( console ){
- console.log('Master Slider Error: Action "'+action+'" not found.');
- }
- };
-
- p.update = function(hard){
- if(this.slider.init_safemode && hard)
- this.slider.init_safemode = false;
- this.__resize(hard);
-
- if ( hard ) {
- this.dispatchEvent(new MSSliderEvent(MSSliderEvent.HARD_UPDATE));
- }
-
- };
-
- p.locate = function(){
- this.__resize();
- };
-
- p.resume = function(){
- if(!this.paused) return;
- this.paused = false;
- this._startTimer();
- };
-
- p.pause = function(){
- if(this.paused) return;
- this.paused = true;
- this._stopTimer();
- };
-
- p.currentTime = function(){
- return this._delayProgress;
- };
-
- averta.EventDispatcher.extend(p);
- })(jQuery);
- /* ================== bin-debug/js/pro/MasterSlider.js =================== */
- /**
- * Master Slider Main JavaScript File
- */
-
- ;(function($){
-
- "use strict";
-
- var LayerTypes = {
- 'image' : MSImageLayerElement,
- 'text' : MSLayerElement,
- 'video' : MSVideoLayerElement,
- 'hotspot' : MSHotspotLayer,
- 'button' : MSButtonLayer
- };
- window.MasterSlider = function(){
-
- // Default Options
- this.options = {
- autoplay : false, // Enables the autoplay slideshow.
- loop : false, // Enables the continuous sliding mode.
- mouse : true, // Whether the user can use mouse drag navigation.
- swipe : true, // Whether the drag/swipe navigation is enabled.
- grabCursor : true, // Whether the slider uses grab mouse cursor.
- space : 0, // The spacing value between slides in pixels.
- fillMode : 'fill', // Specifies the slide background scaling method. Its acceptable values are "fill", "fit", "stretch", "center" and "tile".
- start : 1, // The slider starting slide number.
- view : 'basic', // The slide changing transition.
- width : 300, // The base width of slides. It helps the slider to resize in correct ratio.
- height : 150, // The base height of slides, It helps the slider to resize in correct ratio.
- inView : 15, // Specifies number of slides which will be added at a same time in DOM.
- critMargin : 1, //
- heightLimit : true, // It force the slide to use max height value as its base specified height value.
- smoothHeight : true, // Whether the slider uses smooth animation while its height changes.
- autoHeight : false, // Whether the slider adapts its height to each slide height or not. It overrides heightLimit option.
- minHeight : -1, // @since 2.13.0, Specifies min height value for the slider, it prevents slider to shows too narrow in small screens.
- fullwidth : false, // It enables the slider to adapt width to its parent element. It's very useful for creating full-width sliders. In default it takes max width as its base width value.
- fullheight : false, // It enables the slider to adapt height to its parent element.
- autofill : false, // It enables the slider to adapt width and height to its parent element, It's very useful for creating fullscreen or fullwindow slider.
- layersMode : 'center', // It accepts two values "center" and "full". The "center" value indicates that the slider aligns layers to the center. This option is only effective in full width mode.
- hideLayers : false, // Whether the slider hides all layers before changing slide.
- endPause : false, // Whether the slider pauses slideshow when it stays at the last slide.
- centerControls : true, // Whether the slider aligns UI controls to center. This option is only effective in full width mode.
- overPause : true, // Whether the slider pauses slideshow on hover.
- shuffle : false, // Enables the shuffle slide order.
- speed : 17, // Specifies slide changing speed. It accepts float values between 0 and 100.
- dir : 'h', // Specifies slide changing direction. It accepts two values "h" (horizontal) and "v" (vertical).
- preload : 0, // Specifies number of slides which will be loaded by slider. 0 value means the slider loads slides in sequence.
- wheel : false, // Whether slider uses mouse wheel for navigation.
- layout : 'boxed', // It accepts 'fullwidth', 'fullscreen', 'fillwidth', 'autofill', 'partialview', 'boxed'. It overrides 'fullwidth' and 'autofill' (added in v1.5.6)
- autofillTarget : null, // @since 2.13.0, Specifies the parent element of slider width jQuery selector, it used for sizing slider with autofill layout. Default value is the first parent element of slider.
- fullscreenMargin : 0, // Specifies margin amount to the bottom of slider, it's only effective on fullscreen slider.
- instantStartLayers : false, // @since 1.5.0, Whether instantly shows slide layers.
- parallaxMode : 'mouse', // @since 1.6.0, Specifies mode of parallax effect accepts: "mouse", "mouse:x-only", "mouse:y-only" and "swipe"
- rtl : false, // @since 1.8.0, Whether Right-to-left direction slider.
- deepLink : null, // @since 2.1.0, null value disables slider deep-linking any string values identifies the slider in page's url like /#msslider-1
- deepLinkType : 'path', // @since 2.1.0, type of hash value in page's url possible values, path and query ( #gallery/1 || #gallery=4 )
- disablePlugins : [] // @since 2.9.6, list of disabled Master Slider plugin names for this instance.
- };
-
- this.slides = [];
- this.activePlugins = [];
- this.$element = null;
-
- // used by new layout method. to force fullwidth or fullscreen
- this.lastMargin = 0;
-
- // Reserved side spaces of slider
- this.leftSpace = 0;
- this.topSpace = 0;
- this.rightSpace = 0;
- this.bottomSpace = 0;
-
- // hold on stack
- this._holdOn = 0;
-
- var that = this;
- this.resize_listener = function(){that._resize();};
- $(window).bind('resize', this.resize_listener);
-
- };
-
- MasterSlider.author = 'Averta Ltd. (www.averta.net)';
- MasterSlider.version = '2.15.1';
- MasterSlider.releaseDate = 'Jul 2015';
-
- // Master Slider plugins.
- MasterSlider._plugins = []
- var MS = MasterSlider;
- MS.registerPlugin = function ( plugin ) {
- if ( MS._plugins.indexOf(plugin) === -1 ) {
- MS._plugins.push(plugin);
- }
- };
-
- var p = MasterSlider.prototype;
-
- /*-------------- METHODS --------------*/
-
- /**
- * create one slide object for each slide and add it to slide controller
- * @since 1.0
- * @private
- */
- p.__setupSlides = function(){
- var that = this,
- new_slide,
- ind = 0;
-
- this.$element.children('.ms-slide').each(function(index) {
-
- var $slide_ele = $(this);
-
- new_slide = new MSSlide();
- new_slide.$element = $slide_ele;
- new_slide.slider = that;
- new_slide.delay = $slide_ele.data('delay') !== undefined ? $slide_ele.data('delay') : 3;
- new_slide.fillMode = $slide_ele.data('fill-mode') !== undefined ? $slide_ele.data('fill-mode') : that.options.fillMode;
- new_slide.index = ind++;
-
- // Slide Background Image
- var slide_img = $slide_ele.children('img:not(.ms-layer)');
- if( slide_img.length > 0 ){
- new_slide.setBG(slide_img[0]);
- }
-
- // Slide Video Background
- var slide_video = $slide_ele.children('video');
- if( slide_video.length > 0 ) new_slide.setBGVideo(slide_video);
- // controls
- if(that.controls){
- for(var i = 0 , l = that.controls.length; i<l ; ++i)
- that.controls[i].slideAction(new_slide);
- }
-
- // Slide Link and Video
- var slide_link = $slide_ele.children('a').each(function(index) {
- var $this = $(this);
- if(this.getAttribute('data-type') === 'video'){
- new_slide.video = this.getAttribute('href');
-
- new_slide.videoAutoPlay = $this.data('autoplay');
-
- $this.remove();
- }else if(!$this.hasClass('ms-layer')) {
- new_slide.link = $(this);
- //new_slide.link_targ = this.getAttribute('target');
- //$this.remove();
- }
- });//.remove();
-
- // Slide Layers
- that.__createSlideLayers(new_slide , $slide_ele.find('.ms-layer'));
- that.slides.push(new_slide);
- that.slideController.view.addSlide(new_slide);
-
- });
- };
-
- /**
- * Creates layers of specified layer
- * @param {MSSlide} slide
- * @param {Array} layers
- * @since 1.0
- * @private
- */
- p.__createSlideLayers = function(slide , layers) {
- if(layers.length == 0) return;
- slide.setupLayerController();
-
- layers.each(function(index , domEle){
- var $layer_element = $(this),
- $parent_ele;
-
- if( domEle.nodeName === 'A' && $layer_element.find('>img').data('type') === 'image' ) {
- $parent_ele = $(this);
- $layer_element = $parent_ele.find('img');
- }
-
- var layer = new (LayerTypes[$layer_element.data('type') || 'text']) ();
- layer.$element = $layer_element;
- layer.link = $parent_ele;
-
- var eff_parameters = {},
- end_eff_parameters = {};
-
- if($layer_element.data('effect') !== undefined) eff_parameters.name = $layer_element.data('effect');
- if($layer_element.data('ease') !== undefined) eff_parameters.ease = $layer_element.data('ease');
- if($layer_element.data('duration') !== undefined) eff_parameters.duration = $layer_element.data('duration');
- if($layer_element.data('delay') !== undefined) eff_parameters.delay = $layer_element.data('delay');
-
- if($layer_element.data('hide-effect')) end_eff_parameters.name = $layer_element.data('hide-effect');
- if($layer_element.data('hide-ease')) end_eff_parameters.ease = $layer_element.data('hide-ease');
- if($layer_element.data('hide-duration') !== undefined) end_eff_parameters.duration = $layer_element.data('hide-duration');
- if($layer_element.data('hide-time') !== undefined) end_eff_parameters.time = $layer_element.data('hide-time');
-
- layer.setStartAnim(eff_parameters);
- layer.setEndAnim(end_eff_parameters);
-
- slide.layerController.addLayer(layer);
-
- });
-
- };
-
- /**
- * remove slider initialize loading
- * @since 1.0
- * @private
- */
- p._removeLoading = function(){
- $(window).unbind('resize', this.resize_listener);
- this.$element.removeClass('before-init')
- .css('visibility', 'visible')
- .css('height','')
- .css('opacity' , 0);
- CTween.fadeIn(this.$element);
- this.$loading.remove();
-
- if(this.slideController)
- this.slideController.__resize();
- };
-
- /**
- * resize listener, it only used for aligning slider loading and after slider init it will be removed
- * @param {Event} e
- * @since 1.0
- * @private
- */
- p._resize = function(e){
- if(this.$loading){
- var h = this.$loading[0].clientWidth / this.aspect;
- h = this.options.heightLimit ? Math.min(h , this.options.height) : h;
-
- this.$loading.height(h);
- this.$element.height(h);
- }
- };
-
- /**
- * changes the order of slides element before setup slides
- * @since 1.0
- * @private
- */
- p._shuffleSlides = function(){
- var slides = this.$element.children('.ms-slide') , r;
-
- for(var i = 0 , l = slides.length; i < l ; ++i){
- r = Math.floor(Math.random() * (l - 1));
- if(i != r){
- this.$element[0].insertBefore(slides[i] , slides[r]);
- slides = this.$element.children('.ms-slide');
- }
- }
- };
-
- /**
- * New method of setting up the layout of slider
- * @since 1.5.6
- */
- p._setupSliderLayout = function(){
-
- // create side spaces
- this._updateSideMargins();
- this.lastMargin = this.leftSpace;
-
- var lo = this.options.layout;
-
-
- if( lo !== 'boxed' && lo !== 'partialview' ){
- this.options.fullwidth = true; // enable slider fullscreen for fullwidth, fillwidth, autofill and fullscreen layouts.
- }
- if( lo === 'fullscreen' || lo === 'autofill' ){
- this.options.fullheight = true;
-
- if ( lo === 'autofill' ) {
- this.$autofillTarget = $(this.options.autofillTarget);
- if ( this.$autofillTarget.length === 0 ) {
- this.$autofillTarget = this.$element.parent();
- }
- }
-
- }
-
- // partial view
- if ( lo === 'partialview' ){
- this.$element.addClass('ms-layout-partialview');
- }
- if( lo === 'fullscreen' || lo === 'fullwidth' || lo === 'autofill' ){
- $(window).bind('resize', {that:this}, this._updateLayout);
- this._updateLayout();
- }
-
- // bind resize handler of slidecontroller __resize
- $(window).bind('resize', this.slideController.resize_listener);
- };
-
- /**
- * updates layout of slider based on window size
- * @param {Event} event
- * @since 1.5.6
- */
- p._updateLayout = function(event){
- var that = event? event.data.that : this,
- lo = that.options.layout,
- $element = that.$element,
- $win = $(window);
-
- // height
- if( lo === 'fullscreen' ){
- document.body.style.overflow = 'hidden';
- $element.height( $win.height() - that.options.fullscreenMargin - that.topSpace - that.bottomSpace);
- document.body.style.overflow = '';
- } else if ( lo === 'autofill' ) {
- $element.height(that.$autofillTarget.height() - that.options.fullscreenMargin - that.topSpace - that.bottomSpace)
- .width(that.$autofillTarget.width() - that.leftSpace - that.rightSpace);
- return;
- }
- // width
- $element.width($win.width() - that.leftSpace - that.rightSpace);
- var margin = -$element.offset().left + that.leftSpace + that.lastMargin;
- $element.css('margin-left', margin );
- that.lastMargin = margin;
- //
- };
-
-
- /**
- * initialize the slider, called by document ready
- * <code>holdOn</code> property prevents auto initialize slider after document ready it used by plugins of slider like Flickr
- * @since 1.0
- * @protected
- */
- p._init = function(){
-
- if ( this._holdOn > 0 || !this._docReady ) {
- return;
- }
-
- this.initialized = true;
-
- if(this.options.preload !== 'all'){
- this._removeLoading();
- }
- //else
- // this.$element.css('width' , this.$loading[0].clientWidth);
-
- if(this.options.shuffle) this._shuffleSlides();
-
- MSLayerEffects.setup();
- this.slideController.setupView();
- this.view = this.slideController.view;
-
- this.$controlsCont = $('<div></div>').addClass('ms-inner-controls-cont');//.appendTo(this.$element);
- if(this.options.centerControls){
- this.$controlsCont.css('max-width' , this.options.width + 'px');
- }
-
- this.$controlsCont.prepend(this.view.$element);
-
- this.$msContainer = $('<div></div>').addClass('ms-container').prependTo(this.$element).append(this.$controlsCont);
-
- if(this.controls){
- for(var i = 0 , l = this.controls.length; i<l ; ++i){
- this.controls[i].setup();
- }
- }
- /*else{
- this.$element.append(this.view.$element);
- }*/
-
- this._setupSliderLayout();
- this.__setupSlides();
- this.slideController.setup();
-
- if(this.controls){
- for(i = 0 , l = this.controls.length; i<l ; ++i)
- this.controls[i].create();
- }
-
- if(this.options.autoHeight){
- this.slideController.view.$element.height(this.slideController.currentSlide.getHeight());
- }
-
- // add grab cursor
- if(this.options.swipe && !window._touch && this.options.grabCursor && this.options.mouse){
- var $view = this.view.$element;
-
- $view.mousedown(function(){
- $view.removeClass('ms-grab-cursor');
- $view.addClass('ms-grabbing-cursor');
-
- if ( $.browser.msie && window.ms_grabbing_curosr ) {
- $view[0].style.cursor = 'url(' + window.ms_grabbing_curosr + '), move';
- }
-
- }).addClass('ms-grab-cursor');
-
- $(document).mouseup(function(){
- $view.removeClass('ms-grabbing-cursor');
- $view.addClass('ms-grab-cursor');
-
- if ( $.browser.msie && window.ms_grab_curosr ) {
- $view[0].style.cursor = 'url(' + window.ms_grab_curosr + '), move';
- }
-
- });
- }
-
- this.slideController.__dispatchInit();
- };
-
- /**
- * changes the height of slider, it used in autoheight slider
- * @param {Number} value
- * @since 1.0
- * @public
- */
- p.setHeight = function(value){
- if(this.options.smoothHeight){
- if(this.htween){
- if(this.htween.reset)this.htween.reset();
- else this.htween.stop(true);
- }
- this.htween = CTween.animate(this.slideController.view.$element , 500 , {height:value} , {ease:'easeOutQuart'});
- }else
- this.slideController.view.$element.height(value);
- };
-
- /**
- * reserves white space in sides of slider, it used by controls
- * @param {String} side left|right|top|bottom
- * @param {Number} space
- * @returns {Number} start position in space.
- * @since 1.5.7
- * @public
- */
- p.reserveSpace = function(side, space){
- var sideSpace = side+'Space',
- pos = this[sideSpace];
-
- this[sideSpace] += space;
-
- this._updateSideMargins();
-
- return pos;
- };
-
- /**
- * returns the reserved space, it used by controls and called when aligned control hides
- * @param {String} side
- * @param {Number} space
- * @since 1.5.7
- * @public
- */
- /*p.returnSpace = function(side, space){
- var sideSpace = side+'Space';
- this[sideSpace] = Math.max(0 , this[sideSpace] - space);
-
- this.api.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESERVED_SPACE_CHANGE));
- this._updateSideMargins();
- };*/
-
- p._updateSideMargins = function(){
- this.$element.css('margin', this.topSpace + 'px ' + this.rightSpace + 'px ' + this.bottomSpace + 'px ' + this.leftSpace + 'px');
- }
-
- p._realignControls = function(){
- this.rightSpace = this.leftSpace = this.topSpace = this.bottomSpace = 0;
- this._updateSideMargins();
- this.api.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESERVED_SPACE_CHANGE));
- };
-
- /*------------------------- Public Methods -----------------------*/
-
- /**
- * Adds new control to the slider
- * @param {String} control
- * @param {Object} options [description]
- * @since 1.0
- * @public
- */
- p.control = function(control , options){
- if(!(control in MSSlideController.SliderControlList)) return;
- if(!this.controls) this.controls = [];
- var ins = new MSSlideController.SliderControlList[control](options);
- ins.slider = this;
- this.controls.push(ins);
-
- return this;
- };
-
- /**
- * Hold on slider from initialization
- * @since 2.9.6
- * @public
- */
- p.holdOn = function () {
- this._holdOn ++;
- };
-
- /**
- * Let the slider to initialize
- * @since 2.9.6
- */
- p.release = function () {
- this._holdOn --;
- this._init();
- };
-
- /**
- * setup slider
- * @param {String|jQuery object} id
- * @param {Object} options
- * @since 1.0
- * @public
- */
- p.setup = function(target , options){
- if(typeof target === 'string'){
- this.$element = $('#' + target);
- } else {
- this.$element = target.eq(0);
- }
-
- //create a copy from slider markup, it will be used in destroy method.
- this.setupMarkup = this.$element.html();
-
- if( this.$element.length === 0 ){
- //if(console) console.log('Master Slider Error: #'+id+' not found.');
- return;
- }
-
- this.$element.addClass('master-slider').addClass('before-init');
-
- // IE prefix class
- // add browser prefix class name
- if($.browser.msie){
- this.$element.addClass('ms-ie')
- .addClass('ms-ie' + $.browser.version.slice(0 , $.browser.version.indexOf('.')));
- } else if ( $.browser.webkit ) {
- this.$element.addClass('ms-wk');
- } else if ( $.browser.mozilla ) {
- this.$element.addClass('ms-moz');
- }
-
-
- // Android prefix class
- var ua = navigator.userAgent.toLowerCase();
- var isAndroid = ua.indexOf("android") > -1;
- if(isAndroid) {
- this.$element.addClass('ms-android');
- }
-
- var that = this;
- $.extend(this.options, options);
-
- this.aspect = this.options.width / this.options.height;
-
- this.$loading = $('<div></div>').
- addClass('ms-loading-container').
- insertBefore(this.$element).
- append($('<div></div>').addClass('ms-loading'));
-
- this.$loading.parent().css('position' , 'relative');
-
- // old methods
- if(this.options.autofill){
- this.options.fullwidth = true;
- this.options.fullheight = true;
- }
-
- if(this.options.fullheight){
- this.$element.addClass('ms-fullheight');
- }
-
- //this._setupSliderLayout();
- this._resize();
-
- // define slide controller and api
- this.slideController = new MSSlideController(this);
- this.api = this.slideController;
-
- // setup plugins
- for ( var i = 0, l = MS._plugins.length; i !== l; i++ ) {
- var plugin = MS._plugins[i];
-
- if ( this.options.disablePlugins.indexOf(plugin.name) === -1 ) {
- this.activePlugins.push(new plugin(this));
- }
- }
-
- $(document).ready(function(){
- that._docReady = true;
- that._init();
- });
-
- return this;
- };
-
- /**
- * destroy the slider instance
- * @param {Boolean} insertMarkup whether add slider markup after destroy.
- * @since 1.4
- * @public
- */
- p.destroy = function(insertMarkup){
-
- // destroy active plugins
- for ( var i = 0, l = this.activePlugins.length; i !== l; i++ ) {
- this.activePlugins[i].destroy();
- }
-
- if(this.controls){
- for( i = 0, l = this.controls.length; i !== l; i++ )
- this.controls[i].destroy();
- }
-
- if(this.slideController) this.slideController._destroy();
-
- if(this.$loading) this.$loading.remove();
-
- if ( insertMarkup ) {
- this.$element.html(this.setupMarkup).css('visibility' , 'hidden');
- } else {
- this.$element.remove();
- }
-
- var lo = this.options.layout;
- if( lo === 'fullscreen' || lo === 'fullwidth' ){
- $(window).unbind('resize', this._updateLayout);
- }
-
- this.view = null;
- this.slides = null;
- this.options = null;
- this.slideController = null;
- this.api = null;
- this.resize_listener = null;
-
-
- this.activePlugins = null;
- };
-
- })(jQuery);
-
- /**
- * Master Slider jQuery Plugin
- * @author Averta
- */
- (function ( $, window, document, undefined ) {
-
- var pluginName = "masterslider",
- defaults = {
- controls:{}
- };
-
- function MasterSliderPlugin ( element, options ) {
- this.element = element;
- this.$element = $(element);
- this.settings = $.extend( {}, defaults, options );
- this._defaults = defaults;
- this._name = pluginName;
- this.init();
- }
-
- $.extend(MasterSliderPlugin.prototype, {
- init : function () {
-
- var self = this;
-
- // create new instance form Master Slider
- this._slider = new MasterSlider();
-
- // add controls
- for ( var control in this.settings.controls ){
- this._slider.control(control, this.settings.controls[control]);
- }
-
- this._slider.setup(this.$element, this.settings);
-
- // override api eventdisaptcher method
- var _superDispatch = this._slider.api.dispatchEvent;
- this._slider.api.dispatchEvent = function(event){
- self.$element.trigger(event.type);
- _superDispatch.call(this, event);
- };
-
- },
-
- api : function() {
- return this._slider.api;
- },
-
- slider : function() {
- return this._slider;
- }
-
- });
-
- $.fn[pluginName] = function ( options ) {
- var args = arguments,
- plugin = 'plugin_' + pluginName;
-
- // Is the first parameter an object (options), or was omitted,
- // instantiate a new instance of the plugin.
- if (options === undefined || typeof options === 'object') {
- return this.each(function () {
-
- // Only allow the plugin to be instantiated once,
- // so we check that the element has no plugin instantiation yet
- if (!$.data(this, plugin)) {
- $.data(this, plugin, new MasterSliderPlugin( this, options ));
- }
- });
-
- // If the first parameter is a string and it doesn't start
- // with an underscore or "contains" the `init`-function,
- // treat this as a call to a public method.
- } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
-
- // Cache the method call
- // to make it possible
- // to return a value
- var returns;
-
- this.each(function () {
- var instance = $.data(this, plugin);
-
- // Tests that there's already a plugin-instance
- // and checks that the requested public method exists
- if (instance instanceof MasterSliderPlugin && typeof instance[options] === 'function') {
-
- // Call the method of our plugin instance,
- // and pass it the supplied arguments.
- returns = instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
- }
-
- // Map slider api functions to slider jq plugin
- if ( instance instanceof MasterSliderPlugin && typeof instance._slider.api[options] === 'function' ) {
- returns = instance._slider.api[options].apply( instance._slider.api, Array.prototype.slice.call( args, 1 ) );
- }
-
- // Allow instances to be destroyed via the 'destroy' method
- if (options === 'destroy') {
- $.data(this, plugin, null);
- }
- });
-
- // If the earlier cached method
- // gives a value back return the value,
- // otherwise return this to preserve chainability.
- return returns !== undefined ? returns : this;
- }
- };
-
- })( jQuery, window, document );
- /* ================== bin-debug/js/pro/views/ViewEvents.js =================== */
- window.MSViewEvents = function (type, data){
- this.type = type;
- this.data = data;
- };
-
- MSViewEvents.SWIPE_START = 'swipeStart';
- MSViewEvents.SWIPE_END = 'swipeEnd';
- MSViewEvents.SWIPE_MOVE = 'swipeMove';
- MSViewEvents.SWIPE_CANCEL = 'swipeCancel';
- MSViewEvents.SCROLL = 'scroll';
- MSViewEvents.CHANGE_START = 'slideChangeStart';
- MSViewEvents.CHANGE_END = 'slideChangeEnd';
- /* ================== bin-debug/js/pro/views/BasicView.js =================== */
- ;(function($){
-
- "use strict";
-
- window.MSBasicView = function(options){
-
- this.options = {
- loop : false,
- dir : 'h',
- autoHeight : false,
- spacing : 5,
- mouseSwipe : true,
- swipe : true,
- speed : 17,
- minSlideSpeed : 2,
- viewNum : 20,
- critMargin : 1
- };
-
- $.extend(this.options , options);
-
- this.dir = this.options.dir;
- this.loop = this.options.loop;
- this.spacing = this.options.spacing;
-
- this.__width = 0;
- this.__height = 0;
-
- this.__cssProb = this.dir === 'h' ? 'left' : 'top';
- this.__offset = this.dir === 'h' ? 'offsetLeft' : 'offsetTop';
- this.__dimension = this.dir === 'h' ? '__width' : '__height';
-
- this.__translate_end = window._css3d ? ' translateZ(0px)' : '';
-
- this.$slideCont = $('<div></div>').addClass('ms-slide-container');
- this.$element = $('<div></div>').addClass('ms-view').addClass('ms-basic-view').append(this.$slideCont);
-
- this.currentSlide = null;
- this.index = -1;
- this.slidesCount = 0;
-
- this.slides = [];
- this.slideList = []; // All of slides with added priority sort;
- this.viewSlidesList = [];
-
- this.css3 = window._cssanim;
- this.start_buffer = 0;
- this.firstslide_snap = 0;
-
- this.slideChanged = false;
-
- this.controller = new Controller(0 , 0 , {
- snapping : true,
- snapsize : 100,
- paging : true,
- snappingMinSpeed : this.options.minSlideSpeed,
- friction : (100 - this.options.speed * 0.5) / 100,
- endless : this.loop
- });
-
- this.controller.renderCallback(this.dir === 'h'? this._horizUpdate : this._vertiUpdate , this);
- this.controller.snappingCallback(this.__snapUpdate , this);
- this.controller.snapCompleteCallback(this.__snapCompelet , this);
-
- averta.EventDispatcher.call(this);
- };
-
- var p = MSBasicView.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.__snapCompelet = function(snap , type){
- // if(this.loop && Math.abs(this.__contPos) > 20000){
- // this.__locateSlides();
- // this.gotoSlide(this.index , true);
- // }
- //
-
- if ( !this.slideChanged ) {
- return;
- }
-
- this.slideChanged = false;
-
- this.__locateSlides();
- this.start_buffer = 0;
- this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_END));
- };
-
- p.__snapUpdate = function(controller , snap , change){
-
- if(this.loop){
- var target_index = this.index + change;
- this.updateLoop(target_index);
-
- if(target_index >= this.slidesCount) target_index = target_index - this.slidesCount;
- if(target_index < 0) target_index = this.slidesCount + target_index;
-
- this.index = target_index;
- }else{
- if(snap < 0 || snap >= this.slidesCount) return
- this.index = snap;
- }
-
- this._checkCritMargins();
-
- if($.browser.mozilla){
- this.slideList[this.index].$element[0].style.marginTop = '0.1px';
- if(this.currentSlide){
- this.currentSlide.$element[0].style.marginTop = '';
- }
- }
- var new_slide = this.slideList[this.index];
- if(new_slide === this.currentSlide)return;
- this.currentSlide = new_slide;
-
- if ( this.autoUpdateZIndex ) {
- this.__updateSlidesZindex();
- }
-
- this.slideChanged = true;
- this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START));
- };
-
-
- p._checkCritMargins = function(){
- if(this.normalMode) return;
-
- var hlf = Math.floor(this.options.viewNum / 2),
- inView = this.viewSlidesList.indexOf(this.slideList[this.index]),
- size = (this[this.__dimension] + this.spacing),
- cm = this.options.critMargin;
-
- if(this.loop){
- if(inView <= cm || inView >= this.viewSlidesList.length - cm){
- size *= (inView - hlf);
- this.__locateSlides(false , size + this.start_buffer );
- this.start_buffer += size;
- }
-
- return;
- }
-
- if( (inView < cm && this.index >= cm ) || (inView >= this.viewSlidesList.length - cm && this.index < this.slidesCount - cm)){
- this.__locateSlides(false);
- }
-
- };
-
-
- p._vertiUpdate = function(controller , value){
-
- this.__contPos = value;
- this.dispatchEvent(new MSViewEvents(MSViewEvents.SCROLL));
-
- if(this.css3){
- this.$slideCont[0].style[window._jcsspfx + 'Transform'] = 'translateY('+-value+'px)' + this.__translate_end;
- return;
- }
-
- this.$slideCont[0].style.top = -value + 'px';
-
- };
-
- p._horizUpdate = function(controller , value){
-
- this.__contPos = value;
- this.dispatchEvent(new MSViewEvents(MSViewEvents.SCROLL));
-
- if(this.css3) {
- this.$slideCont[0].style[window._jcsspfx + 'Transform'] = 'translateX('+-value+'px)'+ this.__translate_end;
- return;
- }
-
- this.$slideCont[0].style.left = -value + 'px';
-
- };
-
-
- p.__updateViewList = function(){
-
- if(this.normalMode) {
- this.viewSlidesList = this.slides;
- return;
- }
-
- var temp = this.viewSlidesList.slice();
-
- // update view list
- this.viewSlidesList = [];
- var i = 0 , hlf = Math.floor(this.options.viewNum / 2) , l;
-
- if(this.loop){
- for(; i !== this.options.viewNum ; i++)
- this.viewSlidesList.push(this.slides[this.currentSlideLoc - hlf + i]);
- }else{
- // before
- for(i = 0 ; i !== hlf && this.index - i !== -1 ; i++)
- this.viewSlidesList.unshift(this.slideList[this.index - i]);
- // after
- for(i = 1; i !== hlf && this.index + i !== this.slidesCount; i++)
- this.viewSlidesList.push(this.slideList[this.index + i]);
- }
-
- for (i = 0 , l = temp.length ; i !== l ; i++)
- if( this.viewSlidesList.indexOf(temp[i]) === -1)
- temp[i].sleep();
-
- temp = null;
-
- if( this.currentSlide ) {
- this.__updateSlidesZindex();
- }
- };
-
- p.__locateSlides = function(move , start){
-
- this.__updateViewList();
-
- start = !this.loop ? this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing ) : start || 0;
-
- // old method
- /*for(i = 0; i < this.slidesCount ; ++i){
- var pos = i * (this[this.__dimension] + this.spacing);
-
- this.slides[i].position = pos;
- this.slides[i].$element[0].style[this.__cssProb] = pos + 'px';
- }*/
-
- var l = this.viewSlidesList.length , slide;
-
- for(var i = 0; i !== l ; i++){
- var pos = start + i * (this[this.__dimension] + this.spacing );
- slide = this.viewSlidesList[i];
- slide.wakeup();
- slide.position = pos;
- slide.$element[0].style[this.__cssProb] = pos + 'px';
- }
-
- if(move !== false)this.controller.changeTo( this.slideList[this.index].position , false , null , null , false);
-
- };
-
- p.__createLoopList = function(){
- var return_arr = [];
- var i = 0,
- count = this.slidesCount / 2;
-
- var before_count = (this.slidesCount % 2 === 0)? count - 1 : Math.floor(count);
- var after_count = (this.slidesCount % 2 === 0)? count : Math.floor(count);
-
- this.currentSlideLoc = before_count;
-
- // before
- for(i = 1 ; i <= before_count ; ++i)
- return_arr.unshift(this.slideList[(this.index - i < 0)? this.slidesCount - i + this.index: this.index - i]);
-
- // current
- return_arr.push(this.slideList[this.index]);
-
- // after
- for(i = 1; i <= after_count; ++i)
- return_arr.push(this.slideList[(this.index + i >= this.slidesCount)? this.index + i - this.slidesCount : this.index + i]);
-
- return return_arr;
-
- };
-
- /*
- * Calculate shortest distance from index to target.
- * It will used in loop gesture.
- *
- * Negative values means left direction.
- */
-
- p.__getSteps = function(index , target){
- var right = (target < index)? this.slidesCount - index + target : target - index;
- var left = Math.abs(this.slidesCount - right);
-
- return (right < left)? right : -left;
- };
-
- p.__pushEnd = function(){
- var first_slide = this.slides.shift();
- var last_slide = this.slides[this.slidesCount - 2];
-
- this.slides.push(first_slide);
-
- if(!this.normalMode) return;
-
- var pos = last_slide.$element[0][this.__offset] + this.spacing + this[this.__dimension];
- first_slide.$element[0].style[this.__cssProb] = pos + 'px';
- first_slide.position = pos;
- };
-
- p.__pushStart = function(){
- var last_slide = this.slides.pop();
- var first_slide = this.slides[0];
-
- this.slides.unshift(last_slide);
-
- if(!this.normalMode) return;
-
- var pos = first_slide.$element[0][this.__offset] - this.spacing - this[this.__dimension];
- last_slide.$element[0].style[this.__cssProb] = pos + 'px';
- last_slide.position = pos;
- };
-
- // @since 1.7.0
- // adds z-index to slides
- p.__updateSlidesZindex = function(){
-
-
- var slide,
- l = this.viewSlidesList.length,
- hlf = Math.floor( l/2 );
-
- if( this.loop ){
- var loc = this.viewSlidesList.indexOf(this.currentSlide);
- for ( var i = 0; i!==l; i++ ){
- slide = this.viewSlidesList[i];
- this.viewSlidesList[i].$element.css('z-index', i<=loc ? i+1 : l-i);
- }
- } else {
-
- var beforeNum = this.currentSlide.index - this.viewSlidesList[0].index,
- afterNum = l - beforeNum,
- diff = beforeNum - afterNum;
-
- for ( var i = 0; i!==l; i++ ){
- this.viewSlidesList[i].$element.css('z-index', i<=beforeNum ? i+1 : l-i);
- }
-
- this.currentSlide.$element.css('z-index', l);
- }
-
- };
-
- p.addSlide = function(slide){
- slide.view = this;
- this.slides.push(slide);
- this.slideList.push(slide);
- this.slidesCount++;
- };
-
- p.appendSlide = function(slide){
- this.$slideCont.append(slide.$element);
- };
-
- p.updateLoop = function(index){
- if(this.loop){
- var steps = this.__getSteps(this.index , index);
-
- for(var i = 0 , l = Math.abs(steps) ; i < l ; ++ i){
- if(steps < 0) this.__pushStart();
- else this.__pushEnd();
- }
- }
- };
-
- p.gotoSlide = function(index , fast){
- this.updateLoop(index);
- this.index = index;
-
- var target_slide = this.slideList[index];
-
- this._checkCritMargins();
-
- this.controller.changeTo( target_slide.position , !fast , null , null , false);
- if(target_slide === this.currentSlide) return;
- this.slideChanged = true;
- this.currentSlide = target_slide;
-
- if ( this.autoUpdateZIndex ) {
- this.__updateSlidesZindex();
- }
-
- this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START));
- if(fast)this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_END));
- };
-
- p.next = function(checkLoop){
- if ( checkLoop && !this.loop && this.index + 1 >= this.slidesCount ) {
- this.controller.bounce(10);
- return;
- }
-
- this.gotoSlide((this.index + 1 >= this.slidesCount)? 0 : this.index + 1);
- };
-
- p.previous = function(checkLoop){
- if ( checkLoop && !this.loop && this.index - 1 < 0 ) {
- this.controller.bounce(-10);
- return;
- }
-
- this.gotoSlide((this.index - 1 < 0)? this.slidesCount - 1 : this.index - 1);
- };
-
- /* --------------- Swipe control ------------------*/
-
- p.setupSwipe = function(){
-
- this.swipeControl = new averta.TouchSwipe(this.$element);
- this.swipeControl.swipeType = this.dir === 'h'? 'horizontal' : 'vertical';
- var that = this;
-
- if(this.dir === 'h'){
- this.swipeControl.onSwipe = function(status){
- that.horizSwipeMove(status);
- };
- }else{
- this.swipeControl.onSwipe = function(status){
- that.vertSwipeMove(status);
- };
- }
-
- };
-
- p.vertSwipeMove = function(status){
- var phase = status.phase;
- if(phase === 'start'){
- this.controller.stop();
- this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_START, status));
- }else if(phase === 'move' && (!this.loop || Math.abs(this.currentSlide.position - this.controller.value + status.moveY ) < this.cont_size / 2)){
- this.controller.drag(status.moveY);
- this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_MOVE, status));
- }else if(phase === 'end' || phase === 'cancel'){
-
- var speed = status.distanceY / status.duration * 50/3;
-
- if(Math.abs(speed) > 0.1){
- this.controller.push(-speed);
- if(speed > this.controller.options.snappingMinSpeed)
- this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_END, status));
- }else {
- this.controller.cancel();
- this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_CANCEL, status));
- }
-
- }
- };
-
- p.horizSwipeMove = function(status){
- var phase = status.phase;
- //console.log(this.loop)
- if(phase === 'start'){
- this.controller.stop();
- this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_START, status));
- }else if(phase === 'move' && (!this.loop || Math.abs(this.currentSlide.position - this.controller.value + status.moveX ) < this.cont_size / 2)){
- this.controller.drag(status.moveX);
- this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_MOVE, status));
- }else if(phase === 'end' || phase === 'cancel'){
-
- var speed = status.distanceX / status.duration * 50/3;
-
- if(Math.abs(speed) > 0.1){
- this.controller.push(-speed );
- if(speed > this.controller.options.snappingMinSpeed)
- this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_END, status));
- }else{
- this.controller.cancel();
- this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_CANCEL, status));
- }
-
- }
- };
-
- /* ------------------------------------------------*/
-
- p.setSize = function(width , height , hard){
- if(this.lastWidth === width && height === this.lastHeight && !hard) return;
-
- this.$element.width(width).height(height);
-
- for(var i = 0; i < this.slidesCount ; ++i)
- this.slides[i].setSize(width , height , hard);
-
- this.__width = width;
- this.__height = height;
-
- if(this.__created){
- this.__locateSlides();
-
- this.cont_size = (this.slidesCount - 1) * (this[this.__dimension] + this.spacing);
- if(!this.loop) this.controller._max_value = this.cont_size;
-
- this.controller.options.snapsize = this[this.__dimension] + this.spacing;
- this.controller.changeTo(this.currentSlide.position , false , null , null , false );
- this.controller.cancel();
-
- this.lastWidth = width;
- this.lastHeight = height;
- }
- };
-
- p.create = function(index){
-
- this.__created = true;
-
- this.index = Math.min((index || 0), this.slidesCount - 1);
- this.lastSnap = this.index; // it will be used to check snap changed or not on snap complete
-
- if(this.loop)
- this.slides = this.__createLoopList();
-
- this.normalMode = this.slidesCount <= this.options.viewNum;
-
- for(var i = 0; i < this.slidesCount ; ++i)
- this.slides[i].create();
-
- this.__locateSlides();
-
- this.controller.options.snapsize = this[this.__dimension] + this.spacing;
- if(!this.loop) this.controller._max_value = (this.slidesCount - 1) * (this[this.__dimension] + this.spacing);
-
- this.gotoSlide(this.index , true);
-
- if(this.options.swipe && (window._touch || this.options.mouseSwipe))
- this.setupSwipe();
-
- };
-
- p.destroy = function(){
- if(!this.__created) return;
-
- for(var i = 0; i < this.slidesCount ; ++i)
- this.slides[i].destroy();
-
- this.slides = null;
- this.slideList = null;
- this.$element.remove();
-
- this.controller.destroy();
- this.controller = null;
- };
-
- averta.EventDispatcher.extend(p);
-
- MSSlideController.registerView('basic' , MSBasicView);
-
- })(jQuery);
- /* ================== bin-debug/js/pro/views/WaveView.js =================== */
- ;(function($){
-
- "use strict";
-
- window.MSWaveView = function(options){
- MSBasicView.call(this , options);
- this.$element.removeClass('ms-basic-view').addClass('ms-wave-view');
- this.$slideCont.css(window._csspfx + 'transform-style' , 'preserve-3d');
-
- // Auto update z index of slides
- // @since 1.7
- this.autoUpdateZIndex = true;
- };
-
- MSWaveView.extend(MSBasicView);
- MSWaveView._3dreq = true;
- MSWaveView._fallback = MSBasicView;
-
- var p = MSWaveView.prototype;
- var _super = MSBasicView.prototype;
-
- /*-------------- METHODS --------------*/
-
- /*p.__setSlideTransDuration = function(value){
- for(var i=0; i<this.slidesCount; ++i)
- this.slides[i].$element.css(window._csspfx + 'transition-duration' , value + 'ms');
- };*/
-
- p._horizUpdate = function(controller , value){
-
- _super._horizUpdate.call(this, controller , value);
-
- var cont_scroll = -value;
- var slide_pos , slide , distance;
-
- for(var i = 0; i < this.slidesCount; ++i){
- slide = this.slideList[i];
- //slide_pos = parseInt(slide.$element.css('left'));
- distance = -cont_scroll - slide.position;
- this.__updateSlidesHoriz(slide , distance);
- }
-
- };
-
- p._vertiUpdate = function(controller , value){
-
- _super._vertiUpdate.call(this, controller , value);
-
- var cont_scroll = -value;
- var slide_pos , slide , distance;
-
- for(var i = 0; i < this.slidesCount; ++i){
- slide = this.slideList[i];
- //slide_pos = parseInt(slide.$element.css('left'));
- distance = -cont_scroll - slide.position;
- this.__updateSlidesVertic(slide , distance);
- }
-
- };
-
-
- p.__updateSlidesHoriz = function(slide , distance){
- var value = Math.abs(distance * 100 / this.__width);
- //var value2 = Math.min(value , 100);
- // var sp = Math.min(100 , )
- //slide.$bg_img.css('opacity' , (100 - Math.abs(distance * 120 / this.__width / 3)) / 100);
- slide.$element.css(window._csspfx + 'transform' , 'translateZ('+ -value * 3 +'px) rotateY(0.01deg)'/* translateX('+(distance < 0 ? 1 : -1) * -value * 5+'px)'*/);
- };
-
- p.__updateSlidesVertic = function(slide , distance){
- this.__updateSlidesHoriz(slide , distance);
- };
-
- /*
- p.swipeMove = function(status){
-
- if(status.phase == 'start'){
- this.__setSlideTransDuration(0);
- }else if(status.phase == 'end'){
- this.__setSlideTransDuration(this.__slideDuration);
- }
-
- _super.swipeMove.call(this , status);
- };
-
- p.create = function(index){
- _super.create.call(this , index);
-
- for(var i = 0; i<this.slidesCount ; ++i){
- this.slides[i].$element.css(window._csspfx + 'transition-property' , window._csspfx + 'transform');
- this.slides[i].$element.css(window._csspfx + 'transition-duration' , this.slideDuration + 'ms');
- }
- };
- */
- MSSlideController.registerView('wave' , MSWaveView);
- })(jQuery);
- /* ================== bin-debug/js/pro/views/FadeBasicView.js =================== */
- /**
- * Master Slider Fade Basic view
- * @author averta
- * @version 1.1
- * @package MS
- */
-
- ;(function(){
-
- window.MSFadeBasicView = function(options){
- MSWaveView.call(this , options);
- this.$element.removeClass('ms-wave-view').addClass('ms-fade-basic-view');
- };
-
- MSFadeBasicView.extend(MSWaveView);
-
- var p = MSFadeBasicView.prototype;
- var _super = MSFadeBasicView.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.__updateSlidesHoriz = function(slide , distance){
- var value = Math.abs(distance * 0.6 / this.__width);
- value = 1 - Math.min(value , 0.6);
- slide.$element.css('opacity' , value);
- };
-
- p.__updateSlidesVertic = function(slide , distance){
- this.__updateSlidesHoriz(slide , distance);
- };
-
- MSSlideController.registerView('fadeBasic' , MSFadeBasicView);
- MSWaveView._fallback = MSFadeBasicView;
- })();
- /* ================== bin-debug/js/pro/views/FadeWaveView.js =================== */
- /**
- * Master Slider Fade Wave View
- * @author averta
- * @version 1.0
- * @extends {MSWaveView}
- */
- ;(function(){
-
- window.MSFadeWaveView = function(options){
- MSWaveView.call(this , options);
- this.$element.removeClass('ms-wave-view').addClass('ms-fade-wave-view');
- };
-
- MSFadeWaveView.extend(MSWaveView);
- MSFadeWaveView._3dreq = true;
- MSFadeWaveView._fallback = MSFadeBasicView;
-
- var p = MSFadeWaveView.prototype;
- var _super = MSWaveView.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.__updateSlidesHoriz = function(slide , distance){
- var value = Math.abs(distance * 100 / this.__width);
- value = Math.min(value , 100);
- slide.$element.css('opacity' , 1-value/300);
- slide.$element[0].style[window._jcsspfx + 'Transform'] = 'scale('+ (1 - value/800) +') rotateY(0.01deg) ';
- };
-
- p.__updateSlidesVertic = function(slide , distance){
- this.__updateSlidesHoriz(slide , distance);
- };
-
- MSSlideController.registerView('fadeWave' , MSFadeWaveView);
-
- })();
- /* ================== bin-debug/js/pro/views/FlowView.js =================== */
- ;(function($){
-
- "use strict";
-
- window.MSFlowView = function(options){
- MSWaveView.call(this , options);
- this.$element.removeClass('ms-wave-view').addClass('ms-flow-view');
- //this.$slideCont.css(window._csspfx + 'transform-style' , 'preserve-3d');
- };
-
- MSFlowView.extend(MSWaveView);
- MSFlowView._3dreq = true;
- MSFlowView._fallback = MSFadeBasicView;
-
- var p = MSFlowView.prototype;
- var _super = MSWaveView.prototype;
-
- /*-------------- METHODS --------------*/
-
-
- p.__updateSlidesHoriz = function(slide , distance){
- var value = Math.abs(distance * 100 / this.__width);
- var rvalue = Math.min(value * 0.3 , 30) * (distance < 0 ? -1 : 1);
- var zvalue = value * 1.2;
- slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ('+ -zvalue*5 +'px) rotateY(' + rvalue + 'deg) ';
- };
-
- p.__updateSlidesVertic = function(slide , distance){
- var value = Math.abs(distance * 100 / this.__width);
- var rvalue = Math.min(value * 0.3 , 30) * (distance < 0 ? -1 : 1);
- var zvalue = value * 1.2;
- slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ('+ -zvalue*5 +'px) rotateX(' + -rvalue + 'deg) ';
- };
-
-
- MSSlideController.registerView('flow' , MSFlowView);
- })(jQuery);
- /* ================== bin-debug/js/pro/views/FadeFlowView.js =================== */
- /**
- * Master Slider Fade Flow View
- * @author averta
- * @extends {MSWaveView}
- * @version 1.0
- */
- ;(function(){
-
- window.MSFadeFlowView = function(options){
- MSWaveView.call(this , options);
- this.$element.removeClass('ms-wave-view').addClass('ms-fade-flow-view');
- };
-
- MSFadeFlowView.extend(MSWaveView);
- MSFadeFlowView._3dreq = true;
-
- var p = MSFadeFlowView.prototype;
- var _super = MSWaveView.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.__calculate = function(distance){
- var value = Math.min(Math.abs(distance * 100 / this.__width) , 100);
- var rvalue = Math.min(value * 0.5 , 50) * (distance < 0 ? -1 : 1);
- return {value: value, rvalue: rvalue};
- };
-
- p.__updateSlidesHoriz = function(slide , distance){
- var clc = this.__calculate(distance);
- slide.$element.css('opacity' , 1-clc.value/300);
- console.log(window._jcsspfx + 'transform','translateZ('+ -clc.value +'px) rotateY(' + clc.rvalue + 'deg) ')
- slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ('+ -clc.value +'px) rotateY(' + clc.rvalue + 'deg) ';
- };
-
- p.__updateSlidesVertic = function(slide , distance){
- var clc = this.__calculate(distance);
- slide.$element.css('opacity' , 1-clc.value/300);
- slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ('+ -clc.value +'px) rotateX(' + -clc.rvalue + 'deg) ';
- };
-
- MSSlideController.registerView('fadeFlow' , MSFadeFlowView);
-
- })();
- /* ================== bin-debug/js/pro/views/MaskView.js =================== */
- ;(function($){
-
- "use strict";
-
- window.MSMaskView = function(options){
- MSBasicView.call(this , options);
- this.$element.removeClass('ms-basic-view').addClass('ms-mask-view');
-
- };
-
- MSMaskView.extend(MSBasicView);
-
- var p = MSMaskView.prototype;
- var _super = MSBasicView.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.addSlide = function(slide){ // OK
- slide.view = this;
-
- slide.$frame = $('<div></div>').addClass('ms-mask-frame').append(slide.$element);
- slide.$element[0].style.position = 'relative';
- //this.$slideCont.append(slide.$frame);
- slide.autoAppend = false;
-
- this.slides.push(slide);
- this.slideList.push(slide);
-
- this.slidesCount++;
- };
-
- p.setSize = function(width , height){
- var slider = this.slides[0].slider;
-
- for(var i = 0; i < this.slidesCount ; ++i){
- this.slides[i].$frame[0].style.width = width + 'px';
- if(!slider.options.autoHeight)
- this.slides[i].$frame[0].style.height = height + 'px';
- }
-
- _super.setSize.call(this , width , height);
- };
-
- // p.__snapUpdate = function(controller , snap , change){
-
- // if(this.loop){
- // var target_index = this.index + change;
- // this.updateLoop(target_index);
-
- // if(target_index >= this.slidesCount) target_index = target_index - this.slidesCount;
- // if(target_index < 0) target_index = this.slidesCount + target_index;
-
- // this.index = target_index;
- // }else{
- // if(snap < 0 || snap >= this.slidesCount) return
- // this.index = snap;
- // }
-
-
- // this._checkCritMargins();
-
- // if($.browser.mozilla){
-
- // this.slideList[this.index].$frame[0].style.marginTop = '0.1px';
- // this.slideList[this.index].$element[0].style.marginTop = '0.1px';
-
- // if(this.currentSlide){
- // this.currentSlide.$frame[0].style.marginTop = '';
- // this.currentSlide.$element[0].style.marginTop = '';
- // }
- // }
-
- // var new_slide = this.slideList[this.index];
- // if(new_slide === this.currentSlide)return;
-
- // this.currentSlide = new_slide;
- // this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START));
- // };
-
- p._horizUpdate = function(controller , value){
-
- _super._horizUpdate.call(this , controller , value);
-
- var i = 0;
-
- if(this.css3) {
- for(i = 0 ; i < this.slidesCount ; ++i){
- this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateX('+(value - this.slideList[i].position)+'px)'+ this.__translate_end;
- }
- return;
- }
-
- for(i = 0 ; i < this.slidesCount ; ++i){
- this.slideList[i].$element[0].style.left = (value - this.slideList[i].position) + 'px';
- }
-
- };
-
- p._vertiUpdate = function(controller , value){
-
- _super._vertiUpdate.call(this , controller , value);
-
- var i = 0;
-
- if(this.css3) {
- for(i = 0 ; i < this.slidesCount ; ++i){
- this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateY('+(value - this.slideList[i].position)+'px)'+ this.__translate_end;
- }
- return;
- }
-
- for(i = 0 ; i < this.slidesCount ; ++i){
- this.slideList[i].$element[0].style.top = (value - this.slideList[i].position) + 'px';
- }
-
- };
-
- p.__pushEnd = function(){ // OK
- var first_slide = this.slides.shift();
- var last_slide = this.slides[this.slidesCount - 2];
-
- this.slides.push(first_slide);
- if(!this.normalMode) return;
-
- var pos = last_slide.$frame[0][this.__offset] + this.spacing + this[this.__dimension];
- first_slide.$frame[0].style[this.__cssProb] = pos + 'px';
- first_slide.position = pos;
- };
-
- p.__pushStart = function(){ // OK
-
- var last_slide = this.slides.pop();
- var first_slide = this.slides[0];
-
- this.slides.unshift(last_slide);
-
- if(!this.normalMode) return;
-
- var pos = first_slide.$frame[0][this.__offset] - this.spacing - this[this.__dimension];
- last_slide.$frame[0].style[this.__cssProb] = pos + 'px';
- last_slide.position = pos;
- };
-
- p.__updateViewList = function(){
-
- if(this.normalMode) {
- this.viewSlidesList = this.slides;
- return;
- }
-
- var temp = this.viewSlidesList.slice();
-
- // update view list
- this.viewSlidesList = [];
- var i = 0 , hlf = Math.floor(this.options.viewNum / 2) , l;
-
- if(this.loop){
- for(; i !== this.options.viewNum ; i++)
- this.viewSlidesList.push(this.slides[this.currentSlideLoc - hlf + i]);
- }else{
- // before
- for(i = 0 ; i !== hlf && this.index - i !== -1 ; i++)
- this.viewSlidesList.unshift(this.slideList[this.index - i]);
- // after
- for(i = 1; i !== hlf && this.index + i !== this.slidesCount; i++)
- this.viewSlidesList.push(this.slideList[this.index + i]);
- }
-
- for (i = 0 , l = temp.length ; i !== l ; i++){
- if( this.viewSlidesList.indexOf(temp[i]) === -1){
- temp[i].sleep();
- temp[i].$frame.detach();
- }
- }
-
- temp = null;
- };
-
-
- p.__locateSlides = function(move , start){ // OK
-
- this.__updateViewList();
-
- start = !this.loop ? this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing ) : start || 0;
-
- // Old method
- // for(var i = 0; i < this.slidesCount ; ++i){
- // var pos = i * (this[this.__dimension] + this.spacing);
-
- // this.slides[i].position = pos;
- // this.slides[i].$frame[0].style[this.__cssProb] = pos + 'px';
- // }
-
- var l = this.viewSlidesList.length , slide;
-
- for(var i = 0; i !== l ; i++){
- var pos = start + i * (this[this.__dimension] + this.spacing );
- slide = this.viewSlidesList[i];
-
- this.$slideCont.append(slide.$frame);
- slide.wakeup(false);
- slide.position = pos;
-
- if ( slide.selected && slide.bgvideo ) {
- try{
- slide.bgvideo.play();
- } catch (e) {}
- }
-
- slide.$frame[0].style[this.__cssProb] = pos + 'px';
- }
-
- if(move !== false)this.controller.changeTo( this.slideList[this.index].position , false , null , null , false);
-
- };
-
- MSSlideController.registerView('mask' , MSMaskView);
- })(jQuery);
- /* ================== bin-debug/js/pro/views/ParallaxMaskView.js =================== */
- ;(function($){
-
- "use strict";
-
- window.MSParallaxMaskView = function(options){
- MSMaskView.call(this , options);
- this.$element.removeClass('ms-basic-view').addClass('ms-parallax-mask-view');
-
- };
-
- MSParallaxMaskView.extend(MSMaskView);
- MSParallaxMaskView.parallaxAmount = 0.5;
-
- var p = MSParallaxMaskView.prototype;
- var _super = MSBasicView.prototype;
-
- /*-------------- METHODS --------------*/
-
- p._horizUpdate = function(controller , value){
- _super._horizUpdate.call(this , controller , value);
-
- var i = 0;
-
- if(this.css3) {
- for(i = 0 ; i < this.slidesCount ; ++i){
- this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateX('+(value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount +'px)'+ this.__translate_end;
- }
- return;
- }
-
- for(i = 0 ; i < this.slidesCount ; ++i){
- this.slideList[i].$element[0].style.left = (value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount + 'px';
- }
-
- };
-
- p._vertiUpdate = function(controller , value){
-
- _super._vertiUpdate.call(this , controller , value);
-
- var i = 0;
-
- if(this.css3) {
- for(i = 0 ; i < this.slidesCount ; ++i){
- this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateY('+(value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount +'px)'+ this.__translate_end;
- }
- return;
- }
-
- for(i = 0 ; i < this.slidesCount ; ++i){
- this.slideList[i].$element[0].style.top = (value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount + 'px';
- }
-
- };
-
-
- MSSlideController.registerView('parallaxMask' , MSParallaxMaskView);
- })(jQuery);
- /* ================== bin-debug/js/pro/views/FadeView.js =================== */
- ;(function($){
-
- "use strict";
-
- window.MSFadeView = function(options){
- MSBasicView.call(this , options);
- this.$element.removeClass('ms-basic-view').addClass('ms-fade-view');
- this.controller.renderCallback(this.__update , this);
- };
-
- MSFadeView.extend(MSBasicView);
-
- var p = MSFadeView.prototype;
- var _super = MSBasicView.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.__update = function(controller , value){
- var cont_scroll = -value;
- var slide_pos , slide , distance;
-
- for(var i = 0; i < this.slidesCount; ++i){
- slide = this.slideList[i];
- distance = -cont_scroll - slide.position;
- this.__updateSlides(slide , distance);
- }
- };
-
- p.__updateSlides = function(slide , distance){
- var value = Math.abs(distance / this[this.__dimension]);
- if(1 - value <= 0){
- slide.$element.fadeTo(0 , 0).css('visibility' , 'hidden');
- }else{
- slide.$element.fadeTo(0 , 1 - value).css('visibility' , '');
- }
- };
-
- p.__locateSlides = function(move , start){
-
- this.__updateViewList();
-
- // Old method
- // for(var i = 0; i < this.slidesCount ; ++i){
- // this.slides[i].position = i * this[this.__dimension];
- // }
-
- start = !this.loop ? this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing ) : start || 0;
-
- var l = this.viewSlidesList.length , slide;
-
- for(var i = 0; i !== l ; i++){
- var pos = start + i * this[this.__dimension];
- slide = this.viewSlidesList[i];
- slide.wakeup();
- slide.position = pos;
- }
-
- if(move !== false)this.controller.changeTo( this.slideList[this.index].position , false , null , null , false);
-
- };
-
- p.__pushEnd = function(){
- var first_slide = this.slides.shift();
- var last_slide = this.slides[this.slidesCount - 2];
- this.slides.push(first_slide);
- first_slide.position = last_slide.position + this[this.__dimension];
- };
-
- p.__pushStart = function(){
- var last_slide = this.slides.pop();
- var first_slide = this.slides[0];
- this.slides.unshift(last_slide);
- last_slide.position = first_slide.position - this[this.__dimension];
- };
-
- p.create = function(index){
- _super.create.call(this , index);
- this.spacing = 0;
- this.controller.options.minValidDist = 10;
- };
-
- MSSlideController.registerView('fade' , MSFadeView);
- })(jQuery);
- /* ================== bin-debug/js/pro/views/ScaleView.js =================== */
- ;(function($){
-
- "use strict";
-
- window.MSScaleView = function(options){
- MSBasicView.call(this , options);
- this.$element.removeClass('ms-basic-view').addClass('ms-scale-view');
- this.controller.renderCallback(this.__update , this);
- };
-
- MSScaleView.extend(MSFadeView);
-
- var p = MSScaleView.prototype;
- var _super = MSFadeView.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.__updateSlides = function(slide , distance){
- var value = Math.abs(distance / this[this.__dimension]),
- element = slide.$element[0];
-
- if(1 - value <= 0){
- element.style.opacity = 0;
- element.style.visibility = 'hidden';
- element.style[window._jcsspfx + 'Transform'] = '';
- }else{
- element.style.opacity = 1 - value;
- element.style.visibility = '';
- element.style[window._jcsspfx + 'Transform'] = 'perspective(2000px) translateZ('+(value* (distance < 0 ? -0.5 : 0.5)) * 300+'px)';
- }
-
- };
-
- p.create = function(index){
- _super.create.call(this , index);
- this.controller.options.minValidDist = 0.03;
- };
-
- MSSlideController.registerView('scale' , MSScaleView);
- })(jQuery);
- /* ================== bin-debug/js/pro/views/StackView.js =================== */
- /**
- * Master Slider Stack View
- * @package Master Slider jQuery
- * @author Averta
- */
- ;(function($){
-
- "use strict";
-
- window.MSStackView = function(options){
- MSBasicView.call(this , options);
- this.$element.removeClass('ms-basic-view').addClass('ms-stack-view');
- this.controller.renderCallback(this.__update , this);
- this.autoUpdateZIndex = true;
- };
-
- MSStackView.extend(MSFadeView);
- MSStackView._3dreq = true;
- MSStackView._fallback = MSFadeView;
-
- var p = MSStackView.prototype;
- var _super = MSFadeView.prototype;
-
- /*-------------- METHODS --------------*/
- /**
- * Updates slides z index
- */
- p.__updateSlidesZindex = function () {
- var slide,
- l = this.viewSlidesList.length;
- for ( var i = 0; i!==l; i++ ){
- slide = this.viewSlidesList[i];
- this.viewSlidesList[i].$element.css('z-index', l-i);
- }
-
- };
-
- p.__updateSlides = function(slide , distance){
- var value = Math.abs(distance / this[this.__dimension]),
- element = slide.$element[0];
- if(1 - value <= 0){
- element.style.opacity = 1;
- element.style.visibility = 'hidden';
- element.style[window._jcsspfx + 'Transform'] = '';
- }else{
- element.style.visibility = '';
-
- if ( distance < 0 ) {
- element.style[window._jcsspfx + 'Transform'] = 'perspective(2000px) translateZ('+ (value * -300) +'px)';
- } else {
- element.style[window._jcsspfx + 'Transform'] = this.__translate + '(' + ( -value * this[this.__dimension] ) +'px)';
- }
- }
-
- };
-
- p.create = function(index){
- _super.create.call(this , index);
- this.controller.options.minValidDist = 0.03;
- this.__translate = this.dir === 'h' ? 'translateX' : 'translateY';
- };
-
- MSSlideController.registerView('stack' , MSStackView);
- })(jQuery);
- /* ================== bin-debug/js/pro/views/FocusView.js =================== */
- /**
- * Master Slider Focus View
- * @version 1.1
- * @author averta
- * @package MS
- * @extends {MSFadeBasicView}
- */
-
- ;(function(){
-
- 'use strict';
-
- var perspective = 2000;
-
- window.MSFocusView = function(options){
- MSWaveView.call(this , options);
- this.$element.removeClass('ms-wave-view').addClass('ms-focus-view');
- this.options.centerSpace = this.options.centerSpace || 1;
- };
-
- MSFocusView.extend(MSWaveView);
- MSFocusView._3dreq = true;
- MSFocusView._fallback = MSFadeBasicView;
-
- var p = MSFocusView.prototype;
- var _super = MSWaveView.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.__calcview = function(z , w){
- var a = w / 2 * z / (z + perspective);
- return a * (z + perspective) / perspective;
- };
-
- p.__updateSlidesHoriz = function(slide , distance){
- var value = Math.abs(distance * 100 / this.__width);
- value = -Math.min(value , 100)* 15;
- slide.$element.css(window._csspfx + 'transform' , 'translateZ('+ (value + 1) +'px) rotateY(0.01deg) translateX('+ (distance < 0 ? 1 : -1) * (-this.__calcview(value, this.__width) * this.options.centerSpace )+'px)');
- };
-
- p.__updateSlidesVertic = function(slide , distance){
- var value = Math.abs(distance * 100 / this.__width);
- value = -Math.min(value , 100)* 15;
- slide.$element.css(window._csspfx + 'transform' , 'translateZ('+ (value + 1) +'px) rotateY(0.01deg) translateY('+ (distance < 0 ? 1 : -1) * (-this.__calcview(value, this.__width) * this.options.centerSpace )+'px)');
- };
-
- MSSlideController.registerView('focus' , MSFocusView);
-
- })();
- /* ================== bin-debug/js/pro/views/PartialWaveView.js =================== */
- /**
- * Master Slider Partial Wave View
- * @version 1.0
- * @author averta
- * @extends {MSWaveView}
- */
-
- ;(function(){
-
- window.MSPartialWaveView = function(options){
- MSWaveView.call(this , options);
- this.$element.removeClass('ms-wave-view').addClass('ms-partial-wave-view');
- };
-
- MSPartialWaveView.extend(MSWaveView);
- MSPartialWaveView._3dreq = true;
- MSPartialWaveView._fallback = MSFadeBasicView;
-
- var p = MSPartialWaveView.prototype;
- var _super = MSWaveView.prototype;
-
- /*-------------- METHODS --------------*/
-
- p.__updateSlidesHoriz = function(slide , distance){
- var value = Math.abs(distance * 100 / this.__width);
- if( slide.hasBG ){
- slide.$bg_img.css('opacity' , (100 - Math.abs(distance * 120 / this.__width / 3)) / 100);
- }
- slide.$element.css(window._csspfx + 'transform' , 'translateZ('+ -value * 3 +'px) rotateY(0.01deg) translateX('+distance*0.75+'px)');
- };
-
- p.__updateSlidesVertic = function(slide , distance){
- var value = Math.abs(distance * 100 / this.__width);
- if( slide.hasBG ){
- slide.$bg_img.css('opacity' , (100 - Math.abs(distance * 120 / this.__width / 3)) / 100);
- }
- slide.$element.css(window._csspfx + 'transform' , 'translateZ('+ -value * 3 +'px) rotateY(0.01deg) translateY('+distance*0.75+'px)');
- };
-
- MSSlideController.registerView('partialWave' , MSPartialWaveView);
-
- })();
- /* ================== bin-debug/js/pro/uicontrols/BaseControl.js =================== */
- ;(function($){
-
- "use strict";
-
- var BaseControl = function(){
- this.options = {
- prefix:'ms-',
- autohide:true,
- overVideo:true,
- customClass: null
- };
- };
-
- var p = BaseControl.prototype;
-
- /* -------------------------------- */
-
- p.slideAction = function(slide){
-
- };
-
- p.setup = function(){
- this.cont = this.options.insertTo ? $(this.options.insertTo) : this.slider.$controlsCont;
- if(!this.options.overVideo) this._hideOnvideoStarts();
-
- };
-
- p.checkHideUnder = function(){
- if(this.options.hideUnder){
- //this.slider.api.addEventListener(MSSliderEvent.RESIZE, this.onSliderResize, this);
- this.needsRealign = !this.options.insetTo && (this.options.align === 'left' || this.options.align === 'right') && this.options.inset === false;
- $(window).bind('resize', {that:this}, this.onResize);
- this.onResize();
-
- }
- };
-
- /**
- * hide control if width of slider changes to lower that specified value [hideUnder]
- * @since 1.5.7
- * @protected
- */
- p.onResize = function(event){
- var that = (event && event.data.that) || this;
- var w = window.innerWidth;
- if( w <= that.options.hideUnder && !that.detached ){
- that.hide(true);
- that.detached = true;
- that.onDetach();
- }else if( w >= that.options.hideUnder && that.detached ){
- that.detached = false;
- that.visible();
- that.onAppend();
- }
- };
-
- p.create = function(){
- var that = this;
- if(this.options.autohide ){
-
- this.hide(true);
-
- this.slider.$controlsCont.mouseenter($.proxy(this._onMouseEnter, this))
- .mouseleave($.proxy(this._onMouseLeave, this))
- .mousedown($.proxy(this._onMouseDown, this));
-
- if ( this.$element ) {
- this.$element.mouseenter($.proxy(this._onMouseEnter, this))
- .mouseleave($.proxy(this._onMouseLeave, this))
- .mousedown($.proxy(this._onMouseDown, this));
- }
-
- $(document).mouseup($.proxy(this._onMouseUp, this));
- }
-
- if ( this.options.align ) {
- this.$element.addClass('ms-align-' + this.options.align);
- }
-
- // add custom class to control
- if ( this.options.customClass && this.$element ) {
- this.$element.addClass(this.options.customClass);
- }
- };
-
- /**
- * Mouse Enter Listener
- * @since 2.2
- */
- p._onMouseEnter = function(){
- if ( !this._disableAH && !this.mdown ){
- this.visible();
- }
-
- this.mleave = false;
- };
-
- /**
- * Mouse Leave Listener
- * @since 2.2
- */
- p._onMouseLeave = function(){
- if ( !this.mdown ){
- this.hide();
- }
-
- this.mleave = true;
- };
-
- /**
- * Mouse Down Listener
- * @since 2.2
- */
- p._onMouseDown = function(){
- this.mdown = true;
- };
-
- /**
- * Mouse Up Listener
- * @since 2.2
- */
- p._onMouseUp = function(){
- if ( this.mdown && this.mleave ) {
- this.hide();
- }
-
- this.mdown = false;
- };
-
- /**
- * calls by the parent class [MSBaseControl] when the control element visibles [hideUnder option]
- * @since 1.5.7
- */
- p.onAppend = function(){
- if( this.needsRealign ){
- this.slider._realignControls();
- }
- };
-
- /**
- * calls by the parent class [MSBaseControl] when the control element visibles [hideUnder option]
- * @since 1.5.7
- */
- p.onDetach = function(){
- if( this.needsRealign ){
- this.slider._realignControls();
- }
- };
-
- p._hideOnvideoStarts = function(){
- var that = this;
- this.slider.api.addEventListener(MSSliderEvent.VIDEO_PLAY , function(){
- that._disableAH = true;
- that.hide();
- });
-
- this.slider.api.addEventListener(MSSliderEvent.VIDEO_CLOSE , function(){
- that._disableAH = false;
- that.visible();
- });
- };
-
- p.hide = function(fast){
- if(fast){
- this.$element.css('opacity' , 0);
- this.$element.css('display' , 'none');
- } else {
- clearTimeout(this.hideTo);
- var $element = this.$element;
- this.hideTo = setTimeout(function(){
- CTween.fadeOut($element , 400 , false);
- }, 20);
- }
-
- this.$element.addClass('ms-ctrl-hide');
- };
-
- p.visible = function(){
- if(this.detached) return;
- clearTimeout(this.hideTo);
- this.$element.css('display' , '');
- CTween.fadeIn(this.$element , 400 , false);
- this.$element.removeClass('ms-ctrl-hide');
- };
-
- p.destroy = function(){
-
- if(this.options && this.options.hideUnder){
- //this.slider.api.removeEventListener(MSSliderEvent.RESIZE, this.onResize, this);
- $(window).unbind('resize', this.onResize);
- }
- };
-
- window.BaseControl = BaseControl;
-
- })(jQuery);
- /* ================== bin-debug/js/pro/uicontrols/Arrows.js =================== */
- ;(function($){
-
- "use strict";
-
- var MSArrows = function(options){
- BaseControl.call(this);
- $.extend(this.options , options);
- };
-
- MSArrows.extend(BaseControl);
-
- var p = MSArrows.prototype;
- var _super = BaseControl.prototype;
-
- /* -------------------------------- */
-
- p.setup = function(){
- var that = this;
-
- this.$next = $('<div></div>')
- .addClass(this.options.prefix + 'nav-next')
- //.appendTo(this.cont)
- .bind('click' , function(){
- that.slider.api.next(true);
- });
-
-
- this.$prev = $('<div></div>')
- .addClass(this.options.prefix + 'nav-prev')
- //.appendTo(this.cont)
- .bind('click' , function(){
- that.slider.api.previous(true);
- });
-
- _super.setup.call(this);
-
- this.cont.append(this.$next);
- this.cont.append(this.$prev);
-
- this.checkHideUnder(); // super method
- };
-
- p.hide = function(fast){
- if(fast){
- this.$prev.css('opacity' , 0).css('display', 'none');
- this.$next.css('opacity' , 0).css('display', 'none');
- return;
- }
-
- CTween.fadeOut(this.$prev , 400 , false);
- CTween.fadeOut(this.$next , 400 , false);
-
- this.$prev.addClass('ms-ctrl-hide');
- this.$next.addClass('ms-ctrl-hide');
- };
-
- p.visible = function(){
- if(this.detached) return;
- CTween.fadeIn(this.$prev , 400 );
- CTween.fadeIn(this.$next , 400 );
- this.$prev.removeClass('ms-ctrl-hide').css('display', '');
- this.$next.removeClass('ms-ctrl-hide').css('display', '');
- };
-
- p.destroy = function(){
- _super.destroy();
- this.$next.remove();
- this.$prev.remove();
- };
-
- window.MSArrows = MSArrows;
- MSSlideController.registerControl('arrows' , MSArrows);
- })(jQuery);
- /* ================== bin-debug/js/pro/uicontrols/Thumblist.js =================== */
- ;(function($){
-
- "use strict";
-
- var MSThumblist = function(options){
- BaseControl.call(this);
-
- // default options
- this.options.dir = 'h';
- this.options.wheel = options.dir === 'v';
- this.options.arrows = false;
- this.options.speed = 17;
- this.options.align = null;
- this.options.inset = false;
- this.options.margin = 10;
- this.options.space = 10;
- this.options.width = 100;
- this.options.height = 100;
- this.options.type = 'thumbs'; // tabs
- this.options.hover = false;
-
-
- $.extend(this.options , options);
-
- this.thumbs = [];
- this.index_count = 0;
-
- this.__dimen = this.options.dir === 'h' ? 'width' : 'height';
- this.__alignsize = this.options.dir === 'h' ? 'height' : 'width';
- this.__jdimen = this.options.dir === 'h' ? 'outerWidth' : 'outerHeight';
- this.__pos = this.options.dir === 'h' ? 'left' : 'top';
-
- this.click_enable = true;
-
- };
-
- MSThumblist.extend(BaseControl);
-
- var p = MSThumblist.prototype;
- var _super = BaseControl.prototype;
-
- /* -------------------------------- */
-
- p.setup = function(){
- this.$element = $('<div></div>')
- .addClass(this.options.prefix + 'thumb-list');
-
- if(this.options.type === 'tabs'){
- this.$element.addClass(this.options.prefix + 'tabs');
- }
-
- this.$element.addClass('ms-dir-' + this.options.dir);
-
- _super.setup.call(this);
-
-
- if( this.slider.$controlsCont === this.cont ){
- this.$element.appendTo(this.slider.$element);
- }else{
- this.$element.appendTo(this.cont);
- }
-
- this.$thumbscont = $('<div></div>')
- .addClass('ms-thumbs-cont')
- .appendTo(this.$element);
-
- if(this.options.arrows){
- var that = this;
- this.$fwd = $('<div></div>').addClass('ms-thumblist-fwd').appendTo(this.$element).click(function(){that.controller.push(-15);});
- this.$bwd = $('<div></div>').addClass('ms-thumblist-bwd').appendTo(this.$element).click(function(){that.controller.push(15);});
- }
-
- // align control
- if( !this.options.insetTo && this.options.align ){
- var align = this.options.align;
- if( this.options.inset ){
- this.$element.css(align, this.options.margin );
- }else if( align === 'top' ){
- this.$element.detach().prependTo(this.slider.$element).css({
- 'margin-bottom': this.options.margin,
- 'position': 'relative'
- });
- }else if( align === 'bottom' ){
- this.$element.css({
- 'margin-top': this.options.margin,
- 'position': 'relative'
- });
- }else{
- this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
- this.align();
- }
-
- if( this.options.dir === 'v' ){
- this.$element.width(this.options.width);
- }else{
- this.$element.height(this.options.height);
- }
- }
-
- this.checkHideUnder(); // super method
-
- };
-
- /**
- * calls by "RESERVED_SPACE_CHANGE" realigns the control in slider
- * @since 1.5.7
- */
- p.align = function(event){
- if( this.detached ){
- return;
- }
- var align = this.options.align;
- var pos = this.slider.reserveSpace(align, this.options[this.__alignsize] + this.options.margin * 2);
- this.$element.css(align, -pos - this.options[this.__alignsize] - this.options.margin);
- };
-
- p.slideAction = function(slide){
- var thumb_ele = slide.$element.find('.ms-thumb');
- var that = this;
- var thumb_frame = $('<div></div>')
- .addClass('ms-thumb-frame')
- .append(thumb_ele)
- .append($('<div class="ms-thumb-ol"></div>'))
- .bind(this.options.hover? 'hover' : 'click' , function(){that.changeSlide(thumb_frame);});
-
- if( this.options.align ){
- thumb_frame.width(this.options.width - (this.options.dir === 'v' && this.options.type === 'tabs' ? 12 : 0)) // less arrow size 12px
- .height(this.options.height)
- .css('margin-'+(this.options.dir === 'v' ? 'bottom' : 'right'), this.options.space);
- }
-
- thumb_frame[0].index = this.index_count ++;
-
- this.$thumbscont.append(thumb_frame);
-
- // Added Fillmode support to thumblist
- // @since 1.6.0
- if( this.options.fillMode && thumb_ele.is('img') ){
- var aligner = new window.MSAligner(this.options.fillMode, thumb_frame, thumb_ele);
- thumb_ele[0].aligner = aligner;
- thumb_ele.one('load', function(e){
- var $this = $(this);
- $this[0].aligner.init($this.width(), $this.height());
- $this[0].aligner.align();
- }).each($.jqLoadFix);
- }
-
- if($.browser.msie)
- thumb_ele.on('dragstart', function(event) { event.preventDefault(); }); // disable native dragging
-
- this.thumbs.push(thumb_frame);
- };
-
- p.create = function(){
- _super.create.call(this);
-
- this.__translate_end = window._css3d ? ' translateZ(0px)' : '';
- this.controller = new Controller(0 , 0 , {
- //snapping : true,
- snappingMinSpeed : 2,
- friction : (100 - this.options.speed * 0.5) / 100
- });
-
- this.controller.renderCallback(this.options.dir === 'h'? this._hMove : this._vMove , this);
- //this.controller.snappingCallback(this.__snapUpdate , this);
- //this.controller.snapCompleteCallback(this.__snapCompelet , this);
-
- var that = this;
- this.resize_listener = function(){that.__resize();};
- $(window).bind('resize', this.resize_listener);
-
- this.thumbSize = this.thumbs[0][this.__jdimen](true);
-
- this.setupSwipe();
- this.__resize();
-
- var that = this;
- if(this.options.wheel){
-
- this.wheellistener = function(event){
- var e = window.event || event.orginalEvent || event;
- var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
- that.controller.push(-delta*10);
- return false;
- };
-
- if($.browser.mozilla) this.$element[0].addEventListener('DOMMouseScroll' , this.wheellistener);
- else this.$element.bind('mousewheel', this.wheellistener);
- }
-
- this.slider.api.addEventListener(MSSliderEvent.CHANGE_START , this.update , this);
- this.slider.api.addEventListener(MSSliderEvent.HARD_UPDATE, this.realignThumbs, this);
- this.cindex = this.slider.api.index();
- this.select(this.thumbs[this.cindex]);
-
-
- };
-
- p._hMove = function(controller , value){
- this.__contPos = value;
- if(window._cssanim) {
- this.$thumbscont[0].style[window._jcsspfx + 'Transform'] = 'translateX('+-value+'px)'+ this.__translate_end;
- return;
- }
- this.$thumbscont[0].style.left = -value + 'px';
- };
-
- p._vMove = function(controller , value){
- this.__contPos = value;
- if(window._cssanim) {
- this.$thumbscont[0].style[window._jcsspfx + 'Transform'] = 'translateY('+-value+'px)'+ this.__translate_end;
- return;
- }
- this.$thumbscont[0].style.top = -value + 'px';
- };
-
- p.setupSwipe = function(){
- this.swipeControl = new averta.TouchSwipe(this.$element);
- this.swipeControl.swipeType = this.options.dir === 'h'? 'horizontal' : 'vertical';
-
- var that = this;
- if(this.options.dir === 'h')
- this.swipeControl.onSwipe = function(status){that.horizSwipeMove(status);};
- else
- this.swipeControl.onSwipe = function(status){that.vertSwipeMove(status);};
- };
-
- p.vertSwipeMove = function(status){
- if(this.dTouch) return;
- var phase = status.phase;
- if(phase === 'start')
- this.controller.stop();
- else if(phase === 'move')
- this.controller.drag(status.moveY);
- else if(phase === 'end' || phase === 'cancel'){
- var speed = Math.abs(status.distanceY / status.duration * 50/3);
- if(speed > 0.1){
- this.controller.push(-status.distanceY / status.duration * 50/3 );
- }else{
- this.click_enable = true;
- this.controller.cancel();
- }
- }
- };
-
- p.horizSwipeMove = function(status){
- if(this.dTouch) return;
- var phase = status.phase;
- if(phase === 'start'){
- this.controller.stop();
- this.click_enable = false;
- }else if(phase === 'move')
- this.controller.drag(status.moveX);
- else if(phase === 'end' || phase === 'cancel'){
- var speed = Math.abs(status.distanceX / status.duration * 50/3);
- if(speed > 0.1){
- this.controller.push(-status.distanceX / status.duration * 50/3 );
- }else {
- this.click_enable = true;
- this.controller.cancel();
- }
- }
- };
-
- p.update = function(){
- var nindex = this.slider.api.index();
- if(this.cindex === nindex) return;
-
- if(this.cindex != null)this.unselect(this.thumbs[this.cindex]);
- this.cindex = nindex;
- this.select(this.thumbs[this.cindex]);
-
- if(!this.dTouch)this.updateThumbscroll();
- };
-
- p.realignThumbs = function () {
- this.$element.find('.ms-thumb').each( function (index, thumb) {
- if ( thumb.aligner ) {
- thumb.aligner.align();
- }
- } );
- };
-
- p.updateThumbscroll = function(){
- var thumb_size;
-
- var pos = this.thumbSize * this.cindex;
-
- if(this.controller.value == NaN) this.controller.value = 0;
-
- if(pos - this.controller.value < 0){
- this.controller.gotoSnap(this.cindex , true);
- return;
- }
-
- if(pos + this.thumbSize - this.controller.value > this.$element[this.__dimen]()){
- var first_snap = this.cindex - Math.floor(this.$element[this.__dimen]() / this.thumbSize) + 1;
- this.controller.gotoSnap(first_snap , true);
- return;
- }
- };
-
- p.changeSlide = function(thumb){
- if(!this.click_enable || this.cindex === thumb[0].index) return;
- this.slider.api.gotoSlide(thumb[0].index);
- };
-
- p.unselect = function(ele){
- ele.removeClass('ms-thumb-frame-selected');
- };
-
- p.select = function(ele){
- ele.addClass('ms-thumb-frame-selected');
- };
-
- p.__resize = function(){
- var size = this.$element[this.__dimen]();
-
- if(this.ls === size) return;
-
- this.ls = size;
-
- this.thumbSize = this.thumbs[0][this.__jdimen](true);
- var len = this.slider.api.count() * this.thumbSize;
- this.$thumbscont[0].style[this.__dimen] = len + 'px';
-
- if(len <= size){
- this.dTouch = true;
- this.controller.stop();
- this.$thumbscont[0].style[this.__pos] = (size - len)*.5 + 'px';
- this.$thumbscont[0].style[window._jcsspfx + 'Transform'] = '';
- }else{
- this.dTouch = false;
- this.click_enable = true;
- this.$thumbscont[0].style[this.__pos] = '';
- this.controller._max_value = len - size;
- this.controller.options.snapsize = this.thumbSize;
- this.updateThumbscroll();
- }
-
- };
-
- p.destroy = function(){
- _super.destroy();
-
- if(this.options.wheel){
- if($.browser.mozilla) this.$element[0].removeEventListener('DOMMouseScroll' , this.wheellistener);
- else this.$element.unbind('mousewheel', this.wheellistener);
- this.wheellistener = null;
- }
-
- $(window).unbind('resize', this.resize_listener);
-
- this.$element.remove();
-
- this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
- this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START , this.update , this);
- };
-
- window.MSThumblist = MSThumblist;
- MSSlideController.registerControl('thumblist' , MSThumblist);
-
- })(jQuery);
- /* ================== bin-debug/js/pro/uicontrols/Bullets.js =================== */
- ;(function($){
-
- "use strict";
-
- var MSBulltes = function(options){
- BaseControl.call(this);
-
- this.options.dir = 'h';
- this.options.inset = true;
- this.options.margin = 10;
- this.options.space = 10;
-
-
- $.extend(this.options , options);
-
- this.bullets = [];
-
- };
-
- MSBulltes.extend(BaseControl);
-
- var p = MSBulltes.prototype;
- var _super = BaseControl.prototype;
-
- /* -------------------------------- */
-
- p.setup = function(){
- _super.setup.call(this);
-
- this.$element = $('<div></div>')
- .addClass(this.options.prefix + 'bullets')
- .addClass('ms-dir-' + this.options.dir)
- .appendTo(this.cont);
-
- this.$bullet_cont = $('<div></div>')
- .addClass('ms-bullets-count')
- .appendTo(this.$element);
-
- if( !this.options.insetTo && this.options.align ){
-
- var align = this.options.align;
- if( this.options.inset ){
- this.$element.css(align, this.options.margin);
- }
-
- }
-
- this.checkHideUnder(); // super method
- };
-
- p.create = function(){
- _super.create.call(this);
- var that = this;
-
- this.slider.api.addEventListener(MSSliderEvent.CHANGE_START , this.update , this);
- this.cindex = this.slider.api.index();
- for(var i = 0; i < this.slider.api.count(); ++i){
- var bullet = $('<div></div>').addClass('ms-bullet');
- bullet[0].index = i;
- bullet.on('click', function(){that.changeSlide(this.index);});
- this.$bullet_cont.append(bullet);
- this.bullets.push(bullet);
- if( this.options.dir === 'h' ) {
- bullet.css('margin', this.options.space/2);
- }else {
- bullet.css('margin', this.options.space);
- }
- }
-
- if(this.options.dir === 'h') {
- this.$element.width(bullet.outerWidth(true) * this.slider.api.count());
- } else {
- this.$element.css('margin-top', -this.$element.outerHeight(true)/2);
- }
-
- this.select(this.bullets[this.cindex]);
- };
-
- p.update = function(){
- var nindex = this.slider.api.index();
- if(this.cindex === nindex) return;
-
- if(this.cindex != null)this.unselect(this.bullets[this.cindex]);
- this.cindex = nindex;
- this.select(this.bullets[this.cindex]);
- };
-
- p.changeSlide = function(index){
- if(this.cindex === index) return;
- this.slider.api.gotoSlide(index);
- };
-
- p.unselect = function(ele){
- ele.removeClass('ms-bullet-selected');
- };
-
- p.select = function(ele){
- ele.addClass('ms-bullet-selected');
- };
-
- p.destroy = function(){
- _super.destroy();
- this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START , this.update , this);
- this.$element.remove();
- };
-
- window.MSBulltes = MSBulltes;
-
- MSSlideController.registerControl('bullets' , MSBulltes);
-
- })(jQuery);
- /* ================== bin-debug/js/pro/uicontrols/Scrollbar.js =================== */
- ;(function($){
-
- "use strict";
-
- var MSScrollbar = function(options){
- BaseControl.call(this);
-
- this.options.dir = 'h';
- this.options.autohide = true;
- this.options.width = 4;
- this.options.color = '#3D3D3D';
- this.options.margin = 10;
-
- $.extend(this.options , options);
- this.__dimen = this.options.dir === 'h' ? 'width' : 'height';
- this.__jdimen = this.options.dir === 'h' ? 'outerWidth' : 'outerHeight';
- this.__pos = this.options.dir === 'h' ? 'left' : 'top';
- this.__translate_end = window._css3d ? ' translateZ(0px)' : '';
- this.__translate_start = this.options.dir === 'h' ? ' translateX(' : 'translateY(';
- };
-
- MSScrollbar.extend(BaseControl);
-
- var p = MSScrollbar.prototype;
- var _super = BaseControl.prototype;
-
- /* -------------------------------- */
-
- p.setup = function(){
-
- this.$element = $('<div></div>')
- .addClass(this.options.prefix + 'sbar')
- .addClass('ms-dir-' + this.options.dir);
-
- _super.setup.call(this);
-
- if( this.slider.$controlsCont === this.cont ){
- this.$element.appendTo(this.slider.$element);
- }else{
- this.$element.appendTo(this.cont);
- }
-
- this.$bar = $('<div></div>')
- .addClass(this.options.prefix + 'bar')
- .appendTo(this.$element);
-
- if(this.slider.options.loop){
- console.log('WARNING, MSScrollbar cannot work with looped slider.');
- this.disable = true;
- this.$element.remove();
- }
-
- /**
- * align control
- * @since 1.5.7
- */
- // change width
- if( this.options.dir === 'v' ){
- this.$bar.width(this.options.width);
- } else {
- this.$bar.height(this.options.width);
- }
-
- // change color
- this.$bar.css('background-color', this.options.color);
-
- if( !this.options.insetTo && this.options.align ){
-
- // reset old versions styles
- if( this.options.dir === 'v' ){
- this.$element.css({
- right:'auto',
- left:'auto'
- });
- } else {
- this.$element.css({
- top:'auto',
- bottom:'auto'
- });
- }
-
- var align = this.options.align;
- if( this.options.inset ){
- this.$element.css(align, this.options.margin );
- }else if( align === 'top' ){
- this.$element.prependTo(this.slider.$element).css({
- 'margin-bottom': this.options.margin,
- 'position': 'relative'
- });
- }else if( align === 'bottom' ){
- this.$element.css({
- 'margin-top': this.options.margin,
- 'position': 'relative'
- });
- }else{
- this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
- this.align();
- }
- }
-
- this.checkHideUnder(); // super method
- };
-
- /**
- * calls by "RESERVED_SPACE_CHGANE" realigns the control in slider
- * @since 1.5.7
- */
- p.align = function(event){
- if( this.detached ){
- return;
- }
-
- var align = this.options.align;
- var pos = this.slider.reserveSpace(align, this.options.margin * 2 + this.options.width);
- this.$element.css(align, -pos - this.options.margin - this.options.width);
- };
-
- p.create = function(){
-
- if(this.disable) return;
-
- //_super.create.call(this);
- var that = this;
-
- this.scroller = this.slider.api.scroller;
-
- this.slider.api.view.addEventListener(MSViewEvents.SCROLL , this._update , this);
- this.slider.api.addEventListener(MSSliderEvent.RESIZE , this._resize , this);
-
- this._resize();
-
- if(this.options.autohide){
- this.$bar.css('opacity' , '0');
- }
- };
-
- p._resize = function(){
- this.vdimen = this.$element[this.__dimen]();
- this.bar_dimen = this.slider.api.view[ '__' + this.__dimen] * this.vdimen / this.scroller._max_value;
- this.$bar[this.__dimen](this.bar_dimen );
- };
-
- p._update = function(){
- var value = this.scroller.value * (this.vdimen - this.bar_dimen) / this.scroller._max_value;
- if(this.lvalue === value) return;
- this.lvalue = value;
-
- if(this.options.autohide){
- clearTimeout(this.hto);
- this.$bar.css('opacity' , '1');
-
- var that = this;
- this.hto = setTimeout(function(){
- //if(!that.slider.api.view.swipeControl.touchStarted)
- that.$bar.css('opacity' , '0');
- } , 150);
- }
-
- if(value < 0){
- this.$bar[0].style[this.__dimen] = this.bar_dimen + value + 'px';
- return;
- }
-
- if(value > this.vdimen - this.bar_dimen)
- this.$bar[0].style[this.__dimen] = this.vdimen - value + 'px';
-
- if(window._cssanim) {
- this.$bar[0].style[window._jcsspfx + 'Transform'] = this.__translate_start +value+'px)'+ this.__translate_end;
- return;
- }
-
- this.$bar[0].style[this.__pos] = value + 'px';
-
- };
-
- p.destroy = function(){
- _super.destroy();
- this.slider.api.view.removeEventListener(MSViewEvents.SCROLL , this._update , this);
- this.slider.api.removeEventListener(MSSliderEvent.RESIZE , this._resize , this);
- this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
-
- this.$element.remove();
- };
-
- window.MSScrollbar = MSScrollbar;
- MSSlideController.registerControl('scrollbar' , MSScrollbar);
- })(jQuery);
- /* ================== bin-debug/js/pro/uicontrols/Timebar.js =================== */
- ;(function($){
-
- "use strict";
-
- var MSTimerbar = function(options){
- BaseControl.call(this);
-
- this.options.autohide = false;
- this.options.width = 4;
- this.options.color = '#FFFFFF';
- this.options.inset = true;
- this.options.margin = 0;
-
- $.extend(this.options , options);
- };
-
- MSTimerbar.extend(BaseControl);
-
- var p = MSTimerbar.prototype;
- var _super = BaseControl.prototype;
-
- /* -------------------------------- */
-
- p.setup = function(){
- var that = this;
- _super.setup.call(this);
-
- this.$element = $('<div></div>')
- .addClass(this.options.prefix + 'timerbar');
-
- _super.setup.call(this);
-
- if( this.slider.$controlsCont === this.cont ){
- this.$element.appendTo(this.slider.$element);
- }else{
- this.$element.appendTo(this.cont);
- }
-
- this.$bar = $('<div></div>')
- .addClass('ms-time-bar')
- .appendTo(this.$element);
-
- // change width
- if( this.options.dir === 'v' ){
- this.$bar.width(this.options.width);
- this.$element.width(this.options.width);
- } else {
- this.$bar.height(this.options.width);
- this.$element.height(this.options.width);
- }
-
- // change color
- this.$bar.css('background-color', this.options.color);
-
- if( !this.options.insetTo && this.options.align ){
-
- this.$element.css({
- top:'auto',
- bottom:'auto'
- });
-
- var align = this.options.align;
- if( this.options.inset ){
- this.$element.css(align, this.options.margin );
- }else if( align === 'top' ){
- this.$element.prependTo(this.slider.$element).css({
- 'margin-bottom': this.options.margin,
- 'position': 'relative'
- });
- }else if( align === 'bottom' ){
- this.$element.css({
- 'margin-top': this.options.margin,
- 'position': 'relative'
- });
- }else{
- this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
- this.align();
- }
- }
-
- this.checkHideUnder(); // super method
-
- };
-
- /**
- * calls by "RESERVED_SPACE_CHGANE" realigns the control in slider
- * @since 1.5.7
- */
- p.align = function(event){
- if( this.detached ){
- return;
- }
-
- var align = this.options.align;
- var pos = this.slider.reserveSpace(align, this.options.margin * 2 + this.options.width);
- this.$element.css(align, -pos - this.options.margin - this.options.width);
- };
-
- p.create = function(){
- _super.create.call(this);
- this.slider.api.addEventListener(MSSliderEvent.WAITING , this._update , this);
- this._update();
- };
-
- p._update = function(){
- this.$bar[0].style.width = this.slider.api._delayProgress + '%';
- };
-
- p.destroy = function(){
- _super.destroy();
- this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
- this.slider.api.removeEventListener(MSSliderEvent.WAITING , this._update , this);
- this.$element.remove();
- };
-
- window.MSTimerbar = MSTimerbar;
- MSSlideController.registerControl('timebar' , MSTimerbar);
- })(jQuery);
- /* ================== bin-debug/js/pro/uicontrols/CircleTimer.js =================== */
- ;(function($){
-
- "use strict";
-
- var MSCircleTimer = function(options){
- BaseControl.call(this);
-
- this.options.color = '#A2A2A2';
- this.options.stroke = 10;
- this.options.radius = 4;
-
- this.options.autohide = false;
- $.extend(this.options , options);
- };
-
- MSCircleTimer.extend(BaseControl);
-
- var p = MSCircleTimer.prototype;
- var _super = BaseControl.prototype;
-
- /* -------------------------------- */
-
- p.setup = function(){
- var that = this;
- _super.setup.call(this);
-
- this.$element = $('<div></div>')
- .addClass(this.options.prefix + 'ctimer')
- .appendTo(this.cont);
-
- this.$canvas = $('<canvas></canvas>')
- .addClass('ms-ctimer-canvas')
- .appendTo(this.$element);
-
- this.$bar = $('<div></div>')
- .addClass('ms-ctimer-bullet')
- .appendTo(this.$element);
-
- if(!this.$canvas[0].getContext){
- this.destroy();
- this.disable = true;
- return;
- }
-
-
- this.ctx = this.$canvas[0].getContext('2d');
- this.prog = 0;
-
- this.__w = (this.options.radius + this.options.stroke/2) * 2;
- this.$canvas[0].width = this.__w;
- this.$canvas[0].height = this.__w;
-
- this.checkHideUnder(); // super method
- };
-
- p.create = function(){
- if(this.disable) return;
- _super.create.call(this);
- this.slider.api.addEventListener(MSSliderEvent.WAITING , this._update , this);
-
- var that = this;
- this.$element.click(function(){
- if(that.slider.api.paused)
- that.slider.api.resume();
- else
- that.slider.api.pause();
- });
-
- this._update();
- };
-
- p._update = function(){
- var that = this;
- $(this).stop(true).animate({prog:this.slider.api._delayProgress * 0.01} ,
- {duration:200 , step:function(){that._draw();}});
- //this.$bar[0].style.width = this.slider.api._delayProgress/100 * this.$element.width() + 'px';
- };
-
- p._draw = function(){
- this.ctx.clearRect(0 , 0, this.__w , this.__w);
- this.ctx.beginPath();
- this.ctx.arc(this.__w * .5 , this.__w * .5 ,this.options.radius , Math.PI * 1.5 , Math.PI * 1.5 + 2 * Math.PI * this.prog, false);
- this.ctx.strokeStyle = this.options.color;
- this.ctx.lineWidth = this.options.stroke;
- this.ctx.stroke();
- };
-
- p.destroy = function(){
- _super.destroy();
- if(this.disable) return;
- $(this).stop(true);
- this.slider.api.removeEventListener(MSSliderEvent.WAITING , this._update , this);
- this.$element.remove();
- };
-
- window.MSCircleTimer = MSCircleTimer;
- MSSlideController.registerControl('circletimer' , MSCircleTimer);
- })(jQuery);
- /* ================== bin-debug/js/pro/uicontrols/Lightbox.js =================== */
- ;(function($){
-
- "use strict";
-
- window.MSLightbox = function(options){
- BaseControl.call(this , options);
-
- this.options.autohide = false;
- $.extend(this.options , options);
-
- this.data_list = [];
- };
- MSLightbox.fadeDuratation = 400;
- MSLightbox.extend(BaseControl);
-
- var p = MSLightbox.prototype;
- var _super = BaseControl.prototype;
-
- /* -------------------------------- */
- p.setup = function(){
- _super.setup.call(this);
-
- this.$element = $('<div></div>')
- .addClass(this.options.prefix + 'lightbox-btn')
- .appendTo(this.cont);
-
- this.checkHideUnder(); // super method
- };
-
- p.slideAction = function(slide){
- $('<div></div>')
- .addClass(this.options.prefix + 'lightbox-btn')
- .appendTo(slide.$element)
- .append($(slide.$element.find('.ms-lightbox')));
-
- };
-
- p.create = function(){
- _super.create.call(this);
-
- };
-
-
- MSSlideController.registerControl('lightbox' , MSLightbox);
- })(jQuery);
- /* ================== bin-debug/js/pro/uicontrols/SlideInfo.js =================== */
- ;(function($){
-
- "use strict";
-
- window.MSSlideInfo = function(options){
- BaseControl.call(this , options);
-
- this.options.autohide = false;
- this.options.align = null;
- this.options.inset = false;
- this.options.margin = 10;
- this.options.size = 100;
- this.options.dir = 'h';
-
- $.extend(this.options , options);
-
- this.data_list = [];
- };
- MSSlideInfo.fadeDuratation = 400;
- MSSlideInfo.extend(BaseControl);
-
- var p = MSSlideInfo.prototype;
- var _super = BaseControl.prototype;
-
- /* -------------------------------- */
- p.setup = function(){
- this.$element = $('<div></div>')
- .addClass(this.options.prefix + 'slide-info')
- .addClass('ms-dir-' + this.options.dir);
-
- _super.setup.call(this);
-
- if( this.slider.$controlsCont === this.cont ){
- this.$element.appendTo(this.slider.$element); // insert in outer container out of overflow hidden
- }else{
- this.$element.appendTo(this.cont);
- }
-
- // align control
- if( !this.options.insetTo && this.options.align ){
- var align = this.options.align;
- if( this.options.inset ){
- this.$element.css(align, this.options.margin );
- }else if( align === 'top' ){
- this.$element.prependTo(this.slider.$element).css({
- 'margin-bottom': this.options.margin,
- 'position': 'relative'
- });
- }else if( align === 'bottom' ){
- this.$element.css({
- 'margin-top': this.options.margin,
- 'position': 'relative'
- });
- }else{
- this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
- this.align();
- }
-
- if( this.options.dir === 'v' ){
- this.$element.width(this.options.size);
- }else{
- this.$element.css('min-height', this.options.size);
- }
- }
-
- this.checkHideUnder(); // super method
- };
-
- /**
- * calls by "RESERVED_SPACE_CHGANE" realigns the control in slider
- * @since 1.5.7
- */
- p.align = function(event){
- if( this.detached ){
- return;
- }
- var align = this.options.align;
- var pos = this.slider.reserveSpace(align, this.options.size + this.options.margin * 2);
- this.$element.css(align, -pos - this.options.size - this.options.margin);
- };
-
- p.slideAction = function(slide){
- var info_ele = $(slide.$element.find('.ms-info'));
- var that = this;
- info_ele.detach();
-
- this.data_list[slide.index] = info_ele;
- };
-
- p.create = function(){
- _super.create.call(this);
- this.slider.api.addEventListener(MSSliderEvent.CHANGE_START , this.update , this);
- this.cindex = this.slider.api.index();
- this.switchEle(this.data_list[this.cindex]);
- };
-
- p.update = function(){
- var nindex = this.slider.api.index();
- this.switchEle(this.data_list[nindex]);
- this.cindex = nindex;
- };
-
- p.switchEle = function(ele){
- if(this.current_ele){
- var that = this;
-
- if(this.current_ele[0].tween)this.current_ele[0].tween.stop(true);
- this.current_ele[0].tween = CTween.animate(this.current_ele , MSSlideInfo.fadeDuratation , {opacity:0} , {complete:function(){
- this.detach();
- this[0].tween = null;
- ele.css('position', 'relative');
- } , target:this.current_ele });
-
- //this.current_ele.css('position', 'absolute');
- ele.css('position', 'absolute');
- }
-
- this.__show(ele);
- };
-
- p.__show = function(ele){
- ele.appendTo(this.$element).css('opacity','0');///.css('position', 'relative');
-
- // calculate max height
- if ( this.current_ele ){
- ele.height( Math.max( ele.height(), this.current_ele.height() ) );
- }
-
- clearTimeout(this.tou);
- this.tou = setTimeout(function(){
- CTween.fadeIn(ele , MSSlideInfo.fadeDuratation );
- ele.css('height', '');
- }, MSSlideInfo.fadeDuratation);
-
-
- if(ele[0].tween)ele[0].tween.stop(true);
- this.current_ele = ele;
- };
-
- p.destroy = function(){
- _super.destroy();
- clearTimeout(this.tou);
- if(this.current_ele && this.current_ele[0].tween){
- this.current_ele[0].tween.stop('true');
- }
- this.$element.remove();
- this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
- this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START , this.update , this);
- };
-
- MSSlideController.registerControl('slideinfo' , MSSlideInfo);
- })(jQuery);
- /* ================== bin-debug/js/pro/plugins/MSGallery.js =================== */
- /**
- * Master Slider, Gallery Template v1.0
- * @author: Averta Ltd.
- */
-
- ;(function($){
-
- window.MSGallery = function(id , slider){
- this.id = id;
- this.slider = slider;
-
- this.telement = $('#'+id);
-
- this.botcont = $('<div></div>').addClass('ms-gallery-botcont').appendTo(this.telement);
- this.thumbcont = $('<div></div>').addClass('ms-gal-thumbcont hide-thumbs').appendTo(this.botcont);
- this.playbtn = $('<div></div>').addClass('ms-gal-playbtn').appendTo(this.botcont);
- this.thumbtoggle = $('<div></div>').addClass('ms-gal-thumbtoggle').appendTo(this.botcont);
-
- // adds required controls to slider
- slider.control('thumblist' , {insertTo:this.thumbcont , autohide:false , dir:'h'});
- slider.control('slidenum' , {insertTo:this.botcont , autohide:false});
- slider.control('slideinfo' , {insertTo:this.botcont , autohide:false});
- slider.control('timebar' , {insertTo:this.botcont , autohide:false});
- slider.control('bullets' , {insertTo:this.botcont , autohide:false});
- };
-
- var p = MSGallery.prototype;
-
- p._init = function(){
- var that = this;
-
- if(!this.slider.api.paused)
- this.playbtn.addClass('btn-pause');
-
- this.playbtn.click(function(){
- if(that.slider.api.paused){
- that.slider.api.resume();
- that.playbtn.addClass('btn-pause');
- }else{
- that.slider.api.pause();
- that.playbtn.removeClass('btn-pause');
- }
- });
-
-
- this.thumbtoggle.click(function(){
-
- if(that.vthumbs){
- //that.hideThumbs();
- that.thumbtoggle.removeClass('btn-hide');
- that.vthumbs = false;
- that.thumbcont.addClass('hide-thumbs');
- }else{
- //that.showThumbs();
- that.thumbtoggle.addClass('btn-hide');
- that.thumbcont.removeClass('hide-thumbs');
- that.vthumbs = true;
- }
- });
-
- };
-
- p.setup = function(){
- var that = this;
- $(document).ready(function(){that._init();});
- };
-
-
- })(jQuery);
- /* ================== bin-debug/js/pro/plugins/MSFlickrV2.js =================== */
- /**
- * Master Slider Flickr Plugin Version 2
- * @version 2.0.0
- * @author Averta Ltd.
- */
- ;(function($){
-
- /**
- * Generate Flickr photoset url
- * @param {String} key api key
- * @param {String} id photoset id
- * @param {Number} count number of images
- * @return {String}
- */
- var getPhotosetURL = function(key , id , count){
- return 'https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=' + key + '&photoset_id='+ id +'&per_page='+ count +'&extras=url_o,description,date_taken,owner_name,views&format=json&jsoncallback=?';
- };
-
- /**
- * Generate Flickr user public images url
- * @param {String} key api key
- * @param {String} id user id
- * @param {Number} count number of images
- * @return {String}
- */
- var getUserPublicURL = function(key , id , count){
- return 'https://api.flickr.com/services/rest/?&method=flickr.people.getPublicPhotos&api_key=' + key + '&user_id='+ id +'&per_page='+ count +'&extras=url_o,description,date_taken,owner_name,views&format=json&jsoncallback=?';
- };
-
- /**
- * Generates image path
- * @param {String} fid
- * @param {String} server
- * @param {String} id
- * @param {String} secret
- * @param {String} size
- * @return {String}
- */
- var getImageSource = function(fid , server , id , secret , size, data){
- if ( size === '_o' && data ) {
- return data.url_o;
- }
-
- return 'https://farm' + fid + '.staticflickr.com/'+ server + '/' + id + '_' + secret + size + '.jpg';
- };
-
- window.MSFlickrV2 = function(slider,options){
- var _options = {
- count :10,
- type :'photoset',
- /*
- * s small square 75x75
- * q large square 150x150
- * t thumbnail, 100 on longest side
- */
- thumbSize :'q',
-
- /*
- * - medium, 500 on longest side
- * z medium 640, 640 on longest side
- * c medium 800, 800 on longest side
- * b large, 1024 on longest side
- * o original image, either a jpg, gif or png, depending on source format
- */
- imgSize : 'c'
- };
-
- this.slider = slider;
- this.slider.holdOn();
-
- if( !options.key ){
- this.errMsg('Flickr API Key required. Please add it in settings.');
- return;
- }
-
- $.extend(_options , options);
- this.options = _options;
-
- var that = this;
-
- if(this.options.type === 'photoset'){
- $.getJSON(getPhotosetURL(this.options.key , this.options.id , this.options.count) , function(data){
- that._photosData(data);
- });
- }else{
- $.getJSON(getUserPublicURL(this.options.key , this.options.id , this.options.count) , function(data){
- that.options.type = 'photos';
- that._photosData(data);
- });
- }
-
- if(this.options.imgSize !== '' && this.options.imgSize !== '-')
- this.options.imgSize = '_' + this.options.imgSize;
-
- this.options.thumbSize = '_' + this.options.thumbSize;
-
- // grab slide template from slider markup
- this.slideTemplate = this.slider.$element.find('.ms-slide')[0].outerHTML;
- this.slider.$element.find('.ms-slide').remove(); // remove all slides from slider markup
- };
-
- var p = MSFlickrV2.prototype;
-
- p._photosData = function(data){
-
- if(data.stat === 'fail'){
- this.errMsg('Flickr API ERROR#' + data.code + ': ' + data.message);
- return;
- }
-
- var that = this;
- var getInfo = this.options.author || this.options.desc;
- $.each(data[this.options.type].photo, function(i,item){
-
- var slide_cont = that.slideTemplate.replace(/{{[\w-]+}}/g, function(match){
- match = match.replace(/{{|}}/g, '');
- if( shortCodes[match] ) {
- return shortCodes[match](item, that);
- } else {
- return '{{'+match+'}}';
- }
-
- });
-
- $(slide_cont).appendTo(that.slider.$element);
-
- });
-
- that._initSlider();
- };
-
- p.errMsg = function(msg){
- this.slider.$element.css('display', 'block');
- if(!this.errEle)
- this.errEle = $('<div style="font-family:Arial; color:red; font-size:12px; position:absolute; top:10px; left:10px"></div>').appendTo(this.slider.$loading);
-
- this.errEle.html(msg);
- };
-
- p._initSlider = function(){
- this.slider.release();
- };
-
- // a list of functions that generates data from short codes
- var shortCodes = {
- 'image': function(data, that){
- return getImageSource(data.farm , data.server , data.id , data.secret , that.options.imgSize, data);
- },
-
- 'thumb': function(data, that){
- return getImageSource(data.farm , data.server , data.id , data.secret , that.options.thumbSize);
- },
-
- 'title': function(data, that){
- return data.title;
- },
-
- 'owner-name': function(data, that){
- return data.ownername;
- },
-
- 'date-taken': function(data, that){
- return data.datetaken;
- },
-
- 'views': function(data, that){
- return data.views;
- },
-
- 'description': function(data, that){
- return data.description._content;
- }
- };
-
- })(jQuery);
- /* ================== bin-debug/js/pro/plugins/MSFacebookGallery.js =================== */
- /**
- * Master Slider Facebook Gallery plugin
- * @author Averta Ltd.
- * @version 1.0.0
- */
- ;(function($){
- window.MSFacebookGallery = function(slider, options){
- var _options = {
- count :10,
- type :'photostream', // album
- /*
- orginal/960/720/600/480/320/130
- */
- thumbSize :'320',
- /*
- orginal/960/720/600/480/320/130
- */
- imgSize : 'orginal',
- https: false,
- token: ''
- };
- this.slider = slider;
- this.slider.holdOn();
- $.extend(_options , options);
- this.options = _options;
- //this.graph = this.options.https ? 'https://graph.facebook.com' : 'http://graph.facebook.com';
- this.graph = 'https://graph.facebook.com';
- var that = this;
- if(this.options.type === 'photostream'){
- $.getJSON(this.graph + '/' + this.options.username + '/photos/uploaded/?fields=source,name,link,images,from&limit=' + this.options.count + '&access_token=' + this.options.token , function(data){
- that._photosData(data);
- });
- }else{
- $.getJSON(this.graph + '/' + this.options.albumId + '/photos?fields=source,name,link,images,from&limit=' + this.options.count + '&access_token=' + this.options.token , function(data){
- that._photosData(data);
- });
- }
- // grab slide template from slider markup
- this.slideTemplate = this.slider.$element.find('.ms-slide')[0].outerHTML;
- this.slider.$element.find('.ms-slide').remove(); // remove all slides from slider markup
- };
- var p = MSFacebookGallery.prototype;
- p._photosData = function(content){
- if(content.error){
- this.errMsg('Facebook API ERROR#' + content.error.code + '(' + content.error.type + ')' + ': ' + content.error.message);
- return;
- }
- var that = this;
- var getInfo = this.options.author || this.options.desc;
- for(var i=0,l=content.data.length;i!==l;i++){
- var slide_cont = that.slideTemplate.replace(/{{[\w-]+}}/g, function(match){
- match = match.replace(/{{|}}/g, '');
- if( shortCodes[match] ) {
- return shortCodes[match](content.data[i], that);
- } else {
- return '{{'+match+'}}';
- }
- });
- $(slide_cont).appendTo(that.slider.$element);
- }
- that._initSlider();
- };
- p.errMsg = function(msg){
- this.slider.$element.css('display', 'block');
- if(!this.errEle)
- this.errEle = $('<div style="font-family:Arial; color:red; font-size:12px; position:absolute; top:10px; left:10px"></div>').appendTo(this.slider.$loading);
- this.errEle.html(msg);
- };
- p._initSlider = function(){
- this.slider.release();
- };
- var getImageSource = function(images, size){
- if( size === 'orginal' ) {
- return images[0].source;
- }
- for(var i = 0, l = images.length; i !== l; i++){
- if( images[i].source.indexOf(size + 'x' + size) !== -1 )
- return images[i].source;
- }
- // console.log(images)
- return images[0].source;
- };
- // a list of functions that generates data from short codes
- var shortCodes = {
- 'image': function(data, that){
- return getImageSource(data.images, that.options.imgSize);
- },
- 'thumb': function(data, that){
- return getImageSource(data.images, that.options.thumbSize);
- },
- 'name': function(data, that){
- return data.name;
- },
- 'owner-name': function(data, that){
- return data.from.name;
- },
- 'link': function(data, that){
- return data.link;
- }
- };
- })(jQuery);
- /* ================== bin-debug/js/pro/plugins/MSScrollParallax.js =================== */
- /**
- * Master Slider Parallax Layers Fade
- * @description Moves and fades layers of current slide while scrolling window.
- * @package MasterSlider
- * @author Averta
- * @since v1.8.0
- */
-
- (function($){
-
- 'use strict';
-
- window.MSScrollParallax = function (slider, parallax, bgparallax, fade) {
- this.fade = fade;
- this.slider = slider;
- this.parallax = parallax/100;
- this.bgparallax = bgparallax/100;
-
- slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
- slider.api.addEventListener(MSSliderEvent.DESTROY, this.destory, this);
- slider.api.addEventListener(MSSliderEvent.CHANGE_END, this.resetLayers, this);
- slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.updateCurrentSlide, this);
- };
-
- window.MSScrollParallax.setup = function(slider, parallax, bgparallax, fade){
- // disable in mobile devices
- if ( window._mobile ) {
- return;
- }
-
- if( parallax == null ) {
- parallax = 50;
- }
-
- if( bgparallax == null ){
- bgparallax = 40;
- }
-
- return new MSScrollParallax(slider, parallax, bgparallax, fade);
- };
-
- var p = window.MSScrollParallax.prototype;
-
- p.init = function (e) {
- this.slider.$element.addClass('ms-scroll-parallax');
- this.sliderOffset = this.slider.$element.offset().top;
- this.updateCurrentSlide();
- // wrap layers element
- var slides = this.slider.api.view.slideList,
- slide;
- for(var i = 0, l = slides.length; i!==l ; i++) {
- slide = slides[i];
- if( slide.hasLayers ) {
- slide.layerController.$layers.wrap('<div class="ms-scroll-parallax-cont"></div>');
- slide.$scrollParallaxCont = slide.layerController.$layers.parent();
- }
- }
-
- $(window).on('scroll', {that:this}, this.moveParallax).trigger('scroll');
- };
-
- p.resetLayers = function (e) {
- if( !this.lastSlide ) {
- return;
- }
-
- var layers = this.lastSlide.$scrollParallaxCont;
-
- if ( window._css2d ) {
- if( layers ){
- layers[0].style[window._jcsspfx + 'Transform'] = '';
- }
-
- if ( this.lastSlide.hasBG ) {
- this.lastSlide.$imgcont[0].style[window._jcsspfx + 'Transform'] = '';
- }
-
- } else {
- if( layers ){
- layers[0].style.top = '';
- }
-
- if ( this.lastSlide.hasBG ) {
- this.lastSlide.$imgcont[0].style.top = '0px';
- }
- }
- };
-
- p.updateCurrentSlide = function (e) {
- this.lastSlide = this.currentSlide;
-
- this.currentSlide = this.slider.api.currentSlide;
- this.moveParallax({data:{that:this}});
- };
-
- p.moveParallax = function (e) {
- var that = e.data.that,
- slider = that.slider,
- offset = that.sliderOffset,
- scrollTop = $(window).scrollTop(),
- layers = that.currentSlide.$scrollParallaxCont,
- out = offset - scrollTop;
-
- if( out <= 0 ) {
-
- if( layers ){
- if ( window._css3d ) {
- layers[0].style[window._jcsspfx + 'Transform'] = 'translateY(' + -out * that.parallax + 'px) translateZ(0.4px)';
- } else if ( window._css2d ){
- layers[0].style[window._jcsspfx + 'Transform'] = 'translateY(' + -out * that.parallax + 'px)';
- } else {
- layers[0].style.top = -out * that.parallax + 'px';
- }
- }
-
- that.updateSlidesBG(-out * that.bgparallax + 'px', true);
-
- if ( layers && that.fade ) {
- layers.css('opacity', (1 - Math.min(1, -out / slider.api.height)) );
- }
-
- } else {
- if( layers ){
- if ( window._css2d ) {
- layers[0].style[window._jcsspfx + 'Transform'] = '';
- } else {
- layers[0].style.top = '';
- }
- }
-
- that.updateSlidesBG('0px', false);
-
- if ( layers && that.fade ) {
- layers.css('opacity', 1 );
- }
-
- }
-
- };
-
- p.updateSlidesBG = function(pos, fixed) {
- var slides = this.slider.api.view.slideList,
- position = ( fixed && !$.browser.msie && !$.browser.opera ? 'fixed' : '');
-
- for(var i = 0, l = slides.length; i!==l ; i++) {
- if ( slides[i].hasBG ) {
- slides[i].$imgcont[0].style.position = position;
- slides[i].$imgcont[0].style.top = pos;
- }
-
- if ( slides[i].$bgvideocont ){
- slides[i].$bgvideocont[0].style.position = position;
- slides[i].$bgvideocont[0].style.top = pos;
- }
- }
-
- };
-
- p.destory = function () {
- slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this);
- slider.api.removeEventListener(MSSliderEvent.DESTROY, this.destory, this);
- slider.api.removeEventListener(MSSliderEvent.CHANGE_END, this.resetLayers, this);
- slider.api.removeEventListener(MSSliderEvent.CHANGE_START, this.updateCurrentSlide, this);
- $(window).off('scroll', this.moveParallax);
- };
-
- })(jQuery);
- /* ================== bin-debug/js/pro/plugins/MSKeyboardNav.js =================== */
- /**
- * Keyboard navigation plugin for Master Slider.
- * @version 1.0.0
- * @author Averta
- * @package MasterSlider jQuery
- */
- ;(function($, document, window){
- var PId = 0;
- // check if master slider is available
- if ( !window.MasterSlider ) {
- return;
- }
- var KeyboardNav = function ( slider ) {
- this.slider = slider;
- this.PId = PId++;
- if ( this.slider.options.keyboard ) {
- slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
- }
- };
- KeyboardNav.name = 'MSKeyboardNav';
- var p = KeyboardNav.prototype;
- /**
- * initiate the plugin
- */
- p.init = function (){
- var api = this.slider.api;
- $(document).on('keydown.kbnav' + this.PId , function(event){
- var which = event.which;
- if ( which === 37 || which === 40 ) {
- api.previous(true);
- } else if ( which === 38 || which === 39 ) {
- api.next(true);
- }
- });
- };
- /**
- * destroy the plugin
- */
- p.destroy = function(){
- $(document).off('keydown.kbnav' + this.PId);
- this.slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this);
- };
- // install plugin to master slider
- MasterSlider.registerPlugin( KeyboardNav );
- })(jQuery, document, window);
- /* ================== bin-debug/js/pro/plugins/MSStartOnAppear.js =================== */
- /**
- * Start on appear plugin for Master Slider.
- *
- * @description This plugin prevents slider automatically initialization and inits slider when it appears inside of the browser window.
- * @version 1.0.0
- * @author Averta
- * @package MasterSlider jQuery
- */
- ;(function($, document, window){
- var PId = 0,
- $window = $(window),
- $doc = $(document);
- // check if master slider is available
- if ( !window.MasterSlider ) {
- return;
- }
- var StartOnAppear = function ( slider ) {
- this.PId = PId++;
- this.slider = slider;
- this.$slider = slider.$element;
-
- if ( this.slider.options.startOnAppear ) {
- // hold on slider
- slider.holdOn();
- $doc.ready($.proxy(this.init, this));
- }
- };
- StartOnAppear.name = 'MSStartOnAppear';
- var p = StartOnAppear.prototype;
- /**
- * initiate the plugin
- */
- p.init = function (){
- var api = this.slider.api;
- $window.on('scroll.soa' + this.PId , $.proxy(this._onScroll, this)).trigger('scroll');
- };
- p._onScroll = function () {
- // check slider position
- var vpBottom = $window.scrollTop() + $window.height(),
- top = this.$slider.offset().top ;
- if ( top < vpBottom ) {
- $window.off('scroll.soa' + this.PId);
- this.slider.release();
- }
- };
- /**
- * destroy the plugin
- */
- p.destroy = function(){};
- // install plugin to master slider
- MasterSlider.registerPlugin( StartOnAppear );
- })(jQuery, document, window);
- /* ================== bin-debug/js/pro/plugins/MSFilters.js =================== */
- /**
- * Master Slider Filters Plugin
- * This plugin adds CSS3 filters to the slides, like brightness, grayscale, sepia, ... It works in major browser and devices but in IE `opacity` only supported.
- *
- * @package Master Slider jQuery
- * @author Averta
- * @version 1.0.0a
- */
- ;(function (document, window, jQuery){
- var filterUnits = {
- 'hue-rotate' : 'deg',
- 'blur' : 'px'
- }, initialValues = {
- 'opacity' : 1,
- 'contrast' : 1,
- 'brightness' : 1,
- 'saturate' : 1,
- 'hue-rotate' : 0,
- 'invert' : 0,
- 'sepia' : 0,
- 'blur' : 0,
- 'grayscale' : 0
- }
- // check if master slider is available
- if ( !window.MasterSlider ) {
- return;
- }
- var Filters = function ( slider ) {
- this.slider = slider;
- if ( this.slider.options.filters ) {
- slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
- }
- };
- Filters.name = 'MSFilters';
- var p = Filters.prototype;
- /**
- * initiate the plugin
- */
- p.init = function (){
- var api = this.slider.api,
- view = api.view;
- this.filters = this.slider.options.filters;
- this.slideList = view.slideList;
- this.slidesCount = view.slidesCount;
- this.dimension = view[view.__dimension];
- this.target = this.slider.options.filterTarget === 'slide' ? '$element' : '$bg_img';
- this.filterName = $.browser.webkit ? 'WebkitFilter' : 'filter';
- // override controller update callback
- var superFun = view.controller.__renderHook.fun,
- superRef = view.controller.__renderHook.ref;
- view.controller.renderCallback( function (controller, value) {
- superFun.call(superRef, controller, value);
- this.applyEffect(value);
- } , this);
- this.applyEffect(view.controller.value);
- };
- /**
- * Apply css effect to slides based on slide position.
- * @param {Number} value Current position of slider controller
- */
- p.applyEffect = function (value) {
- var factor, slide;
- for( var i = 0; i < this.slidesCount; ++i ) {
- slide = this.slideList[i];
- factor = Math.min(1 , Math.abs(value - slide.position) / this.dimension);
-
- if ( slide[this.target] ) {
- if ( !$.browser.msie ) {
- slide[this.target][0].style[this.filterName] = this.generateStyle(factor);
- } else if ( this.filters.opacity != null ) {
- slide[this.target].opacity( 1 - this.filters.opacity * factor);
- }
- }
- }
- };
- /**
- * Generate filter style based on slide distance factor
- * @param {Number} factor
- * @return {String} CSS style
- */
- p.generateStyle = function (factor) {
- var style = '',
- unit;
- for ( var filter in this.filters ) {
- unit = filterUnits[filter] || '';
- style += filter + '(' + ( initialValues[filter] + (this.filters[filter] - initialValues[filter]) * factor) + ') ';
- }
- return style;
- };
- /**
- * destroy the plugin
- */
- p.destroy = function(){
- this.slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this);
- };
- // install plugin to master slider
- MasterSlider.registerPlugin( Filters );
- })(document, window, jQuery);
- /* ================== bin-debug/js/pro/plugins/MSScrollToAction.js =================== */
- /**
- * Master Slider Scroll To Action Plugin.
- *
- * @description This plugins adds page scrolling actions to the layer actions list.
- * @version 1.0.0
- * @author Averta
- * @package MasterSlider jQuery
- */
- ;(function($, document, window){
- // check if master slider is available
- if ( !window.MasterSlider ) {
- return;
- }
- var ScrollToAction = function ( slider ) {
- this.slider = slider;
- slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
- };
- ScrollToAction.name = 'MSScrollToAction';
- var p = ScrollToAction.prototype;
- /**
- * initiate the plugin
- */
- p.init = function (){
- var api = this.slider.api;
-
- // define actions
- api.scrollToEnd = _scrollToEnd;
- api.scrollTo = _scrollTo;
- };
- /**
- * destroy the plugin
- */
- p.destroy = function(){};
- /**
- * Scroll window to the target element in page
- * @param {Number} duration animation duration (seconds)
- */
- var _scrollTo = function ( target, duration ) {
- var sliderEle = this.slider.$element,
- target = $(target).eq(0);
- if ( target.length === 0 ) {
- return;
- }
- console.log(target.offset().top, duration )
- if( duration == null ) {
- duration = 1.4;
- }
- $('html, body').animate({
- scrollTop: target.offset().top
- }, duration * 1000, 'easeInOutQuad');
- };
- /**
- * Scroll window to the bottom of slider
- * @param {Number} duration animation duration (seconds)
- */
- var _scrollToEnd = function ( duration ) {
- var sliderEle = this.slider.$element;
- if( duration == null ) {
- duration = 1.4;
- }
- $('html, body').animate({
- scrollTop: sliderEle.offset().top + sliderEle.outerHeight(false)
- }, duration * 1000, 'easeInOutQuad');
- }
- // install plugin to master slider
- MasterSlider.registerPlugin( ScrollToAction );
- })(jQuery, document, window);
|