PageSourceSearch

https://www.visititaly.eu/js/js_viste/experience.js

js visititaly.eu collected 2026-09-24 18:12:45 UTC 7,326 bytes, 261 lines download raw bytes

1function InitGallery(){
2    (($ => {
3    /*
4	Thumb Gallery
5	*/
6    theme.fn.intObs( '.thumb-gallery-wrapper', function(){
7        const $thumbGalleryDetail = $(this).find('.thumb-gallery-detail');
8        const $thumbGalleryThumbs = $(this).find('.thumb-gallery-thumbs');
9        let flag = false;
10        const duration = 300;
11
12        $thumbGalleryDetail
13			.owlCarousel({
14				items: 1,
15				margin: 10,
16				nav: true,
17				dots: false,
18				loop: false,
19				autoHeight: true,
20				navText: [],
21				rtl: ( $('html').attr('dir') == 'rtl' ) ? true : false
22			})
23			.on('changed.owl.carousel', ({item}) => {
24				if (!flag) {
25					flag = true;
26					$thumbGalleryThumbs.trigger('to.owl.carousel', [item.index-1, duration, true]);
27
28					$thumbGalleryThumbs.find('.owl-item').removeClass('selected');
29					$thumbGalleryThumbs.find('.owl-item').eq( item.index ).addClass('selected');
30					flag = false;
31				}
32			});
33
34
35        $thumbGalleryThumbs
36			.owlCarousel({
37				margin: 15,
38				items: $(this).data('thumbs-items') ? $(this).data('thumbs-items') : 4,
39				nav: false,
40				center: $(this).data('thumbs-center') ? true : false,
41				dots: false,
42				rtl: ( $('html').attr('dir') == 'rtl' ) ? true : false
43			})
44			.on('click', '.owl-item', function() {
45				$thumbGalleryDetail.trigger('to.owl.carousel', [$(this).index(), duration, true]);
46			})
47			.on('changed.owl.carousel', ({item}) => {
48				if (!flag) {
49					flag = true;
50					$thumbGalleryDetail.trigger('to.owl.carousel', [item.index, duration, true]);
51					flag = false;
52				}
53			});
54
55        $thumbGalleryThumbs.find('.owl-item').eq(0).addClass('selected');
56    }, {});
57})).apply(this, [jQuery]);
58}
59
60function GetExperienceTiq(categoria, contId){
61	  // Avvia le altre ricerche
62        Promise.all([
63          GetListaProdottiTiq("", "popularity%20desc", "", categoria, ""),
64        ]).then(results => {
65          
66          const nessunRisultatoTiq = !ticket_array || (Array.isArray(ticket_array) && ticket_array.length === 0);
67
68          if (nessunRisultatoTiq && nessunRisultatoExp && nessunRisultato && nessunRisultatoExpInterne) {
69            $('.skeleton_loader').hide();
70            $('.ricerca_nulla').show();
71            return;
72          }
73
74
75          // Unifica gli array se presenti
76          const tuttiRisultati = [
77            ...(Array.isArray(ticket_array) ? ticket_array : [])
78          ];
79
80          const sortByPopularity = (a, b) => {
81            // Priorità per promo_label "bestseller"
82            const aPromo = a.promo_label === "bestseller" ? 1 : 0;
83            const bPromo = b.promo_label === "bestseller" ? 1 : 0;
84
85            // Confronto per promo_label
86            if (aPromo !== bPromo) return bPromo - aPromo;
87            return bPromo - aPromo;
88            // Confronto per ratings (null o stringhe gestite come 0)
89            // const aRating = parseFloat(a.ratings) || 0;
90            // const bRating = parseFloat(b.ratings) || 0;
91
92            // return bRating - aRating;
93          };
94
95          // Applica l'ordinamento all'array dei prodotti
96         // const risultatiOrdinati = tuttiRisultati.sort(sortByPopularity);
97		if (contId!="#experience_cont") {
98			var templateId ='#cont_ticket';
99				var dataType ='ticket';
100		}	
101			
102	
103          renderMustache(tuttiRisultati,contId,templateId,dataType);
104
105        });
106}
107
108function renderMustache(data, contId = '#experience_cont', templateId = '#cont_experience', dataType = 'experience') {
109  const template = $(templateId).html();
110  const rendered = Mustache.render(template, { [dataType] : data });
111  $(contId+"_section").show();
112  $(contId).html(rendered);
113  $('.skeleton_loader').hide();
114}
115
116function GetExperience(parola_chiave,id_regione,id_categoria,id_tags){
117
118	var lingua = $('#lingua').val();
119	var sezione = $('#sezione').val();
120	var sezione2 = $('#sezione').val();
121	var id_regione2 = $('#id_regione_tickets').val();
122  
123	if ((id_regione==undefined || id_regione=="") && sezione2!="risultati") {
124	 var id_regione = id_regione2;
125	}
126	
127	let page_size = Number($('#page_size').val());
128	let page = Number($('#page').val());
129
130	if (!page_size) page_size = 12;
131	if (!page) page = 0;
132
133	if (sezione=="risultati") {
134		page = 0;
135	}
136  
137	if (parola_chiave!="" && query!="") {
138	  var query = parola_chiave;
139	  var sort = sort;
140	}else{
141	  var query = $('#headerSearch3').val();
142	  var sort = $('#sort_filter').val();
143	}
144	return new Promise((resolve) => {
145	$.ajax({
146	  type: "POST",
147	  url: "https://admin.visititaly.eu/controller/experience.controller.php?act=get_experience",
148	  data: {c_visit:"visititaly",lingua:lingua,query:query,id_regione:id_regione,page:page,page_size:page_size,id_categoria,id_tags,sezione},
149	  cache: false,
150	  dataType: "json",
151	  success: function(obj){
152  
153		$(".loader").hide();
154		$(".loader-tickets").hide();
155   
156		if (obj.products.length>0) {
157			$("#experience_cont").show();
158
159			if (sezione!="risultati") {
160				$('.skeleton_loader').hide();
161			}
162
163			$("#no_result_cont").hide();
164			if(obj.products.length>9){
165				$("#btn-experience-all").show();
166			}
167			$("#cont_experience_main").show();
168			
169
170		  if ((sezione=="risultati" || sezione=="regione" || sezione=="top-destinations") && parola_chiave!="") {
171			//  $("#bottone_experience").show();
172			 experience_array = obj.products;
173		  }else{
174			
175			var targetContainer2 = $("#experience_cont"),template2 = $("#cont_experience").html();
176			$(targetContainer2).html("");
177			$(targetContainer2).html(Mustache.to_html(template2, { "experience" :  obj.products }));
178			
179			$("#titolo_all_experience").show();
180		  }
181
182		  
183		  
184		  resolve(true);
185		}else{
186  
187		  if (sezione!="risultati") {
188		 	$("#no_result_cont").show();
189			$("#experience_cont").hide();
190			$('.skeleton_loader').hide();
191			$("#cont_experience_main").hide();
192		  }
193		 
194		  resolve(false);
195		}
196  
197		if (parola_chiave!="" && sort!="") {
198		   $("#btn_experience").show()
199  
200		   $(".count_experience").html(obj.products.length)
201		}
202	   
203  
204	  },
205      error: function () {
206        resolve(false);
207      }
208	});
209});
210  
211  
212  }
213
214function LoadMore(){
215
216    var lingua = $('#lingua').val();
217    var id_regione = $('#id_regione_tickets').val();
218    var sezione = $('#sezione').val();
219    var query = $('#headerSearch3').val();
220    var sort = $('#sort_filter').val();
221
222    var page_size = Number($('#page_size').val());
223    var page = Number($('#page').val());
224
225	const id_categoria = selectedCategoria;
226
227    page= page +12
228    
229    if (lingua=="it" || lingua=="ita") {
230      var load_more="Carica altro";
231      var caricamento="Carico altre esperienze...";
232    }else{
233      var load_more="Load More";
234      var caricamento="Loading more experience...";
235    }
236
237	$("#page_size").val(page_size);
238	$("#page").val(page);
239
240	$.ajax({
241		url: "https://admin.visititaly.eu/controller/experience.controller.php",
242		data: {c_visit:"visititaly",lingua:lingua,act:"get_experience",query:query,sort:sort,id_regione:id_regione,page:page,page_size:page_size,id_categoria},
243		type: "GET",
244		cache: false,
245		dataType: "json",
246		beforeSend:function(){
247			$(".load-more").text(caricamento);
248		},
249		success: function(obj){
250
251			if (obj.products.length>0) {
252
253				var template = $("#cont_experience").html();
254				$("#experience_cont").append(Mustache.to_html(template,  { "experience" :  obj.products }));
255				$(".load-more").text(load_more);
256				 $('.skeleton_loader').hide();
257					
258			}
259		}
260	});
261}

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.