PageSourceSearch

https://www.brosserie-desjardins.com/wp-content/plugins/6tem9Carousel/scripts/carousel.fo.6tem9.js

js brosserie-desjardins.com collected 2026-10-03 02:31:43 UTC 10,583 bytes, 260 lines download raw bytes

1(function($){       
2    
3    // ---------------------------------------------------------------------------------------
4    // Define a clickable zone to open a new page
5    $.fn.slideHover = function(){
6        $(this).mouseover(function(){
7            $(this).addClass("slideHover");
8        }).mouseout(function(){
9            $(this).removeClass("slideHover")
10        ///**migrate/;}).click(function(e){
11        ;}).on('click',function(e){
12            
13            var openLinkIn = $(this).find('img').attr("data-openLinkIn");
14
15            // Open in the same page
16            document.location.href = $(this).find('img').attr("data-slideLink");
17
18            e.preventDefault();
19        });
20        
21    };
22    
23}(jQuery));
24
25jQuery(document).ready(function() {
26
27    if(jQuery('.carousel6tem9').hasClass('owl-carousel'))
28    {
29        // We get the carousel options
30        var tabOptionCarousel = scriptParams;
31
32        var owl = fCreateCarousel(tabOptionCarousel);
33        fLoadCarouselGesture(owl,tabOptionCarousel);
34    }
35    
36    // ---------------------------------------------------------------------------
37    // Carousel creation
38    function fCreateCarousel(tabOptionCarousel)
39    {
40
41        // List of all options
42        var optionActivateAutoplay = tabOptionCarousel.autoplay.activate;
43        var optionAutoplayStopOnHover = tabOptionCarousel.autoplay.stopOnHover;
44        var optionAutoplayWaitBetweenSlide = tabOptionCarousel.autoplay.waitBetweenSlide;
45        var optionSpeed = tabOptionCarousel.speed;
46        var optionTransitionEffect = tabOptionCarousel.transitionEffect;
47
48        var owl = jQuery('.carousel6tem9');
49
50        owl.imagesLoaded(function () {
51            // OWL Carousel gesture
52            owl.owlCarousel({
53                // autoHeight:true,
54                autoplay: optionActivateAutoplay,
55                autoplayTimeout: optionAutoplayWaitBetweenSlide,
56                autoplayHoverPause: optionAutoplayStopOnHover,
57                items: 1,
58                lazyLoad: false,
59                autoplaySpeed: optionSpeed,
60                smartSpeed: optionSpeed,
61                fluidSpeed: optionSpeed,
62                autoHeight: true,
63                animateOut: optionTransitionEffect,
64                // lazyLoad: true,
65                // margin: 10,
66                loop: true,
67                dots: true,
68                slideSpeed: 4000,
69                // merge:true,
70                // video:true,
71                singleItem: true,
72                center: true
73            });        
74        });
75        
76        return owl;
77    }
78
79    // ---------------------------------------------------------------------------
80    // Gesture and events on the carousel
81    function fLoadCarouselGesture(owl,tabOptionCarousel) {
82
83        // List of all options
84        var optionActivateAutoplay = tabOptionCarousel.autoplay.activate;
85        var optionAutoplayStopOnHover = tabOptionCarousel.autoplay.stopOnHover;
86        var optionAutoplayWaitBetweenSlide = tabOptionCarousel.autoplay.waitBetweenSlide;
87        var optionSpeed = tabOptionCarousel.speed;
88
89        // The super container, containing the carousel and the single image if there is only one image
90        var carouselGlobalContainer = jQuery("#carouselGlobalContainer");
91        
92
93        // FIX - Set the video height depending on the calculated image height
94        // PROBLEM if no image in the slide
95        owl.on('resized.owl.carousel', function (event) {
96
97            jQuery(this).find('.item-video').css('height', jQuery(this).find('.photoSlide').height());
98
99            // Restart loader on resize
100            if(optionActivateAutoplay)
101            {
102                jQuery(".progressBar").stop().animate({width: "0%"}, 0);
103                jQuery(".progressBar").stop().animate({width: "100%"}, optionAutoplayWaitBetweenSlide);
104            }            
105        });
106
107        owl.on('resized.owl.carousel', function(event) {
108            owl.trigger('next.owl.carousel');
109        });
110
111        owl.on('initialize.owl.carousel', function(event) {
112            owl.trigger('refresh.owl.carousel');
113        });
114
115        // Show the next/previous buttons after the carousel initialisation
116        imagesLoaded( document.querySelector('.carousel6tem9'), function( instance ) {
117            jQuery('#carouselControlRight , #carouselControlLeft').show();
118            jQuery('#containerCarousel .progressBar').show();
119        });
120
121        if ( document.querySelector('.carousel6tem9') != null )
122        {
123            imagesLoaded( document.querySelector('.carousel6tem9'), function( instance ) {
124                owl.find('.item-video').css('height', owl.find('.photoSlide').height());
125            });
126        }
127
128        // Click gesture on slide for opening links
129        if(carouselGlobalContainer.find(".photoSlide").hasClass("linkable"))
130            carouselGlobalContainer.find(".photoSlide.linkable").slideHover();
131
132        // ------------------------------------------------------------
133        // OWL Carousel Events
134
135        // Animate text on slide
136
137        var animation = carouselGlobalContainer.find('.owl-item.active .slideCaption').data('animation');
138
139        if ( animation == undefined )
140            animation = 'fadeInUp';
141
142        // ------------------------------------------------------------
143        // Initialisation
144
145        // Hide and reset all others
146        
147        jQuery.each(carouselGlobalContainer.find('.owl-item'), function() {  
148            carouselGlobalContainer.find('h3.textCaption').removeClass().addClass('textCaption');
149            carouselGlobalContainer.find('p.textCaption').removeClass().addClass('textCaption');
150            // carouselGlobalContainer.find('a.slideButton').removeClass().addClass('slideButton btn btn-lg btn-default');
151
152            carouselGlobalContainer.find('h3.textCaption').hide();
153            carouselGlobalContainer.find('p.textCaption').hide();
154            carouselGlobalContainer.find('a.slideButton').hide();
155        });
156
157        // Animate first slide
158
159        carouselGlobalContainer.find('.owl-item.active h3.textCaption').addClass('animated '+animation);
160        carouselGlobalContainer.find('.owl-item.active p.textCaption').addClass('animated '+animation);
161        carouselGlobalContainer.find('.owl-item.active a.slideButton').addClass('animated '+animation);
162
163        carouselGlobalContainer.find('.owl-item.active h3.textCaption').show();
164        carouselGlobalContainer.find('.owl-item.active p.textCaption').show();
165        carouselGlobalContainer.find('.owl-item.active a.slideButton').show();
166
167        // ------------------------------------------------------------
168        // On translate
169
170        owl.on('translated.owl.carousel', function(e) {
171            
172            animation = carouselGlobalContainer.find('.owl-item.active').find('.slideCaption').data('animation');
173
174            if ( animation == undefined )
175                animation = 'fadeInUp';
176
177            jQuery.each(carouselGlobalContainer.find('.owl-item'), function() {        
178
179                var animation = jQuery(this).find('.slideCaption').data('animation');
180
181                if ( animation == undefined )
182                    animation = 'fadeInUp';
183
184                jQuery(this).find('h3.textCaption').removeClass().addClass('textCaption');
185                jQuery(this).find('p.textCaption').removeClass().addClass('textCaption');
186                // jQuery(this).find('a.slideButton').removeClass().addClass('slideButton btn btn-lg btn-default');
187
188                jQuery(this).find('h3.textCaption').hide();
189                jQuery(this).find('p.textCaption').hide();
190                jQuery(this).find('a.slideButton').hide();
191            });
192
193            carouselGlobalContainer.find('.owl-item.active').find('h3.textCaption').addClass('animated '+animation);
194            carouselGlobalContainer.find('.owl-item.active').find('p.textCaption').addClass('animated '+animation);
195            carouselGlobalContainer.find('.owl-item.active').find('a.slideButton').addClass('animated '+animation);
196
197            carouselGlobalContainer.find('.owl-item.active').find('h3.textCaption').show();
198            carouselGlobalContainer.find('.owl-item.active').find('p.textCaption').show();
199            carouselGlobalContainer.find('.owl-item.active').find('a.slideButton').show();
200
201        });
202
203        // Event Next/Previous on click on arrows left and right
204        ///**migrate/jQuery('#carouselControlRight').click(function() {
205        jQuery('#carouselControlRight').on('click',function() {
206            owl.trigger('next.owl.carousel');
207            owl.trigger('autoplay.stop.owl');
208        });
209
210        ///**migrate/jQuery('#carouselControlLeft').click(function() {
211        jQuery('#carouselControlLeft').on('click',function() {
212            owl.trigger('prev.owl.carousel');
213        });
214
215        // Progress bar gesture
216        if(optionActivateAutoplay)
217        {
218
219            // Slide loader events
220            owl.on('translated.owl.carousel', function(event) {
221                jQuery(".progressBar").stop().animate({width: "100%"}, parseInt(optionAutoplayWaitBetweenSlide));
222            });
223
224            jQuery(".progressBar").stop().animate({width: "100%"}, parseInt(optionAutoplayWaitBetweenSlide));
225
226            owl.on('translate.owl.carousel', function() {
227                jQuery(".progressBar").stop().animate({width: "0%"}, 100);
228            });
229
230            owl.on('resized.owl.carousel', function() {
231                jQuery(".progressBar").stop().animate({width: "100%"}, parseInt(optionAutoplayWaitBetweenSlide));
232            });
233
234            
235
236            // If the option 'optionAutoplayStopOnHover' is active, we also stop the animation on hover
237            if(optionAutoplayStopOnHover)
238            {
239                ///**migrate/owl.hover(
240                owl.on('hover',
241                    function() {
242                        jQuery(".progressBar").stop().animate({width: "0%"}, 100);
243                    }, function() {
244                        // If a video is not playing
245                        if(!jQuery(this).hasClass('owl-video-playing'))
246                            jQuery(".progressBar").stop().animate({width: "100%"}, parseInt(optionAutoplayWaitBetweenSlide));
247                        else
248                            jQuery(".progressBar").stop().animate({width: "0%"}, 100); 
249                    }
250                );  
251            }
252        }
253
254        // if (window.matchMedia("(max-width: 800px)").matches)
255        // {
256        //     owl.trigger('autoplay.stop.owl');
257        // }
258    }
259  
260});

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.