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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-delivery-1.0.js

Код файла
Версия от 03.10.2026, 07:00:56 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
4201 4202		window.tcart.products.forEach(function (product) {4203			if (JSON.stringify(product) !== '{}' && product.deleted !== 'yes') {4204				products.push(product);4205			}4206		});4207 4208		return products;4209	},4210 4211	/* Checking if the projectId is not set, will try to find it in the DOM */4212	updateProjectId: function () {
История файла и сравнение версий
  • 03.10.2026, 07:00:56 · 56c3b845
4213
var that = this;
4214 var itemsWithProjectId = [
4215 document.getElementById('allrecords'),
4216 document.getElementById('t-header'),
4217 document.getElementById('t-footer'),
4218 ];
4219
4220 Array.prototype.forEach.call(itemsWithProjectId, function (el) {
4221 if (el && !parseInt(that.deliveryState.projectId, 10)) {
4222 that.deliveryState.projectId = parseInt(el.getAttribute('data-tilda-project-id'), 10);
4223 }
4224 });
4225
4226 var el = document.getElementById('tildacopy');
4227 if (el && !parseInt(that.deliveryState.projectId, 10)) {
4228 that.deliveryState.projectId = parseInt((el.getAttribute('data-tilda-sign') || '').split('#')[0], 10);
4229 }
4230 },
4231
4232 /* Checking if the error is a timeout error, it will change the endpoint to `2.tildacdn.com` */
4233 endpointDelivery: '.tildacdn.com',
4234 changeEndpoint: function (error, onChangeCallback, onErrorCallback) {
4235 var that = this;
4236 if (
4237 typeof error === 'object' &&
4238 (error.status >= 500 ||
4239 error.status == 408 ||
4240 error.status == 410 ||
4241 error.status == 429 ||
4242 error.isTimeout) &&
4243 that.endpointDelivery === '.tildacdn.com'
4244 ) {
4245 that.endpointDelivery = '2.tildacdn.com';
4246 if (typeof onChangeCallback === 'function') {
4247 onChangeCallback();
4248 }
4249 } else {
4250 if (error && error.responseText) {
4251 console.error('[' + error.status + '] ' + error.responseText + '. Please, try again later.');
4252 } else if (error && error.statusText) {
4253 console.error('Error [' + error.status + ', ' + error.statusText + ']. Please, try again later.');
4254 } else if (error && error.status) {
4255 console.error('[' + error.status + '] Unknown error. Please, try again later.');
4256 } else {
4257 console.error('Unknown error. Please, try again later.');
4258 }
4259 if (typeof onErrorCallback === 'function') {
4260 onErrorCallback();
4261 }
4262 }
4263 },
4264};
4265
4266/* Show and hide error messages */
4267window.tcart__errorHandler = {
4268 show: function (error) {
4269 var errorBoxes = document.querySelectorAll('.t706 .js-errorbox-all');
4270 var errorBoxString = document.querySelectorAll('.t706 .t-form__errorbox-item.js-rule-error-string');
4271
4272 // fill new text
4273 if (error) {
4274 Array.prototype.forEach.call(errorBoxString, function (stringEl) {
4275 stringEl.innerHTML = error;
4276 });
4277 }
4278
4279 // show old text too
4280 Array.prototype.forEach.call(errorBoxString, function (stringEl) {
4281 if (stringEl.textContent !== '') {
4282 stringEl.style.display = 'block';
4283 Array.prototype.forEach.call(errorBoxes, function (errorBoxEl) {
4284 if (errorBoxEl) {
4285 errorBoxEl.style.display = '';
4286 }
4287 });
4288 }
4289 });
4290 },
4291 hide: function () {
4292 var errorBoxes = document.querySelectorAll('.t706 .js-errorbox-all');
4293 var errorBoxString = document.querySelectorAll('.t706 .t-form__errorbox-item.js-rule-error-string');
4294
4295 Array.prototype.forEach.call(errorBoxes, function (errorBoxEl) {
4296 if (errorBoxEl) {
4297 errorBoxEl.style.display = 'none';
4298 }
4299 });
4300
Предыдущие 100 строкСледующие 100 строк