PageSourceSearch

https://www.fc-baltika.ru/local/templates/new/script.js

js fc-baltika.ru collected 2026-10-02 07:56:11 UTC 12,288 bytes, 373 lines download raw bytes

1var UseCookie  ={
2	Init: function(){
3		if(typeof $.cookie != "undefined"){
4			if($.cookie('USE_COOKIE') != "Y"){
5				$("#UseCookie").css("display","flex");
6				$("#UseCookie button").click($.proxy(this.EventClickAccept,this))
7			}	
8		}
9	},
10	EventClickAccept: function(){
11		$("#UseCookie").css("display","none");
12		$.cookie('USE_COOKIE', 'Y', { expires: 365, path: '/' });
13	}
14}
15
16$(document).ready(function(){
17	
18	UseCookie.Init();
19	
20})
21
22$(window).on('load', function() {
23	
24	$('body').css('opacity',1);
25    /*$('body').find('img').each(function(i, e) {
26        //setTimeout(function(e) {
27        //    if (typeof($(e).data('src')) != 'undefined') e.src = $(e).data('src');
28        //}, 800, e);
29    })*/
30	var lazyLoadInstance = new LazyLoad({elements_selector: ".lazy_load"});
31	$(".lazy").lazyload({threshold: 1.0,});
32	setTimeout(function(){
33		var fired_=false;
34	window.addEventListener('scroll',()=>{
35		if(!fired_){
36			//change_social('instagram');
37		change_social('twitter');
38		change_social('vkontakte');
39			fired_=true;
40		}
41	})
42		
43		$(window).resize(function(){
44			//change_social('instagram');
45			change_social('twitter');
46			change_social('vkontakte');
47		});
48	},1000);
49	if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)) {		
50		var userDeviceArray = [
51			{device: 'Android', platform: /Android/},
52			{device: 'iPhone', platform: /iPhone/},
53			{device: 'iPad', platform: /iPad/},
54			{device: 'Symbian', platform: /Symbian/},
55			{device: 'Windows Phone', platform: /Windows Phone/},
56			{device: 'Tablet OS', platform: /Tablet OS/},
57			{device: 'Linux', platform: /Linux/},
58			{device: 'Windows', platform: /Windows NT/},
59			{device: 'Macintosh', platform: /Macintosh/}
60		];
61
62		var platform = navigator.userAgent;
63
64		function getPlatform() {
65			for (var i in userDeviceArray) {
66				if (userDeviceArray[i].platform.test(platform)) {
67					return userDeviceArray[i].device;
68				}
69			}
70			return 'Неизвестная платформа!' + platform;
71		}
72
73		var $linkNode = $(".mobileApp .mobileApp__Link");
74		
75		if(getPlatform() == "Android")
76			$linkNode.attr("href", $linkNode.data("android"));
77		if(getPlatform() == "iPhone")
78			$linkNode.attr("href", $linkNode.data("iphone"));
79		
80		if($linkNode.attr("href") != "")
81			$(".mobileApp").show();
82	}
83});
84window.addBuyTicket=function(){
85		if($('#mm-1').length>0) if($('#left_buy_tickets').length>0) $('#left_buy_tickets').remove();
86		if($(window).width()<1000){
87			$('.topest-block-in.topest-right .topest-auth .topest-cabinet').hide();
88			$('.topest-block-in.topest-right .topest-auth .topest-cart').show();
89			$('.topest-block-in.topest-right .topest-auth .topest-cart a').prop('href','http://tickets.fc-baltika.ru');
90			
91			/*if($('#mm-1 .mm-listview .add_1').length==0)
92				$('#mm-1 .mm-listview').append('<li id="left_buy_tickets" class="add_1 menu-item unvisible wide_menu mm-listitem"><a class="mm-listitem__text" target="_blank" href="/forum/"><span>Форум<span class="line-wrapper"><span class="line"></span></span></span></a></li>');
93			if($('#mm-1 .mm-listview .add_2').length==0)
94				$('#mm-1 .mm-listview').append('<li id="left_buy_tickets" class="add_2 menu-item unvisible wide_menu mm-listitem"><a class="mm-listitem__text" target="_blank" href="http://tickets.fc-baltika.ru"><span>Купить билеты онлайн<span class="line-wrapper"><span class="line"></span></span></span></a></li>');
95			if($('#mm-1 .mm-listview .add_3').length==0)
96				$('#mm-1 .mm-listview').append('<li id="left_buy_tickets" class="add_3 menu-item unvisible wide_menu mm-listitem"><a class="mm-listitem__text" target="_blank" href="https://shop.fc-baltika.ru/"><span>Интернет магазин<span class="line-wrapper"><span class="line"></span></span></span></a></li>');
97			if($('#mm-1 .mm-listview .add_4').length==0)
98				$('#mm-1 .mm-listview').append('<li id="left_buy_tickets" class="add_4 menu-item unvisible wide_menu mm-listitem"><a class="mm-listitem__text" target="_blank" href="/kontakty/"><span>Контакты<span class="line-wrapper"><span class="line"></span></span></span></a></li>');*/
99		}else{
100			if($('#mm-1').length>0)
101				if($('#left_buy_tickets').length>0)
102					$('#left_buy_tickets').remove();
103		}
104	}
105$(document).ready(function() {
106	addBuyTicket();
107	$(window).on('resize',addBuyTicket);
108	//console.log(123);
109    $(".product-item-container").hover(function() {
110        $(this).addClass("hover");
111    }, function() {
112        $(this).removeClass("hover");
113    });
114    $(window).scroll(function() {
115        var scroll_picca = $('.bottom-block.x-header-section').offset().top + $('.bottom-block.x-header-section').height();
116        if ($(this).scrollTop() > scroll_picca) {
117            $("#header-fixed").addClass('fixed');
118			//console.log($(window).width());
119			if($(window).width()<=720){
120				$('.change-menu-parrent.topest-block.x-header-section').addClass('fixed');
121			}
122        } else {
123            $("#header-fixed").removeClass('fixed');
124			if($(window).width()<=720){
125			$('.change-menu-parrent.topest-block.x-header-section').removeClass('fixed');
126			}
127        }
128		
129    });
130    change_menu('#change-menu-container', false);
131	$(document).ready(function() {$(".fancybox").fancybox();});
132    objectFitImages('.respon-img img');
133    $(".lazy").lazyload();
134});
135
136$('.fc-tabs-block').on('click', '.fc-tabs-tab', function(){
137	let contentID = $(this).data('content');
138	$(this).siblings().removeClass('active');
139	$(this).addClass('active');
140	$('#'+contentID).siblings().removeClass('active');
141	$('#'+contentID).addClass('active');
142});
143
144var mobileApp__close = function(e) {
145	e.preventDefault();
146	
147	setCookie('mobileApp', 'N', {secure: true, 'max-age': 60 * 60 * 24 * 7});
148	
149	$(".mobileApp").fadeOut("normal", function() {
150		$(".mobileApp").remove();
151	});
152};
153
154function setCookie(name, value, options = {}) {
155	options.path = '/';
156
157	if(options.expires instanceof Date) {
158		options.expires = options.expires.toUTCString();
159	}
160
161	let updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
162
163	for(let optionKey in options) {
164		updatedCookie += "; " + optionKey;
165		let optionValue = options[optionKey];
166		if(optionValue !== true) {
167			updatedCookie += "=" + optionValue;
168		}
169	}
170	
171	document.cookie = updatedCookie;
172}
173function deleteCookie(name) {
174	setCookie(name, "", {
175		'max-age': -1
176	})
177}
178function setEqualHeight(columns) {
179    var tallestcolumn = 0;
180    columns.each(function() {
181        currentHeight = $(this).height();
182        if (currentHeight > tallestcolumn) {
183            tallestcolumn = currentHeight;
184        }
185    });
186    columns.height(tallestcolumn);
187}
188(function($) {
189    var truncate = function(el) {
190        var text = el.text(),
191            height = el.height(),
192            clone = el.clone();
193        clone.css({
194            position: 'absolute',
195            visibility: 'hidden',
196            height: 'auto'
197        });
198        el.after(clone);
199        var l = text.length - 1;
200        for (; l >= 0 && clone.height() > height; --l) {
201            clone.text(text.substring(0, l) + '...');
202        }
203        el.text(clone.text());
204        clone.remove();
205    };
206    $.fn.truncateText = function() {
207        return this.each(function() {
208            truncate($(this));
209        });
210    };
211}(jQuery));
212
213
214function change_menu(container, chnged) {
215	var newcontainer, mmenu, iconmenu;
216	var menu_type = $(window).width() >= 991 ? 'top':'mobile';
217	//console.log('change');
218	$.post( "/ajax/menu.php", {type: menu_type}, onSuccess);
219	function onSuccess(data){
220		if(menu_type == 'top'){
221			$(container).html('');
222			$(container).html(data);
223		}else{
224			$(container).html('<div id="change-mobile-menu"><div>');
225			newcontainer = '#change-mobile-menu';
226			$(newcontainer).html(data);
227			var newcontainerin = '#mobile-fcb-menu';
228			mmenu = $(newcontainerin).mmenu({
229				isMenu: true,
230				iconPanels: false,
231				navbar: {title: false,},
232				extensions: ["theme-dark", "shadow-page"],
233			});
234			
235			var icon = '<div id="mobile-menu-icon" class="mobile-menu"><span class="menu-global menu-top"></span><span class="menu-global menu-middle"></span><span class="menu-global menu-bottom"></span></div>';
236			$(container).html(icon);
237			iconmenu = $('#mobile-menu-icon');
238			var API = $(newcontainerin).data( "mmenu" );
239			API.bind( "close:start", function() {
240					Menu.el.menuTop.toggleClass('menu-top-click');
241					Menu.el.menuMiddle.toggleClass('menu-middle-click');
242					Menu.el.menuBottom.toggleClass('menu-bottom-click');
243					
244			});
245			API.bind( "close:finish", function() {
246				if($(window).scrollTop()>52){
247					$('.change-menu-parrent.topest-block.fixed').prop('style','');
248				}
249			});
250			var Menu = {
251				el: {ham: $('.mobile-menu'),menuTop: $('.menu-top'),menuMiddle: $('.menu-middle'),menuBottom: $('.menu-bottom')},
252				init: function() {Menu.bindUIactions();},
253				bindUIactions: function() {
254					Menu.el.ham.on('click',function(event) {
255						Menu.activateMenu(event);
256						event.preventDefault();
257					});
258				},
259				activateMenu: function(event) {
260					Menu.el.menuTop.toggleClass('menu-top-click');
261					Menu.el.menuMiddle.toggleClass('menu-middle-click');
262					Menu.el.menuBottom.toggleClass('menu-bottom-click');
263					if($(window).scrollTop()>52){
264						$('.change-menu-parrent.topest-block.fixed').prop('style','position:absolute!important;top:'+$(window).scrollTop()+'px;');
265					}
266					API.open();
267				}
268			};
269            API.bind( "openPanel:start",
270                (mmenu) => {
271					Menu.el.menuTop.toggleClass('menu-top-click');
272					Menu.el.menuMiddle.toggleClass('menu-middle-click');
273					Menu.el.menuBottom.toggleClass('menu-bottom-click');
274					
275                }
276            );
277			Menu.init();
278		addBuyTicket();
279		}
280	}
281}
282
283$(window).resize(function() {
284    if ($(window).width() > 768) {
285        $('.align-row').each(function() {
286            var elems = $(this).find(' .align-item');
287            if (typeof elems !== "undefined") {
288                setEqualHeight(elems);
289            }
290        })
291    } else {
292        $('.align-row').each(function() {
293            var elems = $(this).find(' .align');
294            elems.each(function() {
295                $(this).height('auto');
296            })
297        })
298    }
299})
300function renderInsta(e){
301		console.log(e);
302		let res = "";
303		console.log(e.edge_owner_to_timeline_media.edges);
304		e.edge_owner_to_timeline_media.edges.forEach(function(picnode,i){
305			if(i<=3){
306			if(i==0||i%2==0){
307				res+='<div class="row">';
308			}
309			res+="<div class='insta-item col-md-6 col-sm-6 col-xs-6'>";
310				res+="<a class='insta-link' href='https://instagram.com/p/"+picnode.node.shortcode+"/'>";
311					res+="<img src='"+picnode.node.thumbnail_src+"'>";
312				res+="</a>";
313			res+="</div>";
314			if(i==1||i%2!=0){
315				res+="</div>";
316			}
317			}
318		})
319		$('#footer-social-instagram').find('.main').html(res);
320}
321function change_social(name) {
322	if(name=="instagram"){
323		//$.instagramFeed({'username': 'fcbaltika','get_raw_json': true,'callback': function(data){renderInsta(data);}});
324	}else{
325		var container = '#footer-social-' + name;
326		var social_type = $(window).width() >= 768 ? 'desktop' : 'mobile';
327		$.ajax({
328			method:'POST',
329			async:true,
330			url:"/ajax/social_" + name + ".php",
331			success:function(data){
332				$(container).html('');
333				$(container).html(data);
334			}
335		});
336	}
337}
338
339$(function() {
340	$(document).on("click", ".mobileApp__close", mobileApp__close);
341});
342
343$(function () {
344	let sectionIds = [110, 122]; // ID разделов с таблицами
345	let currentIndex = 0;
346
347	function loadTable(sectionId) {
348		$.ajax({
349			url: '/ajax/load_tournament_table.php',
350			type: 'POST',
351			data: { section_id: sectionId },
352			success: function (response) {
353				$('#tournament_table_holder').html(response);
354			},
355			error: function () {
356				$('#tournament_table_holder').html('<p>Ошибка загрузки таблицы</p>');
357			}
358		});
359	}
360
361	$('#prevTable').on('click', function () {
362		currentIndex = (currentIndex - 1 + sectionIds.length) % sectionIds.length;
363		loadTable(sectionIds[currentIndex]);
364	});
365
366	$('#nextTable').on('click', function () {
367		currentIndex = (currentIndex + 1) % sectionIds.length;
368		loadTable(sectionIds[currentIndex]);
369	});
370
371	// загружаем первую таблицу при старте
372	loadTable(sectionIds[currentIndex]);
373});

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.