PageSourceSearch

https://www.legambienteanimalhelp.it/wp-content/themes/wp-trust/assets/js/main.js?ver=1.0.0

js legambienteanimalhelp.it collected 2026-10-02 11:36:51 UTC 9,542 bytes, 409 lines download raw bytes

1jQuery(document).ready(function($) {
2	"use strict";
3	
4	/* window */
5	var window_width, window_height, scroll_top;
6	
7	/* admin bar */
8	var adminbar = $('#wpadminbar');
9	var adminbar_height = 0;
10	
11	/* header menu */
12	var header = $('#cshero-header');
13	var header_top = 0;
14	
15	/* scroll status */
16	var scroll_status = '';
17	
18	/**
19	 * window load event.
20	 * 
21	 * Bind an event handler to the "load" JavaScript event.
22	 * @author Fox
23	 */
24	$(window).on('load', function() {
25		
26		/** current scroll */
27		scroll_top = $(window).scrollTop();
28		
29		/** current window width */
30		window_width = $(window).width();
31		
32		/** current window height */
33		window_height = $(window).height();
34		
35		/* get admin bar height */
36		adminbar_height = adminbar.length > 0 ? adminbar.outerHeight(true) : 0 ;
37		
38		/* get top header menu */
39		header_top = header.length > 0 ? header.offset().top - adminbar_height : 0 ;
40		
41		/* check sticky menu. */
42		if(CMSOptions.menu_sticky == '1'){
43			cms_stiky_menu(scroll_top);
44		}
45		
46		/* check video size */
47		cms_auto_video_width();
48
49		/* check mobile menu */
50		cms_mobile_menu();
51
52		/* page loading */
53		cms_page_loading();
54
55		/* Encroll */
56		cms_enscroll();
57
58		/* CMS Add Class */
59		cms_add_class();
60
61		demos();
62		
63		/* check back to top */
64		if(CMSOptions.back_to_top == '1'){
65			/* add html. */
66			$('body').append('<div id="back_to_top" class="back_to_top"><span class="go_up"></span></div><!-- #back-to-top -->');
67			cms_back_to_top();
68		}
69		$(".cms-carousel-attorney-layout1").css('opacity','1');
70		$(".view-demos").css('opacity','1');
71		$(".vc_row-o-full-height").addClass('row-show').css('opacity','1');
72	});
73	
74	/**
75	 * reload event.
76	 * 
77	 * Bind an event handler to the "navigate".
78	 */
79	window.onbeforeunload = function(){ cms_page_loading(1); }
80
81	/**
82	 * resize event.
83	 * 
84	 * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.
85	 * @author Fox
86	 */
87	$(window).on('resize', function(event, ui) {
88		/** current window width */
89		window_width = $(event.target).width();
90		
91		/** current window height */
92		window_height = $(window).height();
93		
94		/** current scroll */
95		scroll_top = $(window).scrollTop();
96		
97		/* check sticky menu. */
98		if(CMSOptions.menu_sticky == '1'){
99			cms_stiky_menu(scroll_top);
100		}
101		
102		/* check mobile menu */
103		cms_mobile_menu();
104
105		/* check video size */
106		cms_auto_video_width();
107
108		/* Encroll */
109		cms_enscroll();
110
111		demos();
112	});
113	
114	/**
115	 * scroll event.
116	 * 
117	 * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element.
118	 * @author Fox
119	 */
120	var lastScrollTop = 0;
121	
122	$(window).on('scroll', function() {
123		/** current scroll */
124		scroll_top = $(window).scrollTop();
125		/** check scroll up or down. */
126		if(scroll_top < lastScrollTop) {
127			/* scroll up. */
128			scroll_status = 'up';
129		} else {
130			/* scroll down. */
131			scroll_status = 'down';
132		}
133		
134		lastScrollTop = scroll_top;
135		
136		/* check sticky menu. */
137		if(CMSOptions.menu_sticky == '1'){
138			cms_stiky_menu();
139		}
140		
141		/* check back to top */
142		cms_back_to_top();
143	});
144
145	/**
146	 * Stiky menu
147	 * 
148	 * Show or hide sticky menu.
149	 * @author Fox
150	 * @since 1.0.0
151	 */
152	function cms_stiky_menu() {
153		if (header_top < scroll_top) {
154			switch (true) {
155				case (window_width > 0):
156					header.addClass('header-fixed');
157					break;
158			}
159		} else {
160			header.removeClass('header-fixed');
161		}
162	}
163	
164	/**
165	 * Mobile menu
166	 * 
167	 * Show or hide mobile menu.
168	 * @author Fox
169	 * @since 1.0.0
170	 */
171	
172	$('body').on('click', '#cshero-menu-mobile', function(){
173		var navigation = $(this).parent().find('#cshero-header-navigation');
174		if(!navigation.hasClass('collapse')){
175			navigation.addClass('collapse');
176		} else {
177			navigation.removeClass('collapse');
178		}
179	});
180	/**
181	 * Page Loading.
182	 */
183	function cms_page_loading($load) {
184		switch ($load) {
185		case 1:
186			$('#cms-loadding').css('display','block')
187			break;
188		default:
189			$('#cms-loadding').css('display','none')
190			break;
191		}
192	}
193	/* check mobile screen. */
194	function cms_mobile_menu() {
195		var menu = $('#cshero-header-navigation');
196		
197		/* active mobile menu. */
198		switch (true) {
199		case (window_width <= 992 && window_width >= 768):
200			menu.removeClass('phones-nav').addClass('tablets-nav');
201			/* */
202			cms_mobile_menu_group(menu);
203			break;
204		case (window_width <= 768):
205			menu.removeClass('tablets-nav').addClass('phones-nav');
206			break;
207		default:
208			menu.removeClass('mobile-nav tablets-nav');
209			menu.find('li').removeClass('mobile-group');
210			break;
211		}	
212	}
213	function demos() {
214		var demo_content_h = $('.view-demos-content').height();
215		$('.view-demos').css('margin-bottom',-demo_content_h+'px');
216		$('.view-demos .open').on('click', function() {
217	    	$('.view-demos').toggleClass('opened');
218	    })
219	}
220	/**
221	 * One page
222	 * 
223	 * @author Fox
224	 */
225	if(CMSOptions.one_page == true){
226		
227		var one_page_options = {'filter' : '.onepage'};
228		
229		if(CMSOptions.one_page_speed != undefined) one_page_options.speed = parseInt(CMSOptions.one_page_speed);
230		if(CMSOptions.one_page_easing != undefined) one_page_options.easing =  CMSOptions.one_page_easing;
231		$('#site-navigation').singlePageNav(one_page_options);
232	}
233	
234	/* Group Sub Menu */
235	function cms_mobile_menu_group(nav) {
236		nav.each(function(){
237			$(this).find('li').each(function(){
238				if($(this).find('ul:first').length > 0){
239					$(this).addClass('mobile-group');
240				}
241			});
242		});
243	}
244
245    /* CMS Gallery Popup */
246    $('.cms-gallery-item').magnificPopup({
247	  delegate: 'a.p-view', // child items selector, by clicking on it popup will open
248	  type: 'image',
249	  gallery: {
250	     enabled: true
251	  },
252	  mainClass: 'mfp-fade'
253	});
254
255    /* CMS Modal Popup */
256	$('.popup-modal').magnificPopup({
257		type: 'inline',
258		preloader: false,
259		focus: '#name',
260
261		// When elemened is focused, some mobile browsers in some cases zoom in
262		// It looks not nice, so we disable it:
263		callbacks: {
264			beforeOpen: function() {
265				if($(window).width() < 700) {
266					this.st.focus = false;
267				} else {
268					this.st.focus = '#name';
269				}
270			}
271		}
272	});
273
274	/**
275	 * Parallax.
276	 * 
277	 * @author Fox
278	 * @since 1.0.0
279	 */
280	var cms_parallax = $('.cms_parallax');
281	if(cms_parallax.length > 0){
282		cms_parallax.each(function() {
283			"use strict";
284			var speed = $(this).attr('data-speed');
285			
286			speed = (speed != undefined && speed != '') ? speed : 0.1 ;
287			
288			$(this).parallax("50%", speed);
289		});
290	}
291	
292	/** smoothscroll */
293	
294	
295	/**
296	 * Back To Top
297	 * 
298	 * @author Fox
299	 * @since 1.0.0
300	 */
301	$('body').on('click', '#back_to_top', function () {
302        $("html, body").animate({
303            scrollTop: 0
304        }, 1500);
305    });
306
307    /* Show Tooltip */
308    $('.cs-social.default [data-rel="tooltip"]').tooltip();
309    $('.single-gallery-wrap [data-rel="tooltip"]').tooltip();
310	/* Replae placeholder input mail newsletter */
311	$('#sidebar #searchform').find("input[type='text']").each(function(ev) {
312	    if(!$(this).val()) { 
313	        $(this).attr("placeholder", "Search...");
314	    }
315	});
316	$('#searchform').find("input[type='text']").each(function(ev) {
317	    if(!$(this).val()) { 
318	        $(this).attr("placeholder", "Type and hit enter ...");
319	    }
320	});
321	$('.cshero-popup-search #searchform').find("input[type='text']").each(function(ev) {
322	    if(!$(this).val()) { 
323	        $(this).attr("placeholder", "Type Words Then Press Enter To Search");
324	    }
325	});
326	/* Show or Hide Buttom  */
327	function cms_back_to_top(){
328		/* Back To Top */
329        if (scroll_top < window_height) {
330        	$('#back_to_top').addClass('off').removeClass('on');
331        } else {
332        	$('#back_to_top').removeClass('off').addClass('on');
333        }
334	}
335	
336	/* Hide search form. */
337	$(document).on('click',function(e){
338		
339		if(e.target.className == 'cshero-popup-search open')
340		
341		$('.cshero-popup-search').removeClass('open');
342    });
343
344	/**
345	 * Auto width video iframe
346	 * 
347	 * Youtube Vimeo.
348	 * @author Fox
349	 */
350	function cms_auto_video_width() {
351		$('.entry-video iframe').each(function(){
352			var v_width = $(this).width();
353			
354			v_width = v_width / (16/9);
355			$(this).attr('height',v_width + 35);
356		})
357	}	
358	/**
359	 * Enscroll
360	 * 
361	 * 
362	 * @author Fox
363	 */
364	function cms_enscroll() {
365		$('.cshero-hidden-sidebar .sidebar-inner').enscroll();
366	}
367
368	/**
369	 * Add Class
370	 * 
371	 * 
372	 * @author Fox
373	 */
374	function cms_add_class() {
375	    $(".cart-contents").on('click',function(){
376			$('.widget_shopping_cart').toggleClass('open');
377	    })
378	    $(".nav-button-icon .fa-search").on('click',function(){
379			$('.cshero-popup-search').toggleClass('open');
380	    })
381	    $(".nav-button-icon .fa-shopping-cart").on('click',function(){
382			$('.widget_shopping_cart').toggleClass('open');
383	    })
384
385	    $("#cshero-header-navigation .hidden-sidebar").on('click',function(){
386			$('.cshero-hidden-sidebar').toggleClass('open');
387			$('#cms-trust').toggleClass('hidden-sidebar-active');
388	    })
389	}
390	/* Woo - Add class */
391    $('.plus').on('click', function(){
392    	$(this).parent().find('input[type="number"]').get(0).stepUp();
393    });
394    $('.minus').on('click', function(){
395    	$(this).parent().find('input[type="number"]').get(0).stepDown();
396    });
397	/* Remove Search Popup & Hidden Sidebar */
398	$(document).on('keyup',function(evt) {
399	    if (evt.keyCode == 27) {
400	       $('.cshero-popup-search').removeClass('open');
401	       $('.cshero-hidden-sidebar').removeClass('open');
402	       $('#cms-trust').removeClass('hidden-sidebar-active');
403	    }
404	});
405	$('.sidebar-close').on('click',function(){
406    	$('.cshero-hidden-sidebar').removeClass('open');
407    	$('#cms-trust').removeClass('hidden-sidebar-active');
408    });
409});

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.