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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
8301				return new URL(editionImageUrl)?.pathname;8302			} catch (error) {8303				return '';8304			}8305		})();8306 8307		if (imgPathName && imgPathName !== '/') {8308			const editionImage = el_product.querySelector(8309				`.t-slds__item .t-slds__bgimg[data-original$="${imgPathName}"]`8310			);8311			if (editionImage) {8312				// TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
8313 // @ts-expect-error ST-2949_5
8314 editionSlide = editionImage.closest('.t-slds__item');
8315 }
8316 }
8317 }
8318
8319 // случай: сайт был экспортирован
8320 if (editionImageUrl.indexOf('http://') !== -1 || editionImageUrl.indexOf('https://') !== -1) {
8321 try {
8322 var url = new URL(editionImageUrl);
8323 var pathname = url.pathname;
8324
8325 if (pathname[0] === '/') {
8326 pathname = pathname.slice(1).replace(/\//, '__');
8327 }
8328
8329 var exportedEditionImage = el_product.querySelector(
8330 '.t-slds__item .t-slds__bgimg[data-original$="' + pathname + '"]'
8331 );
8332 if (!editionSlide && exportedEditionImage) {
8333 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
8334 // @ts-expect-error ST-2949_5
8335 editionSlide = exportedEditionImage.closest('.t-slds__item');
8336 }
8337 } catch (error) {
8338 console.error(error);
8339 }
8340 }
8341
8342 // определяем позицию изображения внутри слайдера
8343 if (editionSlide) {
8344 // если она нулевая (0 это фейковый слайд для анимации), то перемещаем к последнему слайду
8345 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
8346 // @ts-expect-error ST-2949_5
8347 sliderPosition = parseInt(editionSlide.getAttribute('data-slide-index'), 10);
8348 if (sliderPosition === 0) {
8349 sliderPosition = totalSlides;
8350 }
8351 }
8352
8353 // перемещаем слайдер без анимации
8354 sliderWrapper.setAttribute('data-slider-pos', sliderPosition.toString());
8355
8356 // блок ST215 не содержит слайдер
8357 if (!el_product.classList.contains('t922')) {
8358 t_catalog_onFuncLoad('t_slideMoveInstantly', function () {
8359 // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592)
8360 // @ts-expect-error ST-2949_4
8361 t_slideMoveInstantly(recid + ' .js-catalog-product');
8362 });
8363 }
8364}
8365
8366// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
8367// @ts-expect-error ST-2949_2
8368function t_catalog_product_triggerSoldOutMsg(recid, productElement, isSoldOut, options) {
8369 var el_product = productElement;
8370 t_catalog__removeElement(el_product.querySelector('.js-catalog-prod-sold-out'));
8371 var el_buyBtn = el_product.querySelectorAll(
8372 '.t-catalog__card__btns-wrapper [href="#order"], .t-catalog__prod-popup__btn-wrapper [href="#order"]'
8373 );
8374
8375 // у одиночных товаров wrapper кнопок с другими классами
8376 if (el_buyBtn.length === 0) {
8377 el_buyBtn = el_product.querySelectorAll('[href="#order"]');
8378 }
8379
8380 // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592)
8381 // @ts-expect-error ST-2949_4
8382 if (window.jQuery && el_product instanceof jQuery) {
8383 // @ts-expect-error ST-2949_4
8384 el_product = $(el_product).get(0);
8385 }
8386
8387 var orderBtn1 = options.prodCard && options.prodCard.btnLink1 === 'order';
8388 var orderBtn2 = options.prodCard && options.prodCard.btnLink2 === 'order';
8389 var el_buyBtnTxt;
8390
8391 if (el_buyBtn[0]) {
8392 el_buyBtnTxt = el_buyBtn[0].querySelector('.js-catalog-prod-popup-buy-btn-txt');
8393 if (el_product.getAttribute('data-card-size') === 'small') {
8394 el_buyBtnTxt = el_buyBtn[0].querySelector('.t-catalog__card__btn-text');
8395 }
8396 if (!el_buyBtnTxt) {
8397 el_buyBtnTxt = el_buyBtn[0].querySelector('.js-catalog-prod-buy-btn-txt');
8398 }
8399 }
8400
Предыдущие 100 строкСледующие 100 строк