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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.1.js

Код файла
Версия от 04.12.2026, 04:03:55 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
9201		el.style.opacity = opacity;9202		opacity += 0.1;9203		if (opacity >= 1.0) {9204			clearInterval(timer);9205		}9206	}, speed);9207 9208	return true;9209}9210 9211/**9212 * Converts object to a string that can be used as a query9213
История файла и сравнение версий
  • 04.12.2026, 04:03:55 · 56c3b845
*
9214 * @param {object} obj - the object to serialize
9215 * @param {string} prefix - The prefix to use for the key
9216 * @returns {string} - string as a query
9217 **/
9218function t_store__serializeData(obj, prefix) {
9219 var str = [];
9220 for (var property in obj) {
9221 if (Object.prototype.hasOwnProperty.call(obj, property)) {
9222 var key = prefix ? prefix + '[' + property + ']' : property;
9223 var value = obj[property];
9224 var stringifyValue = JSON.stringify(value);
9225 if (stringifyValue !== '{}' && value !== null) {
9226 str.push(
9227 value !== null && typeof value === 'object'
9228 ? t_store__serializeData(value, key)
9229 : encodeURIComponent(key) + '=' + encodeURIComponent(value)
9230 );
9231 }
9232 }
9233 }
9234 return str.join('&');
9235}
9236
9237/**
9238 * If the error is a timeout, the endpoint is changed to store2.tildacdn.com
9239 *
9240 * @param {object} error - The error object.
9241 * @param {Function} callback - A function that will be called when the request is complete.
9242 **/
9243function t_store_changeEndpoint(error, callback) {
9244 if (
9245 error &&
9246 (error.status >= 500 ||
9247 error.status == 408 ||
9248 error.status == 410 ||
9249 error.status == 429 ||
9250 error.type === 'timeout') &&
9251 window.t_store_endpoint.indexOf('store.tilda') !== -1
9252 ) {
9253 const rootzoneapi = t_store__getRootZone();
9254 window.t_store_endpoint = 'store2.tildaapi.' + rootzoneapi;
9255 if (typeof callback === 'function') {
9256 callback();
9257 }
9258 } else {
9259 var text;
9260 if (error && error.responseText > '') {
9261 text = '[' + error.status + '] ' + error.responseText;
9262 } else if (error && error.statusText) {
9263 text = 'Error [' + error.status + ', ' + error.statusText + ']';
9264 } else {
9265 text = 'Error type [' + error.type + ']';
9266 }
9267
9268 console.error(text + '. Please, try again later.');
9269 }
9270}
9271
9272/**
9273 * Обрабатывает ответ запроса и если в нем есть редирект на другую зону, обновляет конечную точку API
9274 * @param {string | object} responseData
9275 * @param {string} previousEndpoint - конечная точка API, которая была до выполнения запроса. Из нее извлекается рутзона
9276 * @returns {boolean} была ли изменена рутзона
9277 */
9278function t_store__handleRootzoneRedirect(responseData, previousEndpoint) {
9279 let json = responseData;
9280 if (typeof responseData === 'string') {
9281 try {
9282 json = JSON.parse(responseData);
9283 } catch (error) {
9284 return false;
9285 }
9286 }
9287 const newRootZone = json?.redirectto;
9288 if (!newRootZone) {
9289 return false;
9290 }
9291
9292 const previousRootZone = t_store__getRootZoneFromEndpoint(previousEndpoint);
9293 const isRootzoneChanged = previousRootZone !== newRootZone;
9294 if (isRootzoneChanged) {
9295 window.t_store_endpoint = window.t_store_endpoint.split('.').slice(0, -1).join('.') + '.' + newRootZone;
9296 }
9297 t_store__setRootZone(newRootZone);
9298 return isRootzoneChanged;
9299}
9300
Предыдущие 100 строкСледующие 100 строк