1/* Extensión de jQuery para soportar animate.css */ 2$.fn.extend({ 3 animateCss: function (animationName) { 4 var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; 5 this.addClass('animated ' + animationName).one(animationEnd, function () { 6 $(this).removeClass('animated ' + animationName); 7 }); 8 } 9}); 10 11document.addEventListener("change", function (e) { 12 if (!e.target.classList.contains("drop-zone__input")) { 13 return; 14 } 15 const file = e.target.files[0]; 16 if (!file) { 17 return; 18 } 19 const allowedTypes = [ 20 "image/jpeg", 21 "image/png", 22 "image/jpg", 23 "image/gif", 24 "image/webp", 25 "image/svg+xml" 26 ]; 27 if (!allowedTypes.includes(file.type)) { 28 alert("Solo se permiten imágenes."); 29 // Limpiar input 30 input.value = ""; 31 // Obtener la zona 32 const dropZone = input.closest(".drop-zone"); 33 // Eliminar miniatura si existe 34 const thumb = dropZone.querySelector(".drop-zone__thumb"); 35 if (thumb) { 36 thumb.remove(); 37 } 38 // Mostrar nuevamente el mensaje 39 let prompt = dropZone.querySelector(".drop-zone__prompt"); 40 if (!prompt) { 41 prompt = document.createElement("span"); 42 prompt.className = "drop-zone__prompt"; 43 prompt.textContent = "Arrastre o suelte una imagen"; 44 dropZone.appendChild(prompt); 45 } else { 46 prompt.style.display = ""; 47 } 48 return; 49 } 50}); 51 52$(document).ready(function () { 53 54 $('.nxFxHover').mouseenter(function () { 55 var self = $(this); 56 self.find('.image').animateCss(self.data('anim-hover')); 57 self.find('.fa').animateCss(self.data('anim-hover')); 58 }); 59 60 window.addEventListener("load", function () { 61 62 document.querySelectorAll(".youtube-video").forEach(function (container) { 63 64 var url = container.dataset.url; 65 if (!url) return; 66 67 var videoId = null; 68 69 var matchWatch = url.match(/[?&]v=([^&]+)/); 70 if (matchWatch) videoId = matchWatch[1]; 71 72 var matchShort = url.match(/youtu\.be\/([^?&]+)/); 73 if (matchShort) videoId = matchShort[1]; 74 75 var matchEmbed = url.match(/embed\/([^?&]+)/); 76 if (matchEmbed) videoId = matchEmbed[1]; 77 78 if (!videoId) return; 79 80 container.innerHTML = 81 '<div class="yt-wrapper">' + 82 '<img class="yt-thumb" src="https://img.youtube.com/vi/' + videoId + '/hqdefault.jpg">' + 83 '<div class="yt-play"></div>' + 84 '</div>'; 85 86 87 container.addEventListener("click", function(){ 88 89 container.innerHTML = 90 '<iframe width="100%" height="100%" frameborder="0" allowfullscreen ' + 91 'src="https://www.youtube.com/embed/' + videoId + '?autoplay=1"></iframe>'; 92 93 }); 94 95 }); 96 97}); 98 99}); 100 101function slideTab(itemId){ 102 103 var container = document.querySelector(".slider"+ itemId); 104 // Selecciono todos los slick que no este activos 105 const nodeList = container.querySelectorAll("div .slick-slide:not(.slick-active)"); 106 // Selecciono el slick activo para cuando se cambie de imagen se quite el tabindex -1 107 container.querySelectorAll("div .slick-active").forEach(function(enlaceL3A){ 108 enlaceL3A.removeAttribute('tabindex','-1'); 109 }); 110 // Selecciono el slick activo y accedo a la etiqueta A para quitarle un tabIndex -1 111 container.querySelectorAll("div .slick-active .enlaceHijaL").forEach(function(enlaceL3){ 112 enlaceL3.removeAttribute('tabindex','-1'); 113 }); 114 // recorro todos los slick ocultos y le pongo un tabindex -1 115 nodeList.forEach(function (elemento, index, arreglo) { 116 arreglo[index].setAttribute("tabindex","-1") 117 118 arreglo[index].querySelectorAll("a").forEach(function(enlace){ 119 enlace.setAttribute("tabindex","-1"); 120 }); 121 // arreglo[index].querySelector(".slideL").setAttribute("tabindex","-1") 122 }); 123} 124 125 126$(document).on('click','.button-limpiar-drop_fail',function() { 127 var self = $(this), 128 idImge = self.data("image-key"); 129 130 const $upperElement = $('.drop-zone'); 131 132 if($upperElement.length){ 133 $upperElement.text('Arrastre o suelte una imagen o seleccione un archivo') 134 } 135 136 self.addClass('d-none'); 137 138 const drop_img = $('.drop-zone__thumb img-fluid'); 139 drop_img.remove(); 140 $('.fileImg'+idImge).val(''); 141}); 142 143 144$(document).on('click','.btn-close',function(event) { 145 // Capturar el atributo 'data-key' del elemento clickeado 146 var valorAtributo = event.currentTarget.getAttribute('data-key'); 147 148 149 const parentDiv = document.getElementsByClassName('nxBlock'+valorAtributo); 150 151 // Si encuentras el div, agrega la clase 'd-none' para ocultarlo 152 if (parentDiv.length > 0) { 153 parentDiv[0].classList.add('d-none'); 154 } 155 156});
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.