← All changes
|
includes/widgets/Login_Register_Form/script.js
+17
-17
51.1.65
→
51.1.86
View file →
| @@ -127,9 +127,9 @@ | ||
| 127 | 127 | clearMessages($wrapper); |
| 128 | 128 | |
| 129 | 129 | // Check if variables are defined |
| 130 | 130 | if (typeof king_addons_login_register_vars === 'undefined') { |
| 131 | - console.error('King Addons Login Register: AJAX variables not loaded'); | |
| 131 | + // console.error('King Addons Login Register: AJAX variables not loaded'); | |
| 132 | 132 | showMessage($messageContainer, 'Configuration error. Please refresh the page.', 'error'); |
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | 135 | |
| @@ -151,9 +151,9 @@ | ||
| 151 | 151 | if (recaptchaResponse) { |
| 152 | 152 | formData['g-recaptcha-response'] = recaptchaResponse; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - console.log('Submitting login form with data:', formData); | |
| 155 | + // console.log('Submitting login form with data:', formData); | |
| 156 | 156 | |
| 157 | 157 | // Validate required fields |
| 158 | 158 | if (!formData.username || !formData.password) { |
| 159 | 159 | showMessage($messageContainer, 'Please fill in all required fields.', 'error'); |
| @@ -188,11 +188,11 @@ | ||
| 188 | 188 | showMessage($messageContainer, response.data.message || 'An error occurred. Please try again.', 'error'); |
| 189 | 189 | } |
| 190 | 190 | }, |
| 191 | 191 | error: function(xhr, status, error) { |
| 192 | - console.error('Login AJAX Error:', error); | |
| 193 | - console.error('Login XHR response:', xhr.responseText); | |
| 194 | - console.error('Login XHR status code:', xhr.status); | |
| 192 | + // console.error('Login AJAX Error:', error); | |
| 193 | + // console.error('Login XHR response:', xhr.responseText); | |
| 194 | + // console.error('Login XHR status code:', xhr.status); | |
| 195 | 195 | |
| 196 | 196 | let errorMessage = 'Network error. Please check your connection and try again.'; |
| 197 | 197 | |
| 198 | 198 | // Try to parse error response |
| @@ -223,9 +223,9 @@ | ||
| 223 | 223 | clearMessages($wrapper); |
| 224 | 224 | |
| 225 | 225 | // Check if variables are defined |
| 226 | 226 | if (typeof king_addons_login_register_vars === 'undefined') { |
| 227 | - console.error('King Addons Login Register: AJAX variables not loaded'); | |
| 227 | + // console.error('King Addons Login Register: AJAX variables not loaded'); | |
| 228 | 228 | showMessage($messageContainer, 'Configuration error. Please refresh the page.', 'error'); |
| 229 | 229 | return; |
| 230 | 230 | } |
| 231 | 231 | |
| @@ -317,12 +317,12 @@ | ||
| 317 | 317 | // Add custom fields to form data if any exist |
| 318 | 318 | if (Object.keys(customFields).length > 0) { |
| 319 | 319 | formData.custom_fields = customFields; |
| 320 | 320 | formData.custom_field_labels = customFieldLabels; |
| 321 | - console.log('Found custom fields:', customFields); | |
| 322 | - console.log('Field labels:', customFieldLabels); | |
| 321 | + // console.log('Found custom fields:', customFields); | |
| 322 | + // console.log('Field labels:', customFieldLabels); | |
| 323 | 323 | } else { |
| 324 | - console.log('No custom fields found'); | |
| 324 | + // console.log('No custom fields found'); | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | // Add reCAPTCHA response if present |
| 328 | 328 | const recaptchaResponse = $form.find('[name="g-recaptcha-response"]').val(); |
| @@ -329,9 +329,9 @@ | ||
| 329 | 329 | if (recaptchaResponse) { |
| 330 | 330 | formData['g-recaptcha-response'] = recaptchaResponse; |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | - console.log('Submitting registration form with data:', formData); | |
| 333 | + // console.log('Submitting registration form with data:', formData); | |
| 334 | 334 | |
| 335 | 335 | // Client-side validation |
| 336 | 336 | const validationResult = validateRegistrationForm(formData); |
| 337 | 337 | if (!validationResult.valid) { |
| @@ -403,11 +403,11 @@ | ||
| 403 | 403 | } else { |
| 404 | 404 | showMessage($messageContainer, response.data.message || 'Registration failed. Please try again.', 'error'); |
| 405 | 405 | } |
| 406 | 406 | }).fail(function(xhr, status, error) { |
| 407 | - console.error('Registration AJAX Error:', error); | |
| 408 | - console.error('Registration XHR response:', xhr.responseText); | |
| 409 | - console.error('Registration XHR status code:', xhr.status); | |
| 407 | + // console.error('Registration AJAX Error:', error); | |
| 408 | + // console.error('Registration XHR response:', xhr.responseText); | |
| 409 | + // console.error('Registration XHR status code:', xhr.status); | |
| 410 | 410 | |
| 411 | 411 | let errorMessage = 'Network error. Please check your connection and try again.'; |
| 412 | 412 | |
| 413 | 413 | // Try to parse error response |
| @@ -435,9 +435,9 @@ | ||
| 435 | 435 | clearMessages($wrapper); |
| 436 | 436 | |
| 437 | 437 | // Check if variables are defined |
| 438 | 438 | if (typeof king_addons_login_register_vars === 'undefined') { |
| 439 | - console.error('King Addons Login Register: AJAX variables not loaded'); | |
| 439 | + // console.error('King Addons Login Register: AJAX variables not loaded'); | |
| 440 | 440 | showMessage($messageContainer, 'Configuration error. Please refresh the page.', 'error'); |
| 441 | 441 | return; |
| 442 | 442 | } |
| 443 | 443 | |
| @@ -473,11 +473,11 @@ | ||
| 473 | 473 | showMessage($messageContainer, response.data.message || 'Lost password request failed. Please try again.', 'error'); |
| 474 | 474 | } |
| 475 | 475 | }, |
| 476 | 476 | error: function(xhr, status, error) { |
| 477 | - console.error('Lost Password AJAX Error:', error); | |
| 478 | - console.error('Lost Password XHR response:', xhr.responseText); | |
| 479 | - console.error('Lost Password XHR status code:', xhr.status); | |
| 477 | + // console.error('Lost Password AJAX Error:', error); | |
| 478 | + // console.error('Lost Password XHR response:', xhr.responseText); | |
| 479 | + // console.error('Lost Password XHR status code:', xhr.status); | |
| 480 | 480 | |
| 481 | 481 | let errorMessage = 'Network error. Please check your connection and try again.'; |
| 482 | 482 | |
| 483 | 483 | // Try to parse error response |