PageSourceSearch

https://portkkm.ru/local/templates/port_2021/components/bitrix/new…/loyal_page_2024/script.js?17790829533722

js portkkm.ru collected 2026-10-04 05:36:33 UTC 3,722 bytes, 123 lines download raw bytes

1function open_tab_l(role, element) {
2    document.querySelectorAll('.tab_loyalty_b3_el').forEach(function(el) {
3        el.classList.remove('active');
4    });
5    element.classList.add('active');
6    document.querySelectorAll('.tab_loyalty_b3_block_elems').forEach(function(block) {
7        block.style.display = 'none';
8    });
9    document.querySelector('.tab_loyalty_b3_block_elems[role="' + role + '"]').style.display = 'block';
10}
11$(document).ready(function () {
12const swiper = new Swiper('.swiper0', {
13    // Optional parameters
14    direction: 'horizontal',
15    loop: true,
16    // If we need pagination
17    pagination: {
18        el: '.swiper-pagination',
19    },
20    autoplay: {
21        delay:5000,
22    },
23    effect:'fade'
24});
25const swiper1 = new Swiper('.swiper1', {
26    // Optional parameters
27    direction: 'horizontal',
28    loop: true,
29    // If we need pagination
30    pagination: {
31        el: '.swiper-pagination',
32    },
33    autoplay: {
34        delay:5000},
35    effect:'fade'
36});
37const swiper2 = new Swiper('.swiper2', {
38    // Optional parameters
39    direction: 'horizontal',
40    loop: true,
41    // If we need pagination
42    pagination: {
43        el: '.swiper-pagination',
44    },
45    autoplay: {
46        delay:5000},
47    effect:'fade'
48});})
49
50
51function cropper_open() {
52    var lb = $('#modal_cropper_loyal')
53
54    setTimeout(function () {
55        lb.addClass('preload')
56    }, 10)
57    setTimeout(function () {
58        lb.removeClass('preload')
59        lb.addClass('show')
60    }, 200)
61}
62
63function cropper_closes(event) {
64    var close = false
65    if (typeof event == 'boolean') {
66        close = event
67    } else {
68        var classList = event.target.classList
69        if (classList.contains('lightbox') || classList.contains('lightbox_window_over')  || classList.contains('lightbox_window_close')) {
70            close = true
71        }
72    }
73    var lb = $('#modal_cropper_loyal')
74
75    if (close) {
76     //   lb.addClass('preload')
77        lb.removeClass('show')
78
79       // setTimeout(function () {
80        //    lb.removeClass('preload')
81       // }, 100)
82    }
83}
84
85function SendCallbackFormLoyal(elem) {
86    var phoneValue = $(elem).parents('form').find('[name="USERPHONE"]');
87    var nameValue = $(elem).parents('form').find('[name="USERNAME"]');
88    var numberOfCharacters = phoneValue.val().length;
89    console.info(nameValue.val().length)
90    phoneValue.css('border','')
91    if(numberOfCharacters == 18 && $(elem).parents('form').find('input[type="checkbox"]').is(':checked') && nameValue.val().length != 0){
92        var form = $(elem).parents('form')
93        $(form).find('[name=URL]').remove();
94        $(form).append('<input type="hidden" name="URL" value="' + window.location.href + '">');
95        var formData = new FormData($(form).get(0));
96        $.ajax({
97            contentType: false,
98            processData: false,
99            type: "post",
100            url: '/ajax/form/form_name_phone_comment.php',
101            data: formData,
102            success: function (data) {
103                if (data == 'true') {
104                    $('#modal_cropper_loyal').find('input').val('');
105                    openModalApplication();
106                    cropper_closes(true);
107                }
108            }
109        });
110    } else {
111        if($(elem).parents('form').find('input[type="checkbox"]').is(':checked')){
112            if(nameValue.val().length != 0){
113                phoneValue.css('border','1px solid red')
114            } else {
115                nameValue.css('border','1px solid red')
116            }
117        } else {
118            $(elem).parents('form').find('.help__form-label').css('color','red')
119            $(elem).parents('form').find('.help__form-label a').css('color','red')
120        }
121
122    }
123}

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.