1/***************************************************************************** 2* Proyecto: INTRODUCIR NOMBRE DEL PROYECTO 3* Desripcion: Fichero de implementación para libre modificación del equipo 4* de proyecto 5******************************************************************************/ 6 7 8$(document).ready(function(){ 9 10 var urlRedirect = window.location.href; 11 if(urlRedirect.indexOf("buscador-gsa/buscadorAvanzado") != -1){ 12 $(".content_buttons").append("<p style='float: left;margin-top: 1em;color: red;'>El buscador avanzado puede no estar disponible en estos momentos. Se está trabajando en generar una nueva versión compatible con los nuevos requisitos de Google. El buscador predictivo y el buscador de soluciones están operativos.</p>"); 13} 14 15 16 if ($('.mod-share').length) { 17 var currentURL = window.location.href; 18 var targetId = "_hiddenCopyText_"; 19 var urlRedirect = window.location.href; 20 if(urlRedirect.indexOf("des-pae.redsara.es") != -1){ 21 var urlAux="https://des-pae.redsara.es/PAe/urlamigable.htm?urlAnalizar="; 22 }else if(urlRedirect.indexOf("pre-pae.redsara.es") != -1){ 23 var urlAux="https://pre-pae.redsara.es/PAe/urlamigable.htm?urlAnalizar="; 24 }else if (urlRedirect.indexOf("administracionelectronica.gob.es") != -1){ 25 var urlAux="https://administracionelectronica.gob.es/PAe/urlamigable.htm?urlAnalizar="; 26 }else{ 27 var urlAux="https://administracionelectronica.gob.es/PAe/urlamigable.htm?urlAnalizar="; 28 } 29 30 $.ajax({
31 type : "GET", 32 33 url : urlAux + currentURL, 34 success : function(data) { 35 var target = document.createElement("textarea"); 36 target.type = "hidden" ; 37 target.style.position = "absolute"; 38 target.style.left = "-9999px"; 39 target.style.top = "0"; 40 target.id = targetId; 41 target.setAttribute("title", "hiddenCopyText"); 42 document.body.appendChild(target); 43 target.value = data; 44 45 addthis_share = { 46 url: data 47 } 48 //var url = document.getElementById("_hiddenCopyText_").value; 49 //$('#botonFacebook').prop( "addthis:url", url); 50 51 }, 52 error : function(xhr, ajaxOptions, thrownError) { 53 } 54 }); 55 56 57 } 58 59 //INI Funcion cambiar ROLE menu mobile 60 var tablaMenu = document.getElementsByClassName("tabletMobile"); 61 62 for (var i = 0; i < tablaMenu.length; i++) { 63 64 var tablaMenuChild = tablaMenu[i].getElementsByTagName("li"); 65 66 67 if (tablaMenuChild != null) { 68 69 for (var k = 0; k < tablaMenuChild.length; k++) { 70 if (tablaMenuChild[k].getAttribute("role") != null) { 71 tablaMenuChild[k].removeAttribute("role"); 72 } 73 74 var tablaMenuChild2 = tablaMenuChild[k].getElementsByTagName("ul"); 75 for (var j = 0; j < tablaMenuChild2.length; j++) { 76 if (tablaMenuChild2[j].getAttribute("role") != null) { 77 tablaMenuChild2[j].removeAttribute("role"); 78 } 79 } 80 } 81 } 82 } 83 84 var tabpanelCambio = document.getElementsByClassName("tabletMobile")[0]; 85 if(tabpanelCambio != null){ 86 87 if(tabpanelCambio.getAttribute("role") != null){ 88 tabpanelCambio.setAttribute("role", "navigation"); 89 90 } 91 } 92 93 //FIN Funcion cambiar ROLE menu mobile 94 95 //INI funcion mover style body a head 96 97 var elementoServiceStyle = document.getElementById("service-icons-0"); 98 99 if(elementoServiceStyle != null){ 100 if(document.getElementById("service-icons-0") != null){ 101 document.getElementById("service-icons-0").remove; 102 } 103 document.getElementsByTagName('head')[0].appendChild(elementoServiceStyle); 104 } 105 106 //FIN funcion mover style body a head 107 108 //INI funcion Ajax MANTPAE-607 109 var currentURL = window.location.pathname; 110 111 112 if (currentURL.indexOf("verPestanaMas") != -1) { 113 if ($('#correo').val()===""){ 114 var url = 'verPestanaMass.htm'; 115 $.ajax({
116 type : "POST", 117 url : url, 118 success : function(data) { 119 $('#correo').val(data); 120 }, 121 error : function(xhr, ajaxOptions, thrownError) { 122 } 123 }); 124 } 125 } 126 127 if (currentURL.indexOf("/mas") != -1) { 128 if ($('#correo').val()===""){ 129 var url = '../verPestanaMass.htm'; 130 $.ajax({ 131 type : "POST", 132 url : url, 133 success : function(data) { 134 $('#correo').val(data); 135 }, 136 error : function(xhr, ajaxOptions, thrownError) { 137 } 138 }); 139 } 140 } 141 142 143 //INI funcion Ajax urlsAmigables 144 $("#acc-copiar").click(function() { 145 var copyText = document.getElementById("_hiddenCopyText_"); 146 147 /* Select the text field */ 148 copyText.select(); 149 150 /* Copy the text inside the text field */ 151 document.execCommand("copy"); 152 153 alert("Se ha copiado el siguiente link a su portapapeles" + " " + copyText.value) 154 }); 155 156 157 158 159 160 //FIN funcion Ajax MANTPAE-607 161 162 $('a[title="Solicitud de acceso a la comunidad"]').eq(0).addClass("disabled"); 163 $('a[title="Solicitud de acceso a la comunidad"]').parent().before('<div style="margin-top: 1.5em" id="avisoDiv"><div style="float: left;margin-right: 5px;margin-bottom: 20px;">*<input type="checkbox" style=" margin-left: 5px;"id="aviso"/></div><div><p class="aviso-text">Doy mi consentimiento para que los datos personales que facilito puedan ser utilizados por el Sector Público Estatal, en el ámbito de la colaboración en esta Comunidad y sus servicios asociados. Tanto para la recepción de información y comunicaciones como para el intercambio de ésta entre los miembros de la Comunidad.</p><div><div style="float: left;margin-right: 5px;margin-bottom: 20px;"><p class="aviso-text" style="">Puede consultar la polÃtica de protección de datos del PAe y CTT en su <a href="http://administracionelectronica.gob.es/pae_Home/pae_Informacion/pae_AvisoLegal.html" target="_blank">aviso legal</a></p></div></div></div>'); 164 165 $("#aviso").click(function() { 166 if($("#aviso").prop("checked")){ 167 $('a[title="Solicitud de acceso a la comunidad"]').eq(0).removeClass("disabled"); 168 }else{ 169 $('a[title="Solicitud de acceso a la comunidad"]').eq(0).addClass("disabled"); 170 } 171 }); 172 173 //ini js de aviso legal temporal 174 /*$(".aviso-text-info").hide(); 175 $(".aviso-text").hide(); 176 177 $("#alta").prop("disabled", true);
178 $('input[name=suscribirse').eq(0).prop("disabled",true); 179 $("#altaDiscusion").prop("disabled", true); 180 $("#altaComentario").prop("disabled", true); 181 $("#altaTema").prop("disabled", true); 182 $("#aceptar").prop("disabled", true); 183 184 $("#desEmailAlta").after('<div style="margin-top: 5em"><div style="float: left;margin-right: 5px;margin-bottom: 20px;">*<input type="checkbox" style=" margin-left: 5px;"id="aviso"/></div><div><p class="aviso-text">Doy mi consentimiento para que los datos personales que facilito puedan ser utilizados por el Sector Público Estatal, en el portal PAe (Portal de la Administración Electrónica) y sus servicios asociados para la recepción de información y comunicaciones.</p><div><div style="float: left;margin-right: 5px;margin-bottom: 20px;"><p class="aviso-text" style="margin-left: 3.2em;">Puede consultar la polÃtica de protección de datos del PAe y CTT en su <a href="http://administracionelectronica.gob.es/pae_Home/pae_Informacion/pae_AvisoLegal.html" target="_blank">aviso legal</a></p></div></div></div>'); 185 $("#emailAlta").after('<div style="margin-top: 5em"><div style="float: left;margin-right: 5px;margin-bottom: 20px;">*<input type="checkbox" style=" margin-left: 5px;"id="aviso"/></div><div><p class="aviso-text">Doy mi consentimiento para que los datos personales que facilito puedan ser utilizados por el Sector Público Estatal, en el portal PAe (Portal de la Administración Electrónica) y sus servicios asociados para la recepción de información y comunicaciones.</p><div><div style="float: left;margin-right: 5px;margin-bottom: 20px;"><p class="aviso-text" style="">Puede consultar la polÃtica de protección de datos del PAe y CTT en su <a href="http://administracionelectronica.gob.es/pae_Home/pae_Informacion/pae_AvisoLegal.html" target="_blank">aviso legal</a></p></div></div></div>'); 186 $("#altaDiscusion").parent().before('<div style="margin-top: 1.5em" id="avisoDiv"><div style="float: left;margin-right: 5px;margin-bottom: 20px;">*<input type="checkbox" style=" margin-left: 5px;"id="aviso"/></div><div><p class="aviso-text">Doy mi consentimiento para que los datos personales que facilito puedan ser utilizados por el Sector Público Estatal, en el portal PAe (Portal de la Administración Electrónica) y sus servicios asociados para la recepción de información y comunicaciones.</p><div><div style="float: left;margin-right: 5px;margin-bottom: 20px;"><p class="aviso-text" style="">Puede consultar la polÃtica de protección de datos del PAe y CTT en su <a href="http://administracionelectronica.gob.es/pae_Home/pae_Informacion/pae_AvisoLegal.html" target="_blank">aviso legal</a></p></div></div></div>'); 187 $("#altaComentario").parent().before('<div style="margin-top: 1.5em" id="avisoDiv"><div style="float: left;margin-right: 5px;margin-bottom: 20px;">*<input type="checkbox" style=" margin-left: 5px;"id="aviso"/></div><div><p class="aviso-text">Doy mi consentimiento para que los datos personales que facilito puedan ser utilizados por el Sector Público Estatal, en el portal PAe (Portal de la Administración Electrónica) y sus servicios asociados para la recepción de información y comunicaciones.</p><div><div style="float: left;margin-right: 5px;margin-bottom: 20px;"><p class="aviso-text" style="">Puede consultar la polÃtica de protección de datos del PAe y CTT en su <a href="http://administracionelectronica.gob.es/pae_Home/pae_Informacion/pae_AvisoLegal.html" target="_blank">aviso legal</a></p></div></div></div>'); 188 $("#altaTema").parent().before('<div style="margin-top: 1.5em" id="avisoDiv"><div style="float: left;margin-right: 5px;margin-bottom: 20px;">*<input type="checkbox" style=" margin-left: 5px;"id="aviso"/></div><div><p class="aviso-text">Doy mi consentimiento para que los datos personales que facilito puedan ser utilizados por el Sector Público Estatal, en el portal PAe (Portal de la Administración Electrónica) y sus servicios asociados para la recepción de información y comunicaciones.</p><div><div style="float: left;margin-right: 5px;margin-bottom: 20px;"><p class="aviso-text" style="">Puede consultar la polÃtica de protección de datos del PAe y CTT en su <a href="http://administracionelectronica.gob.es/pae_Home/p
188ae_Informacion/pae_AvisoLegal.html" target="_blank">aviso legal</a></p></div></div></div>'); 189 $("#aceptar").parent().before('<div style="margin-top: 1.5em" id="avisoDiv"><div style="float: left;margin-right: 5px;margin-bottom: 20px;">*<input type="checkbox" style=" margin-left: 5px;"id="aviso"/></div><div><p class="aviso-text">Doy mi consentimiento para que los datos personales que facilito puedan ser utilizados por el Sector Público Estatal, en el portal PAe (Portal de la Administración Electrónica) y sus servicios asociados para la recepción de información y comunicaciones.</p><div><div style="float: left;margin-right: 5px;margin-bottom: 20px;"><p class="aviso-text" style="">Puede consultar la polÃtica de protección de datos del PAe y CTT en su <a href="http://administracionelectronica.gob.es/pae_Home/pae_Informacion/pae_AvisoLegal.html" target="_blank">aviso legal</a></p></div></div></div>'); 190 191 $("#aviso").click(function() { 192 if($("#aviso").prop("checked")){ 193 $('#alta').prop("disabled",false);
194 $('input[name=suscribirse').eq(0).prop("disabled",false); 195 $("#altaDiscusion").prop("disabled", false); 196 $("#altaComentario").prop("disabled", false); 197 $("#altaTema").prop("disabled", false); 198 $("#aceptar").prop("disabled", false); 199 }else{ 200 $('#alta').prop("disabled",true); 201 $('input[name=suscribirse').eq(0).prop("disabled",true); 202 $("#altaDiscusion").prop("disabled", true); 203 $("#altaComentario").prop("disabled", true); 204 $("#altaTema").prop("disabled", true); 205 $("#aceptar").prop("disabled", true); 206 } 207 }); 208 209 if ($("#email").val() != ""){ 210 $("#altaDiscusion").prop("disabled", false); 211 $("#altaComentario").prop("disabled", false); 212 $("#altaTema").prop("disabled", false); 213 var urlActual = window.location.href; 214 if(urlActual.indexOf("verSuscripciones") == -1){ 215 $("#avisoDiv").hide(); 216 } 217 }*/ 218 219//fin js de aviso legal temporal 220 221 $('#ahora1').change(function() { 222 if($(this).is(":checked")) { 223 $('#fecha_modificacion_dd').prop('disabled', true); 224 $('#fecha_modificacion_mm').prop('disabled', true); 225 $('#fecha_modificacion_yyyy').prop('disabled', true); 226 $('.ui-datepicker-trigger:first').css('display', 'none'); 227 }else { 228 $('#fecha_modificacion_dd').prop('disabled', false); 229 $('#fecha_modificacion_mm').prop('disabled', false); 230 $('#fecha_modificacion_yyyy').prop('disabled', false); 231 $('.ui-datepicker-trigger:first').css('display', 'block'); 232 } 233 }); 234 235 236 customCheckFiltros(); 237 colocar_subir_inicio(); 238 $('.linkButtonTop').click(function () { 239 $('html, body').animate({scrollTop: 0}, 300); 240 return false; 241 }); 242 if($(".linkListen")){ 243 var linkListen = $(".linkListen"); 244 var valLinkL = $(".linkListen").attr("href"); 245 valLinkL = valLinkL.replace("lang=ca_valencia", "lang=ca_es"); 246 $(".linkListen").attr("href", valLinkL); 247 } 248// Renderizado videos 249 if($(".object_elem")){ 250 if(navigator.userAgent.indexOf("MSIE") != -1){ 251 $('.object_elem.ie11-browser').remove(); 252 }else{ 253 $('.object_elem.ie-old').remove(); 254 } 255 $(".object_elem").each(function( index ) { 256 var parent = $(this).parent().get(0); 257 $(this).height($(parent).height()*0.7); 258 $(this).width($(parent).width()*0.7); 259 }); 260 } 261 262 $(window).resize(function(){ 263 customCheckFiltros(); 264 if(window.innerWidth<"1041" && window.innerWidth>"1024"){ 265 266 } 267 if(window.innerWidth<"768"){ 268 // igualar altura en carrusel del figure con respecto al contenedor 269 var slideIMG = $(".carousel-cont_img").height(); 270 var slideContent = $(".carousel-link").height(); 271 if (slideIMG>slideContent){ 272 $(".slick-track").css("height", slideIMG); 273 } 274 else { 275 $(".slick-track").css("height", slideContent); 276 } 277 // fin igualar altura en carrusel del figure con respecto al contenedor 278 279 } 280 else { 281 $(".slick-track").css("height", "auto"); 282 } 283 284 if (window.innerWidth <= "1024" && window.innerWidth >= "768") { 285 $(".md-carousel-content").css("padding-right","17.5px"); 286 $(".md-carousel-content").css("padding-left","17.5px"); 287 288 } 289 290 if (window.innerWidth > "1024") { 291 $(".md-carousel-content").css("padding-right","15px"); 292 $(".md-carousel-content").css("padding-left","15px"); 293 } 294 }); 295 296 var urlOrigen = window.location.href; 297 $(window).on('load', function () { 298 if(window.innerWidth<"768"){ 299 // igualar altura en carrusel del figure con respecto al contenedor 300 var slideContent = $(".md-carousel-content").height(); 301 // Get the current slide 302 $(".slick-track").css("height", slideContent); 303 // fin igualar altura en carrusel del figure con respecto al contenedor 304 } 305 306 if (window.innerWidth <= "1024" && window.innerWidth >= "768") { 307 $(".md-carousel-content").css("padding-right","17.5px"); 308 $(".md-carousel-content").css("padding-left","17.5px"); 309 } 310 311 if (window.innerWidth > "1024") { 312 $(".md-carousel-content").css("padding-right","15px"); 313 $(".md-carousel-content").css("padding-left","15px"); 314 } 315 316 //var desplegables = document.getElementsByClassName('accordion'); 317 //var desplegables = $('.accordion'); 318 //$('.accordion').accordion({ active: false, collapsible: true }); 319 //for(var i = 0; i < desplegables.length; i++){ 320 // if(desplegables[i].title == "true"){ 321 // desplegables[i].addClass('expandirAcordeonDescargas'); 322 //} 323 324 // } 325 $('.expandirAcordeonDescargas').accordion({active: 0}); 326 327 $('.accordion').each(function( i ) { 328 if($(this).attr('data-expandir') == "true"){ 329 $(this).accordion({active: 0}); 330 } 331 }); 332 333 window.history.replaceState(null, "", urlOrigen); 334 335 }); 336 337 338 $(".slick-prev,.slick-next").click(function() { 339 var currentSlide = $('.md-carousel').slick('slickCurrentSlide'); 340 $(".md-carousel-content").each(function(idx, el) { 341 var altSlideContent = $(".carousel-link")[idx].offsetHeight; 342 if (currentSlide === idx) { 343 $(".slick-track").css("height", altSlideContent); 344 } 345 }); 346 });
347 348 349 350 if ($('.mod-pestanas').length > 0) { 351 $('.mod-pestanas').each(function (index) { 352 $(this).attr('id', 'mod-pestanas_' + index); 353 $(this).find('.item_tab').each(function (index2) { 354 $(this).attr('id', 'item_tab_' + index + '_' + index2); 355 }); 356 if ($(this).attr('class').indexOf('t2') != -1) { 357 $(this).find('.tab_t2').each(function (index2) { 358 $(this).attr('id', 'tab_t2_' + index + '_' + index2); 359 }); 360 } else { 361 $(this).find('.tab').each(function (index2) { 362 $(this).attr('id', 'tab_' + index + '_' + index2); 363 }); 364 } 365 366 367 368 }); 369 // Mostramos las tabs seleccionadas 370 $('.item_tab').each(function () { 371 if ($(this).attr('class').indexOf('seleccionado') != -1) { 372 var selected_id = $(this).attr('id').replace('item_tab', ''); 373 $('#tab' + selected_id).css('display', 'block'); 374 } 375 376 377 378 }); 379 } 380 381 382 var tablaMenu = document.getElementsByClassName("tabletMobile"); 383 384for(var i = 0; i<tablaMenu.length;i++){ 385 386 var tablaMenuChild = tablaMenu[i].getElementsByTagName("li"); 387 388 389 if (tablaMenuChild != null) { 390 391 var tablaMenuChild2 = tablaMenuChild[i].getElementsByTagName("ul"); 392 393 for(var j = 0; j < tablaMenuChild2.length; j++){ 394 395 if (tablaMenuChild2[j].getAttribute("role") != null) { 396 tablaMenuChild2[j].removeAttribute("role"); 397 398 } 399 400 for (var k = 0; k < tablaMenuChild.length; k++) { 401 402 if (tablaMenuChild[k].getAttribute("role") != null) { 403 tablaMenuChild[k].removeAttribute("role"); 404 } 405 406 } 407 } 408 409 } 410} 411 412var tabpanelCambio = document.getElementsByClassName("tabletMobile")[0]; 413if(tabpanelCambio != null){ 414 415 if(tabpanelCambio.getAttribute("role") != null){ 416 tabpanelCambio.setAttribute("role", "navigation"); 417 418 } 419} 420 421 422 423 // Control click para mostrar / ocultar pestañas. 424 if ($('.item_tab').length > 0) { 425 $('.item_tab').click(function () { 426 var selected_id = $(this).parents('.mod-pestanas').first().find('.item_tab.seleccionado').first().attr('id').replace('item_tab', ''); 427 if ($(this).parents('.mod-pestanas').first().attr('class').indexOf('t2') != -1) { 428 $(this).parents('.mod-pestanas').first().find('.item_tab.seleccionado').removeClass('seleccionado'); 429 $('#tab_t2' + selected_id).css('display', 'none'); 430 var clicked_id = $(this).attr('id').replace('item_tab', ''); 431 $(this).addClass('seleccionado'); 432 $('#tab_t2' + clicked_id).css('display', 'block'); 433 } else { 434 $(this).parents('.mod-pestanas').first().find('.item_tab.seleccionado').first().removeClass('seleccionado'); 435 $('#tab' + selected_id).css('display', 'none'); 436 var clicked_id = $(this).attr('id').replace('item_tab', ''); 437 $(this).addClass('seleccionado'); 438 $('#tab' + clicked_id).css('display', 'block'); 439 } 440 441 442 443 }); 444 } 445 446//------ 447// Control de elemento menu izq 448 449//Inicializar menu izq 450if(window.innerWidth <= "1024"){ 451 if($(".mod_menu_left_showTM").length>0){ 452 453 $(".mod_menu_left_showTM").each(function( index ) { 454 var showTM= this; 455 var children = $(showTM).children('.mod-list'); 456 var elementActivo = -1; 457 var accordionCollapsible = true; 458 $(children).each(function( i ) { 459 if($(this).hasClass("lst-title")){ 460 elementActivo = i; 461 } 462 }); 463 if(elementActivo!=-1){ 464 $(this).accordion({ collapsible: accordionCollapsible, active: elementActivo, autoHeight: false, heightStyle: "content" }); 465 }else{ 466 $(this).accordion({ collapsible: accordionCollapsible, active: false, autoHeight: false, heightStyle: "content" }); 467 } 468 }); 469 $(".mod_menu_left_showTM").parents('.mod_menu_left').css("display","block"); 470 $(".mod_menu_left_showTM").parents('.mod_menu_left').css("width","100%"); 471 } 472 } 473 474//----- 475 476 //Array de dispositivos 477 var isMobile = { 478 Android: function() { 479 return navigator.userAgent.match(/Android/i); 480 }, 481 BlackBerry: function() { 482 return navigator.userAgent.match(/BlackBerry/i); 483 }, 484 iOS: function() { 485 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 486 }, 487 Opera: function() { 488 return navigator.userAgent.match(/Opera Mini/i); 489 }, 490 Windows: function() { 491 return navigator.userAgent.match(/IEMobile/i); 492 }, 493 any: function() { 494 return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); 495 } 496 }; 497 //Funcion para añadir hover a las celdas del datapicker cuando no es dispositivo movil y es tamaño tablet 498 if(!isMobile.any()){ 499 if (window.innerWidth <= "1024") { 500 $(".date-picker td").hover(function() { 501 $(this).addClass("hover-td"); 502 }, function() { 503 $(this).removeClass("hover-td"); 504 } 505 ); 506 } 507 } 508 509 //cebreado de la tabla 510 //if($(".mdtb-content .fila").length>0){ 511 //var lista = $(".mdtb-content .fila"); 512 //for(var i=0;i<lista.length;i++){i=i+1;$(lista[i]).addClass("destacado");} 513 //} 514 515 var excepcionHome = $(".content-wrapper.home").html(); 516 var excepcionEncuestas = $(".encuestaCompleta").html(); 517 var excepcionError = $(".error-general").html(); 518 var excepcionContacto = $(".form-encuesta").html(); 519 520 var urlRedirect = window.location.href; 521 522 if(urlRedirect.indexOf("des-pae.redsara.es") != -1 || urlRedirect.indexOf("des-local-pae.redsara.es") != -1){ 523 var globalUrlResumen="/general/verResumenEncuesta.htm?selected=1"; 524 }else if(urlRedirect.indexOf("pre-pae.redsara.es") != -1){ 525 var globalUrlResumen="/general/verResumenEncuesta.htm?selected=1"; 526 }else if (urlRedirect.indexOf("administracionelectronica.gob.es/pae_Home/p
526ae_map-egov") != -1){ 527 var globalUrlResumen="/general/verResumenEncuesta.htm?selected=324"; 528 }else if (urlRedirect.indexOf("administracionelectronica.gob.es") != -1){ 529 var globalUrlResumen="/general/verResumenEncuesta.htm?selected=244"; 530 }else { 531 var globalUrlResumen="/general/verResumenEncuesta.htm?selected=244"; 532 } 533 534 if (typeof excepcionHome === "undefined" && typeof excepcionEncuestas === "undefined" && 535 typeof excepcionError === "undefined" && typeof excepcionContacto === "undefined") { 536 jQuery.ajax({ 537 url: globalUrlResumen, 538 success: function (data) { 539 if(data.indexOf("block_error") == -1 && data.indexOf("error-general") == -1){ 540 $(".contenido.mod_content").append("<div class=\"resumenEncuesta\"></div>"); 541 //$(".mod_footer").append("<div class=\"resumenEncuesta\"></div>"); 542 $(".resumenEncuesta").html(data); 543 $(".resumenEncuesta").children("#trans_disclaimer").remove(); 544 $(".resumenEncuesta").children("meta").remove(); 545 if ($(".form-encuesta-resumen").length){ 546 $(".mdshr-list").prepend( "<li class='item valorar'></li>" ) 547 $(".mdshr-list").addClass( "cols2" ); 548 if ($(".mdshr-list .item").length == 6 ){ 549 $(".mdshr-list").addClass( "elm5" ); 550 } 551 $(".item.valorar").append( "<a title='Valorar Página' href='#form-enviar-encuesta' class='lnk-share'>Valorar</a>" ) 552 } 553 } 554 }, 555 error: function(data) {}, 556 async: false 557 }); 558 } 559 560 //Creacion de los divs de advertencia por js 561 562 var padre = document.getElementsByClassName("fld")[0]; 563 if(document.getElementById("listaTipoSolucionSel") != null){ 564 if(padre != null){ 565 var div1 = document.createElement('DIV'); 566 div1.id = "warningCampos"; 567 div1.className = "block_warn hideAccessible"; 568 var div2 = document.createElement('DIV'); 569 div2.id = "warningCamposTitle"; 570 div2.className = "title"; 571 div2.innerHTML = " - "; 572 var div3 = document.createElement('DIV'); 573 div3.id = "warningCamposText"; 574 div3.className = "text"; 575 div3.innerHTML = " - "; 576 577 div1.appendChild(div2); 578 div1.appendChild(div3); 579 580 581 padre.insertBefore(div1, padre.firstChild); 582 } 583 } 584 585 586 587 if (urlRedirect.indexOf("comunidades/verPestanaMas.htm") != -1){ 588 $("#informe-obs").val("observatorio-1"); 589 $("#informe-obs-2").val("observatorio-2"); 590 $("#informe-obs-3").val("observatorio-3"); 591 $("#informe-obs-4").val("observatorio-4"); 592 593 $("#radio-1").val("url"); 594 $("#radio-2").val("lista_urls"); 595 $("#radio-3").val("código_fuente"); 596 597 598 $("#amplitud").change(function () { 599 var amplitud3= $('#amplitud3').val($('#amplitud').val()); 600 }); 601 602 $(".bttn-large.fs1em").val("Solicitar informe"); 603 604 $("#informe-obs-3").change(function () { 605 $('#amplitud').append('<option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option>'); 606 var amplitud3= $('#amplitud3').val(); 607 $('#amplitud').val(amplitud3); 608 $('.17pages').text("Introduce una URL por lÃnea. Solo se analizarán un máximo de 33 páginas"); 609 610 }); 611 $("#informe-obs").change(function () { 612 var value = $('#amplitud').val(); 613 $('#amplitud').empty(); 614 $('#amplitud').append('<option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option>'); 615 $('#amplitud').val(value); 616 if( $('#amplitud')) 617 if ($('#amplitud').val() == '' || $('#amplitud').val() == null){ 618 $('#amplitud').val(4); 619 } 620 $('.17pages').text("Introduce una URL por lÃnea. Solo se analizarán un máximo de 17 páginas"); 621 }); 622 $("#informe-obs-2").change(function () { 623 var value = $('#amplitud').val(); 624 $('#amplitud').empty(); 625 $('#amplitud').append('<option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option>'); 626 $('#amplitud').val(value); 627 if ($('#amplitud').val() == '' || $('#amplitud').val() == null){ 628 $('#amplitud').val(4); 629 } 630 $('.17pages').text("Introduce una URL por lÃnea. Solo se analizarán un máximo de 17 páginas"); 631 }); 632 } 633 634 635 //Funcion aviso al pulsar activo semántico en tipo de solución 636 if(document.getElementById("listaTipoSolucionSel") != null){ 637 638 document.getElementById("listaTipoSolucionSel").onchange = function() {avisoSemanticos();}; 639 640 function avisoSemanticos(){ 641 var optionsLength = $("#listaTipoSolucionSel :selected").length; 642 643 for (var i = 0; i < optionsLength; i++) { 644 if($("#listaTipoSolucionSel :selected")[i].value == "30" && optionsLength == 1){ 645 document.getElementById("warningCamposTitle").innerHTML="AVISO."; 646 document.getElementById("warningCamposText").innerHTML='Si solo se selecciona tipo de soluci\u00F3n "Activo Semántico" la soluci\u00F3n pasar\u00E1 a ser de tipo CISE y no podr\u00E1 cambiar el tipo de soluci\u00F3n m\u00E1s tarde'; 647 $("#warningCampos").removeClass("hideAccessible"); 648 break; 649 }else if ($("#listaTipoSolucionSel :selected")[i].value == "30" && optionsLength > 1 ) { 650 document.getElementById("warningCamposTitle").innerHTML="AVISO."; 651 document.getElementById("warningCamposText").innerHTML='Si escoge mas de un tipo de soluci\u00F3n aparte de "Activo Sem\u00E1ntico" la soluci\u00F3n permanecer\u00E1 como CTT'; 652 $("#warningCampos").removeClass("hideAccessible"); 653 break; 654 }else{ 655 $("#warningCampos").addClass("hideAccessible"); 656 } 657 } 658 659 } 660 } 661 //fin 662 663 664 //Modificación literal página para encuesta en ingles 665 //var encuestaCompleta = document.getElementsByClassName("encuestaCompleta"); 666 667 if(window.location.href.indexOf("general/verEncuesta") > -1){ 668 if ( $('.encuestaCompleta').get(0).attributes.lang.nodeValue == 'en' ) { 669 $("[for=pagina]").text("Page:"); 670 }else if( $('.encuestaCompleta').get(0).attributes.lang.nodeValue == 'ca' ) { 671 $("[for=pagina]").text("Pà gina:"); 672 }else if( $('.encuestaCompleta').get(0).attributes.lang.nodeValue == 'ca_valencia' ) { 673 $("[for=pagina]").text("Pà gina:"); 674 }else if( $('.encuestaCompleta').get(0).attributes.lang.nodeValue == 'eu' ) { 675 $("[for=pagina]").text("Orria:"); 676 }else if( $('.encuestaCompleta').get(0).attributes.lang.nodeValue == 'gl' ) { 677 $("[for=pagina]").text("Páxina:"); 678 } 679 680 } 681 682 /*var menuActivos = document.getElementsByClassName("mod-list active"); 683 684 if(menuActivos.length > 1 ){ 685 if(!menuActivos[1].classList.contains("lst-subtitle") || menuActivos.length > 2){ 686 menuActivos[0].classList.remove("active"); 687 688 } 689 690 if(menuActivos[1].classList.contains("lst-subtitle") && menuActivos[0].nextElementSibling.getElementsByClassName('lst-link')[0].innerHTML == 'Gestión del CTT'){ 691 menuActivos[0].nextElementSibling.classList.add("active"); 692 menuActivos[0].classList.remove("active"); 693 694 } 695 }*/ 696 697 698 699 var listadoSubmenus = document.getElementsByClassName("soysubmenu"); 700 window.onhashchange = function() { 701 urlRedirect = window.location.href; 702 for(var i = 0; i < listadoSubmenus.length; i++){ 703 if(urlRedirect.indexOf(listadoSubmenus[i].previousElementSibling.getElementsByClassName('lst-link')[0].innerHTML.replace(/\s/g, '')) != -1){ 704 listadoSubmenus[i].classList.add("showElement"); 705 listadoSubmenus[i].previousElementSibling.classList.add("active"); 706 } 707 } 708 } 709 710 711 function getWidth() { 712 return Math.max( 713 document.body.scrollWidth, 714 document.documentElement.scrollWidth, 715 document.body.offsetWidth, 716 document.documentElement.offsetWidth, 717 document.documentElement.clientWidth 718 ); 719 } 720 721 function getHeight() { 722 return Math.max( 723 document.body.scrollHeight, 724 document.documentElement.scrollHeight, 725 document.body.offsetHeight, 726 document.documentElement.offsetHeight, 727 document.documentElement.clientHeight 728 ); 729 } 730 var altoPantalla = window.screen.height; 731 var anchoPantalla = window.screen.width; 732 var altoActual = getHeight(); 733 var anchoActual = getWidth(); 734 if(anchoActual < 768 ){ 735 var elementosMigas = document.getElementsByClassName("mmig-link"); 736 for(var i = 0; i < elementosMigas.length; i++){ 737 var posEspacio = elementosMigas[i].innerHTML.indexOf(" "); 738 if( posEspacio != -1){ 739 elementosMigas[i].innerHTML = elementosMigas[i].innerHTML.substring(0, posEspacio) + "..."; 740 } 741 } 742 } 743 744 745 urlRedirect = window.location.href; 746 for(var i = 0; i < listadoSubmenus.length; i++){ 747 if(urlRedirect.indexOf(listadoSubmenus[i].previousElementSibling.getElementsByClassName('lst-link')[0].innerHTML.replace(/\s/g, '')) != -1){ 748 listadoSubmenus[i].previousElementSibling.classList.add("active"); 749 listadoSubmenus[i].classList.add("showElement"); 750 751 } 752 } 753 754 /*if (urlRedirect.indexOf("ctt/") != -1 && document.getElementsByClassName("bannerCtt").length > 0){ 755 var elementos = document.getElementsByTagName("dt"); 756 for(var i=0; i < elementos.length; i++){ 757 if(elementos[i].innerHTML == "Normativa:"){ 758 elementos[i].innerHTML = "Accesos Directos:"; 759 } 760 } 761 }*/ 762 763 //Evento para el menu superior desplegable 764 $(".more_Act").on('click', function(event){ 765 event.stopPropagation(); 766 event.stopImmediatePropagation(); 767 768 if(anchoActual > 1024 ){ 769 if( $(this).find('.sub_list_item').css('display').toLowerCase() == 'block') { 770 $( this ).find( 'ul.sub_list_item' ).toggle(); 771 $('#accesskey_menuNav ul.sub_list_item' ).css("display", "none"); 772 773 }else{ 774 $('#accesskey_menuNav ul.sub_list_item' ).css("display", "none"); 775 $( this ).find( 'ul.sub_list_item' ).toggle(); 776 } 777 778 } 779 }); 780 //Fin del evento para el menu superior desplegable 781 782 //Evento para el menu superior desplegable desde TECLADO 783 $(".more_Act").on('keypress', function(event){ 784 if (event.key === "Enter") { 785 event.stopPropagation(); 786 event.stopImmediatePropagation(); 787 788 if(anchoActual > 1024 ){ 789 if( $(this).find('.sub_list_item').css('display').toLowerCase() == 'block') { 790 $( this ).find( 'ul.sub_list_item' ).toggle(); 791 $('#accesskey_menuNav ul.sub_list_item' ).css("display", "none"); 792 793 }else{ 794 $('#accesskey_menuNav ul.sub_list_item' ).css("display", "none"); 795 $( this ).find( 'ul.sub_list_item' ).toggle(); 796 } 797 } 798 799 }}); 800 //Fin del evento para el menu superior desplegable desde TECLADO 801 802 //Cerrar el menu superior desplegable desde TECLADO 803 $("li.sub_item.last").on('keydown', function(evento){ 804 if (evento.keyCode == 9) { 805 var ulMento = this.previousElementSibling; 806 $(ulMento).parent('ul').css("display", "none"); 807 } 808 });
809 //FIN de Cerrar el menu superior desplegable desde TECLADO 810 811 // Controlador de los submenús del menú izquierdo. 812 var acc = document.getElementsByClassName("buttonAccordion"); 813 var listPaneles = document.getElementsByClassName("panel"); 814 var i; 815 816 if(urlRedirect.indexOf("magnoliaAuthor") != -1 && urlRedirect.indexOf("pae_MenuAdministracion") != -1){ 817 for(var x = 0; x < listPaneles.length; x++) { 818 listPaneles[x].style.maxHeight = "fit-content"; 819 } 820 }else{ 821 822 // Función que se encarga de mostrar/esconder el submenú. 823 var handleSubmenuFunction = function() { 824 if (event.type == "mousedown") { 825 // Cancela el evento "focus" si se ha clickado. Previene que no se muestre en el primer click. 826 event.preventDefault(); 827 } 828 829 this.classList.toggle("active"); 830 var panel = this.nextElementSibling; 831 832 if(panel.style.maxHeight == "" && this.parentElement.classList.contains("active") && event.type == "mousedown"){ 833 834 panel.style.maxHeight = "0px"; 835 if(panel.previousElementSibling.previousElementSibling.className ="arrowdownmenuizq"){ 836 panel.previousElementSibling.previousElementSibling.className ="arrowupmenuizq"; 837 }else{ 838 panel.previousElementSibling.previousElementSibling.className ="arrowdownmenuizq"; 839 } 840 841 } else if (panel.style.maxHeight == "") { 842 843 for(var j = 0; j < listPaneles.length; j++) { 844 listPaneles[j].style.maxHeight = "0px"; 845 if(listPaneles[j].previousElementSibling.previousElementSibling.className == "arrowdownmenuizq"){ 846 listPaneles[j].previousElementSibling.previousElementSibling.className =("arrowupmenuizq"); 847 } 848 } 849 panel.style.maxHeight = panel.scrollHeight + "px"; 850 panel.previousElementSibling.previousElementSibling.className ="arrowdownmenuizq"; 851 852 } else if(panel.style.maxHeight == "0px"){ 853 854 for(var j = 0; j < listPaneles.length; j++) { 855 listPaneles[j].style.maxHeight = "0px"; 856 if(listPaneles[j].previousElementSibling.previousElementSibling.className == "arrowdownmenuizq"){ 857 listPaneles[j].previousElementSibling.previousElementSibling.className =("arrowupmenuizq"); 858 } 859 } 860 panel.style.maxHeight = panel.scrollHeight + "px"; 861 panel.previousElementSibling.previousElementSibling.className ="arrowdownmenuizq"; 862 863 }else if (event.type == "mousedown"){ 864 panel.style.maxHeight = "0px"; 865 panel.previousElementSibling.previousElementSibling.className ="arrowupmenuizq"; 866 } 867 } 868 869 for (i = 0; i < acc.length; i++) { 870 acc[i].addEventListener("focus", handleSubmenuFunction); 871 acc[i].addEventListener("mousedown", handleSubmenuFunction); 872 } 873 } 874 // Fin del controlador de los submenús del menú izquierdo. 875 876 var isIE11 = !!window.MSInputMethodContext && !!document.documentMode; 877 if (isIE11 == true){ 878 var elements = document.getElementsByClassName("blockTwitter"); 879 if (elements.length > 0) { 880 var padrenode = document.getElementsByClassName("mod_redes"); 881 var parrafoAvisoTwitter = document.createElement("p"); 882 parrafoAvisoTwitter.innerHTML = "Su navegador no admite la visualización del timeline de Twitter. Por favor, pruebe con otro navegador o actualice su versión. Puede ver el contenido accediendo a Twitter con los siguientes enlaces:"; 883 padrenode[0].insertBefore(parrafoAvisoTwitter,elements[0]); 884 } 885 } 886 887 if(isIE11 && document.getElementById("calendarEvents-next-month-but") != null && document.getElementById("calendarEvents-prev-month-but") !=null){ 888 document.getElementById("calendarEvents-next-month-but").style.top = "4px"; 889 document.getElementById("calendarEvents-prev-month-but").style.top = "4px"; 890 } 891 892 893 894 if(document.querySelector('.active .arrowupmenuizq') != null){ 895 document.querySelector('.active .arrowupmenuizq').className = "arrowdownmenuizq"; 896 } 897 //Fin de la logica para el menu izquierdo desplegable 898 899 900 901 var listaIdiomas = document.getElementsByClassName("list_multiLanguages")[0]; 902 var elementosIdioma = listaIdiomas.getElementsByClassName("item"); 903 var listaIdiomasResponsive = document.getElementsByClassName("list_multiLanguages_responsive")[0]; 904 var elementosIdiomaResponsive = listaIdiomasResponsive.getElementsByClassName("sub_item"); 905 906 907 var cargando = false;
908 for(var i = 0 && !cargando; i < elementosIdioma.length; i++){ 909 elementosIdioma[i].onclick = function(){ 910 911 var gifCargando = document.createElement("img"); 912 var usuarioAcceso = document.getElementsByClassName("usuarioAcceso"); 913 gifCargando.setAttribute("src", "/resources/templating-kit/themes/pae/images/content/ico-animado-traduccion.gif"); 914 gifCargando.setAttribute("alt", "gif de carga"); 915 gifCargando.setAttribute("title", "cargando"); 916 gifCargando.classList.add("gifCargando"); 917 if(usuarioAcceso.length > 0){ 918 gifCargando.style.marginTop = 0; 919 } 920 921 if(!cargando){ 922 document.getElementsByClassName("bckHeader")[0].appendChild(gifCargando); 923 cargando = true; 924 } 925 926 } 927 /* 928 929 for(var i = 0; i < elementosIdioma.length; i++){ 930 elementosIdioma[i].onclick = function(){ 931 932 var gifCargando = document.createElement("img"); 933 var usuarioAcceso = document.getElementsByClassName("usuarioAcceso"); 934 gifCargando.setAttribute("src", "/resources/templating-kit/themes/pae/images/content/ico-animado-traduccion.gif"); 935 gifCargando.setAttribute("alt", "gif de carga"); 936 gifCargando.setAttribute("title", "cargando"); 937 gifCargando.classList.add("gifCargando"); 938 if(usuarioAcceso.length > 0){ 939 gifCargando.style.marginTop = 0; 940 } 941 942 document.getElementsByClassName("bckHeader")[0].appendChild(gifCargando); 943 944 945 } 946 */ 947 elementosIdiomaResponsive[i].onclick = function(){ 948 949 var gifCargando = document.createElement("img"); 950 var usuarioAcceso = document.getElementsByClassName("usuarioAcceso"); 951 gifCargando.setAttribute("src", "/resources/templating-kit/themes/pae/images/content/ico-animado-traduccion.gif"); 952 gifCargando.setAttribute("alt", "gif de carga"); 953 gifCargando.setAttribute("title", "cargando"); 954 gifCargando.classList.add("gifCargando"); 955 956 document.getElementsByClassName("bckHeader")[0].appendChild(gifCargando); 957 958 959 } 960 } 961 962 963 964 965 var tablas = document.getElementsByTagName("table"); 966 if(tablas != null){ 967 for(var i = 0; i < tablas.length; i++){ 968 if(tablas[i].getAttribute("cellpadding") != null){ 969 tablas[i].removeAttribute("cellpadding"); 970 } 971 if(tablas[i].getAttribute("cellspacing") != null){ 972 tablas[i].removeAttribute("cellspacing"); 973 } 974 if(tablas[i].getAttribute("border") != null){ 975 tablas[i].removeAttribute("border"); 976 } 977 if(tablas[i].getAttribute("style") != null){ 978 tablas[i].removeAttribute("style"); 979 } 980 if(tablas[i].getAttribute("align") != null){ 981 tablas[i].removeAttribute("align"); 982 } 983 984 985 } 986 } 987 var buscadorSoluciones = document.getElementById("formBuscadorIniciativa"); 988 if(buscadorSoluciones!=null){ 989 var linksAyuda = buscadorSoluciones.getElementsByTagName("span"); 990 } 991 992 if(linksAyuda != null){ 993 for(var i = 0; i < linksAyuda.length; i++){ 994 if(linksAyuda[i].getAttribute("role") != null){ 995 linksAyuda[i].setAttribute("role", "alert"); 996 } 997 } 998 } 999 1000 var bloqueErrorParrafo = $(".block_error .text p"); 1001 if (bloqueErrorParrafo != null){ 1002 bloqueErrorParrafo.attr( "role", "alert" ); 1003 } 1004 1005 1006 if (urlRedirect.indexOf("?comentarioContenido=0#comentarios") != -1){ 1007 $('#form-comentario-contenido').attr("action", $('#form-comentario-contenido').attr("action").replace("http://", "https://")); 1008 1009 } 1010 1011 if (urlRedirect.indexOf("?comentarioContenido=0#comentarios") != -1){ 1012 $('#form-comentario-contenido').attr("action", $('#form-comentario-contenido').attr("action").replace("http://", "https://")); 1013 1014 } 1015 1016 if (urlRedirect.indexOf("/ctt/buscadorSoluciones.htm?urlMagnolia=/pae_Home/p
1016ae_SolucionesCTT/pae_BuscadorSol.html") != -1){ 1017 $(".block_error").addClass('hideAccessible'); 1018 } 1019 1020 1021 if (urlRedirect.indexOf("/ctt/buscadorSolucionesAbstract.htm?urlMagnolia=/pae_Home/pae_SolucionesCTT/pae_BuscadorSolAbstract.html") != -1){ 1022 $(".block_error").addClass('hideAccessible'); 1023 } 1024 1025 1026 1027}); 1028 1029 // INICIO Eliminar INSERTAR twitter 1030 1031 1032 // FIN Eliminar INSERTAR twitter 1033 1034(function($){ 1035 $.fn.UItoTop = function(options) { 1036 1037 var defaults = { 1038 text: 'To Top', 1039 min: 200, 1040 inDelay:600, 1041 outDelay:400, 1042 containerID: 'toTop', 1043 containerHoverID: 'toTopHover', 1044 scrollSpeed: 1200, 1045 easingType: 'linear' 1046 }, 1047 settings = $.extend(defaults, options), 1048 containerIDhash = '#' + settings.containerID, 1049 containerHoverIDHash = '#'+settings.containerHoverID; 1050 1051 $('body').append('<a href="#" id="'+settings.containerID+'">'+settings.text+'</a>'); 1052 $(containerIDhash).hide().on('click.UItoTop',function(){ 1053 $('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType); 1054 $('#'+settings.containerHoverID, this).stop().animate({'opacity': 0 }, settings.inDelay, settings.easingType); 1055 return false; 1056 }) 1057 .prepend('<span id="'+settings.containerHoverID+'"></span>') 1058 .hover(function() { 1059 $(containerHoverIDHash, this).stop().animate({ 1060 'opacity': 1 1061 }, 600, 'linear'); 1062 }, function() { 1063 $(containerHoverIDHash, this).stop().animate({ 1064 'opacity': 0 1065 }, 700, 'linear'); 1066 }); 1067 1068 $(window).scroll(function() { 1069 var sd = $(window).scrollTop(); 1070 if(typeof document.body.style.maxHeight === "undefined") { 1071 $(containerIDhash).css({ 1072 'position': 'absolute', 1073 'top': sd + $(window).height() - 50 1074 }); 1075 } 1076 if ( sd > settings.min ) 1077 $(containerIDhash).fadeIn(settings.inDelay); 1078 else 1079 $(containerIDhash).fadeOut(settings.Outdelay); 1080 }); 1081}; 1082})(jQuery); 1083 1084 1085function colocar_subir_inicio() { 1086 var scrollTop = $(window).scrollTop(); 1087 if (scrollTop === 0) { 1088 $(".buttonUp").addClass('top'); 1089 } else { 1090 $(".buttonUp").removeClass('top'); 1091 } 1092} 1093var scrollTimeout; 1094$(window).scroll(function () { 1095 if (scrollTimeout) { 1096 clearTimeout(scrollTimeout); 1097 } 1098 setTimeout(colocar_subir_inicio, 500); 1099}); 1100 1101function ocultar_acordeones() { 1102 if($('#ocultar').prop('value') == 'Expandir'){ 1103 $('.accordion').accordion({ 1104 active: 0 1105 }); 1106 $("#ocultar").prop('value', 'Contraer'); 1107 }else{ 1108 $('.accordion').accordion({ 1109 active: false, 1110 collapsible: true 1111 }); 1112 $("#ocultar").prop('value', 'Expandir'); 1113 1114 } 1115 } 1116 1117function fncConfirmarBorrar() { 1118 var res = confirm("¿Desea eliminar la noticia?"); 1119 if(!res) { 1120 return false; 1121 }else { 1122 return true; 1123 } 1124} 1125 1126function customCheckFiltros(){ 1127 //pae-FILTROS CTT 1128 // checkea y descheckea todos los checkbox de los filtros 1129 if($(".mod_filtros .selAll .fmf-checkbox")){ 1130 if($(".mod_filtros .selAll .fmf-checkbox").length>0){ 1131 var itemTodas = $(".mod_filtros .selAll .fmf-checkbox"); 1132 var itemAll = $(".mod_filtros .description .fmf-checkbox"); 1133 if(itemTodas!=null && itemAll!=null){ 1134 if(window.innerWidth>"1024"){ 1135 $(itemTodas).click(function(){ 1136 if($(itemTodas).is(':checked')) { 1137 $(itemAll).prop('checked', true); 1138 $(itemAll).prop('checked', true); 1139 } else {
1140 $(itemAll).prop('checked',false); 1141 } 1142 }); 1143 }else if($(".mod_filtros .selAll .icheckbox .iCheck-helper")){ 1144 $(".mod_filtros .selAll .icheckbox .iCheck-helper").click(function(){ 1145 if($(itemTodas).is(':checked')) { 1146 $(itemAll).prop('checked', true); 1147 if($(".mod_filtros .description .icheckbox").length>0) 1148 $(".mod_filtros .description .icheckbox").addClass("checked"); 1149 } else { 1150 $(itemAll).prop('checked',false); 1151 if($(".mod_filtros .description .icheckbox").length>0) 1152 $(".mod_filtros .description .icheckbox").removeClass("checked"); 1153 } 1154 }); 1155 } 1156 } 1157 } 1158 } 1159 if($(".mod-busc-apps .seeker .checkbox-list .selAll .fmf-checkbox")){ 1160 if($(".mod-busc-apps .seeker .checkbox-list .selAll .fmf-checkbox").length>0){ 1161 if(window.innerWidth>"1024"){ 1162 var itemTodas = $(".mod-busc-apps .seeker .checkbox-list .selAll .fmf-checkbox"); 1163 if(itemTodas!=null){ 1164 $(itemTodas).click(function(){ 1165 var itemAll = $(this).closest(".checkbox-list").find(".fmf-checkbox"); 1166 if(itemAll!=null){ 1167 if($(this).is(':checked')) { 1168 $(itemAll).prop('checked', true); 1169 if($(itemAll).parent(".icheckbox").length>0){ 1170 $(itemAll).parent(".icheckbox").addClass("checked"); 1171 } 1172 } else { 1173 $(itemAll).prop('checked',false); 1174 if($(itemAll).parent(".icheckbox").length>0){ 1175 $(itemAll).parent(".icheckbox").removeClass("checked"); 1176 } 1177 } 1178 } 1179 }); 1180 } 1181 }else if($(".mod-busc-apps .seeker .checkbox-list .selAll .icheckbox")){ 1182 $(".mod-busc-apps .seeker .checkbox-list .selAll .icheckbox .iCheck-helper").click(function(){ 1183 var itemTodas = $(this).parent().children(".fmf-checkbox"); 1184 var itemAll = $(this).closest(".checkbox-list").find(".fmf-checkbox"); 1185 if($(itemTodas).is(':checked')) { 1186 $(itemAll).prop('checked', true); 1187 if($(itemAll).parent(".icheckbox").length>0){ 1188 $(itemAll).parent(".icheckbox").addClass("checked"); 1189 } 1190 } else { 1191 $(itemAll).prop('checked',false); 1192 if($(itemAll).parent(".icheckbox").length>0){ 1193 $(itemAll).parent(".icheckbox").removeClass("checked"); 1194 } 1195 } 1196 }); 1197 } 1198 } 1199 } 1200} 1201 1202$('.mfoot-list').keydown( 1203 function (ev) { 1204 1205 if (ev.keyCode == 39) { 1206 ev.preventDefault(); 1207 $(this).next().find('a:first').focus(); 1208 } 1209 if (ev.keyCode == 37) { 1210 ev.preventDefault(); 1211 $(this).prev().find('a:first').focus(); 1212 1213 } 1214 1215 } 1216); 1217$('.mod_footer').keydown( 1218 function (ev) { 1219 1220 if (ev.keyCode == 40) { 1221 ev.preventDefault(); 1222 $(".listfl-item:focus").closest('li').next().find('a.listfl-item').focus(); 1223 1224 1225 } 1226 1227 1228 if (ev.keyCode == 38) { 1229 ev.preventDefault(); 1230 $(".listfl-item:focus").closest('li').prev().find('a.listfl-item').focus(); 1231 1232 } 1233 1234 } 1235); 1236 1237 1238$(window).resize(function(){ 1239 if(window.innerWidth <= "1024"){ 1240 if($(".mod_menu_left_showTM").length>0){ 1241 1242 $(".mod_menu_left_showTM").each(function( index ) { 1243 var showTM= this; 1244 var children = $(showTM).children('.mod-list'); 1245 var elementActivo = -1; 1246 var accordionCollapsible = true; 1247 $(children).each(function( i ) { 1248 if($(this).hasClass("lst-title")){ 1249 elementActivo = i; 1250 } 1251 }); 1252 if(elementActivo!=-1){ 1253 $(this).accordion({ collapsible: accordionCollapsible, active: elementActivo, autoHeight: false, heightStyle: "content" }); 1254 }else{ 1255 $(this).accordion({ collapsible: accordionCollapsible, active: false, autoHeight: false, heightStyle: "content" }); 1256 } 1257 });
1258 $(".mod_menu_left_showTM").parents('.mod_menu_left').css("display","block"); 1259 $(".mod_menu_left_showTM").parents('.mod_menu_left').css("width","100%"); 1260 } 1261 } else if (window.innerWidth > "1024") { 1262 if($(".mod_menu_left_showTM").hasClass("ui-accordion")){ 1263 $(".mod_menu_left_showTM").accordion("destroy"); 1264 } 1265 $(".mod_menu_left_showTM").parents('.mod_menu_left').css("width","20%"); 1266 } 1267 }); 1268 1269 1270 1271 $( function() { 1272 1273 var urlRedirect = window.location.href; 1274 1275 var baseURL = window.location.origin; 1276 1277 $.widget( "custom.catcomplete", $.ui.autocomplete, { 1278 _create: function() { 1279 this._super(); 1280 this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" ); 1281 var ul = this.menu.element.empty(); 1282 if(ul) { 1283 ul.append( "<li>No results</li>" ); 1284 } 1285 }, 1286 _renderItem: function(ul, item) { 1287 if (!item.route || 0 === item.route.length) { 1288 return $("<li>") 1289 .append(item.label) 1290 .appendTo(ul); 1291 } else { 1292 return $("<li>") 1293 .append("<a href='"+baseURL+item.route+"' title='Ir' >"+item.label+"</a>") 1294 .appendTo(ul); 1295 } 1296 }, 1297 _renderMenu: function( ul, items ) { 1298 var that = this, 1299 currentCategory = ""; 1300 $.each( items, function( index, item ) { 1301 var li; 1302 if ( item.category != currentCategory ) { 1303 ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" ); 1304 currentCategory = item.category; 1305 } 1306 li = that._renderItemData( ul, item ); 1307 if ( item.category ) { 1308 li.attr( "aria-label", item.category + " : " + item.label ); 1309 } 1310 }); 1311 } 1312 }); 1313 1314 $( "#busqueda" ).catcomplete({ 1315 source: baseURL + '/buscador-gsa/autoComplete.htm', 1316 delay: 500, 1317 minLength: 3,//min = 3 caracteres 1318 position: { collision: 'fit' }, 1319 select : function(event, ui){ 1320 console.log( ui.item.value ); 1321 document.getElementById( 'busqueda' ).value = ui.item.value; 1322 } 1323 }); 1324 1325 $( "#busqueda_tm" ).catcomplete({ 1326 source: baseURL + '/buscador-gsa/autoComplete.htm', 1327 delay: 500, 1328 minLength: 3,//min = 3 caracteres 1329 select : function(event, ui){ 1330 console.log( ui.item.value ); 1331 document.getElementById( 'busqueda_tm' ).value = ui.item.value; 1332// document.getElementById( 'btn-busqueda').click(); 1333 } 1334 }).catcomplete( "widget" ).addClass("busqueda-movil"); 1335 1336 } ); 1337$(function() { 1338 1339const VK_LEFT = 37; 1340const VK_UP = 38; 1341const VK_RIGHT = 39; 1342const VK_DOWN = 40; 1343 1344$('.mfoot-list').keydown( 1345 function (ev) { 1346 1347 if (ev.keyCode == 39) { 1348 ev.preventDefault(); 1349 $(this).next().find('a:first').focus(); 1350 } 1351 if (ev.keyCode == 37) { 1352 ev.preventDefault(); 1353 $(this).prev().find('a:first').focus(); 1354 1355 } 1356 1357 1358 } 1359); 1360$('.mod_footer').keydown( 1361 function (ev) { 1362 1363 if (ev.keyCode == 40) { 1364 ev.preventDefault(); 1365 $(".listfl-item:focus").closest('li').next().find('a.listfl-item').focus(); 1366 1367 1368 } 1369 1370 1371 if (ev.keyCode == 38) { 1372 ev.preventDefault(); 1373 $(".listfl-item:focus").closest('li').prev().find('a.listfl-item').focus(); 1374 1375 } 1376 1377 } 1378); 1379 }); 1380 1381 1382 1383 1384/*$(function() { 1385 1386 1387const tabs = document.querySelectorAll('.content_principal[role="tab"]'); 1388var content = document.querySelectorAll('.content_secundary[role="tabpanel"]'); 1389var index = 0; var isLink = false; var links; 1390var header, panel, idLinks; 1391var linkFocus = 0; 1392 1393$(".content_principal").focus(function () { 1394 for (var i = 0; i < tabs.length; i++) { 1395 if (tabs[i].classList.contains("ui-state-focus", "ui-accordion-header-collapsed")) { 1396 header = tabs[i]; 1397 panel = content[i]; 1398 1399 if ($(content[i]).children().find('a').length > 0) { 1400 index = i; 1401 isLink = true; 1402 idLinks = $(content[i]).attr('id'); 1403 links = $(content[i]).children().find('a') 1404 } else { 1405 isLink = false; 1406 } 1407 } 1408 } 1409 var span = $(header).find('span'); 1410 $(panel).css({ display: "block" });
1411 header.classList.add("ui-state-hover", "ui-accordion-header-active", "ui-state-active"); 1412 header.classList.remove("ui-accordion-header-collapsed", "ui-corner-all"); 1413 header.setAttribute("aria-selected", "true"); header.setAttribute("aria-expanded", "true"); 1414 $(span).removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-e"); 1415 panel.classList.add("ui-accordion-content-active"); 1416 panel.setAttribute("aria-hidden", "false") 1417}); 1418function openPanel(){ 1419 var span = $(header).find('span'); 1420 $(panel[idx]).css({ display: "block" }); 1421 $(header[idx]).removeClass("ui-accordion-header-collapsed ui-corner-all").addClass(" ui-state-active ui-state-hover ui-accordion-header-active"); 1422 $(header).attr("aria-selected", "true"); $(header).attr("aria-expanded", "true"); 1423 $(span).removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-e"); 1424 $(panel[idx]).addClass("ui-accordion-content-active"); 1425 $(panel).attr("aria-hidden", "false"); 1426} 1427 1428 1429 1430function closePanel() { 1431 var header = $(".content_principal"); 1432 var panel = $(".content_principal").next(); 1433 var span = $(header).find('span'); 1434 $(".content_principal").removeClass("ui-state-hover ui-accordion-header-active ui-state-active").addClass("ui-accordion-header-collapse ui-corner-all"); 1435 $(header).attr("aria-selected", "false"); $(header).attr("aria-expanded", "false"); 1436 $(panel).css({ display: "none" }); 1437 $(span).removeClass("ui-icon-triangle-1-e").addClass("ui-icon-triangle-1-s"); 1438 $(panel).removeClass("ui-accordion-content-active"); 1439 $(panel).attr("aria-hidden", "true"); 1440} 1441function openLinkTab(idx) { 1442 var span = $(header).find('span'); 1443 $(panel[idx]).css({ display: "block" }); 1444 $(header[idx]).removeClass("ui-accordion-header-collapsed ui-corner-all").addClass(" ui-state-active ui-state-hover ui-accordion-header-active"); 1445 $(header).attr("aria-selected", "true"); $(header).attr("aria-expanded", "true"); 1446 $(span).removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-e"); 1447 $(panel[idx]).addClass("ui-accordion-content-active"); 1448 $(panel).attr("aria-hidden", "false"); 1449} 1450function updatePanel(){ 1451 closePanel(); 1452 openPanel(); 1453} 1454 1455 1456$(".content_principal").focusout(function (e) { 1457 linkFocus = 0; 1458 1459 if (isLink) { 1460 linkFocus = 0; 1461 $(links[linkFocus]).focus(); 1462 $(links).keydown( 1463 function (e) { 1464 1465 1466 if (e.keyCode == 40 || e.keyCode == 39 || e.keyCode == 9) { 1467 1468 e.preventDefault(); 1469 linkFocus++; 1470 1471 } 1472 1473 if (e.keyCode == 38 || e.keyCode == 37) { 1474 e.preventDefault(); 1475 linkFocus--; 1476 if (linkFocus < 0) { 1477 linkFocus = 0; 1478 1479 } 1480 1481 } 1482 if (linkFocus >= (links.length - 1)) { 1483 closePanel(); 1484 $(tabs[index + 1]).focus(); 1485 openPanel(); 1486 1487 }else if (links.length == 1){ 1488 1489 $(tabs[index + 1]).focus(); 1490 closePanel(); 1491 1492 } else { 1493 $(links[linkFocus]).focus(); 1494 1495 1496 } 1497 } 1498 1499 ) 1500 } else { 1501 closePanel(); 1502 } 1503 }); 1504 1505});*/ 1506$(function() { 1507const tabs = document.querySelectorAll('.content_principal[role="tab"]'); 1508var content = document.querySelectorAll('.content_secundary[role="tabpanel"]'); 1509var index = 0, isLink = false, links, length; 1510 1511 1512$(".content_principal").focus(function () { 1513 for (var i = 0; i < tabs.length; i++) { 1514 if (tabs[i].classList.contains("ui-state-focus", "ui-accordion-header-collapsed") || tabs[i].classList.contains("ui-state-active")) { 1515 header = tabs[i]; 1516 panel = content[i]; 1517 1518 if ($(content[i]).children().find('a').length > 0) { 1519 index = i; 1520 isLink = true; 1521 links = $(content[i]).children().find('a') 1522 $(links).addClass('md-text-ui-links'); 1523 length = links.length; 1524 } else { 1525 isLink = false; 1526 } 1527 } 1528 } 1529 1530}); 1531 1532$(".content_principal").keydown(function (e) { 1533 if (e.keyCode == 9) { 1534 1535 console.log($( this ).next().next().focus()); 1536 if ($( this ).next().next().length == 0){ 1537 $('.mbc-areatecnica').focus(); 1538 } else { 1539 e.preventDefault(); 1540 console.log($( this ).next().next()); 1541 $( this ).next().next().focus(); 1542 } 1543} 1544 if (isLink) { 1545 $(links[0]).focus(); 1546 $('.content_secundary').unbind().keydown( 1547 function (e) { 1548 if (e.keyCode == 40 || e.keyCode == 39) { 1549 e.preventDefault(); 1550 if ($('a:focus').parent().find('a')[0] == links[links.length - 1] ){ 1551 links[0].focus(); 1552 } else { 1553 $('a:focus').parent().next().find('a').focus(); 1554 } 1555 } 1556 if (e.keyCode == 38 || e.keyCode == 37) { 1557 e.preventDefault(); 1558 if ($('a:focus').parent().find('a')[0] == links[0] ){ 1559 links[links.length - 1].focus(); 1560 } else { 1561 $('a:focus').parent().prev().find('a').focus(); 1562 } 1563 } 1564 if (e.keyCode == 9 && $('a:focus').parent().next().find('a').length == 0 ) { 1565 $('.mbc-areatecnica').focus(); 1566 $( this ).closest('div').next().focus(); 1567 } 1568 } 1569 ) 1570 } 1571 });
1572}); 1573 1574 1575$(document).ready(function() { 1576 $("ul.nvf-links a[title='RSS']").addClass("rss"); 1577 $("ul.nvf-links a[title='Biblioteca y Hemeroteca ']").addClass("biblioteca"); 1578 $("ul.nvf-links a[title='Participación']").addClass("participacion"); 1579}); 1580 1581 1582 1583 1584 1585 1586 1587
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.