4201}42024203return 'Text not found "' + msg + '"';4204}42054206function t_feed_returnLang(recid) {4207var lang = 'EN';4208if (4209window.tFeedPosts &&4210typeof window.tFeedPosts[recid] != 'undefined' &&4211typeof window.tFeedPosts[recid]['lang'] != 'undefined' &&4212window.tFeedPosts[recid]['lang'] != ''
) { lang = window.tFeedPosts[recid]['lang'].toUpperCase(); } else { lang = (window.navigator.userLanguage || window.navigator.language).toUpperCase().slice(0, 2); // Language override based on attribute var allrecords = document.getElementById('allrecords'); if (allrecords) { var projectLang = allrecords.getAttribute('data-tilda-project-lang'); if (projectLang) { lang = projectLang; } } } return lang;}/* a11y: this is necessary to screenreader reads only the title as a linkbut user could click on the whole card */function t_feed__moveClickOnPost(recId, posts) { var rec = document.getElementById('rec' + recId); if (!rec) return; var postCards = []; posts.forEach(function (post) { var postCard = rec.querySelector('[data-post-uid="' + post.uid + '"]'); postCard && postCards.push(postCard); }); Array.prototype.forEach.call(postCards, function (card) { var downEventTime; var upEventTime; var link = card.querySelector('.t-feed__link'); if (!link) { return; } card.style.cursor = 'pointer'; card.addEventListener('mousedown', function () { downEventTime = Date.now(); }); card.addEventListener('mouseup', function (event) { upEventTime = Date.now(); // если остаётся попап в разметке после закрытия поста, удаляем его var popup = document.querySelector('.t-feed__post-popup'); if (popup !== null) { popup.parentNode.removeChild(popup); } if (!event.target.closest('.t-feed__link') && event.which === 1 && upEventTime - downEventTime < 200) { link.click(); } }); });}/* a11y: add a visual display of focuswhen interacting with the page from the keyboard */function t_feed__addFocusOnTab(recId) { if (window.isMobile) return; var rec = document.getElementById('rec' + recId); if (!rec) return; var feedLinks = document.querySelectorAll('.t-feed__link'); if (!feedLinks) return; /* check if event focus from mouse or from keyboard */ var handlerType = null; document.addEventListener('keydown', function () { handlerType = 'keyboard'; }); document.addEventListener('mousedown', function () { handlerType = 'mouse'; }); Array.prototype.forEach.call(feedLinks, function (link) { var post = link.closest('.t-feed__post'); link.addEventListener('focus', function () { if (handlerType === 'keyboard') { if (post) { post.classList.add('t-focusable'); } handlerType = null;