1(function($) { 2 3 var isBuilder = $('html').hasClass('is-builder'); 4 5 $.extend($.easing, { 6 easeInOutCubic: function(x, t, b, c, d) { 7 if ((t /= d / 2) < 1) return c / 2 * t * t * t + b; 8 return c / 2 * ((t -= 2) * t * t + 2) + b; 9 } 10 }); 11 12 $.fn.outerFind = function(selector) { 13 return this.find(selector).addBack(selector); 14 }; 15 16 $.fn.footerReveal = function() { 17 var $this = $(this); 18 var $prev = $this.prev(); 19 var $win = $(window); 20 var isIE = !!document.documentMode; 21 22 function initReveal() { 23 if (!isIE && $this.outerHeight() <= $win.outerHeight()) { 24 $this.css({ 25 'z-index': -999, 26 position: 'fixed', 27 bottom: 0 28 }); 29 30 $this.css({ 31 'width': $prev.outerWidth() 32 }); 33 34 $prev.css({ 35 'margin-bottom': $this.outerHeight() 36 }); 37 } else { 38 $this.css({ 39 'z-index': '', 40 position: '', 41 bottom: '' 42 }); 43 44 $this.css({ 45 'width': '' 46 }); 47 48 $prev.css({ 49 'margin-bottom': '' 50 }); 51 } 52 } 53 54 initReveal(); 55 56 $win.on('load resize', function() { 57 initReveal(); 58 }); 59 60 return this; 61 }; 62 63 (function($, sr) { 64 // debouncing function from John Hann 65 // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ 66 var debounce = function(func, threshold, execAsap) { 67 var timeout; 68 69 return function debounced() { 70 var obj = this, 71 args = arguments; 72 73 function delayed() { 74 if (!execAsap) func.apply(obj, args); 75 timeout = null; 76 } 77 78 if (timeout) clearTimeout(timeout); 79 else if (execAsap) func.apply(obj, args); 80 81 timeout = setTimeout(delayed, threshold || 100); 82 }; 83 }; 84 // smartresize 85 jQuery.fn[sr] = function(fn) { 86 return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); 87 }; 88 89 })(jQuery, 'smartresize'); 90 91 (function() { 92 93 var scrollbarWidth = 0, 94 originalMargin, touchHandler = function(event) { 95 event.preventDefault(); 96 }; 97 98 function getScrollbarWidth() { 99 if (scrollbarWidth) return scrollbarWidth; 100 var scrollDiv = document.createElement('div'); 101 $.each({ 102 top: '-9999px', 103 width: '50px', 104 height: '50px', 105 overflow: 'scroll', 106 position: 'absolute' 107 }, function(property, value) { 108 scrollDiv.style[property] = value; 109 }); 110 $('body').append(scrollDiv); 111 scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; 112 $('body')[0].removeChild(scrollDiv); 113 return scrollbarWidth; 114 } 115 116 })(); 117 118 $.isMobile = function(type) { 119 var reg = []; 120 var any = { 121 blackberry: 'BlackBerry', 122 android: 'Android', 123 windows: 'IEMobile', 124 opera: 'Opera Mini', 125 ios: 'iPhone|iPad|iPod' 126 }; 127 type = 'undefined' == $.type(type) ? '*' : type.toLowerCase(); 128 if ('*' == type) reg = $.map(any, function(v) { 129 return v; 130 }); 131 else if (type in any) reg.push(any[type]); 132 return !!(reg.length && navigator.userAgent.match(new RegExp(reg.join('|'), 'i'))); 133 }; 134 135 var isSupportViewportUnits = (function() { 136 // modernizr implementation 137 var $elem = $('<div style="height: 50vh; position: absolute; top: -1000px; left: -1000px;">').appendTo('body'); 138 var elem = $elem[0]; 139 var height = parseInt(window.innerHeight / 2, 10); 140 var compStyle = parseInt((window.getComputedStyle ? getComputedStyle(elem, null) : elem.currentStyle)['height'], 10); 141 $elem.remove(); 142 return compStyle == height; 143 }()); 144 145 $(function() { 146 147 $('html').addClass($.isMobile() ? 'mobile' : 'desktop'); 148 149 // .mbr-navbar--sticky 150 $(window).scroll(function() { 151 $('.mbr-navbar--sticky').each(function() { 152 var method = $(window).scrollTop() > 10 ? 'addClass' : 'removeClass'; 153 $(this)[method]('mbr-navbar--stuck') 154 .not('.mbr-navbar--open')[method]('mbr-navbar--short'); 155 }); 156 }); 157 158 if ($.isMobile() && navigator.userAgent.match(/Chrome/i)) { // simple fix for Chrome's scrolling 159 (function(width, height) { 160 var deviceSize = [width, width]; 161 deviceSize[height > width ? 0 : 1] = height; 162 $(window).smartresize(function() { 163 var windowHeight = $(window).height(); 164 if ($.inArray(windowHeight, deviceSize) < 0) 165 windowHeight = deviceSize[$(window).width() > windowHeight ? 1 : 0]; 166 $('.mbr-section--full-height').css('height', windowHeight + 'px'); 167 }); 168 })($(window).width(), $(window).height()); 169 } else if (!isSupportViewportUnits) { // fallback for .mbr-section--full-height 170 $(window).smartresize(function() { 171 $('.mbr-section--full-height').css('height', $(window).height() + 'px'); 172 }); 173 $(document).on('add.cards', function(event) { 174 if ($('html').hasClass('mbr-site-loaded') && $(event.target).outerFind('.mbr-section--full-height').length) 175 $(window).resize(); 176 }); 177 } 178 179 // .mbr-section--16by9 (16 by 9 blocks autoheight) 180 function calculate16by9() { 181 $(this).css('height', $(this).parent().width() * 9 / 16);
182 } 183 $(window).smartresize(function() { 184 $('.mbr-section--16by9').each(calculate16by9); 185 }); 186 $(document).on('add.cards changeParameter.cards', function(event) { 187 var enabled = $(event.target).outerFind('.mbr-section--16by9'); 188 if (enabled.length) { 189 enabled 190 .attr('data-16by9', 'true') 191 .each(calculate16by9); 192 } else { 193 $(event.target).outerFind('[data-16by9]') 194 .css('height', '') 195 .removeAttr('data-16by9'); 196 } 197 }); 198 199 // .mbr-parallax-background 200 function initParallax(card) { 201 setTimeout(function() { 202 $(card).outerFind('.mbr-parallax-background') 203 .jarallax({ 204 speed: 0.6 205 }) 206 .css('position', 'relative'); 207 }, 0); 208 } 209 210 function destroyParallax(card) { 211 $(card).jarallax('destroy').css('position', ''); 212 } 213 214 if ($.fn.jarallax && !$.isMobile()) { 215 $(window).on('update.parallax', function(event) { 216 setTimeout(function() { 217 var $jarallax = $('.mbr-parallax-background'); 218 219 $jarallax.jarallax('coverImage'); 220 $jarallax.jarallax('clipContainer'); 221 $jarallax.jarallax('onScroll'); 222 }, 0); 223 }); 224 225 if (isBuilder) { 226 $(document).on('add.cards', function(event) { 227 initParallax(event.target); 228 $(window).trigger('update.parallax'); 229 }); 230 231 $(document).on('changeParameter.cards', function(event, paramName, value, key) { 232 if (paramName === 'bg') { 233 destroyParallax(event.target); 234 235 switch (key) { 236 case 'type': 237 if (value.parallax === true) { 238 initParallax(event.target); 239 } 240 break; 241 case 'value': 242 if (value.type === 'image' && value.parallax === true) { 243 initParallax(event.target); 244 } 245 break; 246 case 'parallax': 247 if (value.parallax === true) { 248 initParallax(event.target); 249 } 250 } 251 } 252 253 $(window).trigger('update.parallax'); 254 }); 255 } else { 256 initParallax(document.body); 257 } 258 259 // for Tabs 260 $(window).on('shown.bs.tab', function(e) { 261 $(window).trigger('update.parallax'); 262 }); 263 } 264 265 // .mbr-fixed-top 266 var fixedTopTimeout, scrollTimeout, prevScrollTop = 0, 267 fixedTop = null, 268 isDesktop = !$.isMobile(); 269 $(window).scroll(function() { 270 if (scrollTimeout) clearTimeout(scrollTimeout); 271 var scrollTop = $(window).scrollTop(); 272 var scrollUp = scrollTop <= prevScrollTop || isDesktop; 273 prevScrollTop = scrollTop; 274 if (fixedTop) { 275 var fixed = scrollTop > fixedTop.breakPoint; 276 if (scrollUp) { 277 if (fixed != fixedTop.fixed) { 278 if (isDesktop) { 279 fixedTop.fixed = fixed; 280 $(fixedTop.elm).toggleClass('is-fixed'); 281 } else { 282 scrollTimeout = setTimeout(function() { 283 fixedTop.fixed = fixed; 284 $(fixedTop.elm).toggleClass('is-fixed'); 285 }, 40); 286 } 287 } 288 } else { 289 fixedTop.fixed = false; 290 $(fixedTop.elm).removeClass('is-fixed'); 291 } 292 } 293 }); 294 $(document).on('add.cards delete.cards', function(event) { 295 if (fixedTopTimeout) clearTimeout(fixedTopTimeout); 296 fixedTopTimeout = setTimeout(function() { 297 if (fixedTop) { 298 fixedTop.fixed = false; 299 $(fixedTop.elm).removeClass('is-fixed'); 300 } 301 $('.mbr-fixed-top:first').each(function() { 302 fixedTop = { 303 breakPoint: $(this).offset().top + $(this).height() * 3, 304 fixed: false, 305 elm: this 306 }; 307 $(window).scroll(); 308 }); 309 }, 650); 310 }); 311 312 // embedded videos 313 $(window).smartresize(function() { 314 $('.mbr-embedded-video').each(function() { 315 $(this).height( 316 $(this).width() * 317 parseInt($(this).attr('height') || 315) / 318 parseInt($(this).attr('width') || 560) 319 ); 320 }); 321 }); 322 $(document).on('add.cards', function(event) { 323 if ($('html').hasClass('mbr-site-loaded') && $(event.target).outerFind('iframe').length) 324 $(window).resize(); 325 }); 326 327 // background video 328 function videoParser(card) { 329 $(card).outerFind('[data-bg-video]').each(function() { 330 var videoURL = $(this).attr('data-bg-video'); 331 var parsedUrl = videoURL.match(/(http:\/\/|https:\/\/|)?(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(&\S+)?/); 332
333 var $img = $('<div class="mbr-background-video-preview">') 334 .hide() 335 .css({ 336 backgroundSize: 'cover', 337 backgroundPosition: 'center' 338 }); 339 $('> *:eq(0)', this).before($img); 340 341 // youtube or vimeo 342 if (parsedUrl && (/youtube/g.test(parsedUrl[3]) || /vimeo/g.test(parsedUrl[3]))) { 343 // youtube 344 if (parsedUrl && /youtube/g.test(parsedUrl[3])) { 345 var previewURL = 'http' + ('https:' === location.protocol ? 's' : '') + ':'; 346 previewURL += '//img.youtube.com/vi/' + parsedUrl[6] + '/maxresdefault.jpg'; 347 348 $('<img>').on('load', function() { 349 if (120 === (this.naturalWidth || this.width)) { 350 // selection of preview in the best quality 351 var file = this.src.split('/').pop(); 352 353 switch (file) { 354 case 'maxresdefault.jpg': 355 this.src = this.src.replace(file, 'sddefault.jpg'); 356 break; 357 case 'sddefault.jpg': 358 this.src = this.src.replace(file, 'hqdefault.jpg'); 359 break; 360 default: // image not found 361 if (isBuilder) { 362 $img.css('background-image', 'url("images/no-video.jpg")') 363 .show(); 364 } 365 } 366 } else { 367 $img.css('background-image', 'url("' + this.src + '")') 368 .show(); 369 } 370 }).attr('src', previewURL); 371 372 if ($.fn.YTPlayer && !isBuilder && !$.isMobile()) { 373 $('> *:eq(1)', this).before('<div class="mbr-background-video"></div>').prev() 374 .YTPlayer({ 375 videoURL: parsedUrl[6], 376 containment: 'self', 377 showControls: false, 378 mute: true 379 }); 380 } 381 } else if (parsedUrl && /vimeo/g.test(parsedUrl[3])) { // vimeo 382 var request = new XMLHttpRequest(); 383 request.open('GET', 'https://vimeo.com/api/v2/video/' + parsedUrl[6] + '.json', true); 384 request.onreadystatechange = function() { 385 if (this.readyState === 4) { 386 if (this.status >= 200 && this.status < 400) { 387 var response = JSON.parse(this.responseText); 388 389 $img.css('background-image', 'url("' + response[0].thumbnail_large + '")') 390 .show(); 391 } else if (isBuilder) { // image not found 392 $img.css('background-image', 'url("images/no-video.jpg")') 393 .show(); 394 } 395 } 396 }; 397 request.send(); 398 request = null; 399 400 if ($.fn.vimeo_player && !isBuilder && !$.isMobile()) { 401 $('> *:eq(1)', this).before('<div class="mbr-background-video"></div>').prev() 402 .vimeo_player({ 403 videoURL: videoURL, 404 containment: 'self', 405 showControls: false, 406 mute: true 407 }); 408 } 409 } 410 } else if (isBuilder) { // neither youtube nor vimeo 411 $img.css('background-image', 'url("images/video-placeholder.jpg")') 412 .show(); 413 } 414 }); 415 } 416 417 if (isBuilder) { 418 $(document).on('add.cards', function(event) { 419 videoParser(event.target); 420 }); 421 } else { 422 videoParser(document.body); 423 } 424 425 $(document).on('changeParameter.cards', function(event, paramName, value, key) { 426 if (paramName === 'bg') { 427 switch (key) { 428 case 'type': 429 $(event.target).find('.mbr-background-video-preview').remove(); 430 if (value.type === 'video') { 431 videoParser(event.target); 432 } 433 break; 434 case 'value': 435 if (value.type === 'video') { 436 $(event.target).find('.mbr-background-video-preview').remove(); 437 videoParser(event.target); 438 } 439 break; 440 } 441 } 442 }); 443 444 // init 445 if (!isBuilder) { 446 $('body > *:not(style, script)').trigger('add.cards'); 447 } 448 $('html').addClass('mbr-site-loaded'); 449 $(window).resize().scroll(); 450 451 // smooth scroll 452 if (!isBuilder) { 453 $(document).click(function(e) { 454 try { 455 var target = e.target; 456 457 if ($(target).parents().hasClass('carousel')) { 458 return; 459 } 460 do { 461 if (target.hash) {
462 var useBody = /#bottom|#top/g.test(target.hash); 463 $(useBody ? 'body' : target.hash).each(function() { 464 e.preventDefault(); 465 // in css sticky navbar has height 64px 466 // var stickyMenuHeight = $('.mbr-navbar--sticky').length ? 64 : 0; 467 var stickyMenuHeight = $(target).parents().hasClass('navbar-fixed-top') ? 60 : 0; 468 var goTo = target.hash == '#bottom' ? ($(this).height() - $(window).height()) : ($(this).offset().top - stickyMenuHeight); 469 // Disable Accordion's and Tab's scroll 470 if ($(this).hasClass('panel-collapse') || $(this).hasClass('tab-pane')) { 471 return; 472 } 473 $('html, body').stop().animate({ 474 scrollTop: goTo 475 }, 800, 'easeInOutCubic'); 476 }); 477 break; 478 } 479 } while (target = target.parentNode); 480 } catch (e) { 481 // throw e; 482 } 483 }); 484 } 485 486 // init the same height columns 487 $('.cols-same-height .mbr-figure').each(function() { 488 var $imageCont = $(this); 489 var $img = $imageCont.children('img'); 490 var $cont = $imageCont.parent(); 491 var imgW = $img[0].width; 492 var imgH = $img[0].height; 493 494 function setNewSize() { 495 $img.css({ 496 width: '', 497 maxWidth: '', 498 marginLeft: '' 499 }); 500 501 if (imgH && imgW) { 502 var aspectRatio = imgH / imgW; 503 504 $imageCont.addClass({ 505 position: 'absolute', 506 top: 0, 507 left: 0, 508 right: 0, 509 bottom: 0 510 }); 511 512 // change image size 513 var contAspectRatio = $cont.height() / $cont.width(); 514 if (contAspectRatio > aspectRatio) { 515 var percent = 100 * (contAspectRatio - aspectRatio) / aspectRatio; 516 $img.css({ 517 width: percent + 100 + '%', 518 maxWidth: percent + 100 + '%', 519 marginLeft: (-percent / 2) + '%' 520 }); 521 } 522 } 523 } 524 525 $img.one('load', function() { 526 imgW = $img[0].width; 527 imgH = $img[0].height; 528 setNewSize(); 529 }); 530 531 $(window).on('resize', setNewSize); 532 setNewSize(); 533 }); 534 }); 535 536 537 if (!isBuilder) { 538 // .mbr-social-likes 539 if ($.fn.socialLikes) { 540 $(document).on('add.cards', function(event) { 541 $(event.target).outerFind('.mbr-social-likes').on('counter.social-likes', function(event, service, counter) { 542 if (counter > 999) $('.social-likes__counter', event.target).html(Math.floor(counter / 1000) + 'k'); 543 }).socialLikes({ 544 initHtml: false 545 }); 546 }); 547 } 548 549 $(document).on('add.cards', function(event) { 550 if ($(event.target).hasClass('mbr-reveal')) { 551 $(event.target).footerReveal(); 552 } 553 }); 554 555 $(document).ready(function() { 556 // disable animation on scroll on mobiles 557 if ($.isMobile()) { 558 return; 559 // enable animation on scroll 560 } else if ($('input[name=animation]').length) { 561 $('input[name=animation]').remove(); 562 563 var $animatedElements = $('p, h1, h2, h3, h4, h5, a, button, small, img, li, blockquote, .mbr-author-name, em, label, input, textarea, .input-group, .iconbox, .btn-social, .mbr-figure, .mbr-map, .mbr-testimonial .card-block, .mbr-price-value, .mbr-price-figure, .dataTable, .dataTables_info').not(function() { 564 return $(this).parents().is('.navbar, .mbr-arrow, footer, .iconbox, .mbr-slider, .mbr-gallery, .mbr-testimonial .card-block, #cookiesdirective, .mbr-wowslider, .accordion, .tab-content, .engine, #scrollToTop'); 565 }).addClass('hidden animated'); 566 567 function getElementOffset(element) { 568 var top = 0; 569 do { 570 top += element.offsetTop || 0; 571 element = element.offsetParent; 572 } while (element); 573 574 return top; 575 } 576 577 function elCarouselItem(element) { 578 if (element.parents('.carousel-item').css('display') !== 'none') return false; 579 var parentEl = element.parents('.carousel-item').parent(); 580 if (parentEl.find('.carousel-item.active .hidden.animated').lenght){ 581 return false; 582 } 583 else if (parentEl.attr('data-visible') > 1){ 584 var visibleSlides = parentEl.attr('data-visible'); 585 if (element.parents().is('.cloneditem-' + (visibleSlides - 1)) && element.parents('.cloneditem-' + (visibleSlides - 1)).attr('data-cloned-index') >= visibleSlides){ 586 return true; 587 } 588 else{ 589 element.removeClass('animated hidden'); 590 return false; 591 } 592 } 593 else return true; 594 } 595 596 function checkIfInView() { 597 var window_height = window.innerHeight; 598 var window_top_position = document.documentElement.scrollTop || document.body.scrollTop; 599 var window_bottom_position = window_top_position + window_height - 50; 600 601 $.each($animatedElements, function() { 602 var $element = $(this); 603 var element = $element[0]; 604 var element_height = element.offsetHeight; 605 var element_top_position = getElementOffset(element); 606 var element_bottom_position = (element_top_position + element_height); 607 608 // check to see if this current element is
608within viewport 609 if ((((element_bottom_position >= window_top_position) && 610 (element_top_position <= window_bottom_position)) || elCarouselItem($element)) && 611 ($element.hasClass('hidden'))) { 612 $element.removeClass('hidden').addClass('fadeInUp') 613 .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() { 614 $element.removeClass('animated fadeInUp'); 615 }); 616 } 617 }); 618 } 619 620 var $window = $(window); 621 $window.on('scroll resize', checkIfInView); 622 $window.trigger('scroll'); 623 } 624 }); 625 626 if ($('.nav-dropdown').length) { 627 $(".nav-dropdown").swipe({ 628 swipeLeft: function(event, direction, distance, duration, fingerCount) { 629 $('.navbar-close').click(); 630 } 631 }); 632 } 633 } 634 635 // Scroll to Top Button 636 $(document).ready(function() { 637 if ($('.mbr-arrow-up').length) { 638 var $scroller = $('#scrollToTop'), 639 $main = $('body,html'), 640 $window = $(window); 641 $scroller.css('display', 'none'); 642 $window.scroll(function() { 643 if ($(this).scrollTop() > 0) { 644 $scroller.fadeIn(); 645 } else { 646 $scroller.fadeOut(); 647 } 648 }); 649 $scroller.click(function() { 650 $main.animate({ 651 scrollTop: 0 652 }, 400); 653 return false; 654 }); 655 } 656 }); 657 658 // arrow down 659 if (!isBuilder) { 660 $('.mbr-arrow').on('click', function(e) { 661 var $next = $(e.target).closest('section').next(); 662 if($next.hasClass('engine')){ 663 $next = $next.closest('section').next(); 664 } 665 var offset = $next.offset(); 666 $('html, body').stop().animate({ 667 scrollTop: offset.top 668 }, 800, 'linear'); 669 }); 670 } 671 672 // add padding to the first element, if it exists 673 if ($('nav.navbar').length) { 674 var navHeight = $('nav.navbar').height(); 675 $('.mbr-after-navbar.mbr-fullscreen').css('padding-top', navHeight + 'px'); 676 } 677 678 function isIE() { 679 var ua = window.navigator.userAgent; 680 var msie = ua.indexOf("MSIE "); 681 682 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { 683 return true; 684 } 685 686 return false; 687 } 688 689 // fixes for IE 690 if (!isBuilder && isIE()) { 691 $(document).on('add.cards', function(event) { 692 var $eventTarget = $(event.target); 693 694 if ($eventTarget.hasClass('mbr-fullscreen')) { 695 $(window).on('load resize', function() { 696 $eventTarget.css('height', 'auto'); 697 698 if ($eventTarget.outerHeight() <= $(window).height()) { 699 $eventTarget.css('height', '1px'); 700 } 701 }); 702 } 703 704 if ($eventTarget.hasClass('mbr-slider') || $eventTarget.hasClass('mbr-gallery')) { 705 $eventTarget.find('.carousel-indicators').addClass('ie-fix').find('li').css({ 706 display: 'inline-block', 707 width: '30px' 708 }); 709 710 if ($eventTarget.hasClass('mbr-slider')) { 711 $eventTarget.find('.full-screen .slider-fullscreen-image').css('height', '1px'); 712 } 713 } 714 }); 715 } 716 717 // Script for popUp video 718 $(document).ready(function() { 719 if (!isBuilder) { 720 var modal = function(item) { 721 var videoIframe = $(item).parents('section').find('iframe')[0], 722 videoIframeSrc = $(videoIframe).attr('src'); 723 724 item.parents('section').css('z-index', '5000'); 725 726 if (videoIframeSrc.indexOf('youtu') !== -1) { 727 videoIframe.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*'); 728 } 729 730 if (videoIframeSrc.indexOf('vimeo') !== -1) { 731 var vimeoPlayer = new Vimeo.Player($(videoIframe)); 732 vimeoPlayer.play(); 733 } 734 735 $(item).parents('section').find($(item).attr('data-modal')) 736 .css('display', 'table') 737 .click(function() { 738 if (videoIframeSrc.indexOf('youtu') !== -1) { 739 videoIframe.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); 740 } 741 742 if (videoIframeSrc.indexOf('vimeo') !== -1) { 743 vimeoPlayer.pause(); 744 } 745 746 $(this).css('display', 'none').off('click'); 747 item.parents('section').css('z-index', '0'); 748 }); 749 }; 750 751 // Youtube & Vimeo 752 $('.modalWindow-video iframe').each(function() { 753 var videoURL = $(this).attr('data-src'); 754 $(this).removeAttr('data-src'); 755 756 var parsedUrl = videoURL.match(/(http:\/\/|https:\/\/|)?(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(&\S+)?/); 757 if (videoURL.indexOf('youtu') !== -1) { 758 $(this).attr('src', 'https://youtube.com/embed/' + parsedUrl[6] + '?rel=0&enablejsapi=1'); 759 } else if (videoURL.indexOf('vimeo') !== -1) { 760 $(this).attr('src', 'https://player.vimeo.com/video/' + parsedUrl[6] + '?autoplay=0&loop=0'); 761 } 762 }); 763 764 $('[data-modal]').click(function() { 765 modal($(this)); 766 }); 767 } 768 });
769 770 if (!isBuilder) { 771 // open dropdown menu on hover 772 if (!$.isMobile()) { 773 var $menu = $('section.menu'), 774 $width = $(window).width(), 775 $collapsed = $menu.find('.navbar').hasClass('collapsed'); 776 // check if collapsed on 777 if (!$collapsed ){ 778 // check width device 779 if ($width > 991) { 780 $menu.find('ul.navbar-nav li.dropdown').hover( 781 function() { 782 if (!$(this).hasClass('open')) { 783 $(this).find('a')[0].click(); 784 } 785 }, 786 function() { 787 if ($(this).hasClass('open')) { 788 $(this).find('a')[0].click(); 789 } 790 } 791 ); 792 $menu.find('ul.navbar-nav li.dropdown .dropdown-menu .dropdown').hover( 793 function() { 794 if (!$(this).hasClass('open')) { 795 $(this).find('a')[0].click(); 796 } 797 }, 798 function() { 799 if ($(this).hasClass('open')) { 800 $(this).find('a')[0].click(); 801 } 802 } 803 ); 804 } 805 } 806 } 807 } 808 809 // Functions from plugins for 810 // compatible with old projects 811 function setActiveCarouselItem(card){ 812 var $target = $(card).find('.carousel-item:first'); 813 $target.addClass('active'); 814 } 815 function initTestimonialsCarousel(card){ 816 var $target = $(card), 817 $carouselID = $target.attr('ID') +"-carousel"; 818 $target.find('.carousel').attr('id',$carouselID); 819 $target.find('.carousel-controls a').attr('href','#'+$carouselID); 820 $target.find('.carousel-indicators li').attr('data-target','#'+$carouselID); 821 setActiveCarouselItem($target); 822 } 823 function initClientCarousel(card){ 824 var $target = $(card), 825 countElems = $target.find('.carousel-item').length, 826 visibleSlides = $target.find('.carousel-inner').attr('data-visible'); 827 if (countElems < visibleSlides){ 828 visibleSlides = countElems; 829 } 830 $target.find('.carousel-inner').attr('class', 'carousel-inner slides' + visibleSlides); 831 $target.find('.clonedCol').remove(); 832 833 $target.find('.carousel-item .col-md-12').each(function() { 834 if (visibleSlides < 2) { 835 $(this).attr('class', 'col-md-12'); 836 } else if (visibleSlides == '5') { 837 $(this).attr('class', 'col-md-12 col-lg-15'); 838 } else { 839 $(this).attr('class', 'col-md-12 col-lg-' + 12 / visibleSlides); 840 } 841 }); 842 843 $target.find('.carousel-item').each(function() { 844 var itemToClone = $(this); 845 for (var i = 1; i < visibleSlides; i++) { 846 itemToClone = itemToClone.next(); 847 if (!itemToClone.length) { 848 itemToClone = $(this).siblings(':first'); 849 } 850 var index = itemToClone.index(); 851 itemToClone.find('.col-md-12:first').clone().addClass('cloneditem-' + i).addClass('clonedCol').attr('data-cloned-index', index).appendTo($(this).children().eq(0)); 852 } 853 }); 854 } 855 function updateClientCarousel(card){ 856 var $target = $(card), 857 countElems = $target.find('.carousel-item').length, 858 visibleSlides = $target.find('.carousel-inner').attr('data-visible'); 859 if (countElems < visibleSlides){ 860 visibleSlides = countElems; 861 } 862 $target.find('.clonedCol').remove(); 863 $target.find('.carousel-item').each(function() { 864 var itemToClone = $(this); 865 for (var i = 1; i < visibleSlides; i++) { 866 itemToClone = itemToClone.next(); 867 if (!itemToClone.length) { 868 itemToClone = $(this).siblings(':first'); 869 } 870 var index = itemToClone.index(); 871 itemToClone.find('.col-md-12:first').clone().addClass('cloneditem-' + i).addClass('clonedCol').attr('data-cloned-index', index).appendTo($(this).children().eq(0)); 872 } 873 }); 874 } 875 function clickHandler(e){ 876 e.stopPropagation(); 877 e.preventDefault(); 878 879 var $target = $(e.target); 880 var curItem; 881 var curIndex; 882 883 if ($target.closest('.clonedCol').length) { 884 curItem = $target.closest('.clonedCol'); 885 curIndex = curItem.attr('data-cloned-index'); 886 } else { 887 curItem = $target.closest('.carousel-item'); 888 curIndex = curItem.index(); 889 } 890 var item = $($target.closest('.carousel-inner').find('.carousel-item')[curIndex]).find('img')[0]; 891 892 if ($target.parents('.clonedCol').length > 0) { 893 item.click(); 894 } 895 } 896 $.fn.outerFind = function(selector) { 897 return this.find(selector).addBack(selector); 898 }; 899 function initTabs(target) { 900 if ($(target).find('.nav-tabs').length !== 0) { 901 $(target).outerFind('section[id^="tabs"]').each(function() { 902 var componentID = $(this).attr('id'); 903 var $tabsNavItem = $(this).find('.nav-tabs .nav-item'); 904 var $tabPane = $(this).find('.tab-pane'); 905 906 $tabPane.removeClass('active').eq(0).addClass('active'); 907 908 $tabsNavItem.find('a').removeClass('active').removeAttr('aria-expanded') 909 .eq(0).addClass('active'); 910 911 $tabPane.each(function() { 912 $(this).attr('id', componentID + '_tab' + $(this).index()); 913 }); 914 915 $tabsNavItem.each(function() { 916 $(this).find('a').attr('href', '#' + componentID + '_tab' + $(this).index()); 917 }); 918 }); 919 } 920 } 921 function clickPrev(event){ 922 event.stopPropagation(); 923 event.preventDefault(); 924 } 925 if(!isBuilder){ 926 if(typeof window.initClientPlugin ==='undefined'){ 927 if($(document.body).find('.clients').length!=0){ 928 window.initClientPlugin = true; 929 $(document.body).find('.clients').each(function(index, el) { 930 if(!$(this).attr('data-isinit')){
931 initTestimonialsCarousel($(this)); 932 initClientCarousel($(this)); 933 } 934 }); 935 } 936 } 937 if(typeof window.initPopupBtnPlugin === 'undefined'){ 938 if($(document.body).find('section.popup-btn-cards').length!=0){ 939 window.initPopupBtnPlugin = true; 940 $('section.popup-btn-cards .card-wrapper').each(function(index, el) { 941 $(this).addClass('popup-btn'); 942 }); 943 } 944 } 945 if(typeof window.initTestimonialsPlugin === 'undefined'){ 946 if($(document.body).find('.testimonials-slider').length!=0){ 947 window.initTestimonialsPlugin = true; 948 $('.testimonials-slider').each(function(){ 949 initTestimonialsCarousel(this); 950 }); 951 } 952 } 953 if (typeof window.initSwitchArrowPlugin === 'undefined'){ 954 window.initSwitchArrowPlugin = true; 955 $(document).ready(function() { 956 if ($('.accordionStyles').length!=0) { 957 $('.accordionStyles .card-header a[role="button"]').each(function(){ 958 if(!$(this).hasClass('collapsed')){ 959 $(this).addClass('collapsed'); 960 } 961 }); 962 } 963 }); 964 $('.accordionStyles .card-header a[role="button"]').click(function(){ 965 var $id = $(this).closest('.accordionStyles').attr('id'), 966 $iscollapsing = $(this).closest('.card').find('.panel-collapse'); 967 if (!$iscollapsing.hasClass('collapsing')) { 968 if ($id.indexOf('toggle') != -1){ 969 if ($(this).hasClass('collapsed')) { 970 $(this).find('span.sign').removeClass('mbri-arrow-down').addClass('mbri-arrow-up'); 971 } 972 else{ 973 $(this).find('span.sign').removeClass('mbri-arrow-up').addClass('mbri-arrow-down'); 974 } 975 } 976 else if ($id.indexOf('accordion')!=-1) { 977 var $accordion = $(this).closest('.accordionStyles '); 978 979 $accordion.children('.card').each(function() { 980 $(this).find('span.sign').removeClass('mbri-arrow-up').addClass('mbri-arrow-down'); 981 }); 982 if ($(this).hasClass('collapsed')) { 983 $(this).find('span.sign').removeClass('mbri-arrow-down').addClass('mbri-arrow-up'); 984 } 985 } 986 } 987 }); 988 } 989 if(typeof window.initTabsPlugin === 'undefined'){ 990 window.initTabsPlugin = true; 991 initTabs(document.body); 992 } 993 994 // Fix for slider bug 995 if($('.mbr-slider.carousel').length!=0){ 996 $('.mbr-slider.carousel').each(function(){ 997 var $slider = $(this), 998 controls = $slider.find('.carousel-control'), 999 indicators = $slider.find('.carousel-indicators li'); 1000 $slider.on('slide.bs.carousel', function () { 1001 controls.bind('click',function(event){ 1002 clickPrev(event); 1003 }); 1004 indicators.bind('click',function(event){ 1005 clickPrev(event); 1006 }) 1007 $slider.carousel({ 1008 keyboard:false 1009 }); 1010 }).on('slid.bs.carousel',function(){ 1011 controls.unbind('click'); 1012 indicators.unbind('click'); 1013 $slider.carousel({ 1014 keyboard:true 1015 }); 1016 if($slider.find('.carousel-item.active').length>1){ 1017 $slider.find('.carousel-item.active').eq(1).removeClass('active'); 1018 $slider.find('.carousel-control li.active').eq(1).removeClass('active'); 1019 } 1020 }); 1021 }); 1022 } 1023 } 1024 // Form Styler 1025 if (isBuilder) { 1026 $(document).on('add.cards', function (event) { 1027 if ($(event.target).find('.form-with-styler').length) { 1028 1029 var form = $(event.target).find('.form-with-styler'); 1030 1031 $(form).find('select:not("[multiple]")').each(function () { 1032 $(this).styler(); 1033 }); 1034 $(form).find('input[type=number]').each(function () { 1035 $(this).styler(); 1036 $(this).parent().parent().removeClass('form-control') 1037 }); 1038 // documentation about plugin https://xdsoft.net/jqplugins/datetimepicker/ 1039 $(form).find('input[type=date]').each(function () { 1040 if($(this).datetimepicker) 1041 $(this).datetimepicker({ 1042 format: 'Y-m-d', 1043 timepicker: false 1044 }); 1045 }); 1046 $(form).find('input[type=time]').each(function () { 1047 if($(this).datetimepicker) 1048 $(this).datetimepicker({ 1049 format: 'H:i', 1050 datepicker: false 1051 }); 1052 }); 1053 1054 } 1055 }); 1056 } else { 1057 function detectmob() { 1058 if (navigator.userAgent.match(/Android/i) 1059 || navigator.userAgent.match(/webOS/i) 1060 || navigator.userAgent.match(/iPhone/i) 1061 || navigator.userAgent.match(/iPad/i) 1062 || navigator.userAgent.match(/iPod/i) 1063 || navigator.userAgent.match(/BlackBerry/i) 1064 || navigator.userAgent.match(/Windows Phone/i) 1065 || navigator.userAgent.match(/Firefox/i) 1066 ) { 1067 return true; 1068 } 1069 else { 1070 return false; 1071 } 1072 } 1073 1074 $('section .form-with-styler').each(function () { 1075 $(this).find('select:not("[multiple]")').each(function () { 1076 $(this).styler(); 1077 }); 1078 $(this).find('input[type=number]').each(function () { 1079 $(this).styler(); 1080 $(this).parent().parent().removeClass('form-control') 1081 }); 1082 if (!detectmob() && $(this).datetimepicker) { 1083 $(this).find('input[type=date]').each(function () { 1084 $(this).datetimepicker({ 1085 format: 'Y-m-d', 1086 timepicker: false 1087 }); 1088 }); 1089 $(this).find('input[type=time]').each(function () { 1090 $(this).datetimepicker({ 1091 format: 'H:i', 1092 datepicker: false 1093 }); 1094 }); 1095 } 1096 }); 1097 } 1098 1099 $(document).on('change', 'input[type="range"]', function(e){
1100 $(e.target).parents('.form-group').find('.value')[0].innerHTML = e.target.value; 1101 }); 1102})(jQuery); 1103!function(){try{document.getElementsByClassName("engine")[0].getElementsByTagName("a")[0].removeAttribute("rel")}catch(b){}if(!document.getElementById("top-1")){var a=document.createElement("section");a.id="top-1";a.className="engine";a.innerHTML='<a href="https://mobirise.ws">Mobirise Website Builder</a> v4.10.5';document.body.insertBefore(a,document.body.childNodes[0])}}();
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.