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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
3101 * @param {string} type - 'current' or 'old'3102 * @returns {string} - HTML code3103 **/3104function t_catalog_get_productPopup_onePrice_html(options, type) {3105	var str = '';3106	var priceStylingClass =3107		type === 'current'3108			? 'js-catalog-prod-price t-catalog__prod-popup__price'3109			: 'js-catalog-prod-price-old t-catalog__prod-popup__price_old';3110 3111	// стили для типографики вынесены в отдельный тег <style> в tpl_catalog_setup.tpl3112
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
// проверка наличия свойств в options необходима для пользователей, которые не успели переопубликовать страницы,
3113 // а значит обновления в tpl еще не применились
3114 var shouldUseInlineStyleForPrice =
3115 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
3116 // @ts-expect-error ST-2949_1
3117 Object.prototype.hasOwnProperty.call(options.price, 'fontWeight') &&
3118 // @ts-expect-error ST-2949_1
3119 Object.prototype.hasOwnProperty.call(options.price, 'fontSize');
3120
3121 var styleAttr;
3122 var styleStr = '';
3123 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
3124 // @ts-expect-error ST-2949_1
3125 var color = type === 'current' ? options.price.color : options.price.colorOld;
3126
3127 // @ts-expect-error ST-2949_1
3128 var popupContainerBgColor = options.popup_opts.containerBgColor;
3129 if (Math.abs(t_catalog_getLightnessColor(color) - t_catalog_getLightnessColor(popupContainerBgColor)) === 0) {
3130 color = t_catalog_luma_rgb(popupContainerBgColor);
3131 if (!shouldUseInlineStyleForPrice) styleStr += color ? 'color:' + color + ';' : '';
3132 }
3133
3134 if (shouldUseInlineStyleForPrice) {
3135 styleStr += color ? 'color:' + color + ';' : '';
3136 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
3137 // @ts-expect-error ST-2949_1
3138 styleStr += options.price.fontWeight ? 'font-weight:' + options.price.fontWeight + ';' : '';
3139 }
3140
3141 styleAttr = styleStr !== '' ? 'style = "' + styleStr + '"' : '';
3142
3143 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
3144 // @ts-expect-error ST-2949_1
3145 var currency = options.currencyTxt
3146 ? // @ts-expect-error ST-2949_1
3147 '<div class="t-catalog__prod-popup__price-currency" translate="no">' + options.currencyTxt + '</div>'
3148 : '';
3149 var jsProdClass =
3150 type === 'current' ? 'js-product-price js-catalog-prod-price-val' : 'js-catalog-prod-price-old-val';
3151
3152 str +=
3153 '<div class="' + priceStylingClass + ' t-catalog__prod-popup__price-item t-name t-name_md" ' + styleAttr + '>';
3154 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
3155 // @ts-expect-error ST-2949_1
3156 str += options.currencySide !== 'r' && currency ? currency : '';
3157 str += '<div class="' + jsProdClass + ' t-catalog__prod-popup__price-value" translate="no"></div>';
3158 // @ts-expect-error ST-2949_1
3159 str += options.currencySide === 'r' && currency ? currency : '';
3160 str += '</div>';
3161
3162 return str;
3163}
3164
3165/**
3166 * Make the title of the product popup
3167 *
3168 * @returns {string} HTML code
3169 **/
3170function t_catalog_get_productPopup_titleText_html() {
3171 var str = '';
3172 str += '<div class="t-catalog__prod-popup__title-wrapper">';
3173 str +=
3174 ' <div class="js-catalog-prod-name js-product-name t-catalog__prod-popup__name t-typography__title t-name t-name_xl"></div>';
3175 str += ' <div class="t-catalog__prod-popup__brand t-typography__sku t-descr t-descr_xxs"></div>';
3176 str += ' <div class="t-catalog__prod-popup__sku t-typography__sku t-descr t-descr_xxs">';
3177 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
3178 // @ts-expect-error ST-2949_3
3179 str += window.tCatalogDict['sku'] + ': ';
3180 str += '<span class="js-catalog-prod-sku js-product-sku">';
3181 str += '</span>';
3182 str += ' </div>';
3183 str += '</div>';
3184 return str;
3185}
3186
3187/**
3188 * Make the close icon for the popup
3189 *
3190 * @param {object} options
3191 * @returns {string} - HTML code
3192 **/
3193function t_catalog_get_productPopup_closeIcon_html(options) {
3194 var str = '';
3195 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
3196 // @ts-expect-error ST-2949_1
3197 var iconFillColor = options.popup_opts.iconColor ? options.popup_opts.iconColor : '#000000';
3198 // @ts-expect-error ST-2949_1
3199 var bgColor = options.popup_opts.overlayBgColorRgba
3200 ? // @ts-expect-error ST-2949_1
Предыдущие 100 строкСледующие 100 строк