1jQuery(function ($) { 2 $(document).ready(function () { 3 4 var theme_uri = itwp2.siteurl; 5 6 $(".box-servizi a").addClass("u-color-white"); 7 $(".form-submit > input").addClass("btn btn-default"); 8 9 /* Metto la data dei post nel titolo (nella sidebar) */ 10 $(".italiawp2-sidebar > ul > li, .italiawp2-sidebar > .wp-widget-group__inner-blocks > ul > li").each(function () { 11 if ($('> span', this).length === 1 && $('> a', this).length === 1) { 12 let span = $(this).find('span'); 13 let a = $(this).find('a'); 14 span.html("<br><small>" + span.html() + "</small>"); 15 a.append(span); 16 } 17 }); 18 19 $("img.alignnone").parent('a').addClass("a-alignnone"); 20 $("img.aligncenter").parent('a').addClass("a-aligncenter"); 21 $("img.alignleft").parent('a').addClass("a-alignleft"); 22 $("img.alignright").parent('a').addClass("a-alignright"); 23 24 /* Gestisco i blockquote */ 25 $("blockquote").addClass("callout important callout-punti"); 26 27 /* Sistemo gli elenchi nella sidebar */ 28 $(".italiawp2-sidebar > ul li a, .italiawp2-sidebar > .wp-widget-group__inner-blocks > ul li a").addClass("list-group-item list-group-item-action"); 29 $(".italiawp2-sidebar > ul li, .italiawp2-sidebar > .wp-widget-group__inner-blocks > ul li").changeElementType('span'); 30 $(".italiawp2-sidebar > ul, .italiawp2-sidebar > .wp-widget-group__inner-blocks > ul").addClass("list-group lista-paragrafi").changeElementType('div'); 31 32 $(".italiawp2-sidebar .wp-block-search").parent().addClass("cerca"); 33 34 /* Sistemo la mappa in home */ 35 mapWrap(); 36 37 $(".map-wrap").click(function () { 38 $(this).fadeOut(10); 39 }); 40 /* Fine sistemazione mappa */ 41 42 $('.image-content a').filter(function () { 43 return $(this).attr('href').match(/\.(jpeg|jpg|png|gif)/i); 44 }).magnificPopup({ 45 type: 'image' 46 }); 47 48 $('.magnific-popup-gallery').filter(function () { 49 return $(this).attr('href').match(/\.(jpeg|jpg|png|gif)/i); 50 }).magnificPopup({ 51 type: 'image', 52 gallery: { 53 enabled: true 54 } 55 }); 56 57 /* Aggiungo l'icona di Link Esterno */ 58 $('a').each(function () { 59 if (!(location.hostname === this.hostname || !this.hostname.length || 60 !$.trim($(this).html()).length || $(this).is(':has(figure)') || 61 $(this).closest("#mainheader").length || $(this).closest(".social").length)) { 62 let ext = '<svg class="icon icon-link icon-external-link"><use xlink:href="' + theme_uri + '/static/img/bootstrap-italia.svg#it-external-link"></use></svg>'; 63 $(this).append(ext); 64 } 65 }); 66 67 $(".box-servizi .scheda-sito").each(function () { 68 if ($(this).size() && $("img", this).size()) { 69 if ($(this).html().replace(/<img[^>]*>/g, "") == 0) $(this).addClass("no-padding"); 70 } 71 72 if ($(this).parent().find('.icon-external-link').length) { 73 let link = $(this).parent().find('.icon-external-link'); 74 75 if ( (link.parent().not('.no-padding').find('img').not('.icona').length) && ($(this).not('.no-padding').length == 0) ) { 76 link[0].classList.add("icon-external-link-img"); 77 } 78 79 $(this).append(link); 80 } 81 }); 82 83 /* Slide Gallerie Home */ 84 $(".owl-carousel").owlCarousel({ 85 loop: true, 86 margin: 10, 87 navContainer: ".owl-nav", 88 responsive: { 89 0: { 90 items: 1 91 }, 92 768: { 93 items: 2 94 }, 95 992: { 96 items: 3 97 } 98 } 99 }); 100 101 /* NUOVI */ 102 $('.footer-colonne ul').addClass('footer-list clearfix'); 103 104 $('.custom_megamenu_intestazione').each(function () { 105 $(this).wrap("<h5></h5>"); 106 }); 107 108 /* Fix Menu Principale, sottomenu sulla destra */ 109 fixMainMenu(); 110 111 /* Fix Menu Lingue Polylang e WPML */ 112 fixLangMenu("pll-parent-menu-item"); 113 fixLangMenu("menu-item-language"); 114 }); 115 116 $(window).resize(function () { 117 mapWrap(); 118 fixMainMenu(); 119 }); 120 121 function mapWrap() { 122 let altMap = parseInt($(".map-full-content iframe").outerHeight(), 10); 123 $(".map-wrap").css("height", altMap + "px").css("margin-bottom", -altMap + "px"); 124 return; 125 } 126 127 function fixMainMenu() { 128 if ($('#mainheader .entesup a').has('img')) $('#mainheader .entesup a').addClass('image'); 129 130 let numLi = $('#menu-principale > li').length; 131 let largWi = (parseInt($(window).innerWidth(), 10) / 2) - 25; 132 133 $('#menu-principale > li').each(function (i) { 134 $(this).find("ul.dropdown-menu").removeClass("drodownmenu-on-right"); 135 136 let posiLi = $(this).position().left; 137 let ul = $($(this).find("ul")[0]); 138 139 if(ul.children().length < 4) { 140 if (((i + 1) > (numLi / 2)) && (posiLi > largWi)) { 141 $(this).find("ul.dropdown-menu").addClass("drodownmenu-on-right"); 142 } 143 }else{ 144 $(this).addClass('megamenu'); 145 } 146 147 }); 148 return; 149 } 150 151 function fixLangMenu(pluginClass) { 152 if ($("."+pluginClass)[0]){ 153 let numElement = 7; 154 let langMenu = $("#menu-principale ."+pluginClass+" > ul"); 155 let langMenuLi = $('<li class="langMenuLi menu-item menu-item-has-children dropdown nav-item"></li>'); 156 157 $("#menu-principale ."+pluginClass+" > ul li:not(.langMenuLi)").each(function (i) { 158 if( (i==0) || ( inseriti == numElement ) ) { 159 inseriti = 0; 160 delete nuovoLi; 161 nuovoLi = langMenuLi.clone(); 162 nuovoLi.append("<ul></ul>"); 163 langMenu.append(nuovoLi); 164 } 165 langMenuLiElem = $(this).find("h5 > a"); 166 167 thisElem = $('<li class="menu-item nav-item"></li>'); 168 thisElem.append(langMenuLiElem); 169 nuovoLi.find("ul").append(thisElem); 170 delete thisElem; 171 172 inseriti++; 173 $(this).remove(); 174 }); 175 delete numElement, langMenu, langMenuLi; 176 } 177 return; 178 } 179});
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.