1/* LT-Ext Plugin Frontend functions */ 2"use strict"; 3jQuery(document).on('ready', function() { 4 5 initSwiperWrappers(); 6 //initFCSwiper(); 7 8 setTimeout(function() { 9 10 jQuery('.elementor-accordion .elementor-tab-title').removeClass('elementor-active'); 11 jQuery('.elementor-accordion .elementor-tab-content').css('display', 'none'); 12 }, 100); 13}); 14 15jQuery(window).on('elementor/frontend/init', function () { 16 17 elementorFrontend.hooks.addAction('frontend/element_ready/lte-product-categories.default', initSwiperWrappers); 18 elementorFrontend.hooks.addAction('frontend/element_ready/lte-products.default', initSwiperWrappers); 19 elementorFrontend.hooks.addAction('frontend/element_ready/lte-testimonials.default', initSwiperWrappers); 20 elementorFrontend.hooks.addAction('frontend/element_ready/lte-zoomslider.default', initSwiperWrappers); 21 elementorFrontend.hooks.addAction('frontend/element_ready/lte-gallery.default', initSwiperWrappers); 22 23 elementorFrontend.hooks.addAction('frontend/element_ready/lte-rental-search.default', initCf7Styles); 24 elementorFrontend.hooks.addAction('frontend/element_ready/lte-cf7.default', initCf7Styles); 25 26 elementorFrontend.hooks.addAction('frontend/element_ready/accordion', function() { alert('1'); }); 27 28 jQuery('.elementor-tab-title.elementor-active').removeClass('elementor-active'); 29 30}); 31 32function initSwiperWrappers() { 33 34 initSwiperSliders(); 35 initFilterContainer(); 36} 37 38/* Swiper Slider Containers and Script Initialization */ 39function initSwiperSliders() { 40 41 var lteSliders = jQuery('.lte-swiper-slider:not(".lte-inited")'); 42 43 jQuery(lteSliders).each(function(i, el) { 44 45 var container = jQuery(el), 46 id = 'lte-id-' + Math.floor(Math.random() * Math.floor(10000)), 47 autoplay = false, 48 autoplay_interact = false, 49 navigation = false, 50 pagination = false, 51 slidesPerView = false, 52 centeredSlides = false, 53 simulateTouch = true, 54 allowTouchMove = true, 55 spg = 1, 56 slidesPerGroup = 1, 57 spaceBetween = container.data('space-between'), 58 loop = container.data('loop'), 59 effect = container.data('effect'), 60 speed = container.data('speed'), 61 breakpoints_per = container.data('breakpoints').split(';'), 62 breakpoints_viewports = [1599, 1199, 991, 768, 480, 0], 63 breakpoints = {}; 64 65 if ( container.data('autoplay') && container.data('autoplay') > 0 ) { 66 67 if ( container.data('autoplay-interaction') === 1 ) { 68 69 autoplay_interact = true; 70 } 71 else { 72 73 autoplay_interact = false; 74 } 75 76 autoplay = { 77 78 delay: container.data('autoplay'), 79 disableOnInteraction: autoplay_interact, 80 } 81 } 82 83 if ( container.data('center-slide') ) { 84 85 centeredSlides = true; 86 } 87 88 if ( container.data('arrows') ) { 89 90 var arrows_html = '<div class="'+ id + '-arrows lte-arrows lte-arrows-' + container.data('arrows') + '"><a href="#" class="lte-arrow-left"></a><a href="#" class="lte-arrow-right"></a></div>'; 91 92 if ( container.data('arrows') == 'right' || container.data('arrows') == 'sides-outside' || container.data('arrows') == 'sides-small' ) { 93 94 jQuery(container).after(arrows_html); 95 } 96 else 97 if ( container.data('arrows') != 'custom' ) { 98 99 jQuery(container).append(arrows_html); 100 } 101 102 navigation = { 103 nextEl: '.' + id + '-arrows .lte-arrow-right', 104 prevEl: '.' + id + '-arrows .lte-arrow-left', 105 } 106 } 107 108 if ( !loop ) loop = false; 109 110 jQuery(breakpoints_per).each(function(i, el) { 111 112 if ( !slidesPerView && el ) { 113 114 slidesPerView = 1; 115 if ( container.data('slides-per-group') ) slidesPerGroup = el; 116 slidesPerGroup = 1; 117 } 118 119 if ( el ) { 120 121 122 if ( container.data('slides-per-group') ) spg = el; else spg = 1; 123 spg = 1; 124 if ( container.data('slides-per-group') == -1 ) spg = -1; 125 126 breakpoints[breakpoints_viewports[i]] = { slidesPerView : el, slidesPerGroup : el }; 127 128 if ( spg == -1 ) delete breakpoints[breakpoints_viewports[i]]['slidesPerGroup']; 129 } 130 }); 131 132 if ( container.data('pagination') && container.data('pagination') == 'bullets' ) { 133 134 pagination = { 135 136 el: '.swiper-pagination', 137 type: 'bullets', 138 clickable: true 139 }; 140 141 jQuery(container).append('<div class="swiper-pagination"></div>'); 142 } 143 else 144 if ( container.data('pagination') && container.data('pagination') == 'fraction' ) { 145 146 pagination = { 147 148 el: '.swiper-pagination', 149 type: 'fraction', 150 }; 151 152 jQuery(container).append('<div class="swiper-pagination"></div>'); 153 } 154 else 155 if ( container.data('pagination') && container.data('pagination') == 'custom' ) { 156 157 pagination = { 158 el: '.swiper-pagination-custom', 159 clickable: true, 160 renderBullet: function (index, className) { 161 162 var pages = (container.data('pagination-custom')); 163 164 return '<span class="' + className + ' ' + pages[index]['cats'] +'"><span class="lte-img"><img src="' + pages[index]['image'] + '" alt="' + pages[index]['header'] + '"></span><span class="lte-title">' + pages[index]['header'] + '</span></span>'; 165 }, 166 }; 167 } 168 169 if ( container.data('simulate-touch') ) { 170 171 simulateTouch = false; 172 allowTouchMove = false; 173 } 174 175 if ( !slidesPerView ) slidesPerView = 1; 176 177 var conf = { 178 initialSlide : 0, 179 spaceBetween : spaceBetween, 180 centeredSlides : centeredSlides, 181 182 slidesPerView : slidesPerView, 183 slidesPerGroup : slidesPerGroup, 184 breakpoints : breakpoints, 185 186 loop : loop, 187 speed : speed, 188 navigation : navigation, 189 autoplay : autoplay, 190 191 pagination : pagination, 192 193 simulateTouch : simulateTouch, 194 allowTouchMove : allowTouchMove, 195/* 196 slideChangeTransitionStart: function(s) { 197 198 var currentSlide = $(s.slides[s.activeIndex]); 199 var elems = currentSlide.find(".animated") 200 elems.each(function() { 201 var $this = $(this); 202 var animationType = $this.data('animation'); 203 $this.addClass(animationType, 100).on(animEndEv, function() { 204 $this.removeClass(animationType); 205 }); 206 }); 207 208 }, 209 slideChangeTransitionEnd: function(s) { 210 var currentSlide = $(s.slides[s.activeIndex]); 211 212 } 213*/ 214 on: { 215 init: function () { 216 217 var activeIndex = this.activeIndex; 218 var realIndex = this.slides.eq(activeIndex).attr('data-swiper-slide-index'); 219 220 jQuery('.swiper-slide').removeClass('swiper-slide-nth-prev-2 swiper-slide-nth-next-2'); 221 jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').prev().prev().addClass('swiper-slide-nth-prev-2'); 222 jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').next().next().addClass('swiper-slide-nth-next-2'); 223 }, 224 slideChange: function () { 225 226 var activeIndex = this.activeIndex; 227 var realIndex = this.slides.eq(activeIndex).attr('data-swiper-slide-index'); 228 229 jQuery('.swiper-slide').removeClass('swiper-slide-nth-prev-2 swiper-slide-nth-next-2'); 230 jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').prev().prev().addClass('swiper-slide-nth-prev-2'); 231 jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').next().next().addClass('swiper-slide-nth-next-2'); 232 }, 233 } 234 }; 235 236 if ( slidesPerGroup == 1) delete conf['slidesPerGroup']; 237 238 if ( effect == 'fade') { 239 240 conf["effect"] = 'fade'; 241 conf["fadeEffect"] = { crossFade: true }; 242 } 243 else 244 if ( effect == 'coverflow') { 245 246 var ww = jQuery(window).width(); 247 248 conf['centeredSlides'] = true; 249 conf["loop"] = true; 250 conf["effect"] = 'coverflow'; 251 252 if ( ww > 1199 ) { 253 254 conf["coverflowEffect"] = { 255 256 rotate : 0, 257 stretch :0, 258 depth: 200, 259 modifier: 1, 260 slideShadows: false, 261 }; 262 } 263 else { 264 265 conf["coverflowEffect"] = { 266 267 rotate : 0, 268 stretch :0, 269 depth: 400, 270 modifier: 1.5 , 271 slideShadows: false, 272 }; 273 } 274 } 275 else 276 if ( effect == 'flip') { 277 278 conf["effect"] = 'flip'; 279 conf["flipEffect"] = { slideShadows: false }; 280 } 281 else 282 if ( effect == 'cube') { 283 284 conf["effect"] = 'cube'; 285 conf["cubeEffect"] = { slideShadows: false }; 286 } 287 288 var swiper = new Swiper(container, conf); 289 if ( container.data('autoplay') > 0 && container.data('autoplay-interaction') === 1 ) { 290 291 swiper.el.addEventListener("mouseenter", function( event ) { swiper.autoplay.stop(); }, false); 292 swiper.el.addEventListener("mouseout", function( event ) { swiper.autoplay.start(); }, false); 293 } 294 295 container.addClass('lte-inited');
296 swiper.update(); 297 }); 298} 299 300 301/* Tabs Filterered Container */ 302function initFilterContainer() { 303 304 var container = jQuery('.lte-filter-container:not(".lte-inited")'), 305 heightAuto = 0; 306 307 if ( container.hasClass('lteHeightAuto') ) { 308 309 heightAuto = 1; 310 } 311 312 jQuery(container).each(function(i, el) { 313 314 var wrapper = jQuery(el), 315 tabs = wrapper.find('.lte-tabs-cats'); 316 317 if (tabs.length) { 318 319 tabs.on('click', '.lte-tab', function() { 320 321 322 if ( heightAuto == 0 && !wrapper.hasClass('hasHeight') ) { 323 324 wrapper.css('height', container.height()); 325 wrapper.addClass('hasHeight'); 326 } 327 328 if ( heightAuto == 1 ) { 329 330 wrapper.css('height', wrapper.find('.lte-filter-item.lte-filter-id-' + filter).height()); 331 } 332 333 if ( !tabs.hasClass('animated') ) { 334 335 var el = jQuery(this), 336 filter = el.data('filter'); 337 338 el.parent().parent().find('.active').removeClass('active'); 339 el.addClass('active'); 340 341 if (filter === 0) { 342 343 wrapper.find('.lte-filter-item').show(); 344 } 345 else 346 if (filter !== '') { 347 348 wrapper.find('.lte-filter-item').removeClass('show-item').fadeOut(300, function() { 349 350 tabs.addClass('animated'); 351 352 setTimeout(function() { 353 354 wrapper.find('.lte-filter-item.lte-filter-id-' + filter).addClass('show-item').fadeIn(300, function() { 355 356 tabs.removeClass('animated'); 357 });
358 359 if ( jQuery(window).width() < 1000 ) { 360 361 jQuery('html, body').animate({ 362 scrollTop: wrapper.find('.lte-filter-item.lte-filter-id-' + filter).offset().top 363 }, 100); 364 } 365 366 var mySwiper = document.querySelector('.lte-filter-item.lte-filter-id-' + filter + ' .swiper-container'); 367 if ( document.querySelector('.lte-filter-item.lte-filter-id-' + filter + ' .swiper-container') !== null ) { 368 369 mySwiper = mySwiper.swiper; 370 mySwiper.update(); 371 } 372 373 }, 500); 374 });; 375 376 } 377 378 return false; 379 } 380 381 return false; 382 }); 383 384 // First Init, Activating first tab 385 var firstBtn = tabs.find('.lte-tab:first'); 386 387 firstBtn.addClass('active'); 388 389 if ( firstBtn.data('filter') != 0 ) { 390 391 wrapper.find('.lte-filter-item').hide(); 392 wrapper.find('.lte-filter-item.lte-filter-id-' + firstBtn.data('filter') + '').addClass('show-item').show(); 393 394 wrapper.closest('.elementor-element').css('min-height', container.height()); 395 } 396 397 jQuery(el).addClass('lte-inited'); 398 399 jQuery(window).resize(); 400 401 } 402 }); 403} 404 405 406function initFCSwiper() { 407 408 var container = jQuery('.elementor-widget-lte-slider-full'), 409 menu = container.find('.lte-slider-fc-menu'), 410 items = container.find('.lte-item'); 411 412 var current = menu.find('span').first().addClass('active').data('id'); 413 414 container.find('.lte-wrapper-item').fadeOut(); 415 container.find('.lte-wrapper-item-' + current).fadeIn(); 416 417 menu.on('click', 'span', function() { 418 419 menu.find('span').removeClass('active'); 420 current = jQuery(this).addClass('active').data('id'); 421 422 container.find('.lte-wrapper-item').fadeOut(); 423 container.find('.lte-wrapper-item-' + current).delay(300).fadeIn("slow"); 424 }); 425 426 if ( document.querySelector('.swiper-container') !== null ) { 427 428 var swiper = document.querySelector('.swiper-container').swiper; 429 swiper.update(); 430 } 431} 432 433function initCf7Styles() { 434 435 jQuery('form.wpcf7-form select').parent(":not(.select-wrap)").find('select').wrap('<div class="select-wrap"></div>'); 436 jQuery('form:not(.checkout, .woocommerce-shipping-calculator) select:not(#rating), .wpcf7-form select:not(#rating), .lte-wc-order select, aside select, .lte-footer-widget-area select').parent(":not(.select-wrap)").find('select').wrap('<div class="select-wrap"></div>'); 437}
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.