PageSourceSearch

https://www.ashmanov.com/local/components/ashmanov/form-and-text/templates/callback_new/script.js

js ashmanov.com collected 2026-10-02 02:30:07 UTC 2,510 bytes, 87 lines download raw bytes

1setTimeout(function () {
2    $form = $('#subscribe_form_fixed');
3    $formWrapper = $('.b-block-form.b-block-fixed');
4    $commonForm = $('.js-form-subscribe-embedded');
5    let cookie = getCookie('hide_fixed_block');
6
7    if (getCookie('accept_cookies') !== 'y') {
8        $formWrapper.addClass('showed--cookie')
9    }
10
11    if($commonForm.length) {
12        $(window).on('scroll resize', function () {
13            let maxScroll = $commonForm[0].offsetTop - 1000;
14            if ($(window).scrollTop() > maxScroll) {
15                $formWrapper.fadeOut(500);
16            } else {
17                if (cookie != 'y') {
18                    $formWrapper.fadeIn(500)
19                }
20            }
21        });
22    }
23
24    $('.js-close-form').on('click', function () {
25        setCookie('hide_fixed_block', 'y', {expires: 1 * 24 * 60 * 60, path: '/', secure: false})
26        $('.js-fixed-form').addClass('hidden');
27    });
28
29    $('.callback_form_caller .b-block-form-form__submit').on('click', function () {
30        $('.callback_form_caller').slideToggle();
31        let date = new Date();
32        date.setMonth(date.getMonth() + 1).setDate(date.getDate() + 1);
33        setCookie('hide_fixed_block', 'y', {expires: date, path: '/', secure: false})
34
35        dataLayer.push({
36            'event': 'GAevent',
37            'eventCategory': 'click',
38            'eventAction': 'blognew',
39            'eventLabel': "{SLUG}"
40        });
41    });
42
43    $(function () {
44        if (cookie != 'y') {
45            $formWrapper.fadeIn(500)
46        }
47    });
48
49}, 10000)
50
51
52
53function getCookie(name) {
54    var matches = document.cookie.match(new RegExp(
55        "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
56    ));
57    return matches ? decodeURIComponent(matches[1]) : undefined;
58}
59
60function setCookie(name, value, options) {
61    options = options || {};
62
63    var expires = options.expires;
64
65    if (typeof expires == "number" && expires) {
66        var d = new Date();
67        d.setTime(d.getTime() + expires * 1000);
68        expires = options.expires = d;
69    }
70    if (expires && expires.toUTCString) {
71        options.expires = expires.toUTCString();
72    }
73
74    value = encodeURIComponent(value);
75
76    var updatedCookie = name + "=" + value;
77
78    for (var propName in options) {
79        updatedCookie += "; " + propName;
80        var propValue = options[propName];
81        if (propValue !== true) {
82            updatedCookie += "=" + propValue;
83        }
84    }
85
86    document.cookie = updatedCookie;
87}

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.