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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-feed-1.1.js

Код файла
Версия от 18.08.2026, 07:00:17 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
2801 */2802function t_feed__getVideoIframeHtml(videoType, params) {2803	if (!videoType) return '';2804 2805	const { videoId: id, videoHash: hash, videoTime: time, vkOID, videoParams } = params;2806 2807	const videoTypeConfig = {2808		youtube: {2809			baseUrl: `https://www.youtube.com/embed/${id}`,2810			params: ['rel=0', 'fmt=18', 'html5=1', 'showinfo=0', 'muted=1', 'enable', time && `start=${time}`],2811		},2812
История файла и сравнение версий
  • 18.08.2026, 07:00:17 · 56c3b845
vimeo: {
2813 baseUrl: `https://player.vimeo.com/video/${id}`,
2814 params: ['title=0', 'byline=0', 'portrait=0', 'badge=0', 'color=ffffff', 'muted=1', hash && `h=${hash}`],
2815 hashtag: time ? `#t=${time}` : '',
2816 },
2817 kinescope: {
2818 baseUrl: `https://kinescope.io/embed/${id}`,
2819 params: ['muted=1', time && `t=${time}`],
2820 },
2821 rutube: {
2822 baseUrl: `https://rutube.ru/embed/${id}`,
2823 params: ['muted=1', time && `t=${time}`, hash && `p=${hash}`],
2824 },
2825 vkvideo: {
2826 baseUrl: 'https://vkvideo.ru/video_ext.php',
2827 params: [
2828 'js_api=1',
2829 'hd=2',
2830 'muted=1',
2831 `id=${id}`,
2832 `oid=${vkOID}`,
2833 hash && `hash=${hash}`,
2834 time && `t=${time}`,
2835 ],
2836 },
2837 };
2838 const config = videoTypeConfig[videoType];
2839 if (!config) return '';
2840
2841 const { baseUrl, params: hashQueryArr, hashtag = '' } = config;
2842 if (videoParams) {
2843 hashQueryArr.push(videoParams);
2844 }
2845 const hashQueryStr = hashQueryArr.filter(param => param).join('&');
2846 const src = `${baseUrl}?${hashQueryStr}${hashtag}`;
2847
2848 return createIframeHtml(src);
2849
2850 /**
2851 * Создает и возвращает элемент iframe
2852 * @param {string} src - URL для iframe.
2853 * @param {Record<string, string>} [attrs] - Дополнительные атрибуты для iframe.
2854 * @returns {string} - Возвращает элемент iframe.
2855 */
2856 function createIframeHtml(src, attrs) {
2857 const iframe = document.createElement('iframe');
2858 iframe.src = src;
2859 iframe.classList.add('t-slds__frame');
2860 iframe.width = '100%';
2861 iframe.height = '100%';
2862 iframe.frameBorder = '0';
2863 iframe.allowFullscreen = true;
2864 // Поддержка разными браузерами
2865 iframe.setAttribute('mozallowfullscreen', 'true');
2866 iframe.setAttribute('msallowfullscreen', 'true');
2867 iframe.setAttribute('oallowfullscreen', 'true');
2868 iframe.setAttribute('webkitallowfullscreen', 'true');
2869 iframe.scrolling = 'no';
2870 iframe.allow = 'clipboard-write; fullscreen; picture-in-picture; encrypted-media; gyroscope; accelerometer;';
2871
2872 // Применение всех атрибутов из объекта attrs
2873 for (let key in attrs) {
2874 if (attrs.hasOwnProperty(key)) {
2875 iframe.setAttribute(key, attrs[key]);
2876 }
2877 }
2878 return iframe.outerHTML;
2879 }
2880}
2881
2882function t_feed_drawPostPopupGallery(recid, opts, post) {
2883 var galleryItems = JSON.parse(post.mediadata);
2884 var galleryControl = typeof opts.gallery != 'undefined' ? opts.gallery.control : '';
2885 var withArrowsClass = galleryControl !== 'dots' ? ' t-slds__witharrows' : '';
2886
2887 var str = '';
2888 str +=
2889 '<div class="t-slds" style="visibility: hidden;">' +
2890 '<div class="t-container t-slds__main">' +
2891 '<div class="t-slds__container t-width t-margin_auto">' +
2892 '<div class="t-slds__items-wrapper ' +
2893 withArrowsClass +
2894 '" data-slider-transition="" data-slider-with-cycle="true" data-slider-correct-height="true" data-auto-correct-mobile-width="false" aria-roledescription="carousel">';
2895 galleryItems.forEach(function (item, i) {
2896 var activeClass = i == 0 ? ' t-slds__item_active' : '';
2897 var zoomClass = opts.popup_opts.zoom ? ' t-zoomable' : '';
2898 var zoomTarget = opts.popup_opts.zoom ? ' data-zoomable="yes" data-img-zoom-url="' + item.img + '"' : '';
2899
2900 str +=
Предыдущие 100 строкСледующие 100 строк