1function root() { 2 var scripts = document.getElementsByTagName('script'), 3 script = scripts[scripts.length - 1], 4 path = script.getAttribute('src').split('/'), 5 pathname = location.pathname.split('/'), 6 notSame = false, 7 same = 0; 8 9 for (var i in path) { 10 if (!notSame) { 11 if (path[i] == pathname[i]) { 12 same++; 13 } else { 14 notSame = true; 15 } 16 } 17 } 18 return location.origin + pathname.slice(0, same).join('/'); 19} 20 21var WEB_ROOT = root(); 22 23(function($) { 24 25 $.extend($.easing, { 26 easeInOutCubic: function(x, t, b, c, d) { 27 if ((t /= d / 2) < 1) return c / 2 * t * t * t + b; 28 return c / 2 * ((t -= 2) * t * t + 2) + b; 29 } 30 }); 31 32 $(window).scroll(function() { 33 if ($(this).scrollTop() > 245) { 34 $(".navigation").addClass('fixed'); 35 $("body").addClass('margin'); 36 } else if ($(this).scrollTop() < 245) { 37 $(".navigation").removeClass('fixed'); 38 $("body").removeClass('margin'); 39 } 40 }); 41 42 43 /***************** Nav Transformicon ******************/ 44 45 /* When user clicks the Icon */ 46 $('.nav-toggle').click(function(e) { 47 $(this).toggleClass('active'); 48 $('.header-nav').toggleClass('open'); 49 e.preventDefault(); 50 }); 51 /* When user clicks a link */ 52 $('.header-nav li a').click(function() { 53 $('.nav-toggle').toggleClass('active'); 54 $('.header-nav').toggleClass('open'); 55 56 }); 57 58 // Toggle Search 59 $('.show-search').click(function() { 60 $('.search-form').css('margin-top', '0'); 61 }); 62 $('.close-search').click(function() { 63 $('.search-form').css('margin-top', '-60px'); 64 }); 65 66 /***************** Slide Home ******************/ 67 68 //Function to animate slider captions 69 function doAnimations(elems) { 70 //Cache the animationend event in a variable 71 var animEndEv = 'webkitAnimationEnd animationend'; 72 73 elems.each(function() { 74 var $this = $(this), 75 $animationType = $this.data('animation'); 76 $this.addClass($animationType).one(animEndEv, function() { 77 $this.removeClass($animationType); 78 }); 79 }); 80 } 81 82 //Variables on page load 83 var $myCarousel = $('.carouselHome'), 84 $firstAnimatingElems = $myCarousel.find('.item:first').find("[data-animation ^= 'animated']"); 85 86 //Initialize carousel 87 $myCarousel.carousel(); 88 89 //Animate captions in first slide on page load 90 doAnimations($firstAnimatingElems); 91 92 93 //Other slides to be animated on carousel slide event 94 $myCarousel.on('slide.bs.carousel', function(e) { 95 var $animatingElems = $(e.relatedTarget).find("[data-animation ^= 'animated']"); 96 doAnimations($animatingElems); 97 }); 98 99 $('.carouselHome').carousel({ 100 interval: 3000, 101 pause: "false" 102 }); 103 104 $(function() { 105 106 // init 107 $('body > *:not(style, script)').trigger('add.cards'); 108 $(window).resize().scroll(); 109 110 $(window).scroll(function() { 111 if ($(this).scrollTop() > 500) { 112 $(".button-back-to-top").removeClass('is-hidden'); 113 } else { 114 $(".button-back-to-top").addClass('is-hidden'); 115 } 116 }); 117 $(".button-back-to-top").click(function() { 118 $('html, body').stop().animate({ 119 scrollTop: 0 120 }, 1400, 'easeInOutCubic'); 121 }); 122 123 // smooth scroll 124 if (!$('html').hasClass('is-builder')) { 125 $(document).click(function(e) { 126 try { 127 var target = e.target; 128 do { 129 if (target.hash) { 130 var useBody = /#bottom|#top/g.test(target.hash); 131 $(useBody ? 'body' : target.hash).each(function() { 132 e.preventDefault(); 133 var goTo = target.hash == '#bottom' ? 134 ($(this).height() - $(window).height()) : 135 $(this).offset().top; 136 $('html, body').stop().animate({ 137 scrollTop: goTo 138 }, 800, 'easeInOutCubic'); 139 }); 140 break; 141 } 142 } while (target = target.parentNode); 143 } catch (e) { 144 // throw e; 145 } 146 }); 147 } 148 149 }); 150 151})(jQuery); 152 153 154$(function() { 155 $('[data-toggle="tooltip"]').tooltip() 156}) 157 158jQuery(document).ready(function($) { 159 160 // hide messages 161 $("#error").hide(); 162 $("#sent-form-msg").hide(); 163 164 // on submit... 165 $("#contactForm #submit").click(function() { 166 $("#error").hide(); 167 168 //nombre 169 var nombre = $("input#nombre").val(); 170 var er_nombre = /^([a-zA-Z´`áéÃóúÃÃÃÃÃäëïöüÃÃÃÃÃà èìòùÃÃÃÃÃñÃ\s]{2,40})+$/; 171 if (!er_nombre.test(nombre)) { 172 $("#error").fadeIn().text("Error en el nombre"); 173 $("input#nombre").focus(); 174 return false;
175 } 176 177 //asunto 178 var asunto = $("input#asunto").val(); 179 var er_asunto = /^([a-zA-Z´`áéÃóúÃÃÃÃÃäëïöüÃÃÃÃÃà èìòùÃÃÃÃÃñÃ\s]{2,60})+$/; 180 if (!er_asunto.test(asunto)) { 181 $("#error").fadeIn().text("Error en el asunto"); 182 $("input#asunto").focus(); 183 return false; 184 } 185 186 //email 187 var email = $("input#email").val(); 188 var er_email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/; 189 if (!er_email.test(email)) { 190 $("#error").fadeIn().text("Error en el email"); 191 $("input#email").focus(); 192 return false; 193 } 194 195 //telefono 196 var telefono = $("input#telefono").val(); 197 var er_telefono = /^[0-9]{2,5}-? ?[0-9]{5,8}$/; 198 if (!er_telefono.test(telefono)) { 199 $("#error").fadeIn().text("Error en el telefono"); 200 $("input#telefono").focus(); 201 return false; 202 } 203 204 //comments 205 var comments = $("textarea#mensaje").val(); 206 if (comments.length == 0 || /^\s+$/.test(comments)) { 207 $("#error").fadeIn().text("Error en el mensaje"); 208 $("textarea#mensaje").focus(); 209 return false; 210 } 211 212 // data string 213 var dataString = 'nombre=' + nombre + 214 '&asunto=' + asunto + 215 '&email=' + email + 216 '&telefono=' + telefono + 217 '&mensaje=' + comments; 218 219 // ajax 220 $.ajax({ 221 type: "POST", 222 url: "libreria/send-mail.php", 223 data: dataString, 224 success: success() 225 }); 226 }); 227 228 229 // on success... 230 function success() { 231 $("#sent-form-msg").fadeIn().html("<p class='alert alert-success'><i class='far fa-check-circle'></i> Mensaje enviado<br>A la brevedad posible te responderemos<br><br><strong>Gracias por tu contacto!</strong></p>"); 232 $("#contactForm").fadeOut(); 233 } 234 235 return false; 236}); 237 238 239jQuery(document).ready(function($) { 240 241 // hide messages 242 $("#sent-form-msg").hide(); 243 $("#error").hide(); 244 245 // on submit... 246 $("#clubLectoresForm #submit").click(function() { 247 248 $("#error").hide(); 249 250 //nombre 251 var nombre = $("input#nombre").val(); 252 var er_nombre = /^([a-zA-Z´`áéÃóúÃÃÃÃÃäëïöüÃÃÃÃÃà èìòùÃÃÃÃÃñÃ\s]{2,40})+$/; 253 if (!er_nombre.test(nombre)) { 254 $("#error").fadeIn().text("Error en el nombre"); 255 $("input#nombre").focus(); 256 return false; 257 } 258 259 //apellido 260 var apellido = $("input#apellido").val(); 261 var er_apellido = /^([a-zA-Z´`áéÃóúÃÃÃÃÃäëïöüÃÃÃÃÃà èìòùÃÃÃÃÃñÃ\s]{2,40})+$/; 262 if (!er_nombre.test(apellido)) { 263 $("#error").fadeIn().text("Error en el apellido"); 264 $("input#apellido").focus(); 265 return false; 266 } 267 268 //telefono 269 var telefono = $("input#telefono").val(); 270 var er_telefono = /^[0-9]{2,5}-? ?[0-9]{5,8}$/; 271 if (!er_telefono.test(telefono)) { 272 $("#error").fadeIn().text("Error en el teléfono"); 273 $("input#telefono").focus(); 274 return false; 275 } 276 277 //email 278 var email = $("input#email").val(); 279 var er_email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/; 280 if (!er_email.test(email)) { 281 $("#error").fadeIn().text("Error en el email"); 282 $("input#email").focus(); 283 return false; 284 } 285 286 //dni 287 var dni = $("input#dni").val(); 288 var er_dni = /^([0-9]{7,8})+$/; 289 if (!er_dni.test(dni)) { 290 $("#error").fadeIn().text("Error en el DNI"); 291 $("input#dni").focus(); 292 return false; 293 } 294 295 296 var fecha = $("input#nacimiento").val(); 297 var er_fecha = /^\d{1,2}\-\d{1,2}\-\d{2,4}$/; 298 if (!er_fecha.test(fecha)) { 299 $("#error").fadeIn().text("El formato de fecha debe ser: dd-mm-yyyy"); 300 $("input#nacimiento").focus(); 301 return false;
302 } 303 304 305 // data string 306 var dataString = 'nombre=' + nombre + 307 '&apellido=' + apellido + 308 '&email=' + email + 309 '&telefono=' + telefono + 310 '&dni=' + dni + 311 '&nacimiento=' + fecha; 312 313 // ajax 314 $.ajax({ 315 type: "POST", 316 url: "libreria/send-mail-club-lectores.php", 317 data: dataString, 318 success: success() 319 }); 320 }); 321 322 323 // on success... 324 function success() { 325 $("#sent-form-msg").fadeIn().html("<p class='alert alert-success'><i class='far fa-check-circle'></i> Solicitud enviada<br><br>Un vez procesada la solicitud te escribiremos para informarte los datos del Club de Lectores y Lectoras de Punto de Encuentro.</p>"); 326 $("#clubLectoresForm").fadeOut(); 327 } 328 329 return false; 330});
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.