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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
9701/**9702 * Fade in an element9703 *9704 * @param {HTMLElement} el - the element to fade9705 * @param {number|string} [animationDuration] - the duration of the animation in milliseconds, default is 200ms9706 * @returns {boolean|*} false9707 **/9708function t_catalog__fadeIn(el, animationDuration) {9709	if (9710		(getComputedStyle(el).opacity === '1' || getComputedStyle(el).opacity === '') &&9711		getComputedStyle(el).display !== 'none'9712
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
)
9713 return false;
9714 var opacity = 0;
9715 var duration = animationDuration;
9716 if (!duration) {
9717 duration = 200;
9718 }
9719 duration = parseInt(String(duration));
9720 var speed = duration > 0 ? duration / 10 : 40;
9721 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
9722 // @ts-expect-error ST-2949_5
9723 el.style.opacity = opacity;
9724 el.style.display = 'block';
9725
9726 var timer = setInterval(function () {
9727 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
9728 // @ts-expect-error ST-2949_5
9729 el.style.opacity = opacity;
9730 opacity += 0.1;
9731 if (opacity >= 1.0) {
9732 clearInterval(timer);
9733 }
9734 }, speed);
9735
9736 return true;
9737}
9738
9739/**
9740 * Converts object to a string that can be used as a query
9741 *
9742 * @param {object} obj - the object to serialize
9743 * @param {string} prefix - The prefix to use for the key
9744 * @returns {string} - string as a query
9745 **/
9746function t_catalog__serializeData(obj, prefix) {
9747 var str = [];
9748 for (var property in obj) {
9749 if (Object.prototype.hasOwnProperty.call(obj, property)) {
9750 var key = prefix ? prefix + '[' + property + ']' : property;
9751 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
9752 // @ts-expect-error ST-2949_2
9753 var value = obj[property];
9754 var stringifyValue = JSON.stringify(value);
9755 if (stringifyValue !== '{}' && value !== null) {
9756 str.push(
9757 value !== null && typeof value === 'object'
9758 ? t_catalog__serializeData(value, key)
9759 : encodeURIComponent(key) + '=' + encodeURIComponent(value)
9760 );
9761 }
9762 }
9763 }
9764 return str.join('&');
9765}
9766
9767/**
9768 * If the error is a timeout, the endpoint is changed to store2.tildacdn.com
9769 *
9770 * @param {object} error - The error object.
9771 * @param {Function} callback - A function that will be called when the request is complete.
9772 **/
9773function t_catalog_changeEndpoint(error, callback) {
9774 if (
9775 error &&
9776 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
9777 // @ts-expect-error ST-2949_1
9778 (error.status >= 500 ||
9779 // @ts-expect-error ST-2949_1
9780 error.status == 408 ||
9781 // @ts-expect-error ST-2949_1
9782 error.status == 410 ||
9783 // @ts-expect-error ST-2949_1
9784 error.status == 429 ||
9785 // @ts-expect-error ST-2949_1
9786 error.type === 'timeout') &&
9787 // @ts-expect-error ST-2949_1
9788 window.t_catalog_endpoint.indexOf('store.tilda') !== -1
9789 ) {
9790 const rootzoneapi = t_catalog__getRootZone();
9791 // @ts-expect-error ST-2949_1
9792 window.t_catalog_endpoint = 'store2.tildaapi.' + rootzoneapi;
9793 if (typeof callback === 'function') {
9794 callback();
9795 }
9796 } else {
9797 var text;
9798 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
9799 // @ts-expect-error ST-2949_1
9800 if (error && error.responseText > '') {
Предыдущие 100 строкСледующие 100 строк