PageSourceSearch

https://zabol-deg.ru/static/project_common/scripts/base.js?20211220172638

js zabol-deg.ru collected 2026-10-08 09:12:24 UTC 11,542 bytes, 273 lines download raw bytes

1var LOGIN_URL = '/auth/login/';
2
3// Member
4
5function column_data_select_onchange(self, url) {
6    $.post(url, {'value': $(self).val()}, function () {
7        var current_args = $.QueryString;
8        var args = {clear_filtered: ''};
9        for (var key in current_args) {
10            if (!current_args.hasOwnProperty(key)) continue;
11            if (key !== 'sort' && key !== 'csrfmiddlewaretoken')
12                args[key] = current_args[key];
13        }
14        args = $.param(args);
15        if (args.length > 0)
16            location.href = location.pathname + '?' + args;
17        else
18            location.href = location.pathname;
19    });
20}
21
22// Закладки на странице списка сторонников
23$(function () {
24    $('table.b-member-list').find('tr').find('td:nth-child(2)').click(function (event) {
25        if (event.ctrlKey === true) {
26            var self = $(this);
27            var obj_str = self.attr('data-obj-str');
28            $.ajax({
29                type: 'POST',
30                url: '/member/member_setbookmark/',
31                dataType: 'json',
32                data: {'obj_str': obj_str},
33                success: function (response) {
34                    console.log(response);
35                }
36            });
37        }
38    });
39});
40
41// Глобальные события при выполнении ajax запросов
42$(document).ajaxSuccess(function (event, request, settings) {
43    try {
44        var json = $.parseJSON(request.responseText);
45        if (json.message && window.top === window.self)
46            inova_popup.set_message(json.message, 'Сообщение');
47        if (json.redirect) {
48            setTimeout(function () {
49                window.location = json.redirect;
50            }, 500);
51        }
52    } catch (e) {
53    }
54});
55
56// Календарь
57$(function () {
58    var max_year = (new Date().getFullYear()) + 7;
59    $.datepicker.setDefaults($.datepicker.regional['ru']);
60    $(document)
61        .on('click', 'input.js-datepicker, .b-form__field_widget-type_dateinput input[type=text], .uil-form-controls-v2_type_date input[type=text]', function () {
62            $(this).datepicker({
63                showOn: 'focus',
64                changeYear: true,
65                yearRange: '1915:' + max_year,
66                dateFormat: 'dd.mm.yy'
67            }).focus();
68        })
69        .on('click', '.b-form__field_widget-type_splitdatetimewidget input[type=text], .uil-form-controls-v2_type_datetime input[type=text]', function () {
70            if (this.name.indexOf('_0') !== -1)
71                $(this).datepicker({
72                    showOn: 'focus',
73                    changeYear: true,
74                    yearRange: '1915:' + max_year,
75                    dateFormat: 'dd.mm.yy'
76                }).focus();
77        });
78});
79
80// Полоска перемотки, как в вконтакте
81$(function () {
82    if (window['AUTO_SCROLL_TOP_SELECTOR'] !== undefined) {
83        // BEGIN Автоматическая перемотка
84        var scroll_id = 'stored_scroll_' + location.pathname.replace(/\//g, '');
85        var scroll_value = $.cookie(scroll_id);
86        if (scroll_value !== undefined && !isNaN(Number(scroll_value)) && location.hash.length === 0) {
87            if ($.cookie('inova_admin_state') !== undefined && $.cookie('inova_admin_state') !== 'invisible')
88                setTimeout(function () {
89                    $('html, body').stop(true, true).animate({scrollTop: Number(scroll_value)}, 0);
90                }, 200);
91            else
92                $('html, body').stop(true, true).animate({scrollTop: Number(scroll_value)}, 0);
93            $.removeCookie(scroll_id, {path: '/'});
94        }
95        // END Автоматическая перемотка
96
97        var scroll_timer;
98        var displayed = false;
99        var $scroll_top = $('#scroll_top');
100        var $window = $(window);
101        var scroll_store = $(document.body).height() - $window.height();
102
103        function scroll_top_offset() {
104            var offset_height = 0;
105            if (window['AUTO_SCROLL_OFFSET_HEIGHT_SELECTOR'] !== undefined)
106                $(window['AUTO_SCROLL_OFFSET_HEIGHT_SELECTOR']).each(function () {
107                    var h = $(this).height();
108                    if (h > offset_height)
109                        offset_height = h;
110                });
111            return $(window['AUTO_SCROLL_TOP_SELECTOR']).offset().top - offset_height;
112        }
113
114        function scroll_max_width() {
115            if (window['AUTO_SCROLL_MAX_WIDTH_SELECTOR'] !== undefined)
116                return $(window['AUTO_SCROLL_MAX_WIDTH_SELECTOR']).width() + $scroll_top.width() * 2;
117            return 0;
118        }
119
120        function scroll_update_arrow() {
121            if ($window.scrollTop() <= scroll_top_offset()) {
122                $scroll_top.removeClass('b-scroll-top_direction_top');
123                $scroll_top.addClass('b-scroll-top_direction_bottom');
124            } else {
125                $scroll_top.removeClass('b-scroll-top_direction_bottom');
126                $scroll_top.addClass('b-scroll-top_direction_top');
127            }
128        }
129
130        function anti_incursion() {
131            if ($window.width() < scroll_max_width())
132                $scroll_top.hide();
133            else
134                $scroll_top.show();
135        }
136
137        anti_incursion();
138        $window.resize(function () {
139            anti_incursion();
140        });
141        $window.scroll(function () {
142            if (scroll_timer !== undefined)
143                window.clearTimeout(scroll_timer);
144            scroll_timer = window.setTimeout(function () {
145                // BEGIN Автоматическая перемотка
146                var scroll_id = 'stored_scroll_' + location.pathname.replace(/\//g, '');
147                $.cookie(scroll_id, $(document.body).scrollTop(), {expires: get_date_tmp_cookie(), path: '/'});
148                // END Автоматическая перемотка
149                scroll_update_arrow();
150                if ($window.scrollTop() > scroll_top_offset())
151                    scroll_store = $window.scrollTop();
152                if ($window.scrollTop() < scroll_top_offset()) {
153                    if (displayed === true) {
154                        displayed = false;
155                        $scroll_top.stop(true, true).animate({opacity: 0.01}, 500);
156                    }
157                } else {
158                    if (displayed === false) {
159                        displayed = true;
160                        $scroll_top.stop(true, true).animate({opacity: 1}, 500);
161                    }
162                }
163            }, 500);
164        });
165        $scroll_top.hover(
166            function () {
167                scroll_update_arrow();
168                if (displayed === false) {
169                    displayed = true;
170                    $scroll_top.stop(true, true).animate({opacity: 1}, 500);
171                }
172            },
173            function () {
174                scroll_update_arrow();
175                if (displayed === true && $window.scrollTop() < scroll_top_offset()) {
176                    displayed = false;
177                    $scroll_top.stop(true, true).animate({opacity: 0.01}, 500);
178                }
179            }
180        );
181        $scroll_top.click(function (e) {
182            e.preventDefault();
183            if ($window.scrollTop() <= scroll_top_offset() && scroll_store !== undefined)
184                $('html, body').stop(true, true).animate({scrollTop: scroll_store}, 500, 'swing');
185            else
186                $('html, body').stop(true, true).animate({scrollTop: scroll_top_offset()}, 500, 'swing');
187        });
188    }
189});
190
191// Сравнение
192/*
193$(function () {
194    var compare_button_timeout;
195    $('a.b-inova-comparator__change-link').each(function () {
196        var self = $(this);
197        var data = $.QueryString;
198        data['csrfmiddlewaretoken'] = get_csrf_token();
199        self.click(function () {
200            $.ajax({
201                type: 'POST',
202                url: self.attr('href'),
203                dataType: 'json',
204                data: data,
205                success: function (response) {
206                    setTimeout(function () {
207                        self.toggleClass('b-inova-comparator__change-link_active');
208                        if (self.hasClass('b-inova-comparator__change-link_active')) {
209                            self.attr('title', 'Исключить из сравнения');
210                            self.text('Исключить из сравнения');
211                        } else {
212                            self.attr('title', 'Добавить к сравнению');
213                            self.text('Добавить к сравнению');
214                        }
215                        if (self.attr('data-reaload-page') !== undefined) {
216                            location.href = location.href.split('#', 1)[0];
217                        }
218                        if (self.attr('data-compare-url') !== undefined) {
219                            if ($('#compare_button').length === 0)
220                                $(document.body).append('<div class="b-inova-comparator__compare-button" id="compare_button"><a href="' + self.attr('data-compare-url') + '">Сравнить</a></div>');
221                            var compare_button = $('#compare_button');
222                            compare_button.stop(true, true);
223                            compare_button.css({
224                                left: parseInt(self.offset()['left']) + self.width() + 12 + 'px',
225                                top: parseInt(self.offset()['top']) + 'px'
226                            });
227                            compare_button.fadeIn(500);
228                            clearTimeout(compare_button_timeout);
229                            compare_button_timeout = setTimeout(function () {
230                                compare_button.fadeOut(500);
231                            }, 3000);
232                            compare_button.hover(
233                                function () {
234                                    compare_button.stop(true, true);
235                                    clearTimeout(compare_button_timeout);
236                                },
237                                function () {
238                                    clearTimeout(compare_button_timeout);
239                                    compare_button_timeout = setTimeout(function () {
240                                        compare_button.fadeOut(500);
241                                    }, 3000);
242                                }
243                            );
244                        }
245
246                    }, 250);
247                }
248            });
249            return false;
250        });
251    });
252    $('.b-inova-comparator__table-compare__delete-selected a').click(function () {
253        var self = $(this);
254        var deletable = [];
255        self.closest('tr').find('input[type="checkbox"]:checked').each(function () {
256            deletable.push($(this).attr('id').split('deletable_')[1]);
257        });
258        if (deletable.length > 0)
259            $.ajax({
260                type: 'POST',
261                url: self.attr('href'),
262                dataType: 'json',
263                data: {'deletable': deletable},
264                success: function (response) {
265                    setTimeout(function () {
266                        location.href = location.href.split('#', 1)[0];
267                    }, 500);
268                }
269            });
270        return false;
271    });
272});
273*/

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.