1/// <reference path="../../../../../.vscode/extensions/jquery.d.ts" /> 2/* global jQuery */ 3 4jQuery(document).ready(function () { 5 /************************** 6 * COOKIE POLICY 7 **************************/ 8 var url = 'www.filippodicostanzo.com'; 9 var site = 'Filippo Di Costanzo'; 10 11 jQuery('#cookie p').each(function () { 12 jQuery(this).text(jQuery(this).text().replace('{0}', site).replace('{1}', url)); 13 }); 14 15 jQuery('#privacy p').each(function () { 16 jQuery(this).text(jQuery(this).text().replace('{0}', site).replace('{1}', url)); 17 }); 18 19 /************************** 20 * SOCIAL STREAM ISOTOPE 21 **************************/ 22 23 jQuery('.facebook-section').imagesLoaded(function () { 24 jQuery('.facebook-section').isotope({ 25 itemSelector: '.grid-facebook', 26 percentPosition: true, 27 masonry: { 28 // use outer width of grid-sizer for columnWidth 29 columnWidth: '.grid-facebook-sizer', 30 gutter: 20 31 } 32 }); 33 jQuery(".facebook-section").isotope('layout') 34 // images have loaded 35 }); 36 37 /************************** 38 * DATE PICKER 39 **************************/ 40 41 /*** CREAZIONE DATE PICKER ***/ 42 jQuery('#date-in').datepicker({ dateFormat: 'dd/mm/yy' }); 43 jQuery('#date-out').datepicker({ dateFormat: 'dd/mm/yy' }); 44 45 /*** STYLE DATEPICKER ***/ 46 jQuery('#ui-datepicker-div').addClass('ll-skin-melon'); 47 48 /*** DISABILITA GIORNI PRIMA DI OGGI ***/ 49 jQuery('#date-in').datepicker('option', 'minDate', 0); 50 jQuery('#date-out').datepicker('option', 'minDate', 0); 51 52 /*** INIZIALIZZA LE DATE E CONTROLLA CHE SIANO CORRETTE ***/ 53 54 var date = new Date(); 55 jQuery('#date-in').datepicker('setDate', new Date()); 56 var tomorrow = new Date(date.getTime() + 24 * 60 * 60 * 1000); 57 jQuery('#date-out').datepicker('setDate', tomorrow); 58 59 /************************** 60 * GLAT VALIDATE 61 **************************/ 62 63 jQuery("#date-in").datepicker('option', 'onSelect', function (dateText) { 64 var din = jQuery("#date-in").datepicker('getDate'); 65 var dout = jQuery("#date-out").datepicker('getDate'); 66 if (din >= dout || dout === null) { 67 dout = new Date(din.getTime() + 24 * 60 * 60 * 1000); 68 jQuery("#date-out").datepicker('setDate', dout); 69 } 70 }); 71 72 jQuery("#date-out").datepicker('option', 'onSelect', function (dateText) { 73 var din = jQuery("#date-in").datepicker('getDate'); 74 var dout = jQuery("#date-out").datepicker('getDate'); 75 if (dout <= din || din === null) { 76 din = new Date(dout.getTime() - 24 * 60 * 60 * 1000); 77 jQuery("#date-in").datepicker('setDate', din); 78 } 79 }); 80 81 jQuery('#prenota').on('click', function () { 82 var query = ''; 83 query += '?date=' + jQuery('#date-in').val(); 84 query += '&time=' + jQuery('#time').val(); 85 query += '&persons=' + jQuery('#persons').val(); 86 query += '&excursion=' + jQuery('#excursion').val(); 87 document.location = '/prenota/' + query; 88 }); 89 90 jQuery('#booking').on('click', function () { 91 var query = ''; 92 query += '?date=' + jQuery('#date-in').val(); 93 query += '&time=' + jQuery('#time').val(); 94 query += '&persons=' + jQuery('#persons').val(); 95 query += '&excursion=' + jQuery('#excursion').val(); 96 document.location = 'reservation/' + query; 97 }); 98 99 /* 100 jQuery("#prenota, #booking").on('click', function () { 101 var query = ''; 102 103 document.location = '' 104 105 var dateIn = jQuery('#date-in').val(); 106 var dateOut = jQuery('#date-out').val(); 107 var adults = jQuery('#adults').val(); 108 var childs = jQuery('#childs').val(); 109 110 jQuery('html, body').animate({ scrollTop: jQuery("#book").offset().top - 200 }, 1000); 111 112 jQuery('#date-1').val(dateIn); 113 jQuery('#date-2').val(dateOut); 114 jQuery('#menu-1').val(adults); 115 jQuery('#menu-2').val(childs); 116 });*/ 117 118 /*** FUNZIONE PER PRENDERE PARAMETRI BY NAME ***/ 119 function getParameterByName(name) { 120 name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
121 var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), 122 results = regex.exec(location.search); 123 return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); 124 } 125 126 if ((window.location.pathname.substring(0, 8).toLowerCase() === '/prenota') || (window.location.pathname.substring(0, 15).toLowerCase() === '/en/reservation')) { 127 var m_arrival = getParameterByName('date'); 128 if (m_arrival !== null && typeof m_arrival === 'string' && m_arrival.length > 0) { 129 var a = m_arrival.split('/'); 130 jQuery('#date-in').datepicker('setDate', new Date(a[2], a[1] - 1, a[0], 0, 0, 0, 0)); 131 } 132 133 var m_time = getParameterByName('time'); 134 if (m_time !== null && typeof m_time === 'string' && m_time.length > 0) { 135 jQuery('#time').val(m_time); 136 } 137 138 var m_persons = getParameterByName('persons'); 139 if (m_persons !== null && typeof m_persons === 'string' && m_persons.length > 0) { 140 jQuery('#persons').val(m_persons); 141 } 142 143 var m_excursion = getParameterByName('excursion'); 144 if (m_excursion !== null && typeof m_excursion === 'string' && m_excursion.length > 0) { 145 jQuery('#excursion').val(m_excursion); 146 } 147 } 148 149 jQuery('.btn-prenota').on('click', function () { 150 var query = '?excursion=' + jQuery(this).attr('id') + '&type=1'; 151 document.location = '/prenota/' + query; 152 }); 153 154 /************************** 155 * MENU ONE PAGE REMOVE OVERLAY 156 **************************/ 157 158 var slide = jQuery('#Side_slide'); 159 var overlay = jQuery('#body_overlay'); 160 var pos = 'right'; 161 162 jQuery("#Side_slide #menu ul li").each(function () { 163 jQuery(this).find('a').on("click", function () { 164 close(); 165 }); 166 }); 167 168 var close = function () { 169 if (pos == 'left') { 170 slide.animate({ 'left': -250 }, 300); 171 jQuery('body').animate({ 'right': 0 }, 300); 172 } else { 173 slide.animate({ 'right': -250 }, 300); 174 jQuery('body').animate({ 'left': 0 }, 300); 175 } 176 177 overlay.fadeOut(300); 178 }; 179 180 /************************** 181 * VENOBOX 182 **************************/ 183 184 jQuery('.venobox').venobox({ 185 framewidth: '70%', 186 frameheight: '70%', 187 infinigall: false 188 }); 189 190 jQuery('.container-hidden-box').each(function () { 191 jQuery(this).find('.hidden-box').hide(); 192 }); 193 194 jQuery('.box-item').on("click", function () { 195 var classes = jQuery(this).attr('class'); 196 var boxclass = classes.substr(13, 1); 197 198 jQuery('.container-hidden-box').each(function () { 199 jQuery(this).find('.hidden-box').hide('slow'); 200 jQuery(this).find('.hidden-box-' + boxclass).show('slow'); 201 }) 202 }); 203 204 jQuery('.close-project').on("click", function () { 205 jQuery('.container-hidden-box').each(function () { 206 jQuery(this).find('.hidden-box').hide('slow'); 207 }) 208 }); 209 210 /************************** 211 * READ MORE 212 **************************/ 213 214 jQuery('.section-gallery').readmore({ 215 speed: 1500, 216 lessLink: '<a href="#"><h4><i class="supreme-icon-up-arrow-angle"></i> View Less <i class="supreme-icon-up-arrow-angle"></i></h4></a>', 217 collapsedHeight: 450, 218 heightMargin: 16, 219 moreLink: '<a href="#"><h4><i class="supreme-icon-down-arrow"></i> View More <i class="supreme-icon-down-arrow"></i></h4></a>', 220 221 afterToggle: function (trigger, element, expanded) { 222 if (expanded) { // The "Close" link was clicked 223 jQuery('.section-gallery').addClass('read-active'); 224 } 225 226 if (!expanded) { // The "Close" link was clicked 227 jQuery('.section-gallery').removeClass('read-active'); 228 } 229 } 230 }); 231 232 /************************** 233 * OWL CAROUSEL 234 **************************/ 235 236 jQuery('.owl-carousel').owlCarousel({ 237 items: 3, 238 autoplay: true, 239 autoplayHoverPause: true, 240 nav: true, 241 navText: false, 242 dots: true, 243 244 margin: 10, 245 responsiveClass: true, 246 responsive: { 247 0: { 248 items: 1, 249 nav: false 250 }, 251 960: { 252 items: 2, 253 nav: false 254 }, 255 1240: { 256 items: 3, 257 nav: true, 258 } 259 } 260 }).lightGallery({ 261 selector: 'a' 262 });
vendor: 3 bytes, line 263
263});
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.