PageSourceSearch

https://myblox.github.io/assets/theme/js/script.js

js myblox.github.io collected 2026-10-03 09:39:22 UTC 40,980 bytes, 1,005 lines download raw bytes

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