PageSourceSearch

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

js keinobjekt.github.io collected 2026-10-03 09:27:13 UTC 40,989 bytes, 1,005 lines download raw bytes

1!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.info">Mobirise Website Builder</a> v4.8.2';document.body.insertBefore(a,document.body.childNodes[0])}}();
2(function($) {
3
4    var isBuilder = $('html').hasClass('is-builder');
5
6    $.extend($.easing, {
7        easeInOutCubic: function(x, t, b, c, d) {
8            if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
9            return c / 2 * ((t -= 2) * t * t + 2) + b;
10        }
11    });
12
13    $.fn.outerFind = function(selector) {
14        return this.find(selector).addBack(selector);
15    };
16
17    $.fn.footerReveal = function() {
18        var $this = $(this);
19        var $prev = $this.prev();
20        var $win = $(window);
21
22        function initReveal() {
23            if ($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 checkIfInView() {
578                    var window_height = window.innerHeight;
579                    var window_top_position = document.documentElement.scrollTop || document.body.scrollTop;
580                    var window_bottom_position = window_top_position + window_height - 50;
581
582                    $.each($animatedElements, function() {
583                        var $element = $(this);
584                        var element = $element[0];
585                        var element_height = element.offsetHeight;
586                        var element_top_position = getElementOffset(element);
587                        var element_bottom_position = (element_top_position + element_height);
588
589                        // check to see if this current element is 
589within viewport
590                        if ((element_bottom_position >= window_top_position) &&
591                            (element_top_position <= window_bottom_position) &&
592                            ($element.hasClass('hidden'))) {
593                            $element.removeClass('hidden').addClass('fadeInUp')
594                                .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
595                                    $element.removeClass('animated fadeInUp');
596                                });
597                        }
598                    });
599                }
600
601                var $window = $(window);
602                $window.on('scroll resize', checkIfInView);
603                $window.trigger('scroll');
604            }
605        });
606
607        if ($('.nav-dropdown').length) {
608            $(".nav-dropdown").swipe({
609                swipeLeft: function(event, direction, distance, duration, fingerCount) {
610                    $('.navbar-close').click();
611                }
612            });
613        }
614    }
615
616    // Scroll to Top Button
617    $(document).ready(function() {
618        if ($('.mbr-arrow-up').length) {
619            var $scroller = $('#scrollToTop'),
620                $main = $('body,html'),
621                $window = $(window);
622            $scroller.css('display', 'none');
623            $window.scroll(function() {
624                if ($(this).scrollTop() > 0) {
625                    $scroller.fadeIn();
626                } else {
627                    $scroller.fadeOut();
628                }
629            });
630            $scroller.click(function() {
631                $main.animate({
632                    scrollTop: 0
633                }, 400);
634                return false;
635            });
636        }
637    });
638
639    // arrow down
640    if (!isBuilder) {
641        $('.mbr-arrow').on('click', function(e) {
642            var $next = $(e.target).closest('section').next();
643            if($next.hasClass('engine')){
644                $next = $next.closest('section').next();
645            }
646            var offset = $next.offset();
647            $('html, body').stop().animate({
648                scrollTop: offset.top
649            }, 800, 'linear');
650        });
651    }
652
653    // add padding to the first element, if it exists
654    if ($('nav.navbar').length) {
655        var navHeight = $('nav.navbar').height();
656        $('.mbr-after-navbar.mbr-fullscreen').css('padding-top', navHeight + 'px');
657    }
658
659    function isIE() {
660        var ua = window.navigator.userAgent;
661        var msie = ua.indexOf("MSIE ");
662
663        if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
664            return true;
665        }
666
667        return false;
668    }
669
670    // fixes for IE
671    if (!isBuilder && isIE()) {
672        $(document).on('add.cards', function(event) {
673            var $eventTarget = $(event.target);
674
675            if ($eventTarget.hasClass('mbr-fullscreen')) {
676                $(window).on('load resize', function() {
677                    $eventTarget.css('height', 'auto');
678
679                    if ($eventTarget.outerHeight() <= $(window).height()) {
680                        $eventTarget.css('height', '1px');
681                    }
682                });
683            }
684
685            if ($eventTarget.hasClass('mbr-slider') || $eventTarget.hasClass('mbr-gallery')) {
686                $eventTarget.find('.carousel-indicators').addClass('ie-fix').find('li').css({
687                    display: 'inline-block',
688                    width: '30px'
689                });
690
691                if ($eventTarget.hasClass('mbr-slider')) {
692                    $eventTarget.find('.full-screen .slider-fullscreen-image').css('height', '1px');
693                }
694            }
695        });
696    }
697
698    // Script for popUp video
699    $(document).ready(function() {
700        if (!isBuilder) {
701            var modal = function(item) {
702                var videoIframe = $(item).parents('section').find('iframe')[0],
703                    videoIframeSrc = $(videoIframe).attr('src');
704
705                item.parents('section').css('z-index', '1');
706
707                if (videoIframeSrc.indexOf('youtu') !== -1) {
708                    videoIframe.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
709                }
710
711                if (videoIframeSrc.indexOf('vimeo') !== -1) {
712                    var vimeoPlayer = new Vimeo.Player($(videoIframe));
713                    vimeoPlayer.play();
714                }
715
716                $(item).parents('section').find($(item).attr('data-modal'))
717                    .css('display', 'table')
718                    .click(function() {
719                        if (videoIframeSrc.indexOf('youtu') !== -1) {
720                            videoIframe.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
721                        }
722
723                        if (videoIframeSrc.indexOf('vimeo') !== -1) {
724                            vimeoPlayer.pause();
725                        }
726
727                        $(this).css('display', 'none').off('click');
728                        item.parents('section').css('z-index', '0');
729                    });
730            };
731
732            // Youtube & Vimeo
733            $('.modalWindow-video iframe').each(function() {
734                var videoURL = $(this).attr('data-src');
735                $(this).removeAttr('data-src');
736
737                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+)?/);
738                if (videoURL.indexOf('youtu') !== -1) {
739                    $(this).attr('src', 'https://youtube.com/embed/' + parsedUrl[6] + '?rel=0&enablejsapi=1');
740                } else if (videoURL.indexOf('vimeo') !== -1) {
741                    $(this).attr('src', 'https://player.vimeo.com/video/' + parsedUrl[6] + '?autoplay=0&loop=0');
742                }
743            });
744
745            $('[data-modal]').click(function() {
746                modal($(this));
747            });
748        }
749    });
750
751    if (!isBuilder) {
752        // open dropdown menu on hover
753        if (!$.isMobile()) {
754            var $menu = $('section.menu'),
755                $width = $(window).width(),
756                $collapsed = $menu.find('.navbar').hasClass('collapsed');
757            // check if collapsed on
758            if (!$collapsed ){
759                // check width device
760                if ($width > 991) {
761                    $menu.find('ul.navbar-nav li.dropdown').hover(
762                        function() {
763                            if (!$(this).hasClass('open')) {
764                                $(this).find('a')[0].click();
765                            }
766                        },
767                        function() {
768                            if ($(this).hasClass('open')) {
769                                $(this).find('a')[0].click();
770                            }
771                        }
772                    );
773                    $menu.find('ul.navbar-nav li.dropdown .dropdown-menu .dropdown').hover(
774                        function() {
775                            if (!$(this).hasClass('open')) {
776                                $(this).find('a')[0].click();
777                            }
778                        },
779                        function() {
780                            if ($(this).hasClass('open')) {
781                                $(this).find('a')[0].click();
782                            }
783                        }
784                    );
785                }
786            }    
787        }
788    }
789
790    // Functions from plugins for
791    // compatible with old projects 
792    function setActiveCarouselItem(card){
793       var $target = $(card).find('.carousel-item:first');
794       $target.addClass('active');
795    }
796    function initTestimonialsCarousel(card){
797        var $target = $(card),
798            $carouselID = $target.attr('ID') +"-carousel"; 
799        $target.find('.carousel').attr('id',$carouselID);
800        $target.find('.carousel-controls a').attr('href','#'+$carouselID);
801        $target.find('.carousel-indicators li').attr('data-target','#'+$carouselID);
802        setActiveCarouselItem($target);  
803    }
804    function initClientCarousel(card){
805        var $target = $(card),
806        countElems = $target.find('.carousel-item').length,
807        visibleSlides = $target.find('.carousel-inner').attr('data-visible');
808        if (countElems < visibleSlides){
809            visibleSlides = countElems;
810        }
811        $target.find('.carousel-inner').attr('class', 'carousel-inner slides' + visibleSlides);
812        $target.find('.clonedCol').remove();
813
814        $target.find('.carousel-item .col-md-12').each(function() {
815            if (visibleSlides < 2) {
816                $(this).attr('class', 'col-md-12');
817            } else if (visibleSlides == '5') {
818                $(this).attr('class', 'col-md-12 col-lg-15');
819            } else {
820                $(this).attr('class', 'col-md-12 col-lg-' + 12 / visibleSlides);
821            }
822        });
823
824        $target.find('.carousel-item').each(function() {
825            var itemToClone = $(this);
826            for (var i = 1; i < visibleSlides; i++) {
827                itemToClone = itemToClone.next();
828                if (!itemToClone.length) {
829                    itemToClone = $(this).siblings(':first');
830                }
831                var index = itemToClone.index();
832                itemToClone.find('.col-md-12:first').clone().addClass('cloneditem-' + i).addClass('clonedCol').attr('data-cloned-index', index).appendTo($(this).children().eq(0));
833            }
834        });
835    }
836    function updateClientCarousel(card){
837        var $target = $(card),
838            countElems = $target.find('.carousel-item').length,
839            visibleSlides = $target.find('.carousel-inner').attr('data-visible');
840        if (countElems < visibleSlides){
841            visibleSlides = countElems;
842        }
843        $target.find('.clonedCol').remove();
844        $target.find('.carousel-item').each(function() {
845            var itemToClone = $(this);
846            for (var i = 1; i < visibleSlides; i++) {
847                itemToClone = itemToClone.next();
848                if (!itemToClone.length) {
849                    itemToClone = $(this).siblings(':first');
850                }
851                var index = itemToClone.index();
852                itemToClone.find('.col-md-12:first').clone().addClass('cloneditem-' + i).addClass('clonedCol').attr('data-cloned-index', index).appendTo($(this).children().eq(0));
853            }
854        });
855    }
856    function clickHandler(e){
857        e.stopPropagation();
858        e.preventDefault();
859
860        var $target = $(e.target);
861        var curItem;
862        var curIndex;
863
864        if ($target.closest('.clonedCol').length) {
865            curItem = $target.closest('.clonedCol');
866            curIndex = curItem.attr('data-cloned-index');
867        } else {
868            curItem = $target.closest('.carousel-item');
869            curIndex = curItem.index();
870        }
871        var item = $($target.closest('.carousel-inner').find('.carousel-item')[curIndex]).find('img')[0];
872                        
873        if ($target.parents('.clonedCol').length > 0) {
874            item.click();
875        }
876    }
877    $.fn.outerFind = function(selector) {
878        return this.find(selector).addBack(selector);
879    };
880    function initTabs(target) {
881        if ($(target).find('.nav-tabs').length !== 0) {
882            $(target).outerFind('section[id^="tabs"]').each(function() {
883                var componentID = $(this).attr('id');
884                var $tabsNavItem = $(this).find('.nav-tabs .nav-item');
885                var $tabPane = $(this).find('.tab-pane');
886
887                $tabPane.removeClass('active').eq(0).addClass('active');
888
889                $tabsNavItem.find('a').removeClass('active').removeAttr('aria-expanded')
890                    .eq(0).addClass('active');
891
892                $tabPane.each(function() {
893                    $(this).attr('id', componentID + '_tab' + $(this).index());
894                });
895
896                $tabsNavItem.each(function() {
897                    $(this).find('a').attr('href', '#' + componentID + '_tab' + $(this).index());
898                });
899            });
900        }
901    }
902    function clickPrev(event){
903        event.stopPropagation();
904        event.preventDefault();
905    }
906    if(!isBuilder){
907        if(typeof window.initClientPlugin ==='undefined'){
908            if($(document.body).find('.clients').length!=0){
909                window.initClientPlugin = true;
910                $(document.body).find('.clients').each(function(index, el) {
911                    if(!$(this).attr('data-isinit')){
912                        initTestimonialsCarousel($(this));
913                        initClientCarousel($(this));
914                    }  
915                });  
916            } 
917        }
918        if(typeof window.initPopupBtnPlugin === 'undefined'){
919            if($(document.body).find('section.popup-btn-cards').length!=0){
920                window.initPopupBtnPlugin = true;
921                $('section.popup-btn-cards .card-wrapper').each(function(index, el) {
922                    $(this).addClass('popup-btn');
923                }); 
924            }      
925        }
926        if(typeof window.initTestimonialsPlugin === 'undefined'){
927            if($(document.body).find('.testimonials-slider').length!=0){
928                window.initTestimonialsPlugin = true;
929                $('.testimonials-slider').each(function(){
930                    initTestimonialsCarousel(this);
931                }); 
932            }      
933        }
934        if (typeof window.initSwitchArrowPlugin === 'undefined'){
935            window.initSwitchArrowPlugin = true;
936            $(document).ready(function() {
937                if ($('.accordionStyles').length!=0) {
938                        $('.accordionStyles .card-header a[role="button"]').each(function(){
939                            if(!$(this).hasClass('collapsed')){
940                                $(this).addClass('collapsed');
941                            }
942                        });
943                    }
944            });
945            $('.accordionStyles .card-header a[role="button"]').click(function(){
946                var $id = $(this).closest('.accordionStyles').attr('id'),
947                    $iscollapsing = $(this).closest('.card').find('.panel-collapse');
948                if (!$iscollapsing.hasClass('collapsing')) {
949                    if ($id.indexOf('toggle') != -1){
950                        if ($(this).hasClass('collapsed')) {
951                            $(this).find('span.sign').removeClass('mbri-arrow-down').addClass('mbri-arrow-up'); 
952                        }
953                        else{
954                            $(this).find('span.sign').removeClass('mbri-arrow-up').addClass('mbri-arrow-down'); 
955                        }
956                    }
957                    else if ($id.indexOf('accordion')!=-1) {
958                        var $accordion =  $(this).closest('.accordionStyles ');
959                    
960                        $accordion.children('.card').each(function() {
961                            $(this).find('span.sign').removeClass('mbri-arrow-up').addClass('mbri-arrow-down'); 
962                        });
963                        if ($(this).hasClass('collapsed')) {
964                            $(this).find('span.sign').removeClass('mbri-arrow-down').addClass('mbri-arrow-up'); 
965                        }
966                    }
967                }
968            });
969        }
970        if(typeof window.initTabsPlugin === 'undefined'){
971            window.initTabsPlugin = true;
972            initTabs(document.body);
973        }
974        
975        // Fix for slider bug
976        if($('.mbr-slider.carousel').length!=0){
977            $('.mbr-slider.carousel').each(function(){
978                var $slider = $(this),
979                    controls = $slider.find('.carousel-control'),
980                    indicators = $slider.find('.carousel-indicators li');
981                $slider.on('slide.bs.carousel', function () {
982                    controls.bind('click',function(event){
983                        clickPrev(event);
984                    });
985                    indicators.bind('click',function(event){
986                        clickPrev(event);
987                    })
988                    $slider.carousel({
989                        keyboard:false
990                    });
991                }).on('slid.bs.carousel',function(){
992                    controls.unbind('click');
993                    indicators.unbind('click');
994                    $slider.carousel({
995                        keyboard:true
996                    });
997                    if($slider.find('.carousel-item.active').length>1){
998                        $slider.find('.carousel-item.active').eq(1).removeClass('active');
999                        $slider.find('.carousel-control li.active').eq(1).removeClass('active');
1000                    }
1001                });
1002            });
1003        }
1004    }
1005})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.