'use strict'; (function(){ function h(el, attrs={}, children=[]) { const e = document.createElement(el); for (const [k,v] of Object.entries(attrs||{})) { if (k === 'class') e.className = v; else if (k === 'html') e.innerHTML = v; else e.setAttribute(k, v); } for (const c of (children||[])) e.appendChild(c); return e; } function renderItem(item){ const col = h('div', {class: 'items col-xl-6 col-lg-6 col-md-6 col-sm-6 col-ms-6 col-xs-12'}); const article = h('article', {class: 'post-25620 post type-post status-publish format-standard has-post-thumbnail hentry'}); const aPhoto = h('a', {href: item.link, class: 'lte-photo'}); const img = h('img', { src: item.image, width: '500', height: '300', decoding: 'async', fetchpriority: 'high', class: 'attachment-atleticos-blog size-atleticos-blog wp-post-image', alt: '' }); aPhoto.appendChild(img); aPhoto.appendChild(h('span', {class: 'lte-photo-overlay'})); const descr = h('div', {class: 'lte-description'}); const aHeader = h('a', {href: item.link, class: 'lte-header'}); const h3 = h('h3', {html: item.title || ('Článek ' + item.id)}); aHeader.appendChild(h3); // const excerpt = h('div', {class: 'lte-excerpt', html: ''}); descr.appendChild(aHeader); // descr.appendChild(excerpt); article.appendChild(aPhoto); article.appendChild(descr); col.appendChild(article); return col; } async function loadLatest(attempt = 0) { const primary = document.getElementById('latest-blog-items'); const secondary = document.getElementById('other-blog-items'); if (!primary && !secondary) return; if (primary) primary.innerHTML = '