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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1301 1302// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)1303// @ts-expect-error ST-2949_21304function t_catalog_createCssProperty(propertyName, value) {1305	return `${propertyName}: ${value};`;1306}1307 1308// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)1309// @ts-expect-error ST-2949_21310function t_catalog_addRule(targetArr, prop, val) {1311	if (val === undefined || val === null || val === '') return;
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
1312 targetArr.push(t_catalog_createCssProperty(prop, val));
1313}
1314
1315// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
1316// @ts-expect-error ST-2949_2
1317function t_catalog_addTextColorRule(targetArr, val) {
1318 if (t_catalog_isGradient(val)) {
1319 t_catalog_addRule(targetArr, 'background-image', val);
1320 t_catalog_addRule(targetArr, '-webkit-text-fill-color', 'transparent');
1321 t_catalog_addRule(targetArr, '-webkit-background-clip', 'text');
1322 t_catalog_addRule(targetArr, 'background-clip', 'text');
1323 } else {
1324 t_catalog_addRule(targetArr, 'color', val);
1325 }
1326}
1327
1328// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
1329// @ts-expect-error ST-2949_2
1330function t_catalog_isGradient(stylePropertyValue) {
1331 return typeof stylePropertyValue === 'string' && stylePropertyValue.indexOf('gradient') !== -1;
1332}
1333
1334/**
1335 * Добавляет анимацию смены фона при наведении
1336 * @param {string} css
1337 * @returns
1338 */
1339function t_catalog_appendMainButtonBgHoverStyle(css) {
1340 return (
1341 css +
1342 `
1343 \n
1344 @media (hover: hover) {
1345 .t-catalog__prod-snippet__container .t-catalog__prod-popup__btn:hover {
1346 animation-name: t-button-hover-animation;
1347 animation-duration: 0s;
1348 animation-fill-mode: forwards;
1349 animation-delay: 1s;
1350 animation-timing-function: linear;
1351 }
1352 }
1353 `
1354 );
1355}
1356
1357/**
1358 * Initialize the hover zoom plugin. It is called when the page is loaded
1359 *
1360 * @param {string} recid
1361 **/
1362function t_catalog_hoverZoom_init(recid) {
1363 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
1364 // @ts-expect-error ST-2949_1
1365 if (window.tCatalogIsMobile) return;
1366
1367 var rec = document.getElementById('rec' + recid);
1368 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
1369 // @ts-expect-error ST-2949_3
1370 if (rec.querySelector('[data-hover-zoom]')) {
1371 // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592)
1372 // @ts-expect-error ST-2949_4
1373 t_catalog__loadHoverZoom().then(() => t_hoverZoom_init(recid));
1374 }
1375}
1376
1377/**
1378 * Loads products from the store and shown
1379 *
1380 * @param {string} method - relevants or not
1381 * @param {string} recid
1382 * @param {CatalogOptions} options
1383 * @param {number} slice - the number of the slice to load
1384 * @param {object} relevantsOpts
1385 * @param {HTMLElement} [relevantsOpts.container]
1386 **/
1387function t_catalog_loadProducts(method, recid, options, slice, relevantsOpts) {
1388 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
1389 // @ts-expect-error ST-2949_1
1390 window.tCatalogProductsRequested = true;
1391
1392 var showRelevants = method === 'relevants';
1393 var c = Date.now();
1394 var storepartuid = options.storepart;
1395 // Флаг одноразовый: сбрасываем сразу, чтобы он не остался выставленным при ошибке запроса
1396 var skipFiltersInit = Boolean(options.skipFiltersInit);
1397 options.skipFiltersInit = false;
1398 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
1399 // @ts-expect-error ST-2949_5
1400 var isFirstSlice = !slice || parseInt(slice, 10) === 1;
Предыдущие 100 строкСледующие 100 строк