Keine Beschreibung

masterslider.js 244KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197
  1. /*!
  2. * Master Slider – Responsive Touch Swipe Slider
  3. * Copyright © 2015 All Rights Reserved.
  4. *
  5. * @author Averta [www.averta.net]
  6. * @version 2.15.1
  7. * @date Jul 2015
  8. */
  9. /* ================== bin-debug/js/pro/tools/base.js =================== */
  10. window.averta = {};
  11. ;(function($){
  12. //"use strict";
  13. window.package = function(name){
  14. if(!window[name]) window[name] = {};
  15. };
  16. var extend = function(target , object){
  17. for(var key in object) target[key] = object[key];
  18. };
  19. Function.prototype.extend = function(superclass){
  20. if(typeof superclass.prototype.constructor === "function"){
  21. extend(this.prototype , superclass.prototype);
  22. this.prototype.constructor = this;
  23. }else{
  24. this.prototype.extend(superclass);
  25. this.prototype.constructor = this;
  26. }
  27. };
  28. // Converts JS prefix to CSS prefix
  29. var trans = {
  30. 'Moz' : '-moz-',
  31. 'Webkit' : '-webkit-',
  32. 'Khtml' : '-khtml-' ,
  33. 'O' : '-o-',
  34. 'ms' : '-ms-',
  35. 'Icab' : '-icab-'
  36. };
  37. window._mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
  38. window._touch = 'ontouchstart' in document;
  39. $(document).ready(function(){
  40. window._jcsspfx = getVendorPrefix(); // JS CSS VendorPrefix
  41. window._csspfx = trans[window._jcsspfx]; // CSS VendorPrefix
  42. window._cssanim = supportsTransitions();
  43. window._css3d = supports3DTransforms();
  44. window._css2d = supportsTransforms();
  45. });
  46. // Thanks to LEA VEROU
  47. // http://lea.verou.me/2009/02/find-the-vendor-prefix-of-the-current-browser/
  48. function getVendorPrefix() {
  49. if('result' in arguments.callee) return arguments.callee.result;
  50. var regex = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/;
  51. var someScript = document.getElementsByTagName('script')[0];
  52. for(var prop in someScript.style){
  53. if(regex.test(prop)){
  54. return arguments.callee.result = prop.match(regex)[0];
  55. }
  56. }
  57. if('WebkitOpacity' in someScript.style) return arguments.callee.result = 'Webkit';
  58. if('KhtmlOpacity' in someScript.style) return arguments.callee.result = 'Khtml';
  59. return arguments.callee.result = '';
  60. }
  61. // Thanks to Steven Benner.
  62. // http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/
  63. window.parseQueryString = function(url){
  64. var queryString = {};
  65. url.replace(
  66. new RegExp("([^?=&]+)(=([^&]*))?", "g"),
  67. function($0, $1, $2, $3) { queryString[$1] = $3; }
  68. );
  69. return queryString;
  70. };
  71. function checkStyleValue(prop){
  72. var b = document.body || document.documentElement;
  73. var s = b.style;
  74. var p = prop;
  75. if(typeof s[p] == 'string') {return true; }
  76. // Tests for vendor specific prop
  77. v = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'],
  78. p = p.charAt(0).toUpperCase() + p.substr(1);
  79. for(var i=0; i<v.length; i++) {
  80. if(typeof s[v[i] + p] == 'string') { return true; }
  81. }
  82. return false;
  83. }
  84. function supportsTransitions() {
  85. return checkStyleValue('transition');
  86. }
  87. function supportsTransforms(){
  88. return checkStyleValue('transform');
  89. }
  90. function supports3DTransforms(){
  91. if(!supportsTransforms()) return false;
  92. var el = document.createElement('i'),
  93. has3d,
  94. transforms = {
  95. 'WebkitTransform':'-webkit-transform',
  96. 'OTransform':'-o-transform',
  97. 'MSTransform':'-ms-transform',
  98. 'msTransform':'-ms-transform',
  99. 'MozTransform':'-moz-transform',
  100. 'Transform':'transform',
  101. 'transform':'transform'
  102. };
  103. el.style.display = 'block';
  104. // Add it to the body to get the computed style
  105. document.body.insertBefore(el, null);
  106. for(var t in transforms){
  107. if( el.style[t] !== undefined ){
  108. el.style[t] = 'translate3d(1px,1px,1px)';
  109. has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
  110. }
  111. }
  112. document.body.removeChild(el);
  113. return (has3d != null && has3d.length > 0 && has3d !== "none");
  114. }
  115. /**
  116. * Provides requestAnimationFrame in a cross browser way.
  117. * @author paulirish / http://paulirish.com/
  118. */
  119. var fps60 = 50/3;
  120. if ( !window.requestAnimationFrame ) {
  121. window.requestAnimationFrame = ( function() {
  122. return window.webkitRequestAnimationFrame ||
  123. window.mozRequestAnimationFrame ||
  124. window.oRequestAnimationFrame ||
  125. window.msRequestAnimationFrame ||
  126. function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
  127. window.setTimeout( callback, fps60 );
  128. };
  129. } )();
  130. }
  131. if (!window.getComputedStyle) {
  132. window.getComputedStyle = function(el, pseudo) {
  133. this.el = el;
  134. this.getPropertyValue = function(prop) {
  135. var re = /(\-([a-z]){1})/g;
  136. if (prop == 'float') prop = 'styleFloat';
  137. if (re.test(prop)) {
  138. prop = prop.replace(re, function () {
  139. return arguments[2].toUpperCase();
  140. });
  141. }
  142. return el.currentStyle[prop] ? el.currentStyle[prop] : null;
  143. };
  144. return el.currentStyle;
  145. };
  146. }
  147. // IE8 Array indexOf fix
  148. if (!Array.prototype.indexOf) {
  149. Array.prototype.indexOf = function(elt /*, from*/) {
  150. var len = this.length >>> 0;
  151. var from = Number(arguments[1]) || 0;
  152. from = (from < 0)
  153. ? Math.ceil(from)
  154. : Math.floor(from);
  155. if (from < 0)
  156. from += len;
  157. for (; from < len; from++)
  158. {
  159. if (from in this &&
  160. this[from] === elt)
  161. return from;
  162. }
  163. return -1;
  164. };
  165. }
  166. /**
  167. * check ie browser
  168. * @param {Number | string} version
  169. * @return {Boolean}
  170. */
  171. window.isMSIE = function ( version ) {
  172. if ( !$.browser.msie ) {
  173. return false;
  174. } else if ( !version ) {
  175. return true;
  176. }
  177. var ieVer = $.browser.version.slice(0 , $.browser.version.indexOf('.'));
  178. if ( typeof version === 'string' ) {
  179. if ( version.indexOf('<') !== -1 || version.indexOf('>') !== -1) {
  180. return eval( ieVer + version );
  181. } else {
  182. return eval( version + '==' + ieVer );
  183. }
  184. } else {
  185. return version == ieVer;
  186. }
  187. }
  188. $.removeDataAttrs = function($target, exclude) {
  189. var i,
  190. attrName,
  191. dataAttrsToDelete = [],
  192. dataAttrs = $target[0].attributes,
  193. dataAttrsLen = dataAttrs.length;
  194. exclude = exclude || [];
  195. // loop through attributes and make a list of those
  196. // that begin with 'data-'
  197. for (i=0; i<dataAttrsLen; i++) {
  198. attrName = dataAttrs[i].name;
  199. if ( 'data-' === attrName.substring(0,5) && exclude.indexOf(attrName) === -1 ) {
  200. // Why don't you just delete the attributes here?
  201. // Deleting an attribute changes the indices of the
  202. // others wreaking havoc on the loop we are inside
  203. // b/c dataAttrs is a NamedNodeMap (not an array or obj)
  204. dataAttrsToDelete.push(dataAttrs[i].name);
  205. }
  206. }
  207. // delete each of the attributes we found above
  208. // i.e. those that start with "data-"
  209. $.each( dataAttrsToDelete, function( index, attrName ) {
  210. $target.removeAttr( attrName );
  211. })
  212. };
  213. if(jQuery){
  214. $.jqLoadFix = function(){
  215. if(this.complete){
  216. var that = this;
  217. setTimeout(function(){$(that).load();} , 1);
  218. }
  219. };
  220. jQuery.uaMatch = jQuery.uaMatch || function( ua ) {
  221. ua = ua.toLowerCase();
  222. var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
  223. /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
  224. /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
  225. /(msie) ([\w.]+)/.exec( ua ) ||
  226. ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
  227. [];
  228. return {
  229. browser: match[ 1 ] || "",
  230. version: match[ 2 ] || "0"
  231. };
  232. };
  233. // Don't clobber any existing jQuery.browser in case it's different
  234. //if ( !jQuery.browser ) {
  235. matched = jQuery.uaMatch( navigator.userAgent );
  236. browser = {};
  237. if ( matched.browser ) {
  238. browser[ matched.browser ] = true;
  239. browser.version = matched.version;
  240. }
  241. // Chrome is Webkit, but Webkit is also Safari.
  242. if ( browser.chrome ) {
  243. browser.webkit = true;
  244. } else if ( browser.webkit ) {
  245. browser.safari = true;
  246. }
  247. // hofix for IE11 detection
  248. var isIE11 = !!navigator.userAgent.match(/Trident\/7\./);
  249. if (isIE11) {
  250. browser.msie = "true";
  251. delete browser.mozilla;
  252. }
  253. jQuery.browser = browser;
  254. //}
  255. $.fn.preloadImg = function(src , _event){
  256. this.each(function(){
  257. var $this = $(this);
  258. var self = this;
  259. var img = new Image();
  260. img.onload = function(event){
  261. if(event == null) event = {}; // IE8
  262. $this.attr('src' , src);
  263. event.width = img.width;
  264. event.height = img.height;
  265. $this.data('width', img.width);
  266. $this.data('height', img.height);
  267. setTimeout(function(){_event.call(self , event);},50);
  268. img = null;
  269. };
  270. img.src = src;
  271. });
  272. return this;
  273. };
  274. }
  275. })(jQuery);
  276. /* ================== bin-debug/js/pro/tools/EventDispatcher.js =================== */
  277. ;(function(){
  278. "use strict";
  279. averta.EventDispatcher = function(){
  280. this.listeners = {};
  281. };
  282. averta.EventDispatcher.extend = function(_proto){
  283. var instance = new averta.EventDispatcher();
  284. for(var key in instance)
  285. if(key != 'constructor') _proto[key] = averta.EventDispatcher.prototype[key];
  286. };
  287. averta.EventDispatcher.prototype = {
  288. constructor : averta.EventDispatcher,
  289. addEventListener : function(event , listener , ref){
  290. if(!this.listeners[event]) this.listeners[event] = [];
  291. this.listeners[event].push({listener:listener , ref:ref});
  292. },
  293. removeEventListener : function(event , listener , ref){
  294. if(this.listeners[event]){
  295. for(var i = 0; i < this.listeners[event].length ; ++i){
  296. if(listener === this.listeners[event][i].listener && ref === this.listeners[event][i].ref){
  297. this.listeners[event].splice(i--,1);
  298. }
  299. }
  300. if (this.listeners[event].length === 0){
  301. this.listeners[event] = null;
  302. }
  303. }
  304. },
  305. dispatchEvent : function (event) {
  306. event.target = this;
  307. if(this.listeners[event.type]){
  308. for(var i = 0 , l = this.listeners[event.type].length; i < l ; ++i){
  309. this.listeners[event.type][i].listener.call(this.listeners[event.type][i].ref , event);
  310. }
  311. }
  312. }
  313. };
  314. })();
  315. /* ================== bin-debug/js/pro/tools/TouchSwipe.js =================== */
  316. ;(function($){
  317. "use strict";
  318. var isTouch = 'ontouchstart' in document,
  319. isPointer = window.navigator.pointerEnabled,
  320. isMSPoiner = !isPointer && window.navigator.msPointerEnabled,
  321. usePointer = isPointer || isMSPoiner,
  322. // Events
  323. ev_start = (isPointer ? 'pointerdown ' : '' ) + (isMSPoiner ? 'MSPointerDown ' : '' ) + (isTouch ? 'touchstart ' : '' ) + 'mousedown',
  324. ev_move = (isPointer ? 'pointermove ' : '' ) + (isMSPoiner ? 'MSPointerMove ' : '' ) + (isTouch ? 'touchmove ' : '' ) + 'mousemove',
  325. ev_end = (isPointer ? 'pointerup ' : '' ) + (isMSPoiner ? 'MSPointerUp ' : '' ) + (isTouch ? 'touchend ' : '' ) + 'mouseup',
  326. ev_cancel = (isPointer ? 'pointercancel ' : '' ) + (isMSPoiner ? 'MSPointerCancel ': '' ) + 'touchcancel';
  327. averta.TouchSwipe = function($element){
  328. this.$element = $element;
  329. this.enabled = true;
  330. $element.bind(ev_start , {target: this} , this.__touchStart);
  331. $element[0].swipe = this;
  332. this.onSwipe = null;
  333. this.swipeType = 'horizontal';
  334. this.noSwipeSelector = 'input, textarea, button, .no-swipe, .ms-no-swipe';
  335. this.lastStatus = {};
  336. };
  337. var p = averta.TouchSwipe.prototype;
  338. /*-------------- METHODS --------------*/
  339. p.getDirection = function(new_x , new_y){
  340. switch(this.swipeType){
  341. case 'horizontal':
  342. return new_x <= this.start_x ? 'left' : 'right';
  343. break;
  344. case 'vertical':
  345. return new_y <= this.start_y ? 'up' : 'down';
  346. break;
  347. case 'all':
  348. if(Math.abs(new_x - this.start_x) > Math.abs(new_y - this.start_y))
  349. return new_x <= this.start_x ? 'left' : 'right';
  350. else
  351. return new_y <= this.start_y ? 'up' : 'down';
  352. break;
  353. }
  354. };
  355. p.priventDefultEvent = function(new_x , new_y){
  356. //if(this.priventEvt != null) return this.priventEvt;
  357. var dx = Math.abs(new_x - this.start_x);
  358. var dy = Math.abs(new_y - this.start_y);
  359. var horiz = dx > dy;
  360. return (this.swipeType === 'horizontal' && horiz) ||
  361. (this.swipeType === 'vertical' && !horiz);
  362. //return this.priventEvt;
  363. };
  364. p.createStatusObject = function(evt){
  365. var status_data = {} , temp_x , temp_y;
  366. temp_x = this.lastStatus.distanceX || 0;
  367. temp_y = this.lastStatus.distanceY || 0;
  368. status_data.distanceX = evt.pageX - this.start_x;
  369. status_data.distanceY = evt.pageY - this.start_y;
  370. status_data.moveX = status_data.distanceX - temp_x;
  371. status_data.moveY = status_data.distanceY - temp_y;
  372. status_data.distance = parseInt( Math.sqrt(Math.pow(status_data.distanceX , 2) + Math.pow(status_data.distanceY , 2)) );
  373. status_data.duration = new Date().getTime() - this.start_time;
  374. status_data.direction = this.getDirection(evt.pageX , evt.pageY);
  375. return status_data;
  376. };
  377. p.__reset = function(event , jqevt){
  378. this.reset = false;
  379. this.lastStatus = {};
  380. this.start_time = new Date().getTime();
  381. this.start_x = isTouch ? event.touches[0].pageX : (usePointer ? event.pageX : jqevt.pageX);
  382. this.start_y = isTouch ? event.touches[0].pageY : (usePointer ? event.pageY : jqevt.pageY);
  383. };
  384. p.__touchStart = function(event){
  385. var swipe = event.data.target;
  386. var jqevt = event;
  387. if(!swipe.enabled) return;
  388. if ( $(event.target).closest(swipe.noSwipeSelector, swipe.$element).length > 0 ) {
  389. return;
  390. }
  391. event = event.originalEvent;
  392. if( usePointer ) {
  393. $(this).css('-ms-touch-action', swipe.swipeType === 'horizontal' ? 'pan-y' : 'pan-x');
  394. }
  395. if(!swipe.onSwipe) {
  396. $.error('Swipe listener is undefined');
  397. return;
  398. }
  399. if(swipe.touchStarted) return;
  400. swipe.start_x = isTouch ? event.touches[0].pageX : (usePointer ? event.pageX : jqevt.pageX);
  401. swipe.start_y = isTouch ? event.touches[0].pageY : (usePointer ? event.pageY : jqevt.pageY);
  402. swipe.start_time = new Date().getTime();
  403. $(document).bind(ev_end , {target: swipe} , swipe.__touchEnd).
  404. bind(ev_move , {target: swipe} , swipe.__touchMove).
  405. bind(ev_cancel , {target: swipe} , swipe.__touchCancel);
  406. var evt = isTouch ? event.touches[0] : (usePointer ? event : jqevt);
  407. var status = swipe.createStatusObject(evt);
  408. status.phase = 'start';
  409. swipe.onSwipe.call(null , status);
  410. if(!isTouch)
  411. jqevt.preventDefault();
  412. swipe.lastStatus = status;
  413. swipe.touchStarted = true;
  414. };
  415. p.__touchMove = function(event){
  416. var swipe = event.data.target;
  417. var jqevt = event;
  418. event = event.originalEvent;
  419. if(!swipe.touchStarted) return;
  420. clearTimeout(swipe.timo);
  421. swipe.timo = setTimeout(function(){swipe.__reset(event , jqevt);} , 60);
  422. var evt = isTouch ? event.touches[0] : (usePointer ? event : jqevt);
  423. var status = swipe.createStatusObject(evt);
  424. if(swipe.priventDefultEvent(evt.pageX , evt.pageY))
  425. jqevt.preventDefault();
  426. status.phase = 'move';
  427. //if(swipe.lastStatus.direction !== status.direction) swipe.__reset(event , jqevt);
  428. swipe.lastStatus = status;
  429. swipe.onSwipe.call(null , status);
  430. };
  431. p.__touchEnd = function(event){
  432. var swipe = event.data.target;
  433. var jqevt = event;
  434. event = event.originalEvent;
  435. clearTimeout(swipe.timo);
  436. var evt = isTouch ? event.touches[0] : (usePointer ? event : jqevt);
  437. var status = swipe.lastStatus;
  438. if(!isTouch)
  439. jqevt.preventDefault();
  440. status.phase = 'end';
  441. swipe.touchStarted = false;
  442. swipe.priventEvt = null;
  443. $(document).unbind(ev_end , swipe.__touchEnd).
  444. unbind(ev_move , swipe.__touchMove).
  445. unbind(ev_cancel , swipe.__touchCancel);
  446. status.speed = status.distance / status.duration;
  447. swipe.onSwipe.call(null , status);
  448. };
  449. p.__touchCancel = function(event){
  450. var swipe = event.data.target;
  451. swipe.__touchEnd(event);
  452. };
  453. p.enable = function(){
  454. if(this.enabled) return;
  455. this.enabled = true;
  456. };
  457. p.disable = function(){
  458. if(!this.enabled) return;
  459. this.enabled = false;
  460. };
  461. })(jQuery);
  462. /* ================== bin-debug/js/pro/tools/Timer.js =================== */
  463. /**
  464. * Ticker Class
  465. * Author: Averta Ltd
  466. */
  467. ;(function(){
  468. "use strict";
  469. averta.Ticker = function(){};
  470. var st = averta.Ticker,
  471. list = [],
  472. len = 0,
  473. __stopped = true;
  474. st.add = function (listener , ref){
  475. list.push([listener , ref]);
  476. if(list.length === 1) st.start();
  477. len = list.length;
  478. return len;
  479. };
  480. st.remove = function (listener , ref) {
  481. for(var i = 0 , l = list.length ; i<l ; ++i){
  482. if(list[i] && list[i][0] === listener && list[i][1] === ref){
  483. list.splice(i , 1);
  484. }
  485. }
  486. len = list.length;
  487. if( len === 0 ){
  488. st.stop();
  489. }
  490. };
  491. st.start = function (){
  492. if(!__stopped) return;
  493. __stopped = false;
  494. __tick();
  495. };
  496. st.stop = function (){
  497. __stopped = true;
  498. };
  499. var __tick = function () {
  500. if(st.__stopped) return;
  501. var item;
  502. for(var i = 0; i!==len; i++){
  503. item = list[i];
  504. item[0].call(item[1]);
  505. }
  506. requestAnimationFrame(__tick);
  507. };
  508. })();
  509. /**
  510. * Timer Class
  511. * Author: Averta Ltd
  512. */
  513. ;(function(){
  514. "use strict";
  515. if(!Date.now){
  516. Date.now = function(){
  517. return new Date().getTime();
  518. };
  519. }
  520. averta.Timer = function(delay , autoStart) {
  521. this.delay = delay;
  522. this.currentCount = 0;
  523. this.paused = false;
  524. this.onTimer = null;
  525. this.refrence = null;
  526. if(autoStart) this.start();
  527. };
  528. averta.Timer.prototype = {
  529. constructor : averta.Timer,
  530. start : function(){
  531. this.paused = false;
  532. this.lastTime = Date.now();
  533. averta.Ticker.add(this.update , this);
  534. },
  535. stop : function(){
  536. this.paused = true;
  537. averta.Ticker.remove(this.update , this);
  538. },
  539. reset : function(){
  540. this.currentCount = 0;
  541. this.paused = true;
  542. this.lastTime = Date.now();
  543. },
  544. update : function(){
  545. if(this.paused || Date.now() - this.lastTime < this.delay) return;
  546. this.currentCount ++;
  547. this.lastTime = Date.now();
  548. if(this.onTimer)
  549. this.onTimer.call(this.refrence , this.getTime());
  550. } ,
  551. getTime : function(){
  552. return this.delay * this.currentCount;
  553. }
  554. };
  555. })();
  556. /* ================== bin-debug/js/pro/tools/CSSTweener.js =================== */
  557. ;(function(){
  558. "use strict";
  559. var evt = null;
  560. window.CSSTween = function(element , duration , delay , ease){
  561. this.$element = element;
  562. this.duration = duration || 1000;
  563. this.delay = delay || 0;
  564. this.ease = ease || 'linear';
  565. /*if(!evt){
  566. if(window._jcsspfx === 'O')
  567. evt = 'otransitionend';
  568. else if(window._jcsspfx == 'Webkit')
  569. evt = 'webkitTransitionEnd';
  570. else
  571. evt = 'transitionend' ;
  572. }*/
  573. };
  574. var p = CSSTween.prototype;
  575. /*-------------- METHODS --------------*/
  576. p.to = function(callback , target){
  577. this.to_cb = callback;
  578. this.to_cb_target = target;
  579. return this;
  580. };
  581. p.from = function(callback , target ){
  582. this.fr_cb = callback;
  583. this.fr_cb_target = target;
  584. return this;
  585. };
  586. p.onComplete = function(callback ,target){
  587. this.oc_fb = callback;
  588. this.oc_fb_target = target;
  589. return this;
  590. };
  591. p.chain = function(csstween){
  592. this.chained_tween = csstween;
  593. return this;
  594. };
  595. p.reset = function(){
  596. //element.removeEventListener(evt , this.onTransComplete , true);
  597. clearTimeout(this.start_to);
  598. clearTimeout(this.end_to);
  599. };
  600. p.start = function(){
  601. var element = this.$element[0];
  602. clearTimeout(this.start_to);
  603. clearTimeout(this.end_to);
  604. this.fresh = true;
  605. if(this.fr_cb){
  606. element.style[window._jcsspfx + 'TransitionDuration'] = '0ms';
  607. this.fr_cb.call(this.fr_cb_target);
  608. }
  609. var that = this;
  610. this.onTransComplete = function(event){
  611. if(!that.fresh) return;
  612. //that.$element[0].removeEventListener(evt , this.onTransComplete, true);
  613. //event.stopPropagation();
  614. that.reset();
  615. element.style[window._jcsspfx + 'TransitionDuration'] = '';
  616. element.style[window._jcsspfx + 'TransitionProperty'] = '';
  617. element.style[window._jcsspfx + 'TransitionTimingFunction'] = '';
  618. element.style[window._jcsspfx + 'TransitionDelay'] = '';
  619. that.fresh = false;
  620. if(that.chained_tween) that.chained_tween.start();
  621. if(that.oc_fb) that.oc_fb.call(that.oc_fb_target);
  622. };
  623. this.start_to = setTimeout(function(){
  624. if ( !that.$element ) return;
  625. element.style[window._jcsspfx + 'TransitionDuration'] = that.duration + 'ms';
  626. element.style[window._jcsspfx + 'TransitionProperty'] = that.transProperty || 'all';
  627. if(that.delay > 0) element.style[window._jcsspfx + 'TransitionDelay'] = that.delay + 'ms';
  628. else element.style[window._jcsspfx + 'TransitionDelay'] = '';
  629. element.style[window._jcsspfx + 'TransitionTimingFunction'] = that.ease;
  630. if(that.to_cb) that.to_cb.call(that.to_cb_target);
  631. //that.$element[0].addEventListener(evt , that.onTransComplete , true );
  632. that.end_to = setTimeout(function(){that.onTransComplete();} , that.duration + (that.delay || 0));
  633. } , 100);
  634. return this;
  635. };
  636. })();
  637. /**
  638. * Cross Tween Class
  639. */
  640. ;(function(){
  641. "use strict";
  642. var _cssanim = null;
  643. window.CTween = {};
  644. function transPos(element, properties){
  645. if(properties.x !== undefined || properties.y !== undefined){
  646. if(_cssanim){
  647. var trans = window._jcsspfx+"Transform";
  648. if(properties.x !== undefined){
  649. properties[trans] = (properties[trans] || '') + ' translateX('+properties.x+'px)';
  650. delete properties.x;
  651. }
  652. if(properties.y !== undefined){
  653. properties[trans] = (properties[trans] || '') + ' translateY('+properties.y+'px)';
  654. delete properties.y;
  655. }
  656. }else{
  657. if(properties.x !== undefined){
  658. var posx = element.css('right') !== 'auto' ? 'right' : 'left';
  659. //if(!element[0].bx) element[0].bx = parseInt(element.css(posx));
  660. properties[posx] = /*element[0].bx + */properties.x + 'px';
  661. delete properties.x;
  662. }
  663. if(properties.y !== undefined){
  664. var posy = element.css('bottom') !== 'auto' ? 'bottom' : 'top';
  665. //if(!element[0].by) element[0].by = parseInt(element.css(posy));
  666. properties[posy] = /*element[0].by + */properties.y + 'px';
  667. delete properties.y;
  668. }
  669. }
  670. }
  671. return properties;
  672. }
  673. CTween.setPos = function(element , pos){
  674. element.css(transPos(element , pos));
  675. };
  676. CTween.animate = function(element , duration , properties , options){
  677. if(_cssanim == null) _cssanim = window._cssanim;
  678. options = options || {};
  679. transPos(element , properties);
  680. if(_cssanim){
  681. var tween = new CSSTween(element , duration , options.delay , EaseDic[options.ease]);
  682. if ( options.transProperty ) {
  683. tween.transProperty = options.transProperty;
  684. }
  685. tween.to(function(){ element.css(properties);});
  686. if(options.complete) tween.onComplete(options.complete , options.target);
  687. tween.start();
  688. tween.stop = tween.reset;
  689. return tween;
  690. }
  691. var onCl;
  692. if(options.delay) element.delay(options.delay);
  693. if(options.complete)
  694. onCl = function(){
  695. options.complete.call(options.target);
  696. };
  697. element.stop(true).animate(properties , duration , options.ease || 'linear' , onCl);
  698. return element;
  699. };
  700. CTween.fadeOut = function(target , duration , remove) {
  701. var options = {};
  702. if(remove === true) {
  703. options.complete = function(){target.remove();};
  704. } else if ( remove === 2 ) {
  705. options.complete = function(){target.css('display', 'none');};
  706. }
  707. CTween.animate(target , duration || 1000 , {opacity : 0} , options);
  708. };
  709. CTween.fadeIn = function(target , duration, reset){
  710. if( reset !== false ) {
  711. target.css('opacity' , 0).css('display', '');
  712. }
  713. CTween.animate(target , duration || 1000 , {opacity : 1});
  714. };
  715. })();
  716. ;(function(){
  717. // Thanks to matthewlein
  718. // https://github.com/matthewlein/Ceaser
  719. window.EaseDic = {
  720. 'linear' : 'linear',
  721. 'ease' : 'ease',
  722. 'easeIn' : 'ease-in',
  723. 'easeOut' : 'ease-out',
  724. 'easeInOut' : 'ease-in-out',
  725. 'easeInCubic' : 'cubic-bezier(.55,.055,.675,.19)',
  726. 'easeOutCubic' : 'cubic-bezier(.215,.61,.355,1)',
  727. 'easeInOutCubic' : 'cubic-bezier(.645,.045,.355,1)',
  728. 'easeInCirc' : 'cubic-bezier(.6,.04,.98,.335)',
  729. 'easeOutCirc' : 'cubic-bezier(.075,.82,.165,1)',
  730. 'easeInOutCirc' : 'cubic-bezier(.785,.135,.15,.86)',
  731. 'easeInExpo' : 'cubic-bezier(.95,.05,.795,.035)',
  732. 'easeOutExpo' : 'cubic-bezier(.19,1,.22,1)',
  733. 'easeInOutExpo' : 'cubic-bezier(1,0,0,1)',
  734. 'easeInQuad' : 'cubic-bezier(.55,.085,.68,.53)',
  735. 'easeOutQuad' : 'cubic-bezier(.25,.46,.45,.94)',
  736. 'easeInOutQuad' : 'cubic-bezier(.455,.03,.515,.955)',
  737. 'easeInQuart' : 'cubic-bezier(.895,.03,.685,.22)',
  738. 'easeOutQuart' : 'cubic-bezier(.165,.84,.44,1)',
  739. 'easeInOutQuart' : 'cubic-bezier(.77,0,.175,1)',
  740. 'easeInQuint' : 'cubic-bezier(.755,.05,.855,.06)',
  741. 'easeOutQuint' : 'cubic-bezier(.23,1,.32,1)',
  742. 'easeInOutQuint' : 'cubic-bezier(.86,0,.07,1)',
  743. 'easeInSine' : 'cubic-bezier(.47,0,.745,.715)',
  744. 'easeOutSine' : 'cubic-bezier(.39,.575,.565,1)',
  745. 'easeInOutSine' : 'cubic-bezier(.445,.05,.55,.95)',
  746. 'easeInBack' : 'cubic-bezier(.6,-.28,.735,.045)',
  747. 'easeOutBack' : 'cubic-bezier(.175, .885,.32,1.275)',
  748. 'easeInOutBack' : 'cubic-bezier(.68,-.55,.265,1.55)'
  749. };
  750. })();
  751. /* ================== bin-debug/js/pro/tools/Aligner.js =================== */
  752. ;(function(){
  753. "use strict";
  754. window.MSAligner = function(type , $container , $img ){
  755. this.$container = $container;
  756. this.$img = $img;
  757. this.type = type || 'stretch'; // fill , fit , stretch , tile , center
  758. this.widthOnly = false;
  759. this.heightOnly = false;
  760. };
  761. var p = MSAligner.prototype;
  762. /*-------------- METHODS --------------*/
  763. p.init = function(w , h){
  764. this.baseWidth = w;
  765. this.baseHeight = h;
  766. this.imgRatio = w / h;
  767. this.imgRatio2 = h / w;
  768. switch(this.type){
  769. case 'tile':
  770. this.$container.css('background-image' , 'url('+ this.$img.attr('src') +')');
  771. this.$img.remove();
  772. break;
  773. case 'center':
  774. this.$container.css('background-image' , 'url('+ this.$img.attr('src') +')');
  775. this.$container.css({
  776. backgroundPosition : 'center center',
  777. backgroundRepeat : 'no-repeat'
  778. });
  779. this.$img.remove();
  780. break;
  781. case 'stretch':
  782. this.$img.css({
  783. width : '100%',
  784. height : '100%'
  785. });
  786. break;
  787. case 'fill':
  788. case 'fit' :
  789. this.needAlign = true;
  790. this.align();
  791. break;
  792. }
  793. };
  794. p.align = function(){
  795. if(!this.needAlign) return;
  796. var cont_w = this.$container.width();
  797. var cont_h = this.$container.height();
  798. var contRatio = cont_w / cont_h;
  799. if(this.type == 'fill'){
  800. if(this.imgRatio < contRatio ){
  801. this.$img.width(cont_w);
  802. this.$img.height(cont_w * this.imgRatio2);
  803. }else{
  804. this.$img.height(cont_h);
  805. this.$img.width(cont_h * this.imgRatio);
  806. }
  807. }else if(this.type == 'fit'){
  808. if(this.imgRatio < contRatio){
  809. this.$img.height(cont_h);
  810. this.$img.width(cont_h * this.imgRatio);
  811. }else{
  812. this.$img.width(cont_w);
  813. this.$img.height(cont_w * this.imgRatio2);
  814. }
  815. }
  816. this.setMargin();
  817. };
  818. p.setMargin = function(){
  819. var cont_w = this.$container.width();
  820. var cont_h = this.$container.height();
  821. this.$img.css('margin-top' , (cont_h - this.$img[0].offsetHeight) / 2 + 'px');
  822. this.$img.css('margin-left', (cont_w - this.$img[0].offsetWidth ) / 2 + 'px');
  823. }
  824. })();
  825. /* ================== bin-debug/js/pro/controls/controller.js =================== */
  826. /**
  827. * Touch List Control
  828. * version 1.1.2
  829. *
  830. * Copyright (C) 2014, Averta Ltd. All rights reserved.
  831. */
  832. ;(function(){
  833. "use strict";
  834. var _options = {
  835. bouncing : true,
  836. snapping : false,
  837. snapsize : null,
  838. friction : 0.05,
  839. outFriction : 0.05,
  840. outAcceleration : 0.09,
  841. minValidDist : 0.3,
  842. snappingMinSpeed : 2,
  843. paging : false,
  844. endless : false,
  845. maxSpeed : 160
  846. };
  847. var Controller = function(min , max , options){
  848. if(max === null || min === null) {
  849. throw new Error('Max and Min values are required.');
  850. }
  851. this.options = options || {};
  852. for(var key in _options){
  853. if(!(key in this.options))
  854. this.options[key] = _options[key];
  855. }
  856. this._max_value = max;
  857. this._min_value = min;
  858. this.value = min;
  859. this.end_loc = min;
  860. this.current_snap = this.getSnapNum(min);
  861. this.__extrStep = 0;
  862. this.__extraMove = 0;
  863. this.__animID = -1;
  864. };
  865. var p = Controller.prototype;
  866. /*
  867. ---------------------------------------------------
  868. PUBLIC METHODS
  869. ----------------------------------------------------
  870. */
  871. p.changeTo = function(value , animate , speed , snap_num , dispatch) {
  872. this.stopped = false;
  873. this._internalStop();
  874. value = this._checkLimits(value);
  875. speed = Math.abs(speed || 0);
  876. if(this.options.snapping){
  877. snap_num = snap_num || this.getSnapNum(value);
  878. if( dispatch !== false )this._callsnapChange(snap_num);
  879. this.current_snap = snap_num;
  880. }
  881. if(animate){
  882. this.animating = true;
  883. var self = this,
  884. active_id = ++self.__animID,
  885. amplitude = value - self.value,
  886. timeStep = 0,
  887. targetPosition = value,
  888. animFrict = 1 - self.options.friction,
  889. timeconst = animFrict + (speed - 20) * animFrict * 1.3 / self.options.maxSpeed;
  890. var tick = function(){
  891. if(active_id !== self.__animID) return;
  892. var dis = value - self.value;
  893. if( Math.abs(dis) > self.options.minValidDist && self.animating ){
  894. window.requestAnimationFrame(tick);
  895. } else {
  896. if( self.animating ){
  897. self.value = value;
  898. self._callrenderer();
  899. }
  900. self.animating = false;
  901. if( active_id !== self.__animID ){
  902. self.__animID = -1;
  903. }
  904. self._callonComplete('anim');
  905. return;
  906. }
  907. //self.value += dis * timeconst
  908. self.value = targetPosition - amplitude * Math.exp(-++timeStep * timeconst);
  909. self._callrenderer();
  910. };
  911. tick();
  912. return;
  913. }
  914. this.value = value;
  915. this._callrenderer();
  916. };
  917. p.drag = function(move){
  918. if(this.start_drag){
  919. this.drag_start_loc = this.value;
  920. this.start_drag = false;
  921. }
  922. this.animating = false;
  923. this._deceleration = false;
  924. this.value -= move;
  925. if ( !this.options.endless && (this.value > this._max_value || this.value < 0)) {
  926. if (this.options.bouncing) {
  927. this.__isout = true;
  928. this.value += move * 0.6;
  929. } else if (this.value > this._max_value) {
  930. this.value = this._max_value;
  931. } else {
  932. this.value = 0;
  933. }
  934. }else if(!this.options.endless && this.options.bouncing){
  935. this.__isout = false;
  936. }
  937. this._callrenderer();
  938. };
  939. p.push = function(speed){
  940. this.stopped = false;
  941. if(this.options.snapping && Math.abs(speed) <= this.options.snappingMinSpeed){
  942. this.cancel();
  943. return;
  944. }
  945. this.__speed = speed;
  946. this.__startSpeed = speed;
  947. this.end_loc = this._calculateEnd();
  948. if(this.options.snapping){
  949. var snap_loc = this.getSnapNum(this.value),
  950. end_snap = this.getSnapNum(this.end_loc);
  951. if(this.options.paging){
  952. snap_loc = this.getSnapNum(this.drag_start_loc);
  953. this.__isout = false;
  954. if(speed > 0){
  955. this.gotoSnap(snap_loc + 1 , true , speed);
  956. }else{
  957. this.gotoSnap(snap_loc - 1 , true , speed);
  958. }
  959. return;
  960. }else if(snap_loc === end_snap){
  961. this.cancel();
  962. return;
  963. }
  964. this._callsnapChange(end_snap);
  965. this.current_snap = end_snap;
  966. }
  967. this.animating = false;
  968. this.__needsSnap = this.options.endless || (this.end_loc > this._min_value && this.end_loc < this._max_value) ;
  969. if(this.options.snapping && this.__needsSnap)
  970. this.__extraMove = this._calculateExtraMove(this.end_loc);
  971. this._startDecelaration();
  972. };
  973. p.bounce = function(speed){
  974. if(this.animating) return;
  975. this.stopped = false;
  976. this.animating = false;
  977. this.__speed = speed;
  978. this.__startSpeed = speed;
  979. this.end_loc = this._calculateEnd();
  980. //if(this.options.paging){}
  981. this._startDecelaration();
  982. };
  983. p.stop = function(){
  984. this.stopped = true;
  985. this._internalStop();
  986. };
  987. p.cancel = function(){
  988. this.start_drag = true; // reset flag for next drag
  989. if(this.__isout){
  990. this.__speed = 0.0004;
  991. this._startDecelaration();
  992. }else if(this.options.snapping){
  993. this.gotoSnap(this.getSnapNum(this.value) , true);
  994. }
  995. };
  996. p.renderCallback = function(listener , ref){
  997. this.__renderHook = {fun:listener , ref:ref};
  998. };
  999. p.snappingCallback = function(listener , ref){
  1000. this.__snapHook = {fun:listener , ref:ref};
  1001. };
  1002. p.snapCompleteCallback = function(listener , ref){
  1003. this.__compHook = {fun:listener , ref:ref};
  1004. };
  1005. p.getSnapNum = function(value){
  1006. return Math.floor(( value + this.options.snapsize / 2 ) / this.options.snapsize);
  1007. };
  1008. p.nextSnap = function(){
  1009. this._internalStop();
  1010. var curr_snap = this.getSnapNum(this.value);
  1011. if(!this.options.endless && (curr_snap + 1) * this.options.snapsize > this._max_value){
  1012. this.__speed = 8;
  1013. this.__needsSnap = false;
  1014. this._startDecelaration();
  1015. }else{
  1016. this.gotoSnap(curr_snap + 1 , true);
  1017. }
  1018. };
  1019. p.prevSnap = function(){
  1020. this._internalStop();
  1021. var curr_snap = this.getSnapNum(this.value);
  1022. if(!this.options.endless && (curr_snap - 1) * this.options.snapsize < this._min_value){
  1023. this.__speed = -8;
  1024. this.__needsSnap = false;
  1025. this._startDecelaration();
  1026. }else{
  1027. this.gotoSnap(curr_snap - 1 , true);
  1028. }
  1029. };
  1030. p.gotoSnap = function(snap_num , animate , speed){
  1031. this.changeTo(snap_num * this.options.snapsize , animate , speed , snap_num);
  1032. };
  1033. p.destroy = function(){
  1034. this._internalStop();
  1035. this.__renderHook = null;
  1036. this.__snapHook = null;
  1037. this.__compHook = null;
  1038. };
  1039. /*
  1040. ---------------------------------------------------
  1041. PRIVATE METHODS
  1042. ----------------------------------------------------
  1043. */
  1044. p._internalStop = function(){
  1045. this.start_drag = true; // reset flag for next drag
  1046. this.animating = false;
  1047. this._deceleration = false;
  1048. this.__extrStep = 0;
  1049. };
  1050. p._calculateExtraMove = function(value){
  1051. var m = value % this.options.snapsize;
  1052. return m < this.options.snapsize / 2 ? -m : this.options.snapsize - m;
  1053. };
  1054. p._calculateEnd = function(step){
  1055. var temp_speed = this.__speed;
  1056. var temp_value = this.value;
  1057. var i = 0;
  1058. while(Math.abs(temp_speed) > this.options.minValidDist){
  1059. temp_value += temp_speed;
  1060. temp_speed *= this.options.friction;
  1061. i++;
  1062. }
  1063. if(step) return i;
  1064. return temp_value;
  1065. };
  1066. p._checkLimits = function(value){
  1067. if(this.options.endless) return value;
  1068. if(value < this._min_value) return this._min_value;
  1069. if(value > this._max_value) return this._max_value;
  1070. return value;
  1071. };
  1072. p._callrenderer = function(){
  1073. if(this.__renderHook) this.__renderHook.fun.call(this.__renderHook.ref , this , this.value);
  1074. };
  1075. p._callsnapChange = function(targetSnap){
  1076. if(!this.__snapHook || targetSnap === this.current_snap) return;
  1077. this.__snapHook.fun.call(this.__snapHook.ref , this , targetSnap , targetSnap - this.current_snap);
  1078. };
  1079. p._callonComplete = function(type){
  1080. if(this.__compHook && !this.stopped){
  1081. this.__compHook.fun.call(this.__compHook.ref , this , this.current_snap , type);
  1082. }
  1083. };
  1084. p._computeDeceleration = function(){
  1085. if(this.options.snapping && this.__needsSnap){
  1086. var xtr_move = (this.__startSpeed - this.__speed) / this.__startSpeed * this.__extraMove;
  1087. this.value += this.__speed + xtr_move - this.__extrStep;
  1088. this.__extrStep = xtr_move;
  1089. }else{
  1090. this.value += this.__speed;
  1091. }
  1092. this.__speed *= this.options.friction; //* 10;
  1093. if(!this.options.endless && !this.options.bouncing){
  1094. if(this.value <= this._min_value){
  1095. this.value = this._min_value;
  1096. this.__speed = 0;
  1097. }else if(this.value >= this._max_value){
  1098. this.value = this._max_value;
  1099. this.__speed = 0;
  1100. }
  1101. }
  1102. this._callrenderer();
  1103. if(!this.options.endless && this.options.bouncing){
  1104. var out_value = 0;
  1105. if(this.value < this._min_value){
  1106. out_value = this._min_value - this.value;
  1107. }else if(this.value > this._max_value){
  1108. out_value = this._max_value - this.value;
  1109. }
  1110. this.__isout = Math.abs(out_value) >= this.options.minValidDist;
  1111. if(this.__isout){
  1112. if(this.__speed * out_value <= 0){
  1113. this.__speed += out_value * this.options.outFriction;
  1114. }else {
  1115. this.__speed = out_value * this.options.outAcceleration;
  1116. }
  1117. }
  1118. }
  1119. };
  1120. p._startDecelaration = function(){
  1121. if(this._deceleration) return;
  1122. this._deceleration = true;
  1123. var self = this;
  1124. var tick = function (){
  1125. if(!self._deceleration) return;
  1126. self._computeDeceleration();
  1127. if(Math.abs(self.__speed) > self.options.minValidDist || self.__isout){
  1128. window.requestAnimationFrame(tick);
  1129. }else{
  1130. self._deceleration = false;
  1131. self.__isout = false;
  1132. if(self.__needsSnap && self.options.snapping && !self.options.paging){
  1133. self.value = self._checkLimits(self.end_loc + self.__extraMove);
  1134. }else{
  1135. self.value = Math.round(self.value);
  1136. }
  1137. self._callrenderer();
  1138. self._callonComplete('decel');
  1139. }
  1140. };
  1141. tick();
  1142. };
  1143. window.Controller = Controller;
  1144. })();
  1145. /* ================== bin-debug/js/pro/layers/LayerController.js =================== */
  1146. /**
  1147. * Master Slider Layer Controller
  1148. * @author averta
  1149. * @package Master Slider jQuery PRO
  1150. * @since 2.11.1
  1151. */
  1152. ;(function(window, document, $){
  1153. /**
  1154. * Layer Controller constructor
  1155. * @param {MSSlide} slide layer controller's slide.
  1156. */
  1157. window.MSLayerController = function (slide) {
  1158. this.slide = slide;
  1159. this.slider = slide.slider;
  1160. this.layers = [];
  1161. this.layersCount = 0;
  1162. this.preloadCount = 0;
  1163. this.$layers = $('<div></div>').addClass('ms-slide-layers');
  1164. this.$staticLayers = $('<div></div>').addClass('ms-static-layers');
  1165. this.$fixedLayers = $('<div></div>').addClass('ms-fixed-layers');
  1166. this.$animLayers = $('<div></div>').addClass('ms-anim-layers');
  1167. };
  1168. var p = MSLayerController.prototype;
  1169. /*-----------------------------------------*\
  1170. Public Methods
  1171. \*-----------------------------------------*/
  1172. /**
  1173. * Adds new layer to the controller and slide
  1174. * @param {MSLayerElement} layer
  1175. */
  1176. p.addLayer = function (layer) {
  1177. layer.slide = this.slide;
  1178. layer.controller = this;
  1179. // append layer element to the layers container based on `data-position` attribute.
  1180. switch ( layer.$element.data('position') ) {
  1181. case 'static':
  1182. this.hasStaticLayer = true;
  1183. layer.$element.appendTo(this.$staticLayers);
  1184. break;
  1185. case 'fixed':
  1186. this.hasFixedLayer = true;
  1187. layer.$element.appendTo(this.$fixedLayers);
  1188. break;
  1189. default:
  1190. layer.$element.appendTo(this.$animLayers);
  1191. break;
  1192. }
  1193. layer.create();
  1194. this.layers.push(layer);
  1195. this.layersCount ++;
  1196. // @since 1.7.0
  1197. if( layer.parallax ){
  1198. this.hasParallaxLayer = true;
  1199. }
  1200. if ( layer.needPreload ) {
  1201. this.preloadCount ++;
  1202. }
  1203. };
  1204. /**
  1205. * add layers over slide
  1206. * it calls after addLayer
  1207. */
  1208. p.create = function () {
  1209. this.slide.$element.append(this.$layers);
  1210. this.$layers.append(this.$animLayers);
  1211. if ( this.hasStaticLayer ) {
  1212. this.$layers.append(this.$staticLayers);
  1213. }
  1214. if(this.slider.options.layersMode == 'center'){
  1215. this.$layers.css('max-width' , this.slider.options.width + 'px');
  1216. if ( this.hasFixedLayer ) {
  1217. this.$fixedLayers.css('max-width' , this.slider.options.width + 'px');
  1218. }
  1219. }
  1220. };
  1221. /**
  1222. * load layers that requires preloading
  1223. * @param {Function} callback onload callback function
  1224. */
  1225. p.loadLayers = function (callback) {
  1226. this._onReadyCallback = callback;
  1227. if ( this.preloadCount === 0 ) {
  1228. this._onlayersReady();
  1229. return;
  1230. }
  1231. for(var i = 0 ; i !== this.layersCount; ++i){
  1232. if(this.layers[i].needPreload) {
  1233. this.layers[i].loadImage();
  1234. }
  1235. }
  1236. };
  1237. /**
  1238. * prepare layers to show over slide, this method will be called via `prepareToSelect` method of slide.
  1239. */
  1240. p.prepareToShow = function () {
  1241. if ( this.hasParallaxLayer ) {
  1242. this._enableParallaxEffect();
  1243. }
  1244. if ( this.hasFixedLayer ) {
  1245. this.$fixedLayers.prependTo(this.slide.view.$element);
  1246. }
  1247. };
  1248. /**
  1249. * show layers over slide
  1250. */
  1251. p.showLayers = function(){
  1252. if ( this.layersHideTween ) {
  1253. this.layersHideTween.stop(true);
  1254. }
  1255. if ( this.fixedLayersHideTween ) {
  1256. this.fixedLayersHideTween.stop(true);
  1257. }
  1258. this._resetLayers();
  1259. this.$animLayers.css('opacity', '').css('display', '');
  1260. if ( this.hasFixedLayer ){
  1261. this.$fixedLayers.css('opacity', '').css('display', '');
  1262. }
  1263. if ( this.ready ) {
  1264. this._initLayers();
  1265. this._locateLayers();
  1266. this._startLayers();
  1267. }
  1268. };
  1269. /**
  1270. * hideLayers this method will be called via slide class.
  1271. */
  1272. p.hideLayers = function () {
  1273. if( this.slide.selected || this.slider.options.instantStartLayers ){
  1274. var that = this;
  1275. that.layersHideTween = CTween.animate(this.$animLayers, 500, {opacity: 0}, {
  1276. complete:function(){
  1277. that._resetLayers();
  1278. }
  1279. });
  1280. if ( this.hasFixedLayer ) {
  1281. this.fixedLayersHideTween = CTween.animate(this.$fixedLayers, 500, {opacity: 0}, {
  1282. complete:function(){
  1283. that.$fixedLayers.detach();
  1284. }
  1285. });
  1286. }
  1287. // disables parallax effect
  1288. // @since 1.6.0
  1289. if ( this.hasParallaxLayer ) {
  1290. this._disableParallaxEffect();
  1291. }
  1292. }
  1293. };
  1294. /**
  1295. * hide layers from slide
  1296. */
  1297. p.animHideLayers = function(){
  1298. if ( !this.ready ) {
  1299. return;
  1300. }
  1301. for(var i = 0; i !== this.layersCount; ++i){
  1302. this.layers[i].hide();
  1303. }
  1304. };
  1305. /**
  1306. * calculate new size of layers containers and locate layers
  1307. * @param {Number} width slider width
  1308. * @param {Number} height slider height
  1309. * @param {Boolean} hard whether call init layers.
  1310. */
  1311. p.setSize = function (width, height, hard) {
  1312. if ( this.ready && (this.slide.selected || this.hasStaticLayer) ) {
  1313. if ( hard ) {
  1314. this._initLayers(true);
  1315. }
  1316. this._locateLayers(!this.slide.selected);
  1317. }
  1318. if ( this.slider.options.autoHeight ) {
  1319. this.updateHeight();
  1320. }
  1321. if ( this.slider.options.layersMode == 'center' ) {
  1322. var left = Math.max( 0 , (width - this.slider.options.width) / 2 ) + 'px';
  1323. this.$layers[0].style.left = left;
  1324. this.$fixedLayers[0].style.left = left;
  1325. }
  1326. };
  1327. /**
  1328. * updates layers container height
  1329. */
  1330. p.updateHeight = function () {
  1331. var h = this.slide.getHeight() + 'px';
  1332. this.$layers[0].style.height = h;
  1333. this.$fixedLayers[0].style.height = h;
  1334. };
  1335. /**
  1336. * This method will be called by the last layer after loading all of layers.
  1337. */
  1338. p._onlayersReady = function(){
  1339. this.ready = true;
  1340. if ( this.hasStaticLayer && !this.slide.isSleeping ) {
  1341. this._initLayers(false, true);
  1342. }
  1343. this._onReadyCallback.call(this.slide);
  1344. };
  1345. /**
  1346. * this method will be called by slide when it starts sleeping
  1347. */
  1348. p.onSlideSleep = function () {
  1349. };
  1350. /**
  1351. * this method will be called by slide after waking up
  1352. */
  1353. p.onSlideWakeup = function () {
  1354. if ( this.hasStaticLayer && this.ready ) {
  1355. this._initLayers(false, true);
  1356. }
  1357. };
  1358. /**
  1359. * destroy layer controller and stop layer animations
  1360. */
  1361. p.destroy = function () {
  1362. if ( this.slide.selected && this.hasParallaxLayer ) {
  1363. this._disableParallaxEffect();
  1364. }
  1365. for(var i = 0; i < this.layersCount; ++i){
  1366. this.layers[i].$element.stop(true).remove();
  1367. }
  1368. this.$layers.remove();
  1369. this.$staticLayers.remove();
  1370. this.$fixedLayers.remove();
  1371. this.$animLayers.remove();
  1372. };
  1373. /*-----------------------------------------*\
  1374. Private Methods
  1375. \*-----------------------------------------*/
  1376. /**
  1377. * start layer effect
  1378. */
  1379. p._startLayers = function(){
  1380. for(var i = 0; i !== this.layersCount; ++i){
  1381. this.layers[i].start();
  1382. }
  1383. };
  1384. /**
  1385. * call init method of all layers
  1386. * @param {Boolean} force
  1387. */
  1388. p._initLayers = function(force, onlyStatics){
  1389. if ( this.init && !force || this.slider.init_safemode ) {
  1390. return;
  1391. }
  1392. this.init = onlyStatics !== true;
  1393. var i = 0;
  1394. if ( onlyStatics && !this.staticsInit ) { // init only static layers
  1395. this.staticsInit = true;
  1396. for ( ;i !== this.layersCount; ++i ) {
  1397. if ( this.layers[i].staticLayer ) {
  1398. this.layers[i].init();
  1399. }
  1400. }
  1401. } else if ( this.staticsInit && !force ) { // statics are already initiated, init dynamics
  1402. for ( ;i !== this.layersCount; ++i ) {
  1403. if ( !this.layers[i].staticLayer ){
  1404. this.layers[i].init();
  1405. }
  1406. }
  1407. } else { // init all
  1408. for ( ;i !== this.layersCount; ++i ) {
  1409. this.layers[i].init();
  1410. }
  1411. }
  1412. };
  1413. /**
  1414. * locate layers over slide
  1415. */
  1416. p._locateLayers = function (onlyStatics){
  1417. var i = 0;
  1418. if ( onlyStatics ) {
  1419. for ( ;i !== this.layersCount; ++i ) {
  1420. if ( this.layers[i].staticLayer ) {
  1421. this.layers[i].locate();
  1422. }
  1423. }
  1424. } else {
  1425. for ( ;i !== this.layersCount; ++i ) {
  1426. this.layers[i].locate();
  1427. }
  1428. }
  1429. };
  1430. /**
  1431. * rest layers
  1432. */
  1433. p._resetLayers = function(){
  1434. this.$animLayers.css('display', 'none').css('opacity', 1);
  1435. for ( var i = 0; i !== this.layersCount; ++i ) {
  1436. this.layers[i].reset();
  1437. }
  1438. };
  1439. /**
  1440. * moves layers based on x and y
  1441. * @param {Number} x
  1442. * @param {Number} y
  1443. * @param {Boolean} fast whether animate or not
  1444. */
  1445. p._applyParallax = function(x, y, fast){
  1446. for(var i = 0 ; i !== this.layersCount; ++i){
  1447. if( this.layers[i].parallax != null ){
  1448. this.layers[i].moveParallax(x, y, fast);
  1449. }
  1450. }
  1451. };
  1452. /**
  1453. * enable parallax moving layers
  1454. */
  1455. p._enableParallaxEffect = function(){
  1456. if( this.slider.options.parallaxMode === 'swipe' ){
  1457. this.slide.view.addEventListener(MSViewEvents.SCROLL, this._swipeParallaxMove, this);
  1458. } else {
  1459. this.slide.$element.on('mousemove' , {that:this}, this._mouseParallaxMove)
  1460. .on('mouseleave', {that:this}, this._resetParalax);
  1461. /**
  1462. * Calculates new position of parallax based on device orintation gamma and beta
  1463. * @param {Event} e
  1464. * @since 1.6.0
  1465. */
  1466. /*if( window._mobile && window.DeviceOrientationEvent ){
  1467. var that = this;
  1468. this.orientationParallaxMove = function(e){
  1469. var beta = Math.round(e.beta),
  1470. gamma = Math.round(e.gamma);
  1471. that._applyParallax(beta * that.__width / 360 , -gamma * that.__height / 360);
  1472. };
  1473. window.addEventListener('deviceorientation', this.orientationParallaxMove, false);
  1474. }*/
  1475. }
  1476. };
  1477. /**
  1478. * disable parallax effect
  1479. */
  1480. p._disableParallaxEffect = function(){
  1481. if( this.slider.options.parallaxMode === 'swipe' ){
  1482. this.slide.view.removeEventListener(MSViewEvents.SCROLL, this._swipeParallaxMove, this);
  1483. } else {
  1484. this.slide.$element.off('mousemove', this._mouseParallaxMove)
  1485. .off('mouseleave', this._resetParalax);
  1486. /*if( window._mobile && window.DeviceOrientationEvent ){
  1487. window.removeEventListener('deviceorientation', this.orientationParallaxMove);
  1488. }*/
  1489. }
  1490. };
  1491. /**
  1492. * reset layers parallax position to 0, 0
  1493. */
  1494. p._resetParalax = function(e){
  1495. var that = e.data.that;
  1496. that._applyParallax(0,0);
  1497. };
  1498. /**
  1499. * Calculates new mouse position over slide and moves layers
  1500. * @since 1.6.0
  1501. */
  1502. p._mouseParallaxMove = function(e){
  1503. var that = e.data.that,
  1504. os = that.slide.$element.offset(),
  1505. slider = that.slider;
  1506. if( slider.options.parallaxMode !== 'mouse:y-only' ){
  1507. var x = e.pageX - os.left - that.slide.__width / 2;
  1508. } else {
  1509. var x = 0;
  1510. }
  1511. if( slider.options.parallaxMode !== 'mouse:x-only' ){
  1512. var y = e.pageY - os.top - that.slide.__height / 2;
  1513. } else {
  1514. var y = 0;
  1515. }
  1516. that._applyParallax(-x, -y);
  1517. };
  1518. /**
  1519. * Calculates new position of parallax based on slide position
  1520. * @param {Event} e
  1521. * @since 1.6.0
  1522. */
  1523. p._swipeParallaxMove = function(e){
  1524. var value = this.slide.position - this.slide.view.__contPos;
  1525. if ( this.slider.options.dir === 'v' ) {
  1526. this._applyParallax(0, value, true);
  1527. } else {
  1528. this._applyParallax(value, 0, true);
  1529. }
  1530. };
  1531. })(window, document, jQuery);
  1532. /* ================== bin-debug/js/pro/layers/LayerEffects.js =================== */
  1533. ;(function($){
  1534. window.MSLayerEffects = {};
  1535. var installed,
  1536. _fade = {opacity:0};
  1537. MSLayerEffects.setup = function(){
  1538. if(installed) return;
  1539. installed = true;
  1540. var st = MSLayerEffects,
  1541. transform_css = window._jcsspfx + 'Transform',
  1542. transform_orig_css = window._jcsspfx + 'TransformOrigin',
  1543. o = $.browser.opera; // Opera sucks :|
  1544. _2d = window._css2d && window._cssanim && !o;
  1545. st.defaultValues = {left : 0 , top: 0 , opacity:(isMSIE('<=9')?1:'') , right:0 , bottom:0};
  1546. st.defaultValues[transform_css] = '';
  1547. //st.defaultValues[transform_orig_css] = '';
  1548. st.rf = 1;
  1549. st.presetEffParams = {
  1550. random: '30|300',
  1551. long : 300,
  1552. short : 30,
  1553. 'false' :false,
  1554. 'true' :true,
  1555. tl : 'top left' , bl: 'bottom left',
  1556. tr : 'top right' , br: 'bottom right',
  1557. rt : 'top right' , lb: 'bottom left',
  1558. lt : 'top left' , rb: 'bottom right',
  1559. t : 'top' , b : 'bottom',
  1560. r : 'right' , l : 'left',
  1561. c : 'center'
  1562. };
  1563. /*
  1564. ----------------------------------------
  1565. 2D Effects
  1566. ----------------------------------------
  1567. */
  1568. st.fade = function(){
  1569. return _fade;
  1570. };
  1571. st.left = (_2d)? function(dist , fade){
  1572. var r = fade === false ? {} : {opacity:0};
  1573. r[transform_css] = 'translateX(' + -dist*st.rf + 'px)';
  1574. return r;
  1575. } : function (dist, fade){
  1576. var r = fade === false ? {} : {opacity:0};
  1577. r.left = -dist*st.rf + 'px';
  1578. return r;
  1579. };
  1580. st.right = (_2d)? function(dist , fade){
  1581. var r = fade === false ? {} : {opacity:0};
  1582. r[transform_css] = 'translateX(' + dist*st.rf + 'px)';
  1583. return r;
  1584. } : function (dist, fade){
  1585. var r = fade === false ? {} : {opacity:0};
  1586. r.left = dist*st.rf + 'px';
  1587. return r;
  1588. };
  1589. st.top = (_2d)? function(dist , fade){
  1590. var r = fade === false ? {} : {opacity:0};
  1591. r[transform_css] = 'translateY(' + -dist*st.rf + 'px)';
  1592. return r;
  1593. } : function (dist, fade){
  1594. var r = fade === false ? {} : {opacity:0};
  1595. r.top = -dist*st.rf + 'px';
  1596. return r;
  1597. };
  1598. st.bottom = (_2d)? function(dist , fade){
  1599. var r = fade === false ? {} : {opacity:0};
  1600. r[transform_css] = 'translateY(' + dist*st.rf + 'px)';
  1601. return r;
  1602. } : function (dist, fade){
  1603. var r = fade === false ? {} : {opacity:0};
  1604. r.top = dist*st.rf + 'px';
  1605. return r;
  1606. };
  1607. st.from = (_2d)? function(leftdis , topdis , fade){
  1608. var r = fade === false ? {} : {opacity:0};
  1609. r[transform_css] = 'translateX('+leftdis*st.rf+'px) translateY(' + topdis*st.rf + 'px)';
  1610. return r;
  1611. } : function (leftdis , topdis, fade){
  1612. var r = fade === false ? {} : {opacity:0};
  1613. r.top = topdis*st.rf + 'px';
  1614. r.left = leftdis*st.rf + 'px';
  1615. return r;
  1616. };
  1617. // --------------------------------------------------------------------
  1618. st.rotate = (_2d)? function(deg , orig ){
  1619. var r = {opacity: 0};
  1620. r[transform_css] = ' rotate('+deg+'deg)';
  1621. if(orig) r[transform_orig_css] = orig;
  1622. return r;
  1623. } : function (deg, orig){
  1624. return _fade;
  1625. };
  1626. st.rotateleft = (_2d)? function(deg , dist , orig , fade){
  1627. var r = st.left(dist , fade);
  1628. r[transform_css] += ' rotate('+deg+'deg)';
  1629. if(orig) r[transform_orig_css] = orig;
  1630. return r;
  1631. } : function (deg , dist , orig , fade){
  1632. return st.left(dist , fade);
  1633. };
  1634. st.rotateright = (_2d)? function(deg , dist , orig , fade){
  1635. var r = st.right(dist , fade);
  1636. r[transform_css] += ' rotate('+deg+'deg)';
  1637. if(orig) r[transform_orig_css] = orig;
  1638. return r;
  1639. } : function (deg , dist , orig , fade){
  1640. return st.right(dist , fade);
  1641. };
  1642. st.rotatetop = (_2d)? function(deg , dist , orig , fade){
  1643. var r = st.top(dist , fade);
  1644. r[transform_css] += ' rotate('+deg+'deg)';
  1645. if(orig) r[transform_orig_css] = orig;
  1646. return r;
  1647. } : function (deg , dist , orig , fade){
  1648. return st.top(dist , fade);
  1649. };
  1650. st.rotatebottom = (_2d)? function(deg , dist , orig , fade){
  1651. var r = st.bottom(dist , fade);
  1652. r[transform_css] += ' rotate('+deg+'deg)';
  1653. if(orig) r[transform_orig_css] = orig;
  1654. return r;
  1655. } : function (deg , dist , orig , fade){
  1656. return st.bottom(dist , fade);
  1657. };
  1658. st.rotatefrom = (_2d)? function(deg , leftdis , topdis , orig , fade){
  1659. var r = st.from(leftdis , topdis , fade);
  1660. r[transform_css] += ' rotate('+deg+'deg)';
  1661. if(orig) r[transform_orig_css] = orig;
  1662. return r;
  1663. } : function (deg , leftdis , topdis , orig , fade){
  1664. return st.from(leftdis , topdis , fade);
  1665. };
  1666. st.skewleft = (_2d)? function(deg , dist , fade){
  1667. var r = st.left(dist , fade);
  1668. r[transform_css] += ' skewX(' + deg + 'deg)';
  1669. return r;
  1670. } : function (deg , dist , fade){
  1671. return st.left(dist , fade);
  1672. };
  1673. st.skewright = (_2d)? function(deg , dist , fade){
  1674. var r = st.right(dist , fade);
  1675. r[transform_css] += ' skewX(' + -deg + 'deg)';
  1676. return r;
  1677. } : function (deg , dist , fade){
  1678. return st.right(dist , fade);
  1679. };
  1680. st.skewtop = (_2d)? function(deg , dist , fade){
  1681. var r = st.top(dist , fade);
  1682. r[transform_css] += ' skewY(' + deg + 'deg)';
  1683. return r;
  1684. } : function (deg , dist , fade){
  1685. return st.top(dist , fade);
  1686. };
  1687. st.skewbottom = (_2d)? function(deg , dist , fade){
  1688. var r = st.bottom(dist , fade);
  1689. r[transform_css] += ' skewY(' + -deg + 'deg)';
  1690. return r;
  1691. } : function (deg , dist , fade){
  1692. return st.bottom(dist , fade);
  1693. };
  1694. st.scale = (_2d)? function(x , y , orig , fade){
  1695. var r = fade === false ? {} : {opacity:0};
  1696. r[transform_css] = ' scaleX('+x+') scaleY('+y+')';
  1697. if(orig) r[transform_orig_css] = orig;
  1698. return r;
  1699. } : function (x , y , orig , fade){
  1700. return fade === false ? {} : {opacity:0};
  1701. };
  1702. st.scaleleft = (_2d)? function(x , y , dist , orig , fade){
  1703. var r = st.left(dist , fade);
  1704. r[transform_css] = ' scaleX('+x+') scaleY('+y+')';
  1705. if(orig) r[transform_orig_css] = orig;
  1706. return r;
  1707. } : function (x , y , dist , orig , fade){
  1708. return st.left(dist , fade);
  1709. };
  1710. st.scaleright = (_2d)? function(x , y , dist , orig , fade){
  1711. var r = st.right(dist , fade);
  1712. r[transform_css] = ' scaleX('+x+') scaleY('+y+')';
  1713. if(orig) r[transform_orig_css] = orig;
  1714. return r;
  1715. } : function (x , y , dist , orig , fade){
  1716. return st.right(dist , fade);
  1717. };
  1718. st.scaletop = (_2d)? function(x , y , dist , orig , fade){
  1719. var r = st.top(dist , fade);
  1720. r[transform_css] = ' scaleX('+x+') scaleY('+y+')';
  1721. if(orig) r[transform_orig_css] = orig;
  1722. return r;
  1723. } : function (x , y , dist , orig , fade){
  1724. return st.top(dist , fade);
  1725. };
  1726. st.scalebottom = (_2d)? function(x , y , dist , orig , fade){
  1727. var r = st.bottom(dist , fade);
  1728. r[transform_css] = ' scaleX('+x+') scaleY('+y+')';
  1729. if(orig) r[transform_orig_css] = orig;
  1730. return r;
  1731. } : function (x , y , dist , orig , fade){
  1732. return st.bottom(dist , fade);
  1733. };
  1734. st.scalefrom = (_2d)? function(x , y , leftdis , topdis , orig , fade){
  1735. var r = st.from(leftdis , topdis , fade);
  1736. r[transform_css] += ' scaleX('+x+') scaleY('+y+')';
  1737. if(orig) r[transform_orig_css] = orig;
  1738. return r;
  1739. } : function (x , y , leftdis , topdis , orig , fade){
  1740. return st.from(leftdis , topdis , fade);
  1741. };
  1742. st.rotatescale = (_2d)? function(deg , x , y , orig , fade){
  1743. var r = st.scale(x , y , orig , fade);
  1744. r[transform_css] += ' rotate('+deg+'deg)';
  1745. if(orig) r[transform_orig_css] = orig;
  1746. return r;
  1747. } : function (deg , x , y , orig , fade){
  1748. return st.scale(x , y , orig , fade);
  1749. };
  1750. /*
  1751. ----------------------------------------
  1752. 3D Effects
  1753. ----------------------------------------
  1754. */
  1755. st.front = (window._css3d)? function(dist , fade){
  1756. var r = fade === false ? {} : {opacity:0};
  1757. r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + dist + 'px ) rotate(0.001deg)';
  1758. return r;
  1759. } : function (dist){
  1760. return _fade;
  1761. };
  1762. st.back = (window._css3d)? function(dist, fade){
  1763. var r = fade === false ? {} : {opacity:0};
  1764. r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + -dist + 'px ) rotate(0.001deg)';
  1765. return r;
  1766. } : function (dist){
  1767. return _fade;
  1768. };
  1769. st.rotatefront = (window._css3d)? function(deg , dist , orig , fade ){
  1770. var r = fade === false ? {} : {opacity:0};
  1771. r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + dist + 'px ) rotate('+ (deg || 0.001) +'deg)';
  1772. if(orig) r[transform_orig_css] = orig;
  1773. return r;
  1774. } : function (deg , dist , orig , fade ){
  1775. return _fade;
  1776. };
  1777. st.rotateback = (window._css3d)? function(deg , dist , orig , fade ){
  1778. var r = fade === false ? {} : {opacity:0};
  1779. r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + -dist + 'px ) rotate('+ (deg || 0.001) +'deg)';
  1780. if(orig) r[transform_orig_css] = orig;
  1781. return r;
  1782. } : function (deg , dist , orig , fade ){
  1783. return _fade;
  1784. };
  1785. st.rotate3dleft = (window._css3d)? function(x , y , z , dist , orig , fade){
  1786. var r = st.left(dist , fade);
  1787. r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
  1788. if(orig) r[transform_orig_css] = orig;
  1789. return r;
  1790. } : function (x , y , z , dist , orig , fade){
  1791. return st.left(dist , fade);;
  1792. };
  1793. st.rotate3dright = (window._css3d)? function(x , y , z , dist , orig , fade){
  1794. var r = st.right(dist , fade);
  1795. r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
  1796. if(orig) r[transform_orig_css] = orig;
  1797. return r;
  1798. } : function (x , y , z , dist , orig , fade){
  1799. return st.right(dist , fade);;
  1800. };
  1801. st.rotate3dtop = (window._css3d)? function(x , y , z , dist , orig , fade){
  1802. var r = st.top(dist , fade);
  1803. r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
  1804. if(orig) r[transform_orig_css] = orig;
  1805. return r;
  1806. } : function (x , y , z , dist , orig , fade){
  1807. return st.top(dist , fade);;
  1808. };
  1809. st.rotate3dbottom = (window._css3d)? function(x , y , z , dist , orig , fade){
  1810. var r = st.bottom(dist , fade);
  1811. r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
  1812. if(orig) r[transform_orig_css] = orig;
  1813. return r;
  1814. } : function (x , y , z , dist , orig , fade){
  1815. return st.bottom(dist , fade);
  1816. };
  1817. st.rotate3dfront = (window._css3d)? function(x , y , z , dist , orig , fade){
  1818. var r = st.front(dist , fade);
  1819. r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
  1820. if(orig) r[transform_orig_css] = orig;
  1821. return r;
  1822. } : function (x , y , z , dist , orig , fade){
  1823. return st.front(dist , fade);
  1824. };
  1825. st.rotate3dback = (window._css3d)? function(x , y , z , dist , orig , fade){
  1826. var r = st.back(dist , fade);
  1827. r[transform_css] += (x?' rotateX('+x+'deg)' : ' ')+(y?' rotateY('+y+'deg)' : '')+(z?' rotateZ('+z+'deg)' : '');
  1828. if(orig) r[transform_orig_css] = orig;
  1829. return r;
  1830. } : function (x , y , z , dist , orig , fade){
  1831. return st.back(dist , fade);
  1832. };
  1833. // transform effect
  1834. st.t = (window._css3d)? function(fade,tx,ty,tz,r,rx,ry,rz,scx,scy,skx,sky,ox,oy,oz){
  1835. var _r = fade === false ? {} : {opacity:0};
  1836. var transform = 'perspective(2000px) ';
  1837. tx !== 'n' && (transform += 'translateX(' + tx * st.rf + 'px) ');
  1838. ty !== 'n' && (transform += 'translateY(' + ty * st.rf + 'px) ');
  1839. tz !== 'n' && (transform += 'translateZ(' + tz * st.rf + 'px) ');
  1840. r !== 'n' && (transform += 'rotate(' + r + 'deg) ');
  1841. rx !== 'n' && (transform += 'rotateX(' + rx + 'deg) ');
  1842. ry !== 'n' && (transform += 'rotateY(' + ry + 'deg) ');
  1843. rz !== 'n' && (transform += 'rotateZ(' + rz + 'deg) ');
  1844. skx !== 'n' && (transform += 'skewX(' + skx + 'deg) ');
  1845. sky !== 'n' && (transform += 'skewY(' + sky + 'deg) ');
  1846. scx !== 'n' && (transform += 'scaleX(' + scx + ') ');
  1847. scy !== 'n' && (transform += 'scaleY(' + scy + ')');
  1848. _r[transform_css] = transform;
  1849. var trans_origin = '';
  1850. trans_origin += (ox !== 'n' ? ox + '% ' : '50% ');
  1851. trans_origin += (oy !== 'n' ? oy + '% ' : '50% ');
  1852. trans_origin += (oz !== 'n' ? oz + 'px' : '');
  1853. _r[transform_orig_css] = trans_origin;
  1854. return _r;
  1855. } : function(fade,tx,ty,tz,r,rx,ry,rz,scx,scy,skx,sky,ox,oy,oz) {
  1856. var r = fade === false ? {} : {opacity:0};
  1857. tx !== 'n' && (r.left = tx * st.rf + 'px');
  1858. ty !== 'n' && (r.top = ty * st.rf + 'px');
  1859. return r;
  1860. }
  1861. };
  1862. })(jQuery);
  1863. /* ================== bin-debug/js/pro/layers/LayerElement.js =================== */
  1864. /**
  1865. * Master Slider Layer Element
  1866. * @author Averta
  1867. * @package Master Slider jQuery
  1868. */
  1869. ;(function($){
  1870. /**
  1871. * master slider layer element constructor
  1872. */
  1873. window.MSLayerElement = function(){
  1874. // default layer start animation
  1875. this.start_anim = {
  1876. name : 'fade',
  1877. duration : 1000,
  1878. ease : 'linear',
  1879. delay : 0
  1880. };
  1881. // default layer end animation
  1882. this.end_anim = {
  1883. duration : 1000,
  1884. ease : 'linear'
  1885. };
  1886. // default layer type
  1887. this.type = 'text'; // video , image
  1888. //this.swipe = true;
  1889. this.resizable = true;
  1890. this.minWidth = -1;
  1891. this.isVisible = true;
  1892. // list of styles which should stores initial values and changes based on screen size for resizable layers
  1893. this.__cssConfig = [
  1894. 'margin-top' , 'padding-top' ,
  1895. 'margin-bottom' , 'padding-left' ,
  1896. 'margin-right' , 'padding-right' ,
  1897. 'margin-left' , 'padding-bottom' ,
  1898. 'font-size' , 'line-height' ,
  1899. /*'height' , */ 'width' ,
  1900. 'left' , 'right' ,
  1901. 'top' , 'bottom'
  1902. ];
  1903. this.baseStyle = {};
  1904. };
  1905. var p = MSLayerElement.prototype;
  1906. /*--------------------------------------------------*\
  1907. Public Methods
  1908. \*--------------------------------------------------*/
  1909. /**
  1910. * determine start animation for the layer
  1911. * @param {Objec} anim
  1912. */
  1913. p.setStartAnim = function(anim){
  1914. $.extend(this.start_anim , anim); $.extend(this.start_anim, this._parseEff(this.start_anim.name));
  1915. this.$element.css('visibility' , 'hidden');
  1916. };
  1917. /**
  1918. * determine end/hide animation for the layer
  1919. * @param {Object} anim
  1920. */
  1921. p.setEndAnim = function(anim){
  1922. $.extend(this.end_anim, anim);
  1923. };
  1924. /**
  1925. * create layer object from layer element
  1926. */
  1927. p.create = function(){
  1928. this.$element.css('display', 'none');
  1929. // resizable layer
  1930. this.resizable = this.$element.data('resize') !== false;
  1931. // fixed positioning
  1932. this.fixed = this.$element.data('fixed') === true;
  1933. // hide under parameter
  1934. if( this.$element.data('widthlimit') !== undefined ) {
  1935. this.minWidth = this.$element.data('widthlimit');
  1936. }
  1937. if( !this.end_anim.name ) {
  1938. this.end_anim.name = this.start_anim.name;
  1939. }
  1940. if( this.end_anim.time ) {
  1941. this.autoHide = true;//this.end_anim.delay = this.slide.delay * 1000 - this.end_anim.duration;
  1942. }
  1943. // is this layer static?
  1944. this.staticLayer = this.$element.data('position') === 'static';
  1945. this.fixedLayer = this.$element.data('position') === 'fixed';
  1946. this.layersCont = this.controller.$layers;
  1947. // make it visible if it's static
  1948. if ( this.staticLayer ) {
  1949. this.$element.css('display', '')
  1950. .css('visibility', '');
  1951. }
  1952. // create action event
  1953. // @since v1.7.2
  1954. if( this.$element.data('action') !== undefined ) {
  1955. var slideController = this.slide.slider.slideController;
  1956. this.$element.on('click', function(event){
  1957. slideController.runAction($(this).data('action'));
  1958. event.preventDefault();
  1959. }).addClass('ms-action-layer');
  1960. }
  1961. $.extend(this.end_anim , this._parseEff(this.end_anim.name));
  1962. this.slider = this.slide.slider;
  1963. // new alignment method
  1964. // @since v1.6.1
  1965. var layerOrigin = this.layerOrigin = this.$element.data('origin');
  1966. if ( layerOrigin ){
  1967. var vOrigin = layerOrigin.charAt(0),
  1968. hOrigin = layerOrigin.charAt(1),
  1969. offsetX = this.$element.data('offset-x'),
  1970. offsetY = this.$element.data('offset-y');
  1971. if( offsetY === undefined ){
  1972. offsetY = 0;
  1973. }
  1974. switch ( vOrigin ){
  1975. case 't':
  1976. this.$element[0].style.top = offsetY + 'px';
  1977. break;
  1978. case 'b':
  1979. this.$element[0].style.bottom = offsetY + 'px';
  1980. break;
  1981. case 'm':
  1982. this.$element[0].style.top = offsetY + 'px';
  1983. this.middleAlign = true;
  1984. }
  1985. if( offsetX === undefined ){
  1986. offsetX = 0;
  1987. }
  1988. switch ( hOrigin ){
  1989. case 'l':
  1990. this.$element[0].style.left = offsetX + 'px';
  1991. break;
  1992. case 'r':
  1993. this.$element[0].style.right = offsetX + 'px';
  1994. break;
  1995. case 'c':
  1996. this.$element[0].style.left = offsetX + 'px';
  1997. this.centerAlign = true;
  1998. }
  1999. }
  2000. // parallax effect
  2001. // @since v1.6.0
  2002. this.parallax = this.$element.data('parallax')
  2003. if( this.parallax != null ) {
  2004. this.parallax /= 100;
  2005. this.$parallaxElement = $('<div></div>').addClass('ms-parallax-layer');
  2006. if( this.link ) { // only for image layer
  2007. this.link.wrap(this.$parallaxElement);
  2008. this.$parallaxElement = this.link.parent();
  2009. } else {
  2010. this.$element.wrap(this.$parallaxElement);
  2011. this.$parallaxElement = this.$element.parent();
  2012. }
  2013. this._lastParaX = 0;
  2014. this._lastParaY = 0;
  2015. this._paraX = 0;
  2016. this._paraY = 0;
  2017. // add bottom 0 to the parallax element if layer origin specified to the bottom
  2018. this.alignedToBot = this.layerOrigin && this.layerOrigin.indexOf('b') !== -1;
  2019. if( this.alignedToBot ) {
  2020. this.$parallaxElement.css('bottom', 0);
  2021. }
  2022. if( window._css3d ){
  2023. this.parallaxRender = this._parallaxCSS3DRenderer;
  2024. } else if ( window._css2d ){
  2025. this.parallaxRender = this._parallaxCSS2DRenderer;
  2026. } else {
  2027. this.parallaxRender = this._parallax2DRenderer;
  2028. }
  2029. if( this.slider.options.parallaxMode !== 'swipe' ){ // mouse mode
  2030. averta.Ticker.add(this.parallaxRender, this);
  2031. }
  2032. }
  2033. // remove all data- attributes excluding data-src
  2034. $.removeDataAttrs(this.$element, ['data-src']);
  2035. };
  2036. /**
  2037. * initialize layer
  2038. */
  2039. p.init = function(){
  2040. //if(this.initialized) return;
  2041. this.initialized = true;
  2042. var value;
  2043. this.$element.css('visibility' , '');
  2044. // store initial layer styles
  2045. for(var i = 0 , l = this.__cssConfig.length; i < l ; i ++){
  2046. var key = this.__cssConfig[i];
  2047. if( this.type === 'text' && key === 'width'){ // in some browsers using computed style for width in text layer causes unexpected word wrapping
  2048. value = this.$element[0].style.width;
  2049. } else {
  2050. value = this.$element.css(key);
  2051. // fix for Google Chrome in ios, sometimes image layers over first slide not showing correctly.
  2052. if ( (key === 'width' || key === 'height') && value === '0px' ) {
  2053. value = this.$element.data(key) + 'px';
  2054. }
  2055. }
  2056. if( value != 'auto' && value != "" && value != "normal" ) {
  2057. this.baseStyle[key] = parseInt(value);
  2058. }
  2059. }
  2060. // @since v1.6.0
  2061. if ( this.middleAlign ){
  2062. this.baseHeight = this.$element.outerHeight(false);//this.$element.height();
  2063. }
  2064. if ( this.centerAlign ){
  2065. // in some browsers using computed style for width in text layer causes unexpected word wrapping
  2066. //if ( this.type === 'text' ){
  2067. // this.baseWidth = parseInt(this.$element[0].style.width);
  2068. //} else {
  2069. this.baseWidth = this.$element.outerWidth(false);
  2070. //}
  2071. }
  2072. };
  2073. /**
  2074. * locate layer over slider
  2075. */
  2076. p.locate = function(){
  2077. // is slide ready?
  2078. if ( !this.slide.ready ) {
  2079. return;
  2080. }
  2081. var width = parseFloat(this.layersCont.css('width')),
  2082. height = parseFloat(this.layersCont.css('height')),
  2083. factor, isPosition;
  2084. if( !this.staticLayer && this.$element.css('display') === 'none' && this.isVisible) {
  2085. this.$element.css('display', '')
  2086. .css('visibility', 'hidden');
  2087. }
  2088. factor = this.resizeFactor = width / this.slide.slider.options.width;
  2089. // updated @since v1.6.1
  2090. for (var key in this.baseStyle) {
  2091. isPosition = key === 'top' || key === 'left' || key === 'bottom' || key === 'right';
  2092. //switch resize/position factor
  2093. if( this.fixed && isPosition ){
  2094. factor = 1;
  2095. } else {
  2096. factor = this.resizeFactor;
  2097. }
  2098. if( !this.resizable && !isPosition ){
  2099. continue;
  2100. }
  2101. if ( key === 'top' && this.middleAlign ){
  2102. this.$element[0].style.top = '0px';
  2103. this.baseHeight = this.$element.outerHeight(false);
  2104. this.$element[0].style.top = this.baseStyle['top'] * factor + (height - this.baseHeight) / 2 + 'px';
  2105. } else if ( key === 'left' && this.centerAlign ){
  2106. this.$element[0].style.left = '0px';
  2107. this.baseWidth = this.$element.outerWidth(false);
  2108. this.$element[0].style.left = this.baseStyle['left'] * factor + (width - this.baseWidth) / 2 + 'px';
  2109. } else {
  2110. this.$element.css(key , this.baseStyle[key] * factor + 'px');
  2111. }
  2112. }
  2113. this.visible(this.minWidth < width);
  2114. };
  2115. /**
  2116. * start layer animation
  2117. */
  2118. p.start = function(){
  2119. // is it already showing or is it a static layer?
  2120. if ( this.isShowing || this.staticLayer ) {
  2121. return;
  2122. }
  2123. this.isShowing = true;
  2124. var key , base;
  2125. // reads css value form LayerEffects
  2126. MSLayerEffects.rf = this.resizeFactor;
  2127. var effect_css = MSLayerEffects[this.start_anim.eff_name].apply(null , this._parseEffParams(this.start_anim.eff_params));
  2128. // checkes effect css and defines TO css values
  2129. var start_css_eff = {};
  2130. // set from position
  2131. for(key in effect_css){
  2132. // check the position key (top, left, right or bottom) for animatin
  2133. // It mostly will be used in old browsers
  2134. // In effect left:100, layer base style right:300 -> effect changes to right:100
  2135. if( this._checkPosKey(key , effect_css) ){
  2136. continue;
  2137. }
  2138. // set default value from Layer Effects Class
  2139. if( MSLayerEffects.defaultValues[key] != null ){
  2140. start_css_eff[key] = MSLayerEffects.defaultValues[key];
  2141. }
  2142. if( key in this.baseStyle ){
  2143. base = this.baseStyle[key];
  2144. // updated @since v1.6.1
  2145. if ( this.middleAlign && key === 'top' ){
  2146. base += (parseInt(this.layersCont.height()) - this.$element.outerHeight(false)) / 2;
  2147. }
  2148. if ( this.centerAlign && key === 'left' ){
  2149. base += (parseInt(this.layersCont.width()) - this.$element.outerWidth(false)) / 2;
  2150. }
  2151. //----------------------
  2152. effect_css[key] = base + parseFloat(effect_css[key]) + 'px';
  2153. start_css_eff[key] = base + 'px';
  2154. }
  2155. this.$element.css(key , effect_css[key]);
  2156. }
  2157. var that = this;
  2158. clearTimeout(this.to);
  2159. this.to = setTimeout(function(){
  2160. //that.locate();
  2161. that.$element.css('visibility', '');
  2162. that._playAnimation(that.start_anim , start_css_eff);
  2163. } , that.start_anim.delay || 0.01);
  2164. this.clTo = setTimeout(function(){
  2165. that.show_cl = true;
  2166. },(this.start_anim.delay || 0.01) + this.start_anim.duration);
  2167. if( this.autoHide ){
  2168. clearTimeout(this.hto);
  2169. this.hto = setTimeout(function(){that.hide();} , that.end_anim.time );
  2170. }
  2171. };
  2172. /**
  2173. * starts hide animation
  2174. */
  2175. p.hide = function(){
  2176. // static layers doesn't support animations
  2177. if ( this.staticLayer ) {
  2178. return;
  2179. }
  2180. this.isShowing = false;
  2181. // reads css value form LayerEffects
  2182. var effect_css = MSLayerEffects[this.end_anim.eff_name].apply(null , this._parseEffParams(this.end_anim.eff_params));
  2183. for(key in effect_css){
  2184. if(this._checkPosKey(key , effect_css)) continue;
  2185. if( key === window._jcsspfx + 'TransformOrigin' ){
  2186. this.$element.css(key , effect_css[key]);
  2187. }
  2188. if(key in this.baseStyle){
  2189. effect_css[key] = this.baseStyle[key] + parseFloat(effect_css[key]) + 'px';
  2190. }
  2191. }
  2192. this._playAnimation(this.end_anim , effect_css);
  2193. clearTimeout(this.to);
  2194. clearTimeout(this.hto);
  2195. clearTimeout(this.clTo);
  2196. };
  2197. /**
  2198. * reset layer
  2199. */
  2200. p.reset = function(){
  2201. if ( this.staticLayer ) {
  2202. return;
  2203. }
  2204. this.isShowing = false;
  2205. //this.$element.css(window._csspfx + 'animation-name', '' );
  2206. this.$element[0].style.display = 'none';
  2207. this.$element.css('opacity', '');
  2208. this.$element[0].style['transitionDuration'] = '';
  2209. if(this.show_tween)
  2210. this.show_tween.stop(true);
  2211. clearTimeout(this.to);
  2212. clearTimeout(this.hto);
  2213. };
  2214. /**
  2215. * destroy layer
  2216. */
  2217. p.destroy = function(){
  2218. this.reset();
  2219. this.$element.remove();
  2220. };
  2221. /**
  2222. * change the visibility status
  2223. * @param {Boolean} value
  2224. */
  2225. p.visible = function(value){
  2226. if(this.isVisible == value) return;
  2227. this.isVisible = value;
  2228. this.$element.css('display' , (value ? '' : 'none'));
  2229. };
  2230. /**
  2231. * Change the detestation of parallax position
  2232. * @param {Number} x
  2233. * @param {Number} y
  2234. * @since 1.6.0
  2235. */
  2236. p.moveParallax = function(x, y , fast){
  2237. this._paraX = x;
  2238. this._paraY = y;
  2239. if( fast ){
  2240. this._lastParaX = x;
  2241. this._lastParaY = y;
  2242. this.parallaxRender();
  2243. }
  2244. };
  2245. /*------------------------------------*\
  2246. Private Methods
  2247. \*------------------------------------*/
  2248. /**
  2249. * play layer animation
  2250. * @param {Obeject} animation layer animation object
  2251. * @param {Object} css animation css object
  2252. */
  2253. p._playAnimation = function(animation , css){
  2254. var options = {};
  2255. if(animation.ease){
  2256. options.ease = animation.ease;
  2257. }
  2258. options.transProperty = window._csspfx + 'transform,opacity';
  2259. this.show_tween = CTween.animate(this.$element, animation.duration , css , options);
  2260. };
  2261. /**
  2262. * generate random value
  2263. * @param {String} value the pattern value min|max
  2264. * @return {Number}
  2265. */
  2266. p._randomParam = function(value){
  2267. var min = Number(value.slice(0,value.indexOf('|')));
  2268. var max = Number(value.slice(value.indexOf('|')+1));
  2269. return min + Math.random() * (max - min);
  2270. };
  2271. /**
  2272. * parse effect function
  2273. * @param {String} eff_name effect function
  2274. * @return {Object}
  2275. */
  2276. p._parseEff = function(eff_name){
  2277. var eff_params = [];
  2278. if ( eff_name.indexOf('(') !== -1 ) {
  2279. var temp = eff_name.slice(0 , eff_name.indexOf('(')).toLowerCase();
  2280. var value;
  2281. eff_params = eff_name.slice(eff_name.indexOf('(') + 1 , -1).replace(/\"|\'|\s/g , '').split(',');
  2282. eff_name = temp;
  2283. for ( var i = 0, l = eff_params.length; i < l; ++i) {
  2284. value = eff_params[i];
  2285. if ( value in MSLayerEffects.presetEffParams) {
  2286. value = MSLayerEffects.presetEffParams[value];
  2287. }
  2288. eff_params[i] = value;
  2289. }
  2290. }
  2291. return {eff_name:eff_name , eff_params:eff_params};
  2292. };
  2293. /**
  2294. * parse effect function parameters
  2295. * @param {Aarray} params effect parameters
  2296. * @return {Array}
  2297. */
  2298. p._parseEffParams = function(params){
  2299. var eff_params = [];
  2300. for(var i = 0 , l = params.length; i < l ; ++i){
  2301. var value = params[i];
  2302. if(typeof value === 'string' && value.indexOf('|') !== -1) value = this._randomParam(value);
  2303. eff_params[i] = value;
  2304. }
  2305. return eff_params;
  2306. };
  2307. /**
  2308. * calculates layer position based on initial positioning style and layer effect
  2309. * @param {string} key positioning key
  2310. * @param {Object} style style object
  2311. * @return {Boolean}
  2312. */
  2313. p._checkPosKey = function(key , style){
  2314. if(key === 'left' && !(key in this.baseStyle) && 'right' in this.baseStyle){
  2315. style.right = -parseInt(style.left) + 'px';
  2316. delete style.left;
  2317. return true;
  2318. }
  2319. if(key === 'top' && !(key in this.baseStyle) && 'bottom' in this.baseStyle){
  2320. style.bottom = -parseInt(style.top) + 'px';
  2321. delete style.top;
  2322. return true;
  2323. }
  2324. return false;
  2325. };
  2326. /**
  2327. * calculate parallax position
  2328. */
  2329. p._parallaxCalc = function(){
  2330. var x_def = this._paraX - this._lastParaX,
  2331. y_def = this._paraY - this._lastParaY;
  2332. this._lastParaX += x_def / 12;
  2333. this._lastParaY += y_def / 12;
  2334. if( Math.abs( x_def ) < 0.019 ) {
  2335. this._lastParaX = this._paraX;
  2336. }
  2337. if( Math.abs( y_def ) < 0.019 ) {
  2338. this._lastParaY = this._paraY;
  2339. }
  2340. }
  2341. /**
  2342. * Parallax move ticker function
  2343. */
  2344. p._parallaxCSS3DRenderer = function(){
  2345. this._parallaxCalc();
  2346. this.$parallaxElement[0].style[window._jcsspfx + 'Transform'] = 'translateX(' + this._lastParaX * this.parallax + 'px) translateY(' + this._lastParaY * this.parallax + 'px) translateZ(0)';
  2347. };
  2348. /**
  2349. * parallax move ticker for CSS2 browsers
  2350. * @return {[type]} [description]
  2351. */
  2352. p._parallaxCSS2DRenderer = function(){
  2353. this._parallaxCalc();
  2354. this.$parallaxElement[0].style[window._jcsspfx + 'Transform'] = 'translateX(' + this._lastParaX * this.parallax + 'px) translateY(' + this._lastParaY * this.parallax + 'px)';
  2355. };
  2356. /**
  2357. * parallax move ticker for zombie browsers
  2358. */
  2359. p._parallax2DRenderer = function(){
  2360. this._parallaxCalc();
  2361. // change bottom instead of top if layer aligned to the bottom (origin)
  2362. if( this.alignedToBot ) {
  2363. this.$parallaxElement[0].style.bottom = this._lastParaY * this.parallax + 'px';
  2364. } else {
  2365. this.$parallaxElement[0].style.top = this._lastParaY * this.parallax + 'px';
  2366. }
  2367. this.$parallaxElement[0].style.left = this._lastParaX * this.parallax + 'px';
  2368. };
  2369. })(jQuery);
  2370. /* ================== bin-debug/js/pro/layers/ImageLayerElement.js =================== */
  2371. ;(function($){
  2372. window.MSImageLayerElement = function(){
  2373. MSLayerElement.call(this);
  2374. this.needPreload = true;
  2375. this.__cssConfig = [
  2376. 'width' , 'height' ,
  2377. 'margin-top' , 'padding-top' ,
  2378. 'margin-bottom' , 'padding-left' ,
  2379. 'margin-right' , 'padding-right' ,
  2380. 'margin-left' , 'padding-bottom' ,
  2381. 'left' , 'right' ,
  2382. 'top' , 'bottom'
  2383. ];
  2384. this.type = 'image';
  2385. };
  2386. MSImageLayerElement.extend(MSLayerElement);
  2387. var p = MSImageLayerElement.prototype;
  2388. var _super = MSLayerElement.prototype;
  2389. /*-------------- METHODS --------------*/
  2390. p.create = function(){
  2391. if(this.link){
  2392. var p = this.$element.parent();
  2393. p.append(this.link);
  2394. this.link.append(this.$element);
  2395. this.link.removeClass('ms-layer');
  2396. this.$element.addClass('ms-layer');
  2397. p = null;
  2398. }
  2399. _super.create.call(this);
  2400. if(this.$element.data('src') != undefined){
  2401. this.img_src = this.$element.data('src');
  2402. this.$element.removeAttr('data-src');
  2403. }else{
  2404. var that = this;
  2405. this.$element.on('load', function(event){
  2406. that.controller.preloadCount--;
  2407. if(that.controller.preloadCount === 0)
  2408. that.controller._onlayersReady();
  2409. }).each($.jqLoadFix);
  2410. }
  2411. if($.browser.msie)
  2412. this.$element.on('dragstart', function(event) { event.preventDefault(); }); // disable native dragging
  2413. };
  2414. p.loadImage = function(){
  2415. var that = this;
  2416. this.$element.preloadImg(this.img_src , function(event){
  2417. //this.$element.width(event.width).height(event.height);
  2418. that.controller.preloadCount--;
  2419. if(that.controller.preloadCount === 0) that.controller._onlayersReady();
  2420. });
  2421. };
  2422. })(jQuery);
  2423. /* ================== bin-debug/js/pro/layers/VideoLayerElement.js =================== */
  2424. ;(function($){
  2425. window.MSVideoLayerElement = function(){
  2426. MSLayerElement.call(this);
  2427. this.__cssConfig.push(
  2428. 'height'
  2429. );
  2430. this.type = 'video';
  2431. };
  2432. MSVideoLayerElement.extend(MSLayerElement);
  2433. var p = MSVideoLayerElement.prototype;
  2434. var _super = MSLayerElement.prototype;
  2435. /*-------------- METHODS --------------*/
  2436. p.__playVideo = function(){
  2437. if(this.img)CTween.fadeOut(this.img , 500 , 2);
  2438. CTween.fadeOut(this.video_btn , 500 , 2);
  2439. this.video_frame.attr('src' , 'about:blank').css('display' , 'block');
  2440. if(this.video_url.indexOf('?') == -1) this.video_url += '?';
  2441. this.video_frame.attr('src' , this.video_url + '&autoplay=1');
  2442. };
  2443. p.start = function(){
  2444. _super.start.call(this);
  2445. if ( this.$element.data('autoplay') ) {
  2446. this.__playVideo();
  2447. }
  2448. };
  2449. p.reset = function(){
  2450. _super.reset.call(this);
  2451. if(this.needPreload || this.$element.data('btn')){
  2452. this.video_btn.css('opacity' , 1).css('display', 'block');
  2453. this.video_frame.attr('src' , 'about:blank').css('display' , 'none');
  2454. }
  2455. if(this.needPreload){
  2456. this.img.css('opacity' , 1).css('display', 'block');
  2457. return;
  2458. }
  2459. this.video_frame.attr('src' , this.video_url);
  2460. };
  2461. p.create = function(){
  2462. _super.create.call(this);
  2463. this.video_frame = this.$element.find('iframe').css({width:'100%' , height:'100%'});
  2464. this.video_url = this.video_frame.attr('src');
  2465. var has_img = this.$element.has('img').length != 0;
  2466. if(!has_img && !this.$element.data('btn')) return;
  2467. this.video_frame.attr('src' , 'about:blank').css('display' , 'none');
  2468. var that = this;
  2469. this.video_btn = $('<div></div>').appendTo(this.$element).addClass('ms-video-btn').click(function() {
  2470. that.__playVideo();
  2471. });
  2472. //this.video_frame.attr('src' , 'about:blank');
  2473. if(!has_img) return;
  2474. this.needPreload = true;
  2475. this.img = this.$element.find('img:first').addClass('ms-video-img');
  2476. if(this.img.data('src') !== undefined){
  2477. this.img_src = this.img.data('src');
  2478. this.img.removeAttr('data-src');
  2479. }else{
  2480. var that = this;
  2481. this.img.attr('src' , this.img_src).on('load', function(event) {
  2482. that.controller.preloadCount--;
  2483. if(that.controller.preloadCount === 0)
  2484. that.controller._onlayersReady();
  2485. }).each($.jqLoadFix);
  2486. }
  2487. if($.browser.msie)
  2488. this.img.on('dragstart', function(event) { event.preventDefault(); }); // disables native dragging
  2489. };
  2490. p.loadImage = function(){
  2491. var that = this;
  2492. this.img.preloadImg(this.img_src, function(event) {
  2493. that.controller.preloadCount--;
  2494. if(that.controller.preloadCount === 0) that.controller._onlayersReady();
  2495. });
  2496. };
  2497. })(jQuery);
  2498. /* ================== bin-debug/js/pro/layers/HotspotLayer.js =================== */
  2499. ;(function($){
  2500. "use strict";
  2501. window.MSHotspotLayer = function(){
  2502. MSLayerElement.call(this);
  2503. this.__cssConfig = [
  2504. 'margin-top' , 'padding-top' ,
  2505. 'margin-bottom' , 'padding-left' ,
  2506. 'margin-right' , 'padding-right' ,
  2507. 'margin-left' , 'padding-bottom' ,
  2508. 'left' , 'right' ,
  2509. 'top' , 'bottom'
  2510. ];
  2511. this.ease = 'Expo';
  2512. this.hide_start = true;
  2513. this.type = 'hotspot';
  2514. };
  2515. MSHotspotLayer.extend(MSLayerElement);
  2516. var p = MSHotspotLayer.prototype;
  2517. var _super = MSLayerElement.prototype;
  2518. /*-------------- METHODS --------------*/
  2519. p._showTT = function(){
  2520. if(!this.show_cl) return;
  2521. clearTimeout(this.hto);
  2522. if(this._tween) this._tween.stop(true);
  2523. if( this.hide_start ){
  2524. this.align = this._orgAlign;
  2525. this._locateTT();
  2526. this.tt.css({display:'block'});
  2527. this._tween = CTween.animate(this.tt , 900 , this.to , {ease:'easeOut'+this.ease});
  2528. this.hide_start = false;
  2529. }
  2530. };
  2531. p._hideTT = function(){
  2532. if(!this.show_cl) return;
  2533. if(this._tween) this._tween.stop(true);
  2534. var that = this;
  2535. clearTimeout(this.hto);
  2536. this.hto = setTimeout(function(){
  2537. that.hide_start = true;
  2538. that._tween = CTween.animate(that.tt , 900 , that.from , {ease:'easeOut'+that.ease , complete:function(){that.tt.css('display' , 'none');}} );
  2539. } , 200);
  2540. };
  2541. p._updateClassName = function(name){
  2542. if(this._lastClass) this.tt.removeClass(this._lastClass);
  2543. this.tt.addClass(name);
  2544. this._lastClass = name;
  2545. }
  2546. p._alignPolicy = function(){
  2547. var h = this.tt.outerHeight(false),
  2548. w = Math.max(this.tt.outerWidth(false) , parseInt(this.tt.css('max-width'))),
  2549. ww = window.innerWidth,
  2550. wh = window.innerHeight;
  2551. switch(this.align){
  2552. case 'top':
  2553. if(this.base_t < 0 )
  2554. return 'bottom';
  2555. break;
  2556. case 'right':
  2557. if(this.base_l + w > ww || this.base_t < 0)
  2558. return 'bottom';
  2559. break;
  2560. case 'left':
  2561. if(this.base_l < 0 || this.base_t < 0)
  2562. return 'bottom';
  2563. break;
  2564. }
  2565. return null;
  2566. };
  2567. p._locateTT = function(){
  2568. var os = this.$element.offset(),
  2569. os2 = this.slide.slider.$element.offset();
  2570. var dist = 50,
  2571. space = 15 //* this.factor;
  2572. this.pos_x = os.left - os2.left - this.slide.slider.$element.scrollLeft();
  2573. this.pos_y = os.top - os2.top - this.slide.slider.$element.scrollTop();
  2574. this.from = {opacity:0};
  2575. this.to = {opacity:1};
  2576. this._updateClassName('ms-tooltip-'+this.align);
  2577. this.tt_arrow.css('margin-left' , '');
  2578. var arrow_w = 15,//parseInt(this.tt_arrow.css('border-left')) + parseInt(this.tt_arrow.css('border-right')),
  2579. arrow_h = 15;//parseInt(this.tt_arrow.css('border-top')) + parseInt(this.tt_arrow.css('border-bottom'));
  2580. //console.log(arrow_h,arrow_w);
  2581. //
  2582. switch(this.align){
  2583. case 'top':
  2584. var w = Math.min(this.tt.outerWidth(false) , parseInt(this.tt.css('max-width')));
  2585. this.base_t = this.pos_y - this.tt.outerHeight(false) - arrow_h - space;
  2586. this.base_l = this.pos_x - w/2;
  2587. if(this.base_l + w > window.innerWidth){
  2588. this.tt_arrow.css('margin-left' , -arrow_w/2 + this.base_l + w -window.innerWidth + 'px');
  2589. this.base_l = window.innerWidth - w;
  2590. }
  2591. if(this.base_l < 0){
  2592. this.base_l = 0;
  2593. this.tt_arrow.css('margin-left' , -arrow_w/2 + this.pos_x - this.tt.outerWidth(false) / 2 + 'px');
  2594. }
  2595. if(window._css3d){
  2596. this.from[window._jcsspfx+'Transform'] = 'translateY(-'+dist+'px)';
  2597. this.to[window._jcsspfx+'Transform'] = '';
  2598. }else{
  2599. this.from.top = (this.base_t - dist) + 'px';
  2600. this.to.top = this.base_t + 'px';
  2601. }
  2602. break;
  2603. case 'bottom':
  2604. var w = Math.min(this.tt.outerWidth(false) , parseInt(this.tt.css('max-width')));
  2605. this.base_t = this.pos_y + arrow_h + space;
  2606. this.base_l = this.pos_x - w/2;
  2607. if(this.base_l + w > window.innerWidth){
  2608. this.tt_arrow.css('margin-left' , -arrow_w/2 + this.base_l + w -window.innerWidth + 'px');
  2609. this.base_l = window.innerWidth - w;
  2610. }
  2611. if(this.base_l < 0){
  2612. this.base_l = 0;
  2613. this.tt_arrow.css('margin-left' , -arrow_w/2 + this.pos_x - this.tt.outerWidth(false) / 2 + 'px');
  2614. }
  2615. if(window._css3d){
  2616. this.from[window._jcsspfx+'Transform'] = 'translateY('+dist+'px)';
  2617. this.to[window._jcsspfx+'Transform'] = '';
  2618. }else{
  2619. this.from.top = (this.base_t + dist) + 'px';
  2620. this.to.top = this.base_t + 'px';
  2621. }
  2622. break;
  2623. case 'right':
  2624. this.base_l = this.pos_x + arrow_w + space;
  2625. this.base_t = this.pos_y - this.tt.outerHeight(false) / 2;
  2626. if(window._css3d){
  2627. this.from[window._jcsspfx+'Transform'] = 'translateX('+dist+'px)';
  2628. this.to[window._jcsspfx+'Transform'] = '';
  2629. }else{
  2630. this.from.left = (this.base_l + dist) + 'px';
  2631. this.to.left = this.base_l + 'px';
  2632. }
  2633. break;
  2634. case 'left':
  2635. this.base_l = this.pos_x - arrow_w - this.tt.outerWidth(false) - space;
  2636. this.base_t = this.pos_y - this.tt.outerHeight(false) / 2;
  2637. if(window._css3d){
  2638. this.from[window._jcsspfx+'Transform'] = 'translateX(-'+dist+'px)';
  2639. this.to[window._jcsspfx+'Transform'] = '';
  2640. }else{
  2641. this.from.left = (this.base_l - dist) + 'px';
  2642. this.to.left = this.base_l + 'px';
  2643. }
  2644. break;
  2645. }
  2646. var policyAlign = this._alignPolicy();
  2647. if(policyAlign !== null){
  2648. this.align = policyAlign;
  2649. this._locateTT();
  2650. return;
  2651. }
  2652. this.tt.css('top' ,parseInt(this.base_t)+'px').
  2653. css('left' ,parseInt(this.base_l)+'px');
  2654. this.tt.css(this.from);
  2655. };
  2656. p.start = function(){
  2657. _super.start.call(this);
  2658. this.tt.appendTo(this.slide.slider.$element);
  2659. //this._locateTT();
  2660. this.tt.css('display' , 'none');
  2661. };
  2662. p.reset = function(){
  2663. _super.reset.call(this);
  2664. this.tt.detach();
  2665. };
  2666. /**
  2667. * locate hotspot over slide
  2668. * @override LayerElement.locate
  2669. * @since 2.2.0
  2670. */
  2671. /* p.locate = function(){
  2672. _super.locate.call(this);
  2673. if ( this.relativeToBG ) {
  2674. console.log(this.baseOffsetX , this.slide.$bg_img.width() , this.slide.bgWidth)
  2675. this.$element[0].style.left = this.baseOffsetX * this.slide.$bg_img.width() / this.slide.bgWidth + 'px';
  2676. this.$element[0].style.top = this.baseOffsetY * this.slide.$bg_img.height() / this.slide.bgHeight + 'px';
  2677. }
  2678. };
  2679. */
  2680. p.create = function(){
  2681. var that = this;
  2682. //@since 2.2.0
  2683. //chnage offset progin to top left
  2684. /* this.relativeToBG = this.$element.data('relative') && (this.slide.fillMode === 'fill' || this.slide.fillMode === 'fit');
  2685. if ( this.relativeToBG ) {
  2686. var origin = this.$element.data('origin'),
  2687. osy = this.$element.data('offset-y'),
  2688. osx = this.$element.data('offset-x');
  2689. if ( origin ) {
  2690. if ( origin.charAt(0) === 'b' ){
  2691. osy = this.slide.slider.options.height - this.$element.data('offset-y');
  2692. this.$element.data('offset-y', osy);
  2693. }
  2694. if ( origin.charAt(1) === 'r' ){
  2695. osx = this.slide.slider.options.width - this.$element.data('offset-x');
  2696. this.$element.data('offset-x', osx);
  2697. }
  2698. }
  2699. this.$element.data('origin', 'tl');
  2700. this.baseOffsetX = osx;
  2701. this.baseOffsetY = osy;
  2702. }*/
  2703. this._orgAlign = this.align = this.$element.data('align') !== undefined ? this.$element.data('align') : 'top';
  2704. this.data = this.$element.html();
  2705. this.$element.html('').on('mouseenter' , function(){that._showTT();}).on('mouseleave',function(){that._hideTT();});
  2706. this.point = $('<div><div class="ms-point-center"></div><div class="ms-point-border"></div></div>')
  2707. .addClass('ms-tooltip-point')
  2708. .appendTo(this.$element);
  2709. var link = this.$element.data('link'),
  2710. target = this.$element.data('target');
  2711. if( link ){
  2712. this.point.on('click', function(){window.open(link , target || '_self');});
  2713. }
  2714. this.tt = $('<div></div>')
  2715. .addClass('ms-tooltip')
  2716. //.addClass('ms-tooltip-'+this.align)
  2717. .css('display','hidden')
  2718. .css('opacity' , 0);
  2719. // @since v1.6.1
  2720. if( this.$element.data('width') !== undefined ){
  2721. this.tt.css('width', this.$element.data('width'))
  2722. .css('max-width', this.$element.data('width'));
  2723. }
  2724. this.tt_arrow = $('<div></div>')
  2725. .addClass('ms-tooltip-arrow')
  2726. .appendTo(this.tt);
  2727. this._updateClassName('ms-tooltip-'+this.align);
  2728. this.ttcont = $('<div></div>')
  2729. .addClass('ms-tooltip-cont')
  2730. .html(this.data)
  2731. .appendTo(this.tt)
  2732. if( this.$element.data('stay-hover') === true ) {
  2733. this.tt.on('mouseenter' , function(){
  2734. if( that.hide_start ){
  2735. return
  2736. }
  2737. clearTimeout(that.hto);
  2738. that._tween.stop(true);
  2739. that._showTT();
  2740. }).on('mouseleave', function(){
  2741. that._hideTT();
  2742. });
  2743. }
  2744. _super.create.call(this);
  2745. };
  2746. })(jQuery);
  2747. /* ================== bin-debug/js/pro/layers/ButtonLayer.js =================== */
  2748. /**
  2749. * Master Slider Button Layer
  2750. * @author Averta
  2751. * @since 1.7.2
  2752. * @extends {MSLayerElement}
  2753. */
  2754. (function($){
  2755. window.MSButtonLayer = function(){
  2756. MSLayerElement.call(this);
  2757. this.type = 'button';
  2758. };
  2759. MSButtonLayer.extend(MSLayerElement);
  2760. var p = MSButtonLayer.prototype;
  2761. var _super = MSLayerElement.prototype;
  2762. var positionKies = ['top', 'left', 'bottom', 'right'];
  2763. /*-------------- METHODS --------------*/
  2764. p.create = function(){
  2765. _super.create.call(this);
  2766. this.$element.wrap('<div class="ms-btn-container"></div>').css('position', 'relative');
  2767. this.$container = this.$element.parent();
  2768. };
  2769. p.locate = function(){
  2770. _super.locate.call(this);
  2771. var key, tempValue;
  2772. for (var i=0; i<4; i++){
  2773. key = positionKies[i];
  2774. if ( key in this.baseStyle ) {
  2775. tempValue = this.$element.css(key);
  2776. this.$element.css(key, '');
  2777. this.$container.css(key, tempValue);
  2778. }
  2779. }
  2780. this.$container.width(this.$element.outerWidth(true))
  2781. .height(this.$element.outerHeight(true));
  2782. };
  2783. })(jQuery);
  2784. /* ================== bin-debug/js/pro/controls/SliderEvent.js =================== */
  2785. window.MSSliderEvent = function (type){
  2786. this.type = type;
  2787. };
  2788. MSSliderEvent.CHANGE_START = 'ms_changestart';
  2789. MSSliderEvent.CHANGE_END = 'ms_changeend';
  2790. MSSliderEvent.WAITING = 'ms_waiting';
  2791. MSSliderEvent.AUTOPLAY_CHANGE = 'ms_autoplaychange';
  2792. MSSliderEvent.VIDEO_PLAY = 'ms_videoPlay';
  2793. MSSliderEvent.VIDEO_CLOSE = 'ms_videoclose';
  2794. MSSliderEvent.INIT = 'ms_init';
  2795. MSSliderEvent.HARD_UPDATE = 'ms_hard_update';
  2796. MSSliderEvent.RESIZE = 'ms_resize';
  2797. MSSliderEvent.RESERVED_SPACE_CHANGE = 'ms_rsc'; // internal use
  2798. MSSliderEvent.DESTROY = 'ms_destroy';
  2799. /* ================== bin-debug/js/pro/controls/Slide.js =================== */
  2800. /**
  2801. * Master Slider Slide Class
  2802. * @author averta
  2803. * @package Master Slider jQuery
  2804. */
  2805. ;(function(window, document, $){
  2806. "use strict";
  2807. window.MSSlide = function(){
  2808. this.$element = null;
  2809. this.$loading = $('<div></div>').addClass('ms-slide-loading');
  2810. this.view = null;
  2811. this.index = -1;
  2812. this.__width = 0;
  2813. this.__height = 0;
  2814. this.fillMode = 'fill'; // fill , fit , stretch , tile , center
  2815. this.selected = false;
  2816. this.pselected = false;
  2817. this.autoAppend = true;
  2818. this.isSleeping = true;
  2819. this.moz = $.browser.mozilla;
  2820. };
  2821. var p = MSSlide.prototype;
  2822. /**
  2823. * on swipe start handler
  2824. */
  2825. p.onSwipeStart = function(){
  2826. //this.$layers.css(window._csspfx + 'transition-duration' , '0ms');
  2827. if ( this.link ) {
  2828. this.linkdis = true;
  2829. }
  2830. if ( this.video ) {
  2831. this.videodis = true;
  2832. }
  2833. };
  2834. /**
  2835. * on swipe move handler
  2836. */
  2837. p.onSwipeMove = function (e) {
  2838. var move = Math.max(Math.abs(e.data.distanceX), Math.abs(e.data.distanceY));
  2839. this.swipeMoved = move > 4;
  2840. };
  2841. /**
  2842. * on swipe cancel handler
  2843. */
  2844. p.onSwipeCancel = function(e){
  2845. if ( this.swipeMoved ) {
  2846. this.swipeMoved = false;
  2847. return;
  2848. }
  2849. if ( this.link ) {
  2850. this.linkdis = false;
  2851. }
  2852. if ( this.video ) {
  2853. this.videodis = false;
  2854. }
  2855. //this.$layers.css(window._csspfx + 'transition-duration' , this.view.__slideDuration + 'ms');
  2856. };
  2857. /**
  2858. * setup layer controller for the slide
  2859. * @since 2.11.0
  2860. */
  2861. p.setupLayerController = function () {
  2862. this.hasLayers = true;
  2863. this.layerController = new MSLayerController(this);
  2864. };
  2865. /**
  2866. * this method called after loading all assets related to this slide
  2867. */
  2868. p.assetsLoaded = function(){
  2869. this.ready = true;
  2870. this.slider.api._startTimer();
  2871. if( this.selected || (this.pselected && this.slider.options.instantStartLayers) ){
  2872. if ( this.hasLayers ) {
  2873. this.layerController.showLayers();
  2874. }
  2875. if(this.vinit){
  2876. this.bgvideo.play();
  2877. if( !this.autoPauseBgVid ) {
  2878. this.bgvideo.currentTime = 0;
  2879. }
  2880. }
  2881. }
  2882. if ( !this.isSleeping ) {
  2883. this.setupBG();
  2884. }
  2885. CTween.fadeOut(this.$loading , 300 , true);
  2886. //sequence loading
  2887. if ( (this.slider.options.preload === 0 || this.slider.options.preload === 'all') && this.index < this.view.slideList.length - 1 ) {
  2888. this.view.slideList[this.index + 1].loadImages();
  2889. } else if ( this.slider.options.preload === 'all' && this.index === this.view.slideList.length - 1 ){
  2890. this.slider._removeLoading();
  2891. }
  2892. };
  2893. /**
  2894. * adds backgroun image to the slider
  2895. * @param {Element} img slide image element
  2896. */
  2897. p.setBG = function(img){
  2898. this.hasBG = true;
  2899. var that = this;
  2900. this.$imgcont = $('<div></div>').addClass('ms-slide-bgcont');
  2901. this.$element.append(this.$loading)
  2902. .append(this.$imgcont);
  2903. this.$bg_img = $(img).css('visibility' , 'hidden');
  2904. this.$imgcont.append(this.$bg_img);
  2905. this.bgAligner = new MSAligner(that.fillMode , that.$imgcont, that.$bg_img );
  2906. this.bgAligner.widthOnly = this.slider.options.autoHeight;
  2907. if ( that.slider.options.autoHeight && (that.pselected || that.selected) ) {
  2908. that.slider.setHeight(that.slider.options.height);
  2909. }
  2910. if ( this.$bg_img.data('src') !== undefined ) {
  2911. this.bg_src = this.$bg_img.data('src');
  2912. this.$bg_img.removeAttr('data-src');
  2913. } else {
  2914. this.$bg_img.one('load', function(event) {that._onBGLoad(event);})
  2915. .each($.jqLoadFix);
  2916. }
  2917. };
  2918. /**
  2919. * align and resize backgrund image over slide
  2920. */
  2921. p.setupBG = function(){
  2922. //if(this.isSettedup) return;
  2923. //this.isSettedup = true;
  2924. if ( !this.initBG && this.bgLoaded ) {
  2925. this.initBG = true;
  2926. this.$bg_img.css('visibility' , '');
  2927. this.bgWidth = this.bgNatrualWidth || this.$bg_img.width();
  2928. this.bgHeight = this.bgNatrualHeight || this.$bg_img.height();
  2929. CTween.fadeIn(this.$imgcont , 300);
  2930. if(this.slider.options.autoHeight){
  2931. this.$imgcont.height(this.bgHeight * this.ratio);
  2932. }
  2933. this.bgAligner.init(this.bgWidth , this.bgHeight);
  2934. this.setSize(this.__width , this.__height);
  2935. if(this.slider.options.autoHeight && (this.pselected || this.selected))
  2936. this.slider.setHeight(this.getHeight());
  2937. }
  2938. };
  2939. /**
  2940. * start loading images
  2941. */
  2942. p.loadImages = function(){
  2943. if ( this.ls ) {
  2944. return;
  2945. }
  2946. this.ls = true;
  2947. if ( this.bgvideo ) {
  2948. this.bgvideo.load();
  2949. }
  2950. if ( this.hasBG && this.bg_src ) {
  2951. var that = this;
  2952. this.$bg_img.preloadImg(this.bg_src , function(event) {that._onBGLoad(event);});
  2953. }
  2954. if ( this.hasLayers ) {
  2955. this.layerController.loadLayers(this._onLayersLoad);
  2956. }
  2957. // There is nothing to preload? so slide is ready to show.
  2958. if( !this.hasBG && !this.hasLayers ) {
  2959. this.assetsLoaded();
  2960. }
  2961. };
  2962. /**
  2963. * layerController on assets load callback
  2964. */
  2965. p._onLayersLoad = function () {
  2966. this.layersLoaded = true;
  2967. if ( !this.hasBG || this.bgLoaded ) {
  2968. this.assetsLoaded();
  2969. }
  2970. };
  2971. /**
  2972. * on background image loaded
  2973. * @param {Event} event
  2974. */
  2975. p._onBGLoad = function(event){
  2976. this.bgNatrualWidth = event.width;
  2977. this.bgNatrualHeight = event.height;
  2978. this.bgLoaded = true;
  2979. if ( $.browser.msie ) {
  2980. this.$bg_img.on('dragstart', function(event) { event.preventDefault(); }); // disables native dragging
  2981. }
  2982. if ( !this.hasLayers || this.layerController.ready ) {
  2983. this.assetsLoaded();
  2984. }
  2985. };
  2986. /* -----------------------------------------------------*/
  2987. /**
  2988. * add video background to the slide
  2989. * @param {jQuery Element} $video
  2990. */
  2991. p.setBGVideo = function($video){
  2992. if ( !$video[0].play ) {
  2993. return;
  2994. }
  2995. // disables video in mobile devices
  2996. if ( window._mobile ) {
  2997. $video.remove();
  2998. return;
  2999. }
  3000. this.bgvideo = $video[0];
  3001. var that = this;
  3002. $video.addClass('ms-slide-bgvideo');
  3003. if ( $video.data('loop') !== false ) {
  3004. this.bgvideo.addEventListener('ended' , function(){
  3005. //that.bgvideo.currentTime = -1;
  3006. that.bgvideo.play();
  3007. });
  3008. }
  3009. if ( $video.data('mute') !== false ) {
  3010. this.bgvideo.muted = true;
  3011. }
  3012. if ( $video.data('autopause') === true ) {
  3013. this.autoPauseBgVid = true;
  3014. }
  3015. this.bgvideo_fillmode = $video.data('fill-mode') || 'fill'; // fill , fit , none
  3016. if ( this.bgvideo_fillmode !== 'none' ) {
  3017. this.bgVideoAligner = new MSAligner(this.bgvideo_fillmode , this.$element, $video );
  3018. this.bgvideo.addEventListener('loadedmetadata' , function(){
  3019. if(that.vinit) return;
  3020. that.vinit = true;
  3021. that.video_aspect = that.bgVideoAligner.baseHeight/that.bgVideoAligner.baseWidth;
  3022. that.bgVideoAligner.init(that.bgvideo.videoWidth , that.bgvideo.videoHeight);
  3023. that._alignBGVideo();
  3024. CTween.fadeIn($(that.bgvideo) , 200);
  3025. if ( that.selected ) {
  3026. that.bgvideo.play();
  3027. }
  3028. });
  3029. }
  3030. $video.css('opacity' , 0);
  3031. this.$bgvideocont = $('<div></div>').addClass('ms-slide-bgvideocont').append($video);
  3032. if ( this.hasBG ) {
  3033. this.$imgcont.before(this.$bgvideocont);
  3034. } else {
  3035. this.$bgvideocont.appendTo(this.$element);
  3036. }
  3037. };
  3038. /**
  3039. * align video in slide
  3040. */
  3041. p._alignBGVideo = function () {
  3042. if ( !this.bgvideo_fillmode || this.bgvideo_fillmode === 'none' ) {
  3043. return;
  3044. }
  3045. this.bgVideoAligner.align();
  3046. };
  3047. /* -----------------------------------------------------*/
  3048. /**
  3049. * resize slide
  3050. * @param {Number} width
  3051. * @param {Number} height
  3052. * @param {Boolean} hard after resizing reinitializes layers
  3053. */
  3054. p.setSize = function(width, height, hard) {
  3055. this.__width = width;
  3056. if ( this.slider.options.autoHeight ) {
  3057. if ( this.bgLoaded ) {
  3058. this.ratio = this.__width / this.bgWidth;
  3059. height = Math.floor(this.ratio * this.bgHeight);
  3060. this.$imgcont.height(height);
  3061. } else {
  3062. this.ratio = width / this.slider.options.width;
  3063. height = this.slider.options.height * this.ratio;
  3064. }
  3065. }
  3066. this.__height = height;
  3067. this.$element.width(width).height(height);
  3068. if(this.hasBG && this.bgLoaded)this.bgAligner.align();
  3069. this._alignBGVideo();
  3070. if ( this.hasLayers ) {
  3071. this.layerController.setSize(width, height, hard);
  3072. }
  3073. };
  3074. /**
  3075. * calculates slide height
  3076. * @return {Number} slide height
  3077. */
  3078. p.getHeight = function(){
  3079. if ( this.hasBG && this.bgLoaded ) {
  3080. return this.bgHeight * this.ratio;
  3081. }
  3082. return Math.max(this.$element[0].clientHeight, this.slider.options.height * this.ratio);
  3083. };
  3084. /* -----------------------------------------------------*/
  3085. // YouTube and Vimeo videos
  3086. /**
  3087. * playe embeded video
  3088. */
  3089. p.__playVideo = function (){
  3090. if ( this.vplayed || this.videodis ) {
  3091. return;
  3092. }
  3093. this.vplayed = true;
  3094. if ( !this.slider.api.paused ) {
  3095. this.slider.api.pause();
  3096. this.roc = true; // resume on close;
  3097. }
  3098. this.vcbtn.css('display' , '');
  3099. CTween.fadeOut(this.vpbtn , 500 , false);
  3100. CTween.fadeIn(this.vcbtn , 500);
  3101. CTween.fadeIn(this.vframe , 500);
  3102. this.vframe.css('display' , 'block').attr('src' , this.video + '&autoplay=1');
  3103. this.view.$element.addClass('ms-def-cursor');
  3104. // remove perspective style from view if it's Firefox.
  3105. // it fixes video fullscreen issue in Firefox
  3106. if ( this.moz ) {
  3107. this.view.$element.css('perspective', 'none');
  3108. }
  3109. // if swipe navigation enabled
  3110. if ( this.view.swipeControl ) {
  3111. this.view.swipeControl.disable();
  3112. }
  3113. this.slider.slideController.dispatchEvent(new MSSliderEvent(MSSliderEvent.VIDEO_PLAY));
  3114. };
  3115. /**
  3116. * close embeded video
  3117. */
  3118. p.__closeVideo = function(){
  3119. if ( !this.vplayed ) {
  3120. return;
  3121. }
  3122. this.vplayed = false;
  3123. if(this.roc){
  3124. this.slider.api.resume();
  3125. }
  3126. var that = this;
  3127. CTween.fadeIn(this.vpbtn , 500);
  3128. CTween.animate(this.vcbtn , 500 , {opacity:0} , {complete:function(){ that.vcbtn.css ('display' , 'none'); }});
  3129. CTween.animate(this.vframe , 500 , {opacity:0} , {complete:function(){ that.vframe.attr('src' , 'about:blank').css('display' , 'none');}});
  3130. // video fullscreen issue in Firefox
  3131. if ( this.moz ) {
  3132. this.view.$element.css('perspective', '');
  3133. }
  3134. // if swipe navigation enabled
  3135. if ( this.view.swipeControl ) {
  3136. this.view.swipeControl.enable();
  3137. }
  3138. this.view.$element.removeClass('ms-def-cursor');
  3139. this.slider.slideController.dispatchEvent(new MSSliderEvent(MSSliderEvent.VIDEO_CLOSE));
  3140. };
  3141. /* -----------------------------------------------------*/
  3142. /**
  3143. * create slide - it adds requierd elements over slide
  3144. */
  3145. p.create = function(){
  3146. var that = this;
  3147. if ( this.hasLayers ) {
  3148. this.layerController.create();
  3149. }
  3150. if ( this.link ) {
  3151. this.link.addClass('ms-slide-link').html('').click(function(e){
  3152. if ( that.linkdis ) {
  3153. e.preventDefault();
  3154. }
  3155. });
  3156. // this.$element.css('cursor' , 'pointer')
  3157. // .click(function(){ if(!that.linkdis) window.open(that.link , that.link_targ || '_self'); });
  3158. }
  3159. if ( this.video ) {
  3160. if ( this.video.indexOf('?') === -1 ) {
  3161. this.video += '?';
  3162. }
  3163. this.vframe = $('<iframe></iframe>')
  3164. .addClass('ms-slide-video')
  3165. .css({width:'100%' , height:'100%' , display:'none'})
  3166. .attr('src' , 'about:blank')
  3167. .attr('allowfullscreen', 'true')
  3168. .appendTo(this.$element);
  3169. this.vpbtn = $('<div></div>')
  3170. .addClass('ms-slide-vpbtn')
  3171. .click(function(){that.__playVideo();})
  3172. .appendTo(this.$element);
  3173. this.vcbtn = $('<div></div>')
  3174. .addClass('ms-slide-vcbtn')
  3175. .click(function(){that.__closeVideo();})
  3176. .appendTo(this.$element)
  3177. .css('display','none');
  3178. if ( window._touch ) {
  3179. this.vcbtn.removeClass('ms-slide-vcbtn')
  3180. .addClass('ms-slide-vcbtn-mobile')
  3181. .append('<div class="ms-vcbtn-txt">Close video</div>')
  3182. .appendTo(this.view.$element.parent());
  3183. }
  3184. }
  3185. if ( !this.slider.options.autoHeight && this.hasBG ) {
  3186. this.$imgcont.css('height' , '100%');
  3187. if ( this.fillMode === 'center' || this.fillMode === 'stretch' ){
  3188. this.fillMode = 'fill';
  3189. }
  3190. }
  3191. if ( this.slider.options.autoHeight ) {
  3192. this.$element.addClass('ms-slide-auto-height');
  3193. }
  3194. this.sleep(true);
  3195. };
  3196. /**
  3197. * destory the slide
  3198. */
  3199. p.destroy = function(){
  3200. if ( this.hasLayers ) {
  3201. this.layerController.destroy();
  3202. this.layerController = null;
  3203. }
  3204. this.$element.remove();
  3205. this.$element = null;
  3206. };
  3207. /**
  3208. * everything require to do before selecting slide
  3209. */
  3210. p.prepareToSelect = function(){
  3211. if ( this.pselected || this.selected ) {
  3212. return;
  3213. }
  3214. this.pselected = true;
  3215. if ( this.link || this.video ) {
  3216. this.view.addEventListener(MSViewEvents.SWIPE_START , this.onSwipeStart , this);
  3217. this.view.addEventListener(MSViewEvents.SWIPE_MOVE , this.onSwipeMove , this);
  3218. this.view.addEventListener(MSViewEvents.SWIPE_CANCEL , this.onSwipeCancel , this);
  3219. this.linkdis = false;
  3220. this.swipeMoved = false;
  3221. }
  3222. this.loadImages();
  3223. if ( this.hasLayers ) {
  3224. this.layerController.prepareToShow();
  3225. }
  3226. if ( this.ready ) {
  3227. if( this.bgvideo ){
  3228. this.bgvideo.play();
  3229. }
  3230. if ( this.hasLayers && this.slider.options.instantStartLayers ){
  3231. this.layerController.showLayers();
  3232. }
  3233. }
  3234. if( this.moz ){
  3235. this.$element.css('margin-top' , '');
  3236. }
  3237. };
  3238. /*p.prepareToUnselect = function(){
  3239. if(!this.pselected || !this.selected) return;
  3240. this.pselected = false;
  3241. };*/
  3242. /**
  3243. * select slide
  3244. */
  3245. p.select = function(){
  3246. if ( this.selected ) {
  3247. return;
  3248. }
  3249. this.selected = true;
  3250. this.pselected = false;
  3251. this.$element.addClass('ms-sl-selected');
  3252. if(this.hasLayers){
  3253. if ( this.slider.options.autoHeight ) {
  3254. this.layerController.updateHeight();
  3255. }
  3256. if( !this.slider.options.instantStartLayers ) {
  3257. this.layerController.showLayers();
  3258. }
  3259. //this.view.addEventListener(MSViewEvents.SCROLL , this.updateLayers , this)
  3260. }
  3261. if( this.ready && this.bgvideo ) {
  3262. this.bgvideo.play();
  3263. }
  3264. // @since 1.8.0
  3265. // Autoplay iframe video
  3266. if ( this.videoAutoPlay ) {
  3267. this.videodis = false;
  3268. this.vpbtn.trigger('click');
  3269. }
  3270. };
  3271. /**
  3272. * remove selected status
  3273. */
  3274. p.unselect = function(){
  3275. this.pselected = false;
  3276. if ( this.moz ) {
  3277. this.$element.css('margin-top' , '0.1px');
  3278. }
  3279. if ( this.link || this.video ) {
  3280. this.view.removeEventListener(MSViewEvents.SWIPE_START , this.onSwipeStart , this);
  3281. this.view.removeEventListener(MSViewEvents.SWIPE_MOVE , this.onSwipeMove , this);
  3282. this.view.removeEventListener(MSViewEvents.SWIPE_CANCEL , this.onSwipeCancel , this);
  3283. }
  3284. if (this.bgvideo ) {
  3285. this.bgvideo.pause();
  3286. if(!this.autoPauseBgVid && this.vinit)
  3287. this.bgvideo.currentTime = 0;
  3288. }
  3289. // hide layers
  3290. if ( this.hasLayers ) {
  3291. this.layerController.hideLayers();
  3292. }
  3293. if ( !this.selected ) {
  3294. return;
  3295. }
  3296. this.selected = false;
  3297. this.$element.removeClass('ms-sl-selected');
  3298. if(this.video && this.vplayed){
  3299. this.__closeVideo();
  3300. this.roc = false;
  3301. }
  3302. };
  3303. /**
  3304. * remove slide from DOM
  3305. */
  3306. p.sleep = function(force){
  3307. if ( this.isSleeping && !force ) {
  3308. return;
  3309. }
  3310. this.isSleeping = true;
  3311. if ( this.autoAppend ) {
  3312. this.$element.detach();
  3313. }
  3314. if ( this.hasLayers ) {
  3315. this.layerController.onSlideSleep();
  3316. }
  3317. };
  3318. /**
  3319. * add slide to the DOM
  3320. */
  3321. p.wakeup = function(){
  3322. if ( !this.isSleeping ) {
  3323. return;
  3324. }
  3325. this.isSleeping = false;
  3326. if ( this.autoAppend ) {
  3327. this.view.$slideCont.append(this.$element);
  3328. }
  3329. if ( this.moz ){
  3330. this.$element.css('margin-top' , '0.1px');
  3331. }
  3332. this.setupBG();
  3333. // aling bg
  3334. if ( this.hasBG ){
  3335. this.bgAligner.align();
  3336. }
  3337. if ( this.hasLayers ) {
  3338. this.layerController.onSlideWakeup();
  3339. }
  3340. };
  3341. })(window, document, jQuery);
  3342. /* ================== bin-debug/js/pro/controls/SlideController.js =================== */
  3343. ;(function($){
  3344. "use strict";
  3345. var SliderViewList = {};
  3346. window.MSSlideController = function(slider){
  3347. this._delayProgress = 0;
  3348. this._timer = new averta.Timer(100);
  3349. this._timer.onTimer = this.onTimer;
  3350. this._timer.refrence = this;
  3351. this.currentSlide = null;
  3352. this.slider = slider;
  3353. this.so = slider.options;
  3354. averta.EventDispatcher.call(this);
  3355. };
  3356. MSSlideController.registerView = function(name , _class){
  3357. if(name in SliderViewList){
  3358. throw new Error( name + ', is already registered.');
  3359. return;
  3360. }
  3361. SliderViewList[name] = _class;
  3362. };
  3363. MSSlideController.SliderControlList = {};
  3364. MSSlideController.registerControl = function(name , _class){
  3365. if(name in MSSlideController.SliderControlList){
  3366. throw new Error( name + ', is already registered.');
  3367. return;
  3368. }
  3369. MSSlideController.SliderControlList[name] = _class;
  3370. };
  3371. var p = MSSlideController.prototype;
  3372. /*-------------- METHODS --------------*/
  3373. p.setupView = function(){
  3374. var that = this;
  3375. this.resize_listener = function(){that.__resize();};
  3376. // in @version 1.5.7 it will be added in Masterslider.js _setupSliderLayout function
  3377. //$(window).bind('resize', this.resize_listener);
  3378. //if(this.so.smoothHeight) this.so.autoHeight = true;
  3379. var viewOptions = {
  3380. spacing: this.so.space,
  3381. mouseSwipe: this.so.mouse,
  3382. loop: this.so.loop,
  3383. autoHeight: this.so.autoHeight,
  3384. swipe: this.so.swipe,
  3385. speed: this.so.speed,
  3386. dir: this.so.dir,
  3387. viewNum: this.so.inView,
  3388. critMargin: this.so.critMargin
  3389. };
  3390. if(this.so.viewOptions)
  3391. $.extend(viewOptions , this.so.viewOptions);
  3392. if(this.so.autoHeight) this.so.heightLimit = false;
  3393. //this.view.slideDuration = this.so.duration;
  3394. var viewClass = SliderViewList[this.slider.options.view] || MSBasicView;
  3395. if(viewClass._3dreq && (!window._css3d || $.browser.msie) ) viewClass = viewClass._fallback || MSBasicView;
  3396. this.view = new viewClass(viewOptions);
  3397. if(this.so.overPause){
  3398. var that = this;
  3399. this.slider.$element.mouseenter(function(){
  3400. that.is_over = true;
  3401. that._stopTimer();
  3402. }).mouseleave(function(){
  3403. that.is_over = false;
  3404. that._startTimer();
  3405. });
  3406. }
  3407. };
  3408. p.onChangeStart = function(){
  3409. this.change_started = true;
  3410. if(this.currentSlide) this.currentSlide.unselect();
  3411. this.currentSlide = this.view.currentSlide;
  3412. this.currentSlide.prepareToSelect();
  3413. //this.__appendSlides();
  3414. if(this.so.endPause && this.currentSlide.index === this.slider.slides.length - 1){
  3415. this.pause();
  3416. //this._timer.reset();
  3417. this.skipTimer();
  3418. }
  3419. if(this.so.autoHeight){
  3420. this.slider.setHeight(this.currentSlide.getHeight());
  3421. }
  3422. if ( this.so.deepLink ) {
  3423. this.__updateWindowHash();
  3424. }
  3425. this.dispatchEvent(new MSSliderEvent(MSSliderEvent.CHANGE_START));
  3426. };
  3427. p.onChangeEnd = function(){
  3428. //if(!this.currentSlide.selected)
  3429. // this._timer.reset();
  3430. this.change_started = false;
  3431. this._startTimer();
  3432. this.currentSlide.select();
  3433. if(this.so.preload > 1){
  3434. var loc ,i , l = this.so.preload - 1, slide;
  3435. // next slides
  3436. for(i=1;i<=l;++i){
  3437. loc = this.view.index + i;
  3438. if(loc >= this.view.slideList.length) {
  3439. if(this.so.loop){
  3440. loc = loc - this.view.slideList.length;
  3441. }else{
  3442. i = l;
  3443. continue;
  3444. }
  3445. }
  3446. slide = this.view.slideList[loc];
  3447. if ( slide ) {
  3448. slide.loadImages();
  3449. }
  3450. }
  3451. // previous slides
  3452. if(l > this.view.slideList.length/2)
  3453. l = Math.floor(this.view.slideList.length/2);
  3454. for(i=1;i<=l;++i){
  3455. loc = this.view.index - i;
  3456. if(loc < 0){
  3457. if(this.so.loop){
  3458. loc = this.view.slideList.length + loc;
  3459. }else{
  3460. i = l;
  3461. continue;
  3462. }
  3463. }
  3464. slide = this.view.slideList[loc];
  3465. if ( slide ) {
  3466. slide.loadImages();
  3467. }
  3468. }
  3469. }
  3470. this.dispatchEvent(new MSSliderEvent(MSSliderEvent.CHANGE_END));
  3471. };
  3472. p.onSwipeStart = function(){
  3473. //this._timer.reset();
  3474. this.skipTimer();
  3475. };
  3476. p.skipTimer = function(){
  3477. this._timer.reset();
  3478. this._delayProgress = 0;
  3479. this.dispatchEvent(new MSSliderEvent(MSSliderEvent.WAITING));
  3480. };
  3481. p.onTimer = function(time) {
  3482. if(this._timer.getTime() >= this.view.currentSlide.delay * 1000){
  3483. //this._timer.reset();
  3484. this.skipTimer();
  3485. this.view.next();
  3486. this.hideCalled = false;
  3487. }
  3488. this._delayProgress = this._timer.getTime() / (this.view.currentSlide.delay * 10);
  3489. if(this.so.hideLayers && !this.hideCalled && this.view.currentSlide.delay * 1000 - this._timer.getTime() <= 300){
  3490. var currentSlide = this.view.currentSlide;
  3491. if ( currentSlide.hasLayers ) {
  3492. currentSlide.layerController.animHideLayers();
  3493. }
  3494. this.hideCalled = true;
  3495. }
  3496. this.dispatchEvent(new MSSliderEvent(MSSliderEvent.WAITING));
  3497. };
  3498. p._stopTimer = function(){
  3499. if(this._timer)
  3500. this._timer.stop();
  3501. };
  3502. p._startTimer = function(){
  3503. if(!this.paused && !this.is_over && this.currentSlide && this.currentSlide.ready && !this.change_started)
  3504. this._timer.start();
  3505. };
  3506. p.__appendSlides = function(){
  3507. var slide , loc , i = 0 , l = this.view.slideList.length -1;
  3508. // detach all
  3509. for ( i ; i < l ; ++i){
  3510. slide = this.view.slideList[i];
  3511. if(!slide.detached){
  3512. slide.$element.detach();
  3513. slide.detached = true;
  3514. }
  3515. }
  3516. // append current slide
  3517. this.view.appendSlide(this.view.slideList[this.view.index]);
  3518. l = 3;
  3519. // next slides
  3520. for(i=1;i<=l;++i){
  3521. loc = this.view.index + i;
  3522. if(loc >= this.view.slideList.length) {
  3523. if(this.so.loop){
  3524. loc = loc - this.view.slideList.length;
  3525. }else{
  3526. i = l;
  3527. continue;
  3528. }
  3529. }
  3530. slide = this.view.slideList[loc];
  3531. slide.detached = false;
  3532. this.view.appendSlide(slide);
  3533. }
  3534. // previous slides
  3535. if(l > this.view.slideList.length/2)
  3536. l = Math.floor(this.view.slideList.length/2);
  3537. for(i=1;i<=l;++i){
  3538. loc = this.view.index - i;
  3539. if(loc < 0){
  3540. if(this.so.loop){
  3541. loc = this.view.slideList.length + loc;
  3542. }else{
  3543. i = l;
  3544. continue;
  3545. }
  3546. }
  3547. slide = this.view.slideList[loc];
  3548. slide.detached = false;
  3549. this.view.appendSlide(slide);
  3550. }
  3551. }
  3552. p.__resize = function(hard){
  3553. if(!this.created) return;
  3554. this.width = this.slider.$element[0].clientWidth || this.so.width;
  3555. if(!this.so.fullwidth){
  3556. this.width = Math.min(this.width , this.so.width);
  3557. //this.view.$element.css('left' , (this.slider.$element[0].clientWidth - this.width) / 2 + 'px');
  3558. }
  3559. if( this.so.fullheight ){
  3560. this.so.heightLimit = false;
  3561. this.so.autoHeight = false;
  3562. this.height = this.slider.$element[0].clientHeight;
  3563. } else {
  3564. this.height = this.width / this.slider.aspect;
  3565. }
  3566. if( this.so.autoHeight ){
  3567. this.currentSlide.setSize(this.width , null , hard);
  3568. this.view.setSize(this.width , this.currentSlide.getHeight() , hard);
  3569. } else {
  3570. this.view.setSize(this.width , ( Math.max( this.so.minHeight, ( this.so.heightLimit ? Math.min(this.height , this.so.height) : this.height ) ) ) , hard);
  3571. }
  3572. if(this.slider.$controlsCont){
  3573. if(this.so.centerControls && this.so.fullwidth) {
  3574. this.view.$element.css('left' , Math.min(0,-(this.slider.$element[0].clientWidth - this.so.width) / 2) + 'px');
  3575. }
  3576. }
  3577. this.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESIZE));
  3578. };
  3579. p.__dispatchInit = function(){
  3580. this.dispatchEvent(new MSSliderEvent(MSSliderEvent.INIT));
  3581. };
  3582. /**
  3583. * used by deep link feature, uptades window hash value on slide changes
  3584. * @since 2.1.0
  3585. */
  3586. p.__updateWindowHash = function(){
  3587. var hash = window.location.hash,
  3588. dl = this.so.deepLink,
  3589. dlt = this.so.deepLinkType,
  3590. eq = dlt === 'path' ? '\/' : '=',
  3591. sep = dlt === 'path' ? '\/' : '&',
  3592. sliderHash = dl + eq + (this.view.index + 1),
  3593. regTest = new RegExp( dl + eq + '[0-9]+', 'g');
  3594. if ( hash === '' ) {
  3595. window.location.hash = sep + sliderHash;
  3596. } else if( regTest.test(hash) ) {
  3597. window.location.hash = hash.replace(regTest, sliderHash);
  3598. } else {
  3599. window.location.hash = hash + sep + sliderHash;
  3600. }
  3601. };
  3602. p.__curentSlideInHash = function(){
  3603. var hash = window.location.hash,
  3604. dl = this.so.deepLink,
  3605. dlt = this.so.deepLinkType,
  3606. eq = dlt === 'path' ? '\/' : '=',
  3607. regTest = new RegExp( dl + eq + '[0-9]+', 'g' );
  3608. if ( regTest.test(hash) ) {
  3609. var index = Number(hash.match(regTest)[0].match(/[0-9]+/g).pop());
  3610. if ( !isNaN(index) ) {
  3611. return index - 1;
  3612. }
  3613. }
  3614. return -1;
  3615. };
  3616. p.__onHashChanged = function(){
  3617. var index = this.__curentSlideInHash();
  3618. if ( index !== -1 ){
  3619. this.gotoSlide(index);
  3620. }
  3621. };
  3622. p.setup = function(){
  3623. this.created = true;
  3624. this.paused = !this.so.autoplay;
  3625. //this.slider.$element.append(this.view.$element);
  3626. this.view.addEventListener(MSViewEvents.CHANGE_START , this.onChangeStart , this);
  3627. this.view.addEventListener(MSViewEvents.CHANGE_END , this.onChangeEnd , this);
  3628. this.view.addEventListener(MSViewEvents.SWIPE_START , this.onSwipeStart , this);
  3629. //this.currentSlide = this.view.slides[this.so.start - 1];
  3630. this.currentSlide = this.view.slideList[this.so.start - 1];
  3631. this.__resize();
  3632. var slideInHash = this.__curentSlideInHash(),
  3633. startSlide = slideInHash !== -1 ? slideInHash : this.so.start - 1;
  3634. this.view.create(startSlide);
  3635. if(this.so.preload === 0){
  3636. this.view.slideList[0].loadImages();
  3637. }
  3638. this.scroller = this.view.controller;
  3639. if(this.so.wheel){
  3640. var that = this;
  3641. var last_time = new Date().getTime();
  3642. this.wheellistener = function(event){
  3643. var e = window.event || event.orginalEvent || event;
  3644. e.preventDefault();
  3645. var current_time = new Date().getTime();
  3646. if(current_time - last_time < 400) return;
  3647. last_time = current_time;
  3648. var delta = Math.abs(e.detail || e.wheelDelta);
  3649. if ( $.browser.mozilla ) {
  3650. delta *= 100;
  3651. }
  3652. var scrollThreshold = 15;
  3653. // --- Scrolling up ---
  3654. if (e.detail < 0 || e.wheelDelta > 0) {
  3655. if ( delta >= scrollThreshold) {
  3656. that.previous(true);
  3657. }
  3658. }
  3659. // --- Scrolling down ---
  3660. else {
  3661. if (delta >= scrollThreshold) {
  3662. that.next(true);
  3663. }
  3664. }
  3665. return false;
  3666. };
  3667. if($.browser.mozilla) this.slider.$element[0].addEventListener('DOMMouseScroll' , this.wheellistener);
  3668. else this.slider.$element.bind('mousewheel', this.wheellistener);
  3669. }
  3670. // if(this.so.wheel){
  3671. // var that = this;
  3672. // var last_time = new Date().getTime();
  3673. // this.wheellistener = function(event){
  3674. // var current_time = new Date().getTime();
  3675. // if(current_time - last_time < 550) return;
  3676. // last_time = current_time;
  3677. // var e = window.event || event.orginalEvent || event;
  3678. // var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
  3679. // if(delta < 0) that.next();
  3680. // else if(delta > 0) that.previous();
  3681. // return false;
  3682. // };
  3683. // if($.browser.mozilla) this.slider.$element[0].addEventListener('DOMMouseScroll' , this.wheellistener);
  3684. // else this.slider.$element.bind('mousewheel', this.wheellistener);
  3685. // }
  3686. if(this.slider.$element[0].clientWidth === 0)
  3687. this.slider.init_safemode = true;
  3688. this.__resize();
  3689. var that = this;
  3690. if( this.so.deepLink ) {
  3691. $(window).on('hashchange', function() {
  3692. that.__onHashChanged();
  3693. });
  3694. }
  3695. };
  3696. p.index = function(){
  3697. return this.view.index;
  3698. };
  3699. p.count = function(){
  3700. return this.view.slidesCount;
  3701. };
  3702. p.next = function(checkLoop){
  3703. this.skipTimer();
  3704. this.view.next(checkLoop);
  3705. };
  3706. p.previous = function(checkLoop){
  3707. this.skipTimer();
  3708. this.view.previous(checkLoop);
  3709. };
  3710. p.gotoSlide = function(index) {
  3711. index = Math.min(index, this.count()-1);
  3712. this.skipTimer();
  3713. this.view.gotoSlide(index);
  3714. };
  3715. p.destroy = function(reset){
  3716. this.dispatchEvent(new MSSliderEvent(MSSliderEvent.DESTROY));
  3717. this.slider.destroy(reset);
  3718. };
  3719. p._destroy = function(){
  3720. this._timer.reset();
  3721. this._timer = null;
  3722. $(window).unbind('resize', this.resize_listener);
  3723. this.view.destroy();
  3724. this.view = null;
  3725. if(this.so.wheel){
  3726. if($.browser.mozilla) this.slider.$element[0].removeEventListener('DOMMouseScroll' , this.wheellistener);
  3727. else this.slider.$element.unbind('mousewheel', this.wheellistener);
  3728. this.wheellistener = null;
  3729. }
  3730. this.so = null;
  3731. };
  3732. /**
  3733. * run layer actions like next, previous,...
  3734. * @param {String} action
  3735. * @since v1.7.2
  3736. */
  3737. p.runAction = function(action){
  3738. var actionParams = [];
  3739. if( action.indexOf('(') !== -1 ){
  3740. var temp = action.slice(0 , action.indexOf('('));
  3741. actionParams = action.slice(action.indexOf('(') + 1 , -1).replace(/\"|\'|\s/g , '').split(',');
  3742. action = temp;
  3743. }
  3744. if ( action in this ){
  3745. this[action].apply(this, actionParams);
  3746. } else if ( console ){
  3747. console.log('Master Slider Error: Action "'+action+'" not found.');
  3748. }
  3749. };
  3750. p.update = function(hard){
  3751. if(this.slider.init_safemode && hard)
  3752. this.slider.init_safemode = false;
  3753. this.__resize(hard);
  3754. if ( hard ) {
  3755. this.dispatchEvent(new MSSliderEvent(MSSliderEvent.HARD_UPDATE));
  3756. }
  3757. };
  3758. p.locate = function(){
  3759. this.__resize();
  3760. };
  3761. p.resume = function(){
  3762. if(!this.paused) return;
  3763. this.paused = false;
  3764. this._startTimer();
  3765. };
  3766. p.pause = function(){
  3767. if(this.paused) return;
  3768. this.paused = true;
  3769. this._stopTimer();
  3770. };
  3771. p.currentTime = function(){
  3772. return this._delayProgress;
  3773. };
  3774. averta.EventDispatcher.extend(p);
  3775. })(jQuery);
  3776. /* ================== bin-debug/js/pro/MasterSlider.js =================== */
  3777. /**
  3778. * Master Slider Main JavaScript File
  3779. */
  3780. ;(function($){
  3781. "use strict";
  3782. var LayerTypes = {
  3783. 'image' : MSImageLayerElement,
  3784. 'text' : MSLayerElement,
  3785. 'video' : MSVideoLayerElement,
  3786. 'hotspot' : MSHotspotLayer,
  3787. 'button' : MSButtonLayer
  3788. };
  3789. window.MasterSlider = function(){
  3790. // Default Options
  3791. this.options = {
  3792. autoplay : false, // Enables the autoplay slideshow.
  3793. loop : false, // Enables the continuous sliding mode.
  3794. mouse : true, // Whether the user can use mouse drag navigation.
  3795. swipe : true, // Whether the drag/swipe navigation is enabled.
  3796. grabCursor : true, // Whether the slider uses grab mouse cursor.
  3797. space : 0, // The spacing value between slides in pixels.
  3798. fillMode : 'fill', // Specifies the slide background scaling method. Its acceptable values are "fill", "fit", "stretch", "center" and "tile".
  3799. start : 1, // The slider starting slide number.
  3800. view : 'basic', // The slide changing transition.
  3801. width : 300, // The base width of slides. It helps the slider to resize in correct ratio.
  3802. height : 150, // The base height of slides, It helps the slider to resize in correct ratio.
  3803. inView : 15, // Specifies number of slides which will be added at a same time in DOM.
  3804. critMargin : 1, //
  3805. heightLimit : true, // It force the slide to use max height value as its base specified height value.
  3806. smoothHeight : true, // Whether the slider uses smooth animation while its height changes.
  3807. autoHeight : false, // Whether the slider adapts its height to each slide height or not. It overrides heightLimit option.
  3808. minHeight : -1, // @since 2.13.0, Specifies min height value for the slider, it prevents slider to shows too narrow in small screens.
  3809. 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.
  3810. fullheight : false, // It enables the slider to adapt height to its parent element.
  3811. 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.
  3812. 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.
  3813. hideLayers : false, // Whether the slider hides all layers before changing slide.
  3814. endPause : false, // Whether the slider pauses slideshow when it stays at the last slide.
  3815. centerControls : true, // Whether the slider aligns UI controls to center. This option is only effective in full width mode.
  3816. overPause : true, // Whether the slider pauses slideshow on hover.
  3817. shuffle : false, // Enables the shuffle slide order.
  3818. speed : 17, // Specifies slide changing speed. It accepts float values between 0 and 100.
  3819. dir : 'h', // Specifies slide changing direction. It accepts two values "h" (horizontal) and "v" (vertical).
  3820. preload : 0, // Specifies number of slides which will be loaded by slider. 0 value means the slider loads slides in sequence.
  3821. wheel : false, // Whether slider uses mouse wheel for navigation.
  3822. layout : 'boxed', // It accepts 'fullwidth', 'fullscreen', 'fillwidth', 'autofill', 'partialview', 'boxed'. It overrides 'fullwidth' and 'autofill' (added in v1.5.6)
  3823. 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.
  3824. fullscreenMargin : 0, // Specifies margin amount to the bottom of slider, it's only effective on fullscreen slider.
  3825. instantStartLayers : false, // @since 1.5.0, Whether instantly shows slide layers.
  3826. parallaxMode : 'mouse', // @since 1.6.0, Specifies mode of parallax effect accepts: "mouse", "mouse:x-only", "mouse:y-only" and "swipe"
  3827. rtl : false, // @since 1.8.0, Whether Right-to-left direction slider.
  3828. 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
  3829. deepLinkType : 'path', // @since 2.1.0, type of hash value in page's url possible values, path and query ( #gallery/1 || #gallery=4 )
  3830. disablePlugins : [] // @since 2.9.6, list of disabled Master Slider plugin names for this instance.
  3831. };
  3832. this.slides = [];
  3833. this.activePlugins = [];
  3834. this.$element = null;
  3835. // used by new layout method. to force fullwidth or fullscreen
  3836. this.lastMargin = 0;
  3837. // Reserved side spaces of slider
  3838. this.leftSpace = 0;
  3839. this.topSpace = 0;
  3840. this.rightSpace = 0;
  3841. this.bottomSpace = 0;
  3842. // hold on stack
  3843. this._holdOn = 0;
  3844. var that = this;
  3845. this.resize_listener = function(){that._resize();};
  3846. $(window).bind('resize', this.resize_listener);
  3847. };
  3848. MasterSlider.author = 'Averta Ltd. (www.averta.net)';
  3849. MasterSlider.version = '2.15.1';
  3850. MasterSlider.releaseDate = 'Jul 2015';
  3851. // Master Slider plugins.
  3852. MasterSlider._plugins = []
  3853. var MS = MasterSlider;
  3854. MS.registerPlugin = function ( plugin ) {
  3855. if ( MS._plugins.indexOf(plugin) === -1 ) {
  3856. MS._plugins.push(plugin);
  3857. }
  3858. };
  3859. var p = MasterSlider.prototype;
  3860. /*-------------- METHODS --------------*/
  3861. /**
  3862. * create one slide object for each slide and add it to slide controller
  3863. * @since 1.0
  3864. * @private
  3865. */
  3866. p.__setupSlides = function(){
  3867. var that = this,
  3868. new_slide,
  3869. ind = 0;
  3870. this.$element.children('.ms-slide').each(function(index) {
  3871. var $slide_ele = $(this);
  3872. new_slide = new MSSlide();
  3873. new_slide.$element = $slide_ele;
  3874. new_slide.slider = that;
  3875. new_slide.delay = $slide_ele.data('delay') !== undefined ? $slide_ele.data('delay') : 3;
  3876. new_slide.fillMode = $slide_ele.data('fill-mode') !== undefined ? $slide_ele.data('fill-mode') : that.options.fillMode;
  3877. new_slide.index = ind++;
  3878. // Slide Background Image
  3879. var slide_img = $slide_ele.children('img:not(.ms-layer)');
  3880. if( slide_img.length > 0 ){
  3881. new_slide.setBG(slide_img[0]);
  3882. }
  3883. // Slide Video Background
  3884. var slide_video = $slide_ele.children('video');
  3885. if( slide_video.length > 0 ) new_slide.setBGVideo(slide_video);
  3886. // controls
  3887. if(that.controls){
  3888. for(var i = 0 , l = that.controls.length; i<l ; ++i)
  3889. that.controls[i].slideAction(new_slide);
  3890. }
  3891. // Slide Link and Video
  3892. var slide_link = $slide_ele.children('a').each(function(index) {
  3893. var $this = $(this);
  3894. if(this.getAttribute('data-type') === 'video'){
  3895. new_slide.video = this.getAttribute('href');
  3896. new_slide.videoAutoPlay = $this.data('autoplay');
  3897. $this.remove();
  3898. }else if(!$this.hasClass('ms-layer')) {
  3899. new_slide.link = $(this);
  3900. //new_slide.link_targ = this.getAttribute('target');
  3901. //$this.remove();
  3902. }
  3903. });//.remove();
  3904. // Slide Layers
  3905. that.__createSlideLayers(new_slide , $slide_ele.find('.ms-layer'));
  3906. that.slides.push(new_slide);
  3907. that.slideController.view.addSlide(new_slide);
  3908. });
  3909. };
  3910. /**
  3911. * Creates layers of specified layer
  3912. * @param {MSSlide} slide
  3913. * @param {Array} layers
  3914. * @since 1.0
  3915. * @private
  3916. */
  3917. p.__createSlideLayers = function(slide , layers) {
  3918. if(layers.length == 0) return;
  3919. slide.setupLayerController();
  3920. layers.each(function(index , domEle){
  3921. var $layer_element = $(this),
  3922. $parent_ele;
  3923. if( domEle.nodeName === 'A' && $layer_element.find('>img').data('type') === 'image' ) {
  3924. $parent_ele = $(this);
  3925. $layer_element = $parent_ele.find('img');
  3926. }
  3927. var layer = new (LayerTypes[$layer_element.data('type') || 'text']) ();
  3928. layer.$element = $layer_element;
  3929. layer.link = $parent_ele;
  3930. var eff_parameters = {},
  3931. end_eff_parameters = {};
  3932. if($layer_element.data('effect') !== undefined) eff_parameters.name = $layer_element.data('effect');
  3933. if($layer_element.data('ease') !== undefined) eff_parameters.ease = $layer_element.data('ease');
  3934. if($layer_element.data('duration') !== undefined) eff_parameters.duration = $layer_element.data('duration');
  3935. if($layer_element.data('delay') !== undefined) eff_parameters.delay = $layer_element.data('delay');
  3936. if($layer_element.data('hide-effect')) end_eff_parameters.name = $layer_element.data('hide-effect');
  3937. if($layer_element.data('hide-ease')) end_eff_parameters.ease = $layer_element.data('hide-ease');
  3938. if($layer_element.data('hide-duration') !== undefined) end_eff_parameters.duration = $layer_element.data('hide-duration');
  3939. if($layer_element.data('hide-time') !== undefined) end_eff_parameters.time = $layer_element.data('hide-time');
  3940. layer.setStartAnim(eff_parameters);
  3941. layer.setEndAnim(end_eff_parameters);
  3942. slide.layerController.addLayer(layer);
  3943. });
  3944. };
  3945. /**
  3946. * remove slider initialize loading
  3947. * @since 1.0
  3948. * @private
  3949. */
  3950. p._removeLoading = function(){
  3951. $(window).unbind('resize', this.resize_listener);
  3952. this.$element.removeClass('before-init')
  3953. .css('visibility', 'visible')
  3954. .css('height','')
  3955. .css('opacity' , 0);
  3956. CTween.fadeIn(this.$element);
  3957. this.$loading.remove();
  3958. if(this.slideController)
  3959. this.slideController.__resize();
  3960. };
  3961. /**
  3962. * resize listener, it only used for aligning slider loading and after slider init it will be removed
  3963. * @param {Event} e
  3964. * @since 1.0
  3965. * @private
  3966. */
  3967. p._resize = function(e){
  3968. if(this.$loading){
  3969. var h = this.$loading[0].clientWidth / this.aspect;
  3970. h = this.options.heightLimit ? Math.min(h , this.options.height) : h;
  3971. this.$loading.height(h);
  3972. this.$element.height(h);
  3973. }
  3974. };
  3975. /**
  3976. * changes the order of slides element before setup slides
  3977. * @since 1.0
  3978. * @private
  3979. */
  3980. p._shuffleSlides = function(){
  3981. var slides = this.$element.children('.ms-slide') , r;
  3982. for(var i = 0 , l = slides.length; i < l ; ++i){
  3983. r = Math.floor(Math.random() * (l - 1));
  3984. if(i != r){
  3985. this.$element[0].insertBefore(slides[i] , slides[r]);
  3986. slides = this.$element.children('.ms-slide');
  3987. }
  3988. }
  3989. };
  3990. /**
  3991. * New method of setting up the layout of slider
  3992. * @since 1.5.6
  3993. */
  3994. p._setupSliderLayout = function(){
  3995. // create side spaces
  3996. this._updateSideMargins();
  3997. this.lastMargin = this.leftSpace;
  3998. var lo = this.options.layout;
  3999. if( lo !== 'boxed' && lo !== 'partialview' ){
  4000. this.options.fullwidth = true; // enable slider fullscreen for fullwidth, fillwidth, autofill and fullscreen layouts.
  4001. }
  4002. if( lo === 'fullscreen' || lo === 'autofill' ){
  4003. this.options.fullheight = true;
  4004. if ( lo === 'autofill' ) {
  4005. this.$autofillTarget = $(this.options.autofillTarget);
  4006. if ( this.$autofillTarget.length === 0 ) {
  4007. this.$autofillTarget = this.$element.parent();
  4008. }
  4009. }
  4010. }
  4011. // partial view
  4012. if ( lo === 'partialview' ){
  4013. this.$element.addClass('ms-layout-partialview');
  4014. }
  4015. if( lo === 'fullscreen' || lo === 'fullwidth' || lo === 'autofill' ){
  4016. $(window).bind('resize', {that:this}, this._updateLayout);
  4017. this._updateLayout();
  4018. }
  4019. // bind resize handler of slidecontroller __resize
  4020. $(window).bind('resize', this.slideController.resize_listener);
  4021. };
  4022. /**
  4023. * updates layout of slider based on window size
  4024. * @param {Event} event
  4025. * @since 1.5.6
  4026. */
  4027. p._updateLayout = function(event){
  4028. var that = event? event.data.that : this,
  4029. lo = that.options.layout,
  4030. $element = that.$element,
  4031. $win = $(window);
  4032. // height
  4033. if( lo === 'fullscreen' ){
  4034. document.body.style.overflow = 'hidden';
  4035. $element.height( $win.height() - that.options.fullscreenMargin - that.topSpace - that.bottomSpace);
  4036. document.body.style.overflow = '';
  4037. } else if ( lo === 'autofill' ) {
  4038. $element.height(that.$autofillTarget.height() - that.options.fullscreenMargin - that.topSpace - that.bottomSpace)
  4039. .width(that.$autofillTarget.width() - that.leftSpace - that.rightSpace);
  4040. return;
  4041. }
  4042. // width
  4043. $element.width($win.width() - that.leftSpace - that.rightSpace);
  4044. var margin = -$element.offset().left + that.leftSpace + that.lastMargin;
  4045. $element.css('margin-left', margin );
  4046. that.lastMargin = margin;
  4047. //
  4048. };
  4049. /**
  4050. * initialize the slider, called by document ready
  4051. * <code>holdOn</code> property prevents auto initialize slider after document ready it used by plugins of slider like Flickr
  4052. * @since 1.0
  4053. * @protected
  4054. */
  4055. p._init = function(){
  4056. if ( this._holdOn > 0 || !this._docReady ) {
  4057. return;
  4058. }
  4059. this.initialized = true;
  4060. if(this.options.preload !== 'all'){
  4061. this._removeLoading();
  4062. }
  4063. //else
  4064. // this.$element.css('width' , this.$loading[0].clientWidth);
  4065. if(this.options.shuffle) this._shuffleSlides();
  4066. MSLayerEffects.setup();
  4067. this.slideController.setupView();
  4068. this.view = this.slideController.view;
  4069. this.$controlsCont = $('<div></div>').addClass('ms-inner-controls-cont');//.appendTo(this.$element);
  4070. if(this.options.centerControls){
  4071. this.$controlsCont.css('max-width' , this.options.width + 'px');
  4072. }
  4073. this.$controlsCont.prepend(this.view.$element);
  4074. this.$msContainer = $('<div></div>').addClass('ms-container').prependTo(this.$element).append(this.$controlsCont);
  4075. if(this.controls){
  4076. for(var i = 0 , l = this.controls.length; i<l ; ++i){
  4077. this.controls[i].setup();
  4078. }
  4079. }
  4080. /*else{
  4081. this.$element.append(this.view.$element);
  4082. }*/
  4083. this._setupSliderLayout();
  4084. this.__setupSlides();
  4085. this.slideController.setup();
  4086. if(this.controls){
  4087. for(i = 0 , l = this.controls.length; i<l ; ++i)
  4088. this.controls[i].create();
  4089. }
  4090. if(this.options.autoHeight){
  4091. this.slideController.view.$element.height(this.slideController.currentSlide.getHeight());
  4092. }
  4093. // add grab cursor
  4094. if(this.options.swipe && !window._touch && this.options.grabCursor && this.options.mouse){
  4095. var $view = this.view.$element;
  4096. $view.mousedown(function(){
  4097. $view.removeClass('ms-grab-cursor');
  4098. $view.addClass('ms-grabbing-cursor');
  4099. if ( $.browser.msie && window.ms_grabbing_curosr ) {
  4100. $view[0].style.cursor = 'url(' + window.ms_grabbing_curosr + '), move';
  4101. }
  4102. }).addClass('ms-grab-cursor');
  4103. $(document).mouseup(function(){
  4104. $view.removeClass('ms-grabbing-cursor');
  4105. $view.addClass('ms-grab-cursor');
  4106. if ( $.browser.msie && window.ms_grab_curosr ) {
  4107. $view[0].style.cursor = 'url(' + window.ms_grab_curosr + '), move';
  4108. }
  4109. });
  4110. }
  4111. this.slideController.__dispatchInit();
  4112. };
  4113. /**
  4114. * changes the height of slider, it used in autoheight slider
  4115. * @param {Number} value
  4116. * @since 1.0
  4117. * @public
  4118. */
  4119. p.setHeight = function(value){
  4120. if(this.options.smoothHeight){
  4121. if(this.htween){
  4122. if(this.htween.reset)this.htween.reset();
  4123. else this.htween.stop(true);
  4124. }
  4125. this.htween = CTween.animate(this.slideController.view.$element , 500 , {height:value} , {ease:'easeOutQuart'});
  4126. }else
  4127. this.slideController.view.$element.height(value);
  4128. };
  4129. /**
  4130. * reserves white space in sides of slider, it used by controls
  4131. * @param {String} side left|right|top|bottom
  4132. * @param {Number} space
  4133. * @returns {Number} start position in space.
  4134. * @since 1.5.7
  4135. * @public
  4136. */
  4137. p.reserveSpace = function(side, space){
  4138. var sideSpace = side+'Space',
  4139. pos = this[sideSpace];
  4140. this[sideSpace] += space;
  4141. this._updateSideMargins();
  4142. return pos;
  4143. };
  4144. /**
  4145. * returns the reserved space, it used by controls and called when aligned control hides
  4146. * @param {String} side
  4147. * @param {Number} space
  4148. * @since 1.5.7
  4149. * @public
  4150. */
  4151. /*p.returnSpace = function(side, space){
  4152. var sideSpace = side+'Space';
  4153. this[sideSpace] = Math.max(0 , this[sideSpace] - space);
  4154. this.api.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESERVED_SPACE_CHANGE));
  4155. this._updateSideMargins();
  4156. };*/
  4157. p._updateSideMargins = function(){
  4158. this.$element.css('margin', this.topSpace + 'px ' + this.rightSpace + 'px ' + this.bottomSpace + 'px ' + this.leftSpace + 'px');
  4159. }
  4160. p._realignControls = function(){
  4161. this.rightSpace = this.leftSpace = this.topSpace = this.bottomSpace = 0;
  4162. this._updateSideMargins();
  4163. this.api.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESERVED_SPACE_CHANGE));
  4164. };
  4165. /*------------------------- Public Methods -----------------------*/
  4166. /**
  4167. * Adds new control to the slider
  4168. * @param {String} control
  4169. * @param {Object} options [description]
  4170. * @since 1.0
  4171. * @public
  4172. */
  4173. p.control = function(control , options){
  4174. if(!(control in MSSlideController.SliderControlList)) return;
  4175. if(!this.controls) this.controls = [];
  4176. var ins = new MSSlideController.SliderControlList[control](options);
  4177. ins.slider = this;
  4178. this.controls.push(ins);
  4179. return this;
  4180. };
  4181. /**
  4182. * Hold on slider from initialization
  4183. * @since 2.9.6
  4184. * @public
  4185. */
  4186. p.holdOn = function () {
  4187. this._holdOn ++;
  4188. };
  4189. /**
  4190. * Let the slider to initialize
  4191. * @since 2.9.6
  4192. */
  4193. p.release = function () {
  4194. this._holdOn --;
  4195. this._init();
  4196. };
  4197. /**
  4198. * setup slider
  4199. * @param {String|jQuery object} id
  4200. * @param {Object} options
  4201. * @since 1.0
  4202. * @public
  4203. */
  4204. p.setup = function(target , options){
  4205. if(typeof target === 'string'){
  4206. this.$element = $('#' + target);
  4207. } else {
  4208. this.$element = target.eq(0);
  4209. }
  4210. //create a copy from slider markup, it will be used in destroy method.
  4211. this.setupMarkup = this.$element.html();
  4212. if( this.$element.length === 0 ){
  4213. //if(console) console.log('Master Slider Error: #'+id+' not found.');
  4214. return;
  4215. }
  4216. this.$element.addClass('master-slider').addClass('before-init');
  4217. // IE prefix class
  4218. // add browser prefix class name
  4219. if($.browser.msie){
  4220. this.$element.addClass('ms-ie')
  4221. .addClass('ms-ie' + $.browser.version.slice(0 , $.browser.version.indexOf('.')));
  4222. } else if ( $.browser.webkit ) {
  4223. this.$element.addClass('ms-wk');
  4224. } else if ( $.browser.mozilla ) {
  4225. this.$element.addClass('ms-moz');
  4226. }
  4227. // Android prefix class
  4228. var ua = navigator.userAgent.toLowerCase();
  4229. var isAndroid = ua.indexOf("android") > -1;
  4230. if(isAndroid) {
  4231. this.$element.addClass('ms-android');
  4232. }
  4233. var that = this;
  4234. $.extend(this.options, options);
  4235. this.aspect = this.options.width / this.options.height;
  4236. this.$loading = $('<div></div>').
  4237. addClass('ms-loading-container').
  4238. insertBefore(this.$element).
  4239. append($('<div></div>').addClass('ms-loading'));
  4240. this.$loading.parent().css('position' , 'relative');
  4241. // old methods
  4242. if(this.options.autofill){
  4243. this.options.fullwidth = true;
  4244. this.options.fullheight = true;
  4245. }
  4246. if(this.options.fullheight){
  4247. this.$element.addClass('ms-fullheight');
  4248. }
  4249. //this._setupSliderLayout();
  4250. this._resize();
  4251. // define slide controller and api
  4252. this.slideController = new MSSlideController(this);
  4253. this.api = this.slideController;
  4254. // setup plugins
  4255. for ( var i = 0, l = MS._plugins.length; i !== l; i++ ) {
  4256. var plugin = MS._plugins[i];
  4257. if ( this.options.disablePlugins.indexOf(plugin.name) === -1 ) {
  4258. this.activePlugins.push(new plugin(this));
  4259. }
  4260. }
  4261. $(document).ready(function(){
  4262. that._docReady = true;
  4263. that._init();
  4264. });
  4265. return this;
  4266. };
  4267. /**
  4268. * destroy the slider instance
  4269. * @param {Boolean} insertMarkup whether add slider markup after destroy.
  4270. * @since 1.4
  4271. * @public
  4272. */
  4273. p.destroy = function(insertMarkup){
  4274. // destroy active plugins
  4275. for ( var i = 0, l = this.activePlugins.length; i !== l; i++ ) {
  4276. this.activePlugins[i].destroy();
  4277. }
  4278. if(this.controls){
  4279. for( i = 0, l = this.controls.length; i !== l; i++ )
  4280. this.controls[i].destroy();
  4281. }
  4282. if(this.slideController) this.slideController._destroy();
  4283. if(this.$loading) this.$loading.remove();
  4284. if ( insertMarkup ) {
  4285. this.$element.html(this.setupMarkup).css('visibility' , 'hidden');
  4286. } else {
  4287. this.$element.remove();
  4288. }
  4289. var lo = this.options.layout;
  4290. if( lo === 'fullscreen' || lo === 'fullwidth' ){
  4291. $(window).unbind('resize', this._updateLayout);
  4292. }
  4293. this.view = null;
  4294. this.slides = null;
  4295. this.options = null;
  4296. this.slideController = null;
  4297. this.api = null;
  4298. this.resize_listener = null;
  4299. this.activePlugins = null;
  4300. };
  4301. })(jQuery);
  4302. /**
  4303. * Master Slider jQuery Plugin
  4304. * @author Averta
  4305. */
  4306. (function ( $, window, document, undefined ) {
  4307. var pluginName = "masterslider",
  4308. defaults = {
  4309. controls:{}
  4310. };
  4311. function MasterSliderPlugin ( element, options ) {
  4312. this.element = element;
  4313. this.$element = $(element);
  4314. this.settings = $.extend( {}, defaults, options );
  4315. this._defaults = defaults;
  4316. this._name = pluginName;
  4317. this.init();
  4318. }
  4319. $.extend(MasterSliderPlugin.prototype, {
  4320. init : function () {
  4321. var self = this;
  4322. // create new instance form Master Slider
  4323. this._slider = new MasterSlider();
  4324. // add controls
  4325. for ( var control in this.settings.controls ){
  4326. this._slider.control(control, this.settings.controls[control]);
  4327. }
  4328. this._slider.setup(this.$element, this.settings);
  4329. // override api eventdisaptcher method
  4330. var _superDispatch = this._slider.api.dispatchEvent;
  4331. this._slider.api.dispatchEvent = function(event){
  4332. self.$element.trigger(event.type);
  4333. _superDispatch.call(this, event);
  4334. };
  4335. },
  4336. api : function() {
  4337. return this._slider.api;
  4338. },
  4339. slider : function() {
  4340. return this._slider;
  4341. }
  4342. });
  4343. $.fn[pluginName] = function ( options ) {
  4344. var args = arguments,
  4345. plugin = 'plugin_' + pluginName;
  4346. // Is the first parameter an object (options), or was omitted,
  4347. // instantiate a new instance of the plugin.
  4348. if (options === undefined || typeof options === 'object') {
  4349. return this.each(function () {
  4350. // Only allow the plugin to be instantiated once,
  4351. // so we check that the element has no plugin instantiation yet
  4352. if (!$.data(this, plugin)) {
  4353. $.data(this, plugin, new MasterSliderPlugin( this, options ));
  4354. }
  4355. });
  4356. // If the first parameter is a string and it doesn't start
  4357. // with an underscore or "contains" the `init`-function,
  4358. // treat this as a call to a public method.
  4359. } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
  4360. // Cache the method call
  4361. // to make it possible
  4362. // to return a value
  4363. var returns;
  4364. this.each(function () {
  4365. var instance = $.data(this, plugin);
  4366. // Tests that there's already a plugin-instance
  4367. // and checks that the requested public method exists
  4368. if (instance instanceof MasterSliderPlugin && typeof instance[options] === 'function') {
  4369. // Call the method of our plugin instance,
  4370. // and pass it the supplied arguments.
  4371. returns = instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
  4372. }
  4373. // Map slider api functions to slider jq plugin
  4374. if ( instance instanceof MasterSliderPlugin && typeof instance._slider.api[options] === 'function' ) {
  4375. returns = instance._slider.api[options].apply( instance._slider.api, Array.prototype.slice.call( args, 1 ) );
  4376. }
  4377. // Allow instances to be destroyed via the 'destroy' method
  4378. if (options === 'destroy') {
  4379. $.data(this, plugin, null);
  4380. }
  4381. });
  4382. // If the earlier cached method
  4383. // gives a value back return the value,
  4384. // otherwise return this to preserve chainability.
  4385. return returns !== undefined ? returns : this;
  4386. }
  4387. };
  4388. })( jQuery, window, document );
  4389. /* ================== bin-debug/js/pro/views/ViewEvents.js =================== */
  4390. window.MSViewEvents = function (type, data){
  4391. this.type = type;
  4392. this.data = data;
  4393. };
  4394. MSViewEvents.SWIPE_START = 'swipeStart';
  4395. MSViewEvents.SWIPE_END = 'swipeEnd';
  4396. MSViewEvents.SWIPE_MOVE = 'swipeMove';
  4397. MSViewEvents.SWIPE_CANCEL = 'swipeCancel';
  4398. MSViewEvents.SCROLL = 'scroll';
  4399. MSViewEvents.CHANGE_START = 'slideChangeStart';
  4400. MSViewEvents.CHANGE_END = 'slideChangeEnd';
  4401. /* ================== bin-debug/js/pro/views/BasicView.js =================== */
  4402. ;(function($){
  4403. "use strict";
  4404. window.MSBasicView = function(options){
  4405. this.options = {
  4406. loop : false,
  4407. dir : 'h',
  4408. autoHeight : false,
  4409. spacing : 5,
  4410. mouseSwipe : true,
  4411. swipe : true,
  4412. speed : 17,
  4413. minSlideSpeed : 2,
  4414. viewNum : 20,
  4415. critMargin : 1
  4416. };
  4417. $.extend(this.options , options);
  4418. this.dir = this.options.dir;
  4419. this.loop = this.options.loop;
  4420. this.spacing = this.options.spacing;
  4421. this.__width = 0;
  4422. this.__height = 0;
  4423. this.__cssProb = this.dir === 'h' ? 'left' : 'top';
  4424. this.__offset = this.dir === 'h' ? 'offsetLeft' : 'offsetTop';
  4425. this.__dimension = this.dir === 'h' ? '__width' : '__height';
  4426. this.__translate_end = window._css3d ? ' translateZ(0px)' : '';
  4427. this.$slideCont = $('<div></div>').addClass('ms-slide-container');
  4428. this.$element = $('<div></div>').addClass('ms-view').addClass('ms-basic-view').append(this.$slideCont);
  4429. this.currentSlide = null;
  4430. this.index = -1;
  4431. this.slidesCount = 0;
  4432. this.slides = [];
  4433. this.slideList = []; // All of slides with added priority sort;
  4434. this.viewSlidesList = [];
  4435. this.css3 = window._cssanim;
  4436. this.start_buffer = 0;
  4437. this.firstslide_snap = 0;
  4438. this.slideChanged = false;
  4439. this.controller = new Controller(0 , 0 , {
  4440. snapping : true,
  4441. snapsize : 100,
  4442. paging : true,
  4443. snappingMinSpeed : this.options.minSlideSpeed,
  4444. friction : (100 - this.options.speed * 0.5) / 100,
  4445. endless : this.loop
  4446. });
  4447. this.controller.renderCallback(this.dir === 'h'? this._horizUpdate : this._vertiUpdate , this);
  4448. this.controller.snappingCallback(this.__snapUpdate , this);
  4449. this.controller.snapCompleteCallback(this.__snapCompelet , this);
  4450. averta.EventDispatcher.call(this);
  4451. };
  4452. var p = MSBasicView.prototype;
  4453. /*-------------- METHODS --------------*/
  4454. p.__snapCompelet = function(snap , type){
  4455. // if(this.loop && Math.abs(this.__contPos) > 20000){
  4456. // this.__locateSlides();
  4457. // this.gotoSlide(this.index , true);
  4458. // }
  4459. //
  4460. if ( !this.slideChanged ) {
  4461. return;
  4462. }
  4463. this.slideChanged = false;
  4464. this.__locateSlides();
  4465. this.start_buffer = 0;
  4466. this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_END));
  4467. };
  4468. p.__snapUpdate = function(controller , snap , change){
  4469. if(this.loop){
  4470. var target_index = this.index + change;
  4471. this.updateLoop(target_index);
  4472. if(target_index >= this.slidesCount) target_index = target_index - this.slidesCount;
  4473. if(target_index < 0) target_index = this.slidesCount + target_index;
  4474. this.index = target_index;
  4475. }else{
  4476. if(snap < 0 || snap >= this.slidesCount) return
  4477. this.index = snap;
  4478. }
  4479. this._checkCritMargins();
  4480. if($.browser.mozilla){
  4481. this.slideList[this.index].$element[0].style.marginTop = '0.1px';
  4482. if(this.currentSlide){
  4483. this.currentSlide.$element[0].style.marginTop = '';
  4484. }
  4485. }
  4486. var new_slide = this.slideList[this.index];
  4487. if(new_slide === this.currentSlide)return;
  4488. this.currentSlide = new_slide;
  4489. if ( this.autoUpdateZIndex ) {
  4490. this.__updateSlidesZindex();
  4491. }
  4492. this.slideChanged = true;
  4493. this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START));
  4494. };
  4495. p._checkCritMargins = function(){
  4496. if(this.normalMode) return;
  4497. var hlf = Math.floor(this.options.viewNum / 2),
  4498. inView = this.viewSlidesList.indexOf(this.slideList[this.index]),
  4499. size = (this[this.__dimension] + this.spacing),
  4500. cm = this.options.critMargin;
  4501. if(this.loop){
  4502. if(inView <= cm || inView >= this.viewSlidesList.length - cm){
  4503. size *= (inView - hlf);
  4504. this.__locateSlides(false , size + this.start_buffer );
  4505. this.start_buffer += size;
  4506. }
  4507. return;
  4508. }
  4509. if( (inView < cm && this.index >= cm ) || (inView >= this.viewSlidesList.length - cm && this.index < this.slidesCount - cm)){
  4510. this.__locateSlides(false);
  4511. }
  4512. };
  4513. p._vertiUpdate = function(controller , value){
  4514. this.__contPos = value;
  4515. this.dispatchEvent(new MSViewEvents(MSViewEvents.SCROLL));
  4516. if(this.css3){
  4517. this.$slideCont[0].style[window._jcsspfx + 'Transform'] = 'translateY('+-value+'px)' + this.__translate_end;
  4518. return;
  4519. }
  4520. this.$slideCont[0].style.top = -value + 'px';
  4521. };
  4522. p._horizUpdate = function(controller , value){
  4523. this.__contPos = value;
  4524. this.dispatchEvent(new MSViewEvents(MSViewEvents.SCROLL));
  4525. if(this.css3) {
  4526. this.$slideCont[0].style[window._jcsspfx + 'Transform'] = 'translateX('+-value+'px)'+ this.__translate_end;
  4527. return;
  4528. }
  4529. this.$slideCont[0].style.left = -value + 'px';
  4530. };
  4531. p.__updateViewList = function(){
  4532. if(this.normalMode) {
  4533. this.viewSlidesList = this.slides;
  4534. return;
  4535. }
  4536. var temp = this.viewSlidesList.slice();
  4537. // update view list
  4538. this.viewSlidesList = [];
  4539. var i = 0 , hlf = Math.floor(this.options.viewNum / 2) , l;
  4540. if(this.loop){
  4541. for(; i !== this.options.viewNum ; i++)
  4542. this.viewSlidesList.push(this.slides[this.currentSlideLoc - hlf + i]);
  4543. }else{
  4544. // before
  4545. for(i = 0 ; i !== hlf && this.index - i !== -1 ; i++)
  4546. this.viewSlidesList.unshift(this.slideList[this.index - i]);
  4547. // after
  4548. for(i = 1; i !== hlf && this.index + i !== this.slidesCount; i++)
  4549. this.viewSlidesList.push(this.slideList[this.index + i]);
  4550. }
  4551. for (i = 0 , l = temp.length ; i !== l ; i++)
  4552. if( this.viewSlidesList.indexOf(temp[i]) === -1)
  4553. temp[i].sleep();
  4554. temp = null;
  4555. if( this.currentSlide ) {
  4556. this.__updateSlidesZindex();
  4557. }
  4558. };
  4559. p.__locateSlides = function(move , start){
  4560. this.__updateViewList();
  4561. start = !this.loop ? this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing ) : start || 0;
  4562. // old method
  4563. /*for(i = 0; i < this.slidesCount ; ++i){
  4564. var pos = i * (this[this.__dimension] + this.spacing);
  4565. this.slides[i].position = pos;
  4566. this.slides[i].$element[0].style[this.__cssProb] = pos + 'px';
  4567. }*/
  4568. var l = this.viewSlidesList.length , slide;
  4569. for(var i = 0; i !== l ; i++){
  4570. var pos = start + i * (this[this.__dimension] + this.spacing );
  4571. slide = this.viewSlidesList[i];
  4572. slide.wakeup();
  4573. slide.position = pos;
  4574. slide.$element[0].style[this.__cssProb] = pos + 'px';
  4575. }
  4576. if(move !== false)this.controller.changeTo( this.slideList[this.index].position , false , null , null , false);
  4577. };
  4578. p.__createLoopList = function(){
  4579. var return_arr = [];
  4580. var i = 0,
  4581. count = this.slidesCount / 2;
  4582. var before_count = (this.slidesCount % 2 === 0)? count - 1 : Math.floor(count);
  4583. var after_count = (this.slidesCount % 2 === 0)? count : Math.floor(count);
  4584. this.currentSlideLoc = before_count;
  4585. // before
  4586. for(i = 1 ; i <= before_count ; ++i)
  4587. return_arr.unshift(this.slideList[(this.index - i < 0)? this.slidesCount - i + this.index: this.index - i]);
  4588. // current
  4589. return_arr.push(this.slideList[this.index]);
  4590. // after
  4591. for(i = 1; i <= after_count; ++i)
  4592. return_arr.push(this.slideList[(this.index + i >= this.slidesCount)? this.index + i - this.slidesCount : this.index + i]);
  4593. return return_arr;
  4594. };
  4595. /*
  4596. * Calculate shortest distance from index to target.
  4597. * It will used in loop gesture.
  4598. *
  4599. * Negative values means left direction.
  4600. */
  4601. p.__getSteps = function(index , target){
  4602. var right = (target < index)? this.slidesCount - index + target : target - index;
  4603. var left = Math.abs(this.slidesCount - right);
  4604. return (right < left)? right : -left;
  4605. };
  4606. p.__pushEnd = function(){
  4607. var first_slide = this.slides.shift();
  4608. var last_slide = this.slides[this.slidesCount - 2];
  4609. this.slides.push(first_slide);
  4610. if(!this.normalMode) return;
  4611. var pos = last_slide.$element[0][this.__offset] + this.spacing + this[this.__dimension];
  4612. first_slide.$element[0].style[this.__cssProb] = pos + 'px';
  4613. first_slide.position = pos;
  4614. };
  4615. p.__pushStart = function(){
  4616. var last_slide = this.slides.pop();
  4617. var first_slide = this.slides[0];
  4618. this.slides.unshift(last_slide);
  4619. if(!this.normalMode) return;
  4620. var pos = first_slide.$element[0][this.__offset] - this.spacing - this[this.__dimension];
  4621. last_slide.$element[0].style[this.__cssProb] = pos + 'px';
  4622. last_slide.position = pos;
  4623. };
  4624. // @since 1.7.0
  4625. // adds z-index to slides
  4626. p.__updateSlidesZindex = function(){
  4627. var slide,
  4628. l = this.viewSlidesList.length,
  4629. hlf = Math.floor( l/2 );
  4630. if( this.loop ){
  4631. var loc = this.viewSlidesList.indexOf(this.currentSlide);
  4632. for ( var i = 0; i!==l; i++ ){
  4633. slide = this.viewSlidesList[i];
  4634. this.viewSlidesList[i].$element.css('z-index', i<=loc ? i+1 : l-i);
  4635. }
  4636. } else {
  4637. var beforeNum = this.currentSlide.index - this.viewSlidesList[0].index,
  4638. afterNum = l - beforeNum,
  4639. diff = beforeNum - afterNum;
  4640. for ( var i = 0; i!==l; i++ ){
  4641. this.viewSlidesList[i].$element.css('z-index', i<=beforeNum ? i+1 : l-i);
  4642. }
  4643. this.currentSlide.$element.css('z-index', l);
  4644. }
  4645. };
  4646. p.addSlide = function(slide){
  4647. slide.view = this;
  4648. this.slides.push(slide);
  4649. this.slideList.push(slide);
  4650. this.slidesCount++;
  4651. };
  4652. p.appendSlide = function(slide){
  4653. this.$slideCont.append(slide.$element);
  4654. };
  4655. p.updateLoop = function(index){
  4656. if(this.loop){
  4657. var steps = this.__getSteps(this.index , index);
  4658. for(var i = 0 , l = Math.abs(steps) ; i < l ; ++ i){
  4659. if(steps < 0) this.__pushStart();
  4660. else this.__pushEnd();
  4661. }
  4662. }
  4663. };
  4664. p.gotoSlide = function(index , fast){
  4665. this.updateLoop(index);
  4666. this.index = index;
  4667. var target_slide = this.slideList[index];
  4668. this._checkCritMargins();
  4669. this.controller.changeTo( target_slide.position , !fast , null , null , false);
  4670. if(target_slide === this.currentSlide) return;
  4671. this.slideChanged = true;
  4672. this.currentSlide = target_slide;
  4673. if ( this.autoUpdateZIndex ) {
  4674. this.__updateSlidesZindex();
  4675. }
  4676. this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START));
  4677. if(fast)this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_END));
  4678. };
  4679. p.next = function(checkLoop){
  4680. if ( checkLoop && !this.loop && this.index + 1 >= this.slidesCount ) {
  4681. this.controller.bounce(10);
  4682. return;
  4683. }
  4684. this.gotoSlide((this.index + 1 >= this.slidesCount)? 0 : this.index + 1);
  4685. };
  4686. p.previous = function(checkLoop){
  4687. if ( checkLoop && !this.loop && this.index - 1 < 0 ) {
  4688. this.controller.bounce(-10);
  4689. return;
  4690. }
  4691. this.gotoSlide((this.index - 1 < 0)? this.slidesCount - 1 : this.index - 1);
  4692. };
  4693. /* --------------- Swipe control ------------------*/
  4694. p.setupSwipe = function(){
  4695. this.swipeControl = new averta.TouchSwipe(this.$element);
  4696. this.swipeControl.swipeType = this.dir === 'h'? 'horizontal' : 'vertical';
  4697. var that = this;
  4698. if(this.dir === 'h'){
  4699. this.swipeControl.onSwipe = function(status){
  4700. that.horizSwipeMove(status);
  4701. };
  4702. }else{
  4703. this.swipeControl.onSwipe = function(status){
  4704. that.vertSwipeMove(status);
  4705. };
  4706. }
  4707. };
  4708. p.vertSwipeMove = function(status){
  4709. var phase = status.phase;
  4710. if(phase === 'start'){
  4711. this.controller.stop();
  4712. this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_START, status));
  4713. }else if(phase === 'move' && (!this.loop || Math.abs(this.currentSlide.position - this.controller.value + status.moveY ) < this.cont_size / 2)){
  4714. this.controller.drag(status.moveY);
  4715. this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_MOVE, status));
  4716. }else if(phase === 'end' || phase === 'cancel'){
  4717. var speed = status.distanceY / status.duration * 50/3;
  4718. if(Math.abs(speed) > 0.1){
  4719. this.controller.push(-speed);
  4720. if(speed > this.controller.options.snappingMinSpeed)
  4721. this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_END, status));
  4722. }else {
  4723. this.controller.cancel();
  4724. this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_CANCEL, status));
  4725. }
  4726. }
  4727. };
  4728. p.horizSwipeMove = function(status){
  4729. var phase = status.phase;
  4730. //console.log(this.loop)
  4731. if(phase === 'start'){
  4732. this.controller.stop();
  4733. this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_START, status));
  4734. }else if(phase === 'move' && (!this.loop || Math.abs(this.currentSlide.position - this.controller.value + status.moveX ) < this.cont_size / 2)){
  4735. this.controller.drag(status.moveX);
  4736. this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_MOVE, status));
  4737. }else if(phase === 'end' || phase === 'cancel'){
  4738. var speed = status.distanceX / status.duration * 50/3;
  4739. if(Math.abs(speed) > 0.1){
  4740. this.controller.push(-speed );
  4741. if(speed > this.controller.options.snappingMinSpeed)
  4742. this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_END, status));
  4743. }else{
  4744. this.controller.cancel();
  4745. this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_CANCEL, status));
  4746. }
  4747. }
  4748. };
  4749. /* ------------------------------------------------*/
  4750. p.setSize = function(width , height , hard){
  4751. if(this.lastWidth === width && height === this.lastHeight && !hard) return;
  4752. this.$element.width(width).height(height);
  4753. for(var i = 0; i < this.slidesCount ; ++i)
  4754. this.slides[i].setSize(width , height , hard);
  4755. this.__width = width;
  4756. this.__height = height;
  4757. if(this.__created){
  4758. this.__locateSlides();
  4759. this.cont_size = (this.slidesCount - 1) * (this[this.__dimension] + this.spacing);
  4760. if(!this.loop) this.controller._max_value = this.cont_size;
  4761. this.controller.options.snapsize = this[this.__dimension] + this.spacing;
  4762. this.controller.changeTo(this.currentSlide.position , false , null , null , false );
  4763. this.controller.cancel();
  4764. this.lastWidth = width;
  4765. this.lastHeight = height;
  4766. }
  4767. };
  4768. p.create = function(index){
  4769. this.__created = true;
  4770. this.index = Math.min((index || 0), this.slidesCount - 1);
  4771. this.lastSnap = this.index; // it will be used to check snap changed or not on snap complete
  4772. if(this.loop)
  4773. this.slides = this.__createLoopList();
  4774. this.normalMode = this.slidesCount <= this.options.viewNum;
  4775. for(var i = 0; i < this.slidesCount ; ++i)
  4776. this.slides[i].create();
  4777. this.__locateSlides();
  4778. this.controller.options.snapsize = this[this.__dimension] + this.spacing;
  4779. if(!this.loop) this.controller._max_value = (this.slidesCount - 1) * (this[this.__dimension] + this.spacing);
  4780. this.gotoSlide(this.index , true);
  4781. if(this.options.swipe && (window._touch || this.options.mouseSwipe))
  4782. this.setupSwipe();
  4783. };
  4784. p.destroy = function(){
  4785. if(!this.__created) return;
  4786. for(var i = 0; i < this.slidesCount ; ++i)
  4787. this.slides[i].destroy();
  4788. this.slides = null;
  4789. this.slideList = null;
  4790. this.$element.remove();
  4791. this.controller.destroy();
  4792. this.controller = null;
  4793. };
  4794. averta.EventDispatcher.extend(p);
  4795. MSSlideController.registerView('basic' , MSBasicView);
  4796. })(jQuery);
  4797. /* ================== bin-debug/js/pro/views/WaveView.js =================== */
  4798. ;(function($){
  4799. "use strict";
  4800. window.MSWaveView = function(options){
  4801. MSBasicView.call(this , options);
  4802. this.$element.removeClass('ms-basic-view').addClass('ms-wave-view');
  4803. this.$slideCont.css(window._csspfx + 'transform-style' , 'preserve-3d');
  4804. // Auto update z index of slides
  4805. // @since 1.7
  4806. this.autoUpdateZIndex = true;
  4807. };
  4808. MSWaveView.extend(MSBasicView);
  4809. MSWaveView._3dreq = true;
  4810. MSWaveView._fallback = MSBasicView;
  4811. var p = MSWaveView.prototype;
  4812. var _super = MSBasicView.prototype;
  4813. /*-------------- METHODS --------------*/
  4814. /*p.__setSlideTransDuration = function(value){
  4815. for(var i=0; i<this.slidesCount; ++i)
  4816. this.slides[i].$element.css(window._csspfx + 'transition-duration' , value + 'ms');
  4817. };*/
  4818. p._horizUpdate = function(controller , value){
  4819. _super._horizUpdate.call(this, controller , value);
  4820. var cont_scroll = -value;
  4821. var slide_pos , slide , distance;
  4822. for(var i = 0; i < this.slidesCount; ++i){
  4823. slide = this.slideList[i];
  4824. //slide_pos = parseInt(slide.$element.css('left'));
  4825. distance = -cont_scroll - slide.position;
  4826. this.__updateSlidesHoriz(slide , distance);
  4827. }
  4828. };
  4829. p._vertiUpdate = function(controller , value){
  4830. _super._vertiUpdate.call(this, controller , value);
  4831. var cont_scroll = -value;
  4832. var slide_pos , slide , distance;
  4833. for(var i = 0; i < this.slidesCount; ++i){
  4834. slide = this.slideList[i];
  4835. //slide_pos = parseInt(slide.$element.css('left'));
  4836. distance = -cont_scroll - slide.position;
  4837. this.__updateSlidesVertic(slide , distance);
  4838. }
  4839. };
  4840. p.__updateSlidesHoriz = function(slide , distance){
  4841. var value = Math.abs(distance * 100 / this.__width);
  4842. //var value2 = Math.min(value , 100);
  4843. // var sp = Math.min(100 , )
  4844. //slide.$bg_img.css('opacity' , (100 - Math.abs(distance * 120 / this.__width / 3)) / 100);
  4845. slide.$element.css(window._csspfx + 'transform' , 'translateZ('+ -value * 3 +'px) rotateY(0.01deg)'/* translateX('+(distance < 0 ? 1 : -1) * -value * 5+'px)'*/);
  4846. };
  4847. p.__updateSlidesVertic = function(slide , distance){
  4848. this.__updateSlidesHoriz(slide , distance);
  4849. };
  4850. /*
  4851. p.swipeMove = function(status){
  4852. if(status.phase == 'start'){
  4853. this.__setSlideTransDuration(0);
  4854. }else if(status.phase == 'end'){
  4855. this.__setSlideTransDuration(this.__slideDuration);
  4856. }
  4857. _super.swipeMove.call(this , status);
  4858. };
  4859. p.create = function(index){
  4860. _super.create.call(this , index);
  4861. for(var i = 0; i<this.slidesCount ; ++i){
  4862. this.slides[i].$element.css(window._csspfx + 'transition-property' , window._csspfx + 'transform');
  4863. this.slides[i].$element.css(window._csspfx + 'transition-duration' , this.slideDuration + 'ms');
  4864. }
  4865. };
  4866. */
  4867. MSSlideController.registerView('wave' , MSWaveView);
  4868. })(jQuery);
  4869. /* ================== bin-debug/js/pro/views/FadeBasicView.js =================== */
  4870. /**
  4871. * Master Slider Fade Basic view
  4872. * @author averta
  4873. * @version 1.1
  4874. * @package MS
  4875. */
  4876. ;(function(){
  4877. window.MSFadeBasicView = function(options){
  4878. MSWaveView.call(this , options);
  4879. this.$element.removeClass('ms-wave-view').addClass('ms-fade-basic-view');
  4880. };
  4881. MSFadeBasicView.extend(MSWaveView);
  4882. var p = MSFadeBasicView.prototype;
  4883. var _super = MSFadeBasicView.prototype;
  4884. /*-------------- METHODS --------------*/
  4885. p.__updateSlidesHoriz = function(slide , distance){
  4886. var value = Math.abs(distance * 0.6 / this.__width);
  4887. value = 1 - Math.min(value , 0.6);
  4888. slide.$element.css('opacity' , value);
  4889. };
  4890. p.__updateSlidesVertic = function(slide , distance){
  4891. this.__updateSlidesHoriz(slide , distance);
  4892. };
  4893. MSSlideController.registerView('fadeBasic' , MSFadeBasicView);
  4894. MSWaveView._fallback = MSFadeBasicView;
  4895. })();
  4896. /* ================== bin-debug/js/pro/views/FadeWaveView.js =================== */
  4897. /**
  4898. * Master Slider Fade Wave View
  4899. * @author averta
  4900. * @version 1.0
  4901. * @extends {MSWaveView}
  4902. */
  4903. ;(function(){
  4904. window.MSFadeWaveView = function(options){
  4905. MSWaveView.call(this , options);
  4906. this.$element.removeClass('ms-wave-view').addClass('ms-fade-wave-view');
  4907. };
  4908. MSFadeWaveView.extend(MSWaveView);
  4909. MSFadeWaveView._3dreq = true;
  4910. MSFadeWaveView._fallback = MSFadeBasicView;
  4911. var p = MSFadeWaveView.prototype;
  4912. var _super = MSWaveView.prototype;
  4913. /*-------------- METHODS --------------*/
  4914. p.__updateSlidesHoriz = function(slide , distance){
  4915. var value = Math.abs(distance * 100 / this.__width);
  4916. value = Math.min(value , 100);
  4917. slide.$element.css('opacity' , 1-value/300);
  4918. slide.$element[0].style[window._jcsspfx + 'Transform'] = 'scale('+ (1 - value/800) +') rotateY(0.01deg) ';
  4919. };
  4920. p.__updateSlidesVertic = function(slide , distance){
  4921. this.__updateSlidesHoriz(slide , distance);
  4922. };
  4923. MSSlideController.registerView('fadeWave' , MSFadeWaveView);
  4924. })();
  4925. /* ================== bin-debug/js/pro/views/FlowView.js =================== */
  4926. ;(function($){
  4927. "use strict";
  4928. window.MSFlowView = function(options){
  4929. MSWaveView.call(this , options);
  4930. this.$element.removeClass('ms-wave-view').addClass('ms-flow-view');
  4931. //this.$slideCont.css(window._csspfx + 'transform-style' , 'preserve-3d');
  4932. };
  4933. MSFlowView.extend(MSWaveView);
  4934. MSFlowView._3dreq = true;
  4935. MSFlowView._fallback = MSFadeBasicView;
  4936. var p = MSFlowView.prototype;
  4937. var _super = MSWaveView.prototype;
  4938. /*-------------- METHODS --------------*/
  4939. p.__updateSlidesHoriz = function(slide , distance){
  4940. var value = Math.abs(distance * 100 / this.__width);
  4941. var rvalue = Math.min(value * 0.3 , 30) * (distance < 0 ? -1 : 1);
  4942. var zvalue = value * 1.2;
  4943. slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ('+ -zvalue*5 +'px) rotateY(' + rvalue + 'deg) ';
  4944. };
  4945. p.__updateSlidesVertic = function(slide , distance){
  4946. var value = Math.abs(distance * 100 / this.__width);
  4947. var rvalue = Math.min(value * 0.3 , 30) * (distance < 0 ? -1 : 1);
  4948. var zvalue = value * 1.2;
  4949. slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ('+ -zvalue*5 +'px) rotateX(' + -rvalue + 'deg) ';
  4950. };
  4951. MSSlideController.registerView('flow' , MSFlowView);
  4952. })(jQuery);
  4953. /* ================== bin-debug/js/pro/views/FadeFlowView.js =================== */
  4954. /**
  4955. * Master Slider Fade Flow View
  4956. * @author averta
  4957. * @extends {MSWaveView}
  4958. * @version 1.0
  4959. */
  4960. ;(function(){
  4961. window.MSFadeFlowView = function(options){
  4962. MSWaveView.call(this , options);
  4963. this.$element.removeClass('ms-wave-view').addClass('ms-fade-flow-view');
  4964. };
  4965. MSFadeFlowView.extend(MSWaveView);
  4966. MSFadeFlowView._3dreq = true;
  4967. var p = MSFadeFlowView.prototype;
  4968. var _super = MSWaveView.prototype;
  4969. /*-------------- METHODS --------------*/
  4970. p.__calculate = function(distance){
  4971. var value = Math.min(Math.abs(distance * 100 / this.__width) , 100);
  4972. var rvalue = Math.min(value * 0.5 , 50) * (distance < 0 ? -1 : 1);
  4973. return {value: value, rvalue: rvalue};
  4974. };
  4975. p.__updateSlidesHoriz = function(slide , distance){
  4976. var clc = this.__calculate(distance);
  4977. slide.$element.css('opacity' , 1-clc.value/300);
  4978. console.log(window._jcsspfx + 'transform','translateZ('+ -clc.value +'px) rotateY(' + clc.rvalue + 'deg) ')
  4979. slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ('+ -clc.value +'px) rotateY(' + clc.rvalue + 'deg) ';
  4980. };
  4981. p.__updateSlidesVertic = function(slide , distance){
  4982. var clc = this.__calculate(distance);
  4983. slide.$element.css('opacity' , 1-clc.value/300);
  4984. slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ('+ -clc.value +'px) rotateX(' + -clc.rvalue + 'deg) ';
  4985. };
  4986. MSSlideController.registerView('fadeFlow' , MSFadeFlowView);
  4987. })();
  4988. /* ================== bin-debug/js/pro/views/MaskView.js =================== */
  4989. ;(function($){
  4990. "use strict";
  4991. window.MSMaskView = function(options){
  4992. MSBasicView.call(this , options);
  4993. this.$element.removeClass('ms-basic-view').addClass('ms-mask-view');
  4994. };
  4995. MSMaskView.extend(MSBasicView);
  4996. var p = MSMaskView.prototype;
  4997. var _super = MSBasicView.prototype;
  4998. /*-------------- METHODS --------------*/
  4999. p.addSlide = function(slide){ // OK
  5000. slide.view = this;
  5001. slide.$frame = $('<div></div>').addClass('ms-mask-frame').append(slide.$element);
  5002. slide.$element[0].style.position = 'relative';
  5003. //this.$slideCont.append(slide.$frame);
  5004. slide.autoAppend = false;
  5005. this.slides.push(slide);
  5006. this.slideList.push(slide);
  5007. this.slidesCount++;
  5008. };
  5009. p.setSize = function(width , height){
  5010. var slider = this.slides[0].slider;
  5011. for(var i = 0; i < this.slidesCount ; ++i){
  5012. this.slides[i].$frame[0].style.width = width + 'px';
  5013. if(!slider.options.autoHeight)
  5014. this.slides[i].$frame[0].style.height = height + 'px';
  5015. }
  5016. _super.setSize.call(this , width , height);
  5017. };
  5018. // p.__snapUpdate = function(controller , snap , change){
  5019. // if(this.loop){
  5020. // var target_index = this.index + change;
  5021. // this.updateLoop(target_index);
  5022. // if(target_index >= this.slidesCount) target_index = target_index - this.slidesCount;
  5023. // if(target_index < 0) target_index = this.slidesCount + target_index;
  5024. // this.index = target_index;
  5025. // }else{
  5026. // if(snap < 0 || snap >= this.slidesCount) return
  5027. // this.index = snap;
  5028. // }
  5029. // this._checkCritMargins();
  5030. // if($.browser.mozilla){
  5031. // this.slideList[this.index].$frame[0].style.marginTop = '0.1px';
  5032. // this.slideList[this.index].$element[0].style.marginTop = '0.1px';
  5033. // if(this.currentSlide){
  5034. // this.currentSlide.$frame[0].style.marginTop = '';
  5035. // this.currentSlide.$element[0].style.marginTop = '';
  5036. // }
  5037. // }
  5038. // var new_slide = this.slideList[this.index];
  5039. // if(new_slide === this.currentSlide)return;
  5040. // this.currentSlide = new_slide;
  5041. // this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START));
  5042. // };
  5043. p._horizUpdate = function(controller , value){
  5044. _super._horizUpdate.call(this , controller , value);
  5045. var i = 0;
  5046. if(this.css3) {
  5047. for(i = 0 ; i < this.slidesCount ; ++i){
  5048. this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateX('+(value - this.slideList[i].position)+'px)'+ this.__translate_end;
  5049. }
  5050. return;
  5051. }
  5052. for(i = 0 ; i < this.slidesCount ; ++i){
  5053. this.slideList[i].$element[0].style.left = (value - this.slideList[i].position) + 'px';
  5054. }
  5055. };
  5056. p._vertiUpdate = function(controller , value){
  5057. _super._vertiUpdate.call(this , controller , value);
  5058. var i = 0;
  5059. if(this.css3) {
  5060. for(i = 0 ; i < this.slidesCount ; ++i){
  5061. this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateY('+(value - this.slideList[i].position)+'px)'+ this.__translate_end;
  5062. }
  5063. return;
  5064. }
  5065. for(i = 0 ; i < this.slidesCount ; ++i){
  5066. this.slideList[i].$element[0].style.top = (value - this.slideList[i].position) + 'px';
  5067. }
  5068. };
  5069. p.__pushEnd = function(){ // OK
  5070. var first_slide = this.slides.shift();
  5071. var last_slide = this.slides[this.slidesCount - 2];
  5072. this.slides.push(first_slide);
  5073. if(!this.normalMode) return;
  5074. var pos = last_slide.$frame[0][this.__offset] + this.spacing + this[this.__dimension];
  5075. first_slide.$frame[0].style[this.__cssProb] = pos + 'px';
  5076. first_slide.position = pos;
  5077. };
  5078. p.__pushStart = function(){ // OK
  5079. var last_slide = this.slides.pop();
  5080. var first_slide = this.slides[0];
  5081. this.slides.unshift(last_slide);
  5082. if(!this.normalMode) return;
  5083. var pos = first_slide.$frame[0][this.__offset] - this.spacing - this[this.__dimension];
  5084. last_slide.$frame[0].style[this.__cssProb] = pos + 'px';
  5085. last_slide.position = pos;
  5086. };
  5087. p.__updateViewList = function(){
  5088. if(this.normalMode) {
  5089. this.viewSlidesList = this.slides;
  5090. return;
  5091. }
  5092. var temp = this.viewSlidesList.slice();
  5093. // update view list
  5094. this.viewSlidesList = [];
  5095. var i = 0 , hlf = Math.floor(this.options.viewNum / 2) , l;
  5096. if(this.loop){
  5097. for(; i !== this.options.viewNum ; i++)
  5098. this.viewSlidesList.push(this.slides[this.currentSlideLoc - hlf + i]);
  5099. }else{
  5100. // before
  5101. for(i = 0 ; i !== hlf && this.index - i !== -1 ; i++)
  5102. this.viewSlidesList.unshift(this.slideList[this.index - i]);
  5103. // after
  5104. for(i = 1; i !== hlf && this.index + i !== this.slidesCount; i++)
  5105. this.viewSlidesList.push(this.slideList[this.index + i]);
  5106. }
  5107. for (i = 0 , l = temp.length ; i !== l ; i++){
  5108. if( this.viewSlidesList.indexOf(temp[i]) === -1){
  5109. temp[i].sleep();
  5110. temp[i].$frame.detach();
  5111. }
  5112. }
  5113. temp = null;
  5114. };
  5115. p.__locateSlides = function(move , start){ // OK
  5116. this.__updateViewList();
  5117. start = !this.loop ? this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing ) : start || 0;
  5118. // Old method
  5119. // for(var i = 0; i < this.slidesCount ; ++i){
  5120. // var pos = i * (this[this.__dimension] + this.spacing);
  5121. // this.slides[i].position = pos;
  5122. // this.slides[i].$frame[0].style[this.__cssProb] = pos + 'px';
  5123. // }
  5124. var l = this.viewSlidesList.length , slide;
  5125. for(var i = 0; i !== l ; i++){
  5126. var pos = start + i * (this[this.__dimension] + this.spacing );
  5127. slide = this.viewSlidesList[i];
  5128. this.$slideCont.append(slide.$frame);
  5129. slide.wakeup(false);
  5130. slide.position = pos;
  5131. if ( slide.selected && slide.bgvideo ) {
  5132. try{
  5133. slide.bgvideo.play();
  5134. } catch (e) {}
  5135. }
  5136. slide.$frame[0].style[this.__cssProb] = pos + 'px';
  5137. }
  5138. if(move !== false)this.controller.changeTo( this.slideList[this.index].position , false , null , null , false);
  5139. };
  5140. MSSlideController.registerView('mask' , MSMaskView);
  5141. })(jQuery);
  5142. /* ================== bin-debug/js/pro/views/ParallaxMaskView.js =================== */
  5143. ;(function($){
  5144. "use strict";
  5145. window.MSParallaxMaskView = function(options){
  5146. MSMaskView.call(this , options);
  5147. this.$element.removeClass('ms-basic-view').addClass('ms-parallax-mask-view');
  5148. };
  5149. MSParallaxMaskView.extend(MSMaskView);
  5150. MSParallaxMaskView.parallaxAmount = 0.5;
  5151. var p = MSParallaxMaskView.prototype;
  5152. var _super = MSBasicView.prototype;
  5153. /*-------------- METHODS --------------*/
  5154. p._horizUpdate = function(controller , value){
  5155. _super._horizUpdate.call(this , controller , value);
  5156. var i = 0;
  5157. if(this.css3) {
  5158. for(i = 0 ; i < this.slidesCount ; ++i){
  5159. this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateX('+(value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount +'px)'+ this.__translate_end;
  5160. }
  5161. return;
  5162. }
  5163. for(i = 0 ; i < this.slidesCount ; ++i){
  5164. this.slideList[i].$element[0].style.left = (value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount + 'px';
  5165. }
  5166. };
  5167. p._vertiUpdate = function(controller , value){
  5168. _super._vertiUpdate.call(this , controller , value);
  5169. var i = 0;
  5170. if(this.css3) {
  5171. for(i = 0 ; i < this.slidesCount ; ++i){
  5172. this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateY('+(value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount +'px)'+ this.__translate_end;
  5173. }
  5174. return;
  5175. }
  5176. for(i = 0 ; i < this.slidesCount ; ++i){
  5177. this.slideList[i].$element[0].style.top = (value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount + 'px';
  5178. }
  5179. };
  5180. MSSlideController.registerView('parallaxMask' , MSParallaxMaskView);
  5181. })(jQuery);
  5182. /* ================== bin-debug/js/pro/views/FadeView.js =================== */
  5183. ;(function($){
  5184. "use strict";
  5185. window.MSFadeView = function(options){
  5186. MSBasicView.call(this , options);
  5187. this.$element.removeClass('ms-basic-view').addClass('ms-fade-view');
  5188. this.controller.renderCallback(this.__update , this);
  5189. };
  5190. MSFadeView.extend(MSBasicView);
  5191. var p = MSFadeView.prototype;
  5192. var _super = MSBasicView.prototype;
  5193. /*-------------- METHODS --------------*/
  5194. p.__update = function(controller , value){
  5195. var cont_scroll = -value;
  5196. var slide_pos , slide , distance;
  5197. for(var i = 0; i < this.slidesCount; ++i){
  5198. slide = this.slideList[i];
  5199. distance = -cont_scroll - slide.position;
  5200. this.__updateSlides(slide , distance);
  5201. }
  5202. };
  5203. p.__updateSlides = function(slide , distance){
  5204. var value = Math.abs(distance / this[this.__dimension]);
  5205. if(1 - value <= 0){
  5206. slide.$element.fadeTo(0 , 0).css('visibility' , 'hidden');
  5207. }else{
  5208. slide.$element.fadeTo(0 , 1 - value).css('visibility' , '');
  5209. }
  5210. };
  5211. p.__locateSlides = function(move , start){
  5212. this.__updateViewList();
  5213. // Old method
  5214. // for(var i = 0; i < this.slidesCount ; ++i){
  5215. // this.slides[i].position = i * this[this.__dimension];
  5216. // }
  5217. start = !this.loop ? this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing ) : start || 0;
  5218. var l = this.viewSlidesList.length , slide;
  5219. for(var i = 0; i !== l ; i++){
  5220. var pos = start + i * this[this.__dimension];
  5221. slide = this.viewSlidesList[i];
  5222. slide.wakeup();
  5223. slide.position = pos;
  5224. }
  5225. if(move !== false)this.controller.changeTo( this.slideList[this.index].position , false , null , null , false);
  5226. };
  5227. p.__pushEnd = function(){
  5228. var first_slide = this.slides.shift();
  5229. var last_slide = this.slides[this.slidesCount - 2];
  5230. this.slides.push(first_slide);
  5231. first_slide.position = last_slide.position + this[this.__dimension];
  5232. };
  5233. p.__pushStart = function(){
  5234. var last_slide = this.slides.pop();
  5235. var first_slide = this.slides[0];
  5236. this.slides.unshift(last_slide);
  5237. last_slide.position = first_slide.position - this[this.__dimension];
  5238. };
  5239. p.create = function(index){
  5240. _super.create.call(this , index);
  5241. this.spacing = 0;
  5242. this.controller.options.minValidDist = 10;
  5243. };
  5244. MSSlideController.registerView('fade' , MSFadeView);
  5245. })(jQuery);
  5246. /* ================== bin-debug/js/pro/views/ScaleView.js =================== */
  5247. ;(function($){
  5248. "use strict";
  5249. window.MSScaleView = function(options){
  5250. MSBasicView.call(this , options);
  5251. this.$element.removeClass('ms-basic-view').addClass('ms-scale-view');
  5252. this.controller.renderCallback(this.__update , this);
  5253. };
  5254. MSScaleView.extend(MSFadeView);
  5255. var p = MSScaleView.prototype;
  5256. var _super = MSFadeView.prototype;
  5257. /*-------------- METHODS --------------*/
  5258. p.__updateSlides = function(slide , distance){
  5259. var value = Math.abs(distance / this[this.__dimension]),
  5260. element = slide.$element[0];
  5261. if(1 - value <= 0){
  5262. element.style.opacity = 0;
  5263. element.style.visibility = 'hidden';
  5264. element.style[window._jcsspfx + 'Transform'] = '';
  5265. }else{
  5266. element.style.opacity = 1 - value;
  5267. element.style.visibility = '';
  5268. element.style[window._jcsspfx + 'Transform'] = 'perspective(2000px) translateZ('+(value* (distance < 0 ? -0.5 : 0.5)) * 300+'px)';
  5269. }
  5270. };
  5271. p.create = function(index){
  5272. _super.create.call(this , index);
  5273. this.controller.options.minValidDist = 0.03;
  5274. };
  5275. MSSlideController.registerView('scale' , MSScaleView);
  5276. })(jQuery);
  5277. /* ================== bin-debug/js/pro/views/StackView.js =================== */
  5278. /**
  5279. * Master Slider Stack View
  5280. * @package Master Slider jQuery
  5281. * @author Averta
  5282. */
  5283. ;(function($){
  5284. "use strict";
  5285. window.MSStackView = function(options){
  5286. MSBasicView.call(this , options);
  5287. this.$element.removeClass('ms-basic-view').addClass('ms-stack-view');
  5288. this.controller.renderCallback(this.__update , this);
  5289. this.autoUpdateZIndex = true;
  5290. };
  5291. MSStackView.extend(MSFadeView);
  5292. MSStackView._3dreq = true;
  5293. MSStackView._fallback = MSFadeView;
  5294. var p = MSStackView.prototype;
  5295. var _super = MSFadeView.prototype;
  5296. /*-------------- METHODS --------------*/
  5297. /**
  5298. * Updates slides z index
  5299. */
  5300. p.__updateSlidesZindex = function () {
  5301. var slide,
  5302. l = this.viewSlidesList.length;
  5303. for ( var i = 0; i!==l; i++ ){
  5304. slide = this.viewSlidesList[i];
  5305. this.viewSlidesList[i].$element.css('z-index', l-i);
  5306. }
  5307. };
  5308. p.__updateSlides = function(slide , distance){
  5309. var value = Math.abs(distance / this[this.__dimension]),
  5310. element = slide.$element[0];
  5311. if(1 - value <= 0){
  5312. element.style.opacity = 1;
  5313. element.style.visibility = 'hidden';
  5314. element.style[window._jcsspfx + 'Transform'] = '';
  5315. }else{
  5316. element.style.visibility = '';
  5317. if ( distance < 0 ) {
  5318. element.style[window._jcsspfx + 'Transform'] = 'perspective(2000px) translateZ('+ (value * -300) +'px)';
  5319. } else {
  5320. element.style[window._jcsspfx + 'Transform'] = this.__translate + '(' + ( -value * this[this.__dimension] ) +'px)';
  5321. }
  5322. }
  5323. };
  5324. p.create = function(index){
  5325. _super.create.call(this , index);
  5326. this.controller.options.minValidDist = 0.03;
  5327. this.__translate = this.dir === 'h' ? 'translateX' : 'translateY';
  5328. };
  5329. MSSlideController.registerView('stack' , MSStackView);
  5330. })(jQuery);
  5331. /* ================== bin-debug/js/pro/views/FocusView.js =================== */
  5332. /**
  5333. * Master Slider Focus View
  5334. * @version 1.1
  5335. * @author averta
  5336. * @package MS
  5337. * @extends {MSFadeBasicView}
  5338. */
  5339. ;(function(){
  5340. 'use strict';
  5341. var perspective = 2000;
  5342. window.MSFocusView = function(options){
  5343. MSWaveView.call(this , options);
  5344. this.$element.removeClass('ms-wave-view').addClass('ms-focus-view');
  5345. this.options.centerSpace = this.options.centerSpace || 1;
  5346. };
  5347. MSFocusView.extend(MSWaveView);
  5348. MSFocusView._3dreq = true;
  5349. MSFocusView._fallback = MSFadeBasicView;
  5350. var p = MSFocusView.prototype;
  5351. var _super = MSWaveView.prototype;
  5352. /*-------------- METHODS --------------*/
  5353. p.__calcview = function(z , w){
  5354. var a = w / 2 * z / (z + perspective);
  5355. return a * (z + perspective) / perspective;
  5356. };
  5357. p.__updateSlidesHoriz = function(slide , distance){
  5358. var value = Math.abs(distance * 100 / this.__width);
  5359. value = -Math.min(value , 100)* 15;
  5360. 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)');
  5361. };
  5362. p.__updateSlidesVertic = function(slide , distance){
  5363. var value = Math.abs(distance * 100 / this.__width);
  5364. value = -Math.min(value , 100)* 15;
  5365. 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)');
  5366. };
  5367. MSSlideController.registerView('focus' , MSFocusView);
  5368. })();
  5369. /* ================== bin-debug/js/pro/views/PartialWaveView.js =================== */
  5370. /**
  5371. * Master Slider Partial Wave View
  5372. * @version 1.0
  5373. * @author averta
  5374. * @extends {MSWaveView}
  5375. */
  5376. ;(function(){
  5377. window.MSPartialWaveView = function(options){
  5378. MSWaveView.call(this , options);
  5379. this.$element.removeClass('ms-wave-view').addClass('ms-partial-wave-view');
  5380. };
  5381. MSPartialWaveView.extend(MSWaveView);
  5382. MSPartialWaveView._3dreq = true;
  5383. MSPartialWaveView._fallback = MSFadeBasicView;
  5384. var p = MSPartialWaveView.prototype;
  5385. var _super = MSWaveView.prototype;
  5386. /*-------------- METHODS --------------*/
  5387. p.__updateSlidesHoriz = function(slide , distance){
  5388. var value = Math.abs(distance * 100 / this.__width);
  5389. if( slide.hasBG ){
  5390. slide.$bg_img.css('opacity' , (100 - Math.abs(distance * 120 / this.__width / 3)) / 100);
  5391. }
  5392. slide.$element.css(window._csspfx + 'transform' , 'translateZ('+ -value * 3 +'px) rotateY(0.01deg) translateX('+distance*0.75+'px)');
  5393. };
  5394. p.__updateSlidesVertic = function(slide , distance){
  5395. var value = Math.abs(distance * 100 / this.__width);
  5396. if( slide.hasBG ){
  5397. slide.$bg_img.css('opacity' , (100 - Math.abs(distance * 120 / this.__width / 3)) / 100);
  5398. }
  5399. slide.$element.css(window._csspfx + 'transform' , 'translateZ('+ -value * 3 +'px) rotateY(0.01deg) translateY('+distance*0.75+'px)');
  5400. };
  5401. MSSlideController.registerView('partialWave' , MSPartialWaveView);
  5402. })();
  5403. /* ================== bin-debug/js/pro/uicontrols/BaseControl.js =================== */
  5404. ;(function($){
  5405. "use strict";
  5406. var BaseControl = function(){
  5407. this.options = {
  5408. prefix:'ms-',
  5409. autohide:true,
  5410. overVideo:true,
  5411. customClass: null
  5412. };
  5413. };
  5414. var p = BaseControl.prototype;
  5415. /* -------------------------------- */
  5416. p.slideAction = function(slide){
  5417. };
  5418. p.setup = function(){
  5419. this.cont = this.options.insertTo ? $(this.options.insertTo) : this.slider.$controlsCont;
  5420. if(!this.options.overVideo) this._hideOnvideoStarts();
  5421. };
  5422. p.checkHideUnder = function(){
  5423. if(this.options.hideUnder){
  5424. //this.slider.api.addEventListener(MSSliderEvent.RESIZE, this.onSliderResize, this);
  5425. this.needsRealign = !this.options.insetTo && (this.options.align === 'left' || this.options.align === 'right') && this.options.inset === false;
  5426. $(window).bind('resize', {that:this}, this.onResize);
  5427. this.onResize();
  5428. }
  5429. };
  5430. /**
  5431. * hide control if width of slider changes to lower that specified value [hideUnder]
  5432. * @since 1.5.7
  5433. * @protected
  5434. */
  5435. p.onResize = function(event){
  5436. var that = (event && event.data.that) || this;
  5437. var w = window.innerWidth;
  5438. if( w <= that.options.hideUnder && !that.detached ){
  5439. that.hide(true);
  5440. that.detached = true;
  5441. that.onDetach();
  5442. }else if( w >= that.options.hideUnder && that.detached ){
  5443. that.detached = false;
  5444. that.visible();
  5445. that.onAppend();
  5446. }
  5447. };
  5448. p.create = function(){
  5449. var that = this;
  5450. if(this.options.autohide ){
  5451. this.hide(true);
  5452. this.slider.$controlsCont.mouseenter($.proxy(this._onMouseEnter, this))
  5453. .mouseleave($.proxy(this._onMouseLeave, this))
  5454. .mousedown($.proxy(this._onMouseDown, this));
  5455. if ( this.$element ) {
  5456. this.$element.mouseenter($.proxy(this._onMouseEnter, this))
  5457. .mouseleave($.proxy(this._onMouseLeave, this))
  5458. .mousedown($.proxy(this._onMouseDown, this));
  5459. }
  5460. $(document).mouseup($.proxy(this._onMouseUp, this));
  5461. }
  5462. if ( this.options.align ) {
  5463. this.$element.addClass('ms-align-' + this.options.align);
  5464. }
  5465. // add custom class to control
  5466. if ( this.options.customClass && this.$element ) {
  5467. this.$element.addClass(this.options.customClass);
  5468. }
  5469. };
  5470. /**
  5471. * Mouse Enter Listener
  5472. * @since 2.2
  5473. */
  5474. p._onMouseEnter = function(){
  5475. if ( !this._disableAH && !this.mdown ){
  5476. this.visible();
  5477. }
  5478. this.mleave = false;
  5479. };
  5480. /**
  5481. * Mouse Leave Listener
  5482. * @since 2.2
  5483. */
  5484. p._onMouseLeave = function(){
  5485. if ( !this.mdown ){
  5486. this.hide();
  5487. }
  5488. this.mleave = true;
  5489. };
  5490. /**
  5491. * Mouse Down Listener
  5492. * @since 2.2
  5493. */
  5494. p._onMouseDown = function(){
  5495. this.mdown = true;
  5496. };
  5497. /**
  5498. * Mouse Up Listener
  5499. * @since 2.2
  5500. */
  5501. p._onMouseUp = function(){
  5502. if ( this.mdown && this.mleave ) {
  5503. this.hide();
  5504. }
  5505. this.mdown = false;
  5506. };
  5507. /**
  5508. * calls by the parent class [MSBaseControl] when the control element visibles [hideUnder option]
  5509. * @since 1.5.7
  5510. */
  5511. p.onAppend = function(){
  5512. if( this.needsRealign ){
  5513. this.slider._realignControls();
  5514. }
  5515. };
  5516. /**
  5517. * calls by the parent class [MSBaseControl] when the control element visibles [hideUnder option]
  5518. * @since 1.5.7
  5519. */
  5520. p.onDetach = function(){
  5521. if( this.needsRealign ){
  5522. this.slider._realignControls();
  5523. }
  5524. };
  5525. p._hideOnvideoStarts = function(){
  5526. var that = this;
  5527. this.slider.api.addEventListener(MSSliderEvent.VIDEO_PLAY , function(){
  5528. that._disableAH = true;
  5529. that.hide();
  5530. });
  5531. this.slider.api.addEventListener(MSSliderEvent.VIDEO_CLOSE , function(){
  5532. that._disableAH = false;
  5533. that.visible();
  5534. });
  5535. };
  5536. p.hide = function(fast){
  5537. if(fast){
  5538. this.$element.css('opacity' , 0);
  5539. this.$element.css('display' , 'none');
  5540. } else {
  5541. clearTimeout(this.hideTo);
  5542. var $element = this.$element;
  5543. this.hideTo = setTimeout(function(){
  5544. CTween.fadeOut($element , 400 , false);
  5545. }, 20);
  5546. }
  5547. this.$element.addClass('ms-ctrl-hide');
  5548. };
  5549. p.visible = function(){
  5550. if(this.detached) return;
  5551. clearTimeout(this.hideTo);
  5552. this.$element.css('display' , '');
  5553. CTween.fadeIn(this.$element , 400 , false);
  5554. this.$element.removeClass('ms-ctrl-hide');
  5555. };
  5556. p.destroy = function(){
  5557. if(this.options && this.options.hideUnder){
  5558. //this.slider.api.removeEventListener(MSSliderEvent.RESIZE, this.onResize, this);
  5559. $(window).unbind('resize', this.onResize);
  5560. }
  5561. };
  5562. window.BaseControl = BaseControl;
  5563. })(jQuery);
  5564. /* ================== bin-debug/js/pro/uicontrols/Arrows.js =================== */
  5565. ;(function($){
  5566. "use strict";
  5567. var MSArrows = function(options){
  5568. BaseControl.call(this);
  5569. $.extend(this.options , options);
  5570. };
  5571. MSArrows.extend(BaseControl);
  5572. var p = MSArrows.prototype;
  5573. var _super = BaseControl.prototype;
  5574. /* -------------------------------- */
  5575. p.setup = function(){
  5576. var that = this;
  5577. this.$next = $('<div></div>')
  5578. .addClass(this.options.prefix + 'nav-next')
  5579. //.appendTo(this.cont)
  5580. .bind('click' , function(){
  5581. that.slider.api.next(true);
  5582. });
  5583. this.$prev = $('<div></div>')
  5584. .addClass(this.options.prefix + 'nav-prev')
  5585. //.appendTo(this.cont)
  5586. .bind('click' , function(){
  5587. that.slider.api.previous(true);
  5588. });
  5589. _super.setup.call(this);
  5590. this.cont.append(this.$next);
  5591. this.cont.append(this.$prev);
  5592. this.checkHideUnder(); // super method
  5593. };
  5594. p.hide = function(fast){
  5595. if(fast){
  5596. this.$prev.css('opacity' , 0).css('display', 'none');
  5597. this.$next.css('opacity' , 0).css('display', 'none');
  5598. return;
  5599. }
  5600. CTween.fadeOut(this.$prev , 400 , false);
  5601. CTween.fadeOut(this.$next , 400 , false);
  5602. this.$prev.addClass('ms-ctrl-hide');
  5603. this.$next.addClass('ms-ctrl-hide');
  5604. };
  5605. p.visible = function(){
  5606. if(this.detached) return;
  5607. CTween.fadeIn(this.$prev , 400 );
  5608. CTween.fadeIn(this.$next , 400 );
  5609. this.$prev.removeClass('ms-ctrl-hide').css('display', '');
  5610. this.$next.removeClass('ms-ctrl-hide').css('display', '');
  5611. };
  5612. p.destroy = function(){
  5613. _super.destroy();
  5614. this.$next.remove();
  5615. this.$prev.remove();
  5616. };
  5617. window.MSArrows = MSArrows;
  5618. MSSlideController.registerControl('arrows' , MSArrows);
  5619. })(jQuery);
  5620. /* ================== bin-debug/js/pro/uicontrols/Thumblist.js =================== */
  5621. ;(function($){
  5622. "use strict";
  5623. var MSThumblist = function(options){
  5624. BaseControl.call(this);
  5625. // default options
  5626. this.options.dir = 'h';
  5627. this.options.wheel = options.dir === 'v';
  5628. this.options.arrows = false;
  5629. this.options.speed = 17;
  5630. this.options.align = null;
  5631. this.options.inset = false;
  5632. this.options.margin = 10;
  5633. this.options.space = 10;
  5634. this.options.width = 100;
  5635. this.options.height = 100;
  5636. this.options.type = 'thumbs'; // tabs
  5637. this.options.hover = false;
  5638. $.extend(this.options , options);
  5639. this.thumbs = [];
  5640. this.index_count = 0;
  5641. this.__dimen = this.options.dir === 'h' ? 'width' : 'height';
  5642. this.__alignsize = this.options.dir === 'h' ? 'height' : 'width';
  5643. this.__jdimen = this.options.dir === 'h' ? 'outerWidth' : 'outerHeight';
  5644. this.__pos = this.options.dir === 'h' ? 'left' : 'top';
  5645. this.click_enable = true;
  5646. };
  5647. MSThumblist.extend(BaseControl);
  5648. var p = MSThumblist.prototype;
  5649. var _super = BaseControl.prototype;
  5650. /* -------------------------------- */
  5651. p.setup = function(){
  5652. this.$element = $('<div></div>')
  5653. .addClass(this.options.prefix + 'thumb-list');
  5654. if(this.options.type === 'tabs'){
  5655. this.$element.addClass(this.options.prefix + 'tabs');
  5656. }
  5657. this.$element.addClass('ms-dir-' + this.options.dir);
  5658. _super.setup.call(this);
  5659. if( this.slider.$controlsCont === this.cont ){
  5660. this.$element.appendTo(this.slider.$element);
  5661. }else{
  5662. this.$element.appendTo(this.cont);
  5663. }
  5664. this.$thumbscont = $('<div></div>')
  5665. .addClass('ms-thumbs-cont')
  5666. .appendTo(this.$element);
  5667. if(this.options.arrows){
  5668. var that = this;
  5669. this.$fwd = $('<div></div>').addClass('ms-thumblist-fwd').appendTo(this.$element).click(function(){that.controller.push(-15);});
  5670. this.$bwd = $('<div></div>').addClass('ms-thumblist-bwd').appendTo(this.$element).click(function(){that.controller.push(15);});
  5671. }
  5672. // align control
  5673. if( !this.options.insetTo && this.options.align ){
  5674. var align = this.options.align;
  5675. if( this.options.inset ){
  5676. this.$element.css(align, this.options.margin );
  5677. }else if( align === 'top' ){
  5678. this.$element.detach().prependTo(this.slider.$element).css({
  5679. 'margin-bottom': this.options.margin,
  5680. 'position': 'relative'
  5681. });
  5682. }else if( align === 'bottom' ){
  5683. this.$element.css({
  5684. 'margin-top': this.options.margin,
  5685. 'position': 'relative'
  5686. });
  5687. }else{
  5688. this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
  5689. this.align();
  5690. }
  5691. if( this.options.dir === 'v' ){
  5692. this.$element.width(this.options.width);
  5693. }else{
  5694. this.$element.height(this.options.height);
  5695. }
  5696. }
  5697. this.checkHideUnder(); // super method
  5698. };
  5699. /**
  5700. * calls by "RESERVED_SPACE_CHANGE" realigns the control in slider
  5701. * @since 1.5.7
  5702. */
  5703. p.align = function(event){
  5704. if( this.detached ){
  5705. return;
  5706. }
  5707. var align = this.options.align;
  5708. var pos = this.slider.reserveSpace(align, this.options[this.__alignsize] + this.options.margin * 2);
  5709. this.$element.css(align, -pos - this.options[this.__alignsize] - this.options.margin);
  5710. };
  5711. p.slideAction = function(slide){
  5712. var thumb_ele = slide.$element.find('.ms-thumb');
  5713. var that = this;
  5714. var thumb_frame = $('<div></div>')
  5715. .addClass('ms-thumb-frame')
  5716. .append(thumb_ele)
  5717. .append($('<div class="ms-thumb-ol"></div>'))
  5718. .bind(this.options.hover? 'hover' : 'click' , function(){that.changeSlide(thumb_frame);});
  5719. if( this.options.align ){
  5720. thumb_frame.width(this.options.width - (this.options.dir === 'v' && this.options.type === 'tabs' ? 12 : 0)) // less arrow size 12px
  5721. .height(this.options.height)
  5722. .css('margin-'+(this.options.dir === 'v' ? 'bottom' : 'right'), this.options.space);
  5723. }
  5724. thumb_frame[0].index = this.index_count ++;
  5725. this.$thumbscont.append(thumb_frame);
  5726. // Added Fillmode support to thumblist
  5727. // @since 1.6.0
  5728. if( this.options.fillMode && thumb_ele.is('img') ){
  5729. var aligner = new window.MSAligner(this.options.fillMode, thumb_frame, thumb_ele);
  5730. thumb_ele[0].aligner = aligner;
  5731. thumb_ele.one('load', function(e){
  5732. var $this = $(this);
  5733. $this[0].aligner.init($this.width(), $this.height());
  5734. $this[0].aligner.align();
  5735. }).each($.jqLoadFix);
  5736. }
  5737. if($.browser.msie)
  5738. thumb_ele.on('dragstart', function(event) { event.preventDefault(); }); // disable native dragging
  5739. this.thumbs.push(thumb_frame);
  5740. };
  5741. p.create = function(){
  5742. _super.create.call(this);
  5743. this.__translate_end = window._css3d ? ' translateZ(0px)' : '';
  5744. this.controller = new Controller(0 , 0 , {
  5745. //snapping : true,
  5746. snappingMinSpeed : 2,
  5747. friction : (100 - this.options.speed * 0.5) / 100
  5748. });
  5749. this.controller.renderCallback(this.options.dir === 'h'? this._hMove : this._vMove , this);
  5750. //this.controller.snappingCallback(this.__snapUpdate , this);
  5751. //this.controller.snapCompleteCallback(this.__snapCompelet , this);
  5752. var that = this;
  5753. this.resize_listener = function(){that.__resize();};
  5754. $(window).bind('resize', this.resize_listener);
  5755. this.thumbSize = this.thumbs[0][this.__jdimen](true);
  5756. this.setupSwipe();
  5757. this.__resize();
  5758. var that = this;
  5759. if(this.options.wheel){
  5760. this.wheellistener = function(event){
  5761. var e = window.event || event.orginalEvent || event;
  5762. var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
  5763. that.controller.push(-delta*10);
  5764. return false;
  5765. };
  5766. if($.browser.mozilla) this.$element[0].addEventListener('DOMMouseScroll' , this.wheellistener);
  5767. else this.$element.bind('mousewheel', this.wheellistener);
  5768. }
  5769. this.slider.api.addEventListener(MSSliderEvent.CHANGE_START , this.update , this);
  5770. this.slider.api.addEventListener(MSSliderEvent.HARD_UPDATE, this.realignThumbs, this);
  5771. this.cindex = this.slider.api.index();
  5772. this.select(this.thumbs[this.cindex]);
  5773. };
  5774. p._hMove = function(controller , value){
  5775. this.__contPos = value;
  5776. if(window._cssanim) {
  5777. this.$thumbscont[0].style[window._jcsspfx + 'Transform'] = 'translateX('+-value+'px)'+ this.__translate_end;
  5778. return;
  5779. }
  5780. this.$thumbscont[0].style.left = -value + 'px';
  5781. };
  5782. p._vMove = function(controller , value){
  5783. this.__contPos = value;
  5784. if(window._cssanim) {
  5785. this.$thumbscont[0].style[window._jcsspfx + 'Transform'] = 'translateY('+-value+'px)'+ this.__translate_end;
  5786. return;
  5787. }
  5788. this.$thumbscont[0].style.top = -value + 'px';
  5789. };
  5790. p.setupSwipe = function(){
  5791. this.swipeControl = new averta.TouchSwipe(this.$element);
  5792. this.swipeControl.swipeType = this.options.dir === 'h'? 'horizontal' : 'vertical';
  5793. var that = this;
  5794. if(this.options.dir === 'h')
  5795. this.swipeControl.onSwipe = function(status){that.horizSwipeMove(status);};
  5796. else
  5797. this.swipeControl.onSwipe = function(status){that.vertSwipeMove(status);};
  5798. };
  5799. p.vertSwipeMove = function(status){
  5800. if(this.dTouch) return;
  5801. var phase = status.phase;
  5802. if(phase === 'start')
  5803. this.controller.stop();
  5804. else if(phase === 'move')
  5805. this.controller.drag(status.moveY);
  5806. else if(phase === 'end' || phase === 'cancel'){
  5807. var speed = Math.abs(status.distanceY / status.duration * 50/3);
  5808. if(speed > 0.1){
  5809. this.controller.push(-status.distanceY / status.duration * 50/3 );
  5810. }else{
  5811. this.click_enable = true;
  5812. this.controller.cancel();
  5813. }
  5814. }
  5815. };
  5816. p.horizSwipeMove = function(status){
  5817. if(this.dTouch) return;
  5818. var phase = status.phase;
  5819. if(phase === 'start'){
  5820. this.controller.stop();
  5821. this.click_enable = false;
  5822. }else if(phase === 'move')
  5823. this.controller.drag(status.moveX);
  5824. else if(phase === 'end' || phase === 'cancel'){
  5825. var speed = Math.abs(status.distanceX / status.duration * 50/3);
  5826. if(speed > 0.1){
  5827. this.controller.push(-status.distanceX / status.duration * 50/3 );
  5828. }else {
  5829. this.click_enable = true;
  5830. this.controller.cancel();
  5831. }
  5832. }
  5833. };
  5834. p.update = function(){
  5835. var nindex = this.slider.api.index();
  5836. if(this.cindex === nindex) return;
  5837. if(this.cindex != null)this.unselect(this.thumbs[this.cindex]);
  5838. this.cindex = nindex;
  5839. this.select(this.thumbs[this.cindex]);
  5840. if(!this.dTouch)this.updateThumbscroll();
  5841. };
  5842. p.realignThumbs = function () {
  5843. this.$element.find('.ms-thumb').each( function (index, thumb) {
  5844. if ( thumb.aligner ) {
  5845. thumb.aligner.align();
  5846. }
  5847. } );
  5848. };
  5849. p.updateThumbscroll = function(){
  5850. var thumb_size;
  5851. var pos = this.thumbSize * this.cindex;
  5852. if(this.controller.value == NaN) this.controller.value = 0;
  5853. if(pos - this.controller.value < 0){
  5854. this.controller.gotoSnap(this.cindex , true);
  5855. return;
  5856. }
  5857. if(pos + this.thumbSize - this.controller.value > this.$element[this.__dimen]()){
  5858. var first_snap = this.cindex - Math.floor(this.$element[this.__dimen]() / this.thumbSize) + 1;
  5859. this.controller.gotoSnap(first_snap , true);
  5860. return;
  5861. }
  5862. };
  5863. p.changeSlide = function(thumb){
  5864. if(!this.click_enable || this.cindex === thumb[0].index) return;
  5865. this.slider.api.gotoSlide(thumb[0].index);
  5866. };
  5867. p.unselect = function(ele){
  5868. ele.removeClass('ms-thumb-frame-selected');
  5869. };
  5870. p.select = function(ele){
  5871. ele.addClass('ms-thumb-frame-selected');
  5872. };
  5873. p.__resize = function(){
  5874. var size = this.$element[this.__dimen]();
  5875. if(this.ls === size) return;
  5876. this.ls = size;
  5877. this.thumbSize = this.thumbs[0][this.__jdimen](true);
  5878. var len = this.slider.api.count() * this.thumbSize;
  5879. this.$thumbscont[0].style[this.__dimen] = len + 'px';
  5880. if(len <= size){
  5881. this.dTouch = true;
  5882. this.controller.stop();
  5883. this.$thumbscont[0].style[this.__pos] = (size - len)*.5 + 'px';
  5884. this.$thumbscont[0].style[window._jcsspfx + 'Transform'] = '';
  5885. }else{
  5886. this.dTouch = false;
  5887. this.click_enable = true;
  5888. this.$thumbscont[0].style[this.__pos] = '';
  5889. this.controller._max_value = len - size;
  5890. this.controller.options.snapsize = this.thumbSize;
  5891. this.updateThumbscroll();
  5892. }
  5893. };
  5894. p.destroy = function(){
  5895. _super.destroy();
  5896. if(this.options.wheel){
  5897. if($.browser.mozilla) this.$element[0].removeEventListener('DOMMouseScroll' , this.wheellistener);
  5898. else this.$element.unbind('mousewheel', this.wheellistener);
  5899. this.wheellistener = null;
  5900. }
  5901. $(window).unbind('resize', this.resize_listener);
  5902. this.$element.remove();
  5903. this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
  5904. this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START , this.update , this);
  5905. };
  5906. window.MSThumblist = MSThumblist;
  5907. MSSlideController.registerControl('thumblist' , MSThumblist);
  5908. })(jQuery);
  5909. /* ================== bin-debug/js/pro/uicontrols/Bullets.js =================== */
  5910. ;(function($){
  5911. "use strict";
  5912. var MSBulltes = function(options){
  5913. BaseControl.call(this);
  5914. this.options.dir = 'h';
  5915. this.options.inset = true;
  5916. this.options.margin = 10;
  5917. this.options.space = 10;
  5918. $.extend(this.options , options);
  5919. this.bullets = [];
  5920. };
  5921. MSBulltes.extend(BaseControl);
  5922. var p = MSBulltes.prototype;
  5923. var _super = BaseControl.prototype;
  5924. /* -------------------------------- */
  5925. p.setup = function(){
  5926. _super.setup.call(this);
  5927. this.$element = $('<div></div>')
  5928. .addClass(this.options.prefix + 'bullets')
  5929. .addClass('ms-dir-' + this.options.dir)
  5930. .appendTo(this.cont);
  5931. this.$bullet_cont = $('<div></div>')
  5932. .addClass('ms-bullets-count')
  5933. .appendTo(this.$element);
  5934. if( !this.options.insetTo && this.options.align ){
  5935. var align = this.options.align;
  5936. if( this.options.inset ){
  5937. this.$element.css(align, this.options.margin);
  5938. }
  5939. }
  5940. this.checkHideUnder(); // super method
  5941. };
  5942. p.create = function(){
  5943. _super.create.call(this);
  5944. var that = this;
  5945. this.slider.api.addEventListener(MSSliderEvent.CHANGE_START , this.update , this);
  5946. this.cindex = this.slider.api.index();
  5947. for(var i = 0; i < this.slider.api.count(); ++i){
  5948. var bullet = $('<div></div>').addClass('ms-bullet');
  5949. bullet[0].index = i;
  5950. bullet.on('click', function(){that.changeSlide(this.index);});
  5951. this.$bullet_cont.append(bullet);
  5952. this.bullets.push(bullet);
  5953. if( this.options.dir === 'h' ) {
  5954. bullet.css('margin', this.options.space/2);
  5955. }else {
  5956. bullet.css('margin', this.options.space);
  5957. }
  5958. }
  5959. if(this.options.dir === 'h') {
  5960. this.$element.width(bullet.outerWidth(true) * this.slider.api.count());
  5961. } else {
  5962. this.$element.css('margin-top', -this.$element.outerHeight(true)/2);
  5963. }
  5964. this.select(this.bullets[this.cindex]);
  5965. };
  5966. p.update = function(){
  5967. var nindex = this.slider.api.index();
  5968. if(this.cindex === nindex) return;
  5969. if(this.cindex != null)this.unselect(this.bullets[this.cindex]);
  5970. this.cindex = nindex;
  5971. this.select(this.bullets[this.cindex]);
  5972. };
  5973. p.changeSlide = function(index){
  5974. if(this.cindex === index) return;
  5975. this.slider.api.gotoSlide(index);
  5976. };
  5977. p.unselect = function(ele){
  5978. ele.removeClass('ms-bullet-selected');
  5979. };
  5980. p.select = function(ele){
  5981. ele.addClass('ms-bullet-selected');
  5982. };
  5983. p.destroy = function(){
  5984. _super.destroy();
  5985. this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START , this.update , this);
  5986. this.$element.remove();
  5987. };
  5988. window.MSBulltes = MSBulltes;
  5989. MSSlideController.registerControl('bullets' , MSBulltes);
  5990. })(jQuery);
  5991. /* ================== bin-debug/js/pro/uicontrols/Scrollbar.js =================== */
  5992. ;(function($){
  5993. "use strict";
  5994. var MSScrollbar = function(options){
  5995. BaseControl.call(this);
  5996. this.options.dir = 'h';
  5997. this.options.autohide = true;
  5998. this.options.width = 4;
  5999. this.options.color = '#3D3D3D';
  6000. this.options.margin = 10;
  6001. $.extend(this.options , options);
  6002. this.__dimen = this.options.dir === 'h' ? 'width' : 'height';
  6003. this.__jdimen = this.options.dir === 'h' ? 'outerWidth' : 'outerHeight';
  6004. this.__pos = this.options.dir === 'h' ? 'left' : 'top';
  6005. this.__translate_end = window._css3d ? ' translateZ(0px)' : '';
  6006. this.__translate_start = this.options.dir === 'h' ? ' translateX(' : 'translateY(';
  6007. };
  6008. MSScrollbar.extend(BaseControl);
  6009. var p = MSScrollbar.prototype;
  6010. var _super = BaseControl.prototype;
  6011. /* -------------------------------- */
  6012. p.setup = function(){
  6013. this.$element = $('<div></div>')
  6014. .addClass(this.options.prefix + 'sbar')
  6015. .addClass('ms-dir-' + this.options.dir);
  6016. _super.setup.call(this);
  6017. if( this.slider.$controlsCont === this.cont ){
  6018. this.$element.appendTo(this.slider.$element);
  6019. }else{
  6020. this.$element.appendTo(this.cont);
  6021. }
  6022. this.$bar = $('<div></div>')
  6023. .addClass(this.options.prefix + 'bar')
  6024. .appendTo(this.$element);
  6025. if(this.slider.options.loop){
  6026. console.log('WARNING, MSScrollbar cannot work with looped slider.');
  6027. this.disable = true;
  6028. this.$element.remove();
  6029. }
  6030. /**
  6031. * align control
  6032. * @since 1.5.7
  6033. */
  6034. // change width
  6035. if( this.options.dir === 'v' ){
  6036. this.$bar.width(this.options.width);
  6037. } else {
  6038. this.$bar.height(this.options.width);
  6039. }
  6040. // change color
  6041. this.$bar.css('background-color', this.options.color);
  6042. if( !this.options.insetTo && this.options.align ){
  6043. // reset old versions styles
  6044. if( this.options.dir === 'v' ){
  6045. this.$element.css({
  6046. right:'auto',
  6047. left:'auto'
  6048. });
  6049. } else {
  6050. this.$element.css({
  6051. top:'auto',
  6052. bottom:'auto'
  6053. });
  6054. }
  6055. var align = this.options.align;
  6056. if( this.options.inset ){
  6057. this.$element.css(align, this.options.margin );
  6058. }else if( align === 'top' ){
  6059. this.$element.prependTo(this.slider.$element).css({
  6060. 'margin-bottom': this.options.margin,
  6061. 'position': 'relative'
  6062. });
  6063. }else if( align === 'bottom' ){
  6064. this.$element.css({
  6065. 'margin-top': this.options.margin,
  6066. 'position': 'relative'
  6067. });
  6068. }else{
  6069. this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
  6070. this.align();
  6071. }
  6072. }
  6073. this.checkHideUnder(); // super method
  6074. };
  6075. /**
  6076. * calls by "RESERVED_SPACE_CHGANE" realigns the control in slider
  6077. * @since 1.5.7
  6078. */
  6079. p.align = function(event){
  6080. if( this.detached ){
  6081. return;
  6082. }
  6083. var align = this.options.align;
  6084. var pos = this.slider.reserveSpace(align, this.options.margin * 2 + this.options.width);
  6085. this.$element.css(align, -pos - this.options.margin - this.options.width);
  6086. };
  6087. p.create = function(){
  6088. if(this.disable) return;
  6089. //_super.create.call(this);
  6090. var that = this;
  6091. this.scroller = this.slider.api.scroller;
  6092. this.slider.api.view.addEventListener(MSViewEvents.SCROLL , this._update , this);
  6093. this.slider.api.addEventListener(MSSliderEvent.RESIZE , this._resize , this);
  6094. this._resize();
  6095. if(this.options.autohide){
  6096. this.$bar.css('opacity' , '0');
  6097. }
  6098. };
  6099. p._resize = function(){
  6100. this.vdimen = this.$element[this.__dimen]();
  6101. this.bar_dimen = this.slider.api.view[ '__' + this.__dimen] * this.vdimen / this.scroller._max_value;
  6102. this.$bar[this.__dimen](this.bar_dimen );
  6103. };
  6104. p._update = function(){
  6105. var value = this.scroller.value * (this.vdimen - this.bar_dimen) / this.scroller._max_value;
  6106. if(this.lvalue === value) return;
  6107. this.lvalue = value;
  6108. if(this.options.autohide){
  6109. clearTimeout(this.hto);
  6110. this.$bar.css('opacity' , '1');
  6111. var that = this;
  6112. this.hto = setTimeout(function(){
  6113. //if(!that.slider.api.view.swipeControl.touchStarted)
  6114. that.$bar.css('opacity' , '0');
  6115. } , 150);
  6116. }
  6117. if(value < 0){
  6118. this.$bar[0].style[this.__dimen] = this.bar_dimen + value + 'px';
  6119. return;
  6120. }
  6121. if(value > this.vdimen - this.bar_dimen)
  6122. this.$bar[0].style[this.__dimen] = this.vdimen - value + 'px';
  6123. if(window._cssanim) {
  6124. this.$bar[0].style[window._jcsspfx + 'Transform'] = this.__translate_start +value+'px)'+ this.__translate_end;
  6125. return;
  6126. }
  6127. this.$bar[0].style[this.__pos] = value + 'px';
  6128. };
  6129. p.destroy = function(){
  6130. _super.destroy();
  6131. this.slider.api.view.removeEventListener(MSViewEvents.SCROLL , this._update , this);
  6132. this.slider.api.removeEventListener(MSSliderEvent.RESIZE , this._resize , this);
  6133. this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
  6134. this.$element.remove();
  6135. };
  6136. window.MSScrollbar = MSScrollbar;
  6137. MSSlideController.registerControl('scrollbar' , MSScrollbar);
  6138. })(jQuery);
  6139. /* ================== bin-debug/js/pro/uicontrols/Timebar.js =================== */
  6140. ;(function($){
  6141. "use strict";
  6142. var MSTimerbar = function(options){
  6143. BaseControl.call(this);
  6144. this.options.autohide = false;
  6145. this.options.width = 4;
  6146. this.options.color = '#FFFFFF';
  6147. this.options.inset = true;
  6148. this.options.margin = 0;
  6149. $.extend(this.options , options);
  6150. };
  6151. MSTimerbar.extend(BaseControl);
  6152. var p = MSTimerbar.prototype;
  6153. var _super = BaseControl.prototype;
  6154. /* -------------------------------- */
  6155. p.setup = function(){
  6156. var that = this;
  6157. _super.setup.call(this);
  6158. this.$element = $('<div></div>')
  6159. .addClass(this.options.prefix + 'timerbar');
  6160. _super.setup.call(this);
  6161. if( this.slider.$controlsCont === this.cont ){
  6162. this.$element.appendTo(this.slider.$element);
  6163. }else{
  6164. this.$element.appendTo(this.cont);
  6165. }
  6166. this.$bar = $('<div></div>')
  6167. .addClass('ms-time-bar')
  6168. .appendTo(this.$element);
  6169. // change width
  6170. if( this.options.dir === 'v' ){
  6171. this.$bar.width(this.options.width);
  6172. this.$element.width(this.options.width);
  6173. } else {
  6174. this.$bar.height(this.options.width);
  6175. this.$element.height(this.options.width);
  6176. }
  6177. // change color
  6178. this.$bar.css('background-color', this.options.color);
  6179. if( !this.options.insetTo && this.options.align ){
  6180. this.$element.css({
  6181. top:'auto',
  6182. bottom:'auto'
  6183. });
  6184. var align = this.options.align;
  6185. if( this.options.inset ){
  6186. this.$element.css(align, this.options.margin );
  6187. }else if( align === 'top' ){
  6188. this.$element.prependTo(this.slider.$element).css({
  6189. 'margin-bottom': this.options.margin,
  6190. 'position': 'relative'
  6191. });
  6192. }else if( align === 'bottom' ){
  6193. this.$element.css({
  6194. 'margin-top': this.options.margin,
  6195. 'position': 'relative'
  6196. });
  6197. }else{
  6198. this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
  6199. this.align();
  6200. }
  6201. }
  6202. this.checkHideUnder(); // super method
  6203. };
  6204. /**
  6205. * calls by "RESERVED_SPACE_CHGANE" realigns the control in slider
  6206. * @since 1.5.7
  6207. */
  6208. p.align = function(event){
  6209. if( this.detached ){
  6210. return;
  6211. }
  6212. var align = this.options.align;
  6213. var pos = this.slider.reserveSpace(align, this.options.margin * 2 + this.options.width);
  6214. this.$element.css(align, -pos - this.options.margin - this.options.width);
  6215. };
  6216. p.create = function(){
  6217. _super.create.call(this);
  6218. this.slider.api.addEventListener(MSSliderEvent.WAITING , this._update , this);
  6219. this._update();
  6220. };
  6221. p._update = function(){
  6222. this.$bar[0].style.width = this.slider.api._delayProgress + '%';
  6223. };
  6224. p.destroy = function(){
  6225. _super.destroy();
  6226. this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
  6227. this.slider.api.removeEventListener(MSSliderEvent.WAITING , this._update , this);
  6228. this.$element.remove();
  6229. };
  6230. window.MSTimerbar = MSTimerbar;
  6231. MSSlideController.registerControl('timebar' , MSTimerbar);
  6232. })(jQuery);
  6233. /* ================== bin-debug/js/pro/uicontrols/CircleTimer.js =================== */
  6234. ;(function($){
  6235. "use strict";
  6236. var MSCircleTimer = function(options){
  6237. BaseControl.call(this);
  6238. this.options.color = '#A2A2A2';
  6239. this.options.stroke = 10;
  6240. this.options.radius = 4;
  6241. this.options.autohide = false;
  6242. $.extend(this.options , options);
  6243. };
  6244. MSCircleTimer.extend(BaseControl);
  6245. var p = MSCircleTimer.prototype;
  6246. var _super = BaseControl.prototype;
  6247. /* -------------------------------- */
  6248. p.setup = function(){
  6249. var that = this;
  6250. _super.setup.call(this);
  6251. this.$element = $('<div></div>')
  6252. .addClass(this.options.prefix + 'ctimer')
  6253. .appendTo(this.cont);
  6254. this.$canvas = $('<canvas></canvas>')
  6255. .addClass('ms-ctimer-canvas')
  6256. .appendTo(this.$element);
  6257. this.$bar = $('<div></div>')
  6258. .addClass('ms-ctimer-bullet')
  6259. .appendTo(this.$element);
  6260. if(!this.$canvas[0].getContext){
  6261. this.destroy();
  6262. this.disable = true;
  6263. return;
  6264. }
  6265. this.ctx = this.$canvas[0].getContext('2d');
  6266. this.prog = 0;
  6267. this.__w = (this.options.radius + this.options.stroke/2) * 2;
  6268. this.$canvas[0].width = this.__w;
  6269. this.$canvas[0].height = this.__w;
  6270. this.checkHideUnder(); // super method
  6271. };
  6272. p.create = function(){
  6273. if(this.disable) return;
  6274. _super.create.call(this);
  6275. this.slider.api.addEventListener(MSSliderEvent.WAITING , this._update , this);
  6276. var that = this;
  6277. this.$element.click(function(){
  6278. if(that.slider.api.paused)
  6279. that.slider.api.resume();
  6280. else
  6281. that.slider.api.pause();
  6282. });
  6283. this._update();
  6284. };
  6285. p._update = function(){
  6286. var that = this;
  6287. $(this).stop(true).animate({prog:this.slider.api._delayProgress * 0.01} ,
  6288. {duration:200 , step:function(){that._draw();}});
  6289. //this.$bar[0].style.width = this.slider.api._delayProgress/100 * this.$element.width() + 'px';
  6290. };
  6291. p._draw = function(){
  6292. this.ctx.clearRect(0 , 0, this.__w , this.__w);
  6293. this.ctx.beginPath();
  6294. 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);
  6295. this.ctx.strokeStyle = this.options.color;
  6296. this.ctx.lineWidth = this.options.stroke;
  6297. this.ctx.stroke();
  6298. };
  6299. p.destroy = function(){
  6300. _super.destroy();
  6301. if(this.disable) return;
  6302. $(this).stop(true);
  6303. this.slider.api.removeEventListener(MSSliderEvent.WAITING , this._update , this);
  6304. this.$element.remove();
  6305. };
  6306. window.MSCircleTimer = MSCircleTimer;
  6307. MSSlideController.registerControl('circletimer' , MSCircleTimer);
  6308. })(jQuery);
  6309. /* ================== bin-debug/js/pro/uicontrols/Lightbox.js =================== */
  6310. ;(function($){
  6311. "use strict";
  6312. window.MSLightbox = function(options){
  6313. BaseControl.call(this , options);
  6314. this.options.autohide = false;
  6315. $.extend(this.options , options);
  6316. this.data_list = [];
  6317. };
  6318. MSLightbox.fadeDuratation = 400;
  6319. MSLightbox.extend(BaseControl);
  6320. var p = MSLightbox.prototype;
  6321. var _super = BaseControl.prototype;
  6322. /* -------------------------------- */
  6323. p.setup = function(){
  6324. _super.setup.call(this);
  6325. this.$element = $('<div></div>')
  6326. .addClass(this.options.prefix + 'lightbox-btn')
  6327. .appendTo(this.cont);
  6328. this.checkHideUnder(); // super method
  6329. };
  6330. p.slideAction = function(slide){
  6331. $('<div></div>')
  6332. .addClass(this.options.prefix + 'lightbox-btn')
  6333. .appendTo(slide.$element)
  6334. .append($(slide.$element.find('.ms-lightbox')));
  6335. };
  6336. p.create = function(){
  6337. _super.create.call(this);
  6338. };
  6339. MSSlideController.registerControl('lightbox' , MSLightbox);
  6340. })(jQuery);
  6341. /* ================== bin-debug/js/pro/uicontrols/SlideInfo.js =================== */
  6342. ;(function($){
  6343. "use strict";
  6344. window.MSSlideInfo = function(options){
  6345. BaseControl.call(this , options);
  6346. this.options.autohide = false;
  6347. this.options.align = null;
  6348. this.options.inset = false;
  6349. this.options.margin = 10;
  6350. this.options.size = 100;
  6351. this.options.dir = 'h';
  6352. $.extend(this.options , options);
  6353. this.data_list = [];
  6354. };
  6355. MSSlideInfo.fadeDuratation = 400;
  6356. MSSlideInfo.extend(BaseControl);
  6357. var p = MSSlideInfo.prototype;
  6358. var _super = BaseControl.prototype;
  6359. /* -------------------------------- */
  6360. p.setup = function(){
  6361. this.$element = $('<div></div>')
  6362. .addClass(this.options.prefix + 'slide-info')
  6363. .addClass('ms-dir-' + this.options.dir);
  6364. _super.setup.call(this);
  6365. if( this.slider.$controlsCont === this.cont ){
  6366. this.$element.appendTo(this.slider.$element); // insert in outer container out of overflow hidden
  6367. }else{
  6368. this.$element.appendTo(this.cont);
  6369. }
  6370. // align control
  6371. if( !this.options.insetTo && this.options.align ){
  6372. var align = this.options.align;
  6373. if( this.options.inset ){
  6374. this.$element.css(align, this.options.margin );
  6375. }else if( align === 'top' ){
  6376. this.$element.prependTo(this.slider.$element).css({
  6377. 'margin-bottom': this.options.margin,
  6378. 'position': 'relative'
  6379. });
  6380. }else if( align === 'bottom' ){
  6381. this.$element.css({
  6382. 'margin-top': this.options.margin,
  6383. 'position': 'relative'
  6384. });
  6385. }else{
  6386. this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
  6387. this.align();
  6388. }
  6389. if( this.options.dir === 'v' ){
  6390. this.$element.width(this.options.size);
  6391. }else{
  6392. this.$element.css('min-height', this.options.size);
  6393. }
  6394. }
  6395. this.checkHideUnder(); // super method
  6396. };
  6397. /**
  6398. * calls by "RESERVED_SPACE_CHGANE" realigns the control in slider
  6399. * @since 1.5.7
  6400. */
  6401. p.align = function(event){
  6402. if( this.detached ){
  6403. return;
  6404. }
  6405. var align = this.options.align;
  6406. var pos = this.slider.reserveSpace(align, this.options.size + this.options.margin * 2);
  6407. this.$element.css(align, -pos - this.options.size - this.options.margin);
  6408. };
  6409. p.slideAction = function(slide){
  6410. var info_ele = $(slide.$element.find('.ms-info'));
  6411. var that = this;
  6412. info_ele.detach();
  6413. this.data_list[slide.index] = info_ele;
  6414. };
  6415. p.create = function(){
  6416. _super.create.call(this);
  6417. this.slider.api.addEventListener(MSSliderEvent.CHANGE_START , this.update , this);
  6418. this.cindex = this.slider.api.index();
  6419. this.switchEle(this.data_list[this.cindex]);
  6420. };
  6421. p.update = function(){
  6422. var nindex = this.slider.api.index();
  6423. this.switchEle(this.data_list[nindex]);
  6424. this.cindex = nindex;
  6425. };
  6426. p.switchEle = function(ele){
  6427. if(this.current_ele){
  6428. var that = this;
  6429. if(this.current_ele[0].tween)this.current_ele[0].tween.stop(true);
  6430. this.current_ele[0].tween = CTween.animate(this.current_ele , MSSlideInfo.fadeDuratation , {opacity:0} , {complete:function(){
  6431. this.detach();
  6432. this[0].tween = null;
  6433. ele.css('position', 'relative');
  6434. } , target:this.current_ele });
  6435. //this.current_ele.css('position', 'absolute');
  6436. ele.css('position', 'absolute');
  6437. }
  6438. this.__show(ele);
  6439. };
  6440. p.__show = function(ele){
  6441. ele.appendTo(this.$element).css('opacity','0');///.css('position', 'relative');
  6442. // calculate max height
  6443. if ( this.current_ele ){
  6444. ele.height( Math.max( ele.height(), this.current_ele.height() ) );
  6445. }
  6446. clearTimeout(this.tou);
  6447. this.tou = setTimeout(function(){
  6448. CTween.fadeIn(ele , MSSlideInfo.fadeDuratation );
  6449. ele.css('height', '');
  6450. }, MSSlideInfo.fadeDuratation);
  6451. if(ele[0].tween)ele[0].tween.stop(true);
  6452. this.current_ele = ele;
  6453. };
  6454. p.destroy = function(){
  6455. _super.destroy();
  6456. clearTimeout(this.tou);
  6457. if(this.current_ele && this.current_ele[0].tween){
  6458. this.current_ele[0].tween.stop('true');
  6459. }
  6460. this.$element.remove();
  6461. this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
  6462. this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START , this.update , this);
  6463. };
  6464. MSSlideController.registerControl('slideinfo' , MSSlideInfo);
  6465. })(jQuery);
  6466. /* ================== bin-debug/js/pro/plugins/MSGallery.js =================== */
  6467. /**
  6468. * Master Slider, Gallery Template v1.0
  6469. * @author: Averta Ltd.
  6470. */
  6471. ;(function($){
  6472. window.MSGallery = function(id , slider){
  6473. this.id = id;
  6474. this.slider = slider;
  6475. this.telement = $('#'+id);
  6476. this.botcont = $('<div></div>').addClass('ms-gallery-botcont').appendTo(this.telement);
  6477. this.thumbcont = $('<div></div>').addClass('ms-gal-thumbcont hide-thumbs').appendTo(this.botcont);
  6478. this.playbtn = $('<div></div>').addClass('ms-gal-playbtn').appendTo(this.botcont);
  6479. this.thumbtoggle = $('<div></div>').addClass('ms-gal-thumbtoggle').appendTo(this.botcont);
  6480. // adds required controls to slider
  6481. slider.control('thumblist' , {insertTo:this.thumbcont , autohide:false , dir:'h'});
  6482. slider.control('slidenum' , {insertTo:this.botcont , autohide:false});
  6483. slider.control('slideinfo' , {insertTo:this.botcont , autohide:false});
  6484. slider.control('timebar' , {insertTo:this.botcont , autohide:false});
  6485. slider.control('bullets' , {insertTo:this.botcont , autohide:false});
  6486. };
  6487. var p = MSGallery.prototype;
  6488. p._init = function(){
  6489. var that = this;
  6490. if(!this.slider.api.paused)
  6491. this.playbtn.addClass('btn-pause');
  6492. this.playbtn.click(function(){
  6493. if(that.slider.api.paused){
  6494. that.slider.api.resume();
  6495. that.playbtn.addClass('btn-pause');
  6496. }else{
  6497. that.slider.api.pause();
  6498. that.playbtn.removeClass('btn-pause');
  6499. }
  6500. });
  6501. this.thumbtoggle.click(function(){
  6502. if(that.vthumbs){
  6503. //that.hideThumbs();
  6504. that.thumbtoggle.removeClass('btn-hide');
  6505. that.vthumbs = false;
  6506. that.thumbcont.addClass('hide-thumbs');
  6507. }else{
  6508. //that.showThumbs();
  6509. that.thumbtoggle.addClass('btn-hide');
  6510. that.thumbcont.removeClass('hide-thumbs');
  6511. that.vthumbs = true;
  6512. }
  6513. });
  6514. };
  6515. p.setup = function(){
  6516. var that = this;
  6517. $(document).ready(function(){that._init();});
  6518. };
  6519. })(jQuery);
  6520. /* ================== bin-debug/js/pro/plugins/MSFlickrV2.js =================== */
  6521. /**
  6522. * Master Slider Flickr Plugin Version 2
  6523. * @version 2.0.0
  6524. * @author Averta Ltd.
  6525. */
  6526. ;(function($){
  6527. /**
  6528. * Generate Flickr photoset url
  6529. * @param {String} key api key
  6530. * @param {String} id photoset id
  6531. * @param {Number} count number of images
  6532. * @return {String}
  6533. */
  6534. var getPhotosetURL = function(key , id , count){
  6535. 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=?';
  6536. };
  6537. /**
  6538. * Generate Flickr user public images url
  6539. * @param {String} key api key
  6540. * @param {String} id user id
  6541. * @param {Number} count number of images
  6542. * @return {String}
  6543. */
  6544. var getUserPublicURL = function(key , id , count){
  6545. 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=?';
  6546. };
  6547. /**
  6548. * Generates image path
  6549. * @param {String} fid
  6550. * @param {String} server
  6551. * @param {String} id
  6552. * @param {String} secret
  6553. * @param {String} size
  6554. * @return {String}
  6555. */
  6556. var getImageSource = function(fid , server , id , secret , size, data){
  6557. if ( size === '_o' && data ) {
  6558. return data.url_o;
  6559. }
  6560. return 'https://farm' + fid + '.staticflickr.com/'+ server + '/' + id + '_' + secret + size + '.jpg';
  6561. };
  6562. window.MSFlickrV2 = function(slider,options){
  6563. var _options = {
  6564. count :10,
  6565. type :'photoset',
  6566. /*
  6567. * s small square 75x75
  6568. * q large square 150x150
  6569. * t thumbnail, 100 on longest side
  6570. */
  6571. thumbSize :'q',
  6572. /*
  6573. * - medium, 500 on longest side
  6574. * z medium 640, 640 on longest side
  6575. * c medium 800, 800 on longest side
  6576. * b large, 1024 on longest side
  6577. * o original image, either a jpg, gif or png, depending on source format
  6578. */
  6579. imgSize : 'c'
  6580. };
  6581. this.slider = slider;
  6582. this.slider.holdOn();
  6583. if( !options.key ){
  6584. this.errMsg('Flickr API Key required. Please add it in settings.');
  6585. return;
  6586. }
  6587. $.extend(_options , options);
  6588. this.options = _options;
  6589. var that = this;
  6590. if(this.options.type === 'photoset'){
  6591. $.getJSON(getPhotosetURL(this.options.key , this.options.id , this.options.count) , function(data){
  6592. that._photosData(data);
  6593. });
  6594. }else{
  6595. $.getJSON(getUserPublicURL(this.options.key , this.options.id , this.options.count) , function(data){
  6596. that.options.type = 'photos';
  6597. that._photosData(data);
  6598. });
  6599. }
  6600. if(this.options.imgSize !== '' && this.options.imgSize !== '-')
  6601. this.options.imgSize = '_' + this.options.imgSize;
  6602. this.options.thumbSize = '_' + this.options.thumbSize;
  6603. // grab slide template from slider markup
  6604. this.slideTemplate = this.slider.$element.find('.ms-slide')[0].outerHTML;
  6605. this.slider.$element.find('.ms-slide').remove(); // remove all slides from slider markup
  6606. };
  6607. var p = MSFlickrV2.prototype;
  6608. p._photosData = function(data){
  6609. if(data.stat === 'fail'){
  6610. this.errMsg('Flickr API ERROR#' + data.code + ': ' + data.message);
  6611. return;
  6612. }
  6613. var that = this;
  6614. var getInfo = this.options.author || this.options.desc;
  6615. $.each(data[this.options.type].photo, function(i,item){
  6616. var slide_cont = that.slideTemplate.replace(/{{[\w-]+}}/g, function(match){
  6617. match = match.replace(/{{|}}/g, '');
  6618. if( shortCodes[match] ) {
  6619. return shortCodes[match](item, that);
  6620. } else {
  6621. return '{{'+match+'}}';
  6622. }
  6623. });
  6624. $(slide_cont).appendTo(that.slider.$element);
  6625. });
  6626. that._initSlider();
  6627. };
  6628. p.errMsg = function(msg){
  6629. this.slider.$element.css('display', 'block');
  6630. if(!this.errEle)
  6631. this.errEle = $('<div style="font-family:Arial; color:red; font-size:12px; position:absolute; top:10px; left:10px"></div>').appendTo(this.slider.$loading);
  6632. this.errEle.html(msg);
  6633. };
  6634. p._initSlider = function(){
  6635. this.slider.release();
  6636. };
  6637. // a list of functions that generates data from short codes
  6638. var shortCodes = {
  6639. 'image': function(data, that){
  6640. return getImageSource(data.farm , data.server , data.id , data.secret , that.options.imgSize, data);
  6641. },
  6642. 'thumb': function(data, that){
  6643. return getImageSource(data.farm , data.server , data.id , data.secret , that.options.thumbSize);
  6644. },
  6645. 'title': function(data, that){
  6646. return data.title;
  6647. },
  6648. 'owner-name': function(data, that){
  6649. return data.ownername;
  6650. },
  6651. 'date-taken': function(data, that){
  6652. return data.datetaken;
  6653. },
  6654. 'views': function(data, that){
  6655. return data.views;
  6656. },
  6657. 'description': function(data, that){
  6658. return data.description._content;
  6659. }
  6660. };
  6661. })(jQuery);
  6662. /* ================== bin-debug/js/pro/plugins/MSFacebookGallery.js =================== */
  6663. /**
  6664. * Master Slider Facebook Gallery plugin
  6665. * @author Averta Ltd.
  6666. * @version 1.0.0
  6667. */
  6668. ;(function($){
  6669. window.MSFacebookGallery = function(slider, options){
  6670. var _options = {
  6671. count :10,
  6672. type :'photostream', // album
  6673. /*
  6674. orginal/960/720/600/480/320/130
  6675. */
  6676. thumbSize :'320',
  6677. /*
  6678. orginal/960/720/600/480/320/130
  6679. */
  6680. imgSize : 'orginal',
  6681. https: false,
  6682. token: ''
  6683. };
  6684. this.slider = slider;
  6685. this.slider.holdOn();
  6686. $.extend(_options , options);
  6687. this.options = _options;
  6688. //this.graph = this.options.https ? 'https://graph.facebook.com' : 'http://graph.facebook.com';
  6689. this.graph = 'https://graph.facebook.com';
  6690. var that = this;
  6691. if(this.options.type === 'photostream'){
  6692. $.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){
  6693. that._photosData(data);
  6694. });
  6695. }else{
  6696. $.getJSON(this.graph + '/' + this.options.albumId + '/photos?fields=source,name,link,images,from&limit=' + this.options.count + '&access_token=' + this.options.token , function(data){
  6697. that._photosData(data);
  6698. });
  6699. }
  6700. // grab slide template from slider markup
  6701. this.slideTemplate = this.slider.$element.find('.ms-slide')[0].outerHTML;
  6702. this.slider.$element.find('.ms-slide').remove(); // remove all slides from slider markup
  6703. };
  6704. var p = MSFacebookGallery.prototype;
  6705. p._photosData = function(content){
  6706. if(content.error){
  6707. this.errMsg('Facebook API ERROR#' + content.error.code + '(' + content.error.type + ')' + ': ' + content.error.message);
  6708. return;
  6709. }
  6710. var that = this;
  6711. var getInfo = this.options.author || this.options.desc;
  6712. for(var i=0,l=content.data.length;i!==l;i++){
  6713. var slide_cont = that.slideTemplate.replace(/{{[\w-]+}}/g, function(match){
  6714. match = match.replace(/{{|}}/g, '');
  6715. if( shortCodes[match] ) {
  6716. return shortCodes[match](content.data[i], that);
  6717. } else {
  6718. return '{{'+match+'}}';
  6719. }
  6720. });
  6721. $(slide_cont).appendTo(that.slider.$element);
  6722. }
  6723. that._initSlider();
  6724. };
  6725. p.errMsg = function(msg){
  6726. this.slider.$element.css('display', 'block');
  6727. if(!this.errEle)
  6728. this.errEle = $('<div style="font-family:Arial; color:red; font-size:12px; position:absolute; top:10px; left:10px"></div>').appendTo(this.slider.$loading);
  6729. this.errEle.html(msg);
  6730. };
  6731. p._initSlider = function(){
  6732. this.slider.release();
  6733. };
  6734. var getImageSource = function(images, size){
  6735. if( size === 'orginal' ) {
  6736. return images[0].source;
  6737. }
  6738. for(var i = 0, l = images.length; i !== l; i++){
  6739. if( images[i].source.indexOf(size + 'x' + size) !== -1 )
  6740. return images[i].source;
  6741. }
  6742. // console.log(images)
  6743. return images[0].source;
  6744. };
  6745. // a list of functions that generates data from short codes
  6746. var shortCodes = {
  6747. 'image': function(data, that){
  6748. return getImageSource(data.images, that.options.imgSize);
  6749. },
  6750. 'thumb': function(data, that){
  6751. return getImageSource(data.images, that.options.thumbSize);
  6752. },
  6753. 'name': function(data, that){
  6754. return data.name;
  6755. },
  6756. 'owner-name': function(data, that){
  6757. return data.from.name;
  6758. },
  6759. 'link': function(data, that){
  6760. return data.link;
  6761. }
  6762. };
  6763. })(jQuery);
  6764. /* ================== bin-debug/js/pro/plugins/MSScrollParallax.js =================== */
  6765. /**
  6766. * Master Slider Parallax Layers Fade
  6767. * @description Moves and fades layers of current slide while scrolling window.
  6768. * @package MasterSlider
  6769. * @author Averta
  6770. * @since v1.8.0
  6771. */
  6772. (function($){
  6773. 'use strict';
  6774. window.MSScrollParallax = function (slider, parallax, bgparallax, fade) {
  6775. this.fade = fade;
  6776. this.slider = slider;
  6777. this.parallax = parallax/100;
  6778. this.bgparallax = bgparallax/100;
  6779. slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
  6780. slider.api.addEventListener(MSSliderEvent.DESTROY, this.destory, this);
  6781. slider.api.addEventListener(MSSliderEvent.CHANGE_END, this.resetLayers, this);
  6782. slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.updateCurrentSlide, this);
  6783. };
  6784. window.MSScrollParallax.setup = function(slider, parallax, bgparallax, fade){
  6785. // disable in mobile devices
  6786. if ( window._mobile ) {
  6787. return;
  6788. }
  6789. if( parallax == null ) {
  6790. parallax = 50;
  6791. }
  6792. if( bgparallax == null ){
  6793. bgparallax = 40;
  6794. }
  6795. return new MSScrollParallax(slider, parallax, bgparallax, fade);
  6796. };
  6797. var p = window.MSScrollParallax.prototype;
  6798. p.init = function (e) {
  6799. this.slider.$element.addClass('ms-scroll-parallax');
  6800. this.sliderOffset = this.slider.$element.offset().top;
  6801. this.updateCurrentSlide();
  6802. // wrap layers element
  6803. var slides = this.slider.api.view.slideList,
  6804. slide;
  6805. for(var i = 0, l = slides.length; i!==l ; i++) {
  6806. slide = slides[i];
  6807. if( slide.hasLayers ) {
  6808. slide.layerController.$layers.wrap('<div class="ms-scroll-parallax-cont"></div>');
  6809. slide.$scrollParallaxCont = slide.layerController.$layers.parent();
  6810. }
  6811. }
  6812. $(window).on('scroll', {that:this}, this.moveParallax).trigger('scroll');
  6813. };
  6814. p.resetLayers = function (e) {
  6815. if( !this.lastSlide ) {
  6816. return;
  6817. }
  6818. var layers = this.lastSlide.$scrollParallaxCont;
  6819. if ( window._css2d ) {
  6820. if( layers ){
  6821. layers[0].style[window._jcsspfx + 'Transform'] = '';
  6822. }
  6823. if ( this.lastSlide.hasBG ) {
  6824. this.lastSlide.$imgcont[0].style[window._jcsspfx + 'Transform'] = '';
  6825. }
  6826. } else {
  6827. if( layers ){
  6828. layers[0].style.top = '';
  6829. }
  6830. if ( this.lastSlide.hasBG ) {
  6831. this.lastSlide.$imgcont[0].style.top = '0px';
  6832. }
  6833. }
  6834. };
  6835. p.updateCurrentSlide = function (e) {
  6836. this.lastSlide = this.currentSlide;
  6837. this.currentSlide = this.slider.api.currentSlide;
  6838. this.moveParallax({data:{that:this}});
  6839. };
  6840. p.moveParallax = function (e) {
  6841. var that = e.data.that,
  6842. slider = that.slider,
  6843. offset = that.sliderOffset,
  6844. scrollTop = $(window).scrollTop(),
  6845. layers = that.currentSlide.$scrollParallaxCont,
  6846. out = offset - scrollTop;
  6847. if( out <= 0 ) {
  6848. if( layers ){
  6849. if ( window._css3d ) {
  6850. layers[0].style[window._jcsspfx + 'Transform'] = 'translateY(' + -out * that.parallax + 'px) translateZ(0.4px)';
  6851. } else if ( window._css2d ){
  6852. layers[0].style[window._jcsspfx + 'Transform'] = 'translateY(' + -out * that.parallax + 'px)';
  6853. } else {
  6854. layers[0].style.top = -out * that.parallax + 'px';
  6855. }
  6856. }
  6857. that.updateSlidesBG(-out * that.bgparallax + 'px', true);
  6858. if ( layers && that.fade ) {
  6859. layers.css('opacity', (1 - Math.min(1, -out / slider.api.height)) );
  6860. }
  6861. } else {
  6862. if( layers ){
  6863. if ( window._css2d ) {
  6864. layers[0].style[window._jcsspfx + 'Transform'] = '';
  6865. } else {
  6866. layers[0].style.top = '';
  6867. }
  6868. }
  6869. that.updateSlidesBG('0px', false);
  6870. if ( layers && that.fade ) {
  6871. layers.css('opacity', 1 );
  6872. }
  6873. }
  6874. };
  6875. p.updateSlidesBG = function(pos, fixed) {
  6876. var slides = this.slider.api.view.slideList,
  6877. position = ( fixed && !$.browser.msie && !$.browser.opera ? 'fixed' : '');
  6878. for(var i = 0, l = slides.length; i!==l ; i++) {
  6879. if ( slides[i].hasBG ) {
  6880. slides[i].$imgcont[0].style.position = position;
  6881. slides[i].$imgcont[0].style.top = pos;
  6882. }
  6883. if ( slides[i].$bgvideocont ){
  6884. slides[i].$bgvideocont[0].style.position = position;
  6885. slides[i].$bgvideocont[0].style.top = pos;
  6886. }
  6887. }
  6888. };
  6889. p.destory = function () {
  6890. slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this);
  6891. slider.api.removeEventListener(MSSliderEvent.DESTROY, this.destory, this);
  6892. slider.api.removeEventListener(MSSliderEvent.CHANGE_END, this.resetLayers, this);
  6893. slider.api.removeEventListener(MSSliderEvent.CHANGE_START, this.updateCurrentSlide, this);
  6894. $(window).off('scroll', this.moveParallax);
  6895. };
  6896. })(jQuery);
  6897. /* ================== bin-debug/js/pro/plugins/MSKeyboardNav.js =================== */
  6898. /**
  6899. * Keyboard navigation plugin for Master Slider.
  6900. * @version 1.0.0
  6901. * @author Averta
  6902. * @package MasterSlider jQuery
  6903. */
  6904. ;(function($, document, window){
  6905. var PId = 0;
  6906. // check if master slider is available
  6907. if ( !window.MasterSlider ) {
  6908. return;
  6909. }
  6910. var KeyboardNav = function ( slider ) {
  6911. this.slider = slider;
  6912. this.PId = PId++;
  6913. if ( this.slider.options.keyboard ) {
  6914. slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
  6915. }
  6916. };
  6917. KeyboardNav.name = 'MSKeyboardNav';
  6918. var p = KeyboardNav.prototype;
  6919. /**
  6920. * initiate the plugin
  6921. */
  6922. p.init = function (){
  6923. var api = this.slider.api;
  6924. $(document).on('keydown.kbnav' + this.PId , function(event){
  6925. var which = event.which;
  6926. if ( which === 37 || which === 40 ) {
  6927. api.previous(true);
  6928. } else if ( which === 38 || which === 39 ) {
  6929. api.next(true);
  6930. }
  6931. });
  6932. };
  6933. /**
  6934. * destroy the plugin
  6935. */
  6936. p.destroy = function(){
  6937. $(document).off('keydown.kbnav' + this.PId);
  6938. this.slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this);
  6939. };
  6940. // install plugin to master slider
  6941. MasterSlider.registerPlugin( KeyboardNav );
  6942. })(jQuery, document, window);
  6943. /* ================== bin-debug/js/pro/plugins/MSStartOnAppear.js =================== */
  6944. /**
  6945. * Start on appear plugin for Master Slider.
  6946. *
  6947. * @description This plugin prevents slider automatically initialization and inits slider when it appears inside of the browser window.
  6948. * @version 1.0.0
  6949. * @author Averta
  6950. * @package MasterSlider jQuery
  6951. */
  6952. ;(function($, document, window){
  6953. var PId = 0,
  6954. $window = $(window),
  6955. $doc = $(document);
  6956. // check if master slider is available
  6957. if ( !window.MasterSlider ) {
  6958. return;
  6959. }
  6960. var StartOnAppear = function ( slider ) {
  6961. this.PId = PId++;
  6962. this.slider = slider;
  6963. this.$slider = slider.$element;
  6964. if ( this.slider.options.startOnAppear ) {
  6965. // hold on slider
  6966. slider.holdOn();
  6967. $doc.ready($.proxy(this.init, this));
  6968. }
  6969. };
  6970. StartOnAppear.name = 'MSStartOnAppear';
  6971. var p = StartOnAppear.prototype;
  6972. /**
  6973. * initiate the plugin
  6974. */
  6975. p.init = function (){
  6976. var api = this.slider.api;
  6977. $window.on('scroll.soa' + this.PId , $.proxy(this._onScroll, this)).trigger('scroll');
  6978. };
  6979. p._onScroll = function () {
  6980. // check slider position
  6981. var vpBottom = $window.scrollTop() + $window.height(),
  6982. top = this.$slider.offset().top ;
  6983. if ( top < vpBottom ) {
  6984. $window.off('scroll.soa' + this.PId);
  6985. this.slider.release();
  6986. }
  6987. };
  6988. /**
  6989. * destroy the plugin
  6990. */
  6991. p.destroy = function(){};
  6992. // install plugin to master slider
  6993. MasterSlider.registerPlugin( StartOnAppear );
  6994. })(jQuery, document, window);
  6995. /* ================== bin-debug/js/pro/plugins/MSFilters.js =================== */
  6996. /**
  6997. * Master Slider Filters Plugin
  6998. * 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.
  6999. *
  7000. * @package Master Slider jQuery
  7001. * @author Averta
  7002. * @version 1.0.0a
  7003. */
  7004. ;(function (document, window, jQuery){
  7005. var filterUnits = {
  7006. 'hue-rotate' : 'deg',
  7007. 'blur' : 'px'
  7008. }, initialValues = {
  7009. 'opacity' : 1,
  7010. 'contrast' : 1,
  7011. 'brightness' : 1,
  7012. 'saturate' : 1,
  7013. 'hue-rotate' : 0,
  7014. 'invert' : 0,
  7015. 'sepia' : 0,
  7016. 'blur' : 0,
  7017. 'grayscale' : 0
  7018. }
  7019. // check if master slider is available
  7020. if ( !window.MasterSlider ) {
  7021. return;
  7022. }
  7023. var Filters = function ( slider ) {
  7024. this.slider = slider;
  7025. if ( this.slider.options.filters ) {
  7026. slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
  7027. }
  7028. };
  7029. Filters.name = 'MSFilters';
  7030. var p = Filters.prototype;
  7031. /**
  7032. * initiate the plugin
  7033. */
  7034. p.init = function (){
  7035. var api = this.slider.api,
  7036. view = api.view;
  7037. this.filters = this.slider.options.filters;
  7038. this.slideList = view.slideList;
  7039. this.slidesCount = view.slidesCount;
  7040. this.dimension = view[view.__dimension];
  7041. this.target = this.slider.options.filterTarget === 'slide' ? '$element' : '$bg_img';
  7042. this.filterName = $.browser.webkit ? 'WebkitFilter' : 'filter';
  7043. // override controller update callback
  7044. var superFun = view.controller.__renderHook.fun,
  7045. superRef = view.controller.__renderHook.ref;
  7046. view.controller.renderCallback( function (controller, value) {
  7047. superFun.call(superRef, controller, value);
  7048. this.applyEffect(value);
  7049. } , this);
  7050. this.applyEffect(view.controller.value);
  7051. };
  7052. /**
  7053. * Apply css effect to slides based on slide position.
  7054. * @param {Number} value Current position of slider controller
  7055. */
  7056. p.applyEffect = function (value) {
  7057. var factor, slide;
  7058. for( var i = 0; i < this.slidesCount; ++i ) {
  7059. slide = this.slideList[i];
  7060. factor = Math.min(1 , Math.abs(value - slide.position) / this.dimension);
  7061. if ( slide[this.target] ) {
  7062. if ( !$.browser.msie ) {
  7063. slide[this.target][0].style[this.filterName] = this.generateStyle(factor);
  7064. } else if ( this.filters.opacity != null ) {
  7065. slide[this.target].opacity( 1 - this.filters.opacity * factor);
  7066. }
  7067. }
  7068. }
  7069. };
  7070. /**
  7071. * Generate filter style based on slide distance factor
  7072. * @param {Number} factor
  7073. * @return {String} CSS style
  7074. */
  7075. p.generateStyle = function (factor) {
  7076. var style = '',
  7077. unit;
  7078. for ( var filter in this.filters ) {
  7079. unit = filterUnits[filter] || '';
  7080. style += filter + '(' + ( initialValues[filter] + (this.filters[filter] - initialValues[filter]) * factor) + ') ';
  7081. }
  7082. return style;
  7083. };
  7084. /**
  7085. * destroy the plugin
  7086. */
  7087. p.destroy = function(){
  7088. this.slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this);
  7089. };
  7090. // install plugin to master slider
  7091. MasterSlider.registerPlugin( Filters );
  7092. })(document, window, jQuery);
  7093. /* ================== bin-debug/js/pro/plugins/MSScrollToAction.js =================== */
  7094. /**
  7095. * Master Slider Scroll To Action Plugin.
  7096. *
  7097. * @description This plugins adds page scrolling actions to the layer actions list.
  7098. * @version 1.0.0
  7099. * @author Averta
  7100. * @package MasterSlider jQuery
  7101. */
  7102. ;(function($, document, window){
  7103. // check if master slider is available
  7104. if ( !window.MasterSlider ) {
  7105. return;
  7106. }
  7107. var ScrollToAction = function ( slider ) {
  7108. this.slider = slider;
  7109. slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
  7110. };
  7111. ScrollToAction.name = 'MSScrollToAction';
  7112. var p = ScrollToAction.prototype;
  7113. /**
  7114. * initiate the plugin
  7115. */
  7116. p.init = function (){
  7117. var api = this.slider.api;
  7118. // define actions
  7119. api.scrollToEnd = _scrollToEnd;
  7120. api.scrollTo = _scrollTo;
  7121. };
  7122. /**
  7123. * destroy the plugin
  7124. */
  7125. p.destroy = function(){};
  7126. /**
  7127. * Scroll window to the target element in page
  7128. * @param {Number} duration animation duration (seconds)
  7129. */
  7130. var _scrollTo = function ( target, duration ) {
  7131. var sliderEle = this.slider.$element,
  7132. target = $(target).eq(0);
  7133. if ( target.length === 0 ) {
  7134. return;
  7135. }
  7136. console.log(target.offset().top, duration )
  7137. if( duration == null ) {
  7138. duration = 1.4;
  7139. }
  7140. $('html, body').animate({
  7141. scrollTop: target.offset().top
  7142. }, duration * 1000, 'easeInOutQuad');
  7143. };
  7144. /**
  7145. * Scroll window to the bottom of slider
  7146. * @param {Number} duration animation duration (seconds)
  7147. */
  7148. var _scrollToEnd = function ( duration ) {
  7149. var sliderEle = this.slider.$element;
  7150. if( duration == null ) {
  7151. duration = 1.4;
  7152. }
  7153. $('html, body').animate({
  7154. scrollTop: sliderEle.offset().top + sliderEle.outerHeight(false)
  7155. }, duration * 1000, 'easeInOutQuad');
  7156. }
  7157. // install plugin to master slider
  7158. MasterSlider.registerPlugin( ScrollToAction );
  7159. })(jQuery, document, window);