PageSourceSearch

https://www.fesco.ru/local/components/fesco/subscribe.add/templates/new-subscribe/script.js?17448761862252

js fesco.ru collected 2026-10-02 09:57:58 UTC 2,252 bytes, 54 lines download raw bytes

1$(function () {
2    'use strict';
3
4    var $subscriptionPopup = $('.popup.popup--subscription[data-popup="subscription-form-popup"]');
5    var $resultBadPopup = $('.popup.popup--subscription[data-popup="subscription-result-popup"]');
6    var $resultPopup = $('.popup[data-popup="subscription-result-popup"]');
7
8    $(document)
9        .on('submit', '.form.new-form', function (ev) {
10            ev.preventDefault();
11
12            var $form = $(this);
13            var $email = $form.find('input[name=email]');
14
15            BX.ajax.runComponentAction(
16                'fesco:subscribe.add',
17                'subscribe',
18                {
19                    mode: 'class',
20                    data: {
21                        email: $form.find('input[name=email]').val()
22                    }
23                }
24            )
25                .then(function (response) {
26                    if (response.status === 'success') {
27                        $subscriptionPopup.css({ display: 'none' });
28                        $resultPopup.trigger('open').css({ display: 'flex' });
29                        $resultBadPopup.css({ display: 'none' });
30                        $form.next('.js-other-text').show();
31                        $form.find('input[name=email]').val('');
32                    }
33                })
34                .catch(function (response) {
35                    if (response.status === 'error' && response.errors.length > 0) {
36                        if (response.status === 'error' && response.errors.length > 0) {
37                            if (typeof $email[0].pristine !== 'undefined') {
38                                $email[0].pristine.self.addError($email[0], response.errors[0].message);
39                            }
40                        }
41                    }
42                });
43        })
44        .on('focus', '.form.new-form input[name=email]', function () {
45            $(this)
46                .parents('form')
47                .next('.js-other-text')
48                .hide(500);
49        });
50
51    $('.js-show-text .new-form').each(function () {
52        $(this).closest('.js-show-text').find('.subscribe__wrapper .js-other-text').show().parent().scrollTo(-100);
53    });
54});

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.