1$(function uil_init_popup_auth_form() { 2 3 var SELECTOR_FORM = 4 '.uil-auth-form, ' + 5 '.b-login-form-wrapper', 6 SUCCESS_TEXT = [ 7 'ÐÑ ÑÑпеÑно авÑоÑизованÑ' 8 ]; 9 10 function get_form_html(html) { 11 try { 12 var $html = $(html); 13 return $html.find(SELECTOR_FORM).add($html.filter(SELECTOR_FORM)); 14 } catch (e) { 15 console.error(e); 16 } 17 } 18 19 function handler_link_click(e) { 20 var $link = $(e.target); 21 if ($link.attr('target') !== '_blank') { 22 if ($link.text() === 'ÐеÑнÑÑÑÑÑ') { 23 inova_popup.hide(); 24 return false; 25 } 26 var url = $link.attr('href'); 27 if (url.indexOf('/auth/') > -1 || url.indexOf('/account/') > -1) { 28 inova_popup.set_url(url, '', SELECTOR_FORM); 29 return false; 30 } 31 } 32 } 33 34 function handler_form_submit(e) { 35 var $form = $(e.target), 36 form_data = new FormData($form[0]); 37 $.ajax({ 38 type: 'POST', 39 url: $form.attr('action'), 40 data: form_data, 41 cache: false, 42 contentType: false, 43 processData: false, 44 beforeSend: function () { 45 if (inova_popup.is_shown()) 46 inova_popup.freeze(); 47 else 48 inova_popup.set_message('ÐодождиÑе...').freeze(); 49 }, 50 complete: function (data) { 51 var html = data.responseText; 52 for (var i = 0; i < SUCCESS_TEXT.length; i++) 53 if (html.indexOf(SUCCESS_TEXT[i]) > -1) { 54 inova_popup.refresh_page(); 55 return false; 56 } 57 var form_html = get_form_html(html); 58 if (form_html === undefined) 59 inova_popup.freeze(false); 60 else if (form_html.length === 1) 61 inova_popup.set_html(form_html); 62 else 63 inova_popup.refresh_page(); 64 } 65 }); 66 return false; 67 } 68 69 $(document).on('click', 'a[data-popup-auth-form]', handler_link_click); 70 inova_popup.on('click', '.uil-auth-form a, .b-login-form-wrapper a', handler_link_click); 71 inova_popup.on('submit', '.uil-auth-form form, .b-login-form-wrapper form', handler_form_submit); 72 73});
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.