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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
9201	// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)9202	// @ts-expect-error ST-2949_29203	var onDone = function (dataObj) {9204		var productsArr = dataObj.products;9205 9206		if (productsArr === '') {9207			console.error("Something went wrong. Can't get products array by uid list. Please check products UID.");9208			return;9209		}9210 9211		// store option params9212
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
if (dataObj.options && dataObj.options.length && !window.tCatalogOptionsList) {
9213 window.tCatalogOptionsList = dataObj.options;
9214 }
9215
9216 // save data after request, to make to reachable for other single blocks
9217 window.tStoreSingleProdsObj = t_catalog_oneProduct_prodsArrToAssociative(productsArr);
9218 Array.prototype.forEach.call(el_singleProds, function (product) {
9219 t_catalog_triggerEvent(product, 'tStoreSingleProductsLoaded');
9220 });
9221 };
9222
9223 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
9224 // @ts-expect-error ST-2949_2
9225 t_catalog_loadProducts_byId(arrId, options, onDone, function (error) {
9226 t_catalog_changeEndpoint(error, function () {
9227 // @ts-expect-error ST-2949_2
9228 t_catalog_loadProducts_byId(arrId, options, onDone);
9229 });
9230 });
9231}
9232
9233// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
9234// @ts-expect-error ST-2949_2
9235function t_catalog_oneProduct_prodsArrToAssociative(productsArr) {
9236 var obj = {};
9237 if (!productsArr) {
9238 return obj;
9239 }
9240 for (var i = 0; i < productsArr.length; i++) {
9241 var cur = productsArr[i];
9242 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
9243 // @ts-expect-error ST-2949_2
9244 obj[cur.uid] = cur;
9245 }
9246 return obj;
9247}
9248
9249// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
9250// @ts-expect-error ST-2949_2
9251function t_catalog_oneProduct_fill(recid, product, options) {
9252 var rec = document.getElementById('rec' + recid);
9253 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
9254 // @ts-expect-error ST-2949_3
9255 var el_product = rec.querySelector('.js-product');
9256 if (!el_product) return;
9257 t_catalog_oneProduct_preloader_hide(recid);
9258
9259 el_product.setAttribute('data-card-size', 'large');
9260
9261 if (!product) {
9262 t_catalog_oneProduct_error_show(recid, options);
9263 t_catalog_product_triggerSoldOutMsg(recid, el_product, true, options);
9264
9265 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
9266 // @ts-expect-error ST-2949_3
9267 if (el_product.querySelector('.js-catalog-prod-price-old-val').textContent === '') {
9268 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
9269 // @ts-expect-error ST-2949_1
9270 el_product.querySelector('.js-catalog-prod-price-old').style.display = 'none';
9271 }
9272
9273 return;
9274 }
9275 t_catalog_oneProduct_successMsg_show(recid, product, options);
9276
9277 el_product.setAttribute('data-product-pack-label', product.pack_label);
9278 el_product.setAttribute('data-product-pack-m', product.pack_m);
9279 el_product.setAttribute('data-product-pack-x', product.pack_x);
9280 el_product.setAttribute('data-product-pack-y', product.pack_y);
9281 el_product.setAttribute('data-product-pack-z', product.pack_z);
9282 el_product.setAttribute('data-product-url', product.url || '');
9283
9284 var partuids = product.partuids && JSON.parse(product.partuids);
9285 el_product.setAttribute('data-product-part-uid', partuids || '');
9286
9287 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
9288 // @ts-expect-error ST-2949_5
9289 t_catalog_addProductOptions(recid, product, el_product, options, 'largecard');
9290 t_catalog_snippet_chooseEditionFromUrl(recid, product, el_product, options);
9291 t_catalog_onFuncLoad('t_prod__init', function () {
9292 // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592)
9293 // @ts-expect-error ST-2949_4
9294 t_prod__init(recid);
9295 });
9296
9297 // TODO: вывод характеристик для старых пользователей неприемлимо, им придётся удалять много текста из товаров в каталоге
9298 // Также описание в одиночных товарах уже есть в контенте - функцию нужно разделить на initText и initCharacteristics
9299 // t_catalog_initTextAndCharacteristics(el_product, product);
9300
Предыдущие 100 строкСледующие 100 строк