1// source --> https://larekpointconsulting.com/wp-content/plugins/lock-my-bp/public/js/bp-lock-public.js?ver=1.9.1 2jQuery(document).ready(function ($) { 3 "use strict"; 4 addRecatchaErrorClass(); 5 $("ul.bplock-login-shortcode-tabs li").click(function () { 6 addRecatchaErrorClass(); 7 var tab_id = $(this).attr("data-tab"); 8 $("ul.bplock-login-shortcode-tabs li").removeClass("current"); 9 $(".tab-content").removeClass("current"); 10 11 $(this).addClass("current"); 12 $("#" + tab_id).addClass("current"); 13 }); 14 15 function addRecatchaErrorClass() { 16 if ( jQuery('.bplock-login-form-container').length && jQuery('.bplock-login-form-container > .g-recaptcha').length ) { 17 if ( bplock_public_js_object.is_recaptcha_active == 1 ) { 18 jQuery('#bplock-login-btn').addClass('has-recaptcha-error'); 19 } 20 } 21 22 if ( jQuery('.bplock-register-form-container').length && jQuery('.bplock-register-form-container > .g-recaptcha').length ) { 23 if ( bplock_public_js_object.is_recaptcha_active == 1 ) { 24 jQuery('#bplock-register-btn').addClass('has-recaptcha-error'); 25 } 26 } 27} 28 29 /** 30 * User Login 31 */ 32 $(document).on('click', '#bplock-login-btn', function(){ 33 var btn = $(this); 34 $('.bplock-message').hide(); 35 var btn_txt = btn.html(); 36 var username = $('#bplock-login-username').val(); 37 var password = $('#bplock-login-password').val(); 38 if ( jQuery(this).hasClass('has-recaptcha-error') ) { 39 jQuery('#bplock-login-error').append('Recaptcha is required.'); 40 jQuery('#bplock-login-error').show(); 41 return false; 42 } 43 if( username == '' || password == '' ){ 44 $('#bplock-login-details-empty').show(); 45 } else { 46 btn.html('<i class="fa fa-refresh fa-spin"></i> Logging in...'); 47 var data = { 48 'action' : 'bplock_login', 49 'username' : username, 50 'password' : password, 51 'nonce' : bplock_public_js_object.nonce, 52 }; 53 $.ajax({ 54 dataType: "JSON", 55 url: bplock_public_js_object.ajaxurl, 56 type: 'POST', 57 data: data, 58 success: function( response ) { 59 btn.html( btn_txt ); 60 if( response['data']['login_success'] == 'no' ) { 61 $('#bplock-login-error').append( response['data']['message'] ).show(); 62 } else { 63 $('#bplock-login-success').append( response['data']['message'] ).show(); 64 location.reload(); 65 } 66 } 67 }); 68 } 69 }); 70 71 /** 72 * User Register 73 */ 74 $(document).on('click', '#bplock-register-btn', function(){ 75 var btn = $(this); 76 $('.bplock-message').hide(); 77 var btn_txt = btn.html(); 78 var email = $('#bplock-register-email').val(); 79 var username = $('#bplock-register-username').val(); 80 var password = $('#bplock-register-password').val(); 81 if ( jQuery(this).hasClass('has-recaptcha-error') ) { 82 jQuery('#bplock-register-error').append('Recaptcha is required.'); 83 jQuery('#bplock-register-error').show(); 84 return false; 85 } 86 if( email == '' || username == '' || password == '' ){ 87 $('#bplock-register-details-empty').append('Either of the detail is empty!').show(); 88 } else { 89 var email_regex = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 90 if( !email_regex.test( email ) ) { 91 $('#bplock-register-details-empty').append('Invalid Email!').show(); 92 } else { 93 btn.html('<i class="fa fa-refresh fa-spin"></i> Registering...'); 94 var data = { 95 'action' : 'bplock_register', 96 'email' : email, 97 'username' : username, 98 'password' : password, 99 'nonce' : bplock_public_js_object.nonce, 100 }; 101 $.ajax({ 102 dataType: "JSON", 103 url: bplock_public_js_object.ajaxurl, 104 type: 'POST', 105 data: data, 106 success: function( response ) { 107 btn.html( btn_txt ); 108 if( response['data']['register_success'] == 'no' ) { 109 $('#bplock-register-error').append( response['data']['message'] ).show(); 110 } else { 111 $('#bplock-register-success').append( response['data']['message'] ).show(); 112 location.reload(); 113 } 114 } 115 }); 116 } 117 } 118 }); 119 120 $(document).on("click", "#bplock-user-register", function () { 121 $("#bplock-register-tab").click(); 122 }); 123 $(document).on("click", "#bplock-user-login", function () { 124 $("#bplock-login-tab").click(); 125 }); 126});
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.