PageSourceSearch

https://kulturdelen.nu/wp-content/themes/viral-pro/js/custom.js?ver=1.2.3

js kulturdelen.nu collected 2026-10-03 00:24:13 UTC 27,132 bytes, 793 lines download raw bytes

1/**
2 * Viral Pro Custom JS
3 *
4 * @package Viral Pro
5 *
6 * Distributed under the MIT license - http://opensource.org/licenses/MIT
7 */
8
9jQuery(function ($) {
10    if (navigator.userAgent.indexOf('Mac') > 0) {
11        $('body').addClass('ht-mac-os');
12    }
13    
14    /*---------Preloader---------*/
15    $(window).load(function () {
16        $('#ht-preloader-wrap').fadeOut('slow');
17    });
18
19    /*---------Maintenance Slider---------*/
20    if ($('.ht-maintenance-slider .ht-maintenance-slide').length > 0) {
21        $('.ht-maintenance-slider').owlCarousel({
22            rtl: JSON.parse(viral_pro_options.rtl),
23            items: 1,
24            loop: true,
25            mouseDrag: false,
26            nav: false,
27            dots: false,
28            autoplayTimeout: parseInt($('.ht-maintenance-slider').attr('data-timeout')),
29            autoplay: true,
30            smartSpeed: 600,
31            animateOut: 'fadeOut'
32        });
33    }
34
35    /*---------Maintenance Video---------*/
36    if ($('.ht-maintenance-video[data-property]').length > 0) {
37        $(".ht-maintenance-video[data-property]").YTPlayer({
38            showControls: false,
39            containment: 'self',
40            mute: true,
41            addRaster: false,
42            useOnMobile: false,
43            playOnlyIfVisible: true,
44            anchor: 'center,center',
45            showYTLogo: false,
46            loop: true,
47            optimizeDisplay: true,
48            quality: 'hd720'
49        });
50    }
51
52    $(document).on('click', '.product .viral-pro-product-actions a.compare:not(.added)', function (e) {
53        var $button = $(this);
54        setTimeout(function () {
55            $button.html('<i class="icofont-random"></i><span class="woo-button-tooltip">Added</span>');
56        }, 3000);
57    });
58
59    /*---------scroll To Top---------*/
60    $(window).scroll(function () {
61        if ($(window).scrollTop() > 300) {
62            $('#ht-back-top').removeClass('ht-hide');
63        } else {
64            $('#ht-back-top').addClass('ht-hide');
65        }
66    });
67
68    $('#ht-back-top').click(function (e) {
69        e.preventDefault();
70        $('html,body').animate({
71            scrollTop: 0
72        }, 800);
73    });
74
75    /*---------Blog Isotope---------*/
76    $('.viral-pro-blog-layout6-wrap').isotope({
77        itemSelector: '.viral-pro-hentry',
78        //percentPosition: true,
79        masonry: {
80            // use outer width of grid-sizer for columnWidth
81            //scolumnWidth: '.grid-sizer'
82        }
83    })
84
85    /*---------Single Post Gallery Slider---------*/
86    $('.single-entry-gallery .owl-carousel').owlCarousel({
87        rtl: JSON.parse(viral_pro_options.rtl),
88        items: 1,
89        loop: true,
90        mouseDrag: false,
91        autoplay: true,
92        autoplayTimeout: 6000,
93        nav: true,
94        dots: false,
95        navText: ['<i class="mdi mdi-chevron-left"></i>', '<i class="mdi mdi-chevron-right"></i>']
96    });
97
98    /*---------Related Thumb---------*/
99    $('.viral-pro-related-post.style3 .viral-pro-related-post-wrap').owlCarousel({
100        rtl: JSON.parse(viral_pro_options.rtl),
101        items: 3,
102        margin: 30,
103        loop: true,
104        mouseDrag: false,
105        autoplay: true,
106        autoplayTimeout: 6000,
107        nav: true,
108        dots: false,
109        navText: ['<i class="mdi mdi-chevron-left"></i>', '<i class="mdi mdi-chevron-right"></i>'],
110        responsive: {
111            0: {
112                items: 1
113            },
114            480: {
115                items: 2
116            },
117            680: {
118                items: 3
119            },
120            768: {
121                items: 2
122            },
123            1000: {
124                items: 3
125            }
126        }
127    });
128
129    /*---------Popup Search---------*/
130    $('.ht-search-button a').click(function () {
131        $('.ht-search-wrapper').addClass('ht-search-triggered');
132        setTimeout(function () {
133            $('.ht-search-wrapper .search-field').focus();
134        }, 1000);
135        return false;
136    });
137
138    $('.ht-search-close').click(function () {
139        $('.ht-search-wrapper').removeClass('ht-search-triggered');
140        return false;
141    });
142
143    $(document).keydown(function (e) {
144        // ESCAPE key pressed
145        if (e.keyCode == 27 && $('.ht-search-wrapper').hasClass('ht-search-triggered')) {
146            $('.ht-search-wrapper').removeClass('ht-search-triggered');
147        }
148    });
149
150    /*---------OffCanvas Sidebar---------*/
151    $('.ht-offcanvas-nav a').click(function () {
152        $('body').addClass('ht-offcanvas-opened');
153        return false;
154    });
155
156    $('.ht-offcanvas-close, .ht-offcanvas-sidebar-modal').click(function () {
157        $('body').removeClass('ht-offcanvas-opened');
158    });
159
160    $('.ht-offcanvas-sidebar .widget_nav_menu .menu-item-has-children > a').append('<span class="ht-dropdown"></span>');
161
162    $('.ht-dropdown').on('click', function () {
163        $(this).parent('a').next('ul').slideToggle();
164        $(this).toggleClass('ht-opened');
165        return false;
166    })
167
168    $(document).keydown(function (e) {
169        // ESCAPE key pressed
170        if (e.keyCode == 27 && $('body').hasClass('ht-offcanvas-opened')) {
171            $('body').removeClass('ht-offcanvas-opened');
172        }
173    });
174
175    /*---------Header Time---------*/
176    startTime();
177
178    /*---------Main Menu Dropdown---------*/
179    $('.ht-menu > ul').superfish({
180        delay: 500,
181        animation: {
182            opacity: 'show'
183        },
184        speed: 'fast'
185    });
186
187    $('#ht-mobile-menu .menu-collapser').on('click', function () {
188        $(this).next('ul').slideToggle();
189    });
190
191    $('#ht-responsive-menu .dropdown-nav').on('click', function () {
192        $(this).parents('a').siblings('ul').slideToggle();
193        $(this).toggleClass('ht-opened');
194        return false;
195    })
196
197    /*---------Drop Down---------*/
198    var $dropdowns = $('.ht-menu > ul > .menu-item.menu-item-has-children:not(.menu-item-megamenu) > .sub-menu');
199    if ($dropdowns.length > 0) {
200        var $container = $($dropdowns[0]).closest('.ht-container');
201        if ($container.length > 0) {
202            var container_right_max = $container.offset().left + $container.outerWidth();
203            var window_width = $(window).width();
204            $dropdowns.each(function () {
205                var $dropdown = $(this);
206                var $li = $(this).parent();
207                if (viral_pro_megamenu.rtl == 'true') {
208                    if (((window_width - $li.offset().left) + $dropdown.outerWidth()) > container_right_max) {
209                        $dropdown.css({
210                            'right': 'auto',
211                            'left': 0
212                        });
213                    }
214
215                    if (((window_width - $li.offset().left) + $dropdown.outerWidth() * 2) > container_right_max) {
216                        $dropdown.find('.sub-menu').css({
217                            'right': 'auto',
218                            'left': '100%'
219                        });
220                    }
221                } else {
222                    if ($li.offset().left + $dropdown.outerWidth() > container_right_max) {
223                        $dropdown.css({
224                            'left': 'auto',
225                            'right': 0
226                        });
227                    }
228
229                    if (($li.offset().left + $dropdown.outerWidth() * 2) > container_right_max) {
230                        $dropdown.find('.sub-menu').css({
231                            'left': 'auto',
232                            'right': '100%'
233                        });
234                    }
235                }
236            });
237        }
238    }
239
240    /*---------MegaMenu---------*/
241    viral_pro_build_mega_menu();
242
243    /*---------Sticky Header---------*/
244    var hHeight = 0;
245    var adminbarHeight = 0;
246
247    if ($('body').hasClass('admin-bar')) {
248        adminbarHeight = 32;
249    }
250
251    var $stickyHeader = $('.ht-header');
252
253    if ($('.ht-sticky-header').length > 0 && $stickyHeader.length > 0) {
254        hHeight = $stickyHeader.outerHeight();
255
256        if ($('body').hasClass('ht-header-style4')) {
257            hHeight = hHeight + 38
258        }
259        var hOffset = $stickyHeader.offset().top;
260
261        var offset = hOffset - adminbarHeight;
262
263        $stickyHeader.headroom({
264            offset: offset,
265            onTop: function () {
266                $('#ht-content').css({
267                    paddingTop: 0
268                });
269            },
270            onNotTop: function () {
271                $('#ht-content').css({
272                    paddingTop: hHeight + 'px'
273                });
274            }
275        });
276
277        $('.ht-sticky-sidebar .secondary-wrap').css('top', (hHeight + adminbarHeight + 40) + 'px');
278    }
279
280    /*---------One Page Nav---------*/
281    $('.ht-menu').onePageNav({
282        //currentClass: 'current',
283        changeHash: false,
284        scrollSpeed: 750,
285        scrollThreshold: 0.1,
286        scrollOffset: hHeight + adminbarHeight
287    });
288
289    $('#ht-responsive-menu').onePageNav({
290        //currentClass: 'current',
291        changeHash: false,
292        scrollSpeed: 750,
293        scrollThreshold: 0.1
294    });
295
296    // *only* if we have anchor on the url
297    if (window.location.hash) {
298        $(window).load(function () {
299            var sectionid = window.location.hash;
300            sectionid = sectionid.replace('/', '');
301            if ($(sectionid).length > 0) {
302                $('html, body').animate({
303                    scrollTop: $(sectionid).offset().top - hHeight
304                }, 1000);
305            }
306        });
307    }
308
309    $('.vl-header-ticker .owl-carousel').owlCarousel({
310        rtl: JSON.parse(viral_pro_options.rtl),
311        items: 1,
312        margin: 10,
313        loop: true,
314        mouseDrag: false,
315        autoplay: false,
316        autoplayTimeout: 6000,
317        nav: true,
318        dots: false,
319        animateOut: 'slideOutDown',
320        animateIn: 'slideInDown',
321        navText: ['<i class="mdi mdi-chevron-up"></i>', '<i class="mdi mdi-chevron-down"></i>']
322    });
323
324    /*---------Woocommerce Cart---------*/
325    $('.menu-item-ht-cart .woocommerce-mini-cart').mCustomScrollbar({
326        axis: "y",
327        scrollbarPosition: "outside"
328    });
329
330    $('img.vl-lazy').Lazy();
331
332    /*---------Widgets---------*/
333    $('.ht-single-open-accordian .ht-accordion-box').accordion({
334        'transitionSpeed': 400,
335        'singleOpen': true
336    });
337
338    $('.ht-all-open-accordian .ht-accordion-box').accordion({
339        'transitionSpeed': 400,
340        'singleOpen': false
341    });
342
343    $('.widget_viral_pro_counter .ht-counter-widget').waypoint(function () {
344        $('.ht-counter').each(function (index) {
345            var counter_time = parseInt(index * 500 + 300);
346            var $odometer = $(this).find('.odometer');
347            setTimeout(function () {
348                $odometer.html($odometer.data('count'));
349            }, counter_time);
350        });
351        this.destroy();
352    }, {
353        offset: '90%'
354    });
355
356    $('.ht-progress-bar').each(function (index) {
357        var $this = $(this);
358        var delay_time = parseInt(index * 100 + 300);
359        $this.waypoint(function () {
360            setTimeout(function () {
361                $this.find('.ht-progress-bar-length').animate({
362                    width: $this.attr("data-width") + '%'
363                }, 1000, function () {
364                    $this.find("span").animate({
365                        opacity: 1
366                    }, 500);
367                });
368            }, delay_time);
369            this.destroy();
370        }, {
371            offset: '90%',
372        });
373    });
374
375    $('.ht-post-tab').each(function (index) {
376        $(this).find('.ht-pt-header .ht-pt-tab:first').addClass('ht-pt-active');
377        $(this).find('.ht-pt-content-wrap .ht-pt-content:first').show();
378    });
379
380    $('.ht-pt-tab').on('click', function () {
381        var id = $(this).data('id');
382        $(this).closest('.ht-post-tab').find('.ht-pt-tab').removeClass('ht-pt-active');
383        $(this).addClass('ht-pt-active');
384
385        $(this).closest('.ht-post-tab').find('.ht-pt-content').hide();
386        $('#' + id).show();
387    });
388
389    if ($('.ht-post-carousel').length > 0) {
390        $('.ht-post-carousel').owlCarousel({
391            rtl: JSON.parse(viral_pro_options.rtl),
392            items: 1,
393            loop: true,
394            mouseDrag: false,
395            nav: false,
396            dots: true,
397            autoplayTimeout: 6000,
398            autoplay: true,
399            smartSpeed: 600,
400            margin: 5
401        });
402    }
403
404
405    /*---------Selective Refresh Jquery---------*/
406    selectiveRefreshJquery();
407
408    var hasSelectiveRefresh = (
409            'undefined' !== typeof wp &&
410            wp.customize &&
411            wp.customize.selectiveRefresh &&
412            wp.customize.widgetsPreview &&
413            wp.customize.widgetsPreview.WidgetPartial
414            );
415    if (hasSelectiveRefresh) {
416        wp.customize.selectiveRefresh.bind('partial-content-rendered', function (placement) {
417            selectiveRefreshJquery(placement);
418        });
419    }
420
421    function selectiveRefreshJquery(placement) {
422        if (typeof (placement) == 'undefined') {
423            var partial = 'viral_pro_all';
424            var $container = $('.ht-section');
425        } else {
426            var partial = placement.partial.id;
427            var $container = placement.container;
428        }
429
430        var section_class, section_partial;
431
432        if (partial.indexOf('viral_pro_') !== -1) {
433            var partialArr = partial.split('_');
434            if (partialArr[2]) {
435                if (partialArr[2] == 'all') {
436                    section_class = '.ht-section';
437                    section_partial = 'viral_pro_' + partialArr[2];
438                } else if (partialArr[2] == 'frontpage') {
439                    section_class = '.ht-' + partialArr[3] + '-section';
440                    section_partial = 'viral_pro_' + partialArr[3];
441                } else {
442                    section_class = '.ht-' + partialArr[2] + '-section';
443                    section_partial = 'viral_pro_' + partialArr[2];
444                }
445            }
446        }
447
448        //console.log(section_partial);
449        //console.log(section_class);
450
451        $('body').imagesLoaded(function () {
452            $.stellar({
453                horizontalScrolling: false,
454                responsive: true,
455            });
456        });
457
458        if ($container.hasClass('ht-section')) {
459            if ($(section_class + '[data-motion]').length > 0) {
460                $('body').imagesLoaded(function () {
461                    $(section_class + '[data-motion]').each(function () {
462                        var windowSpy = new $.Espy(window);
463                        var element = $(this)[0];
464                        var headerClouds = new Motio(element, {
465                            fps: 30,
466                            speedX: 60
467                        });
468                        // Play only when in the viewport
469                        windowSpy.add(element, function (entered) {
470                            headerClouds[entered ? 'play' : 'pause']();
471                        });
472                    });
473                });
474            }
475
476            if ($(section_class + '[data-property]').length > 0) {
477                $(section_class + '[data-property]').YTPlayer({
478                    showControls: false,
479                    containment: 'self',
480                    mute: true,
481                    addRaster: false,
482                    useOnMobile: false,
483                    playOnlyIfVisible: true,
484                    anchor: 'center,center',
485                    showYTLogo: false,
486                    loop: true,
487                    optimizeDisplay: true,
488                    quality: 'hd720'
489                });
490            }
491        }
492
493        if (($('.vl-ticker:not(.vl-ele-ticker)').length > 0) && ['viral_pro_all', 'viral_pro_ticker'].includes(section_partial)) {
494            var ticker_parameters = $('.vl-ticker:not(.vl-ele-ticker) .owl-carousel').attr('data-params');
495            var ticker_params = JSON.parse(ticker_parameters);
496
497            var ticker_obj = {
498                rtl: JSON.parse(viral_pro_options.rtl),
499                items: 1,
500                margin: 10,
501                loop: true,
502                mouseDrag: false,
503                autoplay: true,
504                autoplayTimeout: parseInt(ticker_params.pause) * 1000,
505                nav: true,
506                dots: false,
507                navText: ['<i class="mdi mdi-chevron-left"></i>', '<i class="mdi mdi-chevron-right"></i>']
508            }
509
510
511            if (ticker_params.animation == 'top-bottom') {
512                ticker_obj.animateOut = 'slideOutDown';
513                ticker_obj.animateIn = 'slideInDown';
514            } else if (ticker_params.animation == 'flip-top-bottom') {
515                ticker_obj.animateOut = 'slideOutDown';
516                ticker_obj.animateIn = 'flipInX';
517            }
518
519            $('.vl-ticker:not(.vl-ele-ticker) .owl-carousel').owlCarousel(ticker_obj);
520        }
521
522        if ($('.vl-slider-wrap:not(.vl-ele-slider-wrap)').length > 0 && ['viral_pro_all', 'viral_pro_slider1', 'viral_pro_slider2'].includes(section_partial)) {
523            $('.vl-slider-wrap:not(.vl-ele-slider-wrap)').owlCarousel({
524                rtl: JSON.parse(viral_pro_options.rtl),
525                items: 1,
526                margin: 0,
527                loop: true,
528                mouseDrag: true,
529                autoplay: true,
530                nav: true,
531                dots: false,
532                navText: ['<i class="mdi mdi-chevron-left"></i>', '<i class="mdi mdi-chevron-right"></i>']
533            });
534        }
535
536        if ($('.vl-fwcarousel-block').length > 0 && ['viral_pro_all', 'viral_pro_fwcarousel'].includes(section_partial)) {
537            var fwc_parameters = $('.vl-fwcarousel-block .owl-carousel').attr('data-params');
538            var fwc_params = JSON.parse(fwc_parameters);
539
540            if (parseInt(fwc_params.items) === 2) {
541                var fwc_params_item_480 = 1;
542            } else {
543                var fwc_params_item_480 = parseInt(fwc_params.items) - 2;
544            }
545
546            $('.vl-fwcarousel-block .owl-carousel').owlCarousel({
547                rtl: JSON.parse(viral_pro_options.rtl),
548                items: parseInt(fwc_params.items),
549                margin: 0,
550                loop: true,
551                mouseDrag: true,
552                autoplay: JSON.parse(fwc_params.autoplay),
553                autoplayTimeout: parseInt(fwc_params.pause) * 1000,
554                nav: true,
555                dots: false,
556                navText: ['<i class="mdi mdi-chevron-left"></i>', '<i class="mdi mdi-chevron-right"></i>'],
557                responsive: {
558                    0: {
559                        items: 1
560                    },
561                    480: {
562                        items: fwc_params_item_480
563                    },
564                    768: {
565                        items: parseInt(fwc_params.items) - 1
566                    },
567                    1000: {
568                        items: parseInt(fwc_params.items)
569                    }
570                }
571            });
572        }
573
574        if ($('.vl-carousel-wrap:not(.vl-ele-carousel-wrap)').length > 0 && ['viral_pro_all', 'viral_pro_carousel1', 'viral_pro_carousel2'].includes(section_partial)) {
575            $('.vl-carousel-wrap:not(.vl-ele-carousel-wrap)').each(function () {
576                var c_parameters = $(this).find('.owl-carousel').attr('data-params');
577                var c_params = JSON.parse(c_parameters);
578
579                if (parseInt(c_params.items) === 2) {
580                    var c_params_item_480 = 1;
581                } else {
582                    var c_params_item_480 = parseInt(c_params.items) - 2;
583                }
584
585                $(this).find('.owl-carousel').owlCarousel({
586                    rtl: JSON.parse(viral_pro_options.rtl),
587                    items: parseInt(c_params.items),
588                    margin: parseInt(c_params.margin),
589                    loop: true,
590                    mouseDrag: true,
591                    autoplay: JSON.parse(c_params.autoplay),
592                    autoplayTimeout: parseInt(c_params.pause) * 1000,
593                    nav: true,
594                    dots: false,
595                    navText: ['<i class="mdi mdi-chevron-left"></i>', '<i class="mdi mdi-chevron-right"></i>'],
596                    responsive: {
597                        0: {
598                            items: 1
599                        },
600                        480: {
601                            items: c_params_item_480
602                        },
603                        768: {
604                            items: parseInt(c_params.items) - 1
605                        },
606                        1000: {
607                            items: parseInt(c_params.items)
608                        }
609                    }
610                });
611            });
612        }
613
614        if ($('.vl-mininews-block:not(.vl-row)').length > 0 && ['viral_pro_all', 'viral_pro_mininews'].includes(section_partial)) {
615            var sliderGallery = function () {
616
617                /*** Vars ***/
618                var gallery = '.vl-mininews-block:not(.vl-row)',
619                        slider = false;
620
621                /*** Init ***/
622                var init = function () {
623
624                    manage(); // On load (1*)
625
626                    $(window).on('resize', function () { // On resize (2*)
627                        manage();
628                    });
629
630                };
631
632                /*** Manage slider ***/
633                var manage = function () {
634
635                    if (!slider && ($(window).width() < 1000)) { // If mobile and slider not built yet = build
636                        build();
637                        slider = true;
638                    } else if (slider && ($(window).width() > 1000)) { // Not mobile but slider built = destroy
639                        destroy();
640                        slider = false;
641                    }
642
643                };
644
645                /*** Build slider ***/
646                var build = function () {
647                    var item900 = 3;
648                    var item768 = 2;
649                    var item580 = 2;
650                    var item0 = 1;
651
652                    if ($(gallery).hasClass('style2')) {
653                        item900 = 5;
654                        item768 = 4;
655                        item580 = 3;
656                        item0 = 2;
657                    }
658
659                    slider = $(gallery).addClass('owl-carousel'); // Add owl slider class (3*)
660                    slider.owlCarousel({
661                        rtl: JSON.parse(viral_pro_options.rtl),
662                        items: $(gallery).attr('data-count'),
663                        loop: true,
664                        margin: 10,
665                        mouseDrag: true,
666                        autoplay: false,
667                        autoplayTimeout: 6000,
668                        dots: true,
669                        lazyLoad: true,
670                        responsive: {
671                            0: {
672                                items: item0
673                            },
674                            580: {
675                                items: item580
676                            },
677                            768: {
678                                items: item768
679                            },
680                            900: {
681                                items: item900
682                            }
683                        }
684                    });
685
686                };
687
688                /*** Destroy slider ***/
689                var destroy = function () {
690                    $(gallery).trigger('destroy.owl.carousel'); // Trigger destroy event (4*) 
691                    $(gallery).removeClass('owl-carousel'); // Remove owl slider class (3*)
692                };
693
694                /*** Public methods***/
695                return {
696                    init: init
697                };
698
699            }();
700
701            sliderGallery.init();
702        }
703
704        /*---------Youtube Video Playlist---------*/
705        if ($('#vl-video-playlist').length > 0 && ['viral_pro_all', 'viral_pro_video'].includes(section_partial)) {
706            $(".vl-video-thumbnails").mCustomScrollbar({
707                axis: "y",
708                scrollbarPosition: "outside"
709            });
710
711            youtube_videoplaylist_class();
712
713            $(window).on('resize', function () {
714                setTimeout(youtube_videoplaylist_class, 500);
715            });
716        }
717
718
719        var hHeight = 0;
720        var adminbarHeight = 0;
721
722        if ($('body').hasClass('admin-bar')) {
723            adminbarHeight = 32;
724        }
725        var $stickyHeader = $('.ht-header');
726
727        if ($('.ht-sticky-header').length > 0 && $stickyHeader.length > 0) {
728            hHeight = $stickyHeader.outerHeight();
729
730            if ($('body').hasClass('ht-header-style4')) {
731                hHeight = hHeight + 38
732            }
733        }
734
735        /*---------Sticky Sidebar---------*/
736        $('.ht-sticky-sidebar #secondary').theiaStickySidebar({
737            additionalMarginTop: hHeight + adminbarHeight + 40,
738            additionalMarginBottom: 40
739        });
740
741        /*---------Sticky Sidebar---------*/
742        $('.ht-enable-sticky-sidebar .ht-leftnews-container .secondary, .ht-enable-sticky-sidebar .ht-rightnews-container .secondary').theiaStickySidebar({
743            additionalMarginTop: hHeight + adminbarHeight + 40,
744            additionalMarginBottom: 40
745        });
746    } //selectiveRefreshJquery Ends
747
748    //add and remove the class on video playlist according to its width
749    function youtube_videoplaylist_class() {
750        $('#vl-video-playlist').each(function () {
751            var playlistWidth = $(this).outerWidth();
752            if (playlistWidth < 788) {
753                $(this).addClass('shrink-playlist');
754            } else if (playlistWidth > 789) {
755                $(this).removeClass('shrink-playlist');
756            }
757        });
758    }
759
760    function checkTime(i) {
761        return (i < 10) ? "0" + i : i;
762    }
763
764    function startTime() {
765        var today = new Date(),
766                h = checkTime(today.getHours()),
767                m = checkTime(today.getMinutes()),
768                s = checkTime(today.getSeconds());
769        $('.vl-time').html(h + ":" + m + ":" + s);
770        t = setTimeout(function () {
771            startTime()
772        }, 500);
773    }
774
775    /*---------GDPR---------*/
776    if (viral_pro_options.customizer_gdpr_settings && typeof (Cookies) !== 'undefined') {
777        var issetPrivacypolicy = Cookies.get('viral_pro_cookies');
778
779        if (typeof (issetPrivacypolicy) == 'undefined' && !JSON.parse(viral_pro_options.customize_preview)) {
780            $('.viral-pro-privacy-policy').show();
781        }
782
783        $('#viral-pro-confirm').on('click', function () {
784            $('.viral-pro-privacy-policy').fadeOut('fast');
785            //var inFifteenMinutes = new Date(new Date().getTime() + 15 * 60 * 1000);
786            Cookies.set('viral_pro_cookies', 'yes', {
787                expires: 1,
788                path: '/'
789            });
790            return false;
791        })
792    }
793});

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.