PageSourceSearch

https://vsesamodelki.ru/syslegal.js

js vsesamodelki.ru collected 2026-10-04 11:47:54 UTC 7,050 bytes, 272 lines download raw bytes

1//  
2	if(jQuery("body").length) {
3		jQuery('<!-- Yandex.RTB --><script>window.yaContextCb=window.yaContextCb||[]</script><script src="https://yandex.ru/ads/system/context.js" async></script>').insertAfter(jQuery("body"));
4	}
5function getRandomArbitary(min, max) {
6	return Math.random() * (max - min) + min;
7}
8function isMobile() {
9    if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
10        return true; 
11    }
12	if(jQuery(window).width()<700)
13		return true; 
14    return false;
15}
16function isGoogle() {
17    if( /google/i.test(document.referrer) ) {
18        return true; 
19    }
20    return false;
21}
22
23function isToloka() {
24	if( /toloka/i.test(document.referrer) || /iframe-yang/i.test(document.referrer)) {
25        return true; 
26    }
27    return false;
28}
29
30 // 
31function get_cookie ( cookie_name )
32{
33  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
34 
35  if ( results )
36    return ( unescape ( results[2] ) );
37  else
38    return null;
39}
40function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
41{
42  var cookie_string = name + "=" + escape ( value );
43 
44  if ( exp_y )
45  {
46    var expires = cookie_date.getTime() + 24*3600*7;
47    cookie_string += "; expires=" + expires.toGMTString();
48  }
49 
50  if ( path ) 
51        cookie_string += "; path=" + escape ( path );
52 
53  if ( domain )
54        cookie_string += "; domain=" + escape ( domain );
55  
56  if ( secure )
57        cookie_string += "; secure";
58  
59  document.cookie = cookie_string;
60}
61var x = get_cookie ( "isPS" );
62//alert(x);
63function isPS() {
64    if( /google|yandex|bing|mail|rambler/i.test(document.referrer) || x == 1 ) {
65		
66		set_cookie ( "isPS", "1" );	
67
68        return true; 
69    }
70    return false;
71}
72
73if(!isToloka()/* &&  isPS()*/){
74
75	var count = jQuery('.entry-content > p').length;
76	//считаем середины абзацев
77	var sered=Math.floor(count/2);
78
79   	//   в центре
80 
81	zalip='<div id="rekl-center">	<div id="rekl-center-fix"> <div id="yandex_rtb_R-A-7045807-1"></div> </div></div>';
82	
83 
84	if(jQuery(".entry-content > p:nth(" + sered + ")").length && count>5) {
85		jQuery(zalip).insertAfter(jQuery(".entry-content > p:nth(" + sered + ")"));
86		
87 		 
88		window.yaContextCb.push(()=>{
89		  Ya.Context.AdvManager.render({
90			renderTo: 'yandex_rtb_R-A-7045807-1',
91			blockId: 'R-A-7045807-1'
92		  })
93		}) 
94 
95	} 
96
97
98	// сайдбар   
99	if(jQuery(".wxsidebar").length  ) {
100		jQuery('<center><div id="yandex_rtb_R-A-7045807-2"></div></center>').insertAfter(jQuery(".wxsidebar"));
101
102 
103		function AdBangSideBar(){
104		//
105			window.yaContextCb.push(()=>{
106			  Ya.Context.AdvManager.render({
107				renderTo: 'yandex_rtb_R-A-7045807-2',
108				blockId: 'R-A-7045807-2'
109			  })
110			})
111	  
112		} 		
113		setTimeout(AdBangSideBar,1000*10);
114		AdBangSideBar();
115	}
116
117 
118	// начало контента  
119	if(jQuery(".entry-content").length) {
120		jQuery('<center style="margin-bottom:10px;"><div id="yandex_rtb_R-A-7045807-3"></div></center>').insertBefore(jQuery(".entry-content"));
121 
122		window.yaContextCb.push(()=>{
123		  Ya.Context.AdvManager.render({
124			renderTo: 'yandex_rtb_R-A-7045807-3',
125			blockId: 'R-A-7045807-3'
126		  })
127		})
128  
129	}	
130	// конец  контента  
131	if(jQuery(".entry-content").length) {
132		jQuery('<center><div id="yandex_rtb_R-A-7045807-4"></div></center>').insertAfter(jQuery(".entry-content"));
133 
134		window.yaContextCb.push(()=>{
135		  Ya.Context.AdvManager.render({
136			renderTo: 'yandex_rtb_R-A-7045807-4',
137			blockId: 'R-A-7045807-4'
138		  })
139		})
140  
141	} 
142
143 
144	// h2
145	if(jQuery(".entry-content h2:nth(0)").length) {
146		jQuery('<center><div id="yandex_rtb_R-A-7045807-5"></div></center>').insertAfter(jQuery(".entry-content h2:nth(0)"));
147 
148		window.yaContextCb.push(()=>{
149		  Ya.Context.AdvManager.render({
150			renderTo: 'yandex_rtb_R-A-7045807-5',
151			blockId: 'R-A-7045807-5'
152		  })
153		})
154  
155	} 
156	// h2
157	if(jQuery(".entry-content h2:nth(2)").length) {
158		jQuery('<center><div id="yandex_rtb_R-A-7045807-6"></div></center>').insertAfter(jQuery(".entry-content h2:nth(2)"));
159 
160		window.yaContextCb.push(()=>{
161		  Ya.Context.AdvManager.render({
162			renderTo: 'yandex_rtb_R-A-7045807-6',
163			blockId: 'R-A-7045807-6'
164		  })
165		})
166  
167	} 
168	// h2
169	if(jQuery(".entry-content h2:nth(4)").length) {
170		jQuery('<center><div id="yandex_rtb_R-A-7045807-7"></div></center>').insertAfter(jQuery(".entry-content h2:nth(4)"));
171 
172		window.yaContextCb.push(()=>{
173		  Ya.Context.AdvManager.render({
174			renderTo: 'yandex_rtb_R-A-7045807-7',
175			blockId: 'R-A-7045807-7'
176		  })
177		})
178  
179	} 	
180	// h2
181	if(jQuery(".entry-content h2:nth(6)").length) {
182		jQuery('<center><div id="yandex_rtb_R-A-7045807-8"></div></center>').insertAfter(jQuery(".entry-content h2:nth(6)"));
183 
184		window.yaContextCb.push(()=>{
185		  Ya.Context.AdvManager.render({
186			renderTo: 'yandex_rtb_R-A-7045807-8',
187			blockId: 'R-A-7045807-8'
188		  })
189		})
190  
191	} 
192	 
193 	// перед комментами
194	if(jQuery("#respond").length) {
195		jQuery('<center><div id="yandex_rtb_R-A-7045807-9"></div></center>').insertBefore(jQuery("#respond"));
196		window.yaContextCb.push(()=>{
197		  Ya.Context.AdvManager.render({
198			renderTo: 'yandex_rtb_R-A-7045807-9',
199			blockId: 'R-A-7045807-9'
200		  })
201		})	} 	
202	  
203  
204//лента
205	jQuery('<div id="yandex_rtb_R-A-7045807-10"></div>').insertAfter(jQuery("body"));
206	 window.yaContextCb.push(()=>{
207	  Ya.Context.AdvManager.renderFeed({
208		renderTo: 'yandex_rtb_R-A-7045807-10',
209		blockId: 'R-A-7045807-10'
210	  })
211	});
212
213if(!isMobile()){
214	// pc
215 // фулскрин
216 window.yaContextCb.push(()=>{
217	Ya.Context.AdvManager.render({
218		"blockId": "R-A-7045807-11",
219		"type": "fullscreen",
220		"platform": "desktop"
221	})
222});
223 // флоор адв
224 window.yaContextCb.push(()=>{
225	Ya.Context.AdvManager.render({
226		"blockId": "R-A-7045807-12",
227		"type": "floorAd",
228		"platform": "desktop"
229	})
230});
231  	 
232 
233}else {
234	// mob
235window.yaContextCb.push(()=>{
236	Ya.Context.AdvManager.render({
237		"blockId": "R-A-7045807-13",
238		"type": "fullscreen",
239		"platform": "touch"
240	})
241});
242window.yaContextCb.push(()=>{
243	Ya.Context.AdvManager.render({
244		"blockId": "R-A-7045807-14",
245		"type": "floorAd",
246		"platform": "touch"
247	})
248})
249 
250
251
252}  
253// хак со скрытием  - Размещение Floor Ad или Top Ad одновременно с Лентой
254const feed = document.getElementById('yandex_rtb_R-A-7045807-10'); // ID из поля renderTo
255const callback = (entries) => {
256        entries.forEach((entry) => {
257                if (entry.isIntersecting) {
258                        Ya.Context.AdvManager.destroy({ // скрытие Floor Ad
259                                        blockId: 'R-A-7045807-12'
260                                }), // blockId для мобильной версии
261                                Ya.Context.AdvManager.destroy({
262                                        blockId: 'R-A-7045807-14'
263                                }); // blockId для десктопной версии
264                }
265        });
266};
267const observer = new IntersectionObserver(callback, {
268        threshold: 0,
269});
270observer.observe(feed);
271
272} 

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.