1$(document).ready(function () { 2 3 const modalAjaxCalendarForm = new Modal({ 4 modalBtns: '[data-modal-form]', 5 modalCloseBtns: '.js-modal-form-close', 6 modals: '.js-modal-form', 7 }); 8 9 10 const validatorCalendarForm = new FormValidator({ 11 alerts: true, 12 events: false, 13 regex: { 14 tel: /_/, 15 time: /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/, 16 }, 17 texts: { 18 invalid: 'ÐевеÑно заполнено поле', 19 checked: 'ÐаполниÑе поле', 20 empty: 'ÐаполниÑе поле', 21 select: 'ÐÑбеÑиÑе знаÑение', 22 email: 'ÐевеÑно заполнено поле', 23 phone: 'Ðоле заполнено не до конÑа' 24 }, 25 }, "#calendarForm"); 26 27 $("[data-modal-form='calendar-form']").click(function (event) { 28 modalAjaxCalendarForm.openModal(event); 29 30 const modalElement = $("#calendar-form"); 31 const inputs = modalElement.find('input'); 32 formContent = modalElement.find('.form-content')[0]; 33 formMessage = modalElement.find('.form-message')[0]; 34 formMessageError = modalElement.find('.form-message-error')[0]; 35 36 formMessage.classList.remove('active'); 37 formMessageError.classList.remove('active'); 38 39 [...inputs].forEach(input => { 40 if (input.tagName === 'TEXTAREA' && input.getAttribute('placeholder') != null) { 41 input.classList.add('changed'); 42 } else { 43 if (input.value === '') { 44 input.classList.remove('changed'); 45 } else { 46 input.classList.add('changed'); 47 } 48 } 49 }); 50 if (formContent) formContent.classList.add('active'); 51 }); 52 53 $("#calendarForm").submit(function( event ) { 54 event.preventDefault(); 55 56 const form = $("#" + event.target.id); 57 const data = form.serialize(); 58 59 const validatorResult = validatorCalendarForm.checkAll(this); 60 61 if (validatorResult.valid) { 62 $("#spinner-on").addClass("open-loader"); 63 sendFormsCalendarForm(data); 64 } 65 return false; 66 }) 67}); 68 69function sendFormsCalendarForm(dataForm) { 70 let data = {}; 71 data.fields = dataForm; 72 data.className = 'EventCalendarDataManager'; 73 74 BX.ajax.runComponentAction('uniqtrip:forms', 75 'sendMessage', { 76 mode: 'class', 77 data: {post: data}, 78 }).then(function (response) { 79 $("#spinner-on").removeClass("open-loader"); 80 const modalElement = $("#calendar-form"); 81 const form = modalElement.find('.modal-custom__body'); 82 formContent = modalElement.find('.form-content')[0]; 83 formMessage = modalElement.find('.form-message')[0]; 84 formMessageError = modalElement.find('.form-message-error')[0]; 85 86 if (!response.data.result) { 87 if (formMessageError) formMessageError.classList.add('active'); 88 form.addClass('error-message'); //Ð´Ð»Ñ ÑбÑоÑа ÑоÑÐ¼Ñ 89 } else { 90 if (formMessage) formMessage.classList.add('active'); 91 form.addClass('message'); //Ð´Ð»Ñ ÑбÑоÑа ÑоÑÐ¼Ñ 92 } 93 94 if (formContent) formContent.classList.add('hide'); 95 96 }, function (response) { 97 }); 98}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.