1function onSubmitPageRegister(token) { 2 let $ = jQuery 3 var form = $('#page-register-form'); 4 $.ajax({ 5 type: "POST", 6 url: ajaxurl, 7 dataType: 'json', 8 context: this, 9 data: form.serialize() + '&action=stm_custom_register', 10 beforeSend: function () { 11 form.find('input').removeClass('form-error'); 12 form.find('.stm-listing-loader').addClass('visible'); 13 $('.stm-validation-message').empty(); 14 }, 15 success: function (data) { 16 if (data.user_html) { 17 $('#stm_user_info').append(data.user_html); 18 19 $('.stm-not-disabled, .stm-not-enabled').slideUp('fast', function () { 20 $('#stm_user_info').slideDown('fast'); 21 }); 22 $("html, body").animate({ scrollTop: $('.stm-form-checking-user').offset().top }, "slow"); 23 24 $('.stm-form-checking-user button[type="submit"]').removeClass('disabled').addClass('enabled'); 25 } 26 27 if (data.restricted && data.restricted) { 28 $('.btn-add-edit').remove(); 29 } 30 31 form.find('.stm-listing-loader').removeClass('visible'); 32 for (var err in data.errors) { 33 form.find('input[name=' + err + ']').addClass('form-error'); 34 } 35 36 // insert plans select 37 if (data.plans_select && $('#user_plans_select_wrap').length > 0) { 38 $('#user_plans_select_wrap').html(data.plans_select); 39 $('#user_plans_select_wrap select').select2(); 40 } 41 42 if (data.redirect_url) { 43 window.location = data.redirect_url; 44 } 45 46 if (data.message) { 47 var message = $('<div class="stm-message-ajax-validation heading-font">' + data.message + '</div>').hide(); 48 49 form.find('.stm-validation-message').append(message); 50 message.slideDown('fast'); 51 } 52 } 53 }); 54} 55 56jQuery(document).ready(function ($) { 57 58 $('.stm-show-password .fas').mousedown(function () { 59 $(this).closest('.stm-show-password').find('input').attr('type', 'text'); 60 $(this).addClass('fa-eye'); 61 $(this).removeClass('fa-eye-slash'); 62 }); 63 64 $(document).mouseup(function () { 65 $('.stm-show-password').find('input').attr('type', 'password'); 66 $('.stm-show-password .fas').addClass('fa-eye-slash'); 67 $('.stm-show-password .fas').removeClass('fa-eye'); 68 }); 69 70 $("body").on('touchstart', '.stm-show-password .fas', function () { 71 $(this).closest('.stm-show-password').find('input').attr('type', 'text'); 72 $(this).addClass('fa-eye'); 73 $(this).removeClass('fa-eye-slash'); 74 }); 75 76 $('.stm-forgot-password a').on( 77 'click', 78 function (e) { 79 e.preventDefault(); 80 var login_popup = $(this).parents('.stm-login-form-unregistered, .stm-login-form-mobile-unregistered'); 81 if (login_popup.length) { 82 $('.stm-login-form-unregistered form, .stm-login-form-mobile-unregistered form').slideToggle(); 83 $('.stm-login-form-unregistered .stm_forgot_password_send input[type=text], .stm-login-form-mobile-unregistered .stm_forgot_password_send input[type=text]').trigger('focus'); 84 } else { 85 $('.stm-login-form .stm_forgot_password_send').slideToggle(); 86 $('.stm-login-form .stm_forgot_password_send input[type=text]').trigger('focus'); 87 } 88 $(this).toggleClass('active'); 89 } 90 ); 91 $('.stm-forgot-password-back').on( 92 'click', 93 function (e) { 94 e.preventDefault(); 95 $('.stm-login-form-unregistered form, .stm-login-form-mobile-unregistered form').slideToggle(); 96 } 97 ); 98 $(".stm-login-form-mobile-unregistered form,.stm-login-form form:not(.stm_password_recovery), .stm-login-form-unregistered form").on( 99 'submit', 100 function (e) { 101 e.preventDefault(); 102 if (!$(this).hasClass('stm_forgot_password_send')) { 103 $.ajax( 104 { 105 type: "POST", 106 url: ajaxurl, 107 dataType: 'json', 108 context: this, 109 data: $(this).serialize() + '&action=stm_custom_login', 110 beforeSend: function () { 111 $(this).find('input').removeClass('form-error'); 112 $(this).find('.stm-listing-loader').addClass('visible'); 113 $('.stm-validation-message').empty(); 114 115 if ($(this).parent('.lOffer-account-unit').length > 0) { 116 $('.stm-login-form-unregistered').addClass('working'); 117 } 118 }, 119 success: function (data) { 120 if ($(this).parent('.lOffer-account-unit').length > 0) { 121 $('.stm-login-form-unregistered').addClass('working'); 122 } 123 if (data.user_html) { 124 $('.add-car-btns-wrap').remove(); 125 var $user_html = $(data.user_html).appendTo('#stm_user_info');
126 $('.stm-not-disabled, .stm-not-enabled').slideUp( 127 'fast', 128 function () { 129 $('#stm_user_info').slideDown('fast'); 130 } 131 ); 132 133 $("html, body").animate({ scrollTop: $('.stm-form-checking-user').offset().top }, "slow"); 134 $('.stm-add-a-car-login-overlay,.stm-add-a-car-login').toggleClass('visiblity'); 135 136 $('.stm-form-checking-user button[type="submit"]').removeClass('disabled').addClass('enabled'); 137 } 138 139 if (data.restricted && data.restricted) { 140 $('.btn-add-edit').remove(); 141 } 142 143 // insert plans select 144 if (data.plans_select && $('#user_plans_select_wrap').length > 0) { 145 $('#user_plans_select_wrap').html(data.plans_select); 146 $('#user_plans_select_wrap select').select2( 147 { 148 dropdownParent: $('body'), 149 } 150 ); 151 } 152 153 $(this).find('.stm-listing-loader').removeClass('visible'); 154 for (var err in data.errors) { 155 $(this).find('input[name=' + err + ']').addClass('form-error'); 156 } 157 158 if (data.message) { 159 var message = $('<div class="stm-message-ajax-validation heading-font">' + data.message + '</div>').hide(); 160 161 $(this).find('.stm-validation-message').append(message); 162 message.slideDown('fast'); 163 } 164 165 if (typeof (data.redirect_url) !== 'undefined') { 166 window.location = data.redirect_url; 167 } 168 } 169 } 170 ); 171 } else { 172 /*Send passs*/ 173 $.ajax( 174 { 175 type: "POST", 176 url: ajaxurl, 177 dataType: 'json', 178 context: this, 179 data: $(this).serialize() + '&action=mvl_restore_password&security=' + stm_security_nonce, 180 beforeSend: function () { 181 $(this).find('input').removeClass('form-error'); 182 $(this).find('.stm-listing-loader').addClass('visible'); 183 $('.stm-validation-message').empty(); 184 }, 185 success: function (data) { 186 $(this).find('.stm-listing-loader').removeClass('visible'); 187 if (data.message) { 188 var message = $('<div class="stm-message-ajax-validation heading-font">' + data.message + '</div>').hide(); 189 190 $(this).find('.stm-validation-message').append(message); 191 message.slideDown('fast'); 192 } 193 for (var err in data.errors) { 194 $(this).find('input[name=' + err + ']').addClass('form-error'); 195 } 196 } 197 } 198 ); 199 } 200 } 201 ); 202 203 $('.user_validated_field').on( 204 'hover', 205 function () { 206 $(this).removeClass('form-error'); 207 } 208 ); 209 210 $('input[name="stm_accept_terms"]').on( 211 'click', 212 function () { 213 if ($(this).is(':checked')) { 214 $('.stm-login-register-form .stm-register-form form input[type="submit"]').removeAttr('disabled'); 215 } else { 216 $('.stm-login-register-form .stm-register-form form input[type="submit"]').attr('disabled', '1'); 217 } 218 } 219 ); 220}); 221
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.