PageSourceSearch

https://salonzabava.ru/js/profsalon.js?v=bt&ver=6ac675536d013

js salonzabava.ru collected 2026-10-07 16:37:59 UTC 4,400 bytes, 125 lines download raw bytes

1jQuery(document).ready(function ($) {
2
3    let psWidth = '100%';
4
5    if ($(window).width() < 530) {
6        psWidth = '100%';
7    } else {
8        psWidth = '530px';
9    }
10
11    // Функция для открытия iframe
12    function openIframe() {
13
14        if ($('#profsalon-container').length > 0) {
15            $('#profsalon-container').remove();
16            $('body').removeAttr('style');
17        }
18
19        const iframeContainer = $('<div>', {
20            id: 'profsalon-container',
21            css: {
22                position: 'fixed',
23                top: 0,
24                right: 0,
25                width: psWidth,
26                height: '100%',
27                backgroundColor: '#fff',
28                zIndex: 99999,
29                overflow: 'hidden',
30                boxShadow: '0px 0px 20px rgba(0, 0, 0, 0.5)'
31            }
32        });
33
34        const closeBtn = $('<button>', {
35            text: '×',
36            css: {
37                position: 'absolute',
38                top: '0px',
39                right: '0px',
40                width: '40px',
41                height: '40px',
42                border: 'none',
43                backgroundColor: '#333',
44                color: '#ddd',
45                fontSize: '31px',
46                lineHeight: '1',
47                cursor: 'pointer',
48                borderRadius: '0px',
49                zIndex: 100000
50            }
51        });
52
53        const iframe = $('<iframe>', {
54            id: 'profsalon_iframe_custom',
55            src: 'https://profsalon.org/booking/salonzabava/main?skip_places=true&amp;version=v3&amp;online_booking_app_url=https://profsalon.org/booking&amp;start_host=https://salonzabava.ru&amp;show_close_btn=true',
56            css: {
57                width: '100%',
58                height: '100%',
59                border: 'none'
60            },
61            scrolling: 'yes',
62            frameborder: '0',
63            zIndex: 99998
64        });
65
66        iframeContainer.append(iframe).append(closeBtn);
67        $('body').append(iframeContainer).css('overflow', 'hidden');
68
69        closeBtn.on('click', function () {
70            closeIframe();
71        });
72    }
73
74    // Функция для закрытия iframe
75    function closeIframe() {
76        $('#profsalon-container').remove();
77        $('body').removeAttr('style');
78
79        // Возвращаем предыдущий URL
80        if (window.history.state && window.history.state.previousUrl) {
81            window.history.pushState({}, '', window.history.state.previousUrl);
82        } else {
83            window.history.pushState({}, '', window.location.pathname.replace('/online-record/', ''));
84        }
85    }
86
87    // Обработчик клика по кнопке
88    $('.ps-btn-custom-custom').on('click', function (e) {
89        e.preventDefault();
90
91        // Сохраняем текущий URL и меняем на /online-record/
92        const currentUrl = window.location.pathname;
93        window.history.pushState({ previousUrl: currentUrl }, '', '/online-record/');
94
95        openIframe();
96    });
97
98    // Обработчик клика вне iframe для его закрытия
99    $(document).on('click', function (e) {
100        // Проверяем, открыт ли iframe
101        if ($('#profsalon-container').length > 0) {
102            // Проверяем, что клик произошел не по iframe и не по кнопке открытия
103            if (!$(e.target).closest('#profsalon-container').length &&
104                !$(e.target).closest('.ps-btn-custom-custom').length) {
105                closeIframe();
106            }
107        }
108    });
109
110    // Проверяем URL при загрузке страницы
111    if (window.location.pathname === '/online-record/' || window.location.pathname === '/online-record') {
112        openIframe();
113    }
114
115    // Обработка кнопки "Назад" в браузере
116    window.addEventListener('popstate', function(event) {
117        if ($('#profsalon-container').length > 0) {
118            $('#profsalon-container').remove();
119            $('body').removeAttr('style');
120        } else if (window.location.pathname === '/online-record/' || window.location.pathname === '/online-record') {
121            openIframe();
122        }
123    });
124
125});

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.