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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-feed-1.0.js

Код файла
Версия от 24.08.2026, 07:03:11 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
2701	if (!videoType) return '';2702 2703	const { videoId: id, videoHash: hash, videoTime: time, vkOID, videoParams } = params;2704 2705	const videoTypeConfig = {2706		youtube: {2707			baseUrl: `https://www.youtube.com/embed/${id}`,2708			params: ['rel=0', 'fmt=18', 'html5=1', 'showinfo=0', 'muted=1', 'enable', time && `start=${time}`],2709		},2710		vimeo: {2711			baseUrl: `https://player.vimeo.com/video/${id}`,2712
История файла и сравнение версий
  • 24.08.2026, 07:03:11 · 56c3b845
params: ['title=0', 'byline=0', 'portrait=0', 'badge=0', 'color=ffffff', 'muted=1', hash && `h=${hash}`],
2713 hashtag: time ? `#t=${time}` : '',
2714 },
2715 kinescope: {
2716 baseUrl: `https://kinescope.io/embed/${id}`,
2717 params: ['muted=1', time && `t=${time}`],
2718 },
2719 rutube: {
2720 baseUrl: `https://rutube.ru/embed/${id}`,
2721 params: ['muted=1', time && `t=${time}`, hash && `p=${hash}`],
2722 },
2723 vk: {
2724 baseUrl: 'https://vk.com/video_ext.php',
2725 params: ['js_api=1', 'hd=2', 'muted=1', `id=${id}`, `oid=${vkOID}`, hash && `hash=${hash}`, time && `t=${time}`],
2726 },
2727 vkvideo: {
2728 baseUrl: 'https://vkvideo.ru/video_ext.php',
2729 params: ['js_api=1', 'hd=2', 'muted=1', `id=${id}`, `oid=${vkOID}`, hash && `hash=${hash}`, time && `t=${time}`],
2730 },
2731 };
2732 const config = videoTypeConfig[videoType];
2733 if (!config) return '';
2734
2735 const { baseUrl, params: hashQueryArr, hashtag = '' } = config;
2736 if (videoParams) {
2737 hashQueryArr.push(videoParams);
2738 }
2739 const hashQueryStr = hashQueryArr.filter(param => param).join('&');
2740 const src = `${baseUrl}?${hashQueryStr}${hashtag}`;
2741
2742 return createIframeHtml(src);
2743
2744 /**
2745 * Создает и возвращает элемент iframe
2746 * @param {string} src - URL для iframe.
2747 * @param {Record<string, string>} [attrs] - Дополнительные атрибуты для iframe.
2748 * @returns {string} - Возвращает элемент iframe.
2749 */
2750 function createIframeHtml(src, attrs) {
2751 const iframe = document.createElement('iframe');
2752 iframe.src = src;
2753 iframe.classList.add('t-slds__frame');
2754 iframe.width = '100%';
2755 iframe.height = '100%';
2756 iframe.frameBorder = '0';
2757 iframe.allowFullscreen = true;
2758 // Поддержка разными браузерами
2759 iframe.setAttribute('mozallowfullscreen', 'true');
2760 iframe.setAttribute('msallowfullscreen', 'true');
2761 iframe.setAttribute('oallowfullscreen', 'true');
2762 iframe.setAttribute('webkitallowfullscreen', 'true');
2763 iframe.scrolling = 'no';
2764 iframe.allow = 'clipboard-write; fullscreen; picture-in-picture; encrypted-media; gyroscope; accelerometer;';
2765
2766 // Применение всех атрибутов из объекта attrs
2767 for (let key in attrs) {
2768 if (attrs.hasOwnProperty(key)) {
2769 iframe.setAttribute(key, attrs[key]);
2770 }
2771 }
2772 return iframe.outerHTML;
2773 }
2774}
2775
2776function t_feed_drawPostPopupGallery(recid, opts, post) {
2777 var galleryItems = JSON.parse(post.mediadata);
2778 var galleryControl = typeof opts.gallery != 'undefined' ? opts.gallery.control : '';
2779 var withArrowsClass = galleryControl !== 'dots' ? ' t-slds__witharrows' : '';
2780
2781 var str = '';
2782 str +=
2783 '<div class="t-slds" style="visibility: hidden;">' +
2784 '<div class="t-container t-slds__main">' +
2785 '<div class="t-slds__container t-width t-margin_auto">' +
2786 '<div class="t-slds__items-wrapper ' +
2787 withArrowsClass +
2788 '" data-slider-transition="" data-slider-with-cycle="true" data-slider-correct-height="true" data-auto-correct-mobile-width="false" aria-roledescription="carousel">';
2789 galleryItems.forEach(function (item, i) {
2790 var activeClass = i == 0 ? ' t-slds__item_active' : '';
2791 var zoomClass = opts.popup_opts.zoom ? ' t-zoomable' : '';
2792 var zoomTarget = opts.popup_opts.zoom ? ' data-zoomable="yes" data-img-zoom-url="' + item.img + '"' : '';
2793
2794 str +=
2795 '<div class="t-slds__item' +
2796 activeClass +
2797 '" data-slide-index="' +
2798 (i + 1) +
2799 ' role="group" aria-roledescription="slide" ' +
2800 'aria-label="' +
Предыдущие 100 строкСледующие 100 строк