PageSourceSearch

https://dept.one/wp-content/themes/team29/assets/js/custom.js?ver=1712087874

js dept.one collected 2026-10-01 08:30:42 UTC 10,408 bytes, 323 lines download raw bytes

1jQuery(document).ready(function ($) {
2    function calculateWidth(el) {
3        let getWidth = function () {
4            let w1 = $('body').innerWidth();
5            let w2 = document.body.scrollWidth;
6
7            return w1 > 1100 ? w1 : w2;
8        };
9
10        $(el).width(getWidth());
11
12        $(window).resize(function () {
13            $(el).width(getWidth());
14        });
15    }
16
17    let $overlay = $('.popup__overlay');
18    let $overlayWithClose = $('.popup__close').add($overlay);
19
20    $overlayWithClose.click(function () {
21        $('.popup__overlay').hide();
22    })
23
24    function showPopupWithOverlay(el) {
25        return $(el).add($overlay).show();
26    }
27
28    $('.popup__show').click(function () {
29        let $el = $($(this).attr("rel"));
30        let elClass = $el.data('id');
31
32        $('.popup__content').html($el.html());
33        showPopupWithOverlay('.popup__main');
34
35        elClass && $('.popup__main').attr('id', elClass);
36    })
37
38    $overlayWithClose.click(function () {
39        $('.popup__content').html('');
40        $('.popup__main').hide().removeAttr('id');
41    })
42
43    $('.memo-full__classic-content').each(function () {
44        let $container = $(this);
45        let $block = $container.find('.memo-full__classic-content-inner');
46        let $btn = $container.find('.memo-full__classic-content-toggle');
47
48        $btn.click(function () {
49            $btn.toggleClass('--show');
50
51            let btnOldText = $btn.text();
52            let btnNewText = $btn.data('text');
53            $btn.text(btnNewText);
54            $btn.data('text', btnOldText);
55
56            $('html, body').animate({scrollTop: $container.offset().top - 200}, 200);
57            $block.slideToggle(200);
58        });
59    });
60
61    $('.memo-full__faq-questions').each(function () {
62        $(this).sticksy({topSpacing: 100});
63    });
64
65    // Подгрузка дополнительных Памяток в архиве.
66    let setAjaxNavigationArhive = function (classListItems, classItem) {
67        let $preloader = $('.preloader').clone().prop('hidden', false);
68        let $preloaderWrap = $('.archive__preloader');
69        let $classListItems = $(classListItems);
70
71        classListItems.length && $('.archive__content').on('click', '.archive-btn__more', function (e) {
72            e.preventDefault();
73
74            let $link = $(this);
75            $preloaderWrap.html($preloader);
76
77            $.get($link.attr('href'), function (html) {
78                let $newLink = $(html).find('.archive-btn__more');
79                $link.replaceWith($newLink);
80
81                let $newMemos = $(html).find(classItem);
82                $classListItems.append($newMemos);
83				
84				const nextState = { additionalInformation: 'Updated the URL with JS' };
85                window.history.pushState(nextState, "", $link.attr('href'));
86				document.title = $(html).filter('title').text();
87
88                $preloaderWrap.html('');
89            });
90        });
91    }
92
93    setAjaxNavigationArhive('.archive-memo__list', '.memo-short');
94    setAjaxNavigationArhive('.archive-figurant__list', '.figurant-short');
95
96    let figurantFullContentToggle = function (container, block, btn) {
97        $(container).each(function () {
98            let $container = $(this);
99            let $block = $container.find(container + '-' + block);
100            let $btn = $container.find(container + '-' + btn);
101
102            $btn.click(function () {
103                $btn.toggleClass('--hide');
104
105                let btnOldText = $btn.text();
106                let btnNewText = $btn.data('text');
107                $btn.text(btnNewText);
108                $btn.data('text', btnOldText);
109
110                $('html, body').animate({scrollTop: $container.offset().top - 200}, 200);
111                $block.slideToggle(200);
112            });
113        });
114    }
115
116    figurantFullContentToggle('.figurant-full__content_before', 'main', 'toggle');
117    figurantFullContentToggle('.figurant-full__content_after', 'main', 'toggle');
118
119    $('.figurant-full__timeline').each(function () {
120        let $wrap = $(this);
121
122        calculateWidth($wrap);
123
124        let $timelineShort = $wrap.find('.figurant-full__timeline-short').slick({
125            asNavFor: '.figurant-full__timeline-full',
126            infinite: true,
127            adaptiveHeight: true,
128            slidesToShow: 3,
129            slidesToScroll: 1,
130            arrows: false,
131            centerMode: true,
132        });
133
134        $wrap.find('.figurant-full__timeline-full').slick({
135            asNavFor: '.figurant-full__timeline-short',
136            infinite: true,
137        });
138
139        $timelineShort.on('click', '.slick-slide', function (e) {
140            $timelineShort.slick('slickGoTo', $(this).attr('data-slick-index'));
141        });
142
143        if($(".figurant-full__timeline-short").slick("getSlick").slideCount < 5) {
144          $('.figurant-full__timeline-short').slick('slickSetOption', {
145            infinite: false,
146          }, true);
147          $('.figurant-full__timeline-full').slick('slickSetOption', {
148            infinite: false,
149          }, true);
150        }
151    });
152
153    $('.figurant-full__news-slider').each(function () {
154        $(this).slick({
155            infinite: true,
156            adaptiveHeight: true,
157            slidesToShow: 3,
158            slidesToScroll: 1,
159            arrows: false,
160            centerMode: true,
161        });
162    });
163
164    $('.home-main-slider__items').each(function () {
165        calculateWidth('.home-main-slider');
166
167        var $imageSlider;
168        var sliderTimer = 5000;
169        var $bar = $('.home-main-slider__statusbar');
170
171        $imageSlider = $(this).slick({
172            infinite: true,
173            adaptiveHeight: false,
174            slidesToShow: 1,
175            arrows: true,
176            dots: false,
177            autoplay: true,
178            autoplaySpeed: sliderTimer,
179            pauseOnFocus: false,
180            pauseOnHover: false,
181            responsive: [
182                {
183                    breakpoint: 1200,
184                    settings: {
185                        arrows: false,
186                        dots: true
187                    }
188                },
189            ]
190        });
191
192        function progressBar() {
193            $bar.find('span').removeAttr('style');
194            $bar.find('span').removeClass('active');
195            setTimeout(function () {
196                $bar.find('span').css('transition-duration', (sliderTimer / 1000) + 's').addClass('active');
197            }, 100);
198        }
199
200        progressBar();
201
202        $imageSlider.on('beforeChange', function (e, slick) {
203            progressBar();
204        });
205    });
206
207    $('.home-secret-materials__items').each(function () {
208        calculateWidth('.home-secret-materials');
209
210        var $memosSlider;
211        var sliderTimer = 5000;
212        var $bar = $('.home-secret-materials__statusbar');
213
214        $memosSlider = $(this).slick({
215            infinite: true,
216            slidesToShow: 2,
217            slidesToScroll: 1,
218            autoplaySpeed: 5000,
219            arrows: true,
220            appendArrows: $('.home-secret-materials__slider-tools'),
221            dots: false,
222            autoplay: true,
223            centerMode: true,
224            centerPadding: '60px',
225            responsive: [
226                {
227                    breakpoint: 1000,
228                    settings: {
229                        slidesToShow: 1,
230                    }
231                },
232            ]
233        });
234
235        function progressBar() {
236          $bar.find('span').removeAttr('style');
237          $bar.find('span').removeClass('active');
238          setTimeout(function () {
239              $bar.find('span').css('transition-duration', (sliderTimer / 1000) + 's').addClass('active');
240          }, 100);
241        }
242
243        progressBar();
244
245        $memosSlider.on('beforeChange', function (e, slick) {
246            progressBar();
247        });
248    });
249
250    $('.figurant-popup__donat-show').click(function () {
251        showPopupWithOverlay('.figurant-full__donat-popup').show();
252    })
253
254    $overlayWithClose.click(function () {
255        $('.figurant-full__donat-popup').hide();
256    })
257
258    $('.figurant-full__actions-buttons').each(function () {
259        $(this).clone(true).appendTo('.figurant-full__actions-sidebar');
260    });
261
262    // Show Figurant Popup Share
263    $('.figurant-full__actions-btn.--share').click(function () {
264        showPopupWithOverlay('.figurant-full_share-popup').show();
265    });
266
267    $overlayWithClose.click(function () {
268        $('.figurant-full_share-popup').hide();
269    });
270
271    // Ajax archive card
272    function calcUnderlinePositionArchives(el, animation) {
273      var underline = document.querySelector(".underline__item");
274      const selectedItem = document.querySelector('a.archive-figurant__title');
275
276      underline.style.setProperty('--width', + $(el).outerWidth(true) + 'px');
277      underline.style.left = $(el).position().left + 'px';
278      if(animation) {
279        underline.style.left = $(el).position().left +'px';
280      }
281    }
282
283    $('.archive-figurant__title-wrap').on('click', 'a.archive-figurant__title', function(e) {
284      e.preventDefault();
285
286      calcUnderlinePositionArchives(this, true);
287      let url = $(this).attr('href');
288
289      let $preloader = $('.preloader').clone().prop('hidden', false);
290      let $preloaderWrap = $('.archive__preloader');
291      $preloaderWrap.html($preloader);
292
293      let $itemsList = $('.archive-figurant__list').hide();
294      let $showBtnMore = $('.archive-btn__more').hide();
295
296      $.get(url, function(html) {
297        let items = $(html).find('.archive-figurant__list').html();
298        $itemsList.html(items).show();
299
300        let nav = $(html).find('.archive-figurant__title-wrap').html();
301        $('.archive-figurant__title-wrap').html(nav);
302        calcUnderlinePositionArchives($('h1.archive-figurant__title'), false)
303
304        data = html.replace("<body", "<container").replace("body>", "container>");
305        let classes = $(data).filter("container").attr("class");
306        $('body').attr('class', classes);
307
308        let description = $(html).find('.archive-figurant__desc').html();
309        $('.archive-figurant__desc').html(description);
310
311        let showMoreBtn = $(html).find('.archive-figurant__more');
312        $showBtnMore.replaceWith(showMoreBtn).show();
313
314        $preloaderWrap.html('');
315      })
316    })
317    $('h1.archive-figurant__title').each(function() {
318      calcUnderlinePositionArchives(this, false);
319    })
320
321    
322
323});

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.