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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-feed-1.1.js

Код файла
Версия от 18.08.2026, 07:00:17 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1801	}1802	feed.insertAdjacentHTML('beforeend', t_feed_drawWholePostPopup(obj, post, opts, lid_post, recid));1803 1804	var code = obj.code;1805	if (code != '' && code != null && code.indexOf('VK') !== -1 && post.disablecomments != 1) {1806		t_feed_loadCommentsVkWidget(feed);1807	}1808 1809	if (opts.popup_opts.showRelevants === 'all' || opts.popup_opts.showRelevants === 'cc') {1810		t_feed_addRelevantsPosts(recid, opts, post, lid_post);1811	}1812
История файла и сравнение версий
  • 18.08.2026, 07:00:17 · 56c3b845
1813 setTimeout(function () {
1814 // removed t_feed_breakText because it solved by css
1815 if (opts.popup_opts.zoom) {
1816 t_feed_addZoom();
1817 }
1818 }, 100);
1819
1820 t_feed_showPopup(recid, post, opts);
1821
1822 document.title = (post.title || '')
1823 .replace(/&/g, '&')
1824 .replace(/&lt;/g, '<')
1825 .replace(/&gt;/g, '>')
1826 .replace(/&nbsp;/g, ' ');
1827
1828 if (typeof post.needGetPost != 'undefined') {
1829 t_feed_addPostPopupLoader();
1830 t_feed_loadPostPopupData(recid, lid_post, opts);
1831 }
1832
1833 if (post.mediatype == 'gallery') {
1834 if (opts.popup_opts.bgSize === '') {
1835 setTimeout(function () {
1836 t_feed_addPostPopupGallery(recid, post);
1837 }, 500);
1838 } else {
1839 t_feed_addPostPopupGallery(recid, post);
1840 }
1841 }
1842
1843 if (opts.isPublishedPage) {
1844 t_feed_changeURL(obj, post);
1845 }
1846}
1847
1848/**
1849 * a11y
1850 * Добавление класса на пост-триггер для последующего фокусирования
1851 */
1852function t_feed__addClassOnTriggerButton() {
1853 var allTriggeredButtons = document.querySelectorAll('.t-popup__triggered-btn');
1854 Array.prototype.forEach.call(allTriggeredButtons, function (button) {
1855 button.classList.remove('t-popup__triggered-btn');
1856 });
1857 document.addEventListener('keydown', function (event) {
1858 if (event.keyCode === 13) {
1859 var href = window.location.href;
1860 if (!document.querySelector('.t-feed__post-popup')) {
1861 return;
1862 }
1863 var currentPost = document.querySelector('a[href="' + href + '"]');
1864 if (!window.isMobile) currentPost.classList.add('t-popup__triggered-btn');
1865 }
1866 });
1867}
1868
1869/**
1870 * a11y
1871 * Добавление фокуса на пост-триггер после закрытия попапа
1872 */
1873function t_feed__addFocusOnTriggerButton() {
1874 var triggeredButton = document.querySelector('.t-popup__triggered-btn');
1875 if (triggeredButton) {
1876 triggeredButton.focus();
1877 triggeredButton.classList.remove('t-popup__triggered-btn');
1878 }
1879}
1880
1881/**
1882 * Добавление атрибутов для доступности к посту-тригеру
1883 */
1884function t_feed__addAttributesForAccessibility(post) {
1885 var triggerLink = document.querySelector('[data-post-uid="' + post.uid + '"] .t-feed__link');
1886 if (!triggerLink || !document.querySelector('.t-feed__post-popup')) {
1887 return;
1888 }
1889 triggerLink.setAttribute('role', 'button');
1890 triggerLink.setAttribute('aria-haspopup', 'dialog');
1891}
1892
1893function t_feed_loadCommentsVkWidget(feed) {
1894 var comments = feed.querySelector('.t-feed__post-popup__comments');
1895 var scripts = comments ? comments.querySelectorAll('script') : [];
1896 Array.prototype.forEach.call(scripts, function (oldScript) {
1897 var newScript = document.createElement('script');
1898 Array.prototype.forEach.call(oldScript.attributes, function (attr) {
1899 newScript.setAttribute(attr.name, attr.value);
1900 });
Предыдущие 100 строкСледующие 100 строк