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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
4001				imgEl.setAttribute('data-original', imgSrc);4002				imgEl.src = t_catalog_getLazySrc(options, imgSrc);4003				var isSafari16_3 = /Version\/16\.3 Safari/.test(navigator.userAgent);4004				if (isSafari16_3) {4005					imgEl.style.objectFit = 'contain';4006				}4007			} else {4008				imgEl = document.createElement('div');4009				imgEl.classList.add('t-catalog__card__bgimg', 't-catalog__card__bgimg_second');4010				imgEl.classList.add('t-bgimg');4011				imgEl.setAttribute('data-original', imgSrc);
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
4012
imgEl.style.backgroundImage = 'url("' + t_catalog_getLazyUrl(options, imgSrc) + '")';
4013 }
4014
4015 return imgEl.outerHTML;
4016 }
4017 }
4018 return '';
4019}
4020
4021// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
4022// @ts-expect-error ST-2949_2
4023function t_catalog_get_productCard_mark_html(product, options) {
4024 if (!product.mark) {
4025 return '';
4026 }
4027 var stylesStr = '';
4028 stylesStr += options.markColor ? 'color:' + options.markColor + ';' : '';
4029 stylesStr += options.markBgColor ? 'background-color:' + options.markBgColor + ';' : '';
4030 var style = stylesStr ? 'style="' + stylesStr + '"' : '';
4031 var str = '';
4032 str += '<div class="t-catalog__card__mark-wrapper">';
4033 str += '<div class="t-catalog__card__mark" ' + style + '>';
4034 str += product.mark;
4035 str += '</div>';
4036 str += '</div>';
4037 return str;
4038}
4039
4040// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
4041// @ts-expect-error ST-2949_2
4042function t_catalog_get_productCard_txtAndPrice_html(product, edition, options, strImg) {
4043 var str = '';
4044 var removePadStyle = strImg === '' ? 'style="padding-top:0px;"' : '';
4045 str += '<div class="t-catalog__card__textwrapper" ' + removePadStyle + '>';
4046 str += t_catalog_get_productCard_txt_html(product, edition, options);
4047 str += '</div>';
4048 return str;
4049}
4050
4051// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
4052// @ts-expect-error ST-2949_2
4053function t_catalog_get_productCard_txt_html(product, edition, options) {
4054 var str = '';
4055 var typoClass;
4056 if (options.price.position === 'at') {
4057 str += t_catalog_get_productCard_Price_html(product, edition, options);
4058 }
4059 const alignClass = options.align === 'center' ? 't-catalog__card__text_align_center' : '';
4060
4061 var isSnippet =
4062 document.getElementById('allrecords') !== document.querySelector('.t-catalog__product-snippet') &&
4063 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
4064 // @ts-expect-error ST-2949_3
4065 document.getElementById('allrecords').contains(document.querySelector('.t-catalog__product-snippet'));
4066
4067 if (product.title) {
4068 if (parseInt(options.blocksInRow, 10) === 4) {
4069 typoClass = 't-name_xs';
4070 } else if (parseInt(options.blocksInRow, 10) === 2) {
4071 typoClass = 't-name_xl';
4072 } else {
4073 typoClass = 't-name_md';
4074 }
4075 const fieldId = edition.uid;
4076 const titleFieldAttr =
4077 product.editions.length === 1 && fieldId
4078 ? 'field="st_title__' + fieldId + '" data-redactor-toolbar="no"'
4079 : '';
4080 str +=
4081 '<div class="js-catalog-prod-name js-product-name t-catalog__card__title t-typography__title t-name ' +
4082 typoClass +
4083 ' ' +
4084 alignClass +
4085 '"' +
4086 (!options.title_typo && Object.prototype.hasOwnProperty.call(options.typo, 'title')
4087 ? 'style="' + options.typo.title + '"'
4088 : '') +
4089 titleFieldAttr +
4090 '>';
4091 str += product.title;
4092 str += '</div>';
4093 }
4094 if (options.price.position === 'bt') {
4095 str += t_catalog_get_productCard_Price_html(product, edition, options);
4096 }
4097 if (edition.sku) {
4098 const skuVisCss = options.prodCard.showOpts ? '' : 'display:none;';
4099 const skuStyle = skuVisCss ? 'style="' + skuVisCss + '"' : '';
4100 const fieldId = edition.uid;
Предыдущие 100 строкСледующие 100 строк