1(function($) 2{"use strict";$.AviaSlider=function(options,slider) 3{var self=this;this.$win=$(window);this.$slider=$(slider);this.isMobile=$.avia_utilities.isMobile;this._prepareSlides(options);$.avia_utilities.preload({container:this.$slider,single_callback:function(){self._init(options);}});} 4$.AviaSlider.defaults={interval:5,autoplay:false,stopinfiniteloop:false,animation:'slide',transitionSpeed:900,easing:'easeInOutQuart',wrapElement:'>ul',slideElement:'>li',hoverpause:false,bg_slider:false,show_slide_delay:0,fullfade:false,carousel:'no',carouselSlidesToShow:3,carouselSlidesToScroll:1,carouselResponsive:new Array(),};$.AviaSlider.prototype={_init:function(options) 5{this.options=this._setOptions(options);this.$sliderUl=this.$slider.find(this.options.wrapElement);this.$slides=this.$sliderUl.find(this.options.slideElement);this.gotoButtons=this.$slider.find('.avia-slideshow-dots a');this.permaCaption=this.$slider.find('>.av-slideshow-caption');this.itemsCount=this.$slides.length;this.current=0;this.currentCarousel=0;this.slideWidthCarousel='240';this.loopCount=0;this.isAnimating=false;this.browserPrefix=$.avia_utilities.supports('transition');this.cssActive=this.browserPrefix!==false?true:false;this.css3DActive=document.documentElement.className.indexOf('avia_transform3d')!==-1?true:false;if(this.options.bg_slider==true) 6{this.imageUrls=[];this.loader=$.avia_utilities.loading(this.$slider);this._bgPreloadImages();} 7else 8{this._kickOff();} 9if(this.options.carousel==='yes'){this.options.animation='carouselslide';}},_setOptions:function(options) 10{var newOptions=$.extend(true,{},$.AviaSlider.defaults,options),htmlData=this.$slider.data(),i="";for(i in htmlData) 11{if(htmlData.hasOwnProperty(i)) 12{if(typeof htmlData[i]==="string"||typeof htmlData[i]==="number"||typeof htmlData[i]==="boolean") 13{newOptions[i]=htmlData[i];}}} 14return newOptions;},_prepareSlides:function(options) 15{if(this.isMobile) 16{var alter=this.$slider.find('.av-mobile-fallback-image');alter.each(function() 17{var current=$(this).removeClass('av-video-slide').data({'avia_video_events':true,'video-ratio':0}),fallback=current.data('mobile-img'),fallback_link=current.data('fallback-link'),appendTo=current.find('.avia-slide-wrap');current.find('.av-click-overlay, .mejs-mediaelement, .mejs-container').remove();if(!fallback) 18{$('<p class="av-fallback-message"><span>Please set a mobile device fallback image for this video in your wordpress backend</span></p>').appendTo(appendTo);} 19if(options&&options.bg_slider) 20{current.data('img-url',fallback);if(fallback_link!="") 21{if(appendTo.is('a')) 22{appendTo.attr('href',fallback_link);} 23else 24{appendTo.find('a').remove();appendTo.replaceWith(function(){var cur_slide=$(this);return $("<a>").attr({'data-rel':cur_slide.data('rel'),'class':cur_slide.attr('class'),'href':fallback_link}).append($(this).contents());});appendTo=current.find('.avia-slide-wrap');} 25if($.fn.avia_activate_lightbox) 26{current.parents('#main').avia_activate_lightbox();}}} 27else 28{var image=$('<img src="'+fallback+'" alt="" title="" />');var lightbox=false;if('string'==typeof fallback_link&&fallback_link.trim()!='') 29{image=$('<a href="'+fallback_link.trim()+'" rel="lightbox">'+image+'</a>');lightbox=true;} 30if(lightbox&&$.fn.avia_activate_lightbox) 31{current.parents('#main').avia_activate_lightbox();} 32current.find('.avia-slide-wrap').append(image);}});}},_bgPreloadImages:function(callback) 33{this._getImageURLS();this._preloadSingle(0,function() 34{this._kickOff();this._preloadNext(1);});},_getImageURLS:function() 35{var _self=this;this.$slides.each(function(i) 36{_self.imageUrls[i]=[];_self.imageUrls[i]['url']=$(this).data("img-url");if(typeof _self.imageUrls[i]['url']=='string') 37{_self.imageUrls[i]['status']=false;} 38else 39{_self.imageUrls[i]['status']=true;}});},_preloadSingle:function(key,callback) 40{var _self=this,objImage=new Image();if(typeof _self.imageUrls[key]['url']=='string') 41{$(objImage).bind('load error',function() 42{_self.imageUrls[key]['status']=true;_self.$slides.eq(key).css('background-image','url('+_self.imageUrls[key]['url']+')');if(typeof callback=='function')callback.apply(_self,[objImage,key]);});if(_self.imageUrls[key]['url']!="") 43{objImage.src=_self.imageUrls[key]['url'];} 44else 45{$(objImage).trigger('error');}} 46else 47{if(typeof callback=='function')callback.apply(_self,[objImage,key]);}},_preloadNext:function(key) 48{if(typeof this.imageUrls[key]!="undefined") 49{this._preloadSingle(key,function() 50{this._preloadNext(key+1);});}},_bindEvents:function() 51{var self=this,win=$(window);this.$slider.on('click','.next-slide',$.proxy(this.next,this));this.$slider.on('click','.prev-slide',$.proxy(this.previous,this));this.$slider.on('click','.goto-slide',$.proxy(this.go2,this));if(this.options.hoverpause) 52{this.$slider.on('mouseenter',$.proxy(this.pause,this));this.$slider.on('mouseleave',$.proxy(this.resume,this));} 53if(this.options.stopinfiniteloop&&this.options.autoplay) 54{if(this.options.stopinfiniteloop=='last') 55{this.$slider.on('avia_slider_last_slide',$.proxy(this._stopSlideshow,this));} 56else if(this.options.stopinfiniteloop=='first') 57{this.$slider.on('avia_slider_first_slide',$.proxy(this._stopSlideshow,this));}} 58if(this.options.carousel==='yes'){win.on('debouncedresize',$.proxy(this._buildCarousel,this));} 59else{win.on('debouncedresize.aviaSlider',$.proxy(this._setSize,this));} 60if(!this.isMobile) 61{this.$slider.avia_keyboard_controls();} 62else 63{this.$slider.avia_swipe_trigger();} 64self._attach_video_events();},_kickOff:function() 65{var self=this,first_slide=self.$slides.eq(0),video=first_slide.data('video-ratio');self._bindEvents();this.$slider.removeClass('av-default-height-applied');if(video) 66{self._setSize(true);} 67else 68{if(this.options.keep_pading!=true) 69{self.$sliderUl.css('padding',0);self.$win.trigger('av-height-change');}} 70self._setCenter();if(this.options.carousel==='no'){first_slide.css({visibility:'visible',opacity:0}
70).avia_animate({opacity:1},function() 71{var current=$(this).addClass('active-slide');if(self.permaCaption.length) 72{self.permaCaption.addClass('active-slide');}});} 73if(self.options.autoplay) 74{self._startSlideshow();} 75if(self.options.carousel==='yes'){self._buildCarousel();} 76self.$slider.trigger('_kickOff');},_buildCarousel:function(){var self=this,stageWidth=this.$slider.outerWidth(),slidesWidth=parseInt(stageWidth/this.options.carouselSlidesToShow),windowWidth=window.innerWidth||$(window).width();if(this.options.carouselResponsive&&this.options.carouselResponsive.length&&this.options.carouselResponsive!==null){for(var breakpoint in this.options.carouselResponsive){var breakpointValue=this.options.carouselResponsive[breakpoint]['breakpoint'];var newSlidesToShow=this.options.carouselResponsive[breakpoint]['settings']['carouselSlidesToShow'];if(breakpointValue>=windowWidth){slidesWidth=parseInt(stageWidth/newSlidesToShow);this.options.carouselSlidesToShow=newSlidesToShow;}}} 77this.slideWidthCarousel=slidesWidth;this.$slides.each(function(i){$(this).width(slidesWidth);});var slideTrackWidth=slidesWidth*this.itemsCount;this.$sliderUl.width(slideTrackWidth).css('transform','translateX(0px)');if(this.options.carouselSlidesToShow>=this.itemsCount){this.$slider.find('.av-timeline-nav').hide();}},_navigate:function(dir,pos){if(this.isAnimating||this.itemsCount<2Â ||!this.$slider.is(":visible")) 78{return false;} 79this.isAnimating=true;this.prev=this.current;if(pos!==undefined) 80{this.current=pos;dir=this.current>this.prev?'next':'prev';} 81else if(dir==='next') 82{this.current=this.current<this.itemsCount-1?this.current+1:0;if(this.current===0&&this.options.autoplay_stopper==1&&this.options.autoplay) 83{this.isAnimating=false;this.current=this.prev;this._stopSlideshow();return false;}} 84else if(dir==='prev') 85{this.current=this.current>0?this.current-1:this.itemsCount-1;} 86this.gotoButtons.removeClass('active').eq(this.current).addClass('active');if(this.options.carousel==='no'){this._setSize();} 87if(this.options.bg_slider==true) 88{if(this.imageUrls[this.current]['status']==true) 89{this['_'+this.options.animation].call(this,dir);} 90else 91{this.loader.show();this._preloadSingle(this.current,function() 92{this['_'+this.options.animation].call(this,dir);this.loader.hide();});}} 93else 94{this['_'+this.options.animation].call(this,dir);} 95if(this.current==0) 96{this.loopCount++;this.$slider.trigger('avia_slider_first_slide');} 97else if(this.current==this.itemsCount-1) 98{this.$slider.trigger('avia_slider_last_slide');} 99else 100{this.$slider.trigger('avia_slider_navigate_slide');}},_setSize:function(instant) 101{if(this.options.bg_slider==true)return;var self=this,slide=this.$slides.eq(this.current),img=slide.find('img'),current=Math.floor(this.$sliderUl.height()),ratio=slide.data('video-ratio'),setTo=ratio?this.$sliderUl.width()/ratio:Math.floor(slide.height()),video_height=slide.data('video-height'),video_toppos=slide.data('video-toppos');this.$sliderUl.height(current).css('padding',0);if(setTo!=current) 102{if(instant==true) 103{this.$sliderUl.css({height:setTo});this.$win.trigger('av-height-change');} 104else 105{this.$sliderUl.avia_animate({height:setTo},function() 106{self.$win.trigger('av-height-change');});}} 107this._setCenter();if(video_height&&video_height!="set") 108{slide.find('iframe, embed, video, object, .av_youtube_frame').css({height:video_height+'%',top:video_toppos+'%'});slide.data('video-height','set');}},_setCenter:function() 109{var slide=this.$slides.eq(this.current),img=slide.find('img'),min_width=parseInt(img.css('min-width'),10),slide_width=slide.width(),caption=slide.find('.av-slideshow-caption'),css_left=((slide_width-min_width)/2);if(caption.length) 110{if(caption.is('.caption_left')) 111{css_left=((slide_width-min_width)/1.5);} 112else if(caption.is('.caption_right')) 113{css_left=((slide_width-min_width)/2.5);}} 114if(slide_width>=min_width) 115{css_left=0;} 116img.css({left:css_left});},_carouselmove:function(){var offset=this.slideWidthCarousel*this.currentCarousel;this.$sliderUl.css('transform','translateX(-'+offset+'px)');},_carouselslide:function(dir){if(dir==='next'){if(this.options.carouselSlidesToShow+this.currentCarousel<this.itemsCount){this.currentCarousel++;this._carouselmove();}} 117else if(dir==='prev'){if(this.currentCarousel>0){this.currentCarousel--;this._carouselmove();}} 118this.isAnimating=false;},_slide:function(dir) 119{var dynamic=false,modifier=dynamic==true?2:1,sliderWidth=this.$slider.width(),direction=dir==='next'?-1:1,property=this.browserPrefix+'transform',reset={},transition={},transition2={},trans_val=(sliderWidth*direction*-1),trans_val2=(sliderWidth*direction)/modifier;if(this.cssActive) 120{property=this.browserPrefix+'transform';if(this.css3DActive) 121{reset[property]="translate3d("+trans_val+"px, 0, 0)";transition[property]="translate3d("+trans_val2+"px, 0, 0)";
121transition2[property]="translate3d(0,0,0)";} 122else 123{reset[property]="translate("+trans_val+"px,0)";transition[property]="translate("+trans_val2+"px,0)";transition2[property]="translate(0,0)";}} 124else 125{reset.left=trans_val;transition.left=trans_val2;transition2.left=0;} 126if(dynamic) 127{transition['z-index']="1";transition2['z-index']="2";} 128this._slide_animate(reset,transition,transition2);},_slide_up:function(dir) 129{var dynamic=true,modifier=dynamic==true?2:1,sliderHeight=this.$slider.height(),direction=dir==='next'?-1:1,property=this.browserPrefix+'transform',reset={},transition={},transition2={},trans_val=(sliderHeight*direction*-1),trans_val2=(sliderHeight*direction)/modifier;if(this.cssActive) 130{property=this.browserPrefix+'transform';if(this.css3DActive) 131{reset[property]="translate3d( 0,"+trans_val+"px, 0)";transition[property]="translate3d( 0,"+trans_val2+"px, 0)";transition2[property]="translate3d(0,0,0)";} 132else 133{reset[property]="translate( 0,"+trans_val+"px)";transition[property]="translate( 0,"+trans_val2+"px)";transition2[property]="translate(0,0)";}} 134else 135{reset.top=trans_val;transition.top=trans_val2;transition2.top=0;} 136if(dynamic) 137{transition['z-index']="1";transition2['z-index']="2";} 138this._slide_animate(reset,transition,transition2);},_slide_animate:function(reset,transition,transition2) 139{var self=this,displaySlide=this.$slides.eq(this.current),hideSlide=this.$slides.eq(this.prev);hideSlide.trigger('pause');if(!displaySlide.data('disableAutoplay')){if(displaySlide.hasClass('av-video-lazyload')&&!displaySlide.hasClass('av-video-lazyload-complete')) 140{displaySlide.find('.av-click-to-play-overlay').trigger('click');} 141else 142{displaySlide.trigger('play');}} 143displaySlide.css({visibility:'visible',zIndex:4,opacity:1,left:0,top:0});
143displaySlide.css(reset);hideSlide.avia_animate(transition,this.options.transitionSpeed,this.options.easing);var after_slide=function() 144{self.isAnimating=false;displaySlide.addClass('active-slide');hideSlide.css({visibility:'hidden'}).removeClass('active-slide');self.$slider.trigger('avia-transition-done');} 145if(self.options.show_slide_delay>0) 146{setTimeout(function(){displaySlide.avia_animate(transition2,self.options.transitionSpeed,self.options.easing,after_slide);},self.options.show_slide_delay);} 147else 148{displaySlide.avia_animate(transition2,self.options.transitionSpeed,self.options.easing,after_slide);}},_fade:function() 149{var self=this,displaySlide=this.$slides.eq(this.current),hideSlide=this.$slides.eq(this.prev),properties={visibility:'visible',zIndex:3,opacity:0},fadeCallback=function() 150{self.isAnimating=false;displaySlide.addClass('active-slide');hideSlide.css({visibility:'hidden',zIndex:2}).removeClass('active-slide');self.$slider.trigger('avia-transition-done');};hideSlide.trigger('pause');if(!displaySlide.data('disableAutoplay')){if(displaySlide.hasClass('av-video-lazyload')&&!displaySlide.hasClass('av-video-lazyload-complete')) 151{displaySlide.find('.av-click-to-play-overlay').trigger('click');} 152else 153{displaySlide.trigger('play');}} 154if(self.options.fullfade==true) 155{hideSlide.avia_animate({opacity:0}
155,200,'linear',function() 156{displaySlide.css(properties).avia_animate({opacity:1},self.options.transitionSpeed,'linear',fadeCallback);});} 157else 158{displaySlide.css(properties).avia_animate({opacity:1},self.options.transitionSpeed/2,'linear',function() 159{hideSlide.avia_animate({opacity:0},200,'linear',fadeCallback);});}},_attach_video_events:function() 160{var self=this,$html=$('html');self.$slides.each(function(i) 161{var currentSlide=$(this),caption=currentSlide.find('.caption_fullwidth, .av-click-overlay'),mejs=currentSlide.find('.mejs-mediaelement'),lazyload=currentSlide.hasClass('av-video-lazyload')?true:false;if(currentSlide.data('avia_video_events')!=true) 162{currentSlide.data('avia_video_events',true);currentSlide.on('av-video-events-bound',{slide:currentSlide,wrap:mejs,iteration:i,self:self,lazyload:lazyload},onReady);currentSlide.on('av-video-ended',{slide:currentSlide,self:self},onFinish);currentSlide.on('av-video-play-executed',function(){setTimeout(function(){self.pause()},100);});caption.on('click',{slide:currentSlide},toggle);if(currentSlide.is('.av-video-events-bound'))currentSlide.trigger('av-video-events-bound');if(lazyload&&i===0&&!currentSlide.data('disableAutoplay')) 163{currentSlide.find('.av-click-to-play-overlay').trigger('click');}}});function onReady(event) 164{if(event.data.iteration===0) 165{event.data.wrap.css('opacity',0);if(!event.data.self.isMobile&&!event.data.slide.data('disableAutoplay')) 166{event.data.slide.trigger('play');}Â 167setTimeout(function(){event.data.wrap.avia_animate({opacity:1},400);},50);} 168else if($html.is('.avia-msie')&&!event.data.slide.is('.av-video-service-html5')) 169{if(!event.data.slide.data('disableAutoplay'))event.data.slide.trigger('play');} 170if(event.data.slide.is('.av-video-service-html5')&&event.data.iteration!==0) 171{event.data.slide.trigger('pause');} 172if(event.data.lazyload) 173{event.data.slide.addClass('av-video-lazyload-complete');event.data.slide.trigger('play');}} 174function onFinish(event) 175{if(!event.data.slide.is('.av-single-slide')&&!event.data.slide.is('.av-loop-video')) 176{event.data.slide.trigger('reset');self._navigate('next');self.resume();} 177if(event.data.slide.is('.av-loop-video')&&event.data.slide.is('.av-video-service-html5')) 178{if($html.is('.avia-safari-8')) 179{setTimeout(function(){event.data.slide.trigger('play');},1);}}} 180function toggle(event) 181{if(event.target.tagName!="A") 182{event.data.slide.trigger('toggle');}}},_timer:function(callback,delay,first) 183{var self=this,start,remaining=delay;self.timerId=0;this.pause=function(){window.clearTimeout(self.timerId);remaining-=new Date()-start;};this.resume=function(){start=new Date();self.timerId=window.setTimeout(callback,remaining);};this.destroy=function() 184{window.clearTimeout(self.timerId);};this.resume(true);},_startSlideshow:function() 185{var self=this;this.isPlaying=true;this.slideshow=new this._timer(function() 186{self._navigate('next');if(self.options.autoplay) 187{self._startSlideshow();}},(this.options.interval*1000));},_stopSlideshow:function() 188{if(this.options.autoplay){this.slideshow.destroy();this.isPlaying=false;this.options.autoplay=false;}},next:function(e) 189{e.preventDefault();this._stopSlideshow();this._navigate('next');},previous:function(e) 190{e.preventDefault();this._stopSlideshow();this._navigate('prev');},go2:function(pos) 191{if(isNaN(pos)) 192{pos.preventDefault();pos=pos.currentTarget.hash.replace('#','');} 193pos-=1;if(pos===this.current||pos>=this.itemsCount||pos<0) 194{return false;} 195this._stopSlideshow();this._navigate(false,pos);},play:function() 196{if(!this.isPlaying) 197{this.isPlaying=true;this._navigate('next');this.options.autoplay=true;this._startSlideshow();}},pause:function() 198{if(this.isPlaying) 199{this.slideshow.pause();}},resume:function() 200{if(this.isPlaying) 201{this.slideshow.resume();}},destroy:function(callback) 202{this.slideshow.destroy(callback);}} 203$.fn.aviaSlider=function(options) 204{return this.each(function() 205{var self=$.data(this,'aviaSlider');if(!self) 206{self=$.data(this,'aviaSlider',new $.AviaSlider(options,this));}});}})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.