3001var bulletWidth = isGallery ? opts.gallery.dotsWidth : '8px';3002bulletWidth = parseInt(bulletWidth);3003if (bulletWidth > 20) {3004bulletWidth = 20;3005}3006var activeBulletClass = '';3007var dotsActiveBg = isGallery ? opts.gallery.dotsActiveBg : '';3008dotsActiveBg = dotsActiveBg !== '' ? dotsActiveBg : '#222222';3009var dotsBg = isGallery ? opts.gallery.dotsBg : '';3010var dotsBorderSize = isGallery ? opts.gallery.dotsBorderSize : '';3011var dotsStyle = '';3012
dotsStyle += bulletWidth !== '' && !isNaN(bulletWidth) ? 'width:' + bulletWidth + 'px;height:' + bulletWidth + 'px;' : ''; dotsStyle += dotsBg !== '' ? 'background-color:' + dotsBg + ';' : ''; dotsStyle += dotsBorderSize !== '' ? 'border:' + dotsBorderSize + ' solid ' + dotsActiveBg + ';' : ''; var str = ''; str += '<ul class="t-slds__bullet_wrapper">'; galleryItems.forEach(function (item, i) { if (item.length != 1) { activeBulletClass = i == 0 ? ' t-slds__bullet_active' : ''; str += '<li class="t-slds__bullet' + activeBulletClass + '" data-slide-bullet-for="' + (i + 1) + '">' + '<button type="button" class="t-slds__bullet_body" aria-label="' + t_feed_getDictionary('bulletlabel', recid) + ' ' + (i + 1) + '" style="' + dotsStyle + '"></button>' + '</li>'; } }); str += '</ul>'; return str;}function t_feed_setGalleryImageHeight(recid) { var rec = document.querySelector('#rec' + recid); var images = rec.querySelectorAll('.t-feed__post-popup__slider-separator'); Array.prototype.forEach.call(images, function (image) { var width = image.getAttribute('data-slider-image-width'); var height = image.getAttribute('data-slider-image-height'); var ratio = height / width; var padding = ratio * 100; image.style.paddingBottom = padding + '%'; });}function t_feed_initCodeHightlight() { var post = document.querySelector('.js-feed-post-text'); if (!post) return; var codeBlocks = post.querySelectorAll('.t-redactor__highlightcode code'); if (!codeBlocks.length) return; if (typeof window.hljs !== 'undefined') { t_feed_highlightCodeBlocks(codeBlocks); } else { t_feed_loadCodeHighlight(function () { t_feed_highlightCodeBlocks(codeBlocks); }); }}function t_feed_loadCodeHighlight(callback) { var script = document.createElement('script'); var style = document.createElement('link'); style.href = 'https://static.tildacdn.' + t_feed__getRootZone() + '/css/highlight.min.css'; script.src = 'https://static.tildacdn.' + t_feed__getRootZone() + '/js/highlight.min.js'; style.type = 'text/css'; style.rel = 'stylesheet'; if (callback) { script.onload = callback; } document.head.appendChild(script); document.head.appendChild(style);}function t_feed_highlightCodeBlocks(codeBlocks) { Array.prototype.forEach.call(codeBlocks, function (codeBlock) { window.hljs.highlightBlock(codeBlock); });}// TODO: add only for snippetfunction t_feed_PostInit() { window.onpopstate = function () { if (window.location.pathname.indexOf('/tpost/') > -1) return; location.reload(); };