1801}1802feed.insertAdjacentHTML('beforeend', t_feed_drawWholePostPopup(obj, post, opts, lid_post, recid));18031804var code = obj.code;1805if (code != '' && code != null && code.indexOf('VK') !== -1 && post.disablecomments != 1) {1806t_feed_loadCommentsVkWidget(feed);1807}18081809if (opts.popup_opts.showRelevants === 'all' || opts.popup_opts.showRelevants === 'cc') {1810t_feed_addRelevantsPosts(recid, opts, post, lid_post);1811}1812
setTimeout(function () { // removed t_feed_breakText because it solved by css if (opts.popup_opts.zoom) { t_feed_addZoom(); } }, 100); t_feed_showPopup(recid, post, opts); document.title = (post.title || '') .replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') .replace(/ /g, ' '); if (typeof post.needGetPost != 'undefined') { t_feed_addPostPopupLoader(); t_feed_loadPostPopupData(recid, lid_post, opts); } if (post.mediatype == 'gallery') { if (opts.popup_opts.bgSize === '') { setTimeout(function () { t_feed_addPostPopupGallery(recid, post); }, 500); } else { t_feed_addPostPopupGallery(recid, post); } } if (opts.isPublishedPage) { t_feed_changeURL(obj, post); }}/** * a11y * Добавление класса на пост-триггер для последующего фокусирования */function t_feed__addClassOnTriggerButton() { var allTriggeredButtons = document.querySelectorAll('.t-popup__triggered-btn'); Array.prototype.forEach.call(allTriggeredButtons, function (button) { button.classList.remove('t-popup__triggered-btn'); }); document.addEventListener('keydown', function (event) { if (event.keyCode === 13) { var href = window.location.href; if (!document.querySelector('.t-feed__post-popup')) { return; } var currentPost = document.querySelector('a[href="' + href + '"]'); if (!window.isMobile) currentPost.classList.add('t-popup__triggered-btn'); } });}/** * a11y * Добавление фокуса на пост-триггер после закрытия попапа */function t_feed__addFocusOnTriggerButton() { var triggeredButton = document.querySelector('.t-popup__triggered-btn'); if (triggeredButton) { triggeredButton.focus(); triggeredButton.classList.remove('t-popup__triggered-btn'); }}/** * Добавление атрибутов для доступности к посту-тригеру */function t_feed__addAttributesForAccessibility(post) { var triggerLink = document.querySelector('[data-post-uid="' + post.uid + '"] .t-feed__link'); if (!triggerLink || !document.querySelector('.t-feed__post-popup')) { return; } triggerLink.setAttribute('role', 'button'); triggerLink.setAttribute('aria-haspopup', 'dialog');}function t_feed_loadCommentsVkWidget(feed) { var comments = feed.querySelector('.t-feed__post-popup__comments'); var scripts = comments ? comments.querySelectorAll('script') : []; Array.prototype.forEach.call(scripts, function (oldScript) { var newScript = document.createElement('script'); Array.prototype.forEach.call(oldScript.attributes, function (attr) { newScript.setAttribute(attr.name, attr.value); });