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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
7201		columnSizeForMainImage,7202		galleryImageAspectRatio,7203		thumbsSize,7204		marginBetweenThumbs7205	);7206	// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)7207	// @ts-expect-error ST-2949_27208	var strBullets;7209 7210	var oneBulletTpl;7211	var oneBulletStr;7212 
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
7213 if (
7214 (thumbsCount !== maxThumbsCount && galleryArr.length >= maxThumbsCount) ||
7215 (thumbsCount < maxThumbsCount && thumbsCount !== galleryArr.length)
7216 ) {
7217 Array.prototype.forEach.call(galleryArr, function (image, index) {
7218 if (index <= maxThumbsCount - 1) {
7219 if (index <= maxThumbsCount - 2 || index === galleryArr.length - 1) {
7220 oneBulletTpl = t_catalog_get_productcard_oneSliderBullet_html(options);
7221 oneBulletStr = oneBulletTpl
7222 .replace('[[videoPlayIcon]]', '')
7223 .replace('[[activeClass]]', index === 0 ? 't-slds__bullet_active' : '')
7224 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
7225 // @ts-expect-error ST-2949_5
7226 .replace(/\[\[index\]\]/g, index + 1)
7227 .replace(/\[\[imgsource_lazy\]\]/g, t_catalog_getLazyUrl(options, image.img))
7228 .replace(/\[\[imgsource\]\]/g, image.img)
7229 .replace(/\[\[imgalttext\]\]/g, t_catalog_escapeQuote(image.alt));
7230 } else {
7231 oneBulletTpl = t_catalog_get_productcard_thumbsGallery_html(
7232 options,
7233 galleryArr.length,
7234 maxThumbsCount
7235 );
7236 oneBulletStr = oneBulletTpl
7237 .replace('[[activeClass]]', index === 0 ? 't-slds__bullet_active' : '')
7238 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
7239 // @ts-expect-error ST-2949_5
7240 .replace(/\[\[index\]\]/g, index + 1)
7241 .replace(/\[\[imgsource_lazy\]\]/g, t_catalog_getLazyUrl(options, image.img))
7242 .replace(/\[\[imgsource\]\]/g, image.img)
7243 .replace(/\[\[imgalttext\]\]/g, t_catalog_escapeQuote(image.alt));
7244 }
7245
7246 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
7247 // @ts-expect-error ST-2949_2
7248 strBullets += oneBulletStr;
7249 }
7250 });
7251
7252 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
7253 // @ts-expect-error ST-2949_3
7254 var thumbsWrapper = rec.querySelector('.t-slds__thumbsbullet-wrapper');
7255 // @ts-expect-error ST-2949_3
7256 thumbsWrapper.innerHTML = strBullets;
7257
7258 var sliderOptions;
7259
7260 if (options.sliderthumbsside === 'l') {
7261 sliderOptions = {
7262 thumbsbulletGallery: true,
7263 storeOptions: options,
7264 };
7265 }
7266
7267 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
7268 // @ts-expect-error ST-2949_5
7269 t_sldsInit(recid + ' .js-catalog-product', sliderOptions);
7270 t_catalog_popup_updateLazyLoad();
7271 }
7272}
7273
7274// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
7275// @ts-expect-error ST-2949_2
7276function t_catalog_prodPopup_gallery_calcMaxThumbsCount(columnSize, galleryImageRatio, thumbSize, marginBetweenThumbs) {
7277 var columnWidth = t_catalog_getColumnWidth(columnSize);
7278 var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
7279
7280 // hack for popup columns
7281 if (windowWidth >= 960 && windowWidth <= 1240) {
7282 columnWidth = 440;
7283 }
7284
7285 var mainImageHeightPercent = Math.floor(galleryImageRatio * 100);
7286 var mainImageHeight = Math.floor(
7287 (mainImageHeightPercent * (columnWidth - (thumbSize + marginBetweenThumbs))) / 100
7288 );
7289 var maxPreviewsCount = Math.floor(mainImageHeight / (thumbSize + marginBetweenThumbs));
7290
7291 if ((thumbSize + marginBetweenThumbs) * (maxPreviewsCount + 1) - marginBetweenThumbs <= mainImageHeight) {
7292 maxPreviewsCount += 1;
7293 }
7294
7295 return maxPreviewsCount;
7296}
7297
7298// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
7299// @ts-expect-error ST-2949_2
7300function t_catalog_get_productcard_slider_html(rec, options) {
Предыдущие 100 строкСледующие 100 строк