PageSourceSearch

https://khab-vesti.ru/local/templates/archive/js/script.js?t=1790309349

js khab-vesti.ru collected 2026-09-25 04:09:53 UTC 19,084 bytes, 616 lines download raw bytes

1$(document).ready(function () {
2
3    $('.broadcast-close').click(function () {
4        $('.broadcast').addClass('hidden-block');
5    })
6
7    $('.header-top input')
8        .focus(
9            function(){
10                $('.header-top form').addClass('show-bg');
11            })
12        .blur(
13            function(){
14                $('.header-top form').removeClass('show-bg');
15            });
16
17    /*sliders*/
18    let time = 1,
19    time2 = 1;
20    let $bar,
21        isPause,
22        isPause2,
23        tick,
24        tick2,
25        percentTime,
26        percentTime2;
27
28    let bannerSlide = $('.home-page-banner-slider');
29    bannerSlide.slick({
30        infinite: true,
31        slidesToShow: 1,
32        slidesToScroll: 1,
33        arrows: false,
34        swipe: false,
35        dots: true,
36        responsive: [
37            {
38                breakpoint: 991.98,
39                settings: {
40                    swipe: true
41                }
42            }
43        ]
44    });
45
46    let shortNewsSlide = $('.short-news-slider');
47    shortNewsSlide.slick({
48        infinite: true,
49        slidesToShow: 1,
50        slidesToScroll: 1,
51        arrows: true,
52        swipe: false,
53        dots: true
54    });
55
56    $('.home-page-media-slider').slick({
57        infinite: true,
58        slidesToShow: 1,
59        slidesToScroll: 1,
60        arrows: true,
61        autoplay: true,
62        autoplaySpeed: 4000
63    });
64
65    $('.poster-slider').slick({
66        infinite: true,
67        slidesToShow: 4,
68        slidesToScroll: 1,
69        responsive: [
70            {
71                breakpoint: 991.98,
72                settings: {
73                    slidesToShow: 3
74                }
75            },
76            {
77                breakpoint: 767.98,
78                settings: {
79                    slidesToShow: 2,
80                    centerMode: true,
81                    centerPadding: 5
82                }
83            },
84            {
85                breakpoint: 460.98,
86                settings: {
87                    slidesToShow: 1
88                }
89            }
90        ]
91    });
92
93    $('.home-page-media-adaptive-slider').slick({
94        infinite: true,
95        slidesToShow: 1,
96        slidesToScroll: 1,
97        autoplay: true,
98        autoplaySpeed: 4000
99    });
100
101    $('.home-page-cinema-slider').slick({
102        infinite: true,
103        slidesToShow: 1,
104        slidesToScroll: 1,
105        autoplay: true,
106        autoplaySpeed: 4000,
107        responsive: [
108            {
109                breakpoint: 767.98,
110                settings: {
111                    slidesToShow: 1,
112                    centerMode: true,
113                    centerPadding: 5
114                }
115            }
116        ]
117    });
118
119		$('.cinemas-slider').slick({
120        infinite: true,
121        slidesToShow: 1,
122        slidesToScroll: 1,
123        autoplay: false,
124        autoplaySpeed: 4000,
125        responsive: [
126            {
127                breakpoint: 767.98,
128                settings: {
129                    slidesToShow: 1,
130                    centerMode: true,
131                    centerPadding: 5
132                }
133            }
134        ]
135    });
136
137
138    $('.single-news-page-slider-first').slick({
139        slidesToShow: 1,
140        slidesToScroll: 1,
141        arrows: true,
142        fade: true,
143        infinite: true,
144    });
145
146    $('.single-news-page-slider-second').slick({
147        slidesToShow: 4,
148        slidesToScroll: 1,
149        asNavFor: '.single-news-page-slider-first',
150        dots: false,
151        infinite: true,
152        centerMode: true,
153        focusOnSelect: true
154    });
155
156    $(window).resize(function(){
157        $('.single-news-page-slider-first')[0].slick.refresh();
158        $('.single-news-page-slider-second')[0].slick.refresh();
159    });
160
161    /*banner slider progressbar*/
162
163    $bar = $('.slider-progress .progress');
164
165    function startProgressbar() {
166        resetProgressbar();
167        percentTime = 0;
168        isPause = false;
169        tick = setInterval(interval, 60); // N секунд * 10
170    }
171
172    function interval() {
173        if (isPause === false) {
174            percentTime += 1 / (time + 0.1);
175            $bar.css({
176                width: percentTime + "%"
177            });
178            if (percentTime >= 100) {
179                bannerSlide.slick('slickNext');
180                startProgressbar();
181            }
182        }
183    }
184
185    function resetProgressbar() {
186        $bar.css({
187            width: 0 + '%'
188        });
189        clearTimeout(tick);
190    }
191
192    startProgressbar();
193
194    $('.home-page-banner .slick-next, .home-page-banner .slick-prev, .home-page-banner .slick-dots li').click(function() {
195        startProgressbar();
196    });
197
198    let adaptiveSlider = window.matchMedia('(max-width: 991.98px)');
199    if (adaptiveSlider.matches) {
200        bannerSlide.on('swipe', function(){
201            startProgressbar();
202        });
203    }
204
205    /*shortnews slider progressbar*/
206
207    let shortNewsProgressBar = $('.short-news-slider-progress .progress');
208
209    function startProgressbar2() {
210        resetProgressbar2();
211        percentTime2 = 0;
212        isPause2 = false;
213        tick2 = setInterval(interval2, 100);
214    }
215
216    function interval2() {
217        if (isPause2 === false) {
218            percentTime2 += 1 / (time2 + 0.1);
219            shortNewsProgressBar.css({
220                width: percentTime2 + "%"
221            });
222            if (percentTime2 >= 100) {
223                shortNewsSlide.slick('slickNext');
224                startProgressbar2();
225            }
226        }
227    }
228
229    function resetProgressbar2() {
230        shortNewsProgressBar.css({
231            width: 0 + '%'
232        });
233        clearTimeout(tick2);
234    }
235
236    startProgressbar2();
237
238    $('.home-page-short-news .slick-next, .home-page-short-news .slick-prev, .home-page-short-news .slick-dots li').click(function() {
239        startProgressbar2();
240    });
241
242    /*sidebar*/
243
244    setTimeout(function () {
245        $('.home-page-sidebar-top').removeClass('show-weather')
246    }, 5000);
247
248    $('.home-page-sidebar-top').hover(
249        function() {
250            $('.weather').hover(
251                function () {
252                    $('.home-page-sidebar-top').addClass('show-weather')
253                }
254            )
255        },
256        function() {
257            $('.home-page-sidebar-top').removeClass('show-weather')
258        }
259    );
260
261    $('.newspaper-download-btn button').hover(
262        function () {
263            $('.newspaper-download-btn p').removeClass('hidden-block')
264        },
265        function () {
266            $('.newspaper-download-btn p').addClass('hidden-block')
267        }
268    )
269
270    $('.sidebar-nav-link, .other-sections').hover(
271        function () {
272            $(this).addClass('sidebar-nav-submenu-active')
273        },
274        function () {
275            $(this).removeClass('sidebar-nav-submenu-active')
276        }
277    )
278
279    $('.sidebar-nav-link').each(function() {
280        if (!($(this).find('.sidebar-nav-submenu').length)) {
281            $(this).addClass('sidebar-without-submenu')
282        }
283    });
284
285    if ($('.sidebar-nav-link').length > 9) {
286        $('.home-page-sidebar').addClass('sidebar-nav-big')
287    }
288
289    /*fancybox*/
290
291    $(".fancybox-video").click(function () {
292        $.fancybox({
293            'padding'       : 0,
294            'autoScale'     : false,
295            'transitionIn'  : 'none',
296            'transitionOut' : 'none',
297            'title'         : this.title,
298            'width'         : 680,
299            'height'        : 495,
300            'href'          : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
301            'type'          : 'swf',
302            'swf'           : {
303                'wmode'        : 'transparent',
304                'allowfullscreen'   : 'true'
305            }
306        });
307        return false;
308    })
309
310    $(".fancybox-adaptive-video").click(function () {
311        $.fancybox({
312            'padding'       : 0,
313            'autoScale'     : false,
314            'transitionIn'  : 'none',
315            'transitionOut' : 'none',
316            'height'        : '350px',
317            'title'         : this.title,
318            'href'          : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
319            'type'          : 'swf',
320            'swf'           : {
321                'wmode'        : 'transparent',
322                'allowfullscreen'   : 'true'
323            }
324        });
325        return false;
326    })
327
328    /*news img*/
329
330    $('.home-page-news-1, .news-container').each(function() {
331        if (!($(this).find('img').length)) {
332            $(this).addClass('news-without-img')
333            $('.news-without-img .home-page-news-1-img').addClass('hidden-block')
334            $('.news-without-img .news-container-img').addClass('hidden-block')
335
336        }
337        else (
338            $(this).addClass('news-with-img')
339        )
340    });
341/*
342    $(".home-page-news-1 .news-with-img h5").text(function (i, text) {
343        if (text.length >= 56) {
344            text = text.substring(0, 55);
345            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
346            text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
347        }
348        $(this).text(text);
349    })
350
351    $(".news-container.news-with-img h5").text(function (i, text) {
352        if (text.length >= 54) {
353            text = text.substring(0, 54);
354            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
355            text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
356        }
357        $(this).text(text);
358    })
359
360    $(".home-page-news-3 h5").text(function (i, text) {
361        if (text.length >= 90) {
362            text = text.substring(0, 90);
363            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
364            text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
365        }
366        $(this).text(text);
367    })
368
369    $(".short-news-left h5").text(function (i, text) {
370        if (text.length >= 80) {
371            text = text.substring(0, 80);
372            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
373            text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
374        }
375        $(this).text(text);
376    })
377
378    $(".home-page-media-slider-big h5").text(function (i, text) {
379        if (text.length >= 100) {
380            text = text.substring(0, 100);
381            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
382            text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
383        }
384        $(this).text(text);
385    })
386
387    $(".home-page-media-slider-small h5").text(function (i, text) {
388        if (text.length >= 56) {
389            text = text.substring(0, 55);
390            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
391            text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
392        }
393        $(this).text(text);
394    })
395
396    $(".news-page-short-news-content h5, .home-page-news-1-text h5").text(function (i, text) {
397        if (text.length >= 80) {
398            text = text.substring(0, 80);
399            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
400            text = text.substring(0, lastIndex) + '...' ; // обрезаем до последнего слова
401        }
402        $(this).text(text);
403    })
404
405    $(".media-adaptive-slide-container h5").text(function (i, text) {
406        if (text.length >= 100) {
407            text = text.substring(0, 100);
408            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
409            text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
410        }
411        $(this).text(text);
412    })
413
414    $(".cinema-text > p").text(function (i, text) {
415        if (text.length >= 360) {
416            text = text.substring(0, 360);
417            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
418            text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
419        }
420        $(this).text(text);
421    })
422
423    //if (window.matchMedia("(max-width: 575.98px)").matches) {
424        $(".news-without-img h5, .short-news h5, .news-page-short-news-content h5").text(function (i, text) {
425            if (text.length >= 70) {
426                text = text.substring(0, 70);
427                let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
428                text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
429            }
430            $(this).text(text);
431        })
432    //}
433
434    $(".page-newspaper-themes-right h5").text(function (i, text) {
435        if (text.length >= 35) {
436            text = text.substring(0, 35);
437            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
438            text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
439        }
440        $(this).text(text);
441    })
442    $(".page-newspaper .newspaper-bottom-news-content-text h5").text(function (i, text) {
443        if (text.length >= 65) {
444            text = text.substring(0, 65);
445            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
446            text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
447        }
448        $(this).text(text);
449    })
450    $(".page-newspaper .page-newspaper-themes-left h5").text(function (i, text) {
451        if (text.length >= 80) {
452            text = text.substring(0, 80);
453            let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
454            text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
455        }
456        $(this).text(text);
457    })
458
459   if (window.matchMedia("(max-width: 767.98px)").matches) {
460        $(".page-newspaper .only-title .home-page-news-1-text h5").text(function (i, text) {
461            if (text.length >= 80) {
462                text = text.substring(0, 80);
463                let lastIndex = text.lastIndexOf(" ");       // позиция последнего пробела
464                text = text.substring(0, lastIndex) + '...'; // обрезаем до последнего слова
465            }
466            $(this).text(text);
467        })
468    }*/
469
470    /*modal*/
471
472    $('.close-menu').click(function () {
473        event.preventDefault()
474        $('#openMenu').modal('hide')
475   });
476
477    $('.open-menu-modal button').click(function () {
478        $('#openMenu').modal('hide')
479   })
480
481    /*adaptive menu*/
482
483    $('.adaptive-menu').slinky({
484        resize: true,
485        title: true
486    })
487
488    $('.adaptive-menu-nav-item').click(function () {
489        $('.adaptive-menu').removeClass('slinky-menu-custom')
490    })
491
492    /*datetime picker*/
493    /*$('#newsDateTimePicker').datetimepicker({
494        locale: 'ru',
495        format: 'L'
496    });*/
497
498	/*#Ticket #18098*/
499	if (navigator.share && $(window).width() < 768) { // Проверяем поддержку функционала браузера
500		button = $('.mobile-share'); // Класс кнопки "поделиться"
501		button.show().on('click', function () {
502			navigator.share({
503			title: $(this).data('title'),
504			text: $(this).data('text'),
505			url: $(this).data('url'),
506			});
507			return false;
508		});
509	}
510	/*##*/
511
512$(document).on("scroll", scrolling);
513
514function scrolling () {
515    if($("#load-archive").length){
516        var yes = $("#load-archive").offset().top;
517        var winHeight = $(window).height();
518        var s_top = $(window).scrollTop() + winHeight;
519        if(s_top > yes){
520            $(this).unbind("scroll");
521            load_archive();
522        }
523    }else if($("#load-news").length){
524        var yes = $("#load-news").offset().top;
525        var winHeight = $(window).height();
526        var s_top = $(window).scrollTop() + winHeight;
527        if(s_top > yes){
528            $(this).unbind("scroll");
529            load_news();
530        }
531    }
532};
533});
534
535function date_changed(){
536    var date = $('#archive_date').val();
537    window.history.pushState('1', 'Title', '?date='+date);
538    location.reload();
539}
540
541function load_archive(){
542
543    $("#load-archive a").css('transform', 'rotate(145deg)').css('transition-duration', '.3s');
544
545    var el_id = 0;
546    $.each( $('.page-archive-content-container'), function( key, val ) {
547        el_id = $(val).attr('id');
548    });
549
550    var ib_id = $('#load_ib_id').val();
551		var date = $('#load_date').val();
552    var user_access = $('#user_access').val();
553
554    $.post( "/local/ajax/archive.php", { ib_id:ib_id, el_id:el_id, date:date, user_access: user_access })
555      .done(function( data ) {
556
557        if(data.length > 50){
558            $("#archive_content").append( data );
559            $("#load-archive a").css('transform', 'rotate(15deg)');
560
561            $(document).on("scroll", function () {
562
563                var winHeight = $(window).height();
564                var s_top = $(window).scrollTop() + winHeight;
565                var yes = $("#load-archive").offset().top;
566
567                if(s_top > yes){
568                    $(this).unbind("scroll");
569                    load_archive();
570                }
571            });
572        }else{
573            $(this).unbind("scroll");
574            $("#load-archive a").fadeOut('fast');
575        }
576      });
577}
578
579function load_news(){
580
581    $("#load-news a").css('transform', 'rotate(145deg)').css('transition-duration', '.3s');
582
583    var section_code = $('#section_code').val();
584    var date_active = $('.date_active').last().val();
585    var date_select = $('#date_select').val();
586    var showed_ids = $(".showed_ids").serialize()+'&date_select='+date_select+'&date_active='+date_active+'&section_code='+section_code;
587
588    $.ajax({
589          type: 'POST',
590          url: '/local/ajax/news.php',
591          data: showed_ids,
592          success: function(data) {
593
594            if(data.length > 50){
595                $("#news_content").append( data );
596
597                $("#load-news a").css('transform', 'rotate(15deg)');
598
599                $(document).on("scroll", function () {
600
601                    var winHeight = $(window).height();
602                    var s_top = $(window).scrollTop() + winHeight;
603                    var yes = $("#load-news").offset().top;
604
605                    if(s_top > yes){
606                        $(this).unbind("scroll");
607                        load_news();
608                    }
609                });
610            }else{
611                $(this).unbind("scroll");
612                $("#load-news a").fadeOut('fast');
613            }
614          }
615    });
616}

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.