1$(document).ready(function () { 2 $("input[type=radio][name='user_type']").change(function () { 3 var user_type = $("input[name='user_type']:checked").val(); 4 if (user_type === 'student') { 5 $('#send_sms_container').hide(); 6 history.replaceState({}, null, '/login/forgot_password'); 7 } else { 8 $('#send_sms_container').show(); 9 history.replaceState({}, null, '/login/forgot_password/employer'); 10 } 11 }); 12 13 $('#forgot-password-form').validate({ 14 onfocusout: function (element) { 15 this.element(element); 16 }, 17 rules: { 18 email: { 19 required: true, 20 email: true 21 } 22 }, 23 highlight: function (label) { 24 $(label).closest(".form-group").addClass('has-error'); 25 $(label).closest(".form-group").removeClass('has-success'); 26 $(label).closest('input').addClass('error'); 27 $(label).closest('input').removeClass('valid'); 28 }, 29 success: function (label) { 30 $(label).closest(".form-group").addClass('has-success'); 31 $(label).closest(".form-group").removeClass('has-error'); 32 $(label).closest('input').addClass('valid'); 33 $(label).closest('input').removeClass('error'); 34 }, 35 submitHandler: function () { 36 grecaptcha.enterprise.ready(function () { 37 grecaptcha.enterprise.execute(is_g_recaptcha, { 38 action: 'forgot_password_submit' // Button ID 39 }).then(function (token) { 40 forgot_password_submit(token, 'forgot_password_submit'); 41 }); 42 }); 43 return false; 44 } 45 }); 46}); 47 48function forgot_password_submit(token, action) { 49 var data = $('#forgot-password-form').serializeArray(); 50 data.push({ 51 name: "g-recaptcha-response", 52 value: token 53 }); 54 data.push({ 55 name: "action", 56 value: action 57 }); 58 var url = "/login/forgot_password_submit"; 59 NProgress.start(); 60 $('.loading_image').show(); 61 $.ajax(url, { 62 data: data, 63 success: forgot_password_success, 64 error: onError, 65 type: "POST" 66 }); 67 return false; 68} 69 70var forgot_password_success = function (data) { 71 try { 72 NProgress.done(); 73 if (!data.success) { 74 throw_error(data.errorThrown); 75 } else { 76 if (data.sms_send_and_verified == false) { 77 internshala_alert(data.successMsg, '', "Close"); 78 } else { 79 throw_success(data.successMsg, ''); 80 } 81 $('#forgot_email').val(''); 82 } 83 } catch (e) { 84 throw_error(e); 85 NProgress.done(); 86 $('.loading_image').hide(); 87 } 88};
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.