PageSourceSearch

https://aixia.it/wp-content/themes/holocron-theme/assets/js/main.js?ver=1.0.0

js aixia.it collected 2026-09-24 10:20:10 UTC 15,692 bytes, 529 lines download raw bytes

1jQuery(document).ready(function($){
2
3	cart = $('.account-metas .cart').find('sup');
4	url = window.location.href;
5	interr = url.indexOf('?add');
6	newUrl = url.substring(url, interr);
7	console.log(interr);
8	if(cart && interr != -1){
9		location.href = newUrl;
10	}
11
12 	var isMenuOpen = false;
13	var lastScroll = 0;
14
15	var post_ids = new Array();
16
17	$('.splash-slider .slick').slick({
18		dots: true,
19		intinite: true,
20		autoplay: true,
21		autoplaySpeed: 5000,
22		speed: 800, 
23		mobileFirst: true
24	});
25	//menuH = $('.mobile-menu').outerHeight();
26	var hfooter = $('footer').outerHeight();
27	var winH = $(window).height();
28	$('main').css({'min-height': winH-hfooter+1});
29
30	upperH = $('.upper-nav').outerHeight();
31	$('.account-metas').height(upperH+'px');
32
33	upperC = $('.account-metas').children('div').length;
34	$('.account-metas').children('div').each(function(){
35		$(this).height(upperH/upperC);
36	})
37
38	$('#qtranxs_select_qtranslate-chooser').children('option').each(function(){
39		text = $(this).text();
40		if(text.match('Italiano')){
41			$(this).text('IT');
42		} else if(text.match('English')){
43			$(this).text('EN');
44		}
45	});
46
47	$('.lingua').on('click', function(e){
48		e.preventDefault();
49	})
50
51	winW = $(window).width();
52	if(winW > 991){
53		$('header.start').css({'top' : '81px', 'margin-top' : '81px'});
54	}
55
56	$('.toggle-menu').on('click', function(e){
57		e.preventDefault();
58		$('.start').toggleClass('open');
59		$('body').toggleClass('noscroll');
60		$(this).toggleClass('active');
61		$('.header-container').toggleClass('open');
62		if($('.mobile-menu').find('.search').is(':visible')){
63			$('.mobile-menu').find('.search').fadeOut();
64			$('.toggle-search').removeClass('fa-times').addClass('fa-search');
65		}
66	});
67
68	console.log(isMenuOpen);
69
70	$(window).scroll(function(e){
71		resizeIframe($);
72		if(!isMenuOpen){
73			if($(document).scrollTop() > 0){
74				$('body').addClass('scrolled');
75				$('header').addClass('scrolled');
76				$('.mobile-menu').addClass('scrolled');
77			}else{
78				$('body').removeClass('scrolled');
79				$('header').removeClass('scrolled');
80				$('.mobile-menu').removeClass('scrolled');
81			}
82		}else{
83			//console.log(e);
84			$(document).scrollTop(0);
85		}
86	});
87
88	$('.menu-item-has-children').on('click', function(e){
89		if(window.innerWidth < 991){
90			
91
92			if($(this).is('.active')){
93				$(this).removeClass('active');
94			}else{
95				e.preventDefault();
96				$('.menu-item-has-children.active').removeClass('active');
97				$(this).addClass('active');
98
99			}
100		}
101	});
102
103	video = $('div.video');
104
105	/*if(video){
106		vh = video.outerHeight();
107		vw = video.outerWidth();
108		console.log('h: '+vh+', w: '+vw);
109		video.children('iframe').height(vh);
110		video.children('iframe').width(vw);
111	}*/
112
113
114	$('.press-room .section-button').on('click', function(){
115		var search = $(this).data('search');
116		console.log(search);
117		$('.article-list li').each(function(){
118			var data = $(this).data('cat');
119			if(  search == ''){
120			//if( data != search && search == ''){
121				$('.article-list li').removeClass('faded').fadeIn(300);
122			} else if(!data.match(search)){
123			//} else if(data != search){
124 				if(!$(this).hasClass('faded')){
125 					$(this).addClass('faded');
126 					$(this).fadeOut(300);
127 				}
128 			} else {
129				if($(this).hasClass('faded')){
130					$(this).removeClass('faded');
131					$(this).fadeIn(300);
132				}
133			}
134		});
135	});
136
137	/***	HEADER FADE ***/
138	$('nav.upper-nav .menu-item').hover(function(e){
139		$('nav.upper-nav .menu-item').not(this).addClass('header-fade');
140	}, function() {
141		$('nav.upper-nav .menu-item').removeClass('header-fade');
142	});
143	/***	Il lower header richiede un check dei sottomenu ***/
144	$('nav.lower-nav .menu-item-has-children').hover(function(e){
145		$(this).addClass('item-line');
146		$('nav.lower-nav .menu-item-has-children').not(this).removeClass('item-line');
147	}, function() {
148		$(this).removeClass('item-line');
149	});
150	$('nav.lower-nav .menu-item-has-children .menu-item').hover(function(e){
151		$(this).addClass('submenu-highlight');
152		$('nav.lower-nav .menu-item-has-children .menu-item').not(this).removeClass('submenu-highlight');
153	}, function() {
154		$(this).removeClass('submenu-highlight');
155	});
156
157
158
159	//$('.latest-news + .section-content .load-more, .press-room + .section-content .load-more').on('click', function(e){
160	$('.press-room .section-content .load-more').on('click', function(e){
161		e.preventDefault();
162
163		var parent = $('.press-room');//.length ? '.press-room' : '.press-room';
164
165		if(!post_ids.length){
166			parent.children('li').each(function(){
167				post_ids.push($(this).data('id'));
168			})
169		}
170		console.log(post_ids);
171		jQuery.ajax({
172			url : data.ajax_url,
173			type : 'post',
174			data : {
175				action : 'load_more',
176				type: 'post',
177				ids: post_ids
178			},
179			success : function( res ) {
180				var res = JSON.parse(res);
181
182				if(res.data.length){
183					res.data.forEach(function(post){
184						var elem = '<li class="col-md-4 box grey-overlay">';
185						elem += '<div class="content" style="background-image: url(\'' + post.thumb + '\')">';
186						elem += '<div class="overlay">';
187						elem += '<h3>' + post.title + '</h3>';
188						elem += '</div>';
189						elem += '</div>';
190						elem += '<div class="aside">';
191						elem += '<h3>' + post.title + '</h3>';
192						elem += '<a href="#">Read More</a>';
193						elem += '</div>';
194						elem += '</li>';
195						parent.append(elem);
196						post_ids.push(post.id);
197					});
198				}
199			}
200		});
201	});
202
203	resizeIframe($);
204
205	$('.sub-layer').click(function(){
206		$(this).parents('header.start').removeClass('menu-open').removeClass('active');
207		$('.toggle-menu').removeClass('active');
208		$('body').toggleClass('mm-open');
209	})
210
211
212	console.log($('header.start').attr('class'));
213	if($('header.start').hasClass('active')){
214
215	}
216
217	$('.inner-page').append('<div class="foreground"></div>');
218	$('.expandable').each(function(){
219		//initial = $(this).find('.excerpt').height();
220		// iph = $(this).find('.excerpt p').outerHeight();
221		// half = (iph / 2) - 1;
222		// console.log('iph:'+iph + ', half:' +half);
223
224		var newhtml = $(this).find('.excerpt').html().replace('<!--more-->', '<div class="fulltext">');
225		$(this).find('.excerpt').html(newhtml+'</div>');
226		//$(this).find('.excerpt').children('p').children('p').html().append('</div>');
227		//var altezzaexp = $(this).find('.excerpt').height();
228		//var nascondino = $(this).find('.fulltext').height();
229		//$(this).find('.excerpt').height(altezzaexp-nascondino);
230		//console.log(altezzaexp);
231		//console.log(nascondino);
232		$(this).children('h2').click(function(){
233			if($(this).hasClass('expanded')){
234				$(this).removeClass('expanded');
235				$(this).children('i').removeClass('fa-minus').addClass('fa-plus');
236				/*$(this).siblings('.excerpt').animate({
237					height: '-='+nascondino,
238				}, 300);*/
239				
240			} else {
241				$(this).addClass('expanded');
242				$(this).children('i').removeClass('fa-plus').addClass('fa-minus');
243				/*$(this).siblings('.excerpt').animate({
244					height: '+='+nascondino,
245				}, 300);*/
246				$('.expanded').not(this).children('i').removeClass('fa-minus').addClass('fa-plus');
247				/*$('.expanded').not(this).siblings('.excerpt').animate({
248					height: '-='+nascondino,
249				});*/
250				$('.expanded').not(this).removeClass('expanded');
251			}
252			var target_offset = $(this).offset();
253        	var target_top = target_offset.top;
254			if(winW > 991){
255				$('html, body').animate({scrollTop:target_top}, 0, 'easeInSine');
256			} else {
257				$('html, body').animate({scrollTop:target_top-90}, 0, 'easeInSine');
258			}
259
260
261		})
262
263		/*$(this).one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",
264	      	function(event) {
265	      		var target_offset = $(this).offset();
266        		var target_top = target_offset.top;
267				$('html, body').animate({scrollTop:target_top-90}, 500, 'easeInSine');
268			});
269			*/
270		/***** IMPLEMENTARE LA PREVIEW SPECIFICA ****/
271		/*$(this).find('.excerpt').height('50px');
272
273		$(this).children('h2').click(function(){
274
275			ph = $(this).siblings('.excerpt').children('p').height();
276
277			if($(this).hasClass('expanded')){
278				$(this).children('i').removeClass('fa-minus').addClass('fa-plus');
279				$(this).siblings('.excerpt').animate({
280					height: '-='+ph,
281				}, 300);
282				$(this).removeClass('expanded');
283			} else {
284				$(this).addClass('expanded');
285				$(this).children('i').removeClass('fa-plus').addClass('fa-minus');
286				$(this).siblings('.excerpt').animate({
287					height: '+='+ph,
288				}, 300);
289				$('.expanded').not(this).children('i').removeClass('fa-minus').addClass('fa-plus');
290				$('.expanded').not(this).siblings('.excerpt').animate({
291					height: '-='+ph,
292				});
293				$('.expanded').not(this).removeClass('expanded');
294			}
295		})*/
296	})
297
298	$('.close').click(function(e){
299		e.preventDefault();
300		$(this).parents('div.header-container').removeClass('open');
301		$(this).parents('header.start').removeClass('open');
302		$('.toggle-menu').toggleClass('active');
303		if($('.mobile-menu').find('.search').is(':visible')){
304			$('.mobile-menu').find('.search').fadeOut();
305			$('.toggle-search').removeClass('fa-times').addClass('fa-search');
306		}
307	})
308
309	$('.mobile-menu').find('.toggle-search').click(function(e){
310		e.preventDefault();
311		if($(this).hasClass('fa-search')){
312			$(this).removeClass('fa-search').addClass('fa-times');
313			$('.mobile-menu .search').fadeIn(300);
314			if($('.header-container').hasClass('open')){
315				$('.header-container').removeClass('open');
316				$('header.start').removeClass('open');
317				$('.toggle-menu').removeClass('active');
318			}
319		} else if ($(this).hasClass('fa-times')){
320			$(this).removeClass('fa-times').addClass('fa-search');
321			$('.mobile-menu .search').fadeOut(300);
322		}
323	});
324
325
326
327
328	$("ul.language-chooser").css({"display":"block"});
329	$("ul.language-chooser").addClass("sub-menu");
330	$("ul.language-chooser li").removeClass().addClass("menu-item");
331	$("ul.language-chooser li a").removeClass().addClass("link-lingua");
332	$("select#qtranxs_select_qtranslate-chooser").css({"display":"none"});
333
334
335
336
337	/******************************/
338
339	$('#woo-login-popup-sc-login').find('.woo-login-popup-sc-toggle').on('click', function(e){
340		e.preventDefault();
341		$('body').find('#woo-login-popup-sc-password').removeClass('unslided').addClass('slided');
342		$(this).parents('#woo-login-popup-sc-login').removeClass('slided').addClass('unslided');
343	})
344
345	$('#woo-login-popup-sc-password').find('.woo-login-popup-sc-toggle').on('click', function(e){
346		e.preventDefault();
347		$('body').find('#woo-login-popup-sc-login').removeClass('unslided').addClass('slided');
348		$(this).parents('#woo-login-popup-sc-password').removeClass('slided').addClass('unslided');
349	})
350
351	$(".email-associa").each(function(){ //ASSOCIA ACCOUNT - Richiede l'user mail
352		$(this).click(function(){
353			var email = $(this).prev("input").val();
354			$.ajax({
355	            url: data.ajax_url, 
356	            type: "POST", 
357	            //dataType: "text",
358				data: {action: "associa", "email": email},
359				success:function(result){
360				 	alert(result);
361				 	location.reload();	
362				}, error: function(jqXHR, textStatus, errorThrown)
363				{
364					alert ('Request failed: ' + errorThrown) ;
365				}
366	         });
367		});
368	});
369	$(".email-dissocia").each(function(){ //ASSOCIA ACCOUNT - Richiede l'user mail
370		$(this).click(function(){
371			var email = $(this).prev("input").val();
372			var r = confirm("Sta per dissociare l'account "+email+"\nConfermi?");
373			if (r == true) {
374			    $.ajax({
375	            url: data.ajax_url, 
376	            type: "POST", 
377	            //dataType: "text",
378				data: {action: "dissocia", "email-dissocia": email},
379				success:function(result){
380				 	alert(result);
381				 	location.reload();
382				}, error: function(jqXHR, textStatus, errorThrown)
383				{
384					alert ('Request failed: ' + errorThrown) ;
385				}
386	         });
387			} else {
388			}
389		});
390	});
391	$('input[name="ask_parent"]').each(function(){ //ASSOCIA ACCOUNT - Richiede l'user mail
392		$(this).click(function(){
393			var cf = $(this).prev('input[name="asked_parent"]').val();
394		    $.ajax({
395	            url: data.ajax_url, 
396	            type: "POST", 
397	            //dataType: "text",
398				data: {action: "richiedi_aziendale", codfisc: cf},
399				success:function(result){
400				 	alert(result);
401				 	location.reload();
402				}, error: function(jqXHR, textStatus, errorThrown)
403				{
404					alert ('Request failed: ' + errorThrown) ;
405				}
406	         });
407
408		});
409	});
410	$('input[name="undo_ask"]').each(function(){ //ASSOCIA ACCOUNT - Richiede l'user mail
411		$(this).click(function(){
412		    $.ajax({
413	            url: data.ajax_url, 
414	            type: "POST", 
415	            //dataType: "text",
416				data: {action: "annulla_aziendale"},
417				success:function(result){
418				 	alert(result);
419				 	location.reload();
420				}, error: function(jqXHR, textStatus, errorThrown)
421				{
422					alert ('Request failed: ' + errorThrown) ;
423				}
424	         });
425
426		});
427	});
428	$('input[name="accept_request"]').each(function(){ //ASSOCIA ACCOUNT - Richiede l'user mail
429		$(this).click(function(){
430			var email = $(this).prev('input[name="email"]').val();
431		    $.ajax({
432	            url: data.ajax_url, 
433	            type: "POST", 
434	            //dataType: "text",
435				data: {action: "associa", email: email},
436				success:function(result){
437				 	alert(result);
438				 	location.reload();
439				}, error: function(jqXHR, textStatus, errorThrown)
440				{
441					alert ('Request failed: ' + errorThrown) ;
442				}
443	         });
444
445		});
446	});
447	//var hheader = $('.header-container').innerHeight();
448	//$('iframe.map_embed').height(winH - (hfooter+hheader)-2);
449
450	$('#checkcodfisc').on('click', function(){
451		$('.nonitaliano').toggleClass('hidden');
452		if( $('.nonitaliano').hasClass('hidden')){
453			$('#codice_fiscale').attr('readonly', false);
454			$('#codice_fiscale').attr('required', true);
455		} else {
456			$('#codice_fiscale').attr('readonly', true);
457			$('#codice_fiscale').attr('required', false);
458			var quando = $('#birthdate').val();
459			var dove = $('#birthplace').val();
460			$('#codice_fiscale').val(quando+', '+dove); 
461		}
462	});
463	$('.birth').on('input update propertychange', function(){
464		var quando = $('#birthdate').val();
465		var dove = $('#birthplace').val();
466		$('#codice_fiscale').val(quando+', '+dove); 
467	});
468	$(window).resize(function(){
469		var hfooter = $('footer').outerHeight();
470		var winH = $(window).height();
471		$('main').css({'min-height': winH-hfooter+1});
472		//var hheader = $('.header-container').innerHeight();
473		//$('iframe.map_embed').height(winH - (hfooter+hheader)-2);
474
475
476
477		winW = jQuery(window).width();
478		if(winW > 991){
479			jQuery('header.start').css({'top' : '81px', 'margin-top' : '81px'});
480		} else {
481			jQuery('header.start').css({'top' : '', 'margin-top' : ''});
482		}
483
484		upperH = jQuery('.upper-nav').outerHeight();
485		jQuery('.account-metas').height(upperH+'px');
486
487		video = jQuery('div.video');
488		$('.splash-slider .slick').slick('resize');
489
490		/*if(video){
491			vh = video.outerHeight();
492			vw = video.outerWidth();
493			console.log('h: '+vh+', w: '+vw);
494			video.children('iframe').height(vh);
495			video.children('iframe').width(vw);
496		}*/
497	});
498	$('.article-list').infiniteScroll({
499	  path: 'page/{{#}}/',
500	  append: 'li.box',
501	  history: false,
502	  hideNav: '.pagination'
503	});
504	/*$('div.download-files').accordion({
505		collapsible: true,
506		heightStyle: "content"
507	});*/
508	$('.table-responsive').basictable({breakpoint: 990,});
509	$(document).on('click', '#menu-upper-menu .menu-item', function() {
510		window.location.href = $(this).find('a').first().attr('href');
511	});
512});
513
514
515
516function resizeIframe($){
517	if($('.single-news').length){
518		var iframeW = $('iframe').width();
519		var iframeH = $('iframe').height();
520		var iFrameRatio = iframeW / iframeH;
521		var maxWidth = $('article').width();
522		/*$('iframe').css({
523			width: maxWidth,
524			height: maxWidth / iFrameRatio
525		});*/
526		$('iframe.map_embed').attr('style', '');
527		//$('div.video > iframe').attr('style', '');
528	}
529}

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.