PageSourceSearch

https://www.museonicolis.com/html/themes/galleria-metropolia/galle…/lu/lu_functions.js?ver=39363106404

js museonicolis.com collected 2026-09-24 20:44:34 UTC 10,702 bytes, 326 lines download raw bytes

1// document ready
2jQuery( function ( $ ) {
3    'use strict';
4
5    console.log("LU fn  ", lu_vars)
6
7	if($(".link-gallery").length) {
8        $(".link-gallery a").click(function(e){
9            $('.lu-hide-image').each(function(){
10                $(this).removeClass("lu-hide-image")
11                $(".link-gallery").hide()
12            })
13            e.preventDefault();
14        })
15    }
16
17	if($(".lu-leggi-tutto").length) {
18        $(".lu-leggi-tutto").click(function(e){
19            $('.lu-hide-content').removeClass("lu-hide-content")
20            //$('.lu-excerpt').addClass("lu-hide-excerpt")
21            $(".lu-leggi-tutto").hide()
22            e.preventDefault();
23        })
24    }
25
26	// Fixed element - tabella laterale
27    if($(".col-tabella-inner").length) {
28        var $el = $('.col-tabella-inner');
29
30        //$el.append("<p id='debugs'></p>")
31
32        $(window).scroll(function (e) {
33
34            var isPositionFixed = ($el.hasClass('col-tabella-fixed'));
35            var topLimit = 938
36            var bottomLimit = 2200
37
38            //$('#debugs').html($(this).scrollTop())
39
40            //console.log($(this).scrollTop())
41            if ($(this).scrollTop() > topLimit
42                && $(this).scrollTop() < bottomLimit
43            //    && !isPositionFixed
44            ) {
45                $el.addClass('col-tabella-fixed');
46            }
47            if (
48                $(this).scrollTop() > topLimit
49                && $(this).scrollTop() > bottomLimit && isPositionFixed) {
50                console.log("removeClass fixed")
51                $el.removeClass('col-tabella-fixed');
52            }
53
54            if (
55                $(this).scrollTop() < topLimit
56                && isPositionFixed
57            ) {
58                $el.removeClass('col-tabella-fixed');
59            }
60        });
61    }
62
63    $( "#select-filter-query" ).change(function() {
64        console.log("selected changed ");
65
66        $( "select option:selected" ).each(function() {
67            var selected = $( this ).val();
68            if (selected == "") {return}
69            console.log("selected: " + selected);
70
71            var url = updateQueryStringParameter("acf_order", selected)
72
73            // Naviga
74            window.location.href = url;
75
76        });
77
78    });
79
80    // Fix title gallery
81
82    /*
83    $('.gallery-item ').each(function(){
84        var title = $(this).attr("title")
85        console.log(title)
86        setTimeout(function(){
87            var element = $(this).find('.swipebox')
88            element.prop("title", title)
89
90            var title2 = element.attr("title")
91            console.log("title2: " + title2)
92        }, 500)
93
94    })
95*/
96
97
98
99    setTimeout(function($this){
100        $('.gallery-item a').each(function() {
101            var title = $(this).attr("title")
102            console.log("remnove REL attribute: " + title)
103            var $this = $(this)
104            $this.removeAttr('rel');
105        })
106    }, 2500)
107
108
109    //
110    $('.button-invia-dati-card').click(function(e) {
111
112        var idutente = $(this).data('idutente');
113
114        console.log("button-invia-dati-card")
115
116        $(this).append("<b id='sendmailSpinner' class='blink_me'><br>Invio in corso</b>")
117
118        e.preventDefault();
119        //return;
120            $.ajax({
121                type: "POST",
122                url: lu_vars.ajaxurl,
123                data: {
124                    action: 'lu_invia_dati_card_callback', // è il nome della funzione da chiamare in PHP con davanti ”wp_ajax_”!
125                    idutente: idutente,
126                    _nonce: lu_vars.nonce
127                },
128                success: function(res) {
129                    console.log("successo!", res);
130                    var res_decode = JSON.parse(res)
131
132                    $('#sendmailSpinner').remove()
133
134                    if (res_decode.error) {
135                        $('.esito_invio_email').html("Email non inviata a causa di un errore")
136                        $('.esito_invio_email').addClass("error")
137                    } else {
138                        $('.esito_invio_email').html("Email inviata correttamente")
139                    }
140                }
141            });
142
143
144    })
145
146    /*
147    // fix menù che non funziona senza le librerie js del ilightbox del tema
148    $('.responsive_nav ').click(function() {
149        return false;
150        if ($(this).hasClass("active")) {
151            $(this).removeClass("active")
152
153            $('.mid_nav_wrap > nav').css("display", "")
154        } else {
155            $(this).addClass("active")
156            $('.mid_nav_wrap > nav').css("display", "block")
157        }
158    })
159
160     */
161
162    // anti click multiplo
163    $('#lu_card_invio_massivo_email').click(function () {
164        //$(this).prop("disabled", true);
165    })
166
167    /* Bottone Redondo 09.2025*/
168    setTimeout(hideRegiondoButton, 5000)
169
170    $('.regiondo-link, #slider-1-slide-1-layer-33,  #slider-2-slide-2-layer-33,  #slider-3-slide-3-layer-33').
170click(function(e){
171        console.log("regiondo-link")
172        if(!$('.regiondo-button-widget').length) {
173            console.log("regiondo-link - pulsate non trovato")
174        }
175
176        $('.regiondo-button-widget').click()
177        $('.regiondo-dialog').show()
178
179        // Usalo così
180        clickRegiondoButton();
181
182        e.preventDefault()
183    })
184
185	// Traduci il form 
186	 // Verifica se la variabile lu_vars.current_language è "en"
187    if (typeof lu_vars !== 'undefined' && lu_vars.current_lang === 'en') {
188        console.log("traduci il form ")
189		
190		$('.wpcf7.js').attr('lang', "en-EN");
191		
192		// Nascondi tutte le label che hanno data-id o data-de
193        $('label[data-it], label[data-de]').hide();
194		$('.wpcf7-list-item-label:contains("Accetto")').text('I agree');
195		$('.wpcf7-list-item-label:contains("Acconsento")').text('I agree');
196		$('.wpcf7-list-item-label:contains("Non acconsento")').text('I do not agree');
197		$('.wpcf7-submit[value="Invia"]').val('Send');
198		
199        // Itera tra tutti i campi label che contengono uno span con data-en
200        $('label:has(span[data-en])').each(function() {
201            var $label = $(this);
202            
203            // Trova lo span con data-en all'interno del label
204            var $spanEn = $label.find('span[data-en]');
205            
206            // Prendi il valore di data-en
207            var enValue = $spanEn.attr('data-en');
208            
209            // Riscrivi il contenuto text dello span con il valore di data-en
210            if (enValue) {
211                $spanEn.text(enValue);
212            }
213        });
214    } else if (typeof lu_vars !== 'undefined' && lu_vars.current_lang === 'de') {
215        console.log("traduci il form DE")
216		
217		$('.wpcf7.js').attr('lang', "de-DE");
218		
219		// Nascondi tutte le label che hanno data-id o data-de
220        $('label[data-it], label[data-en]').hide();
221		$('.wpcf7-list-item-label:contains("Accetto")').text('Ich akzeptiere');
222		$('.wpcf7-list-item-label:contains("Acconsento")').text('Ich akzeptiere');
223		$('.wpcf7-list-item-label:contains("Non acconsento")').text('Nein, ich akzeptiere das nicht.');
224		$('.wpcf7-submit[value="Invia"]').val('Schicken');
225		
226        // Itera tra tutti i campi label che contengono uno span con data-en
227        $('label:has(span[data-de])').each(function() {
228            var $label = $(this);
229            
230            // Trova lo span con data-en all'interno del label
231            var $spanDe = $label.find('span[data-de]');
232            
233            // Prendi il valore di data-en
234            var deValue = $spanDe.attr('data-de');
235            
236            // Riscrivi il contenuto text dello span con il valore di data-en
237            if (deValue) {
238                $spanDe.text(deValue);
239            }
240        });
241    } else {
242		$('label[data-de], label[data-en]').hide();
243	}
244
245	
246});
247
248function updateQueryStringParameter(key, value, uri) {
249    if (!uri) uri = window.location.href
250
251    var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
252    var separator = uri.indexOf('?') !== -1 ? "&" : "?";
253    if (uri.match(re)) {
254        return uri.replace(re, '$1' + key + "=" + value + '$2');
255    }
256    else {
257        return uri + separator + key + "=" + value;
258    }
259}
260
261function lu_getyourguide_btn_action() {
262    console.log("lu_getyourguide_btn_action")
263    //https://dev-museonicolis.leaduser.it/?tck=4df39f99-35b4-4ad3-8f95-eb09ea486793
264    //https://www.museonicolis.com/?tck=4df39f99-35b4-4ad3-8f95-eb09ea486793
265    var  uri = window.location.href
266    window.location.href= uri + '/?tck=4df39f99-35b4-4ad3-8f95-eb09ea486793'
267    return false;
268}
269
270/*************/
271function clickRegiondoButton() {
272    // Trova tutti gli elementi che hanno shadow root
273    const allElements = document.querySelectorAll('*');
274
275    for (let element of allElements) {
276        if (element.shadowRoot) {
277            try {
278                // Cerca il pulsante nello shadow DOM
279                const regiondoButton = element.shadowRoot.querySelector('.regiondo-button-widget');
280                if (regiondoButton) {
281                    console.log('✅ Pulsante trovato nello shadow DOM!', regiondoButton);
282
283                    // Simula il click
284                    regiondoButton.click();
285                    console.log('Click simulato con successo!');
286                    return true;
287                }
288            } catch (e) {
289                console.log('Errore accesso shadow:', e);
290            }
291        }
292    }
293
294    console.log('Pulsante non trovato');
295    return false;
296}
297
298function hideRegiondoButton() {
299    // Trova tutti gli shadow host
300    const allElements = document.querySelectorAll('*');
301
302    for (let element of allElements) {
303        if (element.shadowRoot) {
304            try {
305                const regiondoButton = element.shadowRoot.querySelector('.regiondo-button-widget');
306                if (regiondoButton) {
307                    console.log('✅ Pulsante trovato, nascondo...', regiondoButton);
308
309                    // Nascondi con CSS
310                    regiondoButton.style.display = 'none';
311                    // oppure:
312                    // regiondoButton.style.visibility = 'hidden';
313                    // regiondoButton.style.opacity = '0';
314
315                    console.log('✅ Pulsante nascosto!');
316                    return true;
317                }
318            } catch (e) {
319                console.log('Errore accesso shadow:', e);
320            }
321        }
322    }
323
324    console.log('Pulsante non trovato');
325    return false;
326}

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.