PageSourceSearch

https://belutin.ru/img/custom.js?ver=1.0

js belutin.ru collected 2026-10-07 22:52:21 UTC 8,236 bytes, 221 lines download raw bytes

1// ---------------------------------------------------------
2// !!!!!!!!!!!!!!!!!document ready!!!!!!!!!!!!!!!!!!!!!!!!!!
3// ---------------------------------------------------------
4jQuery(document).ready(function(){
5// ---------------------------------------------------------
6// Blog masonry
7// ---------------------------------------------------------
8	if(jQuery('body.blog')[0]){
9		var isotope_holder = jQuery('.isotope');
10		isotope_holder.isotope({
11			itemSelector : '.post_wrapper',
12			hiddenClass : 'hidden',
13			resizable : true,
14			transformsEnabled : false,
15			layoutMode: 'masonry'
16		}).bind("resize.rainbows", function(){
17			isotope_holder.isotope('reLayout');
18		}).trigger("resize.rainbows").css({'visibility':'visible'});
19	}
20// ---------------------------------------------------------
21// Call Magnific Popup
22// ---------------------------------------------------------
23	jQuery(".thumbnail").parent().each(function(){magnific_popup_init(jQuery(this))});
24// ---------------------------------------------------------
25// Tooltip
26// ---------------------------------------------------------
27	jQuery("[rel='tooltip']").tooltip();
28// ---------------------------------------------------------
29// Back to Top
30// ---------------------------------------------------------
31	jQuery(window).scroll(function () {
32		if (jQuery(this).scrollTop() > 100) {
33			jQuery('#back-top').fadeIn();
34		} else {
35			jQuery('#back-top').fadeOut();
36		}
37	});
38	jQuery('#back-top a').click(function () {
39		jQuery('body,html').stop(false, false).animate({
40			scrollTop: 0
41		}, 800);
42		return false;
43	});
44// ---------------------------------------------------------
45// Add accordion active class
46// ---------------------------------------------------------
47	jQuery('.accordion').on('show', function (e) {
48		jQuery(e.target).prev('.accordion-heading').find('.accordion-toggle').addClass('active');
49	});
50	jQuery('.accordion').on('hide', function (e) {
51		jQuery(this).find('.accordion-toggle').not(jQuery(e.target)).removeClass('active');
52	});
53// ---------------------------------------------------------
54// Isotope Init
55// ---------------------------------------------------------
56	jQuery("#portfolio-grid").css({"visibility" : "visible"});
57// ---------------------------------------------------------
58// Menu Android
59// ---------------------------------------------------------
60	if(window.orientation!=undefined){
61		var regM = /ipod|ipad|iphone/gi,
62			result = navigator.userAgent.match(regM)
63		if(!result) {
64			jQuery('.sf-menu li').each(function(){
65				if(jQuery(">ul", this)[0]){
66					jQuery(">a", this).toggle(
67						function(){
68							return false;
69						},
70						function(){
71							window.location.href = jQuery(this).attr("href");
72						}
73					);
74				} 
75			})
76		}
77	}
78// ---------------------------------------------------------
79// images loader
80// ---------------------------------------------------------
81	var MSIE8 = (jQuery.browser.msie) && (jQuery.browser.version == 8);
82	jQuery('img[data-src]').bind('load', img_load_complete);
83	jQuery(window).bind('resize', img_loader).bind('scroll', img_loader).trigger('scroll');
84	
85	function img_loader(){
86		var get_img = jQuery('img[data-src]').eq(0)
87		if(get_img[0]){
88			var visible_height = jQuery(window).scrollTop() + jQuery(window).height(),
89				img_top_position = get_img.offset().top;
90
91			if(img_top_position<visible_height){
92				get_img.attr({'src':get_img.attr('data-src')}).removeAttr('data-src');
93				if(!MSIE8){
94					get_img.fadeOut(0)
95				}
96			};
97		}else{
98			jQuery(window).unbind('resize', img_loader).unbind('scroll', img_loader);
99		}
100	}
101	function img_load_complete(){
102		jQuery(this).unbind('load');
103		if(!MSIE8){
104			jQuery(this).fadeIn(500)
105		}
106		if(jQuery('body.blog')[0]){
107			isotope_holder.isotope('reLayout');
108		}
109		img_loader();
110	}
111// ---------------------------------------------------------
112// set voting post JS
113// ---------------------------------------------------------
114	jQuery('.ajax_voting').bind('click', voitng);
115	function voitng(){
116		var item= jQuery(this),
117			item_parent = item.parents('[class*="meta_type"]'),
118			type = item.attr('date-type'),
119			item_class='user_'+type,
120			count = parseInt(jQuery('.voting_count', item).text()),
121			top_position = (type==='like') ? -18 : 18 ,
122			mark = (type==='like') ? '+' : '-', 
123			post_url = item.attr('href');
124
125		jQuery('.post_like>a, .post_dislike>a', item_parent).unbind('click', voitng).removeAttr('href date-type').removeClass('ajax_voting').addClass('user_voting');
126		item.removeClass('user_voting').addClass(item_class).find('.voting_count').text(++count).append('<span class="animation_item">'+mark+'1</span>');
127		jQuery('.animation_item', item).stop(true).animate({'top':top_position, opacity:'0'}, 500, 'easeOutCubic', function(){jQuery(this).remove()});
128
129		jQuery.post(post_url);
130		return false;
131	}
132// ---------------------------------------------------------
133// Contact form loader
134// ---------------------------------------------------------
135	jQuery('.wpcf7-submit').after('<div class="ajax-loader"></div>');
136	jQuery('.wpcf7-submit').click(function(){
137		var listener = setInterval(
138				function(){
139					if(jQuery('img.ajax-loader').css('visibility')=='visible'){
140						jQuery('div.ajax-loader').css({'display':'inline-block'});
141					}else{
142						jQuery('div.ajax-loader').css({'display':'none'});
143						clearInterval(listener);
144					}
145				},100);
146	})
147// ---------------------------------------------------------
148// Contact form notvalid tip fadeOut
149// ---------------------------------------------------------
150jQuery(function() {
151	// clear cf7 error msg on mouseover
152	jQuery(".wpcf7-form-control-wrap").on("mouseover", function(){
153		jQuery("span.wpcf7-not-valid-tip", this).fadeOut();
154	});
155});
156// ---------------------------------------------------------
157// OWL Carousel init
158// ---------------------------------------------------------
159	jQuery('div[id^="owl-carousel-"]').each(function(){
160		var carousel = jQuery(this),
161			auto_play = parseInt(carousel.attr('data-auto-play'))<1 ? false : parseInt(carousel.attr('data-auto-play')),
162			items_count = parseInt(carousel.attr('data-items')),
163			disolay_navs = carousel.attr('data-nav')=='true' ? true : false,
164			disolay_pagination = carousel.attr('data-pagination')=='true' ? true : false,
165			auto_height = items_count<=1 ? true : false;
166
167		jQuery(carousel).owlCarousel({
168			autoPlay: auto_play,
169			items: items_count,
170			navigation : disolay_navs,
171			pagination : disolay_pagination,
172			navigationText:false,
173			autoHeight:auto_height,
174			itemsDesktop:[1170, 5],
175			itemsDesktopSmall:[980, 4],
176			itemsTablet:[768, 3],
177			itemsMobile:[480, 2]
178		});
179	})
180	jQuery('.owl-prev').addClass('icon-chevron-left');
181	jQuery('.owl-next').addClass('icon-chevron-right');
182// ---------------------------------------------------------
183// Cookie Banner
184// ---------------------------------------------------------
185	jQuery('#cf-cookie-banner .close').click(function() {
186		createCookie('cf-cookie-banner', 1, 365);
187	});
188});
189
190// ---------------------------------------------------------
191// Magnific Popup Init
192// ---------------------------------------------------------
193function magnific_popup_init(item) {
194	item.magnificPopup({
195		delegate: 'a[rel^="prettyPhoto"]',
196		type: 'image',
197		removalDelay: 500,
198		mainClass: 'mfp-zoom-in',
199		callbacks: {
200			beforeOpen: function() {
201				// just a hack that adds mfp-anim class to markup 
202				this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
203			}
204		},
205		gallery: {enabled:true}
206	});
207}
208// ---------------------------------------------------------
209// Cookie utilities
210// ---------------------------------------------------------
211function createCookie(name, value, days) {
212	if (days) {
213		var date = new Date();
214		date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
215		var expires = "; expires=" + date.toGMTString()
216	} else var expires = "";
217	document.cookie = name + "=" + value + expires + "; path=/"
218}
219function deleteCookie(name) {
220	createCookie( name, "", { expires: -1 } );
221}

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.