1 2(function($){var windowSel=$(window);var bodySel=$('body');var fixedSel=$('.mkhb-fixed');var stickySel=$('.mkhb-sticky');var normalRespNav=$('.mkhb-navigation-resp__normal');var stickyRespNav=$('.mkhb-navigation-resp__sticky');var windowHeight=windowSel.height();var adminBarHeight=0;function mkhbGetOffset(offset,device){var deviceEl=$('.mkhb-'+device);var $deviceHeight=deviceEl.height();var $offset=0;if(typeof offset==='string'&&offset!=='header'){$offset=Math.round((parseInt(offset)/100)*windowHeight)}else if(typeof offset==='number'){$offset=parseInt(offset)} 3if(0==$offset||isNaN($offset)){$offset=$deviceHeight;if(deviceEl.hasClass('mkhb-overlap')){$offset=deviceEl.children('.mkhb-device-container').height()}} 4if($deviceHeight>$offset){$offset=$deviceHeight} 5return $offset} 6function mkhbUpdateTop(){adminBarHeight=$('#wpadminbar').height();adminBarHeight=(adminBarHeight==null)?0:adminBarHeight} 7function mkhbSetFixedHeight(selector){selector.each(function(e){var thisSel=$(this);if(!thisSel.hasClass('mkhb-overlap')){var childHeight=thisSel.children('.mkhb-device-container').height();thisSel.height(childHeight)}})} 8function mkhbSlideDown(current,offset,device,curHeight){var onScroll=function onScroll(){var addOffset=mkhbAddRespNormal(offset,device);if(windowSel.scrollTop()>addOffset){current.css({'top':adminBarHeight});current.addClass('mkhb-sticky--active')}
8else{current.css({'top':-curHeight});current.removeClass('mkhb-sticky--active');current.find('.mkhb-search-el__overlay').removeClass('mkhb-search-el__overlay--show');mkhbHideRespBurger()}};onScroll();windowSel.on('scroll',onScroll)} 9function mkhbLazy(current,offset,device,curHeight){var lastScrollPos=0;var onScroll=function onScroll(){var addOffset=mkhbAddRespNormal(offset,device);var scrollPos=windowSel.scrollTop();if(scrollPos>addOffset&&scrollPos<lastScrollPos){current.css({'top':adminBarHeight});current.addClass('mkhb-sticky--active')}else{current.css({'top':-curHeight});current.removeClass('mkhb-sticky--active');current.find('.mkhb-search-el__overlay').removeClass('mkhb-search-el__overlay--show');mkhbHideRespBurger()} 10lastScrollPos=scrollPos};onScroll();windowSel.on('scroll',onScroll)} 11function mkhbHideRespBurger(){if(stickyRespNav.length<=0){return} 12if($('body[class*="mkhb-navigation-resp--opened"]')<=0){return} 13stickyRespNav.each(function(){var wrap=$(this);var id=wrap.attr('id').replace('-wrap','');var current=$('#'+id).find('.mkhb-navigation-resp');if(bodySel.hasClass('mkhb-navigation-resp--opened-'+id)){current.removeClass('is-active').find('.mkhb-navigation-resp__container').removeClass('fullscreen-active');bodySel.removeClass('mkhb-navigation-resp--opened-'+id).addClass('mkhb-navigation-resp--closed-'+id).trigger('mkhb-navigation-resp--closed-'+id);wrap.hide()}})} 14function mkhbAddRespNormal(offset,device){if(normalRespNav.length<=0){return offset} 15if($('body[class*="mkhb-navigation-resp--opened"]')<=0){return offset} 16var deviceEl=$('.mkhb-'+device);var deviceHeight=deviceEl.height();normalRespNav.each(function(){var current=$(this);var height=current.height();var id=current.attr('id').replace('-wrap','');if(bodySel.hasClass('mkhb-navigation-resp--opened-'+id)){var newOffset=deviceHeight+parseInt(height);if(newOffset>offset){offset=newOffset} 17return offset}});return offset} 18var resizeHeader=function resizeHeader(){var fixedRsz=$('.mkhb-fixed');if(fixedRsz.length>0){mkhbSetFixedHeight(fixedRsz)}} 19if(fixedSel.length>0){mkhbSetFixedHeight(fixedSel);windowSel.on('resize',resizeHeader)} 20var initialAction=function initialAction(){if(stickySel.length>0){stickySel.each(function(e){var current=$(this);var offset=current.data('offset');var device=current.data('device');offset=mkhbGetOffset(offset,device);mkhbUpdateTop();var curHeight=current.height();
20current.css({'top':-curHeight});var effect=current.data('effect');if(effect=='slide-down'){mkhbSlideDown(current,offset,device,curHeight)}else if(effect=='lazy'){mkhbLazy(current,offset,device,curHeight)}})}} 21windowSel.on('load',initialAction);windowSel.on('resize',mkhbUpdateTop)})(jQuery); 22 23 24 25(function($){var inlineContainer=$('.mkhb-col__container-inline');if(inlineContainer.length>0){inlineContainer.css('opacity','0');$.each(inlineContainer,function(key,value){var thisContainer=$(this);var thisChildren=thisContainer.children();if(thisChildren.length<1){return} 26var inlineStatus=!1;var inlineContent='';var inlineTypes=[];inlineTypes.left='';inlineTypes.center='';inlineTypes.right='';var countEls=thisChildren.length;$.each(thisChildren,function(key,value){elSel=$(this);--countEls;var elMarkup=elSel[0].outerHTML;var elDisplay='inline';var elAlign='left';if(elMarkup){elDisplay=elSel.data('display')||'block'} 27if('inline'==elDisplay){elAlign=elSel.data('align')||'left';inlineTypes[elAlign]+=elMarkup;elMarkup='';inlineStatus=!0} 28if(inlineStatus&&('block'==elDisplay||countEls<=0)){inlineContent+=setInlineContainer(inlineTypes);inlineStatus=!1;inlineTypes.left='';inlineTypes.center='';inlineTypes.right=''} 29inlineContent+=elMarkup});thisContainer.html(inlineContent)});inlineContainer.css('opacity','1')} 30function setInlineContainer(inlineElements){leftContainer='<div class="mkhb-col__container-inline__left">'+inlineElements.left+'</div>';rightContainer='<div class="mkhb-col__container-inline__right">'+inlineElements.right+'</div>';centerContainer='<div class="mkhb-col__container-inline__center">'+inlineElements.center+'</div>';if(''==inlineElements.center){centerContainer='';if(''==inlineElements.left){leftContainer=''} 31if(''==inlineElements.right){rightContainer=''}} 32if(''==inlineElements.left&&''==inlineElements.right){leftContainer='';rightContainer=''} 33columnContent='<div class="mkhb-col__container-inline__wrap">'+leftContainer+centerContainer+rightContainer+'</div>';return columnContent}})(jQuery); 34 35 36 37(function($) { 38 'use strict'; 39 40 var _toBuild = []; 41 MK.api = window.MK.api || {}; 42 43 MK.component.AdvancedGMaps = function(el) { 44 var $this = $(el), 45 container = document.getElementById( 'mk-theme-container' ), 46 data = $this.data( 'advancedgmaps-config' ), 47 apikey = data.options.apikey ? ('key='+data.options.apikey+'&') : false, 48 map = null, 49 bounds = null, 50 infoWindow = null, 51 position = null; 52 53 var build = function() { 54 data.options.scrollwheel = false; 55 data.options.mapTypeId = google.maps.MapTypeId[data.options.mapTypeId]; 56 data.options.styles = data.style; 57 58 bounds = new google.maps.LatLngBounds(); 59 map = new google.maps.Map(el, data.options); 60 infoWindow = new google.maps.InfoWindow(); 61 62 map.setOptions({ 63 panControl : data.options.panControl, 64 draggable: data.options.draggable, 65 zoomControl: data.options.zoomControl, 66 mapTypeControl: data.options.scaleControl, 67 scaleControl: data.options.mapTypeControl, 68 }); 69 70 var marker, i; 71 72 map.setTilt(45); 73 74 for (i = 0; i < data.places.length; i++) { 75 if(data.places[i].latitude && data.places[i].longitude) { 76 position = new google.maps.LatLng(data.places[i].latitude, data.places[i].longitude); 77 78 bounds.extend(position); 79 80 marker = new google.maps.Marker({ 81 position: position, 82 map: map, 83 title: data.places[i].address, 84 icon: (data.places[i].marker) ? data.places[i].marker : data.icon 85 }); 86 87 88 google.maps.event.addListener(marker, 'click', (function(marker, i) { 89 return function() { 90 if(data.places[i].address && data.places[i].address.length > 1) { 91 infoWindow.setContent('<div class="info_content"><p>'+ data.places[i].address +'</p></div>'); 92 infoWindow.open(map, marker); 93 } else { 94 infoWindow.setContent(''); 95 infoWindow.close(); 96 } 97 }; 98 })(marker, i)); 99 100 /** 101 * If there is only one marker, map.fitBounds will zoom-in too much. 102 * Only run map.fitBounds if the markers are more than 1. Use setCenter 103 * instead if the the marker is only 1. 104 */ 105 if ( i > 0 ) { 106 map.fitBounds( bounds ); 107 } else { 108 // Set latitude and longtitude as float. 109 var latLang = { 110 lat: parseFloat( data.places[i].latitude ), 111 lng: parseFloat( data.places[i].longitude ) 112 }; 113 map.setCenter( latLang ); 114 // Need to setZoom here as we didn't trigger bounds_changed event. 115 map.setZoom( data.options.zoom ); 116 } 117 } 118 } 119 120 var boundsListener = google.maps.event.addListener((map), 'bounds_changed', function(event) { 121 this.setZoom(data.options.zoom); 122 google.maps.event.removeListener(boundsListener); 123 }); 124 125 126 var update = function() { 127 google.maps.event.trigger(map, "resize"); 128 map.setCenter(position); 129 }; 130 update(); 131 132 133 var bindEvents = function() { 134 $( window ).on( 'resize', update ); 135 window.addResizeListener( container, update ); 136 }; 137 bindEvents(); 138 }; 139 140 141 var initAll = function() { 142 for( var i = 0, l = _toBuild.length; i < l; i++ ) { 143 _toBuild[i](); 144 } 145 }; 146 147 MK.api.advancedgmaps = MK.api.advancedgmaps || function() { 148 initAll(); 149 }; 150 151 return { 152 init : function() { 153 _toBuild.push( build ); 154 MK.core.loadDependencies(['https://maps.googleapis.com/ma
154ps/api/js?'+apikey+'callback=MK.api.advancedgmaps']); 155 } 156 }; 157 158 }; 159 160})(jQuery); 161(function($) { 162 'use strict'; 163 function mk_animated_cols() { 164 function equalheight (container){ 165 var currentTallest = 0, 166 currentRowStart = 0, 167 rowDivs = new Array(), 168 $el, 169 topPosition = 0; 170 $(container).each(function() { 171 172 $el = $(this); 173 $($el).height('auto'); 174 topPosition = $el.position().top; 175 176 if (currentRowStart != topPosition) { 177 for (var currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { 178 rowDivs[currentDiv].height(currentTallest); 179 } 180 rowDivs.length = 0; // empty the array 181 currentRowStart = topPosition; 182 currentTallest = $el.height(); 183 rowDivs.push($el); 184 } else { 185 rowDivs.push($el); 186 currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest); 187 } 188 for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { 189 rowDivs[currentDiv].height(currentTallest); 190 } 191 192 }); 193 194 // console.log('recalc' + container + ' ' + currentTallest); 195 196 return currentTallest; 197 } 198 199 200 function prepareCols(el) { 201 var $this = el.parent().parent().find('.mk-animated-columns'); 202 203 var iconHeight = equalheight('.vc_row .animated-column-icon, .animated-column-holder .mk-svg-icon'), 204 titleHeight = equalheight('.vc_row .animated-column-title'), 205 descHeight = equalheight('.vc_row .animated-column-desc'), 206 btnHeight = $this.find('.animated-column-btn').innerHeight(); 207 208 if ($this.hasClass('full-style')) { 209 $this.find('.animated-column-item').each(function() { 210 var $this = $(this), 211 contentHeight = (iconHeight + 30) + (titleHeight + 10) + (descHeight + 70) + 34; 212 /* 213 * Fix AM-2418. 214 * 215 * Column height setting of VC Animated Column doesn't work when Animated Column 216 * content is higher than the setting. So, check column height setting first. 217 * - If the column height setting < Animated Column height, update the column 218 * height based on column height setting. 219 */ 220 var $columnHeight = contentHeight * 1.5 + 50; 221 var $minHeight = parseInt( $this.css( 'min-height' ), 10 ); 222 if ( ! isNaN( $minHeight ) ) { 223 if ( $minHeight < $columnHeight ) { 224 $columnHeight = $minHeight; 225 } 226 } 227 228 $this.height( $columnHeight ); 229 230 var $box_height = $this.outerHeight(true), 231 $icon_height = $this.find('.animated-column-icon, .animated-column-holder .mk-svg-icon').height(); 232 233 $this.find('.animated-column-holder').css({ 234 'paddingTop': $box_height / 2 - $icon_height 235 }); 236 237 238 $this.animate({opacity:1}, 300); 239 }); 240 } else { 241 $this.find('.animated-column-item').each(function() { 242 var $this = $(this), 243 halfHeight = $this.height() / 2, 244 halfIconHeight = $this.find('.animated-column-icon, .animated-column-holder .mk-svg-icon').height()/2, 245 halfTitleHeight = $this.find('.animated-column-simple-title').height()/2; 246 247 $this.find('.animated-column-holder').css({ 248 'paddingTop': halfHeight - halfIconHeight 249 }); 250 251 $this.find('.animated-column-title').css({ 252 'paddingTop': halfHeight - halfTitleHeight 253 }); 254 255 $this.animate({ 256 opacity:1 257 }, 300); 258 259 }); 260 } 261 } 262 263 $('.mk-animated-columns').each(function() { 264 var that = this; 265 MK.core.loadDependencies([ MK.core.path.plugins + 'tweenmax.js' ], function() { 266 var $this = $(that), 267 $parent = $this.parent().parent(), 268 $columns = $parent.find('.column_container'), 269 index = $columns.index($this.parent()); 270 // really bad that we cannot read it before bootstrap - needs full shortcode refactor 271 272 if($this.hasClass('full-style')) { 273 $this.find('.animated-column-item').hover( 274 function() { 275 TweenLite.to($(this).find(".animated-column-holder"), 0.5, { 276 top: '-15%', 277 ease: Back.easeOut 278 }); 279 TweenLite.to($(this).find(".animated-column-desc"), 0.5, { 280 top: '50%', 281 ease: Expo.easeOut 282 }, 0.4); 283 TweenLite.to($(this).find(".animated-column-btn"), 0.3, { 284 top: '50%', 285 ease: Expo.easeOut 286 }, 0.6); 287 }, 288 function() { 289 290 TweenLite.to($(this).find(".animated-column-holder"), 0.5, { 291 top: '0%', 292 ease: Back.easeOut, easeParams:[3] 293 }); 294 TweenLite.to($(this).find(".animated-column-desc"), 0.5, { 295 top: '100%', 296 ease: Back.easeOut 297 }, 0.4); 298 TweenLite.to($(this).find(".animated-column-btn"), 0.5, { 299 top: '100%', 300 ease: Back.easeOut 301 }, 0.2); 302 }); 303 } 304 305 if($this.hasClass('simple-style')) { 306 $this.find('.animated-column-item').hover( 307 function() { 308 TweenLite.to($(this).find(".animated-column-holder"), 0.7, { 309 top: '100%', 310 ease: Expo.easeOut 311 }); 312 TweenLite.to($(this).find(".animated-column-title"), 0.7, { 313 top: '0%', 314 ease: Back.easeOut 315 }, 0.2); 316 }, 317 function() { 318 TweenLite.to($(this).find(".animated-column-holder"), 0.7, { 319 top: '0%', 320 ease: Expo.easeOut 321 }); 322 TweenLite.to($(this).find(".animated-column-title"), 0.7, { 323 top: '-100%', 324 ease: Back.easeOut 325 }, 0.2); 326 }); 327 } 328 329 if($columns.length === index + 1) { 330 prepareCols($this); 331 $(window).on("resize", function() { 332 setTimeout(prepareCols($this), 1000); 333 }); 334 } 335 336 MK.utils.eventManager.subscribe('iconsInsert', function() { 337 prepareCols($this); 338 }); 339 }); 340 341 }); 342 } 343 344 $(window).on('load vc_reload', mk_animated_cols); 345 346}(jQuery)); 347 348(function($) { 349 'use strict'; 350 351 var core = MK.core, 352 path = MK.core.path; 353 354 MK.component.BannerBuilder = function( el ) { 355 var init = function(){ 356 var $this = $(el), 357 data = $this.data( 'bannerbuilder-config' ); 358 359 MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.flexslider.js' ], function() { 360 $this.flexslider({ 361 selector: '.mk-banner-slides > .mk-banner-slide', 362 animation: data.animation, 363 smoothHeight: false, 364 direction:'horizontal', 365 slideshow: true, 366 slideshowSpeed: data.slideshowSpeed, 367 animationSpeed: data.animationSpeed, 368 pauseOnHover: true, 369 directionNav: data.directionNav, 370 controlNav: false, 371 initDelay: 2000,
372 prevText: '', 373 nextText: '', 374 pauseText: '', 375 playText: '' 376 }); 377 }); 378 }; 379 380 return { 381 init : init 382 }; 383 }; 384 385})(jQuery); 386 387 388 389 390 391 392 393 394(function($) { 395 'use strict'; 396 397 var zIndex = 0; 398 399 $('.mk-newspaper-wrapper').on('click', '.blog-loop-comments', function (event) { 400 event.preventDefault(); 401 402 var $this = $(event.currentTarget); 403 var $parent = $this.parents('.mk-blog-newspaper-item'); 404 405 $parent.css('z-index', ++zIndex); 406 $this.parents('.newspaper-item-footer').find('.newspaper-social-share').slideUp(200).end().find('.newspaper-comments-list').slideDown(200); 407 setTimeout( function() { 408 MK.utils.eventManager.publish('item-expanded'); 409 }, 300); 410 }); 411 412 $('.mk-newspaper-wrapper').on('click', '.newspaper-item-share', function (event) { 413 event.preventDefault(); 414 415 var $this = $(event.currentTarget); 416 var $parent = $this.parents('.mk-blog-newspaper-item'); 417 418 $parent.css('z-index', ++zIndex); 419 $this.parents('.newspaper-item-footer').find('.newspaper-comments-list').slideUp(200).end().find('.newspaper-social-share').slideDown(200); 420 setTimeout( function() { 421 MK.utils.eventManager.publish('item-expanded'); 422 }, 300); 423 }); 424 425 var init = function init() { 426 427 // setTimeout Trick to make the VC Front Editor to load the images as well 428 setTimeout( function() { 429 430 // Get All Related Layers 431 var $blog = $('.mk-blog-container'); 432 var $imgs = $blog.find('img[data-mk-image-src-set]'); 433 434 if ( $blog.hasClass('mk-blog-container-lazyload') && $imgs.length ) { 435 436 // Load Images if the user scrolls to them 437 $(window).on('scroll.mk_blog_lazyload', MK.utils.throttle(500, function(){ 438 $imgs.each(function(index, elem) { 439 if ( MK.utils.isElementInViewport(elem) ) { 440 MK.component.ResponsiveImageSetter.init( $(elem) ); 441 $imgs = $imgs.not( $(elem) ); // Remove element from the list when loaded to reduce the amount of iteration in each() 442 } 443 }); 444 })); 445 446 $(window).trigger('scroll.mk_blog_lazyload'); 447 $(window).trigger('resize') 448 449 // Handle the resize 450 MK.component.ResponsiveImageSetter.onResize($imgs); 451 452 } else { 453 454 MK.component.ResponsiveImageSetter.init($imgs); 455 MK.component.ResponsiveImageSetter.onResize($imgs); 456 457 } 458 459 }, 50); 460 461 // If in VC Editor Page, Trigger Resize after 2 second (AM-2490) 462 // This is to fix the Pagination Overlapping issue on first initial blog insert as it takes VC about 1 second to change the Blog Layout on initial stage 463 if ( $('body').hasClass('vc_editor') ) { 464 setTimeout( function() { 465 $(window).trigger('resize'); 466 }, 2000) 467 } 468 469 $('.featured-image').on('click', function (event) { 470 var $this = $(event.currentTarget); 471 472 if ( 473 $this.parents('.mk-jupiter-blog').length === 0 || 474 $this.parents( '.mk-blog-spotlight-item' ).length !== 0 475 ) { 476 return; 477 } 478 479 window.location.href = $this.find('.post-type-badge').attr('href'); 480 }) 481 } 482 483 init(); 484 485 // VC Front-End Editor 486 $(window).on('vc_reload mk-image-loaded', init); 487 488}(jQuery)); 489 490(function($) { 491 'use strict'; 492 493 var core = MK.core, 494 path = MK.core.path; 495 496 // TODO: Repair after Rifat. He repeated The same code twice - other same code is in photoalbum (why by the way?!). 497 // Split it into two separate components when you see reusage 498 MK.component.Category = function( el ) { 499 var init = function(){ 500 core.loadDependencies([ path.plugins + 'pixastic.js' ], function() {
501 blurImage($('.blur-image-effect .mk-loop-item .item-holder ')); 502 }); 503 504 core.loadDependencies([ path.plugins + 'minigrid.js' ], masonry); 505 }; 506 507 var blurImage = function($item) { 508 return $item.each(function() { 509 var $_this = $(this); 510 511 var img = $_this.find('.item-thumbnail'); 512 513 img.clone().addClass("blur-effect item-blur-thumbnail").removeClass('item-thumbnail').prependTo(this); 514 515 var blur_this = $(".blur-effect", this); 516 blur_this.each(function(index, element){ 517 if (img[index].complete === true) { 518 Pixastic.process(blur_this[index], "blurfast", {amount:0.5}); 519 } 520 else { 521 blur_this.load(function () { 522 Pixastic.process(blur_this[index], "blurfast", {amount:0.5}); 523 }); 524 } 525 }); 526 }); 527 }; 528 529 // TODO: find other shortcodes like this design and make it as a component 530 var masonry = function() { 531 if(!$('.js-masonry').length) return; 532 533 function grid() { 534 minigrid({ 535 container: '.js-masonry', 536 item: '.js-masonry-item', 537 gutter: 0 538 }); 539 } 540 541 grid(); 542 $(window).on('resize', grid); 543 }; 544 545 return { 546 init : init 547 }; 548 }; 549 550})(jQuery); 551 552 553 554 555 556 557 558 559(function($) { 560 'use strict'; 561 562 var core = MK.core, 563 path = core.path; 564 565 MK.component.Chart = function(el) { 566 var init = function() { 567 MK.core.loadDependencies([MK.core.path.plugins + 'jquery.easyPieChart.js'], function() { 568 $('.mk-chart__chart').each(function() { 569 var $this = $(this), 570 $parent_width = $(this).parent().width(), 571 $chart_size = parseInt($this.attr('data-barSize')); 572 573 if ($parent_width < $chart_size) { 574 $chart_size = $parent_width !== 0 ? $parent_width : $chart_size; 575 $this.css('line-height', $chart_size); 576 $this.find('i').css({ 577 'line-height': $chart_size + 'px' 578 }); 579 $this.css({ 580 'line-height': $chart_size + 'px' 581 }); 582 } 583 584 var build = function() { 585 $this.easyPieChart({ 586 animate: 1300, 587 lineCap: 'butt', 588 lineWidth: $this.attr('data-lineWidth'), 589 size: $chart_size, 590 barColor: $this.attr('data-barColor'), 591 trackColor: $this.attr('data-trackColor'), 592 scaleColor: 'transparent', 593 onStep: function(value) { 594 this.$el.find('.chart-percent span').text(Math.ceil(value)); 595 } 596 }); 597 }; 598 599 // refactored only :in-viewport logic. rest is to-do 600 MK.utils.scrollSpy(this, { 601 position: 'bottom', 602 after: build 603 }); 604 }); 605 }); 606 }; 607 608 return { 609 init: init 610 }; 611 }; 612 613})(jQuery); 614 615(function($) { 616 "use strict"; 617 618 $('.mk-clients.column-style').each(function() { 619 var $group = $(this), 620 $listItems = $group.find('li'), 621 listItemsCount = $listItems.length, 622 listStyle = $group.find('ul').attr('style') || '', 623 fullRowColumnsCount = $group.find('ul:first-of-type li').length; 624 625 function recreateGrid() { 626 var i; 627 628 $listItems.unwrap(); 629 630 if (window.matchMedia('(max-width: 550px)').matches && fullRowColumnsCount >= 1) { 631 for (i = 0; i < listItemsCount; i += 1) { 632 $listItems.slice(i, i + 1) 633 .wrapAll('<ul class="mk-clients-fixed-list" style="' + listStyle + '"></ul>'); 634 } 635 } else if (window.matchMedia('(max-width: 767px)').matches && fullRowColumnsCount >= 2) { 636 for (i = 0; i < listItemsCount; i += 2) { 637 $listItems.slice(i, i + 2) 638 .wrapAll('<ul class="mk-clients-fixed-list" style="' + listStyle + '"></ul>'); 639 } 640 } else if (window.matchMedia('(max-width: 960px)').matches && fullRowColumnsCount >= 3) { 641 for (i = 0; i < listItemsCount; i += 3) { 642 $listItems.slice(i, i + 3) 643 .wrapAll('<ul class="mk-clients-fixed-list" style="' + listStyle + '"></ul>'); 644 } 645 } else { 646 for (i = 0; i < listItemsCount; i += fullRowColumnsCount) { 647 $listItems.slice(i, i + fullRowColumnsCount) 648 .wrapAll('<ul style="' + listStyle + '"></ul>'); 649 } 650 } 651 } 652 653 recreateGrid(); 654 $(window).on('resize', recreateGrid); 655 656 }); 657 658}(jQuery)); 659(function($) { 660 'use strict'; 661 // Update countdown style in VC FEE - AM-2684. 662 $(window).on('vc_reload', function() { 663 $('.mk-event-countdown-ul').each(function() { 664 if ($(this).width() < 750) { 665 $(this).addClass('mk-event-countdown-ul-block'); 666 } else { 667 $(this).removeClass('mk-event-countdown-ul-block'); 668 } 669 }); 670 }); 671})(jQuery); 672(function($) { 673 'use strict'; 674 675 $('.mk-edge-slider').find('video').each(function() { 676 this.pause(); 677 this.currentTime = 0; 678 }); 679
680 MK.component.EdgeSlider = function( el ) { 681 var self = this, 682 $this = $( el ), 683 $window = $(window), 684 $wrapper = $this.parent(), 685 config = $this.data( 'edgeslider-config' ), 686 $nav = $( config.nav ), 687 $prev = $nav.find( '.mk-edge-prev' ), 688 $prevTitle = $prev.find( '.nav-item-caption' ), 689 $prevBg = $prev.find('.edge-nav-bg'), 690 $next = $nav.find( '.mk-edge-next' ), 691 $nextTitle = $next.find( '.nav-item-caption' ), 692 $nextBg = $next.find('.edge-nav-bg'), 693 $navBtns = $nav.find( 'a' ), 694 $pagination = $( '.swiper-pagination' ), 695 $skipBtn = $( '.edge-skip-slider' ), 696 $opacityLayer = $this.find('.edge-slide-content'), 697 $videos = $this.find('video'), 698 currentSkin = null, 699 currentPoint = null, 700 winH = null, 701 opacity = null, 702 offset = null; 703 704 var callbacks = { 705 onInitialize : function( slides ) { 706 self.$slides = $( slides ); 707 708 self.slideContents = $.map( self.$slides, function( slide ) { 709 var $slide = $( slide ), 710 title = $slide.find('.edge-slide-content .edge-title').first().text(), 711 skin = $slide.attr("data-header-skin"), 712 image = $slide.find('.mk-section-image').attr('data-thumb') || 713 $slide.find('.mk-video-section-touch').attr('data-thumb'), 714 bgColor = $slide.find('.mk-section-image').css('background-color'); 715 716 717 return { 718 skin: skin, 719 title: title, 720 image: image, 721 bgColor: bgColor 722 }; 723 }); 724 725 // Set position fixed here rather than css to avoid flash of strangely styled slides befor plugin init 726 if(MK.utils.isSmoothScroll) $this.css('position', 'fixed'); 727 728 setNavigationContent( 1, self.$slides.length - 1 ); 729 setSkin( 0 ); 730 // stopVideos(); 731 playVideo(0); 732 733 setTimeout( function() { 734 $( '.edge-slider-loading' ).fadeOut( '100' ); 735 }, 1000 ); 736 }, 737 738 onBeforeSlide : function( id ) { 739 740 }, 741 742 onAfterSlide : function( id ) { 743 setNavigationContent( nextFrom(id), prevFrom(id) ); 744 setSkin( id ); 745 stopVideos(); // stop all others if needed 746 playVideo( id ); 747 } 748 }; 749 750 751 var nextFrom = function nextFrom(id) { 752 return ( id + 1 === self.$slides.length ) ? 0 : id + 1; 753 }; 754 755 756 var prevFrom = function prevFrom(id) { 757 return ( id - 1 === -1 ) ? self.$slides.length - 1 : id - 1; 758 }; 759 760 761 var setNavigationContent = function( nextId, prevId ) { 762 if(self.slideContents[ prevId ]) { 763 $prevTitle.text( self.slideContents[ prevId ].title ); 764 $prevBg.css( 'background', 765 self.slideContents[ prevId ].image !== 'none' ? 766 'url(' + self.slideContents[ prevId ].image + ')' : 767 self.slideContents[ prevId ].bgColor ); 768 } 769 770 if(self.slideContents[ nextId ]) { 771 $nextTitle.text( self.slideContents[ nextId ].title ); 772 $nextBg.css( 'background', 773 self.slideContents[ nextId ].image !== 'none' ? 774 'url(' + self.slideContents[ nextId ].image + ')' : 775 self.slideContents[ nextId ].bgColor ); 776 } 777 }; 778 779 780 var setSkin = function setSkin( id ) { 781 currentSkin = self.slideContents[ id ].skin; 782 783 $navBtns.attr('data-skin', currentSkin); 784 $pagination.attr('data-skin', currentSkin); 785 $skipBtn.attr('data-skin', currentSkin); 786 787 if( self.config.firstEl ) { 788 MK.utils.eventManager.publish( 'firstElSkinChange', currentSkin ); 789 } 790 }; 791 792 793 var stopVideos = function stopVideos() { 794 $videos.each(function() { 795 this.pause(); 796 this.currentTime = 0; 797 }); 798 }; 799 800 801 var playVideo = function playVideo(id) { 802 var video = self.$slides.eq(id).find('video').get(0); 803 if(video) { 804 video.play(); 805 console.log('play video in slide nr ' + id); 806 } 807 808 }; 809 810 811 var onResize = function onResize() { 812 var height = $wrapper.height(); 813 $this.height( height ); 814 815 var width = $wrapper.width(); 816 $this.width( width ); 817 818 winH = $window.height(); 819 offset = $this.offset().top; 820 821 if(!MK.utils.isSmoothScroll) return; 822 if(MK.utils.isResponsiveMenuState()) { 823 // Reset our parallax layers position and styles when we're in responsive mode 824 $this.css({
825 '-webkit-transform': 'translateZ(0)', 826 '-moz-transform': 'translateZ(0)', 827 '-ms-transform': 'translateZ(0)', 828 '-o-transform': 'translateZ(0)', 829 'transform': 'translateZ(0)', 830 'position': 'absolute' 831 }); 832 $opacityLayer.css({ 833 'opacity': 1 834 }); 835 } else { 836 // or proceed with scroll logic when we assume desktop screen 837 onScroll(); 838 } 839 }; 840 841 var onScroll = function onScroll() { 842 currentPoint = - MK.val.scroll(); 843 844 if( offset + currentPoint <= 0 ) { 845 opacity = 1 + ((offset + currentPoint) / winH) * 2; 846 opacity = Math.min(opacity, 1); 847 opacity = Math.max(opacity, 0); 848 849 $opacityLayer.css({ 850 opacity: opacity 851 }); 852 } 853 854 $this.css({ 855 '-webkit-transform': 'translateY(' + currentPoint + 'px) translateZ(0)', 856 '-moz-transform': 'translateY(' + currentPoint + 'px) translateZ(0)', 857 '-ms-transform': 'translateY(' + currentPoint + 'px) translateZ(0)', 858 '-o-transform': 'translateY(' + currentPoint + 'px) translateZ(0)', 859 'transform': 'translateY(' + currentPoint + 'px) translateZ(0)', 860 'position': 'fixed' 861 }); 862 }; 863 864 onResize(); 865 $window.on('load', onResize); 866 $window.on('resize', onResize); 867 window.addResizeListener( $wrapper.get(0), onResize ); 868 869 if(MK.utils.isSmoothScroll) { 870 onScroll(); 871 $window.on('scroll', function() { 872 if(MK.utils.isResponsiveMenuState()) return; 873 window.requestAnimationFrame(onScroll); 874 }); 875 } 876 877 this.el = el; 878 this.config = $.extend( config, callbacks ); 879 this.slideContents = null; // cache slide contents 880 881 // Let mk_slider know it's EdgeSlider 882 this.config.edgeSlider = true; 883 }; 884 885 MK.component.EdgeSlider.prototype = { 886 init : function() { 887 // Inherit from Slider. add prototypes if needed 888 var slider = new MK.ui.Slider( this.el, this.config ); 889 slider.init(); 890 } 891 }; 892 893})(jQuery); 894 895(function ($) { 896 'use strict'; 897 898var init = function init() { 899 $('.mk-faq-wrapper').each( function() { 900 var $this = $(this); 901 var $filter = $this.find('.filter-faq'); 902 var $filterItem = $filter.find('a'); 903 var $faq = $this.find('.mk-faq-container > div'); 904 var currentFilter = ''; 905 906 $filterItem.on('click', function(e) { 907 var $this = $(this); 908 909 currentFilter = $this.data('filter'); 910 $filterItem.removeClass('current'); 911 $this.addClass('current'); 912 913 filterItems( currentFilter ); 914 915 e.preventDefault(); 916 }); 917 918 function filterItems( cat ) { 919 if( cat === '' ) { 920 $faq.slideDown(200).removeClass('hidden'); 921 return; 922 } 923 $faq.not( '.' + cat ).slideUp(200).addClass('hidden'); 924 $faq.filter( '.' + cat ).slideDown(200).removeClass('hidden'); 925 } 926 }); 927} 928init(); 929$(window).on('vc_reload', init); 930 931}( jQuery )); 932/* Flickr Feeds */ 933/* -------------------------------------------------------------------- */ 934(function ($) { 935 'use strict'; 936function mk_flickr_feeds() { 937 938 $('.mk-flickr-feeds').each(function() { 939 var $this = $(this), 940 apiKey = $this.attr('data-key'), 941 userId = $this.attr('data-userid'), 942 perPage = $this.attr('data-count'), 943 column = $this.attr('data-column'); 944 945 if ( ! $( '.mk-flickr-feeds' ).is( ':empty' ) ) { 946 return; 947 } 948 949 jQuery.getJSON('https://api.flickr.com/services/rest/?format=json&method=' + 'flickr.photos.search&api_key=' + apiKey + '&user_id=' + userId + '&&per_page=' + perPage + '&jsoncallback=?', function(data) { 950 951 jQuery.each(data.photos.photo, function(i, rPhoto) { 952 var basePhotoURL = 'http://farm' + rPhoto.farm + '.static.flickr.com/' + rPhoto.server + '/' + rPhoto.id + '_' + rPhoto.secret; 953 954 var thumbPhotoURL = basePhotoURL + '_q.jpg'; 955 var mediumPhotoURL = basePhotoURL + '.jpg'; 956 957 var photoStringStart = '<a '; 958 var photoStringEnd = 'title="' + rPhoto.title + '" rel="flickr-feeds" class="mk-lightbox flickr-item jupiter-donut-colitem" href="' + mediumPhotoURL + '"><img src="' + thumbPhotoURL + '" alt="' + rPhoto.title + '"/></a>;'; 959 var photoString = (i < perPage) ? photoStringStart + photoStringEnd : photoStringStart + photoStringEnd; 960 961 jQuery(photoString).appendTo($this); 962 }); 963 }); 964 }); 965 966} 967 mk_flickr_feeds(); 968 $( window ).on( 'vc_reload', mk_flickr_feeds ); 969})(jQuery); 970 971jQuery(function($) { 972 973 'use strict'; 974 975 // Get All Related Layers
976 var init = function init() { 977 var $gallery = $('.mk-gallery'); 978 var $imgs = $gallery.find('img[data-mk-image-src-set]'); 979 980 if ( $gallery.hasClass('mk-gallery-lazyload') && $imgs.length ) { 981 982 // Load Images if the user scrolls to them 983 $(window).on('scroll.mk_gallery_lazyload', MK.utils.throttle(500, function(){ 984 $imgs.each(function(index, elem) { 985 if ( MK.utils.isElementInViewport(elem) ) { 986 MK.component.ResponsiveImageSetter.init( $(elem) ); 987 $imgs = $imgs.not( $(elem) ); // Remove element from the list when loaded to reduce the amount of iteration in each() 988 } 989 }); 990 })); 991 992 $(window).trigger('scroll.mk_gallery_lazyload'); 993 994 // Handle the resize 995 MK.component.ResponsiveImageSetter.onResize($imgs); 996 997 } else { 998 999 MK.component.ResponsiveImageSetter.init($imgs); 1000 MK.component.ResponsiveImageSetter.onResize($imgs); 1001 1002 } 1003 } 1004 1005 init(); 1006 $(window).on('vc_reload mk-image-loaded', init); 1007 1008}); 1009 1010 1011 1012jQuery(function($) { 1013 1014 'use strict'; 1015 1016 // Get All Related Layers 1017 var init = function init() { 1018 var $image = $('.mk-image'); 1019 var $imgs = $image.find('img[data-mk-image-src-set]'); 1020 1021 if ( $image.hasClass('mk-image-lazyload') && $imgs.length ) { 1022 1023 // Load Images if the user scrolls to them 1024 $(window).on('scroll.mk_image_lazyload', MK.utils.throttle(500, function(){ 1025 $imgs.each(function(index, elem) { 1026 if ( MK.utils.isElementInViewport(elem) ) { 1027 MK.component.ResponsiveImageSetter.init( $(elem) ); 1028 $imgs = $imgs.not( $(elem) ); // Remove element from the list when loaded to reduce the amount of iteration in each() 1029 } 1030 }); 1031 })); 1032 1033 $(window).trigger('scroll.mk_image_lazyload'); 1034 1035 // Handle the resize 1036 MK.component.ResponsiveImageSetter.onResize($imgs); 1037 1038 } else { 1039 1040 MK.component.ResponsiveImageSetter.init($imgs); 1041 MK.component.ResponsiveImageSetter.onResize($imgs); 1042 1043 } 1044 } 1045 1046 init(); 1047 $(window).on('vc_reload mk-image-loaded', init); 1048 1049}); 1050 1051 1052 1053(function($) { 1054 'use strict'; 1055 1056 /* Page Section Intro Effects */ 1057 /* -------------------------------------------------------------------- */ 1058 1059 function mk_section_intro_effects() { 1060 if (!MK.utils.isMobile()) { 1061 if (!$.exists('.mk-page-section.intro-true')) return; 1062 1063 $('.mk-page-section.intro-true').each(function() { 1064 var that = this; 1065 MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.sectiontrans.js', MK.core.path.plugins + 'tweenmax.js' ], function() { 1066 var $this = $(that), 1067 $pageCnt = $this.parent().nextAll('div'), 1068 windowHeight = $(window).height(), 1069 effectName = $this.attr('data-intro-effect'), 1070 $header = $('.mk-header'); 1071 1072 var effect = { 1073 fade: new TimelineLite({paused: true}) 1074 .set($pageCnt, { opacity: 0, y: windowHeight * 0.3 }) 1075 .to($this, 1, { opacity: 0, ease:Power2.easeInOut }) 1076 .to($pageCnt, 1, { opacity: 1, y: 0, ease:Power2.easeInOut}, "-=.7") 1077 .set($this, { zIndex: '-1'}), 1078 1079 zoom_out: new TimelineLite({paused: true}) 1080 .set($pageCnt, { opacity: 0, y: windowHeight * 0.3}) 1081 .to($this, 1.5, { opacity: .8, scale: 0.8, y: -windowHeight - 100, ease:Strong.easeInOut }) 1082 .to($pageCnt, 1.5, { opacity: 1, y: 0, ease:Strong.easeInOut}, "-=1.3"), 1083 1084 shuffle: new TimelineLite({paused: true}) 1085 .to($this, 1.5, { y: -windowHeight/2, ease:Strong.easeInOut }) 1086 .to($pageCnt.first(), 1.5, { paddingTop: windowHeight/2, ease:Strong.easeInOut }, "-=1.3") 1087 }; 1088 1089 console.log($pageCnt); 1090 1091 1092 $this.sectiontrans({ 1093 effect: effectName 1094 }); 1095 1096 if($this.hasClass('shuffled')) { 1097 TweenLite.set($this, { y: -windowHeight/2 }); 1098 TweenLite.set($this.nextAll('div').first(), { paddingTop: windowHeight/2 }); 1099 } 1100 1101 $('body').on('page_intro', function() { 1102 MK.utils.scroll.disable(); 1103 $(this).data('intro', true); 1104 effect[effectName].play(); 1105 setTimeout(function() { 1106 $header.addClass('pre-sticky'); 1107 $header.addClass('a-sticky'); 1108 $('.mk-header-padding-wrapper').addClass('enable-padding'); 1109 $('body').data('intro', false); 1110 if(effectName === 'shuffle') $this.addClass('shuffled'); 1111 }, 1000); 1112
1113 setTimeout(MK.utils.scroll.enable, 1500); 1114 }); 1115 1116 $('body').on('page_outro', function() { 1117 MK.utils.scroll.disable(); 1118 $(this).data('intro', true); 1119 effect[effectName].reverse(); 1120 setTimeout(function() { 1121 $header.removeClass('pre-sticky'); 1122 $header.removeClass('a-sticky'); 1123 $('.mk-header-padding-wrapper').removeClass('enable-padding'); 1124 $('body').data('intro', false); 1125 if($this.hasClass('shuffled')) $this.removeClass('shuffled'); 1126 }, 1000); 1127 1128 setTimeout(MK.utils.scroll.enable, 1500); 1129 }); 1130 }); 1131 }); 1132 1133 } else { 1134 $('.mk-page-section.intro-true').each(function() { 1135 $(this).attr('data-intro-effect', ''); 1136 }); 1137 } 1138 } 1139 1140 mk_section_intro_effects(); 1141 1142 var debounceResize = null; 1143 $(window).on("resize", function() { 1144 if( debounceResize !== null ) { clearTimeout( debounceResize ); } 1145 debounceResize = setTimeout( mk_section_intro_effects, 300 ); 1146 }); 1147 1148 /* Page Section Adaptive Height */ 1149 /* -------------------------------------------------------------------- */ 1150 1151 function mk_section_adaptive_height() { 1152 $( ".mk-page-section.mk-adaptive-height" ).each( function() { 1153 var imageHeight = $( this ).find( ".mk-adaptive-image" ).height(); 1154 $( this ).css( "height", imageHeight ); 1155 }); 1156 } 1157 1158 $( window ).on( "load resize", mk_section_adaptive_height ); 1159 1160 1161 /* Page Section Image Loader */ 1162 /* -------------------------------------------------------------------- */ 1163 1164 // Get All Related Layers 1165 var init = function init() { 1166 var $allLayers = $('.mk-page-section .background-layer').filter(function(index) { 1167 var isLazyLoad = $(this).attr('data-mk-lazyload') === 'true'; 1168 if ( !isLazyLoad ) { 1169 MK.component.BackgroundImageSetter.init( $(this) ); 1170 } 1171 return isLazyLoad; 1172 });; 1173 1174 // Load BG Images if the user scroll to them 1175 if ( $allLayers.length ) { 1176 1177 $(window).on('scroll.mk_page_section_lazyload', MK.utils.throttle(500, function(){ 1178 $allLayers.each(function(index, elem) { 1179 if ( MK.utils.isElementInViewport(elem) ) { 1180 MK.component.BackgroundImageSetter.init( $(elem) ); 1181 $allLayers = $allLayers.not( $(elem) ); // Remove element from the list when loaded to reduce the amount of iteration in each() 1182 } 1183 }); 1184 })); 1185 1186 // First init 1187 $(window).trigger('scroll.mk_page_section_lazyload'); 1188 1189 // Handle the resize 1190 MK.component.BackgroundImageSetter.onResize($allLayers); 1191 1192 } 1193 } 1194 init(); 1195 1196 $(window).on('vc_reload', init); 1197 1198 /* Page Section Layout */ 1199 /* -------------------------------------------------------------------- */ 1200 1201 function mk_section_half_layout() { 1202 $(".mk-page-section.half_boxed").each(function() { 1203 var $section = $(this); 1204 if ($(window).width() > jupiterDonutVars.gridWidth) { 1205 var margin = ($(window).width() - jupiterDonutVars.gridWidth) / 2; 1206 var $section_inner = $section.find('.mk-half-layout-inner'); 1207 if($section.hasClass('half_left_layout')){ 1208 $section_inner.css({ 1209 marginRight: margin + 'px' 1210 }); 1211 } 1212 if($section.hasClass('half_right_layout')){ 1213 $section_inner.css({ 1214 marginLeft: margin + 'px' 1215 }); 1216 } 1217 } 1218 }); 1219 } 1220 1221 $(window).on("load resize", mk_section_half_layout); 1222 1223 /* Page Section - Fluid Width Equal Height Columns */ 1224 /* -------------------------------------------------------------------- */ 1225 function mk_reset_section_fluid_width_equal_height_columns() { 1226 var $colWrappers = '', maxWidth = 850; 1227 1228 $colWrappers = $('.page-section-content.fluid-width-equal-height-columns'); 1229 1230 $colWrappers.each(function() { 1231 var $colWrapper = '', colHeight = 0; 1232 $colWrapper = $(this); 1233 $colWrapper.find('.wpb_column.column_container').each(function() { 1234 var $col = $(this), size = $(this).children('div').length; 1235 if (size > 0) { 1236 $col.removeAttr("style"); 1237 $col.children('div').each(function() { 1238 var $this = $( this ); 1239 /** 1240 * Fix Advanced Google Maps (AGM) issue on page section. 1241 * 1242 * Problem: AGM set the height as inline CSS property (style attribute). 1243 * In this case, the style attribute will be removed before checking the 1244 * elements height in each of the column. That's why AGM container will 1245 * loose the height and the map can't be displayed properly (only 1px) 1246 * because it overlap other row in the page. We need to check if current 1247 * element is AGM or not before removing style attribute of the element. 1248 */ 1249 if ( ! $this.hasClass( 'mk-advanced-gmaps' ) ) { 1250 $this.removeAttr( 'style' ); 1251 } 1252 }); 1253 } 1254 }); 1255 }); 1256 } 1257 1258 function mk_section_fluid_width_equal_height_columns() { 1259 mk_reset_section_fluid_width_equal_height_columns(); 1260 1261 var $colWrappers = '', maxWidth = 850, $pageSection = $('.page-section-content'); 1262 1263 if ( ! $pageSection.hasClass('.fluid-width-equal-height-columns') ) { 1264 $pageSection.find('.wpb_column.column_container').removeAttr( 'style' ); 1265 $pageSection.find('.wpb_column.column_container .vc_element').removeAttr( 'style' ); 1266 } 1267 1268 $colWrappers = $('.page-section-content.fluid-width-equal-height-columns'); 1269 1270 $colWrappers.each(function() { 1271 var $colWrapper = '', colHeight = 0; 1272 $colWrapper = $(this); 1273 1274 if ($colWrapper.length > 0) { 1275 /* Get the minimum height of the wrapper */ 1276 colHeight = $colWrappers.outerHeight(true); 1277 $colWrapper.find('.wpb_column.column_container').each(function() { 1278 var $col = $(this); 1279 if ($col.length > 0) { 1280 colHeight = ($col.outerHeight(true) > colHeight) ? $col.outerHeight(true) : colHeight; 1281 } 1282 }); 1283 } 1284 1285 if (colHeight > 0) { 1286 $colWrapper.find('.wpb_column.column_container').each(function() { 1287 var $col = $(this), size = $(this).children('div').length; 1288 if (size > 0) { 1289 colHeight = ($(window).width() < maxWidth) ? 'initial' : colHe
1289ight; 1290 $col.css("height", colHeight); 1291 if ($colWrapper.hasClass('vertical-align-center')) { 1292 $col.children('div').each(function() { 1293 var elHeight = ($(window).width() < maxWidth) ? 'initial' : (colHeight/size); 1294 /** 1295 * Fix Advanced Google Maps (AGM) issue on page section. 1296 */ 1297 if ( ! $(this).hasClass( 'mk-advanced-gmaps' ) ) { 1298 $(this).css("height", elHeight); 1299 } 1300 }); 1301 } 1302 } 1303 }); 1304 } 1305 }); 1306 } 1307 $(window).on('load vc_reload', function() { 1308 setTimeout(function() { 1309 /* 1310 Somehow the values are not correctly updated for the screens 1311 and we need to put setTimeout to fix the issue. 1312 */ 1313 mk_section_fluid_width_equal_height_columns(); 1314 }, 500); 1315 }); 1316 1317 var debounceResize = null; 1318 $(window).on("resize", function() { 1319 if( debounceResize !== null ) { clearTimeout( debounceResize ); } 1320 debounceResize = setTimeout( mk_section_fluid_width_equal_height_columns(), 500 ); 1321 }); 1322 1323}(jQuery)); 1324 1325(function($) { 1326 'use strict'; 1327 1328 function mk_page_title_parallax() { 1329 if (!MK.utils.isMobile()) { 1330 1331 $('.mk-effect-wrapper').each(function() { 1332 var $this = $(this), 1333 progressVal, 1334 currentPoint, 1335 ticking = false, 1336 scrollY = MK.val.scroll(), 1337 $window = $(window), 1338 windowHeight = $(window).height(), 1339 parentHeight = $this.outerHeight(), 1340 startPoint = 0, 1341 endPoint = $this.offset().top + parentHeight, 1342 effectLayer = $this.find('.mk-effect-bg-layer'), 1343 gradientLayer = effectLayer.find('.mk-effect-gradient-layer'), 1344 cntLayer = $this.find('.mk-page-title-box-content'), 1345 animation = effectLayer.attr('data-effect'), 1346 top = $this.offset().top, 1347 height = $this.outerHeight(); 1348 1349 var parallaxSpeed = 0.7, 1350 zoomFactor = 1.3; 1351 1352 var parallaxTopGap = function() { 1353 var gap = top * parallaxSpeed; 1354 1355 effectLayer.css({ 1356 height : height + gap + 'px', 1357 top : (-gap) + 'px' 1358 }); 1359 }; 1360 1361 1362 if (animation == ("parallax" || "parallaxZoomOut") ) { 1363 parallaxTopGap(); 1364 } 1365 1366 var animationSet = function() { 1367 scrollY = MK.val.scroll(); 1368 1369 if (animation == "parallax") { 1370 currentPoint = (startPoint + scrollY) * parallaxSpeed; 1371 effectLayer.get(0).style.transform = 'translateY(' + currentPoint + 'px)'; 1372 } 1373 1374 if (animation == "parallaxZoomOut") { 1375 console.log(effectLayer); 1376 currentPoint = (startPoint + scrollY) * parallaxSpeed; 1377 progressVal = (1 / (endPoint - startPoint) * (scrollY - startPoint)); 1378 var zoomCalc = zoomFactor - ((zoomFactor - 1) * progressVal); 1379 1380 effectLayer.get(0).style.transform = 'translateY(' + currentPoint + 'px) scale(' + zoomCalc + ')'; 1381 } 1382 1383 if (animation == "gradient") { 1384 progressVal = (1 / (endPoint - startPoint) * (scrollY - startPoint)); 1385 gradientLayer.css({ 1386 opacity: progressVal * 2 1387 }); 1388 } 1389 1390 if (animation != "gradient") { 1391 progressVal = (1 / (endPoint - startPoint) * (scrollY - startPoint)); 1392 cntLayer.css({ 1393 opacity: 1 - (progressVal * 4) 1394 }); 1395 } 1396 1397 // Stop ticking 1398 ticking = false; 1399 }; 1400 animationSet(); 1401 1402 // This will limit the calculation of the background position to 1403 // 60fps as well as blocking it from running multiple times at once 1404 var requestTick = function() { 1405 if (!ticking) { 1406 window.requestAnimationFrame(animationSet); 1407 ticking = true; 1408 } 1409 }; 1410 1411 $window.off('scroll', requestTick); 1412 $window.on('scroll', requestTick); 1413 1414 }); 1415 } 1416 } 1417 1418 1419 var $window = $(window); 1420 var debounceResize = null; 1421 1422 $window.on('load', mk_page_title_parallax); 1423 $window.on("resize", function() { 1424 if( debounceResize !== null ) { clearTimeout( debounceResize ); } 1425 debounceResize = setTimeout( mk_page_title_parallax, 300 ); 1426 }); 1427 1428}(jQuery)); 1429 1430(function($) { 1431 'use strict'; 1432 var utils = MK.utils, 1433 core = MK.core, 1434 path = MK.core.path; 1435 MK.component.PhotoAlbum = function(el) { 1436 this.album = el; 1437 this.initialOpen = false;
1438 }; 1439 MK.component.PhotoAlbum.prototype = { 1440 dom: { 1441 gallery: '.slick-slider-wrapper', 1442 title: '.slick-title', 1443 galleryContainer: '.slick-slides', 1444 closeBtn: '.slick-close-icon', 1445 thumbList: '.slick-dots', 1446 thumbs: '.slick-dots li', 1447 imagesData: 'photoalbum-images', 1448 titleData: 'photoalbum-title', 1449 idData: 'photoalbum-id', 1450 urlData: 'photoalbum-url', 1451 activeClass: 'is-active' 1452 }, 1453 tpl: { 1454 gallery: '#tpl-photo-album', 1455 slide: '<div class="slick-slide"></div>' 1456 }, 1457 init: function() { 1458 this.cacheElements(); 1459 this.bindEvents(); 1460 this.openByLink(); 1461 }, 1462 cacheElements: function() { 1463 this.$album = $(this.album); 1464 this.imagesSrc = this.$album.data(this.dom.imagesData); 1465 this.albumLength = this.imagesSrc.length; 1466 this.title = this.$album.data(this.dom.titleData); 1467 this.id = this.$album.data(this.dom.idData); 1468 this.url = this.$album.data(this.dom.urlData); 1469 this.images = []; // stores dom objects to insert into gallery instance 1470 }, 1471 bindEvents: function() { 1472 this.$album.not('[data-photoalbum-images="[null]"]').on('click', this.albumClick.bind(this)); 1473 $(document).on('click', this.dom.closeBtn, this.closeClick.bind(this)); 1474 $(window).on('resize', this.thumbsVisibility.bind(this)); 1475 $(window).on('resize', this.makeArrows.bind(this)); 1476 }, 1477 albumClick: function(e) { 1478 e.preventDefault(); 1479 this.open(); 1480 MK.ui.loader.add(this.album); 1481 }, 1482 closeClick: function(e) { 1483 e.preventDefault(); 1484 // Because one close btn rules them all 1485 if (this.slider) { 1486 this.removeGallery(); 1487 this.slider.exitFullScreen(); 1488 } 1489 }, 1490 thumbsVisibility: function() { 1491 if (!this.thumbsWidth) return; 1492 if (window.matchMedia('(max-width:' + (this.thumbsWidth + 260) + 'px)').matches) this.hideThumbs(); // 260 is 2 * 120 - right corner buttons width + scrollbar 1493 else this.showThumbs(); 1494 }, 1495 hideThumbs: function() { 1496 if (!this.$thumbList) return; 1497 this.$thumbList.hide(); 1498 }, 1499 showThumbs: function() { 1500 if (!this.$thumbList) return; 1501 this.$thumbList.show(); 1502 }, 1503 open: function() { 1504 var self = this; 1505 core.loadDependencies([path.plugins + 'slick.js'], function() { 1506 self.createGallery(); 1507 self.loadImages(); 1508 }); 1509 }, 1510 createGallery: function() { 1511 // only one per page 1512 if (!$(this.dom.gallery).length) { 1513 var tpl = $(this.tpl.gallery).eq(0).html(); 1514 $('body').append(tpl); 1515 } 1516 // and cache obj 1517 this.$gallery = $(this.dom.gallery); 1518 this.$closeBtn = $(this.dom.closeBtn); 1519 }, 1520 createSlideshow: function() { 1521 var self = this; 1522 this.slider = new MK.ui.FullScreenGallery(this.dom.galleryContainer, { 1523 id: this.id, 1524 url: this.url 1525 }); 1526 this.slider.init(); 1527 $(window).trigger('resize'); 1528 this.makeArrows(); 1529 this.$thumbList = $(this.dom.thumbList); 1530 this.$thumbs = $(this.dom.thumbs); 1531 this.thumbsWidth = (this.$thumbs.length) * 95; 1532 this.thumbsVisibility(); 1533 setTimeout(function() { 1534 MK.ui.loader.remove(self.album); 1535 }, 100); 1536 MK.utils.eventManager.publish('photoAlbum-open'); 1537 }, 1538 makeArrows: function() { 1539 if (this.arrowsTimeout) clearTimeout(this.arrowsTimeout); 1540 this.arrowsTimeout = setTimeout(function() { 1541 var $prev = $('.slick-prev').find('svg'); 1542 var $next = $('.slick-next').find('svg'); 1543 $prev.wrap('<div class="slick-nav-holder"></div>'); 1544 $next.wrap('<div class="slick-nav-holder"></div>'); 1545 if (matchMedia("(max-width: 1024px)").matches) { 1546 $prev.attr({ 1547 width: 12, 1548 height: 22 1549 }).find('polyline').attr('points', '12,0 0,11 12,22'); 1550 $next.attr({ 1551 width: 12, 1552 height: 22 1553 }).find('polyline').attr('points', '0,0 12,11 0,22'); 1554 } else { 1555 $prev.attr({ 1556 width: 33, 1557 height: 65 1558 }).find('polyline').attr('points', '0.5,0.5 32.5,32.5 0.5,64.5'); 1559 $next.attr({ 1560 width: 33, 1561 height: 65 1562 }).find('polyline').attr('points', '0.5,0.5 32.5,32.5 0.5,64.5'); 1563 } 1564 }, 0); 1565 }, 1566 loadImages: function() { 1567 var self = this, 1568 n = 0; 1569 // cache images on first load. 1570 if (!this.images.length) {
1571 this.imagesSrc.forEach(function(src) { 1572 if (src === null) return; // protect from nulls 1573 var img = new Image(); 1574 img.onload = function() { 1575 self.onLoad(n += 1); 1576 }; 1577 img.src = src; 1578 self.images.push(img); 1579 }); 1580 } else { 1581 this.onLoad(this.albumLength); 1582 } 1583 }, 1584 onLoad: function(n) { 1585 if (n === this.albumLength) { 1586 this.insertImages(); 1587 this.showGallery(); 1588 this.createSlideshow(); 1589 } 1590 }, 1591 insertImages: function() { 1592 var $galleryContainer = this.$gallery.find(this.dom.galleryContainer), 1593 $title = $(this.dom.title), 1594 slide = this.tpl.slide; 1595 // clear first 1596 $galleryContainer.html(''); 1597 $title.html(this.title); 1598 this.images.forEach(function(img) { 1599 var $slide = $(slide); 1600 $slide.html(img); 1601 $galleryContainer.prepend($slide); 1602 }); 1603 }, 1604 showGallery: function() { 1605 var self = this; 1606 this.$gallery.addClass(this.dom.activeClass); 1607 utils.scroll.disable(); 1608 }, 1609 removeGallery: function() { 1610 var self = this; 1611 this.$gallery.removeClass(this.dom.activeClass); 1612 setTimeout(function() { 1613 self.$gallery.remove(); 1614 }, 300); 1615 utils.scroll.enable(); 1616 }, 1617 openByLink: function() { 1618 var loc = window.location, 1619 hash = loc.hash, 1620 id; 1621 if (hash.length && hash.substring(1).length) { 1622 id = hash.substring(1); 1623 id = id.replace('!loading', ''); 1624 if (id == this.id && !this.initialOpen) { 1625 this.initialOpen = true; 1626 this.open(); 1627 } 1628 } 1629 } 1630 }; 1631 // Barts note; Rifat duplication and coupling here. Remove it when have time 1632 MK.component.PhotoAlbumBlur = function(el) { 1633 var init = function() { 1634 core.loadDependencies([path.plugins + 'pixastic.js'], function() { 1635 blurImage($('.mk-album-item figure')); 1636 }); 1637 }; 1638 var blurImage = function($item) { 1639 return $item.each(function() { 1640 var $_this = $(this); 1641 var img = $_this.find('.album-cover-image'); 1642 img.clone().addClass("blur-effect item-blur-thumbnail").removeClass('album-cover-image').prependTo(this); 1643 var blur_this = $(".blur-effect", this); 1644 blur_this.each(function(index, element) { 1645 if (img[index].complete === true) { 1646 Pixastic.process(blur_this[index], "blurfast", { 1647 amount: 0.5 1648 }); 1649 } else { 1650 blur_this.load(function() { 1651 Pixastic.process(blur_this[index], "blurfast", { 1652 amount: 0.5 1653 }); 1654 }); 1655 } 1656 }); 1657 }); 1658 }; 1659 return { 1660 init: init 1661 }; 1662 }; 1663})(jQuery); 1664 1665jQuery(document).ready(function( $ ) { 1666 1667 // Continue only on Safari. 1668 if ( typeof window.safari === 'undefined' ) { 1669 return; 1670 } 1671 1672 // Fore redraw for Safari. This is a hack. 1673 function mkRedraw() { 1674 $('.mk-photo-roller').hide().show(0); 1675 } 1676 1677 mkRedraw(); 1678 1679 $( window ).resize( function() { 1680 mkRedraw() 1681 } ); 1682 1683}); 1684jQuery(function($) { 1685 1686 'use strict'; 1687 1688 // Get All Related Layers 1689 var init = function init() { 1690 var $portfolio = $('.portfolio-grid'); 1691 var $imgs = $portfolio.find('img[data-mk-image-src-set]'); 1692 1693 if ( $portfolio.hasClass('portfolio-grid-lazyload') && $imgs.length ) { 1694 1695 // Load Images if the user scrolls to them 1696 $(window).on('scroll.mk_portfolio_lazyload', MK.utils.throttle(500, function(){ 1697 $imgs.each(function(index, elem) { 1698 if ( MK.utils.isElementInViewport(elem) ) { 1699 MK.component.ResponsiveImageSetter.init( $(elem) ); 1700 $imgs = $imgs.not( $(elem) ); // Remove element from the list when loaded to reduce the amount of iteration in each() 1701 } 1702 }); 1703 })); 1704 1705 $(window).trigger('scroll.mk_portfolio_lazyload'); 1706 1707 // Handle the resize 1708 MK.component.ResponsiveImageSetter.onResize($imgs); 1709 1710 } else { 1711 1712 MK.component.ResponsiveImageSetter.init($imgs); 1713 MK.component.ResponsiveImageSetter.onResize($imgs); 1714 1715 } 1716 } 1717 1718 init(); 1719 $(window).on('vc_reload mk-image-loaded', function(){ 1720 init(); 1721 1722 $('.mk-portfolio-container').each(function(){ 1723 var id = $(this).attr('id'); 1724 var el = '#' + id + '.mk-portfolio-container.js-el'; 1725 1726 if($(this).data('mk-component') == 'Grid') { 1727 // Disable VC frontend component init for portfolio. 1728 $(el).data('init-Grid', true); 1729 1730 // Init Grid component on shortcode render. 1731 var component = new MK.component[ 'Grid' ]( el ); 1732 component.init(); 1733 } 1734 }); 1735 1736 }); 1737 1738}); 1739 1740 1741 1742jQuery(document).ready(function($) { 1743 'use strict'; 1744 /** 1745 * Get dynamic width of items for passing in `flexslider()`. 1746 * @param string style Style of the carousel, classic/modern 1747 * @param integer showItems Number of items to show 1748 * @param integer id ID of the carousel
1749 * @return interger The width for items 1750 */ 1751 function get_item_width(style, showItems, id) { 1752 var item_width; 1753 if (style == "classic") { 1754 item_width = 275; 1755 items_to_show = 4; 1756 } else { 1757 var screen_width = $('#portfolio-carousel-' + id).width(), 1758 items_to_show = showItems; 1759 if (screen_width >= 1100) { 1760 item_width = screen_width / items_to_show; 1761 } else if (screen_width <= 1200 && screen_width >= 800) { 1762 item_width = screen_width / 3; 1763 } else if (screen_width <= 800 && screen_width >= 540) { 1764 item_width = screen_width / 2; 1765 } else { 1766 item_width = screen_width; 1767 } 1768 } 1769 return item_width; 1770 } 1771 jQuery(window).on("load vc_reload", function() { 1772 MK.core.loadDependencies([MK.core.path.plugins + 'jquery.flexslider.js'], function() { 1773 1774 $('.portfolio-carousel .mk-flexslider').each(function() { 1775 var $this = $(this); 1776 var $pauseOnHover = $this.attr('data-pauseOnHover') == "true" ? true : false; 1777 var $slideshow = $this.attr('data-slideshow') == "true" ? true : false; 1778 1779 $this.flexslider({ 1780 selector: ".mk-flex-slides > li", 1781 animation: "slide", 1782 slideshowSpeed: parseInt($this.attr('data-slideshowSpeed')), 1783 animationSpeed: parseInt($this.attr('data-animationSpeed')), 1784 pauseOnHover: $pauseOnHover, 1785 controlNav: false, 1786 smoothHeight: false, 1787 useCSS: false, 1788 directionNav: $this.data('directionNav'), 1789 prevText: "", 1790 nextText: "", 1791 itemWidth: get_item_width($this.data('style'), $this.data('showItems'), $this.data('id')), 1792 itemMargin: 0, 1793 maxItems: ($this.data('style') === 'modern') ? $this.data('showItems') : 4, 1794 minItems: 1, 1795 move: 1, 1796 slideshow: $slideshow, 1797 }); 1798 }); // End each(). 1799 }); // End loadDependencies(). 1800 }); // End on(). 1801}); 1802 1803(function($) { 1804 if (window.addEventListener) { 1805 window.addEventListener('load', handleLoad, false); 1806 } 1807 else if (window.attachEvent) { 1808 window.attachEvent('onload', handleLoad); 1809 } 1810 1811 function handleLoad() { 1812 $('.mk-slideshow-box').each(run); 1813 } 1814 1815 function run() { 1816 var $slider = $(this); 1817 1818 var $slides = $slider.find('.mk-slideshow-box-item'); 1819 var $transition_time = $slider.data('transitionspeed'); 1820 var $time_between_slides = $slider.data('slideshowspeed'); 1821 1822 $slider.find('.mk-slideshow-box-content').children('p').filter(function() { 1823 if ( $.trim($(this).text()) == '' ) { 1824 return true; 1825 } 1826 }).remove(); 1827 1828 // set active classes 1829 $slides.first().addClass('active').fadeIn($transition_time, function(){ 1830 setTimeout(autoScroll, $time_between_slides); 1831 }); 1832 1833 // auto scroll 1834 function autoScroll(){ 1835 var $i = $slider.find('.active').index(); 1836 $slides.eq($i).removeClass('active').fadeOut($transition_time); 1837 if ($slides.length == $i + 1) $i = -1; // loop to start 1838 $slides.eq($i + 1).addClass('active').fadeIn($transition_time, function() { 1839 setTimeout(autoScroll, $time_between_slides); 1840 }); 1841 } 1842 1843 /** 1844 * Need to set the height manually as min-height property doesn't work with display 1845 * table and table-cell in Firefox and Safari. We use Javascript to set them only 1846 * for Firefox and Safari to avoid any problem with Chrome users. The problem is only 1847 * happen when the window screen size bigger than 850px. 1848 */ 1849 var browserName = MK.utils.browser.name; 1850 if ( browserName === 'Firefox' || browserName === 'Safari' ) { 1851 var currentWidth = parseInt( $( window ).width() ); 1852 if ( currentWidth >= 850 ) { 1853 var height = $slider.css( 'min-height' ); 1854 if ( typeof height !== 'undefined' ) { 1855 $slider.find( '.mk-slideshow-box-items' ).height( parseInt( height ) ); 1856 } 1857 } else { 1858 $slider.find( '.mk-slideshow-box-items' ).removeAttr( 'style' ); 1859 } 1860 } 1861 } 1862 $(window).on('vc_reload', function(){ 1863 handleLoad(); 1864 }); 1865 1866 // Handle resize event only for Safari and Firefox. 1867 window.addEventListener( 'resize', function(){ 1868 var browserName = MK.utils.browser.name; 1869 if ( browserName === 'Firefox' || browserName === 'Safari' ) { 1870 handleLoad(); 1871 } 1872 }, true); 1873}(jQuery)); 1874 1875(function($) { 1876 'use strict'; 1877 1878 $(".mk-subscribe").each(function() { 1879 var $this = $(this); 1880 1881 $this.find('.mk-subscribe--form').submit(function(e){ 1882 $this.addClass('form-in-progress'); 1883 e.preventDefault(); 1884 $.ajax({ 1885 url: MK.core.path.ajaxUrl, 1886 type: "POST", 1887 data: { 1888 action: "mk_ajax_subscribe", 1889 email: $this.find(".mk-subscribe--email").val(), 1890 list_id: $this.find(".mk-subscribe--list-id").val(), 1891 optin: $this.find(".mk-subscribe--optin").val() 1892 }, 1893 success: function (response) { 1894 console.log(response) 1895 $this.removeClass('form-in-progress'); 1896 var data = $.parseJSON(response), 1897 $messaage_box = $this.find(".mk-subscribe--message"); 1898 1899 $messaage_box.html(data.message); 1900 1901 if(data.action_status == true) { 1902 $messaage_box.addClass('success'); 1903 } else { 1904 $messaage_box.addClass('error'); 1905 } 1906 1907 $this.find(".mk-subscribe--email").val(''); 1908 1909 } 1910 }); 1911 }); 1912 }); 1913 1914}(jQuery)); 1915 1916(function( $ ) { 1917 'use strict'; 1918 1919 // If we want to get access to API of already initilised component we run a regular new conctructor. 1920 // When instance is discovered in cache object then we return exisiting instance. 1921 // 1922 // TODO move it to core functions and run logic on init
1923 // var init = function init() { 1924 var _instancesCollection = {}; 1925 1926 var MK = window.MK || {}; 1927 window.MK = MK; 1928 MK.component = window.MK.component || {}; 1929 1930 MK.component.SwipeSlideshow = function( el ) { 1931 var $this = $( el ); 1932 var id = $this.parent().attr('id'); 1933 1934 this.el = el; 1935 this.id = id; 1936 this.config = $this.data( 'swipeslideshow-config' ); 1937 if( this.config ) this.config.hasPagination = false; 1938 }; 1939 1940 MK.component.SwipeSlideshow.prototype = { 1941 init : function() { 1942 var slider = new MK.ui.Slider( this.el, this.config ); 1943 slider.init(); 1944 1945 _instancesCollection[ this.id ] = slider; 1946 } 1947 }; 1948 1949 1950 // Additional nav 1951 // Mostly for thumbs in woocommerce 1952 MK.component.SwipeSlideshowExtraNav = function( el ) { 1953 this.el = el; 1954 }; 1955 1956 MK.component.SwipeSlideshowExtraNav.prototype = { 1957 init : function init() { 1958 this.cacheElements(); 1959 this.bindEvents(); 1960 }, 1961 1962 cacheElements : function cacheElements() { 1963 var $this = $( this.el ); 1964 1965 this.sliderId = $this.data( 'gallery' ); 1966 this.slider = _instancesCollection[this.sliderId]; 1967 this.$thumbs = $( '#' + this.sliderId ).find( '.thumbnails a'); 1968 }, 1969 1970 bindEvents : function bindEvents() { 1971 this.$thumbs.on( 'click', this.clickThumb.bind( this ) ); 1972 }, 1973 1974 clickThumb : function clickThumb( e ) { 1975 e.preventDefault(); 1976 var $this = $( e.currentTarget ), 1977 id = $this.index(); 1978 1979 this.slider.goTo( id ); 1980 } 1981 }; 1982 1983 1984 // Mostly for switcher in woocommerce 1985 MK.utils.eventManager.subscribe('gallery-update', function(e, config) { 1986 if(typeof _instancesCollection[config.id] === 'undefined') return; 1987 _instancesCollection[config.id].reset(); 1988 }); 1989 1990 function init() { 1991 // Lazy load. 1992 // Get All Related Layers 1993 var $swiper = $('.mk-slider'); 1994 1995 if ( ! $swiper.hasClass('mk-slideshow') && ! $swiper.hasClass('mk-swipe-slideshow') ) { 1996 return; 1997 } 1998 1999 var $imgs = $swiper.find('img[data-mk-image-src-set]'); 2000 2001 if ( $swiper.hasClass('mk-swipe-slideshow-lazyload') && $imgs.length ) { 2002 2003 // Load Images if the user scrolls to them 2004 $(window).on('scroll.mk_swipe_slideshow_lazyload', MK.utils.throttle(500, function(){ 2005 $imgs.each(function(index, elem) { 2006 if ( MK.utils.isElementInViewport(elem) ) { 2007 MK.component.ResponsiveImageSetter.init( $(elem) ); 2008 $imgs = $imgs.not( $(elem) ); // Remove element from the list when loaded to reduce the amount of iteration in each() 2009 } 2010 }); 2011 })); 2012 2013 $(window).trigger('scroll.mk_swipe_slideshow_lazyload'); 2014 2015 // Handle the resize 2016 MK.component.ResponsiveImageSetter.onResize($imgs); 2017 2018 } else { 2019 2020 MK.component.ResponsiveImageSetter.init($imgs); 2021 MK.component.ResponsiveImageSetter.onResize($imgs); 2022 2023 } 2024 2025 /* Why we need to reinitialize it? it causes double sliding effect 2026 $( '.mk-swiper-container' ).each( function() { 2027 new MK.component.SwipeSlideshow( this ).init(); 2028 } ); 2029 */ 2030 2031 } 2032 2033 init(); 2034 $(window).on('vc_reload mk-image-loaded', init); 2035 2036})( jQuery ); 2037 2038(function($) { 2039 'use strict'; 2040 2041 var core = MK.core, 2042 path = core.path; 2043 2044 MK.component.Tooltip = function(el) { 2045 var init = function() { 2046 $('.mk-tooltip').each(function() { 2047 $(this).find('.mk-tooltip--link').hover(function() { 2048 $(this).siblings('.mk-tooltip--text').stop(true).animate({ 2049 'opacity': 1 2050 }, 400); 2051 2052 }, function() { 2053 $(this).siblings('.mk-tooltip--text').stop(true).animate({ 2054 'opacity': 0 2055 }, 400); 2056 }); 2057 }); 2058 }; 2059 2060 return { 2061 init: init 2062 }; 2063 }; 2064 2065})(jQuery); 2066 2067(function( $ ) { 2068 'use strict'; 2069 2070 /** 2071 * Fix issue with WC Recent Carousel classic style when SC is active. 2072 * At the first load of shortcode, the height is not correct, only cover the image 2073 * without product detail. This script only set the min-height. 2074 */ 2075 function mkWcCarouselSwiperHeight() { 2076 var mkWCRecentCarousel = $( '.mk-woocommerce-carousel.classic-style' ); 2077 mkWCRecentCarousel.each( function() { 2078 var maxHeight = 0; 2079 var height = $( this ).height(); 2080 var childs = $( this ).find( '.item' ); 2081 childs.each( function(){ 2082 if ( $( this ).height() > maxHeight ) { 2083 maxHeight = $( this ).height(); 2084 } 2085 } ); 2086 var swiperContainers = $( this ).find( '.mk-swiper-container' ); 2087 swiperContainers[0].style.setProperty( 'min-height', maxHeight + 'px', 'important' ); 2088 } ); 2089 } 2090 2091 mkWcCarouselSwiperHeight(); 2092 2093}
2093)( jQuery ); 2094(function ($) { 2095 'use strict'; 2096 2097 function dynamicHeight() { 2098 var $this = $( this ); 2099 2100 $this.height( 'auto' ); 2101 2102 if( window.matchMedia( '(max-width: 767px)' ).matches ) { 2103 return; 2104 } 2105 2106 $this.height( $this.height() ); 2107 } 2108 2109 var $window = $( window ); 2110 var container = document.getElementById( 'mk-theme-container' ); 2111 2112 function equalColumns() { 2113 $( '.equal-columns' ).each( function() { 2114 dynamicHeight.bind( this ); 2115 $window.on( 'load', dynamicHeight.bind( this ) ); 2116 $window.on( 'resize', dynamicHeight.bind( this ) ); 2117 $window.on( 'mk-image-loaded', dynamicHeight.bind( this ) ); 2118 window.addResizeListener( container, dynamicHeight.bind( this ) ); 2119 }); 2120 } 2121 2122 equalColumns(); 2123 2124 $window.on( 'vc_reload' , function() { 2125 equalColumns(); 2126 }); 2127 2128}( jQuery )); 2129 2130(function($) { 2131 'use strict'; 2132 2133 function mk_video_play() { 2134 2135 var lightboxMargin = 60; 2136 2137 // Play self hosted video 2138 function playSelfHosted($video, isLightbox) { 2139 if (isLightbox === undefined || typeof isLightbox === 'undefined') { 2140 isLightbox = false; 2141 } 2142 2143 if (isLightbox) { 2144 var content = $video.parent().html(); 2145 var src = $video.parent().find('source').attr('src'); 2146 2147 playLightbox({ 2148 content: '<div class="fancybox-video">' + $(content).attr('autoplay', 'autoplay').wrap('<div></div>').parent().html() + '</div>', 2149 src: src, 2150 }); 2151 2152 } else { 2153 playTagVideo($video); 2154 } 2155 } 2156 2157 // Play social hosted video 2158 function playSocialHosted($iframe, isLightbox) { 2159 2160 if (isLightbox === undefined || typeof isLightbox === 'undefined') { 2161 isLightbox = false; 2162 } 2163 2164 if (isLightbox) { 2165 playLightbox({ 2166 type: 'iframe', 2167 src: $iframe.attr('src'), 2168 }); 2169 2170 } else { 2171 2172 var videoData = getSocialVideoData($iframe.attr('src')); 2173 2174 switch (videoData.source) { 2175 case 'youtube': 2176 playTagIframeYoutube(videoData.videoId, $iframe); 2177 break; 2178 case 'vimeo': 2179 playTagIframeVimeo(videoData.videoId, $iframe); 2180 break; 2181 default: 2182 playTagIframe($iframe); 2183 break; 2184 } 2185 } 2186 } 2187 2188 // Play video in lightbox 2189 function playLightbox(args) { 2190 var options = { 2191 autoSize: 0, 2192 width: getVideoboxWidth(), 2193 height: getVideoHeight(), 2194 }; 2195 $.extend(options, args); 2196 $.fancybox.open(options); 2197 } 2198 2199 function playTagVideo($video) { 2200 $video.get(0).play(); 2201 $video.closest('.video-container').find('.video-thumbnail').fadeOut('slow'); 2202 } 2203 2204 function playTagIframe($iframe, videoId) { 2205 var video_loop = ''; 2206 if (videoId !== undefined && typeof videoId !== 'undefined') { 2207 video_loop = '&playlist=' + videoId; 2208 } 2209 2210 var src = $iframe.attr('src'); 2211 var separator = (src.indexOf('?') === -1) ? '?' : '&'; 2212 src += separator + 'autoplay=1'; 2213 separator = (src.indexOf('?') === -1) ? '?' : '&'; 2214 video_loop = separator + 'loop=1' + video_loop; 2215 video_loop = ( $iframe.closest('.video-container').data('loop') == '1' ) ? video_loop : ''; 2216 src += video_loop; 2217 $iframe.attr('src', src).closest('.video-container').find('.video-thumbnail').fadeOut(3000); 2218 } 2219 2220 function playTagIframeYoutube(videoId, $iframe) { 2221 2222 // Credit: https://goo.gl/ku3NgH 2223 if ( document.getElementById('mk_iframe_api') === null ) { 2224 var tag = document.createElement('script'); 2225 tag.src = "https://www.youtube.com/iframe_api"; 2226 tag.id = "mk_iframe_api"; 2227 var firstScriptTag = document.getElementsByTagName('script')[0]; 2228 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 2229 } else { 2230 runPlayer(); 2231 } 2232 2233 window.onYouTubeIframeAPIReady = function () { 2234 runPlayer(); 2235 }; 2236 2237 function runPlayer(){ 2238 var player, 2239 isPlayed = false; 2240 2241 player = new YT.Player('video-player-' + $iframe.data('id'), { 2242 videoId: videoId, 2243 rel: false, 2244 events: { 2245 onReady: function(e) { 2246 e.target.playVideo(); 2247 }, 2248 onStateChange: function(e) { 2249 let $playerWrapper = $('#video-player-' + $iframe.data('id')) 2250 2251 if (e.data === 1 && !isPlayed) { 2252 $playerWrapper.closest('.video-container').find('.video-thumbnail').fadeOut('slow'); 2253 isPlayed = true; 2254 } 2255 2256 if ($playerWrapper.closest('.video-container').data('loop') && e.data === YT.PlayerState.ENDED) { 2257 e.target.playVideo(); 2258 } 2259 }, 2260 onError: function(e) { 2261 playTagIframe($iframe, videoId); 2262 } 2263 } 2264 }); 2265 } 2266 } 2267 2268 function playTagIframeVimeo(videoId, $iframe) { 2269 // Embed async the vimeo API script 2270 $.getScript('//player.vimeo.com/api/player.js', function(data, textStatus, jqxhr) { 2271 if (jqxhr.status === 200) { 2272 2273 var player, 2274 isPlayed = false;
2275 2276 player = new Vimeo.Player('video-player-' + $iframe.data('id'), { 2277 id: videoId 2278 }); 2279 2280 player.play().then(function() { 2281 if (!isPlayed) { 2282 $iframe.closest('.video-container').find('.video-thumbnail').fadeOut('slow'); 2283 isPlayed = true; 2284 } 2285 }).catch(function(error) { 2286 playTagIframe($iframe); 2287 }); 2288 2289 if ($iframe.closest('.video-container').data('loop')) { 2290 player.setLoop(true).then(function(loop) { 2291 // Enable loop 2292 }).catch(function(error) { 2293 playTagIframe($iframe); 2294 }); 2295 } 2296 2297 } else { 2298 playTagIframe($iframe); 2299 } 2300 }); 2301 } 2302 2303 // Get Social Provider Video Data 2304 function getSocialVideoData(url) { 2305 2306 // Get Youtube video data 2307 var youtubeRegex = /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i; 2308 var youtubeMatch = url.match(youtubeRegex); 2309 if (youtubeMatch && youtubeMatch != null) { 2310 return { 2311 source: 'youtube', 2312 videoId: youtubeMatch[3] 2313 }; 2314 } 2315 2316 // Get Vimeo video data 2317 var vimeoRegex = /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/i; 2318 var vimeoMatch = url.match(vimeoRegex); 2319 if (vimeoMatch && vimeoMatch != null) { 2320 return { 2321 source: 'vimeo', 2322 videoId: vimeoMatch[1] 2323 }; 2324 } 2325 2326 return { 2327 source: false, 2328 videoId: false 2329 }; 2330 } 2331 2332 // Get lightbox width 2333 function getVideoboxWidth() { 2334 var $width, 2335 wWidth = $(window).width(), 2336 wHeight = $(window).height(); 2337 2338 if (wHeight >= wWidth) { 2339 2340 $width = wWidth - (lightboxMargin * 2); 2341 2342 } else { 2343 2344 var wHeightMax = (wHeight * 90) / 100; 2345 2346 if (wWidth > 1280) { 2347 var $width = (wHeightMax / 5768) * 10000; 2348 } else { 2349 var $width = (wHeightMax / 6120) * 10000; 2350 } 2351 2352 } 2353 2354 return Math.round($width) + 'px'; 2355 } 2356 2357 // Get lightbox height 2358 function getVideoHeight() { 2359 2360 var $height, 2361 wWidth = $(window).width(), 2362 wHeight = $(window).height(); 2363 2364 if (wHeight >= wWidth) { 2365 $height = ((wWidth - (lightboxMargin * 2)) * 5670) / 10000; 2366 } else { 2367 $height = ((wHeight * 90) / 100) + (lightboxMargin * 2); 2368 } 2369 return Math.round($height) + 'px'; 2370 } 2371 2372 $('.video-container').each(function() { 2373 2374 var $videoContainer = $(this); 2375 var playSource = $videoContainer.data('source'); 2376 var playTarget = $videoContainer.data('target'); 2377 var $iframe = $videoContainer.find('iframe'); 2378 var $video = $videoContainer.find('video'); 2379 2380 if ($videoContainer.data('autoplay')) { 2381 switch (playSource) { 2382 case 'social_hosted': 2383 playSocialHosted($iframe); 2384 break; 2385 case 'self_hosted': 2386 playSelfHosted($video); 2387 break; 2388 } 2389 } else { 2390 var $playIcon = $videoContainer.find('.mk-svg-icon'); 2391 $playIcon.bind('click', function(e) { 2392 e.preventDefault(); 2393 var isLightbox = (playTarget == 'lightbox') ? true : false; 2394 if (!isLightbox) { 2395 $playIcon.hide().next('.preloader-preview-area').show(); 2396 } 2397 switch (playSource) { 2398 case 'social_hosted': 2399 playSocialHosted($iframe, isLightbox); 2400 break; 2401 case 'self_hosted': 2402 playSelfHosted($video, isLightbox); 2403 break; 2404 } 2405 }); 2406 } 2407 }); 2408 } 2409 $(window).on('load vc_reload', mk_video_play); 2410 2411 // Resize icon size for responsive layout 2412 function mk_video_resize_play_icon() { 2413 $('.video-thumbnail-overlay').each(function() { 2414 var $thumbnailOverlay = $(this); 2415 var thumbnailWidth = $thumbnailOverlay.width(); 2416 var $svg = $thumbnailOverlay.find('svg'); 2417 if (typeof $svg.data('width') === 'undefined') { 2418 $svg.attr('data-width', $svg.width()); 2419 } 2420 if (typeof $svg.data('height') === 'undefined') { 2421 $svg.attr('data-height', $svg.height()); 2422 } 2423 if (($svg.data('width') * 4) > thumbnailWidth) { 2424 $svg.css({ 2425 width: Math.round((parseInt(thumbnailWidth) / 4)) + 'px', 2426 height: Math.round((parseInt(thumbnailWidth) / 4) * $svg.data('height') / $svg.data('width')) + 'px' 2427 }); 2428 } else { 2429 $svg.css({ 2430 width: $svg.data('width') + 'px', 2431 height: $svg.data('height') + 'px' 2432 }); 2433 } 2434 }); 2435 } 2436 $(window).on('load resize orientationChange vc_reload', mk_video_resize_play_icon); 2437}(jQuery)); 2438 2439 2440 2441document.documentElement.className+=" js_active ",document.documentElement.className+="ontouchstart"in document.documentElement?" vc_mobile ":" vc_desktop ",(()=>{for(var e=["-webkit-","-moz-","-ms-","-o-",""],t=0;t<e.length;t++)e[t]+"transform"in document.documentElement.style&&(document.documentElement.className+=" vc_transform ")})(),(c=>{"function"!=typeof window.vc_js&&(window.vc_js=function(){vc_toggleBehaviour(),vc_tabsBehaviour(),vc_accordionBehaviour(),vc_teaserGrid(),vc_carouselBehaviour(),vc_slidersBehaviour(),vc_prettyPhoto(),vc_pinterest(),vc_progress_bar(),vc_plugin_flexslider(),vc_gridBehaviour(),vc_rowBehaviour(),vc_prepareHoverBo
2441x(),vc_googleMapsPointer(),vc_ttaActivation(),vc_ttaToggleBehaviour(),jQuery(document).trigger("vc_js"),window.setTimeout(vc_waypoints,500)}),"function"!=typeof window.vc_plugin_flexslider&&(window.vc_plugin_flexslider=function(e){(e?e.find(".wpb_flexslider"):jQuery(".wpb_flexslider")).each(function(){var e=jQuery(this),t=1e3*parseInt(e.attr("data-interval"),10),i=e.attr("data-flex_fx"),o=0==t?!1:!0;e.is(":visible")&&setTimeout(function(){e.flexslider({animation:i,slideshow:o,slideshowSpeed:t,sliderSpeed:800,smoothHeight:!0})},1)})}),"function"!=typeof window.vc_googleplus&&(window.vc_googleplus=function(){var e,t;0<jQuery(".wpb_googleplus").length&&((e=document.createElement("script")).type="text/javascript",e.async=!0,e.src="https://apis.google.com/js/plusone.js",(t=document.getElementsByTagName("script")[0]).parentNode.insertBefore(e,t))}),"function"!=typeof window.vc_pinterest&&(window.vc_pinterest=function(){var e,t;0<jQuery(".wpb_pinterest").length&&((e=document.createElement("script")).type="text/javascript",e.async=!0,e.src="https://assets.pinterest.com/js/pinit.js",(t=document.getElementsByTagName("script")[0]).parentNode.insertBefore(e,t))}),"function"!=typeof window.vc_progress_bar&&(window.vc_progress_bar=function(){void 0!==jQuery.fn.vcwaypoint&&jQuery(".vc_progress_bar").each(function(){var e=jQuery(this);e.vcwaypoint(function(){e.find(".vc_single_bar").each(function(e){var t=jQuery(this).find(".vc_bar"),i=t.data("percentage-value");setTimeout(function(){t.css({width:i+"%"})},200*e)})},{offset:"85%"})})}),"function"!=typeof window.vc_waypoints&&(window.vc_waypoints=function(){void 0!==jQuery.fn.vcwaypoint&&jQuery(".wpb_animate_when_almost_visible:not(.wpb_start_animation)").each(function(){var e=jQuery(this);e.vcwaypoint(function(){e.addClass("wpb_start_animation animated")},{offset:"85%"})})}),"function"!=typeof window.vc_toggleBehaviour&&(window.vc_toggleBehaviour=function(e){function t(e){e&&e.preventDefault&&e.preventDefault();var t=jQuery(this).closest(".vc_toggle"),e=t.find(".vc_toggle_content");t.hasClass("vc_toggle_active")?e.slideUp({duration:300,complete:function(){t.removeClass("vc_toggle_active")}}):e.slideDown({duration:300,complete:function(){t.addClass("vc_toggle_active")}})}(e?e.hasClass("vc_toggle_title")?e.unbind("click"):e.find(".vc_toggle_title").off("click"):jQuery(".vc_toggle_title").off("click")).on("click",t)}),"function"!=typeof window.vc_ttaToggleBehaviour&&(window.vc_ttaToggleBehaviour=function(e){function t(){var e=jQuery(this);e.toggleClass("wpb-tta-toggle-active"),e.parent().parent().parent().find(".vc_pagination-item").each(function(){if(!c(this).hasClass("vc_active"))return c(this).find("a").click(),!1})}(e?e.find(".wpb-tta-toggle"):jQuery(".wpb-tta-toggle")).off("click").on("click",t),setTimeout(function(){jQuery(".wpb-tta-toggle").each(function(){var e=jQuery(this);e.parent().parent().parent().find(".vc_tta-panels-container .vc_pagination li:first").hasClass("vc_active")||e.addClass("wpb-tta-toggle-active")})},1e3)}),"function"!=typeof window.vc_tabsBehaviour&&(window.vc_tabsBehaviour=function(e){var t,o;jQuery.ui&&(e=e||jQuery(".wpb_tabs, .wpb_tour"),t=jQuery.ui&&jQuery.ui.version?jQuery.ui.version.split("."):"1.10",o=1===parseInt(t[0],10)&&parseInt(t[1],10)<9,e.each(function(){var e=jQuery(this).attr("data-interval"),t=[],i=jQuery(this).find(".wpb_tour_tabs_wrapper").tabs({show:function(e,t){wpb_prepare_tab_content(e,t)},activate:function(e,t){wpb_prepare_tab_content(e,t)}});if(e&&0<e)try{i.tabs("rotate",1e3*e)}catch(e){window.console&&window.console.warn&&console.warn("tabs behaviours error",e)}jQuery(this).find(".wpb_tab").each(function(){t.push(this.id)}),jQuery(this).find(".wpb_tabs_nav li").on("click",function(e){return e&&e.preventDefault&&e.preventDefault(),o?i.tabs("select",jQuery("a",this).attr("href")):i.tabs("option","active",jQuery(this).index()),!1}),jQuery(this).find(".wpb_prev_slide a, .wpb_next_slide a").on("click",function(e){var t;e&&e.preventDefault&&e.preventDefault(),o?(t=i.tabs("option","selected"),jQuery(this).parent().hasClass("wpb_next_slide")?t++:t--,t<0?t=i.tabs("length")-1:t>=i.tabs("length")&&(t=0),i.tabs("select",t)):(t=i.tabs("option","active"),e=i.find(".wpb_tab").length,t=jQuery(this).parent().hasClass("wpb_next_slide")?e<=t+1?0:t+1:t-1<0?e-1:t-1,i.tabs("option","active",t))})}))}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(){var e=jQuery(this),t=(e.attr("data-interval"),!isNaN(jQuery(this).data("active-tab"))&&0<parseInt(e.data("active-tab"),10)&&parseInt(e.data("active-tab"),10)-1),i=!1===t||"yes"===e.data("collapsible"),t=e.find(".wpb_accordion_wrapper").accordion({header:"> div > h3",autoHeight:!1,heightStyle:"content",active:t,collapsible:i,navigation:!0,activate:vc_accordionActivate,change:function(e,t){void 0!==jQuery.fn.isotope&&t.newContent.find(".
2441isotope").isotope("layout"),vc_carouselBehaviour(t.newPanel)}});!0===e.data("vcDisableKeydown")&&(t.data("uiAccordion")._keydown=function(){})})}),"function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){var o={fitrows:"fitRows",masonry:"masonry"};jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){var e=jQuery(this),t=e.find(".wpb_thumbnails"),i=t.attr("data-layout-mode");t.isotope({itemSelector:".isotope-item",layoutMode:void 0===o[i]?"fitRows":o[i]}),e.find(".categories_filter a").data("isotope",t).on("click",function(e){e&&e.preventDefault&&e.preventDefault();e=jQuery(this).data("isotope");jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"),e.isotope({filter:jQuery(this).attr("data-filter")})}),jQuery(window).on("load resize",function(){t.isotope("layout")})})}),"function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function(e){(e?e.find(".wpb_carousel"):jQuery(".wpb_carousel")).each(function(){var e=jQuery(this);!0!==e.data("carousel_enabled")&&e.is(":visible")&&(e.data("carousel_enabled",!0),getColumnsCount(jQuery(this)),jQuery(this).hasClass("columns_count_1"),(e=jQuery(this).find(".wpb_thumbnails-fluid li")).css({"margin-right":e.css("margin-left"),"margin-left":0}),(e=jQuery(this).find("ul.wpb_thumbnails-fluid")).width(e.width()+300))})}),"function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){jQuery(".wpb_gallery_slides").each(function(){var e,t,i=jQuery(this);i.hasClass("wpb_slider_nivo")?(0===(t=1e3*i.attr("data-interval"))&&(t=9999999999),jQuery.fn.nivoSlider&&!i.data("nivo-initialized")&&(i.data("nivo-initialized",!0),i.find(".nivoSlider").nivoSlider({effect:"boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",slices:15,boxCols:8,boxRows:4,animSpeed:800,pauseTime:t,startSlide:0,directionNav:!0,directionNavHide:!0,controlNav:!0,keyboardNav:!1,pauseOnHover:!0,manualAdvance:!1,prevText:"Prev",nextText:"Next"}))):i.hasClass("wpb_image_grid")&&i.find(".wpb_image_grid_ul")&&i.find(".wpb_image_grid_ul").isotope&&(jQuery.fn.imagesLoaded?e=i.find(".wpb_image_grid_ul").imagesLoaded(function(){e.isotope({itemSelector:".isotope-item",layoutMode:"fitRows",percentPosition:!0})}):i.find(".wpb_image_grid_ul").isotope({itemSelector:".isotope-item",layoutMode:"fitRows",percentPosition:!0}))})}),"function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){try{jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({animationSpeed:"normal",hook:"data-rel",padding:15,opacity:.7,showTitle:!0,allowresize:!0,counter_separator_label:"/",hideflash:!1,deeplinking:!1,modal:!1,callback:function(){-1<location.href.indexOf("#!prettyPhoto")&&(location.hash="")},social_tools:""})}catch(e){window.console&&window.console.warn&&window.console.warn("vc_prettyPhoto initialize error",e)}}),"function"!=typeof window.vc_google_fonts&&(window.vc_google_fonts=function(){return window.console&&window.console.warn&&window.console.warn("function vc_google_fonts is deprecated, no need to use it"),!1}),window.vcParallaxSkroll=!1,"function"!=typeof window.vc_rowBehaviour&&(window.vc_rowBehaviour=function(){var s=window.jQuery;function e(){var e;void 0!==window.wpb_disable_full_width_row_js&&window.wpb_disable_full_width_row_js||(e=s('[data-vc-full-width="true"]'),s.each(e,function(){var e,t,i,o,n,a,r,c=s(this),d=(c.addClass("vc_hidden"),c.next(".vc_row-full-width"));(d=d.length?d:c.parent().next(".vc_row-full-width")).length&&(c.removeAttr("data-vc-full-width-temp"),e=parseInt(c.css("margin-left"),10),t=parseInt(c.css("margin-right"),10),i=0-d.offset().left-e,o=s(window).width(),n={position:"relative",left:i="rtl"===c.css("direction")?(i=i-d.width()+o)+e+t:i,"box-sizing":"border-box",width:o,"max-width":o},c.css(n),c.data("vcStretchContent")||("rtl"===c.css("direction")?((a=i)<0&&(a=0),(r=i)<0&&(r=0)):(r=o-(a=(a=-1*i)<0?0:a)-d.width()+e+t)<0&&(r=0),c.css({"padding-left":a+"px","padding-right":r+"px"})),c.attr("data-vc-full-width-init","true"),c.removeClass("vc_hidden"),s(document).trigger("vc-full-width-row-single",{el:c,offset:i,marginLeft:e,marginRight:t,elFull:d,width:o,maxWidth:o}))}),s(document).trigger("vc-full-width-row",e))}function t(){var e,t,i=s(".vc_row-o-full-height:first");i.length&&(e=s(window).height(),(t=i.offset().top)<e)&&i.css("min-height",100-t/(e/100)+"vh"),s(document).trigger("vc-full-height-row",i)}s(window).off("resize.vcRowBehaviour").on("resize.vcRowBehaviour",e).on("resize.vcRowBehaviour",t),e(),t(),(0<window.navigator.userAgent.indexOf("MSIE ")||navigator.userAgent.match(/Trident.*rv\:11\./))&&s(".vc_row-o-full-height").each(function(){"flex"===s(this).css("display")&&s(this).wrap('<div class="vc_ie-flexbox-fixer"></div>')}
2441),vc_initVideoBackgrounds();var n=!1;if(window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(),s(".vc_parallax-inner").remove(),s("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"),s("[data-vc-parallax]").each(function(){var e,t,i,o;n=!0,"on"===s(this).data("vcParallaxOFade")&&s(this).children().attr("data-5p-top-bottom","opacity:0;").attr("data-30p-top-bottom","opacity:1;"),e=100*s(this).data("vcParallax"),(t=s("<div />").addClass("vc_parallax-inner").appendTo(s(this))).height(e+"%"),i=s(this).data("vcParallaxImage"),(o=vcExtractYoutubeId(i))?insertYoutubeVideoAsBackground(t,o):void 0!==i&&t.css("background-image","url("+i+")"),t.attr("data-bottom-top","top: "+-(e-100)+"%;").attr("data-top-bottom","top: 0%;")}),n&&window.skrollr)window.vcParallaxSkroll=skrollr.init({forceHeight:!1,smoothScrolling:!1,mobileCheck:function(){return!1}}),window.vcParallaxSkroll}),"function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()}),"function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(e){for(var t=!1,i=1;!1===t;){if(e.hasClass("columns_count_"+i))return t=!0,i;i++}}),"function"!=typeof window.wpb_prepare_tab_content&&(window.wpb_prepare_tab_content=function(e,t){var i=t.panel||t.newPanel,o=i.find(".vc_pie_chart:not(.vc_ready)"),n=i.find(".vc_round-chart"),a=i.find(".vc_line-chart"),r=i.find('[data-ride="vc_carousel"]');vc_carouselBehaviour(),vc_plugin_flexslider(i),t.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&t.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var e=jQuery(this).data("vcGrid");e&&e.gridBuilder&&e.gridBuilder.setMasonry&&e.gridBuilder.setMasonry()}),i.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&i.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var e=jQuery(this).data("vcGrid");e&&e.gridBuilder&&e.gridBuilder.setMasonry&&e.gridBuilder.setMasonry()}),o.length&&jQuery.fn.vcChat&&o.vcChat(),n.length&&jQuery.fn.vcRoundChart&&n.vcRoundChart({reload:!1}),a.length&&jQuery.fn.vcLineChart&&a.vcLineChart({reload:!1}),r.length&&jQuery.fn.carousel&&r.carousel("resizeAction"),t=i.find(".isotope, .wpb_image_grid_ul"),o=i.find(".wpb_gmaps_widget"),0<t.length&&t.isotope("layout"),o.length&&!o.is(".map_ready")&&((n=o.find("iframe")).attr("src",n.attr("src")),o.addClass("map_ready")),i.parents(".isotope").length&&i.parents(".isotope").each(function(){jQuery(this).isotope("layout")}),c(document).trigger("wpb_prepare_tab_content",i)}),"function"!=typeof window.vc_ttaActivation&&(window.vc_ttaActivation=function(){jQuery("[data-vc-accordion]").on("show.vc.accordion",function(e){var t=window.jQuery,i={};i.newPanel=t(this).data("vc.accordion").getTarget(),window.wpb_prepare_tab_content(e,i)})}),"function"!=typeof window.vc_accordionActivate&&(window.vc_accordionActivate=function(e,t){var i,o,n,a;t.newPanel.length&&t.newHeader.length&&(i=t.newPanel.find(".vc_pie_chart:not(.vc_ready)"),o=t.newPanel.find(".vc_round-chart"),n=t.newPanel.find(".vc_line-chart"),a=t.newPanel.find('[data-ride="vc_carousel"]'),void 0!==jQuery.fn.isotope&&t.newPanel.find(".isotope, .wpb_image_grid_ul").isotope("layout"),t.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&t.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var e=jQuery(this).data("vcGrid");e&&e.gridBuilder&&e.gridBuilder.setMasonry&&e.gridBuilder.setMasonry()}),vc_carouselBehaviour(t.newPanel),vc_plugin_flexslider(t.newPanel),i.length&&jQuery.fn.vcChat&&i.vcChat(),o.length&&jQuery.fn.vcRoundChart&&o.vcRoundChart({reload:!1}),n.length&&jQuery.fn.vcLineChart&&n.vcLineChart({reload:!1}),a.length&&jQuery.fn.carousel&&a.carousel("resizeAction"),t.newPanel.parents(".isotope").length)&&t.newPanel.parents(".isotope").each(function(){jQuery(this).isotope("layout")})}),"function"!=typeof window.initVideoBackgrounds&&(window.initVideoBackgrounds=function(){return window.console&&window.console.warn&&window.console.warn("this function is deprecated use vc_initVideoBackgrounds"),vc_initVideoBackgroun
2441ds()}),"function"!=typeof window.vc_initVideoBackgrounds&&(window.vc_initVideoBackgrounds=function(){c(".vc_video-bg").remove(),c("[data-vc-video-bg]").each(function(){var e,i=jQuery(this);i.data("vcVideoBg")?(e=i.data("vcVideoBg"),(e=vcExtractYoutubeId(e))&&(i.find(".vc_video-bg").remove(),insertYoutubeVideoAsBackground(i,e)),jQuery(window).on("grid:items:added",function(e,t){i.has(t).length&&vcResizeVideoBackground(i)})):i.find(".vc_video-bg").remove()})}),"function"!=typeof window.insertYoutubeVideoAsBackground&&(window.insertYoutubeVideoAsBackground=function(e,t,i){if("undefined"==typeof YT||void 0===YT.Player)return 100<(i=void 0===i?0:i)?void console.warn("Too many attempts to load YouTube api"):void setTimeout(function(){insertYoutubeVideoAsBackground(e,t,i++)},100);var o=e.prepend('<div class="vc_video-bg"><div class="inner"></div></div>').find(".inner");new YT.Player(o[0],{width:"100%",height:"100%",videoId:t,playerVars:{playlist:t,iv_load_policy:3,enablejsapi:1,disablekb:1,autoplay:1,controls:0,showinfo:0,rel:0,loop:1,mute:1,wmode:"transparent"},events:{onReady:function(e){e.target.mute().setLoop(!0)}}}),vcResizeVideoBackground(e),jQuery(window).on("resize",function(){vcResizeVideoBackground(e)})}),"function"!=typeof window.vcResizeVideoBackground&&(window.vcResizeVideoBackground=function(e){var t,i,o,n,a=e.innerWidth(),r=e.innerHeight();a/r<16/9?(t=r*(16/9),i=r,o=-Math.round((t-a)/2)+"px",n=-Math.round((i-r)/2)+"px"):(i=(t=a)*(9/16),n=-Math.round((i-r)/2)+"px",o=-Math.round((t-a)/2)+"px"),t+="px",i+="px",e.find(".vc_video-bg iframe").css({maxWidth:"1000%",marginLeft:o,marginTop:n,width:t,height:i})}),"function"!=typeof window.vcExtractYoutubeId&&(window.vcExtractYoutubeId=function(e){return void 0!==e&&null!==(e=e.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/))&&e[1]}),"function"!=typeof window.vc_googleMapsPointer&&(window.vc_googleMapsPointer=function(){var e=window.jQuery,t=e(".wpb_gmaps_widget");t.on("click",function(){e("iframe",this).css("pointer-events","auto")}),t.on("mouseleave",function(){e("iframe",this).css("pointer-events","none")}),e(".wpb_gmaps_widget iframe").css("pointer-events","none")}),"function"!=typeof window.vc_setHoverBoxPerspective&&(window.vc_setHoverBoxPerspective=function(e){e.each(function(){var e=jQuery(this),t=e.width();e.css("perspective",4*t+"px")})}),"function"!=typeof window.vc_setHoverBoxHeight&&(window.vc_setHoverBoxHeight=function(e){e.each(function(){var e=jQuery(this),t=e.find(".vc-hoverbox-inner"),i=(t.css("min-height",0),e.find(".vc-hoverbox-front-inner").outerHeight()),e=e.find(".vc-hoverbox-back-inner").outerHeight(),i=e<i?i:e;t.css("min-height",(i=i<250?250:i)+"px")})}),"function"!=typeof window.vc_prepareHoverBox&&(window.vc_prepareHoverBox=function(){var e=jQuery(".vc-hoverbox");vc_setHoverBoxHeight(e),vc_setHoverBoxPerspective(e)}),jQuery(document).ready(window.vc_prepareHoverBox),jQuery(window).on("resize",window.vc_prepareHoverBox),jQuery(document).ready(function(){window.vc_js()})})(window.jQuery); 2442 2443 2444 2445(()=>{var e=0,r={};function i(t){if(!t)throw new Error("No options passed to Waypoint constructor");if(!t.element)throw new Error("No element option passed to Waypoint constructor");if(!t.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=i.Adapter.extend({},i.defaults,t),this.element=this.options.element,this.adapter=new i.Adapter(this.element),this.callback=t.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=i.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=i.Context.findOrCreateByElement(this.options.context),i.offsetAliases[this.options.offset]&&(this.options.offset=i.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),r[this.key]=this,e+=1}i.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},i.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},i.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete r[this.key]},i.prototype.disable=function(){return this.enabled=!1,this},i.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},i.prototype.next=function(){return this.group.next(this)},i.prototype.previous=function(){return this.group.previous(this)},i.invokeAll=function(t){var e,i=[];for(e in r)i.push(r[e]);for(var o=0,n=i.length;o<n;o++)i[o][t]()},i.destroyAll=function(){i.invokeAll("destroy")},i.disableAll=function(){i.invokeAll("disable")}
2445,i.enableAll=function(){for(var t in i.Context.refreshAll(),r)r[t].enabled=!0;return this},i.refreshAll=function(){i.Context.refreshAll()},i.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},i.viewportWidth=function(){return document.documentElement.clientWidth},i.adapters=[],i.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},i.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.VcWaypoint=i})(),(()=>{function e(t){window.setTimeout(t,1e3/60)}var i=0,o={},u=window.VcWaypoint,t=window.onload;function n(t){this.element=t,this.Adapter=u.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,u.windowContext||(u.windowContext=!0,u.windowContext=new n(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}n.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},n.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical),i=this.element==this.element.window;t&&e&&!i&&(this.adapter.off(".vcwaypoints"),delete o[this.key])},n.prototype.createThrottledResizeHandler=function(){var t=this;function e(){t.handleResize(),t.didResize=!1}this.adapter.on("resize.vcwaypoints",function(){t.didResize||(t.didResize=!0,u.requestAnimationFrame(e))})},n.prototype.createThrottledScrollHandler=function(){var t=this;function e(){t.handleScroll(),t.didScroll=!1}this.adapter.on("scroll.vcwaypoints",function(){t.didScroll&&!u.isTouch||(t.didScroll=!0,u.requestAnimationFrame(e))})},n.prototype.handleResize=function(){u.Context.refreshAll()},n.prototype.handleScroll=function(){var t,e,i={},o={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(t in o){var n,r=o[t],s=r.newScroll>r.oldScroll?r.forward:r.backward;for(n in this.waypoints[t]){var a,l,h=this.waypoints[t][n];null!==h.triggerPoint&&(a=r.oldScroll<h.triggerPoint,l=r.newScroll>=h.triggerPoint,a&&l||!a&&!l)&&(h.queueTrigger(s),i[h.group.id]=h.group)}}for(e in i)i[e].flushTriggers();this.oldScroll={x:o.horizontal.newScroll,y:o.vertical.newScroll}},n.prototype.innerHeight=function(){return this.element==this.element.window?u.viewportHeight():this.adapter.innerHeight()},n.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},n.prototype.innerWidth=function(){return this.element==this.element.window?u.viewportWidth():this.adapter.innerWidth()},n.prototype.destroy=function(){var t,e=[];for(t in this.waypoints)for(var i in this.waypoints[t])e.push(this.waypoints[t][i]);for(var o=0,n=e.length;o<n;o++)e[o].destroy()},n.prototype.refresh=function(){var t,e,i=this.element==this.element.window,o=i?void 0:this.adapter.offset(),n={};for(e in this.handleScroll(),t={horizontal:{contextOffset:i?0:o.left,contextScroll:i?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:i?0:o.top,contextScroll:i?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}}){var r,s=t[e];for(r in this.waypoints[e]){var a,l=this.waypoints[e][r],h=l.options.offset,p=l.triggerPoint,c=0,d=null==p;l.element!==l.element.window&&(c=l.adapter.offset()[s.offsetProp]),"function"==typeof h?h=h.apply(l):"string"==typeof h&&(h=parseFloat(h),-1<l.options.offset.indexOf("%"))&&(h=Math.ceil(s.contextDimension*h/100)),a=s.contextScroll-s.contextOffset,l.triggerPoint=Math.floor(c+a-h),c=p<s.oldScroll,a=l.triggerPoint>=s.oldScroll,h=!c&&!a,!d&&(c&&a)?(l.queueTrigger(s.backward),n[l.group.id]=l.group):(!d&&h||d&&s.oldScroll>=l.triggerPoint)&&(l.queueTrigger(s.forward),n[l.group.id]=l.group)}}return u.requestAnimationFrame(function(){for(var t in n)n[t].flushTriggers()}),this},n.findOrCreateByElement=function(t){return n.findByElement(t)||new n(t)},n.refreshAll=function(){for(var t in o)o[t].refresh()},n.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){t&&t(),n.refreshAll()},u.requestAnimationFrame=function(t){(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||e).call(window,t)},u.Context=n})(),(()=>{function r(t,e){return t.triggerPoint-e.triggerPoint}function s(t,e){return e.triggerPoint-t.triggerPoint}var e={vertical:{},horizontal:{}},i=window.VcWaypoint;function o(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),e[this.axis][this.name]=this}o.prototype.add=function(t){this.waypoints.push(t)},o.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
2445ight:[]}},o.prototype.flushTriggers=function(){for(var t in this.triggerQueues){var e=this.triggerQueues[t];e.sort("up"===t||"left"===t?s:r);for(var i=0,o=e.length;i<o;i+=1){var n=e[i];!n.options.continuous&&i!==e.length-1||n.trigger([t])}}this.clearTriggerQueues()},o.prototype.next=function(t){this.waypoints.sort(r);t=i.Adapter.inArray(t,this.waypoints);return t===this.waypoints.length-1?null:this.waypoints[t+1]},o.prototype.previous=function(t){this.waypoints.sort(r);t=i.Adapter.inArray(t,this.waypoints);return t?this.waypoints[t-1]:null},o.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},o.prototype.remove=function(t){t=i.Adapter.inArray(t,this.waypoints);-1<t&&this.waypoints.splice(t,1)},o.prototype.first=function(){return this.waypoints[0]},o.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},o.findOrCreate=function(t){return e[t.axis][t.name]||new o(t)},i.Group=o})(),(()=>{var i=window.jQuery,t=window.VcWaypoint;function o(t){this.$element=i(t)}i.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(t,e){o.prototype[e]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[e].apply(this.$element,t)}}),i.each(["extend","inArray","isEmptyObject"],function(t,e){o[e]=i[e]}),t.adapters.push({name:"jquery",Adapter:o}),t.Adapter=o})(),(()=>{var n=window.VcWaypoint;function t(o){return function(){var e=[],i=arguments[0];return o.isFunction(arguments[0])&&((i=o.extend({},arguments[1])).handler=arguments[0]),this.each(function(){var t=o.extend({},i,{element:this});"string"==typeof t.context&&(t.context=o(this).closest(t.context)[0]),e.push(new n(t))}),e}}window.jQuery&&(window.jQuery.fn.vcwaypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.vcwaypoint=t(window.Zepto))})(); 2446 2447
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.