Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-feed-1.0.js

Код файла
Версия от 24.08.2026, 07:03:11 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1701 1702	if (opts.popup_opts.showRelevants === 'all' || opts.popup_opts.showRelevants === 'cc') {1703		t_feed_addRelevantsPosts(recid, opts, post, lid_post);1704	}1705 1706	setTimeout(function () {1707		// removed t_feed_breakText because it solved by css1708		if (opts.popup_opts.zoom) {1709			t_feed_addZoom();1710		}1711	}, 100);1712 
История файла и сравнение версий
  • 24.08.2026, 07:03:11 · 56c3b845
1713 t_feed_showPopup(recid, post, opts);
1714
1715 document.title = (post.title || '')
1716 .replace(/&/g, '&')
1717 .replace(/&lt;/g, '<')
1718 .replace(/&gt;/g, '>')
1719 .replace(/&nbsp;/g, ' ');
1720
1721 if (typeof post.needGetPost != 'undefined') {
1722 t_feed_addPostPopupLoader();
1723 t_feed_loadPostPopupData(recid, lid_post, opts);
1724 }
1725
1726 if (post.mediatype == 'gallery') {
1727 if (opts.popup_opts.bgSize === '') {
1728 setTimeout(function () {
1729 t_feed_addPostPopupGallery(recid, post);
1730 }, 500);
1731 } else {
1732 t_feed_addPostPopupGallery(recid, post);
1733 }
1734 }
1735
1736 if (opts.isPublishedPage) {
1737 t_feed_changeURL(obj, post);
1738 }
1739}
1740
1741/**
1742 * a11y
1743 * Добавление класса на пост-триггер для последующего фокусирования
1744 */
1745function t_feed__addClassOnTriggerButton() {
1746 var allTriggeredButtons = document.querySelectorAll('.t-popup__triggered-btn');
1747 Array.prototype.forEach.call(allTriggeredButtons, function (button) {
1748 button.classList.remove('t-popup__triggered-btn');
1749 });
1750 document.addEventListener('keydown', function (event) {
1751 if (event.keyCode === 13) {
1752 var href = window.location.href;
1753 if (href.indexOf('tpost/') === -1) {
1754 return;
1755 }
1756 var currentPost = document.querySelector('a[href="' + href + '"]');
1757 if (!window.isMobile) currentPost.classList.add('t-popup__triggered-btn');
1758 }
1759 });
1760}
1761
1762/**
1763 * a11y
1764 * Добавление фокуса на пост-триггер после закрытия попапа
1765 */
1766function t_feed__addFocusOnTriggerButton() {
1767 var triggeredButton = document.querySelector('.t-popup__triggered-btn');
1768 if (triggeredButton) {
1769 triggeredButton.focus();
1770 triggeredButton.classList.remove('t-popup__triggered-btn');
1771 }
1772}
1773
1774/**
1775 * Добавление атрибутов для доступности к посту-тригеру
1776 */
1777function t_feed__addAttributesForAccessibility(post) {
1778 var triggerLink = document.querySelector('[data-post-uid="' + post.uid + '"] .t-feed__link');
1779 if (!triggerLink || post.url.indexOf('tpost') === -1) {
1780 return;
1781 }
1782 triggerLink.setAttribute('role', 'button');
1783 triggerLink.setAttribute('aria-haspopup', 'dialog');
1784}
1785
1786function t_feed_loadCommentsVkWidget(feed) {
1787 var comments = feed.querySelector('.t-feed__post-popup__comments');
1788 var scripts = comments ? comments.querySelectorAll('script') : [];
1789 Array.prototype.forEach.call(scripts, function (oldScript) {
1790 var newScript = document.createElement('script');
1791 Array.prototype.forEach.call(oldScript.attributes, function (attr) {
1792 newScript.setAttribute(attr.name, attr.value);
1793 });
1794 if (oldScript.innerHTML.length === 0) {
1795 var script = document.createElement('script');
1796 script.src = oldScript.attributes.src.value;
1797 document.head.appendChild(script);
1798 } else {
1799 newScript.appendChild(document.createTextNode(oldScript.innerHTML));
1800 setTimeout(function () {
Предыдущие 100 строкСледующие 100 строк