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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-forms-1.0.js

Код файла
Версия от 15.10.2026, 07:00:47 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1101 1102	// Собираем объект из элементы в попапе сообщения об успехе,1103	// которые могут меняться в зависимости от условий1104	function createElementsData() {1105		return {1106			title: {1107				element: document.getElementById('tildaformsuccesspopuptitle-new'),1108				content: isEmptyContent ? t_forms__getMsg('success_title') : title,1109				show: isEmptyContent ? true : !!title,1110			},1111			text: {1112
История файла и сравнение версий
  • 15.10.2026, 07:00:47 · 56c3b845
element: document.getElementById('tildaformsuccesspopuptext-new'),
1113 content: isEmptyContent ? t_forms__getMsg('success_text') : text,
1114 show: isEmptyContent ? true : !!text,
1115 },
1116 linkButton: {
1117 element: document.getElementById('tildaformsuccesspopuplink-new'),
1118 content: btn || (isRedirect ? t_forms__getMsg('success_btn_redirect') : t_forms__getMsg('success_btn')),
1119 show: isRedirect,
1120 },
1121 closeButton: {
1122 element: document.getElementById('tildaformsuccesspopupbtn-new'),
1123 content: btn || (isRedirect ? t_forms__getMsg('success_btn_redirect') : t_forms__getMsg('success_btn')),
1124 show: !isRedirect,
1125 },
1126 info: {
1127 element: document.getElementById('tildaformsuccesspopupinfo-new'),
1128 content: null,
1129 show: isRedirect,
1130 },
1131 infoText: {
1132 element: document.getElementById('tildaformsuccesspopupinfotext-new'),
1133 content: isPopupAfterRedirectError
1134 ? t_forms__getMsg('success_info_redirect_error')
1135 : t_forms__getMsg('success_info'),
1136 show: isRedirect,
1137 },
1138 infoDigit: {
1139 element: document.getElementById('tildaformsuccesspopupinfodigit-new'),
1140 content: isPopupAfterRedirectError ? '' : '3',
1141 show: isRedirect,
1142 },
1143 closeIcon: {
1144 element: document.getElementById('tildaformsuccesspopupclose-new'),
1145 content: null,
1146 show: !isRedirect,
1147 },
1148 };
1149 }
1150
1151 function updatePopupContent() {
1152 const elementsData = createElementsData();
1153 Object.keys(elementsData).forEach(key => {
1154 const { element, content, show } = elementsData[key];
1155 if (!element) return;
1156
1157 element.classList.toggle('t-form-success-popup_hidden', !show);
1158 if (show && content) {
1159 element.innerHTML = content;
1160 }
1161
1162 if (key === 'linkButton' && isRedirect) {
1163 element.setAttribute('href', successUrl);
1164 }
1165 });
1166 }
1167
1168 function restartIconAnimation() {
1169 const icon = document.querySelector('.t-form-success-popup__content-icon');
1170 if (!icon) return;
1171 const newIcon = icon.cloneNode(true);
1172 icon.parentNode.replaceChild(newIcon, icon);
1173 }
1174};
1175
1176window.tildaForm.handleClosePopup = function () {
1177 window.tildaForm.closeSuccessPopup();
1178 if (
1179 window.tildaForm.currentRemoveCloseHandlers &&
1180 typeof window.tildaForm.currentRemoveCloseHandlers === 'function'
1181 ) {
1182 window.tildaForm.currentRemoveCloseHandlers();
1183 }
1184};
1185
1186function t_forms__setupCloseHandlers(successPopup, isRedirect) {
1187 const body = document.body;
1188 const closeBtnIcon = successPopup.querySelector('.t-form-success-popup__close-icon');
1189 const closeBtn = document.getElementById('tildaformsuccesspopupbtn-new');
1190
1191 function removeCloseHandlers() {
1192 if (closeBtnIcon) closeBtnIcon.removeEventListener('click', window.tildaForm.handleClosePopup);
1193 if (closeBtn) closeBtn.removeEventListener('click', window.tildaForm.handleClosePopup);
1194 body.removeEventListener('keydown', handleKeydown);
1195 successPopup.removeEventListener('click', handleOutsideClick);
1196 }
1197
1198 window.tildaForm.currentRemoveCloseHandlers = removeCloseHandlers;
1199
1200 if (closeBtnIcon) {
Предыдущие 100 строкСледующие 100 строк