PageSourceSearch

https://www.krasnevone.sk/user/documents/webotvurci/wt-rating.js?v=1.04

js krasnevone.sk collected 2026-10-05 22:59:52 UTC 4,984 bytes, 120 lines download raw bytes

1$(document).ready(function () {
2    $(".myrating").insertAfter(".homeProductsNav");
3    $.getJSON("https://www.krasnevone.sk/user/documents/wt-data/testimonials.json", function (response) {
4        const data = response[0].data;
5
6        // Omezíme počet recenzí podle velikosti obrazovky
7        const isMobile = window.innerWidth <= 767;
8        const maxReviews = isMobile ? 10 : 20;
9        const reviewsPerSlide = isMobile ? 2 : 5;
10        const limitedData = data.slice(0, maxReviews);
11
12        $(".myrating .swiper-wrapper").empty();
13
14        // Rozdělíme hodnocení do bloků podle velikosti obrazovky
15        for (let i = 0; i < limitedData.length; i += reviewsPerSlide) {
16            const chunk = limitedData.slice(i, i + reviewsPerSlide);
17            let groupHtml = '<div class="myreference-group">';
18
19            chunk.forEach(item => {
20                let stars = '';
21                for (let j = 0; j < 5; j++) {
22                    stars += `<span class="${j < item.rating ? 'star star-full' : 'star star-off'}"></span>`;
23                }
24
25                groupHtml += `
26                        <div class="myreference">
27                            <div class="myreference-text">${item.description}</div>
28                            <div class="myreference-stars">${stars}</div>
29                            <div class="myreference-name">${item.fullName}</div>
30                        </div>
31                    `;
32            });
33
34            groupHtml += '</div>';
35
36            // Vložíme celý blok do jednoho swiper-slide
37            $('.myrating-swiper .swiper-wrapper').append(`
38                    <div class="swiper-slide">${groupHtml}</div>
39                `);
40        }
41
42        // Inicializace Swiperu
43        window.myRatingSwiper = new Swiper('.myrating-swiper', {
44            slidesPerView: 1,
45            spaceBetween: 30,
46            loop: false,
47            autoHeight: true,
48            pagination: {
49                el: '.swiper-pagination',
50                clickable: true,
51            },
52            navigation: {
53                nextEl: '.swiper-button-next',
54                prevEl: '.swiper-button-prev',
55            }
56        });
57    });
58
59    // Přepočítání při změně velikosti okna
60    let resizeTimeout;
61    $(window).on('resize', function() {
62        clearTimeout(resizeTimeout);
63        resizeTimeout = setTimeout(function() {
64            // Znovu načteme recenze s novým limitem
65            $.getJSON("https://www.krasnevone.sk/user/documents/wt-data/testimonials.json", function (response) {
66                const data = response[0].data;
67                const isMobile = window.innerWidth <= 767;
68                const maxReviews = isMobile ? 10 : 20;
69                const reviewsPerSlide = isMobile ? 2 : 5;
70                const limitedData = data.slice(0, maxReviews);
71
72                $(".myrating .swiper-wrapper").empty();
73
74                for (let i = 0; i < limitedData.length; i += reviewsPerSlide) {
75                    const chunk = limitedData.slice(i, i + reviewsPerSlide);
76                    let groupHtml = '<div class="myreference-group">';
77
78                    chunk.forEach(item => {
79                        let stars = '';
80                        for (let j = 0; j < 5; j++) {
81                            stars += `<span class="${j < item.rating ? 'star star-full' : 'star star-off'}"></span>`;
82                        }
83
84                        groupHtml += `
85                                <div class="myreference">
86                                    <div class="myreference-text">${item.description}</div>
87                                    <div class="myreference-stars">${stars}</div>
88                                    <div class="myreference-name">${item.fullName}</div>
89                                </div>
90                            `;
91                    });
92
93                    groupHtml += '</div>';
94                    $('.myrating-swiper .swiper-wrapper').append(`
95                            <div class="swiper-slide">${groupHtml}</div>
96                        `);
97                }
98
99                // Znovu inicializujeme Swiper
100                if (window.myRatingSwiper) {
101                    window.myRatingSwiper.destroy(true, true);
102                }
103                window.myRatingSwiper = new Swiper('.myrating-swiper', {
104                    slidesPerView: 1,
105                    spaceBetween: 30,
106                    loop: false,
107                    autoHeight: true,
108                    pagination: {
109                        el: '.swiper-pagination',
110                        clickable: true,
111                    },
112                    navigation: {
113                        nextEl: '.swiper-button-next',
114                        prevEl: '.swiper-button-prev',
115                    }
116                });
117            });
118        }, 250);
119    });
vendor: 3 bytes, line 120
120});

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.