1/* Clasificados â lista estilo prototipo (typeAI). 2 Reemplaza al rotador. Pinta varios items con categorÃa + tÃtulo + precio + ubicación. */ 3(function () { 4 function init() { 5 const card = document.querySelector('.tai-clasif-list'); 6 if (!card) return; 7 const body = card.querySelector('.tai-clasif-body'); 8 const countEl = card.querySelector('.tai-clasif-count'); 9 const url = card.dataset.clasifUrl; 10 const key = card.dataset.clasifKey; 11 const limit = card.dataset.clasifLimit || 5; 12 const api = `${url}/ghost/api/content/posts/?key=${key}&limit=${limit}&include=tags&fields=title,url,custom_excerpt,excerpt`; 13 14 fetch(api).then(r => r.json()).then(data => { 15 const posts = data.posts || []; 16 if (!posts.length) { 17 body.innerHTML = '<div style="padding:14px;font-size:12px;color:var(--tai-text-muted)">Sin clasificados activos.</div>'; 18 countEl.textContent = '0'; 19 return; 20 } 21 body.innerHTML = posts.map(p => 22 `<a href="${p.url}" target="_blank" rel="noopener" class="tai-clasif-item"> 23 <div class="tai-clasif-title">${p.title}</div> 24 </a>` 25 ).join(''); 26 const total = data.meta?.pagination?.total; 27 countEl.textContent = total ? total.toLocaleString('es-CO') : posts.length; 28 }).catch(err => { 29 console.warn('Clasificados:', err); 30 body.innerHTML = '<div style="padding:14px;font-size:12px;color:var(--tai-text-muted)">No fue posible cargar los clasificados.</div>'; 31 countEl.textContent = 'â'; 32 }); 33 } 34 if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init); 35 else init(); 36})();
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.