Некодим© 2020-2026 Некодим
Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.
Журнал изменений История Git Файлы Tilda MCP Каталог файловtilda-forms-1.0.js Следить за файлом 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 История файла и сравнение версий element: document.getElementById('tildaformsuccesspopuptext-new'),
1113 content: isEmptyContent ? t_forms__getMsg('success_text') : text,1114 show: isEmptyContent ? true : !!text,1117 element: document.getElementById('tildaformsuccesspopuplink-new'),1118 content: btn || (isRedirect ? t_forms__getMsg('success_btn_redirect') : t_forms__getMsg('success_btn')),1122 element: document.getElementById('tildaformsuccesspopupbtn-new'),1123 content: btn || (isRedirect ? t_forms__getMsg('success_btn_redirect') : t_forms__getMsg('success_btn')),1127 element: document.getElementById('tildaformsuccesspopupinfo-new'),1132 element: document.getElementById('tildaformsuccesspopupinfotext-new'),1133 content: isPopupAfterRedirectError1134 ? t_forms__getMsg('success_info_redirect_error')1135 : t_forms__getMsg('success_info'),1139 element: document.getElementById('tildaformsuccesspopupinfodigit-new'),1140 content: isPopupAfterRedirectError ? '' : '3',1144 element: document.getElementById('tildaformsuccesspopupclose-new'),1151 function updatePopupContent() {1152 const elementsData = createElementsData();1153 Object.keys(elementsData).forEach(key => {1154 const { element, content, show } = elementsData[key];1155 if (!element) return;1157 element.classList.toggle('t-form-success-popup_hidden', !show);1158 if (show && content) {1159 element.innerHTML = content;1162 if (key === 'linkButton' && isRedirect) {1163 element.setAttribute('href', successUrl);1168 function restartIconAnimation() {1169 const icon = document.querySelector('.t-form-success-popup__content-icon');1171 const newIcon = icon.cloneNode(true);1172 icon.parentNode.replaceChild(newIcon, icon);1176 window.tildaForm.handleClosePopup = function () {1177 window.tildaForm.closeSuccessPopup();1179 window.tildaForm.currentRemoveCloseHandlers &&1180 typeof window.tildaForm.currentRemoveCloseHandlers === 'function'1182 window.tildaForm.currentRemoveCloseHandlers();1186 function 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');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);1198 window.tildaForm.currentRemoveCloseHandlers = removeCloseHandlers;