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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
601			if (canonical && url) {602				canonical.setAttribute('href', url);603			}604		}605		if (params.updateDocumentTitle && typeof title === 'string') {606			document.title = title;607		}608	} catch (error) {609		console.error(error);610	}611}612 613
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
/**
614 * Initialize the product from Snippet
615 *
616 * @param {string} recid
617 * @param {object} options
618 * @param {object} product - the options of product
619 **/
620
621function t_catalog_productInit(recid, options, product) {
622 t_onReady(function () {
623 const allRecords = document.getElementById('allrecords');
624
625 if (allRecords) {
626 t_catalog__setupEndpoint();
627 }
628 t_catalog_snippet_initProduct(recid, options, product);
629 });
630}
631
632// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
633// @ts-expect-error ST-2949_2
634function t_catalog_snippet_initProduct(recid, options, product) {
635 var rec = document.querySelector('#rec' + recid);
636 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
637 // @ts-expect-error ST-2949_3
638 var el_product = rec.querySelector('.t-catalog__product-snippet.js-catalog-product');
639 // @ts-expect-error ST-2949_3
640 el_product.setAttribute('data-card-size', 'large');
641 var urlSearch = t_catalog_snippet_getJsonFromUrl();
642
643 if (options.popup_opts.popupContainer === '100') {
644 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
645 // @ts-expect-error ST-2949_3
646 var productContainer = el_product.querySelector('.t-container');
647 // @ts-expect-error ST-2949_3
648 productContainer.classList.add('t-container_fluid');
649 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
650 // @ts-expect-error ST-2949_1
651 productContainer.style.maxWidth = '100%';
652
653 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
654 // @ts-expect-error ST-2949_3
655 if (productContainer.firstElementChild) {
656 // @ts-expect-error ST-2949_3
657 productContainer.firstElementChild.classList.add('t-container_fluid');
658 }
659 }
660
661 t_catalog_snippet_copyTypographyToSnippet(recid, options);
662
663 t_catalog_drawProdPopup_drawGallery(recid, el_product, product, options);
664
665 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
666 // @ts-expect-error ST-2949_5
667 initProductSnippetBreadcrumbs(recid, el_product, product, options);
668
669 var addOptionsAndChooseEdition = function () {
670 // @ts-expect-error ST-2949_5
671 t_catalog_addProductOptions(recid, product, el_product, options, 'largecard');
672 t_catalog_snippet_chooseEditionFromUrl(recid, product, el_product, options);
673 t_catalog_onFuncLoad('t_prod__init', function () {
674 // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592)
675 // @ts-expect-error ST-2949_4
676 t_prod__init(recid);
677 });
678 };
679
680 if (!window.tCatalogDict) {
681 t_catalog__setGlobalDictObj();
682 }
683
684 // Snippet relevants title fallback (same logic as popup)
685 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
686 // @ts-expect-error ST-2949_3
687 var relevantsTitle = rec.querySelector('.t-catalog__relevants__title');
688 // @ts-expect-error ST-2949_3
689 if (relevantsTitle && !relevantsTitle.textContent.trim()) {
690 // @ts-expect-error ST-2949_3
691 relevantsTitle.textContent = options.titleRelevants ? options.titleRelevants : window.tCatalogDict['seeAlso'];
692 if (Object.prototype.hasOwnProperty.call(options.typo, 'title') && options.typo.title) {
693 relevantsTitle.setAttribute('style', options.typo.title);
694 }
695 }
696
697 // add SKU text
698 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
699 // @ts-expect-error ST-2949_3
700 var storeProdSKU = el_product.querySelector('.js-catalog-prod-sku');
Предыдущие 100 строкСледующие 100 строк