PageSourceSearch

https://www.gruppopoli.it/scripts/myScript.js

js gruppopoli.it collected 2026-10-02 11:13:07 UTC 24,037 bytes, 607 lines download raw bytes

1$(document).ready(function () {
2
3    $("#anniversario20anni a").click(function (eve) {
4        eve.preventDefault();
5        hrefRedirect_sliderhome1 = $(this).attr("href");
6        /*gtag('event', 'click', {
7            'event_category': 'anniversario20anni',
8            'event_label': "Click box home",
9            'event_callback': gaHitCallbackHandler_sliderhome1
10        });*/
11        dataLayer.push({
12            'event': 'Click box home',
13            'event_category': 'anniversario20anni',
14            'eventCallback': function () {
15                gaHitCallbackHandler_sliderhome1();
16            },
17        });
18    });
19
20    SetLayout();
21    autosize($('.autosize'));
22    //$('.importo-decimale').number(true, 2,'.','');
23
24    // Comportamento menu mobile (doppio click per voci cliccabili, aggiunta dello stesso link nella lista dei figli)
25    if (window.innerWidth <= 991.98) {
26        $('#menu-principale').find('li.li_liv_1').each(function () {
27            if ($(this).children().length > 1 && $(this).has('ul')) {
28                var anchor = $(this).find('a.link_liv_1');
29                anchor.each(function () {
30                    if (!$(this).attr('href').includes('javascript')) {
31                        $(this).attr('data-times', '0');
32                        if (window.innerWidth <= 767.98 && $(this).next().is('ul')) {
33                            var counter = 0;
34                            var tmpLi = '<li class="espandi hafigli first espandi_sottopagine li_placeholder_menu"><a class="link_liv_2" href="' + $(this).attr('href') + '" title="' + $(this).attr('title') + '" target="_self">' + $(this).text() + '</a></li>';
35                            if (counter === 0) {
36                                $(this).next().prepend(tmpLi);
37                                counter++;
38                            }
39                        }
40                        $(this).on('click', function (e) {
41                            anchor.not($(this)).attr('data-times', '0');
42                            anchor.not($(this)).parent().removeClass('hover');
43                            if ($(this).attr('data-times') == '0' && $(this).next().is('ul')) {
44                                e.preventDefault();
45                                e.stopImmediatePropagation();
46                                $(this).attr('data-times', '1');
47                                $(this).parent().addClass('hover');
48                            } else if ($(this).attr('data-times') == '0' && $(this).parent().children().length <= 1) {
49                                $(this).trigger('click');
50                            } else if ($(this).attr('data-times') == '1') {
51                                window.location.href = $(this).attr('href');
52                                $(this).attr('data-times', '0');
53                            }
54                        });
55                    }
56                });
57            }
58        });
59    }
60
61    // light box
62    $('.boxGalleryPagina').magnificPopup({
63        delegate: 'a',
64        type: 'image',
65        tLoading: 'Loading image...',
66        mainClass: 'mfp-img-mobile',
67        gallery: {
68            enabled: true,
69            navigateByImgClick: true,
70            preload: [0, 1]
71        },
72        image: {
73            tError: 'Loading failed!',
74            titleSrc: function (item) {
75                return item.el.attr('title');
76            }
77        },
78        callbacks: {
79            markupParse: function (template, values, item) {
80                values.counter = item.el.attr("data-foto-index"); // nel link inserire data-foto-index="<%=counter %> / <%=mGallery.Count %>"
81            }
82        }
83    });
84
85    $("#menu-principale-button").click(function (eve) {
86        eve.stopPropagation();
87        if ($("#menu-principale-button .hamburger").hasClass("is-active")) {
88            $("#menu-principale-button .hamburger").removeClass("is-active");
89            $("#menu-principale-container").removeClass("is-active");
90            $("#master").removeClass("menu-active");
91            $("body").removeClass("zoho-hide");
92            $("#menu-principale-tendine").hide();
93        } else {
94            $("#menu-principale-button .hamburger").addClass("is-active");
95            $("#menu-principale-container").addClass("is-active");
96            $("#master").addClass("menu-active");
97            $("body").addClass("zoho-hide");
98        }
99    });
100
101    $("body").click(function (event) {
102        if ($("#menu-principale-button .hamburger").hasClass("is-active")) {
103            if ($(event.target).closest('#menu-principale-container,#header').length == 0) {
104                $("#menu-principale-button").click();
105            }
106        }
107    });
108
109    $("#cmdLogout").click(function () {
110        $(this).find("button").click();
111    });
112
113    //Se si vuole inserire le freccie all'interno dell'immagine nella gallery fluida inserire queste righe dopo image
114    /*,
115        callbacks: {
116            buildControls: function() {
117                // re-appends controls inside the main container
118                try{
119                    this.contentContainer.append(this.arrowLeft.add(this.arrowRight));
120                }catch(err){
121                    console.log(err);
122                }
123            }
124        }
125    */
126
127    //Per inserire un video in light box fluido
128    /*
129        $('.popup-youtube').magnificPopup({
130              disableOn: 200,
131              type: 'iframe',
132              mainClass: 'mfp-fade',
133              removalDelay: 160,
134              preloader: false,
135              fixedContentPos: false
136         });
137    */
138
139    // form
140    $(".boxForm.versioneContratta .inputForm, .boxForm.versioneContratta .textareaForm").focusin(function () {
141        $(this).addClass("focused");
142    });
143    $(".boxForm.versioneContratta .inputForm, .boxForm.versioneContratta .textareaForm").focusout(function () {
144        if ($(this).val() == "") {
145            $(this).removeClass("focused");
146        }
147    });
148
149    $(".boxForm.versioneContratta .inputForm, .boxForm.versioneContratta .textareaForm").each(function () {
150        var inputSel = $(this);
151        if (inputSel.val() != "") {
152            inputSel.addClass("focused");
153        }
154    });
155
156    // calendar
157    $(".date-arrivo").datepicker({
158        dateFormat: "dd/mm/yy",
159        onSelect: function (dateText, inst) {
160            var date = $('.date-arrivo').datepicker('getDate', '+1d');
161            date.setDate(date.getDate() + 7);
162            $('.date-partenza').datepicker('setDate', date);
163        }
164    }, $.datepicker.regional['it']);
165
166    $(".date-partenza").datepicker({
167        dateFormat: "dd/mm/yy",
168        onSelect: function (dateText, inst) {
169            if ($('.date-arrivo').val() == "") {
170                var date = $('.date-partenza').datepicker('getDate', '+1d');
171                date.setDate(date.getDate() - 7);
172                $('.date-arrivo').datepicker('setDate', date);
173            }
174        }
175    }, $.datepicker.regional['it']);
176
177    $('.icon-calendar').click(function (e) {
178        $(".date-arrivo, .date-partenza").datepicker("hide");
179        $(this).parent().find(".input").datepicker("show");
180    });
181
182    $(".calendar_year").datepicker({
183        dateFormat: "dd/mm/yy",
184        changeYear: true,
185        changeMonth: true
186    }, $.datepicker.regional['it']);
187
188    // scrolls
189    var scrollOffsetDefault = -85;
190    $('.scroll-to-testata').click(function (e) {
191        e.preventDefault();
192        var offset = $('#master').attr('data-testata-type') == "mobile" ? -65 : scrollOffsetDefault;
193        $('html,body').stop(true, false).animate({ scrollTop: $("#fascia-testata").offset().top }, 800).promise().then(function () { });
194    });
195
196    $('.scroll-to-content').click(function (e) {
197        e.preventDefault();
198        var offset = $('#master').attr('data-testata-type') == "mobile" ? -65 : scrollOffsetDefault;
199        $('html,body').stop(true, false).animate({ scrollTop: $(".fascia-content").offset().top + offset }, 800).promise().then(function () { });
200    });
201
202    $('.scroll-to-camere').click(function (e) {
203        e.preventDefault();
204        var offset = $('#master').attr('data-testata-type') == "mobile" ? -65 : scrollOffsetDefault;
205        $('html,body').stop(true, false).animate({ scrollTop: $(".listato-camere").offset().top + offset }, 800).promise().then(function () { });
206    });
207
208    $('.scroll-to-form').click(function (e) {
209        var ancoraScrollForm = $(".ancora-scroll-form");
210        if (ancoraScrollForm.length > 0) {
211            e.preventDefault();
212            var offset = $('#master').attr('data-testata-type') == "mobile" ? -65 : scrollOffsetDefault;
213            $('html,body').stop(true, false).animate({ scrollTop: ancoraScrollForm.offset().top + offset }, 800).promise().then(function () { });
214        }
215    });
216
217    if ($(window).outerWidth() > 991.98) {
218        $(".menu-principale > li").hover(function () {
219            $(".menu-principale > li").removeClass("hover");
220            $(this).addClass("hover");
221        }, function () {
222            $(".menu-principale > li").removeClass("hover");
223        });
224    } else {
225        $(".menu-principale").click(function (e) {
226            if ($(e.target).is("li") || $(e.target).is("a")) {
227                $(".menu-principale > li").removeClass("hover");
228                if ($(e.target).is("li")) {
229                    $(e.target).addClass("hover");
230                } else {
231                    $(e.target).parent().addClass("hover");
232                }
233            } else {
234                $(".menu-principale > li").removeClass("hover");
235            }
236        });
237    }
238
239    var timeoutMenuLiv2 = null;
240    $(".menu-principale > li").hover(function () {
241        $("#menu-principale-tendine .menu-principale_liv2").removeClass("hover");
242        
243        if ($(this).find(".menu-principale_liv2")) {
244            $(this).find(".menu-principale_liv2").appendTo("#menu-principale-tendine-content");
245        }
246        var tendina = $("#tendina_" + $(this).attr("id").split('_')[2] + ",#menu-formstendina_" + $(this).attr("id").split('_')[2]);
247        if (tendina.length) {
248            $("#menu-principale-tendine").show();
249            
250            setTimeout(function () {
251                tendina.addClass("hover");
252            }, 1);
253        }
254        //$(".menu-principale_liv2-container").addClass("hover");
255    }, function () {
256        /*timeoutMenuLiv2 =setTimeout(function () {
257            $("#menu-principale-tendine .menu-principale_liv2").removeClass("hover");
258        }, 50);*/
259        //$(".menu-principale_liv2-container").removeClass("hover");
260    });
261
262    /*$(".menu-principale_liv2").hover(function () {
263        if (timeoutMenuLiv2 != null) clearTimeout(timeoutMenuLiv2);
264    }, function () {
265        timeoutMenuLiv2 =setTimeout(function () {
266            $("#menu-principale-tendine .menu-principale_liv2").removeClass("hover");
267        }, 50);
268        //$(".menu-principale_liv2-container").removeClass("hover");
269    });*/
270
271    var scrollingHomeMenu = false;
272    $("#menu-home a").hover(function () {
273        $("#menu-home").addClass("hover");
274    }, function () {
275        $("#menu-home").removeClass("hover");
276    });
277    $("#menu-home a").click(function (ev) {
278        var elem = $(this);
279        /*gtag('event', 'click', {
280            'event_category': 'Menu Home',
281            'event_label': elem.html()
282        });*/
283        dataLayer.push({
284            'event': 'click',
285            'event_category': 'Menu Home',
286            'event_label': elem.html()
287        });
288
289        if ($(this).attr("href") == "javascript:void(0);") {
290            ev.preventDefault();
291            var FixedHeaderHeight = $("#header").outerHeight() - 1;
292            $("#menu-home a").removeClass("selected");
293            $(this).addClass("selected");
294            var offsetTop = $(".band[data-band='" + $(this).data("band") + "']").offset().top;
295            scrollingHomeMenu = true;
296            $('html,body').stop(true, false).animate({ scrollTop: offsetTop - FixedHeaderHeight }, 800).promise().then(function () { scrollingHomeMenu = false; });
297        }
298    });
299
300    $(window).on('scroll', function () {
301        if (!scrollingHomeMenu) {
302            $(".band").each(function () {
303                if ($(this).is_on_screen() && $("#menu-home a[data-band='" + $(this).data("band") + "']").length > 0) {
304                    $("#menu-home a").removeClass("selected");
305                    $("#menu-home a[data-band='" + $(this).data("band") + "']").addClass("selected");
306                }
307            });
308        }
309        if ($(window).scrollTop() > $(window).height()) {
310            $("#arrow-up-site").fadeIn();
311        } else {
312            $("#arrow-up-site").fadeOut();
313        }
314
315        /*if ($(window).scrollTop() + $("#header").height() > $("#band-top-bk-testata").height()) {
316            $("#anniversario20anni").addClass("hidden");
317        } else {
318            $("#anniversario20anni").removeClass("hidden");
319        }*/
320    });
321
322    ControlCheckbox();
323    $(".CheckBox").click(function () {
324        ControlCheckbox();
325    });
326    ControlRadioButton();
327    $(".RadioButton").click(function () {
328        ControlRadioButton();
329    });
330    ControlRadioButtonList();
331    $(".RadioButtonList label").click(function () {
332        ControlRadioButtonList();
333    });
334
335    $(".numero-duplicard").on("input", function () {
336        if ($(this).val().length > $(this).attr("maxLength"))
337            $(this).val($(this).val().slice(0, $(this).attr("maxLength")));
338    });
339
340    InizializzaLoginEMenuUtente();
341
342    IsotopePackery();
343
344    setTimeout(function () {
345        $("#IsotopePackeryFixer").show();
346        IsotopePackery();
347    }, 10);
348
349    $("#band-app-image a").click(function () {
350        $("#popup_video_app .content_video").html("<iframe width=\"100%\" height=\"450\" src=\"" + $(this).data("video") + "\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>");
351
352        $("#popup_video_app").show();
353    });
354    $("#popup_video_app_chiudi").click(function () {
355        $("#popup_video_app").fadeOut(function () {
356            $("#popup_video_app .content_video").html("");
357        });
358    });
359    $(".popup_v2_close").click(function () {
360        $(this).parents(".popup_v2_container").fadeOut();
361    });
362    $(".popup_v2_container").click(function (e) {
363        if ($(e.target).closest(".popup_v2_content").length > 0) {
364            return true;
365        }
366        $(this).fadeOut();
367    });
368
369    if (isDesktop) {
370        $("input[type='number']").on("keypress", isNumberKey);
371        $("input[type='number']").removeAttr("type");
372    }
373
374    $("input.TextBox,textarea.TextBox").wrap("<div class='TextBox-Content'></div>");
375    $(".TextBox-Content").wrap("<div class='TextBox'></div>");
376    $("input.TextBox,textarea.TextBox").removeClass("TextBox");
377
378    $("#arrow-up-site").click(function () {
379        $("html, body").animate({ scrollTop: 0 }, 1000);
380    });
381
382    $('.band-sliderhome1').on('click', '.overlink', function (eve) {
383        eve.preventDefault();
384        hrefRedirect_sliderhome1 = $(this).attr("href");
385
386        /*gtag('event', 'click', {
387            'event_category': stripHtml($(this).parents(".band-sliderhome1").find(".band-sliderhome1-titolo").html()),
388            'event_label': stripHtml($(this).parents(".rotator-template1-item").find(".rotator-template1-item-title").html()),
389            'event_callback': gaHitCallbackHandler_sliderhome1
390        });*/
391
392        dataLayer.push({
393            'event': 'click',
394            'event_category': stripHtml($(this).parents(".band-sliderhome1").find(".band-sliderhome1-titolo").html()),
395            'event_label': stripHtml($(this).parents(".rotator-template1-item").find(".rotator-template1-item-title").html()),
396            'eventCallback': function () {
397                gaHitCallbackHandler_sliderhome1();
398            },
399        });
400    });
401});
402
403var hrefRedirect_sliderhome1 = "";
404gaHitCallbackHandler_sliderhome1 = function () {
405    window.location.href = hrefRedirect_sliderhome1;
406}
407function stripHtml(html) {
408    let tmp = document.createElement("DIV");
409    tmp.innerHTML = html;
410    return tmp.textContent || tmp.innerText || "";
411}
412function isNumberKey(evt) {
413    var charCode = (evt.which) ? evt.which : evt.keyCode
414    if (charCode > 31 && (charCode < 48 || charCode > 57))
415        return false;
416    return true;
417}
418
419function IsotopePackery() {
420    var detailMultiplier = 3;
421    $(".list-cards.isotope-packery").isotope({
422        layoutMode: 'packery',
423        itemSelector: '.card',
424        masonryHorizontal: {
425            columnWidth: '.grid-sizer'
426        },
427        getSortData: {
428            selected: function (itemElem) { // function
429                return $(itemElem).hasClass('card-big') ? 0 : 1;
430            }
431        }
432    }); 
433    $(".list-cards.isotope-packery").isotope({ sortBy: 'selected' });
434    $(".list-cards.isotope-packery .card-image").click(function () {
435        if (window.innerWidth <= 992) {
436            detailMultiplier = 1;
437        } else if (window.innerWidth <= 1199) {
438            detailMultiplier = 2;
439        } 
440        var card = $(this).parents(".card");
441        if (card.hasClass("card-big")) return;
442        if (window.innerWidth <= 992) {
443            $(".card-big").find(".card-content").prepend($(".card-big").find(".card-image"));
444            card.find('.card-detail-content').prepend(card.find(".card-image"));
445            card.find(".card-image").height(card.width());
446            card.find(".card-detail").width('100%');
447        } else {
448            card.find(".card-detail").width(card.width() * detailMultiplier);
449        }
450        $(".card-big").removeClass("card-big");
451        card.find(".card-image").width(card.width());
452        card.addClass("card-big");
453
454        $(".list-cards.isotope-packery").isotope('updateSortData', $('.list-cards .card')).isotope();
455
456        var islayoutComplete = false;
457
458        $(".list-cards.isotope-packery").on('layoutComplete',
459            function (event, laidOutItems) {
460                if (islayoutComplete) return;
461                var FixedHeaderHeight = $("#header").outerHeight() + 20; 
462                var IsotopePackeryFixer = $("#IsotopePackeryFixer").offset().top;
463                $('html,body').stop(true, false).animate({ scrollTop: IsotopePackeryFixer - FixedHeaderHeight }, 500).promise().then(function () { });
464                islayoutComplete = true;
465                //$("#contents-anni-lista.isotope .contents-anni-item:visible .contents-anni-anno-rotator").show();
466                //$("#contents-anni-lista.isotope .contents-anni-item:visible .contents-anni-anno-rotator").trigger('refresh.owl.carousel');
467                setTimeout(function () {
468                    $(".list-cards.isotope-packery").isotope({
469                        filter: function () {
470                            return $(this).is(':visible');
471                        }
472                    });
473                }, 500);
474            }
475        );
476    });
477}
478
479function InizializzaLoginEMenuUtente()
480{
481    var boxLoginWidth = $("#box-login").outerWidth();
482    $("#box-login").css("right", 0 - boxLoginWidth);
483    $("#accedi-myduplicard-link,#duplicard-corner").click(function () {
484        if ($("#box-login").is(":hidden")) {
485            $("#box-login").show();
486            $("#box-login").stop(true, true).animate({ right: 0 });
487        } else {
488            $("#box-login").stop(true, true).animate({ right: 0 - boxLoginWidth }).promise().done(function () {
489                $("#box-login").hide();
490            });
491        }
492    });
493
494    var boxMenuUtenteWidth = $("#box-menu-utente").outerWidth();
495    $("#box-menu-utente").css("right", 0 - boxMenuUtenteWidth);
496    $("#cmdMenuUtente,#duplicard-corner").click(function () {
497        if ($("#box-menu-utente").is(":hidden")) {
498            $("#box-menu-utente").show();
499            $("#box-menu-utente").stop(true, true).animate({ right: 0 });
500            $(".zsiq_custommain").hide();
501            SetLayoutBoxMenuUtente();
502        } else {
503            $("#box-menu-utente").stop(true, true).animate({ right: 0 - boxMenuUtenteWidth }).promise().done(function () {
504                $("#box-menu-utente").hide();
505                $(".zsiq_custommain").show();
506            });
507        }
508    });
509}
510function ControlCheckbox() {
511    $(".CheckBox").each(function (index, elem) {
512        if ($(elem).find("input").prop("checked"))
513            $(elem).addClass("checked");
514        else
515            $(elem).removeClass("checked");
516    });
517}
518function ControlRadioButton() {
519    $(".RadioButton").each(function (index, elem) {
520        if ($(elem).find("input").prop("checked"))
521            $(elem).addClass("checked");
522        else
523            $(elem).removeClass("checked");
524    });
525}
526function ControlRadioButtonList() {
527    setTimeout(function () {
528        $(".RadioButtonList input").each(function (index, elem) {
529            var label = $(elem).parents(".RadioButtonList").find("label[for='" + $(elem).attr("id") + "']")
530            if ($(elem).prop("checked")) {
531                label.addClass("checked");
532            } else
533                label.removeClass("checked");
534        });
535    }, 10);
536}
537
538$(window).resize(function () {
539    SetLayout();
540});
541
542function SetLayout() {
543    var width = $("#windowwidth").width();
544    if (width <= 1150) {
545        if (!$('#master').hasClass('size-320')) {
546            $('#master').removeClass().addClass('size-320');
547        }
548    } else {
549        if (!$('#master').hasClass('size-normal')) {
550            $('#master').removeClass().addClass('size-normal');
551        }
552    }
553    SetLayoutBoxMenuUtente();
554}
555function SetLayoutBoxMenuUtente() {
556    var height = $("#windowheight").height();
557    if ($("#header").outerHeight() + $("#box-menu-utente").outerHeight() >= height) {
558        $("#box-menu-utente").css("max-height", height - $("#header").outerHeight());
559    } else {
560        $("#box-menu-utente").css("max-height", "none");
561    }
562}
563
564// funzione che esegue il resize in base all'elemento più alto
565// passo in ingresso l'array di elementi jquery
566// uso i for invece che gli each in modo tale che posso passare anche array di elementi jquery (non solo un elemento jquery che è un insieme di elementi)
567function ResizeToMaxHeight(elements) {
568    var max = 0;
569
570    for (let i = 0; i < elements.length; ++i) {
571        var item = $(elements[i]);
572
573        $(item).css("height", "auto");
574
575        if ($(item).height() > max) {
576            max = $(item).height();
577        }
578    }
579
580    for (let i = 0; i < elements.length; ++i) {
581        $(elements[i]).height(max);
582    }
583}
584
585// gestione accordion
586$(document).ready(function () {
587    $(document).on("click", ".titolo-accordion", function () {
588        var item = $(this).parents(".accordion").first();
589        var container = $(item).find(".desc-accordion").first();
590
591        if ($(item).hasClass("open")) {
592            $(container).stop(true, false).animate({
593                height: "0"
594            }, 400);
595            $(item).removeClass("open");
596        } else {
597            var currentHeight = $(container).height();
598            var totalHeight = $(container).css("height", "auto").height();
599            $(container).height(currentHeight).stop(true, false).animate({
600                height: totalHeight + "px"
601            }, 400, function () {
602                $(container).css("height", "auto");
603            });
604            $(item).addClass("open");
605        }
606    });
vendor: 3 bytes, line 607
607});

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.