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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-forms-1.0.js

Код файла
Версия от 15.10.2026, 07:00:47 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
901 902		if (window.mauser.token) {903			window.tildaForm.tildamember['token'] = window.mauser.token;904		}905	} catch (error) {906		console.error('addMembersInfoToForm exception: ', error);907	}908};909 910/* Close success popup for ZB */911window.tildaForm.closeSuccessPopup = function () {912	const newSuccessPopup = document.getElementById('tildaformsuccesspopup-new');
История файла и сравнение версий
  • 15.10.2026, 07:00:47 · 56c3b845
913 const oldSuccessPopup = document.getElementById('tildaformsuccesspopup');
914
915 const isOldPopupVisible = oldSuccessPopup && getComputedStyle(oldSuccessPopup).display === 'block';
916 const successPopup = isOldPopupVisible ? oldSuccessPopup : newSuccessPopup;
917
918 if (!successPopup) return;
919
920 t_removeClass(document.body, 't-body_success-popup-showed');
921
922 if (t_forms__isIOS()) {
923 window.tildaForm.unlockBodyScroll();
924 }
925
926 t_fadeOut(successPopup);
927
928 if (successPopup.classList.contains('t-form-success-popup_new')) {
929 successPopup.classList.remove('t-popup_show');
930 }
931
932 // если есть тег style со стилями из формы в попапе,
933 // удаляем после закрытия попапа с сообщением об успехе
934 const styleElement = document.querySelector('style.t-success-popup');
935 if (styleElement) {
936 styleElement.remove();
937 }
938};
939
940/* Locked scroll document for iPhone/iPad/iPod */
941window.tildaForm.lockBodyScroll = function () {
942 var body = document.body;
943 if (t_hasClass(body, 't-body_scroll-locked')) return;
944
945 var bodyScrollTop =
946 typeof window.pageYOffset !== 'undefined'
947 ? window.pageYOffset
948 : (document.documentElement || document.body.parentNode || document.body).scrollTop;
949 t_addClass(body, 't-body_scroll-locked');
950 body.style.top = '-' + bodyScrollTop + 'px';
951 body.setAttribute('data-popup-scrolltop', bodyScrollTop);
952};
953
954/* Unlocked scroll document for iPhone/iPad/iPod */
955window.tildaForm.unlockBodyScroll = function () {
956 var body = document.body;
957 if (!t_hasClass(body, 't-body_scroll-locked')) return;
958
959 var bodyScrollTop = body.getAttribute('data-popup-scrolltop');
960 t_removeClass(body, 't-body_scroll-locked');
961 body.style.top = null;
962 body.removeAttribute('data-popup-scrolltop');
963 document.documentElement.scrollTop = parseInt(bodyScrollTop);
964};
965
966/**
967 * Show success popup for ZB
968 * @param {string} message - str message
969 */
970window.tildaForm.showSuccessPopup = function (message) {
971 var strHtml = '';
972 var successPopup = document.getElementById('tildaformsuccesspopup');
973 var successPopupText = document.getElementById('tildaformsuccesspopuptext');
974 var body = document.body;
975
976 if (!successPopup) {
977 strHtml +=
978 '<style media="screen"> .t-form-success-popup { display: none; position: fixed; background-color: rgba(0,0,0,.8); top: 0px; left: 0px; width: 100%; height: 100%; z-index: 10000; overflow-y: auto; cursor: pointer; } .t-body_success-popup-showed { height: 100vh; min-height: 100vh; overflow: hidden; } .t-form-success-popup__window { width: 100%; max-width: 400px; position: absolute; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); left: 0px; right: 0px; margin: 0 auto; padding: 20px; box-sizing: border-box; } .t-form-success-popup__wrapper { background-color: #fff; padding: 40px 40px 50px; box-sizing: border-box; border-radius: 5px; text-align: center; position: relative; cursor: default; } .t-form-success-popup__text { padding-top: 20px; word-break: break-word; } .t-form-success-popup__close-icon { position: absolute; top: 14px; right: 14px; cursor: pointer; } @media screen and (max-width: 480px) { .t-form-success-popup__text { padding-top: 10px; } .t-form-success-popup__wrapper { padding-left: 20px; padding-right: 20px; } } </style>';
979 strHtml +=
980 '<div class="t-form-success-popup" style="display:none;" id="tildaformsuccesspopup"> <div class="t-form-success-popup__window"> <div class="t-form-success-popup__wrapper"> <svg class="t-form-success-popup__close-icon" xmlns="http://www.w3.org/2000/svg" width="14" height="14" class="t657__icon-close" viewBox="0 0 23 23"> <g fill-rule="evenodd"> <path d="M0 1.41L1.4 0l21.22 21.21-1.41 1.42z"/> <path d="M21.21 0l1.42 1.4L1.4 22.63 0 21.21z"/> </g> </svg> <svg width="50" height="50" fill="#62C584"> <path d="M25.1 49.28A24.64 24.64 0 0 1 .5 24.68 24.64 24.64 0 0 1 25.1.07a24.64 24.64 0 0 1 24.6 24.6 24.64 24.64 0 0 1-24.6 24.61zm0-47.45A22.87 22.87 0 0 0 2.26 24.68 22.87 22.87 0 0 0 25.1 47.52a22.87 22.87 0 0 0 22.84-22.84A22.87 22.87 0 0 0 25.1 1.83z"/> <path d="M22.84 30.53l-4.44-4.45a.88.88 0 1 1 1.24-1.24l3.2 3.2 8.89-8.9a.88.88 0 1 1 1.25 1.26L22.84 30.53z"/> </svg> <div class="t-form-success-popup__text t-descr t-descr_sm" id="tildaformsuccesspopuptext"> Thank You! </div> </div> </div> </div>';
981
982 body.insertAdjacentHTML('beforeend', strHtml);
983 successPopup = document.getElementById('tildaformsuccesspopup');
984 successPopupText = document.getElementById('tildaformsuccesspopuptext');
985 var successPopupCloseBtn = successPopup.querySelector('.t-form-success-popup__close-icon');
986
987 t_addEventListener(successPopup, 'click', function (event) {
988 var clickEvent = event || window.event;
989 var target = clickEvent.target || clickEvent.srcElement;
990
991 if (target === this) {
992 window.tildaForm.closeSuccessPopup();
993 }
994 });
995
996 t_addEventListener(successPopupCloseBtn, 'click', function () {
997 window.tildaForm.closeSuccessPopup();
998 });
999
1000 t_addEventListener(body, 'keydown', function (event) {
Предыдущие 100 строкСледующие 100 строк