PageSourceSearch

https://tomdom.ru/js/catalog/index.js?v=40

js tomdom.ru collected 2026-10-03 19:35:53 UTC 39,906 bytes, 887 lines download raw bytes

1function getcounts(n) {
2    // временно отключаем на пробу
3    return true;
4    var q = $("form.ajax_filter").serialize();
5    var cid = category_id;
6    var stype;
7    $("span").removeClass("inactive");
8    $.getJSON("/res/api/ajax_filter.php", q + "&ajax=y&changed=" + n + "&cid=" + cid + "&seo_url=" + seo_url + "&seo_id=" + seo_id + "&stype=" + stype, function (data) {
9        $.each(data, function (key, val) {
10            var p = val.p;
11            $.each(val.v, function (v, d) {
12                //$("#"+p+"_id_"+d.i).attr("disabled", false);
13                $("#lbl_" + p + "_id_" + d.i).removeClass("inactive");
14                if (d.c == 0) {
15                    //$("#"+p+"_id_"+d.i).attr("disabled", true);
16                    $("#lbl_" + p + "_id_" + d.i).addClass("inactive");
17                }
18
19                $("#lbl_" + p + "_id_" + d.i + " span.num").html("(" + d.c + ")");
20            });
21        });
22    });
23}
24
25function load_pagination(curr_page, pages, url, show, pages_count, fp) {
26    $.get("/res/api/ajax_pages.php", {
27        'curr_page': curr_page,
28        'pages': pages,
29        'url': url,
30        'show': show,
31        'pages_count': pages_count,
32        'first_id': fp,
33        'qstr': qstr
34    }, function (data) {
35        //console.log(data);
36        $(".paging-holder").html(data);
37    });
38}
39
40function showpages() {
41    if (typeof load_pagination_i !== "undefined") {
42        if (load_pagination_i == 1) {
43            fp = $(".product-list-holder ul.product-list li:first").prop("id");
44            load_pagination(pr, pc, pu, ps, pn, fp);
45        }
46    }
47}
48
49function load_next_page_pics() {
50    if (typeof ponpj !== "undefined") {
51        $.each(ponpj, function (index, value) {
52            $("body").append("<img alt='' src='/upload/products_photos/listimg/" + value + "' style='position: absolute; top: -20000px; left: -20000px;' />");
53        });
54    }
55}
56
57function initHiddenItems() {
58    if ($('.filter.expanded-filter').length) {
59        $('.filter.expanded-filter .item').each(function () {
60            var _this = $(this);
61            if (_this.offset().top > $('.filter.expanded-filter').offset().top && _this.offset().top < $('.filter.expanded-filter').offset().top + $('.filter.expanded-filter').height()) {
62                _this.removeClass('hidden');
63            } else {
64                _this.addClass('hidden');
65            }
66        });
67    }
68}
69
70function initExpandedFilter() {
71    $('.filter.expanded-filter').attr('style', '')
72    _hidden_height = $('.filter.expanded-filter .item').height() + 14;
73    _opened_height = $('.filter.expanded-filter').attr('style', '').height();
74    //_opened_height = 105;
75    if (!$('.filter-opener').hasClass('opened')) {
76        $('.filter.expanded-filter').css({
77            'height': _hidden_height
78        });
79    } else {
80        $('.filter.expanded-filter').css({
81            'height': _opened_height
82        });
83    }
84    $('.filter-opener').click(function () {
85        var _this = $(this);
86        if (!$('.filter.expanded-filter').is(':animated')) {
87            if (_this.hasClass('opened')) {
88                $('.filter.expanded-filter').animate({
89                    'height': _hidden_height
90                }, 300, function () {
91                    _this.removeClass('opened');
92                    initHiddenItems();
93                    initFilterFix();
94                });
95            } else {
96                $('.filter.expanded-filter').animate({
97                    'height': _opened_height
98                }, 300, function () {
99                    _this.addClass('opened');
100                    initHiddenItems();
101                    initFilterFix();
102                });
103            }
104        }
105    });
106    var tmr;
107    var tmr2;
108    var ivebeenclicked = 0;
109    $("#filterform1").click(function () {
110        ivebeenclicked = 1;
111        clearTimeout(tmr);
112        clearTimeout(tmr2);
113    });
114    $("#filterform1").hover(function () {
115        if ($(".filter-opener").is(":visible")) {
116            clearTimeout(tmr);
117
118            var _this = $(this).find(".filter-opener");
119            if (!$('.filter.expanded-filter').is(':animated')) {
120                if (_this.hasClass('opened')) {
121
122                } else {
123
124                    tmr2 = window.setTimeout(function () {
125                        $('.filter.expanded-filter').animate({
126                            'height': _opened_height
127                        }, 300, function () {
128                            _this.addClass('opened');
129                            initHiddenItems();
130                            initFilterFix();
131                        });
132                    }, 500);
133
134                }
135            }
136        }
137    }, function () {
138        if ($(".filter-opener").is(":visible")) {
139            clearTimeout(tmr2);
140            var _this = $(this).find(".filter-opener");
141            if (ivebeenclicked == 0) {
142                tmr = window.setTimeout(function () {
143
144                    if (_this.hasClass('opened')) {
145                        $('.filter.expanded-filter').animate({
146                            'height': _hidden_height
147                        }, 300, function () {
148                            _this.removeClass('opened');
149                            initHiddenItems();
150                            initFilterFix();
151                        });
152                    }
153                }, 5000);
154            }
155        }
156    });
157    initFilterFix();
158}
159
160function initPriceSlider() {
161    $('.price-slider').each(function (i, e) {
162        var _self = this;
163        var _measure = $(_self).data('measure');
164        //var _step = parseInt($(_self).data('step'));
165        var _valMin = parseInt($(_self).find('.min').val()),
166            _valMax = parseInt($(_self).find('.max').val()),
167            _min = $(_self).find('.min').data("pr"),
168            _max = $(_self).find('.max').data("pr");
169
170        $(_self).find('.sslider').slider({
171            range: true,
172            min: _min,
173            step: 10,
174            max: _max,
175            values: [_valMin, _valMax],
176            slide: function (event, ui) {
177                $(_self).find('.min').val(ui.values[0] + ' ' + _measure);
178                $(_self).find('.max').val(ui.values[1] + ' ' + _measure);
179            },
180            stop: function () {
181                $("#filterform1").submit();
182            }
183        });
184
185        $(_self).find('.max').change(function () {
186            var _maxValue = $(this).data('pr');
187            var value1 = parseInt($(_self).find('.min').val());
188            var value2 = parseInt($(this).val());
189            if (value2 > _maxValue) {
190                value2 = _maxValue;
191                $(this).val(_maxValue + ' ' + _measure);
192            }
193            if (parseInt(value1) > parseInt(value2)) {
194                value2 = value1;
195                $(this).val(value2 + ' ' + _measure);
196            }
197            $(_self).find('.sslider').slider("values", 1, value2);
198            $("#filterform1").submit();
199        });
200
201        $(_self).find('.min').change(function () {
202            var value1 = parseInt($(this).val());
203            var value2 = parseInt($(_self).find('.max').val());
204            if (parseInt(value1) < 0) {
205                value1 = 0;
206            }
207            if (parseInt(value1) > parseInt(value2)) {
208                value1 = value2;
209            }
210            $(this).val(value1 + ' ' + _measure);
211            $(_self).find('.sslider').slider("values", 0, value1);
212            $("#filterform1").submit();
213        });
214
215        $(_self).find('.min, .max').val(function () {
216            return parseInt($(this).val()) + ' ' + _measure;
217        });
218    });
219}
220
221function initInfoDrop() {
222    $('.additional-variants .choose-btn, .additional-variants .ico, .prtnrslst').click(function (e) {
223        if ($(this).closest('.additional-variants').hasClass('opened')) {
224            $(this).closest('.additional-variants').removeClass('opened')
225        } else {
226            $(this).closest('.additional-variants').addClass('opened')
227            $('.scroll-frame').sly('reload');
228            initScrollVisible();
229        }
230        e.preventDefault();
231    });
232    $('.additional-variants .close-box').click(function (e) {
233        $(this).closest('.additional-variants').removeClass('opened')
234        e.preventDefault();
235    });
236    $('.additional-variants-box').mouseleave(function () {
237        $(this).closest('.additional-variants').removeClass('opened');
238    })
239}
240
241function initCheckItems() {
242    $('.filter .item').each(function () {
243        var _this = $(this),
244            _index1 = _this.index()
245        _this.find('.check-list li').each(function () {
246            var _index2 = $(this).index();
247            $(this).find('input:checkbox').addClass('check' + _index1 + _index2)
248        })
249        if ($(window).width() < 1100) {
250            if (_this.position().left < _this.closest('.ajax_filter').outerWidth() / 2) {
251                _this.removeClass('align-right');
252            } else {
253                _this.addClass('align-right');
254            }
255        } else {
256            $('filter .item').removeClass('align-right');
257        }
258        $(window).resize(function () {
259            if ($(window).width() < 1100) {
260                if (_this.position().left < _this.closest('.ajax_filter').outerWidth() / 2) {
261                    _this.removeClass('align-right');
262                } else {
263                    _this.addClass('align-right');
264                }
265            } else {
266                $('.filter .item').removeClass('align-right');
267            }
268        })
269    });
270
271    $(document).on("click", '.item .title', function () {
272        $('.item.active').css("top", "0");
273        var _this = $(this);
274        _this.parent().toggleClass('active').siblings().removeClass('active');
275        var dr = _this.parent();
276        var vh = $(document).scrollTop() + $(window).height();
277        var el = dr.find(".item-drop").offset();
278        //alert(el.top);
279        var dl = el.top + dr.find(".item-drop").height() - vh + 30;
280        if (el.top + dr.find(".item-drop").height() > vh)
281            dr.css("top", "-" + dl + "px");
282    });
283    $(document).click(function (event) {
284        if ($(event.target).closest('.item').length) return;
285        $('.item.active').css("top", "0");
286        $('.item').removeClass('active');
287        event.stopPropagation();
288    });
289    $('.checked-item-holder .checked-item').remove();
290    var checked_cnt = 0;
291    $('.ajax_filter .side-item').each(function () {
292        var _this = $(this);
293        _this.find('.check-list li').each(function () {
294            var _check_image = $(this).find('.check-color').attr('src'),
295                _check_text = $(this).find('.check-text').text()
296            _check_class = $(this).find('input').attr('class').replace('radio-no-js', '')
297            if ($(this).find('input:checkbox').is(':checked') || $(this).find('input:radio').is(':checked')) {
298                checked_cnt++;
299                if ($(this).find('.check-color').length) {
300                    $('.checked-item-holder').append('<span data-class="' + _check_class + '" class="checked-item"><em><img src="' + _check_image + '"></em><a href="#" class="remove"><svg class="svg-icon" width="10" height="10" ><use xlink:href="/images/icons.svg#icon_close"></use></svg></a></span>')
301                }
302                if ($(this).find('.check-text').length) {
303                    $('.checked-item-holder').append('<span data-class="' + _check_class + '" class="checked-item ' + _check_class + '"><strong>' + _check_text + '</strong><a href="#" class="remove"><svg class="svg-icon" width="10" height="10" ><use xlink:href="/images/icons.svg#icon_close"></use></svg></a></span>')
304                }
305            }
306        });
307        initFilterFix();
308    });
309    $(".clearfilter").remove();
310    $(".cheched-item-holder__label").remove();
311    if (checked_cnt > 0) {
312        $('.checked-item-holder').prepend('<span class="cheched-item-holder__label">Что ищем:</span>');
313
314        if (location.pathname.indexOf('myfav') < 0 && location.pathname.indexOf('myhistory') < 0) {
315            $('.checked-item-holder').append('<span class="block__share block__share--catalog"><a href="#" class="checked-item save-result block__share-link"><svg width="15" height="16" viewBox="0 0 15 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n' +
316                '<g clip-path="url(#clip0_9513_8007)">\n' +
317                '<path d="M12.5 10.5093C11.68 10.5093 10.96 10.9093 10.5 11.5193L4.9 8.64928C4.96 8.43928 5 8.22928 5 8.00928C5 7.79928 4.96 7.58928 4.91 7.38928L10.51 4.50928C10.97 5.10928 11.68 5.50928 12.5 5.50928C13.88 5.50928 15 4.38928 15 3.00928C15 1.62928 13.88 0.509277 12.5 0.509277C11.12 0.509277 10 1.62928 10 3.00928C10 3.21928 10.03 3.41928 10.08 3.60928L4.47 6.48928C4.02 5.89928 3.31 5.50928 2.5 5.50928C1.12 5.50928 0 6.62928 0 8.00928C0 9.38928 1.12 10.5093 2.5 10.5093C3.3 10.5093 4.01 10.1293 4.46 9.53928L10.07 12.4193C10.03 12.6093 10 12.7993 10 13.0093C10 14.3893 11.12 15.5093 12.5 15.5093C13.88 15.5093 15 14.3893 15 13.0093C15 11.6293 13.88 10.5093 12.5 10.5093ZM12.5 1.50928C13.33 1.50928 14 2.17928 14 3.00928C14 3.83928 13.33 4.50928 12.5 4.50928C11.67 4.50928 11 3.83928 11 3.00928C11 2.17928 11.67 1.50928 12.5 1.50928ZM2.5 9.50928C1.67 9.50928 1 8.83928 1 8.00928C1 7.17928 1.67 6.50928 2.5 6.50928C3.33 6.50928 4 7.17928 4 8.00928C4 8.83928 3.33 9.50928 2.5 9.50928ZM12.5 14.5093C11.67 14.5093 11 13.8393 11 13.0093C11 12.1793 11.67 11.5093 12.5 11.5093C13.33 11.5093 14 12.1793 14 13.0093C14 13.8393 13.33 14.5093 12.5 14.5093Z" fill="#92478E"/>\n' +
318                '</g>\n' +
319                '<defs>\n' +
320                '<clipPath id="clip0_9513_8007">\n' +
321                '<rect width="15" height="15" fill="white" transform="translate(0 0.509277)"/>\n' +
322                '</clipPath>\n' +
323                '</defs>\n' +
324                '</svg><span>Сохранить результат</span></a><div class="share__notification share__notification--catalog btn btn--sended btn--block">\n' +
325                '                                    <img class="share__notification__img" src="/images/link.svg"/>\n' +
326                '                                    <div class="share__notification__text">\n' +
327                '                                        <span>ссылка скопирована</span>\n' +
328                '                                       \n' +
329                '                                    </div>\n' +
330                '                                </div></span>');
331        }
332
333        $('.checked-item-holder').append('<a href="#" class="checked-item clearfilter"><svg class="svg-icon" width="10" height="10" ><use xlink:href="/images/icons.svg#icon_delete"></use></svg><span>Очистить фильтры</span></a>');
334    } else {
335        $(".clearfilter").remove();
336        $(".save-result").remove();
337        $(".cheched-item-holder__label").remove();
338    }
339    $('#filterform1 .check-list input').change(function (e) {
340
341        if ($(this).attr('name') == 'my_height' || $(this).attr('name') == 'my_width') {
342            if ($(this).val().length > 0) {
343                $('input[name=' + $(this).attr('name') + '_on]').attr('checked', 'checked');
344            } else {
345                $('input[name=' + $(this).attr('name') + '_on]').removeAttr('checked');
346            }
347        }
348
349        // if ($(this).attr('name') != 'my_height' && $(this).attr('name') != 'my_width') {
350            $("#filterform1").submit();
351            getcounts($(this).attr("sname"));
352        // }
353    });
354    $('.separate-list.color input').click(function (e) {
355        $("#filterform1").submit();
356        getcounts($(this).attr("sname"));
357    });
358    $('.item .show-checked').click(function (e) {
359        var _this = $(this);
360        $('.item.active').css("top", "0");
361        _this.closest('.item').removeClass('active');
362        $('.checked-item-holder .checked-item').remove();
363        var checked_cnt = 0;
364        $('.ajax_filter .side-item').each(function () {
365            var _this = $(this);
366            _this.find('.check-list li').each(function () {
367                var _check_image = $(this).find('.check-color').attr('src'),
368                    _check_text = $(this).find('.check-text').text()
369                _check_class = $(this).find('input').attr('class').replace('radio-no-js', '')
370                if ($(this).find('input:checkbox').is(':checked') || $(this).find('input:radio').is(':checked')) {
371                    checked_cnt++;
372                    if ($(this).find('.check-color').length) {
373                        $('.checked-item-holder').append('<span data-class="' + _check_class + '" class="checked-item"><em><img src="' + _check_image + '"></em><a href="#" class="remove"><svg class="svg-icon" width="10" height="10" ><use xlink:href="/images/icons.svg#icon_close"></use></svg></a></span>')
374                    }
375                    if ($(this).find('.check-text').length) {
376                        $('.checked-item-holder').append('<span data-class="' + _check_class + '" class="checked-item ' + _check_class + '"><strong>' + _check_text + '</strong><a href="#" class="remove"><svg class="svg-icon" width="10" height="10" ><use xlink:href="/images/icons.svg#icon_close"></use></svg></a></span>')
377                    }
378                }
379            });
380        });
381
382        $(".clearfilter").remove();
383        $(".cheched-item-holder__label").remove();
384        if (checked_cnt > 0) {
385            $('.checked-item-holder').prepend('<span class="cheched-item-holder__label">Что ищем:</span>');
386
387            if (location.pathname.indexOf('myfav') < 0 && location.pathname.indexOf('myhistory') < 0) {
388                $('.checked-item-holder').append('<span class="block__share block__share--catalog"><a href="#" class="checked-item save-result block__share-link"><svg width="15" height="16" viewBox="0 0 15 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n' +
389                    '<g clip-path="url(#clip0_9513_8007)">\n' +
390                    '<path d="M12.5 10.5093C11.68 10.5093 10.96 10.9093 10.5 11.5193L4.9 8.64928C4.96 8.43928 5 8.22928 5 8.00928C5 7.79928 4.96 7.58928 4.91 7.38928L10.51 4.50928C10.97 5.10928 11.68 5.50928 12.5 5.50928C13.88 5.50928 15 4.38928 15 3.00928C15 1.62928 13.88 0.509277 12.5 0.509277C11.12 0.509277 10 1.62928 10 3.00928C10 3.21928 10.03 3.41928 10.08 3.60928L4.47 6.48928C4.02 5.89928 3.31 5.50928 2.5 5.50928C1.12 5.50928 0 6.62928 0 8.00928C0 9.38928 1.12 10.5093 2.5 10.5093C3.3 10.5093 4.01 10.1293 4.46 9.53928L10.07 12.4193C10.03 12.6093 10 12.7993 10 13.0093C10 14.3893 11.12 15.5093 12.5 15.5093C13.88 15.5093 15 14.3893 15 13.0093C15 11.6293 13.88 10.5093 12.5 10.5093ZM12.5 1.50928C13.33 1.50928 14 2.17928 14 3.00928C14 3.83928 13.33 4.50928 12.5 4.50928C11.67 4.50928 11 3.83928 11 3.00928C11 2.17928 11.67 1.50928 12.5 1.50928ZM2.5 9.50928C1.67 9.50928 1 8.83928 1 8.00928C1 7.17928 1.67 6.50928 2.5 6.50928C3.33 6.50928 4 7.17928 4 8.00928C4 8.83928 3.33 9.50928 2.5 9.50928ZM12.5 14.5093C11.67 14.5093 11 13.8393 11 13.0093C11 12.1793 11.67 11.5093 12.5 11.5093C13.33 11.5093 14 12.1793 14 13.0093C14 13.8393 13.33 14.5093 12.5 14.5093Z" fill="#92478E"/>\n' +
391                    '</g>\n' +
392                    '<defs>\n' +
393                    '<clipPath id="clip0_9513_8007">\n' +
394                    '<rect width="15" height="15" fill="white" transform="translate(0 0.509277)"/>\n' +
395                    '</clipPath>\n' +
396                    '</defs>\n' +
397                    '</svg><span>Сохранить результат</span></a><div class="share__notification share__notification--catalog btn btn--sended btn--block">\n' +
398                    '                                    <img class="share__notification__img" src="/images/link.svg"/>\n' +
399                    '                                    <div class="share__notification__text">\n' +
400                    '                                        <span>ссылка скопирована</span>\n' +
401                    '                                        \n' +
402                    '                                    </div>\n' +
403                    '                                </div></span>');
404            }
405
406            $('.checked-item-holder').append('<a href="#" class="checked-item clearfilter"><svg class="svg-icon" width="10" height="10" ><use xlink:href="/images/icons.svg#icon_delete"></use></svg><span>Очистить фильтры</span></a>')
407        } else {
408            $(".clearfilter").remove();
409            $(".save-result").remove();
410            $(".cheched-item-holder__label").remove();
411        }
412
413        initFilterFix();
414        $("#filterform1").submit();
415        getcounts($(this).attr("sname"));
416        e.preventDefault();
417    });
418    $('.check-list input:checkbox, .check-list input:radio').on('change', function (e) {
419        var _this = $(this);
420        $('.item.active').css("top", "0");
421        _this.closest('.item').removeClass('active');
422        $('.checked-item-holder .checked-item').remove();
423        var checked_cnt = 0;
424        $('.ajax_filter .side-item').each(function () {
425            var _this = $(this);
426            _this.find('.check-list li').each(function () {
427                var _check_image = $(this).find('.check-color').attr('src'),
428                    _check_text = $(this).find('.check-text').text()
429                _check_class = $(this).find('input').attr('class').replace('radio-no-js', '')
430                if ($(this).find('input:checkbox').is(':checked') || $(this).find('input:radio').is(':checked')) {
431                    checked_cnt++;
432                    if ($(this).find('.check-color').length) {
433                        $('.checked-item-holder').append('<span data-class="' + _check_class + '" class="checked-item"><em><img src="' + _check_image + '"></em><a href="#" class="remove"><svg class="svg-icon" width="10" height="10" ><use xlink:href="/images/icons.svg#icon_close"></use></svg></a></span>')
434                    }
435                    if ($(this).find('.check-text').length) {
436                        $('.checked-item-holder').append('<span data-class="' + _check_class + '" class="checked-item ' + _check_class + '"><strong>' + _check_text + '</strong><a href="#" class="remove"><svg class="svg-icon" width="10" height="10" ><use xlink:href="/images/icons.svg#icon_close"></use></svg></a></span>')
437                    }
438                }
439            })
440        });
441
442        $(".clearfilter").remove();
443        $(".cheched-item-holder__label").remove();
444        if (checked_cnt > 0) {
445            $('.checked-item-holder').prepend('<span class="cheched-item-holder__label">Что ищем:</span>');
446
447            if (location.pathname.indexOf('myfav') < 0 && location.pathname.indexOf('myhistory') < 0) {
448                $('.checked-item-holder').append('<span class="block__share block__share--catalog"><a href="#" class="checked-item save-result block__share-link"><svg width="15" height="16" viewBox="0 0 15 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n' +
449                    '<g clip-path="url(#clip0_9513_8007)">\n' +
450                    '<path d="M12.5 10.5093C11.68 10.5093 10.96 10.9093 10.5 11.5193L4.9 8.64928C4.96 8.43928 5 8.22928 5 8.00928C5 7.79928 4.96 7.58928 4.91 7.38928L10.51 4.50928C10.97 5.10928 11.68 5.50928 12.5 5.50928C13.88 5.50928 15 4.38928 15 3.00928C15 1.62928 13.88 0.509277 12.5 0.509277C11.12 0.509277 10 1.62928 10 3.00928C10 3.21928 10.03 3.41928 10.08 3.60928L4.47 6.48928C4.02 5.89928 3.31 5.50928 2.5 5.50928C1.12 5.50928 0 6.62928 0 8.00928C0 9.38928 1.12 10.5093 2.5 10.5093C3.3 10.5093 4.01 10.1293 4.46 9.53928L10.07 12.4193C10.03 12.6093 10 12.7993 10 13.0093C10 14.3893 11.12 15.5093 12.5 15.5093C13.88 15.5093 15 14.3893 15 13.0093C15 11.6293 13.88 10.5093 12.5 10.5093ZM12.5 1.50928C13.33 1.50928 14 2.17928 14 3.00928C14 3.83928 13.33 4.50928 12.5 4.50928C11.67 4.50928 11 3.83928 11 3.00928C11 2.17928 11.67 1.50928 12.5 1.50928ZM2.5 9.50928C1.67 9.50928 1 8.83928 1 8.00928C1 7.17928 1.67 6.50928 2.5 6.50928C3.33 6.50928 4 7.17928 4 8.00928C4 8.83928 3.33 9.50928 2.5 9.50928ZM12.5 14.5093C11.67 14.5093 11 13.8393 11 13.0093C11 12.1793 11.67 11.5093 12.5 11.5093C13.33 11.5093 14 12.1793 14 13.0093C14 13.8393 13.33 14.5093 12.5 14.5093Z" fill="#92478E"/>\n' +
451                    '</g>\n' +
452                    '<defs>\n' +
453                    '<clipPath id="clip0_9513_8007">\n' +
454                    '<rect width="15" height="15" fill="white" transform="translate(0 0.509277)"/>\n' +
455                    '</clipPath>\n' +
456                    '</defs>\n' +
457                    '</svg><span>Сохранить результат</span></a><div class="share__notification share__notification--catalog btn btn--sended btn--block">\n' +
458                    '                                    <img class="share__notification__img" src="/images/link.svg"/>\n' +
459                    '                                    <div class="share__notification__text">\n' +
460                    '                                        <span>ссылка скопирована</span>\n' +
461                    '                                        \n' +
462                    '                                    </div>\n' +
463                    '                                </div></span>');
464            }
465
466            $('.checked-item-holder').append('<a href="#" class="checked-item clearfilter"><svg class="svg-icon" width="10" height="10" ><use xlink:href="/images/icons.svg#icon_delete"></use></svg><span>Очистить фильтры</span></a>')
467        } else {
468            $(".clearfilter").remove();
469            $(".save-result").remove();
470            $(".cheched-item-holder__label").remove();
471        }
472        initFilterFix();
473        e.preventDefault();
474    });
475    $('body').on('click', '.checked-item .remove', function (e) {
476        var _this = $(this),
477            _class = _this.parent().attr('data-class').trim().replace(/\s/g, '.');
478        _this.closest('.checked-item').remove();
479        $('.ajax_filter').find('input.' + _class + '').removeAttr('checked').prop('checked', '');
480        initFilterFix();
481        $("#filterform1").submit();
482        getcounts($(this).closest(".checked-item").attr("sname"));
483        e.preventDefault();
484    }).on("click", ".clearfilter, .clearfilter2, .clearfilter3", function () {
485        $('.checked-item .remove').each(function () {
486            var _this = $(this),
487                _class = _this.parent().attr('data-class').trim().replace(/\s/g, '.');
488            _this.closest('.checked-item').remove();
489            $('.ajax_filter').find('input.' + _class + '').removeAttr('checked').prop('checked', '');
490            initFilterFix();
491        });
492        if ($('.price-slider').length > 0) {
493            $('.price-slider').each(function () {
494                let sf = $(this).find('input[name=price_from]');
495                sf.val(sf.data('pr'));
496                let st = $(this).find('input[name=price_to]');
497                st.val(st.data('pr'));
498
499                $(this).find('.sslider').slider("values", 0, sf.data('pr'));
500                $(this).find('.sslider').slider("values", 1, st.data('pr'));
501            });
502        }
503        initFilterFix();
504        $("#filterform1").submit();
505        getcounts($(this).closest(".checked-item").attr("sname"));
506        $(".checked-item-holder").html("");
507        return false;
508    });
509}
510
511function initFilterFix() {
512    if ($('.filter-mobile-fix').is(':visible') && $('.product-list-container.catalog-list .filter-block').length) {
513        $('.product-list-container.catalog-list').css({
514            'padding-top': $('.product-list-container.catalog-list .filter-block').outerHeight()
515        })
516    } else {
517        $('.product-list-container.catalog-list').attr('style', '')
518    }
519}
520
521$(window).on('load', function () {
522    load_next_page_pics();
523});
524
525$(document).ready(function () {
526
527    var _hidden_height,
528        _opened_height;
529
530    initExpandedFilter();
531    initHiddenItems();
532    initInfoDrop();
533    initPriceSlider();
534    initCheckItems();
535    initFilterFix();
536
537    $(window).resize(function () {
538        initFilterFix();
539        initHiddenItems();
540        initExpandedFilter();
541    });
542
543    $(".showallpvzreg").click(function () {
544        $(".regional_pvzs .delivery-item-frame").slideToggle();
545    });
546
547    // delete maybe
548    $(document).on('change', '.sortby_select', function (event, ui) {
549        if ($(this).val().length > 0) {
550            location.href = $(this).val();
551        }
552    });
553
554    initPopularLabelsSlider();
555
556    if (typeof popular != 'undefined') {
557        $('.container.productlist:last').append(popular.removeClass('popular-labels_hide'));
558    }
559
560    var seoText = $(".main-text-columns__col.main-info-text");
561    var showHiddenTextBtn = $("#show-more-btn");
562    var btnText = showHiddenTextBtn.find(".btn__text");
563
564    function toggleSEOTextTruncated() {
565        seoText.outerHeight() > 474 ? seoText.addClass("truncated") : seoText.removeClass("truncated");
566    }
567
568    toggleSEOTextTruncated();
569
570    showHiddenTextBtn.on("click", function () {
571        if (seoText.hasClass("truncated")) {
572            // Раскрываем текст
573            seoText.removeClass("truncated");
574            btnText.text("свернуть текст");
575        } else {
576            // Сворачиваем текст
577            seoText.addClass("truncated");
578            btnText.text("показать еще");
579        }
580    });
581
582    var prev_interval = 0;
583
584    if (Modernizr.touchevents) {
585        console.log('touch supported')
586    } else {
587        $(document).on('mouseenter', '.product-list li', function () {
588            if ($(this).hasClass('track-block')) {
589                var id = $(this).attr('id').replace('prdct', '');
590                var self = this;
591                if (prev_interval > 0) {
592                    clearTimeout(prev_interval);
593                }
594                prev_interval = setTimeout(function () {
595                    var i = $(self).find('.visual > a > img');
596                    if (typeof i.data('src_hover') != "undefined") {
597                        if (i.data('src_hover').length > 0) {
598                            i.attr('src', i.data('src_hover'));
599                        }
600                    }
601                }, 250);
602            }
603        });
604
605        $(document).on('mouseleave', '.product-list li', function () {
606            if ($(this).hasClass('track-block')) {
607                clearTimeout(prev_interval);
608                var i = $(this).find('.visual > a > img');
609                if (typeof i.data('src_default') != "undefined") {
610                    if (i.data('src_default').length > 0) {
611                        i.attr('src', i.data('src_default'));
612                    }
613                }
614            }
615        });
616    }
617
618    $(document)
619        .on('click', '.catalog-show-more', function () {
620            if (typeof experiment_group != 'undefined') {
621                if (experiment_group == 1) {
622                    var u = $(this).attr('href');
623                    var self = this;
624
625                    $('.special-check-list li').removeClass('active');
626
627                    $(".product-list-holder").css("opacity", "0.3");
628                    $('.product-loader').css('display', 'block').show();
629
630                    $.get(u, "&ajax=y", function (result) {
631                        $("#listing_product_list").append(result);
632                        //$(self).parent().hide();
633                        $(".product-list-holder").css("opacity", "1");
634                        $(window).resize();
635                        initProductListHover();
636                        initLoadImage();
637
638                        pr = parseInt(pr) + 1;
639
640                        load_pagination(pr, pc, pu, ps, pn, fp);
641
642                        $('.product-list__v3 > li').matchHeight();
643
644                        $('.product-loader').hide();
645                    });
646
647                    setLoc(u);
648
649                    return false;
650                }
651            }
652        })
653        .on('click', '.zoom-button', function () {
654            var item = this;
655            $.fancybox.open({
656                // 'src': '/res/api/product.php?id=' + $(item).closest('.track-block').data('id'),
657                'src': $(item).attr('href'),
658                'type': 'ajax',
659                'touch': false,
660                'showCloseButton': false,
661                'closeBtn': false,
662                "baseClass": "zoom-preview",
663                'afterClose': function () {
664                    setLoc(window.listingUrl);
665                }
666            });
667
668            if (typeof listingUrl == 'undefined') {
669                window.listingUrl = location.href;
670            }
671
672            setLoc($(item).attr('href'));
673
674            return false;
675        })
676    ;
677
678    $('.prod_slide_wrap .psv_close').click(function () {
679        $('.product_views').removeClass('active');
680    });
681
682    $('.service-info .now-view .close').on('click', function () {
683        $(this).closest('.service-info .now-view').fadeOut();
684        return false;
685    });
686
687    $('.side-item .check-list').each(function () {
688        var t = $(this);
689
690        if (t[0].scrollHeight > t[0].clientHeight) {
691            t.addClass('-border');
692        }
693    });
694
695    function fixingSortBar() {
696        if ($('.sorting-panel').length > 0) {
697            var panel = $('.sorting-panel');
698
699            var targetOffset = panel.offset().top;
700
701            var scroll = $('html,body').scrollTop();
702
703            if (targetOffset === (scroll + 50)) {
704                panel.addClass('-shadow');
705            } else {
706                panel.removeClass('-shadow');
707            }
708        }
709    }
710
711    fixingSortBar();
712
713    var position = $(window).scrollTop();
714
715    $(document).on('scroll', function (e) {
716        var scroll = $(window).scrollTop();
717
718        if (scroll > position) {
719            $('.sorting-panel').addClass('-no-stiky');
720        } else {
721            $('.sorting-panel').removeClass('-no-stiky');
722        }
723
724        fixingSortBar();
725
726        position = scroll;
727    });
728
729    $('.filter-mobile-actions-drop-trigger').click(function () {
730        $(this).toggleClass('-active');
731    });
732
733
734    if (typeof load_pagination_i !== "undefined") {
735        if (load_pagination_i == 1) {
736            fp = $(".product-list-holder ul.product-list li:first").prop("id");
737            load_pagination(pr, pc, pu, ps, pn, fp);
738        }
739    }
740    if (typeof pagetype !== "undefined") {
741        if (pagetype == 'catalog') {
742            getcounts();
743        }
744        if (pagetype == 'salecatalog') {
745            getcounts();
746        }
747    }
748
749    $("form.ajax_filter").submit(function () {
750        var f = $(this);
751        var q = $(this).serialize();
752        $(".product-list-holder").css("opacity", "0.3");
753
754        $.get($(this).attr("action"), q + "&ajax=y", function (result) {
755            $(".product-list-holder").html(result);
756            $(".product-list-holder").css("opacity", "1");
757            $(window).resize();
758            // initLoadImage();
759            load_pagination(pr, pc, pu, ps, pn, fp);
760            $('.product-list__v3 > li').matchHeight({
761                byRow: false,
762            });
763            if ($('.page-title__category-items').length == 1 && typeof products_total != 'undefined') {
764                $('.page-title__category-items').text(parseInt(products_total) + ' Товаров');
765            }
766            $('.lazy').Lazy();
767            lazyload();
768            customSelectDropdown();
769            ratingInit();
770            mobileFilterOpener();
771            $('#product-list').removeClass("skeleton_is_loading");
772            $('#listing_product_list').removeAttr("style");
773            
774            $('.product-list-item').addClass('-use');
775        });
776        var u = window.location.pathname;
777        u = u.replace(/\/([0-9]{1,5})\//, '/');
778        setLoc(u + "?" + q);
779        return false;
780    });
781
782    $("form.ajax_filter .mobile-control-panel button").click(function () {
783        $('body').removeClass('mobile-filter-open');
784    });
785
786
787    $('.colors-filter__arrow').on('click', function () {
788        const parent = $(this).parents('.colors-filter__item');
789        $(parent).toggleClass('colors-filter__expand');
790    })
791
792    $('.colors-filter__item .colors-filter__wrapper label').on('click', function () {
793        const parent = $(this).parents('.colors-filter__item');
794        const input = $(this).find('input');
795        const statusCheck = $(input).prop('checked');
796
797        /*
798        $(parent).next().find('li').each( (index, item) => {
799            $(item).find('input').each( (index, input) => {
800                $(input).prop('checked', statusCheck);
801            })
802        })
803        */
804    })
805
806    $('.color-filter__sub li label').on('click', function () {
807        const parent = $(this).parents('.color-filter__sub');
808
809        let status = false;
810
811        $(parent).find('li input').each((index, input) => {
812            if ($(input).prop('checked')) {
813                status = true;
814            }
815        })
816
817        // const mainInput = $(parent).prev().find('input');
818        // $(mainInput).prop('checked', status);
819    });
820
821    let productSlider = document.querySelectorAll('.product-list-item__swiper')
822    let pagination = document.querySelectorAll('.swiper-pagination')
823    let visualPaginationBullets = document.querySelectorAll('.swiper-pagination-visual')
824
825    productSlider.forEach((slider, index) => {
826        const swiper = new Swiper(slider, {
827            centeredSlides: true,
828            spaceBetween: 30,
829            pagination: {
830                el: pagination[index],
831                clickable: true,
832            },
833            on: {
834                init: function () {
835                    setTimeout(function () {
836                        $(swiper.$el).find('.swiper-pagination-bullet').hover(function () {
837                            swiper.slideTo($(this).index());
838                        });
839                    }, 500);
840                },
841            },
842        });
843        const visualPagination = new Swiper(slider, {
844            pagination: {
845                el: visualPaginationBullets[index],
846                clickable: false,
847            },
848        });
849
850        swiper.controller.control = visualPagination;
851    });
852
853    $(document)
854        .on('click', '#all-question-open', function () {
855            $('.question-list .item-toogled').toggleClass('hidden');
856            $(this).hide();
857            $('#all-question-wrapper').show();
858        })
859        .on('click', '#all-question-collapse', function () {
860            $('.question-list .item-toogled').toggleClass('hidden');
861            $('#all-question-wrapper').hide();
862            $('#all-question-open').show();
863        })
864    ;
865});
866
867function initPopularLabelsSlider() {
868    var popular = $('.popular-labels_hide');
869
870    $('.container.productlist:last').append(popular.removeClass('popular-labels_hide'));
871
872    if ($('.popular-labels__list li').length > 2) {
873        $('.popular-labels__list').each(function () {
874            $(this).slick({
875                // infinite: true,
876                infinite: false,
877                slidesToShow: 1,
878                variableWidth: true,
879                arrows: !$(this).hasClass('no-arrows'),
880                prevArrow: '<button type="button" class="slick-prev slick-arrow btn btn--icon-only btn--outline btn--sm" role="button"><span class="btn__icon"><svg width="10" height="10"><use xlink:href="/images/icons.svg#icon_left"></use></svg></span></button>',
881                nextArrow: '<button type="button" class="slick-next slick-arrow btn btn--icon-only btn--outline btn--sm" role="button"><span class="btn__icon"><svg width="10" height="10"><use xlink:href="/images/icons.svg#icon_right"></use></svg></span></button>',
882            })
883        });
884    }
885}
886
887

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.