1(function($) { 2 let windowWidth; 3 4 $.fn.updateTestimonialsCarousel = function() { 5 if (windowWidth === $(window).width()) { 6 return; 7 } else { 8 windowWidth = $(window).width(); 9 } 10 function initTestimonialsCarousel() { 11 if (window.tgpLazyItems !== undefined) { 12 var isShowed = window.tgpLazyItems.checkGroupShowed(this, function(node) { 13 initTestimonialsCarousel.call(node); 14 }); 15 if (!isShowed) { 16 return; 17 } 18 } 19 20 var $testimonialsElement = $(this); 21 22 var $testimonialsCarousel = $('.gem-testimonials-carousel', $testimonialsElement); 23 var $testimonials = $('.gem-testimonial-item', $testimonialsCarousel); 24 var $testimonialsPrev = $('.gem-testimonials-prev', $testimonialsElement); 25 var $testimonialsNext = $('.gem-testimonials-next', $testimonialsElement); 26 27 $testimonialsElement.thegemPreloader(function() { 28 29 var $testimonialsView = $testimonialsCarousel.carouFredSel({ 30 auto: ($testimonialsElement.data('autoscroll') > 0 ? $testimonialsElement.data('autoscroll') : false), 31 circular: true, 32 infinite: true, 33 width: '100%', 34 height: 'auto', 35 items: 1, 36 align: 'center', 37 responsive: true, 38 swipe: true, 39 prev: $testimonialsPrev, 40 next: $testimonialsNext, 41 scroll: { 42 pauseOnHover: true, 43 fx: 'scroll', 44 easing: 'easeInOutCubic', 45 duration: 1000, 46 onBefore: function(data) { 47 data.items.old.css({ 48 opacity: 1 49 }).animate({ 50 opacity: 0 51 }, 500, 'linear'); 52 53 data.items.visible.css({ 54 opacity: 0 55 }).animate({ 56 opacity: 1 57 }, 1000, 'linear'); 58 } 59 } 60 }); 61 62 }); 63 } 64 65 $('.gem-testimonials', this).add($(this).filter('.gem-testimonials')).each(initTestimonialsCarousel); 66 } 67 68 $(function() { 69 70 $('.gem-testimonials').each(function() { 71 72 var $testimonialsElement = $(this); 73 74 var $testimonials = $('.gem-testimonial-item', $testimonialsElement); 75 76 var $testimonialsWrap = $('<div class="gem-testimonials-carousel-wrap"/>') 77 .appendTo($testimonialsElement); 78 var $testimonialsCarousel = $('<div class="gem-testimonials-carousel"/>') 79 .appendTo($testimonialsWrap); 80 if($testimonialsElement.hasClass('fullwidth-block')) { 81 $testimonialsCarousel.wrap('<div class="container" />'); 82 } 83 var $testimonialsNavigation = $('<div class="gem-testimonials-navigation"/>') 84 .appendTo($testimonialsWrap); 85 var $testimonialsPrev = $('<a href="#" class="gem-prev gem-testimonials-prev" aria-label="Previous testimonial"></a>') 86 .appendTo($testimonialsNavigation); 87 var $testimonialsNext = $('<a href="#" class="gem-next gem-testimonials-next" aria-label="Next testimonial"></a>') 88 .appendTo($testimonialsNavigation); 89 if($testimonialsElement.hasClass('random-order')) { 90 $testimonials.sort(function() { 91 return 0.5 - Math.random(); 92 }); 93 } 94 $testimonials.appendTo($testimonialsCarousel); 95 96 }); 97 98 $('body').updateTestimonialsCarousel(); 99 $('.fullwidth-block').each(function() { 100 $(this).on('updateTestimonialsCarousel', function() { 101 $(this).updateTestimonialsCarousel(); 102 }); 103 }); 104 $('.gem_tab').on('tab-update', function() { 105 $(this).updateTestimonialsCarousel(); 106 }); 107 }); 108 109})(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.