PageSourceSearch

https://xn--56-plcifg2alx8f.xn--p1ai/local/templates/redkot/js/scripts.js?17727975474091

js xn--56-plcifg2alx8f.xn--p1ai collected 2026-10-07 20:45:18 UTC 4,091 bytes, 101 lines download raw bytes

1$(document).ready(function() {
2    /* Favorites */
3    $('.favor').on('click', function(e) {
4        var favorID = $(this).attr('data-item');
5        if($(this).hasClass('is-active'))
6            var doAction = 'delete';
7        else
8            var doAction = 'add';
9
10        addFavorite(favorID, doAction);
11    });
12    /* Favorites */
13
14     // Функция для чтения куки
15    function getCookie(name) {
16        const value = "; " + document.cookie;
17        const parts = value.split("; " + name + "=");
18        if (parts.length === 2) return parts.pop().split(";").shift();
19    }
20    // Проверяем, есть ли кука
21    if (!getCookie('coockcheck')) {
22        $('#gdpr-cookie-message').removeClass('_hide');
23    }
24    $('.gdpr_cookie_btn').on('click', function (e) {
25        e.preventDefault();
26        // Проверяем, есть ли кука
27        if (!getCookie('coockcheck')) {
28            // Устанавливаем сессионную куку (без expires)
29            document.cookie = "coockcheck=1; path=/";
30            $('#gdpr-cookie-message').addClass('_hide');
31        }
32    });
33});
34/* Избранное */
35    function addFavorite(id, action)
36    {
37        var param = 'id='+id+"&action="+action;
38        $.ajax({
39            url:     '/local/templates/redkot/ajax/favorites.php', // URL отправки запроса
40            type:     "GET",
41            dataType: "html",
42            data: param,
43            success: function(response) { // Если Данные отправлены успешно
44                var result = $.parseJSON(response);
45                if(result == 1){ // Если всё чётко, то выполняем действия, которые показывают, что данные отправлены
46                     $('.favor[data-item="'+id+'"]').addClass('is-active');
47                     /*var wishCount = parseInt($('#want .col').html()) + 1;
48                     $('#want .col').html(wishCount); // Визуально меняем количество у иконки*/
49                }
50                if(result == 2){
51                     $('.favor[data-item="'+id+'"]').removeClass('is-active');
52                     /*var wishCount = parseInt($('#want .col').html()) - 1;
53                     $('#want .col').html(wishCount); // Визуально меняем количество у иконки*/
54                }
55            },
56            error: function(jqXHR, textStatus, errorThrown){ // Ошибка
57                console.log('Error: '+ errorThrown);
58            }
59         });
60    }
61/* Избранное */
62
63
64function onloadFunction() {
65    if (!window.smartCaptcha) return;
66
67    const captchaContainers = document.querySelectorAll('.captcha-container');
68
69    captchaContainers.forEach((container) => {
70        const currentForm = container.closest('form');
71        if (!currentForm) return;
72
73        const widgetId = window.smartCaptcha.render(container, {
74            sitekey: 'ysc1_2b4PVRbzDiNdUkgmFKaTvMGwWiHfTKAvMsmcJ8UO6571c6a4',
75            invisible: true, // Невидимая капча
76            hideShield: true,
77            callback: (token) => {
78                let input = currentForm.querySelector('input[name="smart-token"]');
79                if (!input) {
80                    input = document.createElement('input');
81                    input.type = 'hidden';
82                    input.name = 'smart-token';
83                    currentForm.appendChild(input);
84                }
85                input.value = token;
86
87                currentForm.submit();
88            }
89        });
90
91        currentForm.addEventListener('submit', (e) => {
92            e.preventDefault();
93
94            const submitBtn = currentForm.querySelector('[type="submit"]');
95            if (submitBtn) submitBtn.disabled = true;
96
97            // Запускаем проверку капчи
98            window.smartCaptcha.execute(widgetId);
99        });
100    });
101}

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.