PageSourceSearch

https://www.unidformazione.com/wp-content/themes/astra-child/js/custom.js?var=1790939737&ver=1.0.0

js unidformazione.com collected 2026-10-02 11:16:49 UTC 6,089 bytes, 160 lines download raw bytes

1//mobile icons injection:
2var spanElements = document.querySelectorAll('.mobilemenuicon');
3
4var iconClasses = [
5  ['fa', 'fa-phone'],
6  ['fa', 'fa-envelope'],
7  ['fa', 'fa-whatsapp']
8];
9
10spanElements.forEach((spanElement, index) => {
11  if (index < iconClasses.length) {
12    var iconElement = document.createElement('i');
13    iconElement.classList.add(...iconClasses[index]);
14    if (spanElement) {
15      spanElement.appendChild(iconElement);
16    }
17  }
18});
19
20//fix euro symbol:
21// Function to add € symbol if missing in Prezzo scontato
22function addEuroSymbol() {
23  // Get the element containing Prezzo scontato
24  var prezzoScontatoElement = document.evaluate("//th[text()='Prezzo scontato']", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
25  
26  // Check if the element exists
27  if (prezzoScontatoElement) {
28      var prezzoScontatoValueElement = prezzoScontatoElement.nextElementSibling.querySelector("strong");
29      
30      if (prezzoScontatoValueElement) {
31          // Get the current value
32          var prezzoScontatoValue = prezzoScontatoValueElement.textContent.trim();
33
34          // Check if the € symbol is missing and add it if necessary
35          if (!prezzoScontatoValue.startsWith('€')) {
36              prezzoScontatoValueElement.textContent = '€' + prezzoScontatoValue;
37          }
38      }
39  }
40}
41
42// Execute the function after the page loads
43window.onload = function() {
44  addEuroSymbol();
45};
46
47//Empty cart
48// jQuery('<form style="display:inline" action="" method="post"><input style="border:1px solid #0f6346"type="submit" class="button" name="wcj_empty_cart" value="Elimina il corso selezionato"></form>').appendTo('.woocommerce-error li');
49
50
51jQuery('.woocommerce-error li').each(function() {
52    if(jQuery(this).is(':contains("Non puoi aggiungere un ulteriore")')) {
53        jQuery(this).html('Hai già selezionato un corso. <a href="/checkout">Torna al modulo di iscrizione</a> oppure eliminalo e ricomincia. <form style="position: absolute;right: 1px;top: 50%;transform: translateY(-50%);" action="" method="post"><input style="border:1px solid #0f6346"type="submit" class="button" name="wcj_empty_cart" value="Elimina il corso selezionato"><input type="hidden" id="wcj_empty_cart_nonce" name="wcj_empty_cart_nonce" value="aac69e251c"></form>')
54    } else {
55		jQuery('<form style="position: absolute;right: 1px;top: 50%;transform: translateY(-50%);" action="" method="post"><input style="border:1px solid #0f6346"type="submit" class="button" name="wcj_empty_cart" value="Elimina il corso selezionato"><input type="hidden" id="wcj_empty_cart_nonce" name="wcj_empty_cart_nonce" value="aac69e251c"></form>').appendTo(this);
56	}
57    
58});
59
60
61//modal
62jQuery('.dc-pulsante-modale').click(function() {
63  jQuery( this ).next('.elementor-widget-ae-woo-add-to-cart').fadeIn('slow');
64  jQuery( this ).siblings('.dc-pulsante-modale-chiudi').fadeIn('slow');	
65  jQuery('html').css("overflow", "hidden");
66});
67
68jQuery('.dc-pulsante-modale-chiudi').click(function() {
69  jQuery( this ).prev('.elementor-widget-ae-woo-add-to-cart').fadeOut('slow');
70	jQuery( this ).fadeOut('slow');
71  jQuery('html').css("overflow-y", "scroll");
72});
73
74
75
76
77
78
79//dropdown vertical menu
80
81if (!jQuery('.dc-vertical-menu .menu-item-has-children').hasClass("current_page_ancestor")) {
82	jQuery('.dc-vertical-menu .menu-item-has-children').hover(function() {
83        jQuery(this).find('.sub-menu').stop().slideDown("slow").css({"margin-left":"20px","width":"90%"});
84    },
85	function() {
86	        jQuery(this).find('.sub-menu').stop().slideUp("slow").css({"margin-left":"20px","width":"90%"});
87	    }	
88	);
89} else if(jQuery("li.current_page_item").length > 0){
90	jQuery("li.current_page_item").each(function (i,e) {
91       jQuery(e).parent().css({"display":"block","margin-left":"20px","width":"90%"});
92    });
93	jQuery('.dc-vertical-menu .menu-item-has-children').not('.current_page_ancestor').hover(function() {
94        jQuery(this).find('.sub-menu').stop().slideDown("slow").css({"margin-left":"20px","width":"90%"});
95    },
96	function() {
97	        jQuery(this).find('.sub-menu').stop().slideUp("slow").css({"margin-left":"20px","width":"90%"});
98	    }	
99	);
100}
101
102  var myx = 0;
103  var myy = 0;
104  var hiddenWidth = 150;
105
106//  search
107jQuery(document).ready(function($) {
108  $(".search_icon").click(function() {
109    $(".dcsearch").slideToggle();
110  });
111
112  $(document).keydown(function(e) {
113    if (e.keyCode == 27) {
114      //$(modal_or_menu_element).closeElement();
115      $(".dcsearch").hide();
116    }
117  });
118
119  // CRi 04/02/2021 - Pop up home nascosta  
120
121            var currentMousePos = { x: -1, y: -1 };
122            $(document).mousemove(function(event) {
123                currentMousePos.x = event.pageX;
124                currentMousePos.y = event.pageY;
125                 if ( $(".hotip-tooltip").length >0) {  
126                     if (myx ==0 || myy ==0) {
127                        var tooltip =  $(".hotip-tooltip");
128                        var lunghezza = tooltip.width();
129                        var altezza = tooltip.height();
130                        var left =  parseInt(tooltip.css("left"),10);
131                        var top =  parseInt(tooltip.css("top"),10);
132                     
133                        myx = left + (lunghezza /2 );
134                        myy = top + (altezza / 2);
135                    } else {
136                        if (
137                                (((myx - currentMousePos.x) >hiddenWidth) || ((currentMousePos.x - myx) >hiddenWidth)) || 
138                                (((myy - currentMousePos.y) >hiddenWidth) || ((currentMousePos.y - myy) >hiddenWidth))
139                           ) {
140                            $(".hotip-tooltip").hide();
141                        } else {
142                             $(".hotip-tooltip").show();
143                        }
144                    }
145                }
146            });
147
148
149
150        
151
152});
153
154//search results fix
155jQuery('#dc-read-more-for-search div.elementor-widget-wrap').each(function() {
156if(jQuery(this).children().length == 0){
157	jQuery(this).closest('article.ae-post-list-item').css('display','none');
158}
159});
160

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.