1jQuery.validator.setDefaults({ 2 errorElement: 'span', 3 errorPlacement: function (error, element) { 4 error.addClass('invalid-feedback'); 5 element.closest('.form-group').append(error); 6 }, 7 highlight: function (element, errorClass, validClass) { 8 $(element).addClass('is-invalid'); 9 }, 10 unhighlight: function (element, errorClass, validClass) { 11 $(element).removeClass('is-invalid'); 12 } 13}); 14 15$.validator.addMethod("dateES", function (value, element) { 16 var check = false, 17 re = /^\d{1,2}\/\d{1,2}\/\d{4}$/, 18 adata, gg, mm, aaaa, xdata; 19 if (re.test(value)) { 20 adata = value.split("/"); 21 gg = parseInt(adata[0], 10); 22 mm = parseInt(adata[1], 10); 23 aaaa = parseInt(adata[2], 10); 24 xdata = new Date(Date.UTC(aaaa, mm - 1, gg, 12, 0, 0, 0)); 25 if ((xdata.getUTCFullYear() === aaaa) && (xdata.getUTCMonth() === mm - 1) && (xdata.getUTCDate() === gg)) { 26 check = true; 27 } else { 28 check = false; 29 } 30 } else { 31 check = false; 32 } 33 return this.optional(element) || check; 34}, 'Fecha inválida.'); 35 36$(document).ready(function () { 37 38 var width = $(window).width(); 39 40 controlesGenerales(width); 41 42 botonToTop(); 43 44 // Cerrar el menu movil con el boton X 45 $(".cerrar-menu").on("click", function () { 46 $(".menu").removeClass("deslizar-menu"); 47 }); 48 49 // Cerrar el menu movil al pulsar fuera (ni dentro del menu ni en el boton hamburguesa) 50 $(document).on("click", function (e) { 51 if ($(".menu").hasClass("deslizar-menu") && 52 !$(e.target).closest(".menu").length && 53 !$(e.target).closest(".menu-bars").length) { 54 $(".menu").removeClass("deslizar-menu"); 55 } 56 }); 57 58 $("#preAlumno").validate({ 59 rules: { 60 nombre: { 61 required: true 62 }, 63 apellidos: { 64 required: true 65 }, 66 dni: { 67 required: true 68 }, 69 fechanacimiento: { 70 required: true 71 }, 72 provincia: { 73 required: true 74 }, 75 localidad: { 76 required: true 77 }, 78 domicilio: { 79 required: true 80 }, 81 codigo_postal: { 82 required: true 83 }, 84 telefono_1: { 85 required: true 86 }, 87 correo_electronico: { 88 required: true, 89 email: true, 90 }, 91 numcuentabancaria: { 92 required: true 93 } 94 } 95 }); 96 97 $('.datepicker').datepicker({ 98 format: 'dd/mm/yyyy', 99 language: 'es', 100 startView: 2, 101 }); 102 103 104 $("#formConvocatoriaEmpleoPublico").validate({ 105 rules: { 106 id_contenido: { 107 required: true, 108 number: true, 109 }, 110 dni: { 111 required: true, 112 dniCheck: true 113 }, 114 nombre: { 115 required: true 116 }, 117 apellidos: { 118 required: true 119 }, 120 telefono: { 121 required: true, 122 }, 123 email: { 124 required: true, 125 email: true 126 }, 127 provincia: { 128 required: true, 129 }, 130 localidad: { 131 required: true 132 }, 133 direccion: { 134 required: true, 135 }, 136 codigo_postal: { 137 required: true, 138 number: true, 139 minlength: 5, 140 maxlength: 5 141 }, 142 fecha_nacimiento: { 143 required: true, 144 dateES: true 145 }, 146 fecha_publicacion_bop: { 147 required: true, 148 dateES: true 149 }, 150 captcha: { 151 // El codigo ya no viaja al navegador (va en la sesion): #oculto es 152 // ahora un identificador opaco. La comprobacion real es de servidor. 153 required: true 154 }, 155 rgpd: { 156 required: true, 157 }, 158 declaracion_responsable: { 159 required: true, 160 } 161 }, 162 messages: { 163 captcha: { 164 equalTo: "Escribe los números correctamente", 165 } 166 }, 167 submitHandler: function (form, e) { 168 e.preventDefault(); 169 $("#btnFormConvocatoriaEmpleoPublico").html("Enviando..."); 170 $("#alertSuccessConvocatoriaEmpleoPublico").addClass('d-none'); 171 $("#alertDangerConvocatoriaEmpleoPublico").addClass('d-none'); 172 173 var url = ""; 174 if (window.location.hostname === 'localhost') { 175 url = "http://" + window.location.hostname + "/v20/assets/ajax/ajFormularioConvocatoriaPublicaEmpleo.php" 176 } else { 177 url = "https://" + window.location.hostname + "/v20/assets/ajax/ajFormularioConvocatoriaPublicaEmpleo.php"; 178 } 179 180 $.ajax({
181 type: "POST", 182 url: url, 183 data: { 184 data: JSON.stringify($(form).serializeArray()), 185 } 186 }).done(function (data) { 187 // error_captcha: el servidor rechazo el codigo de validacion. Se distingue 188 // del error generico para poder decirle al ciudadano que es el codigo. 189 if (data.trim() == "error_captcha" || data.trim() == "error") { 190 $("#btnFormConvocatoriaEmpleoPublico").html("Enviar"); 191 if (data.trim() == "error_captcha") { 192 $("#alertDangerConvocatoriaEmpleoPublico").text("El código de validación no es correcto o ha caducado. Recargue la página para obtener un código nuevo y vuelva a intentarlo."); 193 } 194 $("#alertDangerConvocatoriaEmpleoPublico").removeClass('d-none'); 195 } else { 196 var obj = jQuery.parseJSON(data); 197 $("#btnFormConvocatoriaEmpleoPublico").html("Enviar"); 198 if (obj.email == "true") { 199 $("#btnFormConvocatoriaEmpleoPublico").prop("disabled", true); 200 $("#enviadoEmailConvocatoriaEmpleoPublico").removeClass('d-none'); 201 } else { 202 $("#enviadoEmailConvocatoriaEmpleoPublico").addClass('d-none'); 203 } 204 205 $("#enlaceConvocatoriaEmpleoPublico").attr("href", "https://convocatoriapublicaempleo.badajozciudad.es/" + obj.token); 206 $("#alertSuccessConvocatoriaEmpleoPublico").removeClass('d-none'); 207 } 208 209 }).fail(function (data) { 210 console.log('btnPublicacionEditar: ' + data); 211 }); 212 } 213 }); 214 215 $("#formConvocatoriaEmpleoPublicoSubsanaciones").validate({ 216 rules: { 217 id_contenido: { 218 required: true, 219 number: true, 220 }, 221 dni: { 222 required: true, 223 dniCheck: true 224 }, 225 nombre: { 226 required: true 227 }, 228 apellidos: { 229 required: true 230 }, 231 telefono: { 232 required: true, 233 }, 234 email: { 235 required: true, 236 email: true 237 }, 238 provincia: { 239 required: true, 240 }, 241 localidad: { 242 required: true 243 }, 244 direccion: { 245 required: true, 246 }, 247 codigo_postal: { 248 required: true, 249 number: true, 250 minlength: 5, 251 maxlength: 5 252 }, 253 fecha_nacimiento: { 254 required: true, 255 dateES: true 256 }, 257 fecha_publicacion_bop: { 258 required: true, 259 dateES: true 260 }, 261 captcha: { 262 // El codigo ya no viaja al navegador (va en la sesion): #oculto es 263 // ahora un identificador opaco. La comprobacion real es de servidor. 264 required: true 265 }, 266 rgpd: { 267 required: true, 268 } 269 }, 270 messages: { 271 captcha: { 272 equalTo: "Escribe los números correctamente", 273 } 274 }, 275 submitHandler: function (form, e) { 276 e.preventDefault(); 277 $("#btnFormConvocatoriaEmpleoPublicoSubsanaciones").html("Enviando..."); 278 $("#alertSuccessConvocatoriaEmpleoPublicoSubsanaciones").addClass('d-none'); 279 $("#alertDangerConvocatoriaEmpleoPublicoSubsanaciones").addClass('d-none'); 280 281 var url = ""; 282 if (window.location.hostname === 'localhost') { 283 url = "http://" + window.location.hostname + "/v20/assets/ajax/ajFormularioConvocatoriaPublicaEmpleoSubsanaciones.php" 284 } else { 285 url = "https://" + window.location.hostname + "/v20/assets/ajax/ajFormularioConvocatoriaPublicaEmpleoSubsanaciones.php"; 286 } 287 288 $.ajax({
289 type: "POST", 290 url: url, 291 data: { 292 data: JSON.stringify($(form).serializeArray()), 293 } 294 }).done(function (data) { 295 // error_captcha: el servidor rechazo el codigo de validacion. Se distingue 296 // del error generico para poder decirle al ciudadano que es el codigo. 297 if (data.trim() == "error_captcha" || data.trim() == "error") { 298 $("#btnFormConvocatoriaEmpleoPublicoSubsanaciones").html("Enviar"); 299 if (data.trim() == "error_captcha") { 300 $("#alertDangerConvocatoriaEmpleoPublicoSubsanaciones").text("El código de validación no es correcto o ha caducado. Recargue la página para obtener un código nuevo y vuelva a intentarlo."); 301 } 302 $("#alertDangerConvocatoriaEmpleoPublicoSubsanaciones").removeClass('d-none'); 303 } else { 304 var obj = jQuery.parseJSON(data); 305 $("#btnFormConvocatoriaEmpleoPublicoSubsanaciones").html("Enviar"); 306 if (obj.email == "true") { 307 $("#btnFormConvocatoriaEmpleoPublicoSubsanaciones").prop("disabled", true); 308 $("#enviadoEmailConvocatoriaEmpleoPublicoSubsanaciones").removeClass('d-none'); 309 } else { 310 $("#enviadoEmailConvocatoriaEmpleoPublicoSubsanaciones").addClass('d-none'); 311 } 312 313 $("#enlaceConvocatoriaEmpleoPublicoSubsanaciones").attr("href", "https://convocatoriapublicaempleo.badajozciudad.es/" + obj.token + "/subsanaciones"); 314 $("#alertSuccessConvocatoriaEmpleoPublicoSubsanaciones").removeClass('d-none'); 315 } 316 317 }).fail(function (data) { 318 console.log('btnPublicacionEditar: ' + data); 319 }); 320 } 321 }); 322 323 //Usado en formConvocatoriaEmpleoPublico, para seleccionar sólo un checkbox. no se puede poner un radiobuton 324 $(".seleccionarUno").click(function () { 325 $(".seleccionarUno").prop("checked", false); 326 $(this).prop('checked', true); 327 }); 328 329 $("#formDelegacionComercio").validate({ 330 rules: { 331 nombre: { 332 required: true 333 }, 334 apellidos: { 335 required: true 336 }, 337 telefono: { 338 required: true, 339 }, 340 email: { 341 required: true, 342 email: true 343 }, 344 provincia: { 345 required: true, 346 }, 347 localidad: { 348 required: true 349 }, 350 direccion: { 351 required: true, 352 }, 353 codigo_postal: { 354 required: true, 355 number: true, 356 minlength: 5, 357 maxlength: 5 358 }, 359 captcha: { 360 // El codigo ya no viaja al navegador (va en la sesion): #oculto es 361 // ahora un identificador opaco. La comprobacion real es de servidor. 362 required: true 363 }, 364 rgpd: { 365 required: true, 366 }, 367 publicar: { 368 required: true, 369 } 370 }, 371 messages: { 372 captcha: { 373 equalTo: "Escribe los números correctamente", 374 } 375 }, 376 submitHandler: function (form, e) { 377 e.preventDefault(); 378 $("#btnFormDelegacionComercio").html("Enviando..."); 379 form.submit(); 380 } 381 }); 382 383 $(window).resize(function () { 384 var width = $(window).width(); 385 width = $(window).width(); 386 deshabilitarEventos(); 387 controlesGenerales(width); 388 }); 389 390 $(window).on("scroll", function () { 391 if ($(this).scrollTop() > 30) { 392 $(".cabecera").addClass("sombra"); 393 } else { 394 $(".cabecera").removeClass("sombra"); 395 } 396 397 botonToTop(); 398 });
399 400 $(window).on("load", function () { 401 botonToTop(); 402 if ($(window).scrollTop() > 30) { 403 $(".cabecera").addClass("sombra"); 404 } else { 405 $(".cabecera").removeClass("sombra"); 406 } 407 408 // Activar la primera pestaña de las fichas de Ayuntamiento > corporación 409 if ($('.tabs-solid > li:first-child > a').length > 0) { 410 $('.tabs-solid > li:first-child > a').click(); 411 } 412 }); 413 414 415 $(".cerrar-fullscreen").on("click", function (e) { 416 $(this).parents('.menu-fullscreen').fadeOut(300); 417 $("html, body").css("overflow-y", "auto"); 418 }); 419 420 $(".ventana-menu > .titulo").on("click", function () { 421 $(this).parents(".ventana-menu").siblings(".caja-menus").slideToggle(300); 422 $(this).find(".flecha").toggleClass("flecha-girada"); 423 }); 424 425 $(".listado-acordeon > .apartado > .cabeza").on("click", function (e) { 426 var cuerpo = $(this).siblings(".cuerpo"); 427 var hermanos = cuerpo.parents(".apartado").siblings(".apartado"); 428 $(this).find(".icono").toggleClass("d-none"); 429 $(".activo").slideUp(300); 430 431 if (!cuerpo.hasClass("activo")) { 432 cuerpo.slideDown(300); 433 cuerpo.addClass("activo"); 434 hermanos.find(".cuerpo").removeClass("activo"); 435 hermanos.children(".cabeza").children(".icono-menos").addClass("d-none"); 436 hermanos.children(".cabeza").children(".icono-mas").removeClass("d-none"); 437 } else { 438 cuerpo.slideUp(300); 439 cuerpo.removeClass("activo"); 440 } 441 442 443 }); 444 445 $(".link-menu-portal").on("click", function (e) { 446 if ($(this).siblings(".submenu-portal").length > 0) { 447 e.preventDefault(); 448 $(this).siblings(".submenu-portal").slideToggle(300); 449 $(this).find("i").toggleClass("flecha-girada"); 450 } 451 }); 452 453 454 $('#boton-idiomas').click(function () { 455 $('.menu-idiomas').fadeToggle(); 456 }); 457 $('#boton-idiomas').mouseenter(function () { 458 $('.menu-idiomas').fadeIn(); 459 }); 460 $('.barra-superior').mouseleave(function () { 461 $('.menu-idiomas').fadeOut(); 462 }); 463 464 $(".form-busqueda").on("focus", ".campo-busqueda", function () { 465 $(".form-busqueda").addClass("activo"); 466 }); 467 468 $(".form-busqueda").on("blur", ".campo-busqueda", function () { 469 $(".form-busqueda").removeClass("activo"); 470 }); 471 472 $(".boton-to-top").on("click", function () { 473 $("html, body").animate({ 474 scrollTop: 0 475 }, 1000); 476 }); 477 478 $(".tabla-contenidos").on("click", ".titulo", function () { 479 $(".tabla-contenidos .titulo").siblings(".caja-lista").slideToggle(300); 480 // $(".tabla-contenidos .titulo").find(".flecha-menu-contenidos").toggleClass("flecha-girada"); 481 $(".tabla-contenidos").toggleClass("colapsada"); 482 }); 483 484 // Añadir enlace a los iconos de descarga en los bloques .item_fichero 485 $('.item_fichero a.enlace').each(function () { 486 let link = $(this); 487 let item = $(this).closest('.item_fichero').find('.item_fichero-izq'); 488 item.css('cursor', 'pointer'); 489 item.click(function () { 490 window.open(link.attr('href')); 491 }); 492 }); 493 494 // Añado una clase a los .item_fichero que no tienen enlace 495 $('.item_fichero').each(function () { 496 if ($(this).find('a').length == 0) { 497 $(this).addClass('sin-enlace'); 498 } 499 }); 500 501 // Desplegar el menú del sidebar para mostrar la página actual 502 $('.lista-menu-portal a[href="' + window.location.href + '"], .tabla-contenidos a[href="' + window.location.href + '"], .relacionados ul a[href="' + window.location.href + '"]').parentsUntil('.menu-portal', 'li').find('ul').show(); 503 $('.lista-menu-portal a[href="' + window.location.href + '"], .tabla-contenidos a[href="' + window.location.href + '"], .relacionados ul a[href="' + window.location.href + '"]').addClass('enlace-actual'); 504 505}); 506 507/** 508 * Función que controla los siguientes aspectos del funcionamiento de la interfaz: 509 * 510 * - Controla el comportamiento de los menús, provocando un fundido o un deslizamiento para su aparición o desaparición 511 * 512 * @param width 513 */ 514 515function controlesGenerales(width) { 516 $(".link-menu").on("click", function (e) { 517 if ($(this).siblings(".submenu").length > 0) { 518 e.preventDefault(); 519 } 520 });
521 if (width > 1199) { 522 // Accesibilidad por teclado del menu principal de escritorio. 523 // controlesGenerales() se re-ejecuta en cada resize: limpiamos antes de re-enlazar. 524 $(".lista-menu").find(".item-menu, .link-menu, .submenu").off(".a11ymenu"); 525 526 $(".lista-menu .item-menu").each(function () { 527 var $item = $(this); 528 var $trigger = $item.children(".link-menu"); 529 var $submenu = $item.children(".submenu"); 530 531 if ($submenu.length === 0) { 532 return; 533 } 534 535 function abrirSubmenu() { 536 $submenu.stop(true, true).fadeIn(200); 537 $trigger.find(".flecha-menu").addClass("flecha-girada"); 538 $trigger.attr("aria-expanded", "true"); 539 } 540 541 function cerrarSubmenu() { 542 $submenu.stop(true, true).fadeOut(200); 543 $trigger.find(".flecha-menu").removeClass("flecha-girada"); 544 $trigger.attr("aria-expanded", "false"); 545 } 546 547 $item.on("mouseenter.a11ymenu", abrirSubmenu); 548 $item.on("mouseleave.a11ymenu", cerrarSubmenu); 549 550 // Enter o Espacio abre/cierra; Escape cierra. 551 $trigger.on("keydown.a11ymenu", function (e) { 552 if (e.key === "Enter" || e.key === " " || e.key === "Spacebar") { 553 e.preventDefault(); 554 if ($trigger.attr("aria-expanded") === "true") { 555 cerrarSubmenu(); 556 } else { 557 abrirSubmenu(); 558 } 559 } else if (e.key === "Escape" || e.key === "Esc") { 560 cerrarSubmenu(); 561 } 562 }); 563 564 // Escape dentro del submenu cierra y devuelve el foco al disparador. 565 $submenu.on("keydown.a11ymenu", function (e) { 566 if (e.key === "Escape" || e.key === "Esc") { 567 cerrarSubmenu(); 568 $trigger.focus(); 569 } 570 }); 571 572 // Cerrar cuando el foco abandona por completo el item del menu. 573 $item.on("focusout.a11ymenu", function (e) { 574 if (!e.relatedTarget || !$item[0].contains(e.relatedTarget)) { 575 cerrarSubmenu(); 576 } 577 }); 578 }); 579 580 $(".idioma-activo").on("click", function () { 581 $(this).siblings('.menu-idiomas').slideToggle(200); 582 $(this).find('.flecha-menu').toggleClass('flecha-girada'); 583 }); 584 } else if (width < 1200) { 585 $(".item-menu").on("click", function () { 586 $(this).find('.submenu').slideToggle(200); 587 $(this).find('.flecha-menu').toggleClass("flecha-girada"); 588 }); 589 590 $(".menu-bars").on("click", function (e) { 591 // Evita que este mismo clic burbujee al handler de "cerrar al pulsar fuera" 592 // (en iOS Safari provocaba que el menu se abriera y cerrara en el mismo toque). 593 e.stopPropagation(); 594 $(".menu").toggleClass("deslizar-menu"); 595 }); 596 } 597 598 $(".link-segundo-menu").on("click", function (e) { 599 e.preventDefault(); 600 var megaMenu = $(this).data("mega-menu"); 601 $(megaMenu).addClass("deslizar-menu"); 602 }); 603 604 $(".cerrar-mega-menu").on("click", function () { 605 $(this).parents('.mega-menu').removeClass("deslizar-menu"); 606 }); 607 608 $(".link-menu-segunda-navegacion").on("click", function (e) { 609 e.preventDefault(); 610 var megaMenu = $(this).data("mega-menu"); 611 $(megaMenu).addClass("deslizar-menu"); 612 }); 613 614 // igualarMaxAlturaElementos($(".tab-especial")); 615 igualarAlturaElementos($(".slider-especiales .item-slider .titulo")); 616 igualarAlturaElementos($(".slider-especiales-portal .item-slider .titulo")); 617 618 // if(width > 575){ 619 // $(".link-segundo-menu").on("click",function(e){ 620 // e.preventDefault(); 621 // e.stopPropagation(); 622 // e.stopImmediatePropagation(); 623 // 624 // var megamenu = $(this).siblings(".mega-menu"); 625 // if(megamenu.hasClass("activo")){ 626 // megamenu.removeClass("activo"); 627 // megamenu.slideUp(300); 628 // }else{ 629 // $(".mega-menu.activo").removeClass("activo").slide
629Up(300); 630 // megamenu.addClass("activo"); 631 // megamenu.slideDown(300); 632 // } 633 // // $("html, body").css("overflow-y", "hidden"); 634 // }); 635 // }else{ 636 // $(".link-segundo-menu").on("click",function(e){ 637 // e.preventDefault(); 638 // $(this).siblings(".mega-menu").toggleClass("activo"); 639 // }); 640 // } 641 642 // $(".tabla-contenidos .nav-link").on("show.bs.tab", function(){ 643 // var $href = $(this).attr("href"); 644 // $(".tabla-contenidos .nav-link").removeClass("active"); 645 // $(".tabla-contenidos .nav-link[href='"+$href+"']").addClass("active"); 646 // 647 // }); 648 // 649 // $(".tabla-contenidos .nav-link").on("click", function(){ 650 // $("html, body").animate({ 651 // scrollTop: $(".migas-especiales").offset().top-100 652 // }, 1000); 653 // }); 654 655} 656 657function deshabilitarEventos() { 658 $(".menu-bars").off("click"); 659 $(".item-menu").off("click"); 660 $(".lista-menu").find(".item-menu, .link-menu, .submenu").off(".a11ymenu"); 661} 662 663$("#carruselPortada").carousel({ 664 interval: 5000, 665}); 666 667$(".slider-especiales").slick({ 668 slidesToShow: 6, 669 slidesToScroll: 6, 670 // autoplay:true, 671 dots: false, 672 arrows: true, 673 centerMode: false, 674 prevArrow: ".flecha-izquierda", 675 nextArrow: ".flecha-derecha", 676 responsive: [ 677 { 678 breakpoint: 1600, 679 settings: { 680 slidesToShow: 4, 681 slidesToScroll: 4 682 } 683 }, 684 { 685 breakpoint: 1300, 686 settings: { 687 slidesToShow: 4, 688 slidesToScroll: 4 689 } 690 }, 691 { 692 // Por debajo de 992px se des-activa Slick: Especiales pasa a galeria masonry por CSS (ver portada.scss) 693 breakpoint: 992, 694 settings: "unslick" 695 } 696 ] 697}); 698 699$(".slider-especiales-portal").slick({ 700 slidesToShow: 4, 701 slidesToScroll: 1, 702 autoplay: true, 703 dots: false, 704 arrows: true, 705 prevArrow: ".flecha-izquierda", 706 nextArrow: ".flecha-derecha", 707 // prevArrow: "<button type='button' class='slick-prev pull-left flecha-slider' data-aos='fade-right' data-aos-delay='400'><img src='assets/images/flecha-izquierda.png'></button>", 708 // nextArrow: "<button type='button' class='slick-next pull-right flecha-slider' data-aos='fade-left' data-aos-delay='400'><img src='assets/images/flecha-derecha.png'></button>", 709 responsive: [ 710 { 711 breakpoint: 1600, 712 settings: { 713 slidesToShow: 4, 714 slidesToScroll: 1 715 } 716 }, 717 { 718 breakpoint: 1200, 719 settings: { 720 slidesToShow: 3, 721 slidesToScroll: 1 722 } 723 }, 724 { 725 breakpoint: 768, 726 settings: { 727 slidesToShow: 3, 728 slidesToScroll: 1 729 } 730 }, 731 { 732 breakpoint: 620, 733 settings: { 734 slidesToShow: 3, 735 slidesToScroll: 1 736 } 737 }, 738 { 739 breakpoint: 480, 740 settings: { 741 slidesToShow: 2, 742 slidesToScroll: 1 743 } 744 } 745 ] 746}); 747 748$(".slider-banners").slick({ 749 slidesToShow: 1, 750 slidesToScroll: 1, 751 autoplay: false, 752 dots: true, 753 arrows: true, 754 centerMode: false, 755 autoplaySpeed: 5000, 756 speed: 1500 757}); 758 759function igualarMaxAlturaElementos(nodos) { 760 var $max = 0; 761 762 nodos.each(function () { 763 if ($(this).height() > $max) { 764 $max = $(this).height(); 765 } 766 767 }); 768 769 nodos.css("max-height", $max); 770 771 // elementos.css("height", height); 772} 773 774function igualarAlturaElementos(nodos) { 775 var $max = 0; 776 777 nodos.each(function () { 778 // console.log($(this).height()); 779 if ($(this).outerHeight() > $max) { 780 $max = $(this).outerHeight(); 781 } 782 783 });
784 785 nodos.css("height", $max); 786 $maxPx = $max + 'px'; 787 788 // nodos.each(function () { 789 // // console.log($(this).siblings("img").height()); 790 // }); 791 792 793 // elementos.css("height", height); 794} 795 796function igualarAlturaBanners(nodos) { 797 var $max = 0; 798 799 nodos.each(function () { 800 // console.log($(this).height()); 801 if ($(this).outerHeight() > $max) { 802 $max = $(this).outerHeight(); 803 } 804 805 }); 806 807 nodos.css("height", $max); 808 $maxPx = $max + 'px'; 809 810 nodos.each(function () { 811 console.log($(this).siblings("img").height()); 812 }); 813 814 815 // elementos.css("height", height); 816} 817 818function botonToTop() { 819 if ($(window).scrollTop() > 300) { 820 $(".boton-to-top").addClass("active"); 821 } else { 822 $(".boton-to-top").removeClass("active"); 823 } 824} 825 826 827//Aviso de Cookies 828 829function getCookie(e) { 830 var o = document.cookie, i = o.indexOf(" " + e + "="); 831 if (-1 == i && (i = o.indexOf(e + "=")), -1 == i) o = null; else { 832 i = o.indexOf("=", i) + 1; 833 var c = o.indexOf(";", i); 834 -1 == c && (c = o.length), o = unescape(o.substring(i, c)); 835 } 836 return o; 837} 838 839function setCookie(e, o, i, c) { 840 var n = new Date(); 841 n.setDate(n.getDate() + c); 842 var s = escape(o) + (null == c ? "" : "; expires=" + n.toUTCString()) + (null == i ? "" : "; path=" + i); 843 document.cookie = e + "=" + s; 844} 845 846function processCookieNotification() { 847 var e = getCookie(cookiesPolicyCookieName); 848 null != e && "" != e ? $(".cookie-wrapper").remove() : ($(".cookie-wrapper").css("display", "block").slideDown(500), 849 showAvisoCookiesOnlyOneTime && (cookieType == sessionCookieType ? setCookie(cookiesPolicyCookieName, cookiesPolicyCookieValue, "/", null) : setCookie(cookiesPolicyCookieName, cookiesPolicyCookieValue, "/", cookieTime)), 850 $("a.cerrar").click(function (e) { 851 e.preventDefault(), $(".cookie-wrapper").slideUp(500, function () { 852 $(this).remove(); 853 }); 854 }), $("a.aceptar-cookies").click(function (e) { 855 e.preventDefault(), $(".cookie-wrapper").slideUp(500, function () { 856 $(this).remove(); 857 }); 858 })); 859} 860 861var cookieTime = 1e5, cookieType = "persistente", showAvisoCookiesOnlyOneTime = !0, 862 cookiesPolicyCookieName = "COOKIES_POLICY", cookiesPolicyCookieValue = "true", 863 sessionCookieType = "sesion"; 864 865$(document).ready(function () { 866 $(".cookie-wrapper").length > 0 && processCookieNotification(); 867 868 if ($('.item_fichero-der.abridor_mas_info').length > 0) { 869 $('.item_fichero-der.abridor_mas_info').click(function () { 870 $(this).siblings('.textoinfo').slideToggle(); 871 }); 872 } 873 874}); 875 876$(window).on('load', function () { 877 $('.encabezado-fichero').off('click'); 878 $('.encabezado-fichero').click(function (e) { 879 e.preventDefault(); 880 e.stopPropagation(); 881 var selector = $(this).attr('href'); 882 $(selector).fadeToggle(); 883 }); 884}); 885 886// Desplegables en /es/ayto/telefonos-de-interes 887$(window).on('load', function () { 888 if ($('.nombresitio').length > 0) { 889 $('.nombresitio').click(function () { 890 let wasOpen = $(this).closest('.ficha_directorio').hasClass('desplegado'); 891 $('.mascampos_directorio').slideUp(200); 892 $('.ficha_directorio').removeClass('desplegado'); 893 if (!wasOpen) { 894 $(this).siblings('.mascampos_directorio').slideDown(200); 895 $(this).closest('.ficha_directorio').addClass('desplegado'); 896 } 897 }); 898 } 899 900 // El footer se mantiene pegado al fondo via CSS (body flex + min-height:100dvh), 901 // fiable en iOS Safari. Antes se rellenaba por JS y dejaba huecos. 902 903}); 904 905// Scroll suave con offset de la cabecera 906/*$('a[href*="#"]:not([href="#"])').click(function() { 907 var offset = -($('header.cabecera').height() + 45); 908 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 909 var target = $(this.hash); 910 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 911 if (target.length) { 912 $('html, body').animate({ 913 scrollTop: target.offset().top + offset 914 }, 1000); 915 return false; 916 } 917 } 918});*/
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.