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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
6201 * @param {HTMLElement} snippetContainer - Контейнер сниппета товара6202 * @param {string} recid - ID записи6203 * @param {CatalogOptions} options - Объект настроек6204 * @param {string} [bgColor] - Цвет фона6205 */6206function t_catalog_setProductDescriptionStyles(snippetContainer, recid, options, bgColor) {6207	const productDescr = snippetContainer.querySelector('.js-catalog-prod-text');6208	if (!productDescr) return;6209 6210	if (options.descr_typo) {6211		t_catalog_parseTypoStylesConfig(
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
6212
recid,
6213 '.t-catalog__prod-popup__text',
6214 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
6215 // @ts-expect-error ST-2949_5
6216 options.descr_typo,
6217 'js-catalog-descr-typo-styles-' + recid
6218 );
6219 return;
6220 }
6221
6222 const productDescrStyle = productDescr.getAttribute('style');
6223 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
6224 // @ts-expect-error ST-2949_5
6225 productDescr.setAttribute('style', t_catalog_removeSizesFromStylesLine(productDescrStyle));
6226
6227 if (bgColor) {
6228 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
6229 // @ts-expect-error ST-2949_3
6230 const productDescrColor = options.typo.descrColor;
6231 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
6232 // @ts-expect-error ST-2949_5
6233 t_catalog_applyContrastColorIfNecessary(productDescr, productDescrColor, bgColor);
6234 }
6235}
6236
6237/**
6238 * Устанавливает стили для цены товара в сниппете
6239 * @param {HTMLElement} snippetContainer - Контейнер сниппета товара
6240 * @param {string} recid - ID записи
6241 * @param {CatalogOptions} options - Объект настроек
6242 * @param {string} [bgColor] - Цвет фона
6243 */
6244function t_catalog_setProductPriceStyles(snippetContainer, recid, options, bgColor) {
6245 const productPrice = snippetContainer.querySelector('.js-catalog-prod-price');
6246 if (!productPrice) return;
6247
6248 if (options.price_typo) {
6249 t_catalog_parseTypoStylesConfig(
6250 recid,
6251 '.t-catalog__prod-popup__price',
6252 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
6253 // @ts-expect-error ST-2949_5
6254 options.price_typo,
6255 'js-catalog-price-typo-styles-' + recid
6256 );
6257 return;
6258 }
6259
6260 if (bgColor) {
6261 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
6262 // @ts-expect-error ST-2949_3
6263 const productPriceColor = options.price.color;
6264 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
6265 // @ts-expect-error ST-2949_5
6266 t_catalog_applyContrastColorIfNecessary(productPrice, productPriceColor, bgColor);
6267 }
6268}
6269
6270/**
6271 * Устанавливает стили для старой цены товара в сниппете
6272 * @param {HTMLElement} snippetContainer - Контейнер сниппета товара
6273 * @param {string} recid - ID записи
6274 * @param {CatalogOptions} options - Объект настроек
6275 * @param {string} [bgColor] - Цвет фона
6276 */
6277function t_catalog_setProductOldPriceStyles(snippetContainer, recid, options, bgColor) {
6278 const productOldPrice = snippetContainer.querySelector('.js-catalog-prod-price-old');
6279 if (!productOldPrice) return;
6280
6281 if (options.price_old_typo) {
6282 t_catalog_parseTypoStylesConfig(
6283 recid,
6284 '.t-catalog__prod-popup__price_old',
6285 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
6286 // @ts-expect-error ST-2949_5
6287 options.price_old_typo,
6288 'js-catalog-old-price-typo-styles-' + recid
6289 );
6290 return;
6291 }
6292
6293 if (bgColor) {
6294 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
6295 // @ts-expect-error ST-2949_3
6296 const productOldPriceColor = options.price.colorOld;
6297 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
6298 // @ts-expect-error ST-2949_5
6299 t_catalog_applyContrastColorIfNecessary(productOldPrice, productOldPriceColor, bgColor);
6300 }
Предыдущие 100 строкСледующие 100 строк