PageSourceSearch

https://podshipnikru.com/bitrix/cache/js/s1/redesign-podshipnik/pa…91c7714ffdba3c3f1d87a_v1.js?178790110924070

js podshipnikru.com collected 2026-10-02 17:49:03 UTC 24,070 bytes, 624 lines download raw bytes

1
2; /* Start:"a:4:{s:4:"full";s:84:"/local/templates/redesign-podshipnik/js/classes/FilterPropsElement.js?17847030242239";s:6:"source";s:69:"/local/templates/redesign-podshipnik/js/classes/FilterPropsElement.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3class FilterPropsElement{
4
5
6    constructor() {
7
8        this.filterBtn = main.content.querySelectorAll('[data-event=filter-card]');
9
10        this.init();
11    }
12
13    init(){
14        if(!this.filterBtn) return;
15        this.HandlerUrl = '/local/action/filterElement.php';
16
17        this.eventFilterBtn.eventClickBtn();
18    }
19
20    eventFilterBtn = {
21        eventClickBtn: () => {
22            this.filterBtn.forEach((e) => {
23
24                this.eventFilterBtn.checkActiveBtn(e);
25
26                e.addEventListener('click', (d) => {
27                    if(d.target == this.ilterBtnActive) return;
28
29                 this.request(this.eventFilterBtn.formData(e), this.HandlerUrl);
30
31                    this.eventFilterBtn.toggleClassBtn(d.target);
32                });
33            });
34
35        },
36        /** получаем активную кнопку */
37        checkActiveBtn:(e)=>{
38
39            if(e.classList.contains('active')){
40                this.ilterBtnActive = e;
41            }
42        },
43
44        formData(e){
45            let data = {
46                'action' : 'filter-card',
47                'prop-id' : e.dataset.id
48            }
49            return data;
50        },
51        toggleClassBtn:(e)=>{
52            this.ilterBtnActive.classList.toggle('active');
53            e.classList.toggle('active');
54            this.eventFilterBtn.checkActiveBtn(e);
55        }
56    }
57
58    request(requestData, url) {
59        fetch(url, {
60            method: 'POST',
61            headers: {
62                "Content-Type": 'multipart/form-data'
63            },
64            body: JSON.stringify(requestData)
65        }).then((res) => {
66            return res.json();
67        }).then((res) => {
68            if (!!res.status) {
69                let block = main.content.querySelector('.catalog-wrapper');
70                block.innerHTML = '';
71                block.appendChild(main.parseTextToHTML(res.html, '.catalog-wrapper')[1]);
72                // window.JCCatalogItem.prototype.init();
73                catalog.basket.getAllBtns();
74            }
75
76        }).catch((err) => {
77            console.log(err);
78        });
79    }
80}
81
82let filterProps = new FilterPropsElement();
83/* End */
84;
85; /* Start:"a:4:{s:4:"full";s:73:"/local/templates/redesign-podshipnik/js/classes/Review.js?178775063212345";s:6:"source";s:57:"/local/templates/redesign-podshipnik/js/classes/Review.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
86// Проверяем, существует ли уже объект
87if (typeof sliderMainEventReview === 'undefined' || sliderMainEventReview === null) {
88    var sliderMainEventReview = {
89        instance: null, // Храним экземпляр Swiper
90        currentFilter: 'all', // Текущий фильтр
91
92
93    // Инициализация слайдера
94    initSwiper: () => {
95        const element = document.querySelector('.section--news-list-wrapper.swiper');
96
97            if (!element || !(element instanceof Element)) {
98                console.warn('Элемент слайдера не найден');
99                return false;
100            }
101
102            // Уничтожаем предыдущий экземпляр если есть
103            if (this.instance) {
104                this.instance.destroy(true, true);
105            }
106
107            try {
108                this.instance = new Swiper(element, {
109                    speed: 400,
110                    slidesPerView: 1,
111                    breakpoints: {
112                        320:{
113                            spaceBetween: 20,
114                        },
115                        640: {
116                            slidesPerView: 2,
117                        },
118                        1024: {
119                            slidesPerView: 3,
120                        }
121                    },
122                    pagination: {
123                        el: element.querySelector('.swiper-pagination'),
124                        type: 'bullets',
125                        clickable: true,
126                    },
127                    on: {
128                        init: function() {
129                            console.log('Слайдер инициализирован');
130                        }
131                    }
132                });
133                return true;
134            } catch (error) {
135                console.error('Ошибка инициализации Swiper:', error);
136                return false;
137            }
138        },
139
140        // Обновление слайдера после замены контента
141        refreshSwiper: function() {
142            // Небольшая задержка для гарантии обновления DOM
143            setTimeout(() => {
144                if (this.instance) {
145                    this.instance.update();
146                    console.log('Слайдер обновлен');
147                } else {
148                    this.initSwiper();
149                }
150            }, 100);
151        },
152
153        // Загрузка отзывов по фильтру
154        loadReviews: function(eventType) {
155            const self = this;
156
157            // Показываем индикатор загрузки
158            const wrapper = document.querySelector('.review-list-wrapper');
159            if (wrapper) {
160                wrapper.style.opacity = '0.5';
161            }
162
163            // AJAX запрос
164            fetch(window.location.href, {
165                method: 'POST',
166                headers: {
167                    'Content-Type': 'application/x-www-form-urlencoded',
168                    'X-Requested-With': 'XMLHttpRequest'
169                },
170                body: new URLSearchParams({
171                    'ajax': 'Y',
172                    'filterReview': eventType,
173                    'sessid': typeof BX !== 'undefined' ? BX.bitrix_sessid() : ''
174                })
175            })
176                .then(response => response.text())
177                .then(html => {
178                    // Создаем временный контейнер для парсинга HTML
179                    const temp = document.createElement('div');
180                    temp.innerHTML = html;
181
182                    // Находим новый список отзывов
183                    const newWrapper = temp.querySelector('.review-list-wrapper');
184                    const newPagination = temp.querySelector('.section--review-list .swiper-pagination');
185
186                    if (newWrapper && wrapper) {
187                        // Заменяем содержимое
188                        wrapper.innerHTML = newWrapper.innerHTML;
189
190                        // Обновляем пагинацию если нужно
191                        if (newPagination) {
192                            const oldPagination = document.querySelector('.section--review-list .swiper-pagination');
193                            if (oldPagination) {
194                                oldPagination.innerHTML = newPagination.innerHTML;
195                            }
196                        }
197
198                        // Восстанавливаем видимость
199                        wrapper.style.opacity = '1';
200
201                        // Обновляем слайдер
202                        self.refreshSwiper();
203
204                        // Обновляем активный класс кнопок
205                        self.updateActiveButton(eventType);
206
207                        // Инициализируем кнопки "Читать полностью"
208                        self.initReadMoreButtons();
209
210                        // Проверяем строки после загрузки
211                        self.checkLinesAndHideButton();
212                    }
213                })
214                .catch(error => {
215                    console.error('Ошибка загрузки отзывов:', error);
216                    if (wrapper) {
217                        wrapper.style.opacity = '1';
218                    }
219                });
220        },
221
222        // Обновление активной кнопки
223        updateActiveButton: function(eventType) {
224            document.querySelectorAll('.btn-service').forEach(btn => {
225                if (btn.dataset.event === eventType) {
226                    btn.classList.add('active');
227                } else {
228                    btn.classList.remove('active');
229                }
230            });
231        },
232
233        // Инициализация кнопок "Читать полностью"
234        initReadMoreButtons: function() {
235            const self = this;
236            document.querySelectorAll('.review-text-btn').forEach(btn => {
237                // Удаляем старые обработчики
238                btn.removeEventListener('click', self.toggleText);
239                // Добавляем новые
240                btn.addEventListener('click', self.toggleText.bind(self));
241            });
242        },
243
244        // Переключение текста "Читать полностью/Свернуть"
245        toggleText: function(e) {
246            const btn = e.currentTarget;
247            const textBlock = btn.previousElementSibling;
248
249            if (textBlock.classList.contains('expanded')) {
250                textBlock.classList.remove('expanded');
251                btn.textContent = btn.dataset.start || 'Читать полностью';
252            } else {
253                textBlock.classList.add('expanded');
254                btn.textContent = btn.dataset.end || 'Свернуть';
255            }
256        },
257
258        // Навешивание обработчиков на кнопки фильтрации
259        initFilters: function() {
260            const self = this;
261            document.querySelectorAll('.btn-service').forEach(btn => {
262                // Удаляем старые обработчики, чтобы избежать дублирования
263                const oldHandler = btn._filterHandler;
264                if (oldHandler) {
265                    btn.removeEventListener('click', oldHandler);
266                }
267
268                // Создаем обработчик и сохраняем его для возможности удаления
269                const handler = function(e) {
270                    e.preventDefault();
271                    const eventType = btn.dataset.event;
272
273                    // Не делаем запрос если тот же фильтр
274                    if (eventType === self.currentFilter) {
275                        return;
276                    }
277
278                    self.currentFilter = eventType;
279                    self.loadReviews(eventType);
280                };
281
282                btn._filterHandler = handler;
283                btn.addEventListener('click', handler);
284            });
285        },
286
287        // Функция для проверки количества строк
288        checkLinesAndHideButton: function() {
289            const reviews = document.querySelectorAll('.review-item');
290
291            reviews.forEach(review => {
292                const textElement = review.querySelector('.review-text');
293                const buttonElement = review.querySelector('.review-text-btn');
294
295                if (textElement && buttonElement) {
296                    // Сбрасываем стили для точного измерения
297                    const originalMaxHeight = textElement.style.maxHeight;
298                    const originalOverflow = textElement.style.overflow;
299
300                    // Временно убираем ограничения для измерения
301                    textElement.style.maxHeight = 'none';
302                    textElement.style.overflow = 'visible';
303
304                    // Получаем высоту одной строки
305                    const lineHeight = parseInt(window.getComputedStyle(textElement).lineHeight);
306                    const textHeight = textElement.scrollHeight;
307
308                    // Вычисляем количество строк
309                    const linesCount = Math.round(textHeight / lineHeight);
310
311                    // Если строк меньше 4 - скрываем кнопку
312                    if (linesCount < 4) {
313                        buttonElement.style.display = 'none';
314                    } else {
315                        buttonElement.style.display = 'block';
316                    }
317
318                    // Восстанавливаем стили
319                    textElement.style.maxHeight = originalMaxHeight;
320                    textElement.style.overflow = originalOverflow;
321                }
322            });
323        },
324
325        // Дебаунс функция
326        debounce: function(func, wait) {
327            let timeout;
328            return function executedFunction(...args) {
329                const later = () => {
330                    clearTimeout(timeout);
331                    func(...args);
332                };
333                clearTimeout(timeout);
334                timeout = setTimeout(later, wait);
335            };
336        },
337
338        // Главная функция запуска
339        startSlider: function() {
340            const self = this;
341
342            // Ждем загрузку DOM
343            if (document.readyState === 'loading') {
344                document.addEventListener('DOMContentLoaded', function() {
345                    self.initSwiper();
346                    self.initFilters();
347                    self.initReadMoreButtons();
348                    self.checkLinesAndHideButton();
349                });
350            } else {
351                self.initSwiper();
352                self.initFilters();
353                self.initReadMoreButtons();
354                self.checkLinesAndHideButton();
355            }
356        }
357    };
358}
359
360// Запускаем, если объект был создан
361if (typeof sliderMainEventReview !== 'undefined' && sliderMainEventReview.startSlider) {
362    sliderMainEventReview.startSlider();
363}
364
365// Добавляем обработчик resize с debounce
366if (typeof sliderMainEventReview !== 'undefined') {
367    window.addEventListener('resize', sliderMainEventReview.debounce(function() {
368        if (sliderMainEventReview.checkLinesAndHideButton) {
369            sliderMainEventReview.checkLinesAndHideButton();
370        }
371        if (sliderMainEventReview.instance) {
372            sliderMainEventReview.instance.update();
373        }
374    }, 250));
375}
376/* End */
377;
378; /* Start:"a:4:{s:4:"full";s:101:"/local/templates/redesign-podshipnik/components/bitrix/news.list/banner-main/script.
378js?17847030242514";s:6:"source";s:86:"/local/templates/redesign-podshipnik/components/bitrix/news.list/banner-main/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
379sliderMainEventReview = {
380    instance: null, // Храним экземпляр Swiper
381    currentFilter: 'all', // Текущий фильтр
382
383    // Инициализация слайдера
384    initSwiper: () => {
385        const element = document.querySelector('.banner-main-wrapper-swiper');
386
387        if (!element || !(element instanceof Element)) {
388            console.warn('Элемент слайдера не найден');
389            return false;
390        }
391
392        // Уничтожаем предыдущий экземпляр если есть
393        if (sliderMainEventReview.instance) {
394            sliderMainEventReview.instance.destroy(true, true);
395        }
396
397        try {
398            sliderMainEventReview.instance = new Swiper(element, {
399                speed: 400,
400                slidesPerView: 1,
401                loop: true,
402                autoplay: {
403                    delay: 5000,        // задержка между слайдами в миллисекундах (3 секунды)
404                    disableOnInteraction: false,  // продолжать автопрокрутку после взаимодействия пользователя
405                    pauseOnMouseEnter: true,      // ставить на паузу при наведении мыши
406                    stopOnLastSlide: false,       // не останавливаться на последнем слайде
407                },
408                pagination: {
409                    el: '.swiper-pagination-banner',
410                    type: 'bullets',
411                    clickable: true,
412                },
413                on: {
414                    init: function() {
415                        console.log('Слайдер инициализирован');
416                    }
417                }
418            });
419            return true;
420        } catch (error) {
421            console.error('Ошибка инициализации Swiper:', error);
422            return false;
423        }
424    },
425
426    // Главная функция запуска
427    startSlider: () => {
428        // Ждем загрузку DOM
429        if (document.readyState === 'loading') {
430            document.addEventListener('DOMContentLoaded', () => {
431                sliderMainEventReview.initSwiper();
432            });
433        } else {
434            sliderMainEventReview.initSwiper();
435        }
436    }
437}
438
439// Запускаем
440sliderMainEventReview.startSlider();
441/* End */
442;
443; /* Start:"a:4:{s:4:"full";s:91:"/local/components/imedia/mainfilters.custom/templates/redesign/script.min.js?17847030231009";s:6:"source";s:72:"/local/components/imedia/mainfilters.custom/templates/redesign/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
444compJsData = function (b) {
445    this.params = b;
446    let form_id = "#smart_form_" + this.params.ID;
447    $(document).on("submit", form_id, function (a) {
448        a.preventDefault();
449        let data = new FormData($(this)[0]);
450        BX.ajax.runComponentAction("imedia:mainfilters.custom", "getSmartFilterUrl", {
451            mode: "class",
452            data: data
453        }).then(function (d) {
454            let katalog_url = $(form_id).data("href");
455            location.href = katalog_url + d.data
456        })
457    });
458    $(document).on("keyup change", form_id + " input", function () {
459        if ($(this).val() !== "") {
460            $(form_id + " input[name='set_filter']").prop("disabled", false)
461        } else {
462            $(form_id + " input[name='set_filter']").prop("disabled", true)
463        }
464    });
465    $(document).on("click", "#clear_main_form", function () {
466        $(form_id)[0].reset();
467        $(form_id + " input[name='set_filter']").prop("disabled", true)
468    })
469};
470/* End */
471;
472; /* Start:"a:4:{s:4:"full";s:110:"/local/templates/redesign-podshipnik/components/bitrix/news.list/clients-trust-slider/script.js?17879010972182";s:6:"source";s:95:"/local/templates/redesign-podshipnik/components/bitrix/news.list/clients-trust-slider/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
473(function () {
474    function initClientsTrustSlider() {
475        var root = document.querySelector('.clients-trust-slider');
476        if (!root || root.swiper) {
477            return;
478        }
479        if (typeof Swiper === 'undefined') {
480            setTimeout(initClientsTrustSlider, 50);
481            return;
482        }
483
484        var outer = root.closest('.clients-trust-slider-outer') || root.parentNode;
485        var paginationEl = outer.querySelector('.clients-trust-pagination');
486        var slidesCount = root.querySelectorAll('.swiper-slide').length;
487        var swiper = new Swiper(root, {
488            slidesPerView: 6,
489            spaceBetween: 40,
490            speed: 600,
491            loop: slidesCount >= 8,
492            watchOverflow: true,
493            autoplay: {
494                delay: 4000,
495                disableOnInteraction: false,
496                pauseOnMouseEnter: true
497            },
498            pagination: {
499                el: paginationEl,
500                type: 'bullets',
501                clickable: true,
502                dynamicBullets: false
503            },
504            navigation: {
505                nextEl: root.querySelector('.clients-trust-nav__btn--next'),
506                prevEl: root.querySelector('.clients-trust-nav__btn--prev')
507            },
508            breakpoints: {
509                0: {
510                    slidesPerView: 2,
511                    spaceBetween: 10
512                },
513                640: {
514                    slidesPerView: 3,
515                    spaceBetween: 10
516                },
517                1024: {
518                    slidesPerView: 6,
519                    spaceBetween: 40
520                }
521            }
522        });
523
524        root.addEventListener('mouseenter', function () {
525            if (swiper.autoplay) {
526                swiper.autoplay.stop();
527            }
528        });
529        root.addEventListener('mouseleave', function () {
530            if (swiper.autoplay) {
531                swiper.autoplay.start();
532            }
533        });
534    }
535
536    if (document.readyState === 'loading') {
537        document.addEventListener('DOMContentLoaded', initClientsTrustSlider);
538    } else {
539        initClientsTrustSlider();
540    }
541})();
542
543/* End */
544;
545; /* Start:"a:4:{s:4:"full";s:85:"/bitrix/components/bitrix/map.yandex.view/templates/.default/script.js?17204261751540";s:6:"source";s:70:"/bitrix/components/bitrix/map.yandex.view/templates/.default/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
546if (!window.BX_YMapAddPlacemark)
547{
548	window.BX_YMapAddPlacemark = function(map, arPlacemark)
549	{
550		if (null == map)
551			return false;
552
553		if(!arPlacemark.LAT || !arPlacemark.LON)
554			return false;
555
556		var props = {};
557		if (null != arPlacemark.TEXT && arPlacemark.TEXT.length > 0)
558		{
559			var value_view = '';
560
561			if (arPlacemark.TEXT.length > 0)
562			{
563				var rnpos = arPlacemark.TEXT.indexOf("\n");
564				value_view = rnpos <= 0 ? arPlacemark.TEXT : arPlacemark.TEXT.substring(0, rnpos);
565			}
566
567			props.balloonContent = arPlacemark.TEXT.replace(/\n/g, '<br />');
568			props.hintContent = value_view;
569		}
570
571		var obPlacemark = new ymaps.Placemark(
572			[arPlacemark.LAT, arPlacemark.LON],
573			props,
574			{balloonCloseButton: true}
575		);
576
577		map.geoObjects.add(obPlacemark);
578
579		return obPlacemark;
580	}
581}
582
583if (!window.BX_YMapAddPolyline)
584{
585	window.BX_YMapAddPolyline = function(map, arPolyline)
586	{
587		if (null == map)
588			return false;
589
590		if (null != arPolyline.POINTS && arPolyline.POINTS.length > 1)
591		{
592			var arPoints = [];
593			for (var i = 0, len = arPolyline.POINTS.length; i < len; i++)
594			{
595				arPoints.push([arPolyline.POINTS[i].LAT, arPolyline.POINTS[i].LON]);
596			}
597		}
598		else
599		{
600			return false;
601		}
602
603		var obParams = {clickable: true};
604		if (null != arPolyline.STYLE)
605		{
606			obParams.strokeColor = arPolyline.STYLE.strokeColor;
607			obParams.strokeWidth = arPolyline.STYLE.strokeWidth;
608		}
609		var obPolyline = new ymaps.Polyline(
610			arPoints, {balloonContent: arPolyline.TITLE}, obParams
611		);
612
613		map.geoObjects.add(obPolyline);
614
615		return obPolyline;
616	}
617}
618/* End */
619;; /* /local/templates/redesign-podshipnik/js/classes/FilterPropsElement.js?17847030242239*/
620; /* /local/templates/redesign-podshipnik/js/classes/Review.js?178775063212345*/
621; /* /local/templates/redesign-podshipnik/components/bitrix/news.list/banner-main/script.
621js?17847030242514*/
622; /* /local/components/imedia/mainfilters.custom/templates/redesign/script.min.js?17847030231009*/
623; /* /local/templates/redesign-podshipnik/components/bitrix/news.list/clients-trust-slider/script.js?17879010972182*/
624; /* /bitrix/components/bitrix/map.yandex.view/templates/.default/script.js?17204261751540*/

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.