1(function($) { 2 "use strict"; 3 4 UNCODE.carousel = function(container) { 5 var $owlContainers = $('.owl-carousel-container', container); 6 $owlContainers.each(function() { 7 var $owlContainer = $(this), 8 $owlWrapper = $owlContainer.closest('.owl-carousel-wrapper'), 9 $owlSelector = $('> [class*="owl-carousel"]', $owlContainer), 10 values = {}, 11 tempTimeStamp, 12 newWidth = UNCODE.wwidth, 13 $owlInsideEqual = []; 14 $owlSelector.each(function() { 15 var itemID = $(this).attr('id'), 16 $elSelector = $(('#' + itemID).toString()); 17 values['id'] = itemID; 18 values['items'] = 1; 19 values['columns'] = 3; 20 values['fade'] = false; 21 values['nav'] = false; 22 values['navmobile'] = false; 23 values['navskin'] = 'light'; 24 values['navspeed'] = 400; 25 values['dots'] = false; 26 values['dotsmobile'] = false; 27 values['loop'] = false; 28 values['autoplay'] = false; 29 values['timeout'] = 3000; 30 values['autoheight'] = false; 31 values['stagepadding'] = 0; 32 values['margin'] = 0; 33 values['lg'] = 1; 34 values['md'] = 1; 35 values['sm'] = 1; 36 $.each($(this).data(), function(i, v) { 37 values[i] = v; 38 }); 39 40 if ($(this).closest('.uncode-slider').length) { 41 values['navskin'] = ''; 42 values['navmobile'] = false; 43 //values['dotsmobile'] = true; 44 } else { 45 values['navskin'] = ' style-'+values['navskin']+' style-override'; 46 } 47 48 var setIndexActive = function(event, init){ 49 var init = typeof init === 'undefined' ? false : init, 50 thiis = $(event.currentTarget); 51 if (tempTimeStamp != event.timeStamp && ( init || ( !UNCODE.isFullPage || ( UNCODE.isFullPage && thiis.closest('.fp-section').hasClass('uncode-scroll-active') ) ) ) ) { 52 var scrolltop = $(document).scrollTop(), 53 size = event.page.size, 54 i; 55 var setIndex = requestTimeout(function() { 56 for ( i = 0; i < size; i++ ) { 57 var itemCont = event.item.index != null ? (event.item.index + i) : i; 58 var currentItem = thiis.find("> .owl-stage-outer > .owl-stage > .owl-item")[itemCont]; 59 if (thiis.closest('.row-slider').length) { 60 if (currentItem == undefined) { 61 currentItem = thiis.children()[i]; 62 } 63 if ($(currentItem).closest('#page-header').length) { 64 if ($('.row-container > .row > .row-inner > div > .style-dark', currentItem).closest('.uncode-slider').length) { 65 UNCODE.switchColorsMenu(scrolltop, 'dark'); 66 } else if ($('.row-container > .row > .row-inner > div > .style-light', currentItem).closest('.uncode-slider').length) { 67 UNCODE.switchColorsMenu(scrolltop, 'light'); 68 } 69 } 70 var owlCustomNav = $elSelector.closest('.owl-carousel-wrapper-nav').find('.uncode-owl-nav-out.skin-inherit'); 71 if (owlCustomNav.length) { 72 if ($('.row-container > .row > .row-inner > div > .style-dark', currentItem).closest('.uncode-slider').length) { 73 owlCustomNav.addClass('style-dark').removeClass('style-light'); 74 } else if ($('.row-container > .row > .row-inner > div > .style-light', currentItem).closest('.uncode-slider').length) { 75 owlCustomNav.addClass('style-light').removeClass('style-dark'); 76 } 77 } 78 } 79 var itendIndex = $(currentItem).attr('data-index'); 80 if ( isNaN(itendIndex) ) { 81 itendIndex = 1; 82 } 83 $elSelector.find('.owl-item:not(.new-indexed)').removeClass('index-active'); 84 $elSelector.find('.owl-item[data-index="' + itendIndex + '"]').addClass('index-active').addClass('new-indexed'); 85 if ($.fn.counterUp) { 86 $elSelector.find('.owl-item[data-index="' + itendIndex + '"] .uncode-counter').each(function(){ 87 var $counter = $(this); 88 $counter.addClass('started').counterUp({ 89 delay: 10, 90 time: 1500 91 }); 92 }); 93 } 94 } 95 $elSelector.find('.owl-item.new-indexed').removeClass('new-indexed'); 96 }, 200); 97 } 98 tempTimeStamp = event.timeStamp; 99 } 100 101 /** Initialize */ 102 $elSelector.on('initialize.owl.carousel', function(event) { 103 if (typeof UNCODE.owlNav !== 'undefined') { 104 UNCODE.owlNav(itemID, event); 105 } 106 107 if ( $('body').hasClass('compose-mode') && typeof window.parent.vc !== 'undefined' ) { 108 window.parent.vc.events.on('shortcodeView:beforeUpdate shortcodeView:destroy', function(model) { 109 var shortcode = model.attributes.shortcode, 110 $el = model.view.$el, 111 $row_wrap = $el.closest('.row'); 112 if ( shortcode === 'uncode_carousel_nav' && typeof UNCODE.owlNav !== 'undefined') { 113 $row_wrap.find('.owl-carousel-wrapper-nav .uncode-owl-nav-out').remove(); 114 } 115 }); 116 window.parent.vc.events.on('shortcodeView:updated', function(model) { 117 var shortcode = model.attributes.shortcode; 118 if ( shortcode === 'uncode_carousel_nav' && typeof UNCODE.owlNav !== 'undefined') { 119 tempTimeStamp = Math.floor(Date.now() / 1000); 120 } 121 }); 122 window.parent.vc.events.on('shortcodeView:updated shortcodeView:ready', function(model) { 123 var shortcode = model.attributes.shortcode; 124 if ( shortcode === 'uncode_carousel_nav' && typeof UNCODE.owlNav !== 'undefined') { 125 UNCODE.owlNav(itemID, event); 126 $elSelector.trigger('refresh.owl.carousel'); 127 } 128 }); 129 } 130 }); 131 132 /** Initialized */ 133 $elSelector.on('initialized.owl.navigation', function(event) { 134 $('.owl-dot', event.currentTarget).each(function(key, val){ 135 $(val).attr('aria-label', SiteParameters.uncode_slide_label + ' ' + (key+1)); 136 }); 137 }); 138 139 $elSelector.on('initialized.owl.carousel', function(event) { 140 141 if ( $('.isotope-container', event.currentTarget).length ) { 142 window.dispatchEvent(UNCODE.boxEvent); 143 } 144 145 $('.owl-dot.active', $elSelector).on('click', function(){ 146 return false;
147 }); 148 149 var thiis = $(event.currentTarget), 150 // get the time from the data method 151 time = thiis.data("timer-id"), 152 rowParent = thiis.closest('.row-parent'); 153 154 if ( typeof rowParent[0] !== 'undefined' ) { 155 rowParent[0].dispatchEvent(new CustomEvent('owl-carousel-initialized')); 156 } 157 158 if (time) { 159 clearRequestTimeout(time); 160 } 161 162 thiis.addClass('showControls'); 163 var new_time = requestTimeout(function() { 164 thiis.closest('.owl-carousel-container').removeClass('owl-carousel-loading'); 165 if (thiis.hasClass('owl-height-viewport')) 166 setItemsRelHeight(thiis); 167 if (thiis.hasClass('owl-height-equal')) 168 setItemsHeight(thiis); 169 if (!UNCODE.isMobile && !$elSelector.closest('.header-wrapper').length) navHover($elSelector.parent()); 170 if (thiis.closest('.unequal, .unexpand').length) { 171 UNCODE.setRowHeight(rowParent[0], true); 172 } 173 if (SiteParameters.dynamic_srcset_active === '1') { 174 UNCODE.refresh_dynamic_srcset_size(thiis); 175 } 176 }, 350); 177 // save the new time 178 thiis.data("timer-id", new_time); 179 180 var scrolltop = $(document).scrollTop(); 181 thiis.closest('.uncode-slider').find('video').removeAttr('poster'); 182 183 //if (!UNCODE.isMobile) { 184 /** fix autoplay when visible **/ 185 $(window).on('load', function(){ 186 if (thiis.data('autoplay')) { 187 if ( !thiis.closest('.sticky-element').length ) { 188 thiis.trigger('stop.autoplay.owl'); 189 } else { 190 thiis.trigger('play.owl.autoplay'); 191 } 192 } 193 if (UNCODE.isUnmodalOpen && !thiis.closest('#unmodal-content')) { 194 return; 195 } 196 if ( ! thiis.closest('.sticky-element').length ) { 197 var carouselInView = new Waypoint.Inview({ 198 context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, 199 element: thiis[0], 200 exited: function() { 201 var el = $(this.element); 202 if (el.data('autoplay') ) { 203 el.trigger('stop.owl.autoplay'); 204 el.data('stopped','true'); 205 } 206 }, 207 enter: function(direction) { 208 var el = $(this.element); 209 requestTimeout(function() { 210 if (el.data('autoplay')) { 211 el.trigger('play.owl.autoplay'); 212 el.data('stopped','false'); 213 } 214 }, 100); 215 } 216 }); 217 } 218 if ( typeof window.lenis !== 'undefined' && window.lenis !== null ) { 219 setTimeout(function(){ 220 window.lenis.resize(); 221 }, 1000); 222 } 223 224 }); 225 //} 226 227 // $(window).on('frontend:carousel_updated', function(){ 228 // Waypoint.refreshAll(); 229 // }); 230 231 if (!thiis.closest('.isotope-system').length) { 232 requestTimeout(function() { 233 animate_thumb($('.t-inside', el), event); 234 }, 400); 235 } else { 236 requestTimeout(function() { 237 thiis.closest('.isotope-container').isotope('layout'); 238 }, 400); 239 } 240 241 var currentItem = thiis.find("> .owl-stage-outer > .owl-stage > .owl-item")[event.item.index], 242 currentIndex = $(currentItem).attr('data-index'); 243 244 $.each($('.owl-item:not(.active) .start_animation', $(event.target)), function(index, val) { 245 if ($(val).closest('.uncode-slider').length) { 246 $(val).removeClass('start_animation'); 247 } 248 }); 249 $.each($('.owl-item:not(.active) .already-animated', $(event.target)), function(index, val) { 250 if ($(val).closest('.uncode-slider').length) { 251 $(val).removeClass('already-animated'); 252 } 253 }); 254 255 $.each($('.owl-item:not(.active) [data-animated="yes"]', $(event.target)), function(index, val) { 256 if ($(val).closest('.uncode-slider').length) { 257 $(val).removeAttr('data-animated'); 258 } 259 }); 260 261 $.each($('.owl-item.cloned', thiis), function(index, val) { 262 $('.t-entry-visual-cont > a', $(val)).attr('data-lbox-clone', true); 263 }); 264 265 $.each($('.owl-item:not(.active)', thiis), function(index, val) { 266 if ($(val).attr('data-index') != currentIndex) { 267 $('.start_animation:not(.t-inside)', val).removeClass('start_animation'); 268 $('.already-animated:not(.t-inside)', val).removeClass('already-animated'); 269 } 270 if ($(val).attr('data-index') != currentIndex) { 271 $('[data-animated="yes"]:not(.t-inside)', val).removeAttr('data-animated'); 272 } 273 if ($(val).attr('data-index') == currentIndex) { 274 $('.animate_when_almost_visible:not(.t-inside), .animate_inner_when_almost_visible:not(.t-inside)', val).addClass('start_animation'); 275 } 276 }); 277 278 if (thiis.closest('.uncode-slider').length) { 279 var el = thiis.closest('.row-parent')[0], 280 section = thiis.closest('.vc_section'); 281 if ( section.length ) { 282 el = $('> .row-parent', section)[0]; 283 } 284 if ($(el).data('imgready')) { 285 firstLoaded(el, event); 286 } else { 287 el.addEventListener("imgLoaded", function(el) { 288 firstLoaded(el.target, event); 289 }, false); 290 } 291 var transHeight = $('.hmenu .menu-transparent.menu-primary .menu-container').height() - UNCODE.bodyBorder; 292 if (transHeight != null) { 293 requestTimeout(function() { 294 thiis.closest('.uncode-slider').find('.owl-prev, .owl-next').css('paddingTop', transHeight / 2 + 'px'); 295 }, 100); 296 } 297 } else { 298 var el = thiis; 299 el.closest('.uncode-slider').addClass('slider-loaded'); 300 } 301 302 requestTimeout(function() { 303 if (typeof UNCODE.bigText !== 'undefined') { 304 UNCODE.bigText(thiis); 305 } 306 if (thiis.closest('.uncode-slider').length || thiis.closest('.row').find('.uncode-owl-nav-in').length) { 307 if (thiis.data('autoplay')) pauseOnHover(thiis); 308 } 309 }, 500); 310 311 if (thiis.closest('.unequal').length) { 312 $owlInsideEqual.push(thiis.closest('.row-parent')); 313 } 314 315 var containerClasses = '', 316 containerStyle = '';
317 if ( $('.owl-dots-classes', $owlContainer).length ) { 318 containerClasses = $('.owl-dots-classes', $owlContainer).attr('class'); 319 containerStyle = $('.owl-dots-classes', $owlContainer).attr('style'); 320 $('.owl-dots-classes', $owlContainer).remove(); 321 } 322 323 if ( containerClasses !== '' ) { 324 requestTimeout(function() { 325 if ( containerClasses !== '' ) 326 $('.owl-dots', $owlContainer).attr('style', containerStyle); 327 if ( containerStyle !== '' ) 328 $('.owl-dots', $owlContainer).addClass(containerClasses); 329 }, 100); 330 } 331 332 $.each($('.column_child.pos-bottom', thiis), function(index, val) { 333 $(val).closest('.row-inner').css({ 334 'margin-top': '-1px' 335 }); 336 }); 337 338 if ($.fn.isotope) { 339 if ( thiis.closest('.isotope-container').length ) { 340 if (thiis.closest('.isotope-container').data('isotope')) { 341 requestTimeout(function(){ 342 thiis.closest('.isotope-container').isotope('layout'); 343 }, 300); 344 } 345 $(window).on('load', function(){ 346 if (thiis.closest('.isotope-container').data('isotope')) { 347 thiis.closest('.isotope-container').isotope('layout'); 348 } 349 }); 350 } 351 } 352 353 if (thiis.data('autoplay')) { 354 $(window).on('menuOpen', function(){ 355 thiis.trigger('stop.owl.autoplay'); 356 thiis.data('stopped','true'); 357 }).on('menuClose', function(){ 358 359 }); 360 } 361 $(window).on('menuClose', function(){ 362 if (thiis.data('autoplay')) { 363 thiis.trigger('play.owl.autoplay'); 364 thiis.data('stopped','false'); 365 } 366 }); 367 368 setIndexActive(event, true); 369 370 var nested_a = $('a[data-lbox]:not(.lb-disabled):not([data-lbox-init]):not([data-album])').filter(function( index ) { 371 return !$(this).closest('.nested-carousel').length; 372 }), 373 $_galleries = $('.isotope-container:not([data-lbox-init]), .owl-carousel:not([data-lbox-init]), .custom-grid-container:not([data-lbox-init]), .index-scroll-wrapper:not([data-lbox-init]), .justified-gallery:not([data-lbox-init]), .uncode-single-media-wrapper:not([data-lbox-init]), .woocommerce-product-gallery:not([data-lbox-init]), .icon-box:not([data-lbox-init]), .grid-container:not([data-lbox-init])', thiis).has(nested_a), 374 $galleries = $_galleries.filter(function( index ) { 375 return !$(this).closest('.owl-carousel').length || $(this).is('.owl-carousel'); 376 }); 377 378 if (typeof UNCODE.lightgallery !== 'undefined' && SiteParameters.lbox_enhanced) { 379 UNCODE.lightgallery( $galleries ); 380 } 381 382 if ( typeof ScrollTrigger !== 'undefined' && ScrollTrigger !== null ) { 383 $(document).trigger('uncode-scrolltrigger-refresh'); 384 } 385 }); 386 387 $elSelector.on('resized.owl.carousel', function(event) { 388 $('.owl-dot', event.currentTarget).each(function(key, val){ 389 $(val).attr('aria-label', SiteParameters.uncode_slide_label + ' ' + (key+1)); 390 }); 391 }); 392 393 $elSelector.on('resized.owl.carousel', function(event) { 394 var thiis = $(event.currentTarget); 395 // if ($(this).closest('.nested-carousel').length) { 396 // requestTimeout(function() { 397 // window.dispatchEvent(UNCODE.boxEvent); 398 // }, 200); 399 // } 400 if ( thiis.hasClass('owl-height-equal') ) 401 setItemsHeight(thiis); 402 403 if ( UNCODE.wwidth > UNCODE.mediaQuery || ( UNCODE.wwidth <= UNCODE.mediaQuery && newWidth !== UNCODE.wwidth ) ) { 404 newWidth = UNCODE.wwidth; 405 setItemsRelHeight($elSelector); 406 } 407 408 setIndexActive(event); 409 410 if (SiteParameters.dynamic_srcset_active === '1') { 411 UNCODE.refresh_dynamic_srcset_size(thiis); 412 } 413 414 if ($.fn.isotope) { 415 $(window).on('load', function(){ 416 if ($(event.currentTarget).closest('.isotope-container').data('isotope')) { 417 $(event.currentTarget).closest('.isotope-container').isotope('layout'); 418 } 419 }); 420 } 421 422 if ( typeof window.lenis !== 'undefined' && window.lenis !== null ) { 423 setTimeout(function(){ 424 window.lenis.resize(); 425 }, 1000); 426 } 427 if ( typeof ScrollTrigger !== 'undefined' && ScrollTrigger !== null ) { 428 $(document).trigger('uncode-scrolltrigger-refresh'); 429 } 430 }); 431 432 $elSelector.on('refreshed.owl.carousel', function(event) { 433 setIndexActive(event); 434 }); 435 436 /** detect resize window for fluid height layout */ 437 var setFluidResize;
438 function manageFluidCarouseHeight() { 439 clearRequestTimeout(setFluidResize); 440 setFluidResize = requestTimeout(function(){ 441 if ( UNCODE.wwidth > UNCODE.mediaQuery || ( UNCODE.wwidth <= UNCODE.mediaQuery && newWidth !== UNCODE.wwidth ) ) { 442 newWidth = UNCODE.wwidth; 443 setItemsRelHeight($elSelector); 444 } 445 }, 100); 446 } 447 window.addEventListener('resize', manageFluidCarouseHeight); 448 449 /** Change */ 450 $elSelector.on('change.owl.carousel', function(event) { 451 if (!UNCODE.isMobile) UNCODE.owlStopVideo(event.currentTarget); 452 }); 453 454 /** Changed */ 455 $elSelector.on('changed.owl.carousel', function(event) { 456 var $row = $elSelector.parents('.row')[0]; 457 if ( typeof $row !== 'undefined' ) { 458 $row.dispatchEvent(new CustomEvent('owl-carousel-changed')); 459 } 460 setIndexActive(event); 461 }); 462 463 var checkDrag = function(e) { 464 $elSelector.addClass('owl-dragging'); 465 }; 466 $elSelector.on('drag.owl.carousel', function(event) { 467 document.addEventListener("mousemove", checkDrag); 468 }); 469 470 $elSelector.on('dragged.owl.carousel', function(event) { 471 $elSelector.removeClass('owl-dragging'); 472 document.removeEventListener("mousemove", checkDrag); 473 }); 474 475 $elSelector.on('translate.owl.carousel', function(event) { 476 if (UNCODE.isMobile) { 477 $(event.currentTarget).addClass('owl-translating'); 478 } 479 }); 480 481 /** Translated */ 482 $elSelector.on('translated.owl.carousel', function(event) { 483 484 var thiis = $(event.currentTarget), 485 currentItem = thiis.find("> .owl-stage-outer > .owl-stage > .owl-item")[event.item.index], 486 currentIndex = $(currentItem).attr('data-index'), 487 stagePadding = thiis.data('stagepadding'); 488 489 stagePadding = (stagePadding == undefined || stagePadding == 0) ? false : true; 490 491 if (!UNCODE.isMobile) { 492 UNCODE.owlPlayVideo(thiis); 493 } 494 495 requestTimeout(function(){ 496 var lastDelayElems = animate_elems($('.owl-item.index-active', thiis)); 497 var lastDelayThumb = animate_thumb($('.owl-item' + (stagePadding ? '' : '.active') + ' .t-inside', thiis), event); 498 if (thiis.closest('.uncode-slider').length && thiis.data('autoplay')) { 499 if (lastDelayElems == undefined) lastDelayElems = 0; 500 if (lastDelayThumb == undefined) lastDelayThumb = 0; 501 var maxDelay = Math.max(lastDelayElems, lastDelayThumb); 502 thiis.trigger('stop.owl.autoplay'); 503 requestTimeout(function() { 504 if (!thiis.hasClass('owl-mouseenter') && thiis.data('stopped') != 'true') thiis.trigger('play.owl.autoplay'); 505 }, maxDelay); 506 } 507 }, 200); 508 509 $.each($('.owl-item:not(.active) .start_animation', $(event.target)), function(index, val) { 510 if ($(val).closest('.uncode-slider').length) { 511 $(val).removeClass('start_animation'); 512 } 513 }); 514 515 $.each($('.owl-item:not(.active) .already-animated', $(event.target)), function(index, val) { 516 if ($(val).closest('.uncode-slider').length) { 517 $(val).removeClass('already-animated'); 518 } 519 }); 520 521 $.each($('.owl-item:not(.active) [data-animated="yes"]', $(event.target)), function(index, val) { 522 if ($(val).closest('.uncode-slider').length) { 523 $(val).removeAttr('data-animated'); 524 } 525 }); 526 527 $.each($('.owl-item:not(.active)', thiis), function(index, val) { 528 if ($(val).attr('data-index') != currentIndex) { 529 $('.start_animation:not(.t-inside)', val).removeClass('start_animation'); 530 $('.already-animated:not(.t-inside)', val).removeClass('already-animated'); 531 } 532 if ($(val).attr('data-index') != currentIndex) { 533 $('[data-animated="yes"]:not(.t-inside)', val).removeClass('start_animation'); 534 } 535 if ($(val).attr('data-index') == currentIndex) { 536 $('.animate_when_almost_visible:not(.t-inside), .animate_inner_when_almost_visible:not(.t-inside)', val).addClass('start_animation'); 537 } 538 }); 539 540 if (UNCODE.isMobile) { 541 thiis.removeClass('owl-translating'); 542 } 543 544 setIndexActive(event); 545 }); 546 547 if (UNCODE.wwidth < UNCODE.mediaQuery && $(this).data('stagepadding') > 25) values['stagepadding'] = 25; 548 549 /** Init carousel */ 550 $elSelector.not('.showControls').owlCarousel({ 551 items: values['items'], 552 animateIn: (values['fade'] == true) ? 'fadeIn' : null, 553 animateOut: (values['fade'] == true) ? 'fadeOut' : null, 554 nav: values['nav'], 555 dots: values['dots'], 556 loop: values['loop'], 557 stagePadding: values['stagepadding'], 558 margin: 0, 559 video: true, 560 autoWidth: false, 561 autoplay: false, 562 autoplayTimeout: values['timeout'], 563 autoplaySpeed: values['navspeed'], 564 autoplayHoverPause: $(this).closest('.uncode-slider').length || $(this).closest('.carousel-no-hover').length ? false : true, 565 autoHeight: ( $(this).hasClass('owl-height-equal') ? false : values['autoheight'] ), 566 itemSelector: SiteParameters.uncode_carousel_itemSelector, 567 rtl: $('body').hasClass('rtl') ? true : false, 568 fluidSpeed: true, 569 navSpeed: values['navspeed'], 570 dotsSpeed: values['navspeed'] / values['items'], 571 navElement: ['button type="button" aria-label="' + SiteParameters.uncode_prev_label + '"', 'button type="button" aria-label="' + SiteParameters.uncode_next_label + '"'], 572 navClass: [ 'owl-prev'+values['navskin'], 'owl-next'+values['navskin'] ], 573 navText: ['<div class="owl-nav-container btn-default btn-hover-nobg" tabindex="0"><i class="fa fa-fw fa-angle-left"></i></div>', '<div class="owl-nav-container btn-default btn-hover-nobg" aria-label="' + SiteParameters.uncode_next_label + '" tabindex="0"><i class="fa fa-fw fa-angle-right"></i></div>'], 574 navContainer: values['nav'] && ! SiteParameters.is_frontend_editor ? $elSelector : false, 575 responsiveClass: true, 576 responsiveBaseElement: '.box-container', 577 responsive: { 578 0: { 579 items: values['sm'], 580 nav: values['navmobile'], 581 dots: values['dotsmobile'], 582 dotsSpeed: values['navspeed'] / values['sm'], 583 }, 584 480: { 585 items: values['sm'], 586 nav: values['navmobile'], 587 dots: values['dotsmobile'], 588 dotsSpeed: values['navspeed'] / values['sm'], 589 }, 590 570: { 591 items: values['md'], 592 nav: values['navmobile'], 593 dots: values['dotsmobile'], 594 dotsSpeed: values['navspeed'] / values['md'], 595 }, 596 960: { 597 items: values['lg'], 598 dotsSpeed: values['navspeed'] / values['lg'], 599 } 600 } 601 }); 602 603 var transDuration = parseFloat(values['navspeed']) * 0.3; 604 var transDuration2 = parseFloat(values['navspeed']) * 0.8; 605 606 $('.owl-item .tmb', $elSelector).css({ 607 '-webkit-transition-delay': transDuration + 'ms', 608 '-moz-transition-delay': transDuration + 'ms', 609 '-o-transition-delay': transDuration + 'ms', 610 'transition-delay': transDuration + 'ms', 611 '-webkit-transition-duration': transDuration2 + 'ms', 612 '-moz-transition-duration': transDuration2 + 'ms', 613 '-o-transition-duration': transDuration2 + 'ms', 614 'transition-duration': transDuration2 + 'ms', 615 }); 616 617 requestTimeout(function() { 618 for (var i = $owlInsideEqual.length - 1; i >= 0; i--) { 619 UNCODE.setRowHeight($owlInsideEqual[i]); 620 }; 621 }, 300); 622 623 $(window).on('load', function(){ 624 var $elCarousel = $elSelector.data('owl.carousel'); 625 if ( typeof $elCarousel !== 'undefined' ) { 626 $elCarousel.trigger('refreshed'); 627 for (var i = $owlInsideEqual.length - 1; i >= 0; i--) { 628 UNCODE.setRowHeight($owlInsideEqual[i]); 629 }; 630 } 631 }); 632 633 $( document.body ).on( 'added-owl-item', function( e, carousel_id, $new_slide, randId ) { 634 if ( $('#' + carousel_id).data( 'added-id' ) != randId ) { 635 $('#' + carousel_id).data( 'added-id', randId ).trigger( 'add.owl.carousel', $new_slide ).trigger('refresh.owl.carousel'); 636 $('#' + carousel_id).find('.owl-item').each( function() { 637 var $item = $(this), 638 index = ( $item.index() + 1 ); 639 $item.attr('data-index', index); 640 }); 641 } 642 }); 643 644 if ( $('body').hasClass('compose-mode') && typeof window.parent.vc !== 'undefined' ) { 645 window.parent.vc.events.on( 'removed-owl-item', function( carousel_id, item_index, randId ) { 646 if ( $('#' + carousel_id).data( 'added-id' ) != randId ) { 647 $('#' + carousel_id).data( 'added-id', randId ).trigger('remove.owl.carousel', [ (item_index-1) ]).trigger('refresh.owl.carousel'); 648 $('#' + carousel_id).find('.owl-item').each( function() { 649 var $item = $(this), 650 index = ( $item.index() + 1 ); 651 $item.attr('data-index', index); 652 }); 653 } 654 }); 655 } 656 657 }); 658 659 function firstLoaded(el, event) { 660 var el = $(el), 661 uncode_slider = el.find('.uncode-slider'); 662 el.find('.owl-carousel').css('opacity', 1); 663 uncode_slider.addClass('slider-loaded'); 664 if (typeof UNCODE.bigText !== 'undefined') { 665 UNCODE.bigText(el.find('.owl-item.active')); 666 } 667 //if (!UNCODE.isMobile) { 668 requestTimeout(function() { 669 var lastDelayElems = animate_elems(el.find('.owl-item.index-active')); 670 var lastDelayThumb = animate_thumb(el.find('.owl-item.active .t-inside'), event); 671 if (uncode_slider.length && el.find('.owl-carousel').data('autoplay')) { 672 if (lastDelayElems == undefined) lastDelayElems = 0; 673 if (lastDelayThumb == undefined) lastDelayThumb = 0; 674 var maxDelay = Math.max(lastDelayElems, lastDelayThumb); 675 $('> .owl-carousel', uncode_slider).trigger('stop.owl.autoplay'); 676 requestTimeout(function() { 677 $('> .owl-carousel', uncode_slider).trigger('play.owl.autoplay'); 678 }, maxDelay); 679 } 680 }, 500); 681 682 //} 683 } 684 685 function navHover(el) { 686 var $owlCont = el, 687 $owlPrev = $owlCont.find('.owl-prev'), 688 $owlNext = $owlCont.find('.owl-next'), 689 $owlDots = $owlCont.find('.owl-dots-inside .owl-dots'), 690 $owlPagination = $owlCont.next(), 691 owlPrevW = $owlPrev.outerWidth(), 692 owlNextW = $owlNext.outerWidth(), 693 owlDotsH = $owlDots.innerHeight(), 694 owlTime = 400, 695 owlNested = $owlCont.parent().parent().hasClass('nested-carousel'); 696 if ( $('body').hasClass('rtl') ) { 697 $owlPrev.css("margin-right", -owlPrevW); 698 $owlNext.css("margin-left", -owlNextW); 699 } else { 700 $owlPrev.css("margin-left", -owlPrevW); 701 $owlNext.css("margin-right", -owlNextW); 702 } 703 if (!owlNested) $owlDots.css("bottom", -owlDotsH); 704 $owlCont.mouseenter(function() { 705 owlNested = $owlCont.parent().parent().hasClass('nested-carousel'); 706 $owlPrev.add($owlNext).css({ 707 marginLeft: 0, 708 marginRight: 0 709 }); 710 if (!owlNested) { 711 $owlDots.css({ 712 opacity: 1, 713 bottom: 0 714 }); 715 } 716 }).mouseleave(function() { 717 owlNested = $owlCont.parent().parent().hasClass('nested-carousel'); 718 if ( $('body').hasClass('rtl') ) { 719 $owlPrev.css("margin-right", -owlPrevW); 720 $owlNext.css("margin-left", -owlNextW); 721 } else { 722 $owlPrev.css("margin-left", -owlPrevW); 723 $owlNext.css("margin-right", -owlNextW); 724 } 725 if (!owlNested) { 726 $owlDots.css({ 727 opacity: 1, 728 bottom: -owlDotsH 729 }); 730 } 731 }); 732 }; 733 734 function animate_elems($this) { 735 var lastDelay; 736 $.each($('.animate_when_almost_visible:not(.t-inside), .animate_inner_when_almost_visible:not(.t-inside), .animate_when_parent_almost_visible:not(.t-inside)', $this), function(index, val) { 737 var element = $(val), 738 delayAttr = element.attr('data-delay'), 739 $first_item = element.closest('.owl-item[data-index="1"]'); 740 741 if ( $first_item.length && $first_item.attr('data-already-reached') !== 'true' && !$first_item.closest('#page-header').length ) { 742 return false;
743 } 744 745 if (delayAttr == undefined) delayAttr = 0; 746 requestTimeout(function() { 747 element.addClass('start_animation'); 748 }, delayAttr); 749 lastDelay = delayAttr; 750 }); 751 return lastDelay; 752 } 753 754 function animate_thumb(items, event) { 755 var lastDelay, 756 itemIndex, 757 thiis = $(event.currentTarget), 758 tempIndex = (thiis.data('tempIndex') == undefined) ? $('.owl-item.active', thiis).first().index() : thiis.data('tempIndex'), 759 numActives = $('.owl-item.active', thiis).length, 760 stagePadding = thiis.data('stagepadding'); 761 762 stagePadding = (stagePadding == undefined || stagePadding == 0) ? false : true; 763 764 thiis.data('tempIndex', event.item.index); 765 $.each(items, function(index, val) { 766 var parent = $(val).closest('.owl-item'); 767 if (UNCODE.isUnmodalOpen && !val.closest('#unmodal-content')) { 768 return; 769 } 770 if (!$(val).hasClass('start_animation')) { 771 if (parent.hasClass('active') || stagePadding || $owlWrapper.hasClass('carousel-animation-first')) { 772 var thumbInView = new Waypoint.Inview({ 773 context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, 774 element: val, 775 enter: function(direction) { 776 var element = $(this.element), 777 delayAttr = parseInt(element.attr('data-delay')), 778 itemIndex = element.closest('.owl-item').index() + 1, 779 diffItem = Math.abs(itemIndex - tempIndex) - 1; 780 if (itemIndex > tempIndex) { 781 thiis.data('tempIndex', itemIndex); 782 } 783 if (isNaN(delayAttr)) delayAttr = 100; 784 if (stagePadding) { 785 var objTimeout = requestTimeout(function() { 786 element.addClass('start_animation'); 787 }, index * delayAttr); 788 lastDelay = index * delayAttr; 789 } else { 790 $('.owl-item.cloned[data-index="'+(element.closest('.owl-item').data('index'))+'"] .t-inside', thiis).addClass('start_animation'); 791 var objTimeout = requestTimeout(function() { 792 element.addClass('start_animation'); 793 }, diffItem * delayAttr); 794 lastDelay = diffItem * delayAttr; 795 } 796 parent.data('objTimeout', objTimeout); 797 if (!UNCODE.isUnmodalOpen) { 798 this.destroy(); 799 } 800 } 801 }); 802 } 803 } 804 }); 805 return lastDelay; 806 } 807 808 function setItemsHeight(item) { 809 $.each($('.owl-item', item), function(index, val) { 810 var availableThumbHeight = $('.t-inside', $(val)).height(), 811 innerThumbHeight = $('.t-entry-text-tc', $(val)).outerHeight(), 812 difference = availableThumbHeight - innerThumbHeight; 813 if ($('.tmb-content-under', val).length) { 814 var visualPart = $('.t-entry-visual', val); 815 if (visualPart.length) { 816 difference -= $('.t-entry-visual', val).height(); 817 } 818 } 819 if (! $('.tmb-content-lateral', val).length) 820 $('.t-entry > *:last-child', val).css( 'transform', 'translateY('+difference+'px)' ); 821 }); 822 } 823 824 function setItemsRelHeight(item) { 825 $.each($('.owl-item', item), function(index, val) { 826 var $rowContainer = $(item).parents('.row-parent').eq(0), 827 paddingRow = parseInt($rowContainer.css('padding-top')) + parseInt($rowContainer.css('padding-bottom')), 828 $colContainer = $(item).parents('.uncell').eq(0), 829 paddingCol = parseInt($colContainer.css('padding-top')) + parseInt($colContainer.css('padding-bottom')), 830 winHeight = UNCODE.wheight, 831 multiplier_h = parseInt($(item).attr('data-vp-height')), 832 data_viewport_h, 833 consider_menu = $(item).data('vp-menu'); 834 835 if ( consider_menu ) { 836 winHeight = winHeight - UNCODE.menuHeight; 837 } 838 839 data_viewport_h = Math.ceil(winHeight / (100 / multiplier_h) ) - ( paddingRow + paddingCol ); 840 $('.t-inside', val).css( 'height', data_viewport_h ); 841 }); 842 } 843 844 function pauseOnHover(slider) { 845 var $owlCustomNavSels = slider.closest('.row').find('.uncode-nav-dots, .uncode-nav-prev, .uncode-nav-next'); 846 $('.owl-dots, .owl-prev, .owl-next', slider).add($owlCustomNavSels).on({ 847 mouseenter: function () { 848 $(slider).addClass('owl-mouseenter'); 849 $(slider).trigger('stop.owl.autoplay'); 850 }, 851 mouseleave: function () { 852 $(slider).removeClass('owl-mouseenter'); 853 $(slider).trigger('play.owl.autoplay'); 854 } 855 }); 856 } 857 }); 858}; 859 860UNCODE.owlPlayVideo = function(carousel) { 861 var player, iframe; 862 $('.owl-item.active .uncode-video-container', carousel).each(function(index, val) { 863 var content = $(val).html(); 864 if (content == '') { 865 var getCloned = $('.owl-item:not(.active) .uncode-video-container[data-id="'+$(this).attr('data-id')+'"]').children().first().clone(); 866 $(val).append(getCloned); 867 } 868 if ($(this).attr('data-provider') == 'vimeo') { 869 iframe = $(this).find('iframe'); 870 player = new Vimeo.Player(iframe[0]); 871 player.play(); 872 } else if ($(this).attr('data-provider') == 'youtube') { 873 if (youtubePlayers[$(this).attr('data-id')] != undefined) youtubePlayers[$(this).attr('data-id')].playVideo(); 874 } else { 875 var player = $(this).find('video'); 876 if (player.length) { 877 $(this).find('video')[0].volume = 0; 878 $(this).find('video')[0].play(); 879 $(val).css('opacity', 1); 880 } 881 } 882 }); 883}; 884 885UNCODE.owlStopVideo = function(carousel) { 886 $('.owl-item .uncode-video-container', carousel).each(function(index, val) { 887 var player, iframe; 888 if ($(this).attr('data-provider') == 'vimeo') { 889 iframe = $(this).find('iframe'); 890 player = new Vimeo.Player(iframe[0]); 891 player.pause(); 892 } else if ($(this).attr('data-provider') == 'youtube') { 893 if (youtubePlayers[$(this).attr('data-id')] != undefined) youtubePlayers[$(this).attr('data-id')].pauseVideo(); 894 } else { 895 var player = $(this).find('video'); 896 if (player.length) { 897 $(this).find('video')[0].volume = 0; 898 $(this).find('video')[0].play(); 899 } 900 } 901 }); 902}; 903 904 905})(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.