PageSourceSearch

https://rutanmedellin.org/hubfs/hub_generated/module_assets/1/1968…/1776722842371/module_comunidad-n.min.js

js rutanmedellin.org collected 2026-10-02 04:14:29 UTC 4,543 bytes, 2 lines download raw bytes

1var module_196845269766=void document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".js-slider-module").forEach(async moduleEl=>{const sliderRoot=moduleEl.querySelector(".testimonial-slider");if(!sliderRoot)return;const tableId=sliderRoot.dataset.table,portalId=sliderRoot.dataset.portalId,uniqueId=sliderRoot.dataset.unique,displayMode=sliderRoot.dataset.display||"slider",wrapper=moduleEl.querySelector(`#testimonial-slider-container-${uniqueId}`);try{const res=await fetch(`https://api.hubapi.com/cms/v3/hubdb/tables/${tableId}/rows?portalId=${portalId}&limit=100`);if(!res.ok)throw new Error(`Error ${res.status}: ${res.statusText}`);const data=await res.json();let items=Array.isArray(data.results)?data.results:[];items.sort((a,b)=>new Date(b.createdAt)-new Date(a.createdAt)),items.forEach(row=>{const fields=row.values||{},title=fields.name,image=fields.image?.url||"",description=fields.description,youtubeId=fields.youtube_id,slide=document.createElement("div");slide.className="slider"===displayMode?"swiper-slide testimonial__item":"testimonial__item",slide.dataset.youtubeId=youtubeId,slide.innerHTML=`\n          <img src="${image}" alt="${title}" loading="lazy">\n          <span class="testimonial__play-icon" aria-hidden="true"></span>\n          <div class="info-testimonial">\n            <h3>${title}</h3>\n            <span>${description}</span>\n          </div>\n        `,wrapper.appendChild(slide)}),function(container){const items=container.querySelectorAll(".testimonial__item");items.forEach(item=>{item.addEventListener("click",()=>{const videoId=item.dataset.youtubeId;videoId&&Fancybox.show([{src:`https://www.youtube.com/embed/${videoId}?autoplay=1&rel=0`,type:"iframe",preload:!1}],{dragToClose:!0,mainClass:"fancybox-custom",on:{destroy:()=>{const iframe=document.querySelector(".fancybox__content iframe");iframe&&(iframe.src="")}}})})})}(wrapper),"slider"===displayMode?function(uid,rootEl){const swiperEl=rootEl.querySelector(`.testimonialSwiper--${uid}`),prev=rootEl.querySelector(`.swiper-button-prev--${uid}`),next=rootEl.querySelector(`.swiper-button-next--${uid}`);swiperEl&&prev&&next&&new Swiper(swiperEl,{loop:!0,centeredSlides:!0,spaceBetween:30,grabCursor:!0,freeMode:!0,navigation:{nextEl:next,prevEl:prev},autoplay:!0,breakpoints:{480:{slidesPerView:1.2},768:{slidesPerView:2.2},1024:{slidesPerView:3}}})}(uniqueId,moduleEl):function(container,perPage=6){const items=[...container.querySelectorAll(".testimonial__item")];if(items.length<=perPage)return;let currentPage=1;const totalPages=Math.ceil(items.length/perPage),pagination=document.createElement("div");pagination.className="testimonial-pagination";const prevBtn=document.createElement("button");prevBtn.className="testimonial-pagination__prev",prevBtn.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n    <polyline points="15 18 9 12 15 6"></polyline>\n  </svg>';const nextBtn=document.createElement("button");nextBtn.className="testimonial-pagination__next",nextBtn.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n                      <polyline points="9 18 15 12 9 6"></polyline>\n                    </svg>';const numbersWrapper=document.createElement("div");numbersWrapper.className="testimonial-pagination__numbers";for(let i=1;i<=totalPages;i++){const pageBtn=document.createElement("button");pageBtn.className="testimonial-pagination__number",pageBtn.textContent=i,pageBtn.addEventListener("click",()=>{currentPage=i,renderPage()}),numbersWrapper.appendChild(pageBtn)}pagination.appendChild(prevBtn),pagination.appendChild(numbersWrapper),pagination.appendChild(nextBtn),container.after(pagination);const renderPage=()=>{items.forEach((item,i)=>{const start=(currentPage-1)*perPage,end=start+perPage;item.style.display=i>=start&&i<end?"block":"none"}),numbersWrapper.querySelectorAll("button").forEach((btn,idx)=>{btn.classList.toggle("is-active",idx+1===currentPage)}),prevBtn.disabled=1===currentPage,nextBtn.disabled=currentPage===totalPages};prevBtn.addEventListener("click",()=>{currentPage>1&&(currentPage--,renderPage())}),nextBtn.addEventListener("click",()=>{currentPage<totalPages&&(currentPage++,renderPage())}),renderPage()}(wrapper,6)}catch(error){console.error("Error cargando ítems del módulo:",error)}})});
2//# sourceURL=https://5509874.fs1.hubspotusercontent-na1.net/hubfs/5509874/hub_generated/module_assets/1/196845269766/1776722842371/module_comunidad-n.js

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.