PageSourceSearch

https://plusworld.ru/local/templates/plus_new/js/main.js

js plusworld.ru collected 2026-09-24 08:59:42 UTC 7,466 bytes, 243 lines download raw bytes

1(function($){
2/* определяем размер экрана */	
3$.screenWidth = function() {
4	var screen = $(window).width();
5	if (screen > 575) {
6		var width = $('main').width();
7		} 
8		else
9		{
10		var width = 575;
11	};
12	var SWidth = $.cookie('ScreenWidth');
13	if (width != SWidth) {
14			$.cookie('ScreenWidth', width, {expires: 30, path: '/', domain: 'plusworld.ru'});
15//		location.reload();
16	}
17	return width;
18};	
19
20
21/* Вывод яндекс-отзывы */
22/*	
23	$('body #comment').click(function(){
24		alert('Click');
25		let dateYandex = (+new Date())/1000;
26		$('body #popup-yandex.overlay').css({opacity: 0, visibility: ""})
27		$.cookie('PopUpYandex', dateYandex, {expires: 30, path: '/', domain: 'plusworld.ru'});
28		window.open("https://yandex.ru/maps/org/zhurnal_plas/1309243312/?add-review=true&ll=37.582673%2C55.674621&mode=search&sctx=ZAAAAAgBEAAaKAoSCUImGTkLP0ZAEQBw7NlzGURAEhIJEvjDz38Ptj8RB7Ezhc5rpD8iBgABAgMEBSgKOABAllBIAWIzcmVhcnI9c2NoZW1lX0xvY2FsL0dlby9Db2xsZWN0aW9ucy9FbmFibGVkTWl4PWZhbHNlagJhbZ0BzcxMPaABAKgBAL0BHnzVeMIBBbDvpfAE6gEA8gEA%2BAEAggIV0LbRg9GA0L3QsNC7INCf0JvQkNChigIAkgIAmgIMZGVza3RvcC1tYXBz&sll=37.582673%2C55.674621&sspn=0.021544%2C0.007348&text=%D0%B6%D1%83%D1%80%D0%BD%D0%B0%D0%BB%20%D0%9F%D0%9B%D0%90%D0%A1&z=16");
29	});	
30*/	
31/*  // */	
32
33
34/* функция вывода слайдера на главной */
35$.sliderHome = function(width) {
36	BX.ajax({
37		url: '/local/templates/plus_new/includes/carousel-home.php',
38		method: 'post',
39		async: true,
40		timeout: 10,
41		processData: true,
42		scriptsRunFirst: true,
43		emulateOnload: false,
44		start: true,
45		cache: true,
46		dataType: 'html',         
47		data: {
48			width: width,
49		}, 
50		onsuccess: function(data){
51			$('#main-slider').html(data);	
52		},
53		error: function(xhr, ajaxOptions, thrownError) {
54			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
55		}
56		
57	});
58};			
59    $(document).ready(function () {
60
61		
62
63/* выводим кнопку ВВЕРХ */
64	var shirina = $.cookie('ScreenWidth');
65
66if(shirina > 576) {
67	$('body').append('<div id="scroller" class="button-up"><img src="/local/templates/plus_new/images/chevron-up-solid.svg" alt=""></i></div>');
68	$(window).scroll(function () {
69		if ($(this).scrollTop() > 1000) {
70			$('#scroller').fadeIn(600);
71		} else {
72			$('#scroller').fadeOut(600);
73		}
74	});
75	$('#scroller').click(function () {
76			$('body,html').animate({
77				scrollTop: 0
78			}, 300);
79			return false;
80		});		
81};
82/* -- */
83
84
85		$(document).on('click', '#ellipsiss.themNext', function() {
86			$('.sub-menu').css({'flex-wrap':'wrap'});
87			$('#ellipsiss').removeClass('themNext').addClass('themPrev');
88		});
89
90		$(document).on('click', '#ellipsiss.themPrev', function() {
91			$('.sub-menu').css({'flex-wrap':''});
92			$('#ellipsiss').removeClass('themPrev').addClass('themNext');
93		});
94
95
96		
97
98		if ( $("body .main-article").length ) {
99			var blockMain = $("body .main-article"), // Основной раздел
100				topMain = blockMain.offset().top, // Вверхняя граница элемента
101				heightMain = blockMain.height(), //Высота элемента
102				blockSidebar = $("body .sidebar"), // Боковой раздел
103				topSidebar = blockSidebar.offset().top, // Вверхняя граница элемента
104				heightSidebar = blockSidebar.height(); //Высота элемента
105
106//console.log('Высота основного элемента - '+heightMain);
107//console.log('Высота сайдбара - '+heightSidebar);
108			}	
109			
110			
111$.secondHome = function() {	
112	
113	var SWidth = $.cookie('ScreenWidth');
114	let stat = [],
115		i = 0;
116	$(window).scroll(function() {
117/*		topOfBlock = $('#second').offset().top; // Верхняя граница элемента
118		blockHeight = $('#second').height(); //Высота элемента
119		bottom_of_block = parseInt(topOfBlock) + parseInt(blockHeight);
120		bottom_of_screen = $(window).scrollTop() + window.innerHeight;
121		top_of_screen = $(window).scrollTop();
122		console.log(bottom_of_screen);
123		if (topOfBlock-1500 < bottom_of_screen) {
124*/			if (stat[i] != 1) {
125	
126			BX.ajax({
127				url: '/local/templates/plus_new/includes/second.php',
128				method: 'post',
129                async: true,
130				timeout: 0,
131                processData: true,
132                scriptsRunFirst: false,
133                emulateOnload: true,
134                start: true,
135                cache: true,
136				dataType: 'html',         
137				data: {
138					width: SWidth,
139				}, 
140				onsuccess: function(data){
141					$('#second').html(data);	
142				},
143				error: function(xhr, ajaxOptions, thrownError) {
144					alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
145				}
146				
147			});
148				stat[i] = 1;
149			}
150//		} 
151	});
152}			
153			
154			
155$.thirdHome = function() {	
156	
157	var SWidth = $.cookie('ScreenWidth');
158	let stat = [],
159		i = 0;
160	$(window).scroll(function() {
161		topOfBlock = $('#third').offset().top; // Верхняя граница элемента
162		blockHeight = $('#third').height(); //Высота элемента
163		bottom_of_block = parseInt(topOfBlock) + parseInt(blockHeight);
164		bottom_of_screen = $(window).scrollTop() + window.innerHeight;
165		top_of_screen = $(window).scrollTop();
166//		console.log(bottom_of_screen);
167		if (topOfBlock < bottom_of_screen) {
168			if (stat[i] != 1) {
169				var randomIndex = Math.floor(Math.random() * 4);
170				var preloader = ["preloader1.gif", "preloader2.gif", "preloader3.gif", "preloader4.gif"];
171//console.log(preloader);
172//BX.showWait = function () {
173//		var loader = '<div class="loader"><div class="cssload-clock"></div></div>';
174		var loader = '<div class="loader"><div class="text-center my-5 d-flex flex-column">'+
175		'<div class="loader-text">... ещё кое-что интересное, ожидайте!</div>'+
176		'<div class="loader-img"><img src="/images/preloaders/'+preloader[randomIndex]+'" alt="preloader" /></div>'+
177		'</div></div>';
178//console.log(loader);
179		$('#third').prepend(loader);
180//	};
181
182			BX.ajax({
183				url: '/local/templates/plus_new/includes/third.php',
184				method: 'post',
185                async: true,
186				timeout: 0,
187                processData: true,
188                scriptsRunFirst: false,
189                emulateOnload: true,
190                start: true,
191                cache: true,
192				dataType: 'html',         
193				data: {
194					width: SWidth,
195				}, 
196				onsuccess: function(data){
197				$('.loader').remove();
198					$('#third').html(data);	
199				},
200				error: function(xhr, ajaxOptions, thrownError) {
201					alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
202				}
203				
204			});
205				stat[i] = 1;
206			}
207		} 
208	});
209}			
210
211
212		
213	
214	
215function onOfBanner(block) {
216	var stat = [];
217	$(window).scroll(function() {
218		i=0;
219		block.each( function() {
220			i++;
221			topOfBlock = $(this).offset().top; // Верхняя граница элемента
222			blockHeight = $(this).height(); //Высота элемента
223			bottom_of_block = parseInt(topOfBlock) + parseInt(blockHeight);
224			bottom_of_screen = $(window).scrollTop() + window.innerHeight;
225			top_of_screen = $(window).scrollTop();
226			if (bottom_of_block > top_of_screen && topOfBlock < bottom_of_screen) {
227				if (stat[i] != 1) {
228					$(this).load('<?=SITE_TEMPLATE_PATH;?>/includes/banners/banner-intertext.php');
229					stat[i] = 1;
230				}
231			} 
232			if ((bottom_of_block) <= top_of_screen || topOfBlock >= bottom_of_screen) {
233				if (stat[i] == 1) {
234					$(this).css('height', $(this).height());
235					$(this).empty();
236					stat[i] = 0;
237				}
238			}
239		});
240	});
241};
242});
243})(jQuery);

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.