1if( /iPhone/i.test(navigator.userAgent) ) { 2 document.querySelector('html').classList.add('iphone'); 3} 4 5var form_slct = []; 6 7form_slct.init = function() { 8 jQuery('select').not('.filtros-area-crr *, .hs-input').niceSelect(); 9} 10 11jQuery(function(){ 12 form_slct.init(); 13 jQuery( document ).ajaxComplete(function() { 14 form_slct.init(); 15 16 //Buscador - Asset fix autosubmit 17 input = jQuery("input[name=search]"); 18 input.focus(); 19 var tmpStr = input.val(); 20 input.val(''); 21 input.val(tmpStr); 22 23 24 }); 25}); 26 27jQuery(function(){ 28 // jQuery('img').map(function(x){ 29 // var img = jQuery('img').eq(x); 30 // img.attr('src', 'https://tec.mx/' + img.attr('src').split('drupal')[1]); 31 // }); 32 33 // var src_prefix = "https://tec.mx/"; 34 // jQuery('img').on('error',function(){ 35 // var img = jQuery(this); 36 // var src_sufix = img.attr('src'); 37 // img.attr('src', src_prefix + src_sufix); 38 // }); 39 40 (function($) { 41 $( window ).on('load', function() { 42 jQuery('.hero-sidebar-buttons a, .paragraph_map a, .to-form').each(function() { 43 if (jQuery(this).attr('href').startsWith("#")) { 44 jQuery(this).on('click', function(event) { 45 event.stopPropagation(); 46 event.preventDefault(); 47 jQuery("html, body").animate({ 48 scrollTop: jQuery(jQuery(this).attr('href')).offset().top-100 49 }, 800, "linear"); 50 }) 51 } 52 }); 53 if (jQuery('.tecbot-button').length > 0) { 54 tecbot(); 55 floatingButtonTecbot(); 56 } 57 viewCampus(); 58 campusList(); 59 enlaceContacto(); 60 }); 61 $( document ).ajaxComplete( function() { 62 viewCampus(); 63 campusList(); 64 }); 65 // $(".paragraph--type--adm-imagen-zoom").find('img').addClass('img-zoom'); 66 67$(".paragraph--type--adm-imagen-zoom").zoomer({ 68 controls: { 69 position: "bottom" 70 }, 71 increment: 0.03, 72 marginMin: 0, 73 marginMax: 0, 74 source: null 75}); 76 77jQuery(document).ajaxComplete(function () { 78 79 if ($('.busqueda-eventos-exposed .search_title input').length > 0) { 80 var titleField = $('.busqueda-eventos-exposed .search_title input'); // Asegúrate de usar el ID correcto para el campo de tÃtulo 81 82 titleField.each(function() { 83 let input_search = jQuery(this); 84 if (input_search.length) { 85 input_search.off('keyup').on('keyup', function () { 86 clearTimeout($.data(this, 'timer')); // Limpiar el temporizador anterior 87 // Establecer un temporizador para que el submit se ejecute después de 500ms de no escribir 88 $.data(this, 'timer', setTimeout(function () { 89 input_search.closest('form').find('.js-form-submit').click(); // Enviar el formulario 90 }, 1000)); 91 }); 92 } 93 }); 94 } 95 96 $(".paragraph--type--adm-imagen-zoom").zoomer({ 97 controls: { 98 position: "bottom" 99 }, 100 increment: 0.03, 101 marginMin: 0, 102 marginMax: 0, 103 source: null 104 }); 105}); 106 107 108 109 if (window.top_menu != undefined) { 110 top_menu.active = function() { 111 top_menu.activar_2('header .navigation .top-menu-nav'); 112 top_menu.activar_2('header #block-admisiones'); 113 top_menu.activar_2('header .breadcrumb '); 114 top_menu.activar_2('header #block-admisionesprepa'); 115 top_menu.activar('header .alt-top-header .top-menu-nav'); 116 top_menu.activar('header'); 117 } 118 119 function shouldApplyActiveClass() { 120 return jQuery(window).width() < 1024 121 && jQuery('.page-node-type-tercer-nivel, .page-node-type-cuarto-nivel, .page-node-type-oficina').length > 0 122 && jQuery('.titular-tercer-nivel').length > 0 123 && !jQuery('#main-navigation').hasClass('header-fixed'); 124 } 125 126 top_menu.activar_2 = function(item) { 127 var header = jQuery(item); 128 var is_active = header.hasClass('is-active'); 129 var top = jQuery(window).scrollTop(); 130 if (shouldApplyActiveClass()) { 131 if (!is_active) { 132 header.addClass('is-active'); 133 } 134 return; 135 } 136 if(top >= 31 && !is_active){ 137 header.addClass('is-active'); 138 } else if (top < 31 && is_active) { 139 header.removeClass('is-active'); 140 } 141 } 142 143 top_menu.activar = function(item) { 144 var header = jQuery(item); 145 var is_active = header.hasClass('is-active'); 146 var top = jQuery(window).scrollTop(); 147 if (shouldApplyActiveClass()) { 148 if (!is_active) { 149 header.addClass('is-active'); 150 } 151 return; 152 } 153 if(top >= 64 && !is_active){ 154 header.addClass('is-active'); 155 } else if (top < 64 && is_active) { 156 header.removeClass('is-active'); 157 } 158 } 159 160 jQuery(window).resize(function() { 161 top_menu.active(); 162 }); 163 } 164 165 if (jQuery('.floating-buttons').length > 0) { 166 jQuery('.evento-general.full').addClass('has-buttons'); 167 } 168
169 if( $('.adm-domino-abbreviation-r').length){ 170 $('.columns h3').addClass('title-siglas'); 171 }else if ($('.adm-domino-abbreviation-l').length) { 172 $('.columns h3').addClass('title-siglas'); 173 } 174 function enlaceContacto() { 175 var enlace = jQuery('#block-emulsify-encontactocontigo ul.menu'); 176 jQuery('#block-emulsify-redessociales').append(enlace); 177 jQuery('#block-emulsify-encontactocontigo').remove(); 178 } 179 180 function tecbot() { 181 var initESW = function (gslbBaseURL) { 182 embedded_svc.settings.displayHelpButton = true; //Or false 183 embedded_svc.settings.language = 'es'; //For example, enter 'en' or 'en-US' 184 embedded_svc.settings.defaultMinimizedText = 'Solicita Ayuda'; //(Defaults to Chat with an Expert) 185 embedded_svc.settings.disabledMinimizedText = 'Sin agentes disponibles'; //(Defaults to Agent Offline) 186 embedded_svc.settings.loadingText = 'Cargando...'; //(Defaults to Loading) 187 embedded_svc.settings.enabledFeatures = ['LiveAgent']; 188 embedded_svc.settings.entryFeature = 'LiveAgent'; 189 embedded_svc.init( 190 'https://micrmtec.my.salesforce.com', 191 'https://micrmtec.my.salesforce-sites.com/', 192 gslbBaseURL, 193 '00D41000001NkaU', 194 'ADM_ATR_Chatbot_TecMx', 195 { 196 baseLiveAgentContentURL: 'https://c.la13-core2.sfdc-lywfpd.salesforceliveagent.com/content', 197 deploymentId: '572UG000000Crer', 198 buttonId: '573UG000000SQsP', 199 baseLiveAgentURL: 'https://d.la13-core2.sfdc-lywfpd.salesforceliveagent.com/chat', 200 eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04IUG000001IEFF2A4_1959233c24a', 201 isOfflineSupportEnabled: false 202 } 203 ); 204 }; 205 if (!window.embedded_svc) { 206 var s = document.createElement('script'); 207 s.setAttribute('src', 'https://micrmtec.my.salesforce.com/embeddedservice/5.0/esw.min.js'); 208 s.onload = function () { 209 initESW(null); 210 }; 211 document.body.appendChild(s); 212 } else { 213 initESW('https://service.force.com'); 214 } 215 } 216 function floatingButtonTecbot() { 217 let intentos = 0; 218 let $botonFlotante = $('.adm-botones-flotantes-container button.adm-boton-flotante.tecbot-button'); 219 220 if ($botonFlotante.length > 0) { 221 setTimeout(() => { 222 let $botonTecbot = $('.embeddedServiceHelpButton .uiButton'); 223 $($botonFlotante).on('click', function() { 224 $botonTecbot.click(); 225 botonInsertarClase(this); 226 }); 227 }, 3000); 228 229 function botonInsertarClase(button) { 230 $(button).addClass('tecbot-loading'); 231 setTimeout(() => { 232 $(button).removeClass('tecbot-loading'); 233 }, 4000); 234 } 235 } 236 } 237 238 function campusList() { 239 $('#cmp-lnk02').off().on('click', function(e) { 240 e.preventDefault(); 241 // if ($(this).parent().hasClass('open')) { 242 // $(this).parent().removeClass('open'); 243 // } else { 244 // $(this).parent().addClass('open'); 245 // } 246 }); 247 $('.cmp-lnk-act').off().on('click', function(e){ 248 e.preventDefault(); 249 var idcmp = $(this).attr("id-cmp"); 250 var tid = $(this).attr("tid"); 251 var text = jQuery(this).text(); 252 jQuery(this) 253 .parents('.campus_vista--lista') 254 .find('.dropdown-toggle > div') 255 .html(text + '<i class="material-icons">keyboard_arrow_down</i>'); 256 $('.cmp-bloq #views-exposed-form-campus-block-1 .form-select') 257 .val(tid) 258 .trigger('change'); 259 $(this).closest('.dropdown.mega-menu__toggle').removeClass('open'); 260 }); 261 262 jQuery('.campus_vista--lista .field-content').off().on('click', function (e) { 263 e.preventDefault(); 264 var idcmp = jQuery(this).attr("id-cmp"); 265 var tid = jQuery(this).find('.cmp-lnk-act').attr("tid"); 266 var text = jQuery(this).text(); 267 jQuery('.cmp-bloq [id*="views-exposed-form-campus-block-1"] .form-select') 268 .val(tid) 269 .trigger('change'); 270 }); 271 272 jQuery('#cmp-lnk02').on('click', function (e) { 273 e.preventDefault(); 274 }); 275 jQuery('#cmp-lnk02').off('click').click(function (e) { 276 e.preventDefault(); 277 jQuery(this).toggleClass('open'); 278 jQuery(this).next('.dropdown-menu').toggle(); 279 }); 280 jQuery('.cmp-lnk-act').click(function () { 281 jQuery('#cmp-lnk02').toggleClass('open'); 282 jQuery('#cmp-lnk02').next('.dropdown-menu').toggle(); 283 }); 284 jQuery('#cmp-lnk02').off('focusout').focusout(function () { 285 var menu = jQuery(this); 286 setTimeout(function() { 287 menu.removeClass('open'); 288 menu.next('.dropdown-menu').hide(); 289 }, 300); 290 }); 291 } 292 293 function viewCampus() { 294 jQuery("#action-dron").on("click", function(e) { 295 e.preventDefault(); 296 jQuery(".bx-wrapper .bx-controls").hide(); 297 jQuery("#content-iframe").show(); 298 jQuery(".video").remove(); 299 jQuery("#content-iframe").css( "zIndex", 1); 300 jQuery("#content-iframe").empty(); 301 var data_video = jQuery(this).attr("url-dron"); 302 output = data_video.replace(/(?:http:\/\/)?(?:https:\/\/)?(?:youtu\.be)?(?:www\.)?(?:youtube\.com)?(?:\/watch\?v=)?\/?(.+)/g, '<div class="responsive-video__content"><iframe src="//www.youtube.com/embed/jQuery1?autoplay=1&start=0&rel=0&loop=1&controls=0&autohide=1&showinfo=0&loop=1&controls=0&autohide=1&showinfo=0" frameborder="0" allowfullscreen></iframe></div>'); 303 jQuery("#content-iframe").append(output); 304 305 var video = jQuery("#content-iframe .responsive-video__content iframe"); 306 var videoHeight = video.outerHeight(); 307 //var newWidth = videoHeight * 2; 308 var newWidth = jQuery(window).width(); 309 var halfNewWidth = newWidth/2; 310 311 video.css({ 312 "width": newWidth + "px", 313 "margin-left":"-" + halfNewWidth + "px", 314 "left": "50%" 315 }); 316 jQuery("#street-view-close").show(); 317 jQuery("html, body").animate({ 318 scrollTop: jQuery("#content-iframe").offset().top+100 319 }, 500, "linear"); 320 }); 321 322 jQuery("#vista-360").on("click", function(e) { 323 e.preventDefault(); 324 jQuery(".video").remove(); 325 jQuery("#content-iframe").css( "zIndex", 0); 326 jQuery("#content-iframe").empty(); 327 var data_video = jQuery(this).attr("url-vista"); 328 output = data_video.replace(/(?:http:\/\/)?(?:https:\/\/)?(?:youtu\.be)?(?:www\.)?(?:youtube\.com)?(?:\/watch\?v=)?\/?(.+)/g, '<div class="responsive-video__content"><iframe src="//www.youtube.com/embed/jQuery1?autoplay=1&start=0&rel=0&loop=1&controls=0&autohide=1&showinfo=0&loop=1&controls=0&autohide=1&showinfo=0" frameborder="0" allowfullscreen></iframe></div>'); 329 jQuery("#content-iframe").append(output); 330 331 var video = jQuery("#content-iframe .responsive-video__content iframe"); 332 var videoHeight = video.outerHeight(); 333 var newWidth = videoHeight * 2; 334 var halfNewWidth = newWidth/2; 335 336 video.css({ 337 "width": newWidth + "px", 338 "margin-left":"-" + halfNewWidth + "px", 339 "left": "50%" 340 }); 341 jQuery("#street-view-close").show(); 342 jQuery("html, body").animate({ 343 scrollTop: jQuery("#content-iframe").offset().top+100 344 }, 500, "linear"); 345 }); 346
347 jQuery('#action-street-view').on("click", function(e) { 348 e.preventDefault(); 349 jQuery("#content-iframe").show(); 350 jQuery(".video").remove(); 351 jQuery("#content-iframe").css( "zIndex", 1); 352 jQuery("#content-iframe").empty(); 353 var frame = '<div id="street-view"></div>'; 354 frame += '<script> var panorama; function initialize() { panorama = new google.maps.StreetViewPanorama( document.getElementById("street-view"),{ position: {lat: '+jQuery(this).attr('latitud')+', lng: '+jQuery(this).attr('longitud')+',}, pov: {heading: 165, pitch: 0},zoom: 1 });}</script>'; 355 frame += '<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBHhwm5PubjjlEm8k2eafcJY9wmMJ_V7xw&signed_in=true&callback=initialize"></script>'; 356 jQuery("#content-iframe").append(frame); 357 jQuery("#street-view-close").show(); 358 jQuery("html, body").animate({ 359 scrollTop: jQuery("#content-iframe").offset().top+100 360 }, 500, "linear"); 361 }); 362 363 jQuery("#street-view-close").on("click", function(e) { 364 e.preventDefault(); 365 jQuery(".bx-wrapper .bx-controls").show(); 366 jQuery(".video").remove(); 367 jQuery("#content-iframe").empty(); 368 jQuery("#street-view-close").hide(); 369 jQuery("#content-iframe").hide(); 370 var url_video = jQuery(".module-branches__virtualtour-details").attr("url-campus"); 371 if(url_video != null) { 372 output = url_video.replace(/(?:http:\/\/)?(?:https:\/\/)?(?:youtu\.be)?(?:www\.)?(?:youtube\.com)?(?:\/watch\?v=)?\/?(.+)/g, '<div class="responsive-video__content"><iframe src="//www.youtube.com/embed/jQuery1?autoplay=1&start=0&rel=0&loop=1&controls=0&autohide=1&showinfo=0&loop=1&controls=0&autohide=1&showinfo=0" frameborder="0" allowfullscreen></iframe></div>'); 373 jQuery(".module-branches__virtualtour").append(output); 374 } 375 }); 376 } 377 378 jQuery(".addtoany_share").unbind("click"); 379 jQuery(".addtoany_share").click(function(){ 380 $(this).siblings().toggle(); 381 wrapper = $(this).closest('.addtoany_list'); 382 if (wrapper.hasClass('share-open')) { 383 wrapper.removeClass('share-open'); 384 } else { 385 wrapper.addClass('share-open'); 386 } 387 if ($(this).closest('.header-home, .news.header')) { 388 jQuery(this).siblings('.news .a2a_button_facebook, .news .a2a_button_twitter, .share-no-image .a2a_button_facebook, .share-no-image .a2a_button_twitter, .title-in-note .a2a_button_facebook, .title-in-note .a2a_button_twitter').show(); 389 } 390 }); 391 392 jQuery(document).ajaxComplete(function(event, xhr, settings){ 393 jQuery(".addtoany_share").unbind("click"); 394 jQuery(".addtoany_share").click(function(){ 395 jQuery(this).siblings().toggle(); 396 wrapper = $(this).closest('.addtoany_list'); 397 if (wrapper.hasClass('share-open')) { 398 wrapper.removeClass('share-open'); 399 } else { 400 wrapper.addClass('share-open'); 401 } 402 if ($(this).closest('.header-home, .news.header')) { 403 jQuery(this).siblings('.news .a2a_button_facebook, .news .a2a_button_twitter, .share-no-image .a2a_button_facebook, .share-no-image .a2a_button_twitter, .title-in-note .a2a_button_facebook, .title-in-note .a2a_button_twitter').show(); 404 } 405 }); 406 407 if ($(".especial-img-indice img").length && $(".especial-img-indice img").height() > 0){ 408 especialHeightSmall = $(".especial-img-indice img").height(); 409 } 410 411 if ($(".especial-img-destacado img").length && $(".especial-img-destacado img").height() > 0){ 412 especialHeightBig = $(".especial-img-destacado img").height(); 413 } 414 415 }); 416 417 function micrositio_href(item){ 418 if(item){ 419 item.prev("a.--with-sub").removeAttr("href").css("cursor", "pointer"); 420 } 421 } 422 423 $(document).ready(function(){ 424 $(document).on("click", "#colorbox .addtoany_share", function(e){ 425 e.preventDefault(); 426 $("#colorbox .a2a_button_facebook, #colorbox .a2a_button_twitter").show(); 427 }); 428 //Micrositio 429 if(jQuery(".alt-top-header").length){ 430 var menu_micrositio = jQuery("nav[role=navigation] .menu span.expand-sub"); 431 micrositio_href(menu_micrositio); 432 } 433 434 /* asset - fix botón webform*/ 435 if(jQuery('#webform').text().trim() == ""){ 436 jQuery('#webform').remove(); 437 jQuery('a[href="#webform"]').remove(); 438 } 439 if(jQuery('#block-noticiashome').length){ 440 let block_news = jQuery('#block-noticiashome').clone(); 441 jQuery('#block-noticiashome').remove(); 442 block_news.insertBefore(jQuery('#Educación').parent()); 443 jQuery('.slider-grid-imagenes-image-text-link a').attr('target', '_blank'); 444 } 445 446 }); 447 448 449 }(jQuery)); 450 451}); 452 453jQuery('.left-menu-adaptable .alt-header > nav > .menu > .menu__item.menu__item--with-sub > a').on('click', function(event) { 454 event.preventDefault(); 455 event.stopPropagation(); 456 if(jQuery(this).parent().hasClass('active')) { 457 jQuery('.left-menu-adaptable .alt-header > nav > .menu > .menu__item').removeClass('active'); 458 jQuery('.left-menu-adaptable .alt-header > nav > .menu > .menu__item > .menu--sub').slideUp(); 459 } else { 460 jQuery('.left-menu-adaptable .alt-header > nav > .menu > .menu__item').removeClass('active'); 461 jQuery('.left-menu-adaptable .alt-header > nav > .menu > .menu__item > .menu--sub').slideUp(); 462 jQuery(this).parent().addClass('active'); 463 jQuery(this).parent().children('.menu--sub').slideDown(); 464 } 465}); 466 467/* Agrega un wrapper para los paragraphs grid en TC home, area trayectoria y pagina modular */ 468if(jQuery(".tile_individual").length){ 469 var wrapper = "<div class='field_wrapper-tile_individual'></div>"; 470 jQuery(".page-node-type-home .tile_individual").unwrap().wrapAll(wrapper); 471 jQuery(".page-node-type-adm-area-trayectoria .tile_individual").unwrap().wrapAll(wrapper); 472 jQuery(".page-node-type-pagina-modular .tile_individual").unwrap().wrapAll(wrapper); 473} 474 475if (jQuery('.alt-header').length > 0 ) { 476 jQuery('.aux-footer nav').addClass(jQuery(".alt-header .microsite").attr('class')); 477 jQuery('.left-menu-adaptable--bottom').html(jQuery('.left-menu-adaptable .alt-header .top_bar_2 .secondary-nav').html()); 478 jQuery('body').addClass('es_micrositio'); 479} 480 481 482//Código del asset injector "language english" - Rafael Rivadeneyra - Agosto 2023 483 484if(drupalSettings.path.currentLanguage === 'en'){ 485 jQuery('.spanish-text + a').text('Find out more'); 486 jQuery('.enlace-mas ul.menu-menu-mas li.mas-menu>a.mas-menu-a').text('More'); 487} 488 489 490//Código del asset injector "Programas educativos" - Rafael Rivadeneyra - Agosto 2023 491
492if(jQuery(".page-node-type-campus").length) { 493 var programas = jQuery('.secciones .paragraph.paragraph--type--adm-grid-campus.paragraph--view-mode--default .column-4.image-simple-tile').length; 494 if(programas == "5"){ 495 jQuery('.secciones .paragraph.paragraph--type--adm-grid-campus.paragraph--view-mode--default .column-4.image-simple-tile').last().after('<div class=areagris></>'); 496 } 497 498 var programas = jQuery('.secciones .paragraph.paragraph--type--adm-grid-campus.paragraph--view-mode--default .column-4.image-simple-tile').length; 499 if(programas == "4"){ 500 jQuery('.secciones .paragraph.paragraph--type--adm-grid-campus.paragraph--view-mode--default .column-4.image-simple-tile').last().after('<div class=areagris2></>'); 501 } 502 503 var programas = jQuery('.secciones .paragraph.paragraph--type--adm-grid-campus.paragraph--view-mode--default .column-4.image-simple-tile').length; 504 if(programas == "2"){ 505 jQuery('.secciones .paragraph.paragraph--type--adm-grid-campus.paragraph--view-mode--default .column-4.image-simple-tile').last().after('<div class=areagris></>'); 506 } 507 508 var programas = jQuery('.secciones .paragraph.paragraph--type--adm-grid-campus.paragraph--view-mode--default .column-4.image-simple-tile').length; 509 if(programas == "1"){ 510 jQuery('.secciones .paragraph.paragraph--type--adm-grid-campus.paragraph--view-mode--default .column-4.image-simple-tile').last().after('<div class=areagris2></>'); 511 } 512 513 /* Asset fix anclas campus */ 514 jQuery('.container.pro-edu-title').remove(); 515 jQuery('.container-fluid.adm-menu').html(''); 516 if(window.adm_menu != undefined) { 517 adm_menu.init(); 518 } 519} 520 521 522//Código del asset injector "language english" - Rafael Rivadeneyra - Agosto 2023 523 524jQuery(document).ready(function() { 525 if (drupalSettings.path.currentLanguage === 'en'){ 526 jQuery('.spanish-text + a').text('Find out more'); 527 jQuery('.enlace-mas ul.menu-menu-mas li.mas-menu>a.mas-menu-a').text('More'); 528 } 529}); 530 531 532//Código del asset injector "Mingo" - Rafael Rivadeneyra - Agosto 2023 533 534 535jQuery('.enlace-llave > ul.menu-menu-llave > li').off('click').on('click', function() { 536 jQuery(this).toggleClass('open'); 537}); 538 539jQuery('body').on('click', function(evt){ 540 if(jQuery(evt.target).hasClass('.enlace-llave')) 541 return; 542 //For descendants of menu_content being clicked, remove this check if you do not want to put constraint on descendants. 543 if(jQuery(evt.target).closest('.enlace-llave').length) 544 return; 545 jQuery('.enlace-llave > ul.menu-menu-llave > li').removeClass('open'); 546}); 547 548jQuery(window).scroll(function () { 549 jQuery('.enlace-llave > ul.menu-menu-llave > li').removeClass('open'); 550}); 551 552if (jQuery(".page-node-type-cuarto-nivel").length) { 553 554 jQuery(window).on('load', function() { 555 if (window.street_view != undefined) { 556 street_view.enable_api_script = function() { 557 if (window.google !== undefined) { 558 street_view.api_script.not('[src]').each(function() { 559 var script = jQuery(this); 560 var url = script.attr('data-src'); 561 var apy_key = script.attr('apy-key'); 562 var query_args = script.attr('query-args'); 563 var src = url + '?' + apy_key + query_args; 564 script.attr('src', src); 565 script.removeAttr('data-src'); 566 script.removeAttr('apy-key'); 567 script.removeAttr('query-args'); 568 }); 569 } else { 570 var script_api = document.createElement('script'); 571 script_api.src = 'https://maps.googleapis.com/maps/api/js?key=' + street_view.api_script.attr('apy-key') + '&signed_in=true&callback=initialize'; 572 script_api.defer = true; 573 script_api.async = true; 574 // Attach your callback function to the `window` object 575 window.initialize = function() { 576 street_view.set_maps(); 577 }; 578 // Append the 'script' element to 'head' 579 document.head.appendChild(script_api); 580 } 581 } 582 } 583 }); 584 585} 586 587jQuery.extend(jQuery.easing, { 588 easeOutQuart: function (x, t, b, c, d) { 589 return -c * ((t = t / d - 1) * t * t * t - 1) + b; 590 }, 591 easeOutQuad: function (x, t, b, c, d) { 592 return -c * (t /= d) * (t - 2) + b; 593 }, 594 easeOutCubic: function (x, t, b, c, d) { 595 return c * ((t = t / d - 1) * t * t + 1) + b; 596 }, 597 easeOutExpo: function (x, t, b, c, d) { 598 return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; 599 }, 600 easeOutCirc: function (x, t, b, c, d) { 601 return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; 602 } 603}); 604 605/* ===== Iconos Menus ===== */ 606 607jQuery(document).ready(function () { 608 609 jQuery(document).off('click', '.menu-menu-llave > li > a'); 610 611 jQuery(document).on('click', '.menu-menu-llave > li > a', function (e) { 612 if (window.innerWidth <= 1023) { 613 e.preventDefault(); 614 e.stopPropagation(); 615 jQuery(this).toggleClass('open'); 616 } 617 }); 618}); 619 620 621jQuery(document).ready(function () { 622 623 jQuery(document).off('click', '.more-expanse'); 624 625 jQuery(document).on('click', '.more-expanse', function (e) { 626 if (window.innerWidth <= 1023) { 627 e.preventDefault(); 628 e.stopPropagation(); 629 jQuery(this).toggleClass('open'); // la clase activa la rotación del icono 630 } 631 }); 632 633 jQuery('.modalbutton .botonStyle.doubleButton').on('click', function() { 634 let modalButton = jQuery(this).closest('.modalbutton').prev('.modal-button');
635 let iframe = modalButton.find('.modal-content-iframe'); 636 if (iframe.attr('src') == '') { 637 638 } else { 639 iframe.html('<iframe frameborder="0" id="formhs" src="'+iframe.attr('src')+'" title="'+iframe.attr('title')+'" aria-label="'+iframe.attr('aria-label')+'"></iframe>'); 640 } 641 642 modalButton.fadeIn(); 643 }); 644 645 jQuery('.modal-button .close').on('click', function() { 646 jQuery('.modal-button').fadeOut(); 647 }); 648 649 jQuery(".modal-button").on("click", function (event) { 650 // Solo ejecutar si se hizo clic directamente en el contenedor 651 if (event.target === this) { 652 jQuery('.modal-button').fadeOut(); 653 } 654 }); 655 656}); 657 658jQuery('.hero-subtitulo a').each(function() { 659 var href = jQuery(this).attr('href'); 660 // Verifica si el enlace apunta a un archivo con las extensiones especÃficas 661 if (href && href.match(/\.(txt|pdf|doc|docx|png|jpeg|jpg)$/i)) { 662 // Verifica si el atributo 'download' ya está presente 663 if (!jQuery(this).attr('download')) { 664 jQuery(this).attr('download', ''); 665 } 666 } 667}); 668 669jQuery(window).on('ajaxComplete', function() { 670 if (jQuery('#ja_busqueda--bg_programas__filtro_ingles__selector').prop('checked') == true) { 671 jQuery('.spanish-label').hide(); 672 } 673 674 jQuery('.english-label').each(function() { 675 let visible = 1; 676 let campus_filter = jQuery('input[name="field_filtro_campus"]').val(); 677 let campus_attr = jQuery(this).attr('campus'); 678 679 if (campus_filter != '' ) { 680 jQuery(this).hide(); 681 682 jQuery.each(campus_filter.split(' '), function(index, value) { 683 if (!campus_attr.includes(value.trim())) { 684 visible = 0; 685 } 686 }); 687 688 if (visible === 1) { 689 jQuery(this).show(); 690 } 691 } 692 }); 693 694 if (jQuery('.english-label:visible').length == 0 && jQuery('.spanish-label:visible').length == 0) { 695 var mensajes = (drupalSettings.emulsify_tec && drupalSettings.emulsify_tec.mensajeSinResultados) || {}; 696 var lang = jQuery('html').attr('lang') === 'es' ? 'es' : 'en'; 697 var mensaje = mensajes[lang] || (lang === 'es' 698 ? 'No hay resultados que cumplan con todos los criterios seleccionados' 699 : 'No results'); 700 701 jQuery('.ja_busqueda--bg_programas__resultados').html(mensaje); 702} 703 704}); 705 706 707 708/* == Cierra acordeones abiertos en OTROS <dl> dentro del mismo div.text-long == */ 709jQuery(document).ready(function ($) { 710 711 $(document).on('click', '.ckeditor-accordion-toggler', function () { 712 var $dt = $(this).parent(); 713 var justOpened = $dt.hasClass('active'); 714 //console.log("Sà ejecuta el JS"); 715 if (!justOpened) { 716 return; 717 } 718 719 var $scope = $dt.closest('.text-long'); 720 721 // Validación real: si no está dentro de .text-long, no hace nada 722 if (!$scope.length) { 723 return; 724 } 725 726 // Anima la apertura del dd actual 727 $dt.next('dd').stop(true, true).slideDown('fast'); 728 729 var $currentDl = $dt.closest('dl'); 730 731 $scope 732 .find('.ckeditor-accordion-container dl.styled dt.active') 733 .not($dt) 734 .each(function () { 735 var $otherDt = $(this); 736 737 if ($otherDt.closest('dl').is($currentDl)) { 738 return; 739 } 740 741 var $otherDd = $otherDt.next('dd'); 742 $otherDt.removeClass('active'); 743 $otherDd.removeClass('active').stop(true, true).slideUp('fast'); 744 }); 745 }); 746});
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.