PageSourceSearch

https://www.gup.ru/bitrix/templates/twit_main/js/kernel.js?v=10

js gup.ru collected 2026-10-02 04:45:18 UTC 11,637 bytes, 323 lines download raw bytes

1// функция перемешивания массива 
2Array.prototype.shuffle = function() {
3    for (var i = this.length - 1; i > 0; i--) {
4        var num = Math.floor(Math.random() * (i + 1));
5        var d = this[num];
6        this[num] = this[i];
7        this[i] = d;
8    }
9    return this;
10}
11
12// Смена баннера-ткз
13function swapTKZ(){
14      var $active = $('#banner-tkz .active');
15      var $next = ($active.next().length > 0) ? $active.next() : $('#banner-tkz img:first');
16      $next.css('z-index',2);//move the next image up the pile
17      $active.fadeOut(1500,function(){//fade out the top image
18	  $active.css('z-index',1).show().removeClass('active');//reset the z-index and hide the image
19          $next.css('z-index',3).addClass('active');//make the next image the top one
20      });
21}
22
23// Смена баннера-высшего балла
24function swapBall(){
25      var $active = $('#banner-ball .active');
26      var $next = ($active.next().length > 0) ? $active.next() : $('#banner-ball img:first');
27      $next.css('z-index',2);//move the next image up the pile
28      $active.fadeOut(1500,function(){//fade out the top image
29	  $active.css('z-index',1).show().removeClass('active');//reset the z-index and hide the image
30          $next.css('z-index',3).addClass('active');//make the next image the top one
31      });
32}
33
34// Создает картики в для слайдера интервью
35// картинки расположены в background-url, чтобы не грузились при открытии
36// картинки расположены рандомно
37function createImgsToSlide(containerId,prefix,qty){
38      var container = $(containerId); // определить элемент, содержащий картинки
39      $('.img a', container).append('<span class="swap-group"></span>'); // добавить контейнер для слайдера
40	  var arrNums = []; for(i=1;i<=qty;i++){arrNums.push(i);} // создать массив чисел
41	  arrNums.shuffle(); // перемешать элементы
42      $.each(arrNums,function() { // добавить картинки
43		  url = '/bitrix/templates/twit_main/img/press-inter/'+prefix+'-'+this+'.jpg';
44		  ie_fix = "filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"',sizingMethod='scale')";
45		  $('.swap-group', container).append('<span class="hidden swap-el"><span style="background-image:url('+url+');'+ie_fix+'" class="swap-img"></span></span>');
46      });
47      $('.swap-group .swap-el:first',container).removeClass('hidden').addClass('active'); // показать верхнюю картинку 
48      $('div a img',container).remove(); // убрать дефолтную (которую сгенерил сервер)
49}
50// Смена разных элементов (пока-что интервью)
51function slideSomething(containerId){
52      var $container = $(containerId + ' .swap-group');
53      var $active = $('span.active ',$container);
54      var $next = ($active.next().length > 0) ? $active.next() : $('span:first', $container);
55      $next.css('z-index',2).removeClass('hidden');//move the next image up the pile
56      $active.fadeOut(1500,function(){//fade out the top image
57		  $active.css('z-index',1).show().removeClass('active'); //reset the z-index and hide the image
58		  $next.css('z-index',3).addClass('active');//make the next image the top one
59      });
60}
61
62$(function() 
63{
64	/* На всех страницах */
65	
66	/* Фикс bootstrap dropdown menu для iPad */
67	$('.dropdown-menu').on('touchstart.dropdown.data-api', function(e) {
68		e.stopPropagation();
69	});
70	
71	/* Список филиалов */
72    $("#branch").hover(function(){
73        $('#branch_open').css({'visibility': 'visible', display:'block'});
74        $("#branch").css({background: 'url("/bitrix/templates/bit_main/images/branch-bg-open.png") no-repeat'});
75        $("#branch ul").eq(0).css({background: 'url("/bitrix/templates/bit_main/images/ul-up.png") no-repeat 140px 5px'});
76        $("#branch .title").css({'color':'#000', 'text-decoration':'none'});
77    },function(){
78        $('#branch_open').css({'visibility': 'hidden', display:'none'});
79        $("#branch").css({background: 'url("/bitrix/templates/bit_main/images/branch-bg.png") no-repeat'});
80        $("#branch ul").eq(0).css({background: 'url("/bitrix/templates/bit_main/images/ul-bot.png") no-repeat 140px 5px'});
81        $("#branch .title").css({'color':'#2C72A3', 'text-decoration':'underline'});
82    });	
83	
84	/* На главной */
85
86	/* Слайдер баннера ТКЗ */
87	if($('#banner-tkz').length){
88		setInterval('swapTKZ()', 5000);
89	}
90	/* Слайдер баннера Высшего балла */
91	if($('#banner-ball').length){
92		setInterval('swapBall()', 5000);
93	}
94	/* Слайдер картинок-интервью со студентами и абитуриентами */
95	if($('#press-inter').length){
96		// добавить кучу картинок абитуриентов
97		var abitContainer = '#press-inter-data li:first .tbl-row';
98		createImgsToSlide(abitContainer, 'abit', 6);
99		// добавить кучу картинок студентов
100		var studContainer = '#press-inter-data li:nth-child(2) .tbl-row';
101		createImgsToSlide(studContainer, 'stud', 6);
102		// запустить скрипты слайд-шоу
103		setInterval('slideSomething("'+abitContainer+'")', 5000);
104		setInterval('slideSomething("'+studContainer+'")', 5000);
105		
106		// до 1 апреля иногда менять ссылку
107		var ddd = new Date();
108		if (ddd.getMonth() < 4 && ddd.getSeconds() % 2 == 0) {$('#press-inter .tbl-row a').last().attr('href','/events/reports/winter-session2013.php').text('Как стать отличником');}
109	}
110
111	/* Карусель на главной */
112	if($.fn.jcarousel) {
113		$('.jcarousel').jcarousel({
114				wrap: 'circular'
115		});
116		
117		$('.jcarousel-control-prev')
118			.on('jcarouselcontrol:active', function() {
119				$(this).removeClass('inactive');
120			})
121			.on('jcarouselcontrol:inactive', function() {
122				$(this).addClass('inactive');
123				$(this).addClass('hidden'); // temp
124			})
125			.jcarouselControl({
126				target: '-=1'
127			});
128
129		$('.jcarousel-control-next')
130			.on('jcarouselcontrol:active', function() {
131				$(this).removeClass('inactive');
132			})
133			.on('jcarouselcontrol:inactive', function() {
134				$(this).addClass('inactive');
135				$(this).addClass('hidden'); // temp
136			})
137			.jcarouselControl({
138				target: '+=1'
139			});
140
141		$('.jcarousel').jcarouselAutoscroll({
142			interval: 5000
143		});
144	}
145	/* Конец карусели на главной */
146	
147	/* Смена новостей Высшего баллп */
148	$(".news_year a").click(function(e){
149		 e.preventDefault();
150		 // стиль новостей
151		 var year = $(this).text();
152		 $("#news .news_post:not(.hidden)").addClass('hidden'); // скрыть все
153		 $("#news .news_post").each(function() {
154			// показать из выбранного года
155			if(this.getAttribute("data-year")==year) $(this).removeClass('hidden');
156		 });
157		 // стиль селектора годов
158		 $(".news_year .selected").removeClass('selected');
159		 $(this).addClass('selected');
160
161	});
162	
163	/* for new faculty page (beta) */
164	$('.caption-fade').hover(
165		function(){
166			$(this).find('.caption').fadeIn(250);
167		},
168		function(){
169			$(this).find('.caption').fadeOut(250);
170		}
171	);
172	
173	$('#extraordinary_all').click(function(){
174		$('.tab-pane').addClass('active');
175	});
176	
177	//$('.extraordinar__menu').scrollspy();
178
179
180
181	$(".fancybox").fancybox();
182
183// Фотоальбомы
184	if($(".news-album").length)
185	{
186		$(".news-album a").fancybox({
187			nextClick : true,
188			helpers : {
189				title : {
190					type : 'inside'
191				}
192			}
193			/*'transitionIn'		: 'elastic',
194            'transitionOut'		: 'elastic',
195            'titlePosition' 	: 'inside',
196            'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
197                return '<span id="fancybox-title-over">Фотография ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
198            }*/
199		});
200	}
201
202	if($(".news-detail__column").length)
203	{
204		$(".news-detail__column a").fancybox({
205			nextClick : true,
206			helpers : {
207				title : {
208					type : 'inside'
209				}
210			}
211			/*'transitionIn'		: 'elastic',
212            'transitionOut'		: 'elastic',
213            'titlePosition' 	: 'inside',
214            'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
215                return '<span id="fancybox-title-over">Фотография ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
216            }*/
217		});
218	}
219	
220	if($(".page-album").length)
221    {
222        $(".page-album a[rel=photo]").fancybox({
223            nextClick : true,
224            helpers : {
225			title : {
226				type : 'inside'
227				}
228            }
229            /*'transitionIn'		: 'elastic',
230            'transitionOut'		: 'elastic',
231            'titlePosition' 	: 'inside',
232            'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
233                return '<span id="fancybox-title-over">Фотография ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
234            }*/
235        });
236    }
237	
238	  /* Аватар ректора рядом с сообщениями */
239    if($(".faq-data").length)
240    {
241		var prev_has_img = false;
242		$(".faq-data").each(function() {
243			console.log('!!!!!');
244			if ($(".rector-avatar", this).length) {
245				console.log('rector avatar process...');
246				if (prev_has_img == true) {
247					$("<div class='clear'></div>").insertBefore($(this));
248				}
249				$(".faq-left", this).append($(".rector-avatar", this)).addClass('with-avatar');
250				prev_has_img = true;
251			}
252			else {
253				prev_has_img = false;
254			}
255
256			var textAreaWidth = $(this).find('.faq-right').width();
257			$(this).find('.answer img').each(function () {
258				if( this.complete ) {
259					forumAnswerImageLoaded.call( this );
260				} else {
261					$(this).one('load', forumAnswerImageLoaded);
262				}
263
264				function forumAnswerImageLoaded() {
265					if ($(this).width() < (textAreaWidth / 2 + 100))
266						$(this).addClass('answer-img-half');
267					else
268						$(this).addClass('answer-img-full');
269				}
270			})
271    	});
272    }
273	
274	/* блоки, которые нужно показывать-скрывать */
275    if ($(".to-hide").length)
276    {
277	var toHide = $(".to-hide");
278	toHide.delay(500).fadeIn(500);
279	var delayHide = 2000;
280	var animFunctionHide = '';
281
282	var classNamesHide = toHide.attr('class').split(' ');
283	$.each (classNamesHide,function(i,str) {
284		if (str.indexOf('sec') > 0) {
285			delayHide =  parseFloat(str) * 1000;
286		}
287		if (str.indexOf('anim-') == 0) {
288			animFunctionHide = str.split('-')[1];
289		}
290	});
291	
292	if (toHide.hasClass("resize"))
293	{
294		toHide.delay(delayHide).animate({width: "200px", height: "150px"});
295	}
296	else if (animFunctionHide == '') {
297		toHide.delay(delayHide).slideUp(500);
298	}
299	else {
300		toHide.delay(delayHide)[animFunctionHide](500);
301	}
302    }
303    if ($(".to-show").length)
304    {
305	var toShow = 	$('.to-show');
306	var delayShow = 2000;
307	var animFunctionShow = '';
308
309	var classNamesShow = toShow.attr('class').split(' ');
310	$.each (classNamesShow,function(i,str) {
311		if (str.indexOf('sec') > 0) {
312			delayShow =  parseFloat(str) * 1000;
313		}
314		if (str.indexOf('anim-') == 0) {
315			animFunctionShow = str.split('-')[1];
316		}
317	});
318	
319	if (animFunctionShow == '') {toShow.delay(delayShow+1000).slideDown(500);}
320	else {toShow.delay(delayShow+1500)[animFunctionShow](500);}
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.