PageSourceSearch

https://svisgaz.by/bitrix/templates/svisloch/js/script.js?15477972537447

js svisgaz.by collected 2026-10-02 03:29:29 UTC 7,447 bytes, 239 lines download raw bytes

1jQuery(document).ready(function($){
2
3		function youTubeGetId(url) {
4	    var expression = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be[.]?\/|youtube\.com[.]?\/(?:embed\/|v\/|watch\/?\?(?:\S+=\S*&)*v=))([\w-]{11})\S*$/;
5	    return url.match(expression) ? RegExp.$1 : undefined;
6		}
7
8		$('.youtube-video-block').each(function(){
9			var $this = $(this),
10			$src = $this.find('.video-link').data('video'),
11			$id = youTubeGetId($src);
12			var iframe = document.createElement('iframe');
13			iframe.src = '//www.youtube.com/embed/'+$id;
14			iframe.setAttribute('frameborder',0);
15			iframe.setAttribute('allowfullscreen','');
16			$this.append(iframe);
17		});
18
19		//main menu li max-width
20		var $liLength = $('nav.sections > ul > li').length;
21		var $liMaxWidth = 100 / $liLength;
22		$('nav.sections > ul > li').css('flex','0 0 '+$liMaxWidth+'%');
23
24		$('.container_with_aside table').wrap('<div class="responsive-table"></div>');
25
26		function slickArrows (slider, img) {
27			var slideHeight = $(img).innerHeight();
28			var arrows = $(slider).find('.slick-arrow');
29			console.log(slideHeight, arrows);
30
31			arrows.css({
32				'top': -(slideHeight/2)
33			});
34		}
35
36		// $(window).on('load resize',slickArrows('.carousel-today','.carousel-today .slide-img'));
37
38    var todayShare = Ya.share2('today-share', {});
39    $('.carousel-today').on('init',function(){
40        var ImgSrc = $('.carousel-today').find('.slick-active .slide-img img').attr('src');
41        console.log(ImgSrc);
42        console.log(location.protocol+'//'+location.hostname+'/'+ImgSrc);
43
44        todayShare.updateContent({
45            image: location.protocol+'//'+location.hostname+ImgSrc
46        });
47    });
48    //карусель "Вчера и сегодня"
49    $('.carousel-today').slick({
50        dots: false
51    });
52    $('.carousel-today').on('afterChange',function(slick, currentSlide){
53        var ImgSrc = $('.carousel-today').find('.slick-active .slide-img img').attr('src');
54
55        console.log(ImgSrc);
56        todayShare.updateContent({
57            image: location.protocol+'//'+location.hostname+ImgSrc
58        });
59    });
60
61
62	if ($('.anounce-imgs').length) {
63		$('.anounce-imgs').lightGallery({
64			'selector': '.lightgallery'
65		});
66	} else {
67		$('body').lightGallery({
68			'selector': '.lightgallery'
69		});
70	}
71	$('body').lightGallery({
72		'selector': '.highslide'
73	});
74
75	$('.full_interview p').each(function(){
76		if($(this).text().length < 2 && !$(this).find('*').length){
77			$(this).addClass('empty');
78		}
79	});
80
81	//инициализация попапа
82	$(document).on('click','.ajax-mfp',function(){
83		var a = $(this);
84		$.magnificPopup.open({
85			items: { src: a.attr('data-href') },
86			type: 'ajax',    
87			overflowY: 'scroll',
88			removalDelay: 300,
89			mainClass: 'my-mfp-zoom-in',
90			callbacks: {
91				open: function () {
92
93				}
94			}
95		});
96		return false;
97	});
98
99	//инициализация табов
100	$('.tabs ul li').tabs({});
101	$('.tabs_2 ul li').tabs({});
102
103	//инициализация стайлера
104	$('.styler').styler({});
105	
106	//разворачивание меню по клику
107	$(document).click( function(event){
108		if( $(event.target).closest(".dropdown-menu").length ) 
109			return;
110		$(".dropdown-menu").slideUp("slow");
111		$(".drop-menu-toggler").removeClass("opened");
112		event.stopPropagation();
113	});
114	$('.drop-menu-toggler').click( function() {
115		$(this).siblings(".dropdown-menu").slideToggle("slow");
116		if($('.drop-menu-toggler').hasClass('opened')){
117			$('.drop-menu-toggler').removeClass('opened');
118		}
119		else { $(".drop-menu-toggler").addClass("opened");
120	}
121	return false;
122});
123
124	//функция для кнопки "back to top"
125	$(window).scroll(function() {
126		if($(this).scrollTop() != 0) {
127			$('#toTop').fadeIn();
128		} else {
129			$('#toTop').fadeOut();
130		}
131	});
132	$('#toTop').click(function() {
133		$('body,html').animate({scrollTop:0},400);
134	});
135
136	//инициализация слайдера
137	$(".owl-carousel").owlCarousel({
138		items: 1,
139		loop:true,
140	});
141	dotcount = 1;
142
143	jQuery('.owl-dot').each(function() {
144		jQuery(this).addClass('dotnumber' + dotcount);
145		jQuery(this).attr('data-info', dotcount);
146		dotcount = dotcount + 1;
147	});
148	slidecount = 1;
149	jQuery('.owl-item').not('.cloned').each(function() {
150		jQuery(this).addClass('slidenumber' + slidecount);
151		slidecount = slidecount + 1;
152	});
153	jQuery('.owl-dot').each(function() {
154		grab = jQuery(this).data('info');
155		slidegrab = jQuery('.slidenumber' + grab + ' img').attr('src');
156		console.log(slidegrab);
157		jQuery(this).css("background-image", "url(" + slidegrab + ")");
158	});
159	amount = jQuery('.owl-dot').length;
160	gotowidth = 100 / amount;
161	jQuery('.owl-dot').css("width", gotowidth + "%");
162	newwidth = jQuery('.owl-dot').width();
163	jQuery('.owl-dot').css("height", newwidth + "px");
164
165	//сворачивание поля для комментария
166	$(document).on('click','.comments .auth .btn',function(){
167		if($('.comments form').hasClass('opened')){
168			$('.comments form').removeClass('opened');
169			$('.comments form').show();
170			$(".comments .auth .btn").val("Свернуть");
171		}
172		else{
173			$('.comments form').addClass('opened');
174			$('.comments form').hide();
175			$(".comments .auth .btn").val("Комментировать");
176		}
177	});
178
179	//добавление картинки в главный блок
180	$('.main_block .top_news .big_item').each(function(){
181		var $this = $(this),
182		$imgSrc = $this.find('.link_shadow img').attr('src');
183		$this.find('.link_shadow').css('backgroundImage','url('+ $imgSrc +')');
184	});
185
186	//запуск видео
187	$(document).on('click','.PlayPauseVideo',function(){
188		var video = $(this).closest(".video_with_link").find(".video")[0];
189		if (video.paused) {
190			video.play();
191		} else {
192			video.pause();
193		}
194	});
195
196	//изменение при клике на кнопку "голосовать"
197	$(document).on('click','.competition .about_this_option .btn',function(){
198		var img = document.getElementById("image");
199		img.src = "../images/heart_hover.png";
200		$counter = $(".plus_vote");
201		$counter.text(+$counter.text() + 1);
202		var button = document.getElementById('vote');
203		button.disabled = true;
204	});
205
206	//инициализация простого слайдера
207	$('.single-item').slick();
208
209	//сворачивание поля для поиска
210	$(document).on('click','.search span.advanced',function(){
211		if($('.advanced_search').hasClass('opened')){
212			$('.advanced_search').removeClass('opened');
213			$('.advanced_search').show();
214			$('.search span.advanced').text('Скрыть');
215		}
216		else{
217			$('.advanced_search').addClass('opened');
218			$('.advanced_search').hide();
219			$('.search span.advanced').text('Расширенный поиск');
220		}
221	});
222
223	//сворачивание поля для поиска(2)
224	$(document).on('click','.search span.just_advanced',function(){
225		if($('.just_advanced_search').hasClass('opened')){
226			$('.just_advanced_search').removeClass('opened');
227			$('.just_advanced_search').css('display','none');
228			$('.search span.just_advanced').text('Расширенный поиск');
229		}
230		else{
231			$('.just_advanced_search').addClass('opened');
232			$('.just_advanced_search').css('display','block');
233			$('.search span.just_advanced').text('Скрыть');
234		}
235	});
236	
237
238
239});

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.