diff --git a/lib/assets/javascripts/devise/registrations/edit.js b/lib/assets/javascripts/devise/registrations/edit.js index 1f5c57e..ff38153 100644 --- a/lib/assets/javascripts/devise/registrations/edit.js +++ b/lib/assets/javascripts/devise/registrations/edit.js @@ -6,7 +6,7 @@ // Run the input validations when the focus changes $("#user_email, #user_recovery_email").blur(function(){ - let msg = validateEmail($(this).val().trim()); + var msg = validateEmail($(this).val().trim()); // If the standard email validation was successful validate that they do not match toggleInputError(this, (msg != '' ? msg : validateEmailsDoNotMatch())); }); @@ -14,14 +14,14 @@ toggleInputError(this, validatePassword($(this).val().trim())); }); $("#user_new_password, #user_password_confirmation").blur(function(){ - let msg = validatePassword($(this).val().trim()); + var msg = validatePassword($(this).val().trim()); // If the standard password validation was successful validate that they match toggleInputError(this, (msg != '' ? msg : validatePasswordsMatch())); }); // Toggle the password field so that its visible/masked $("#passwords_show").click(function(){ - let typ = $("#user_current_password").attr('type'); + var typ = $("#user_current_password").attr('type'); $("#user_current_password").attr('type', (typ === 'password' ? 'text' : 'password')); $("#user_new_password").attr('type', (typ === 'password' ? 'text' : 'password')); $("#user_password_confirmation").attr('type', (typ === 'password' ? 'text' : 'password')); @@ -33,20 +33,20 @@ toggleSubmit(); function validateEmailsDoNotMatch(){ - let email = $("form.register-form #user_email").val().trim(); - let recovery = $("form.register-form #user_recovery_email").val().trim(); + var email = $("form.register-form #user_email").val().trim(); + var recovery = $("form.register-form #user_recovery_email").val().trim(); return (email === recovery ? (email != '' ? __('Emails must be different') : '') : ''); } function validatePasswordsMatch(){ - let pwd = $("#user_new_password").val().trim(); - let conf = $("#user_password_confirmation").val().trim(); + var pwd = $("#user_new_password").val().trim(); + var conf = $("#user_password_confirmation").val().trim(); return (pwd != conf ? (pwd != '' ? __('Passwords must match') : '') : ''); } // Display the submit button only if there is a valid email and password function toggleSubmit(){ - let disabled = ($("#user_firstname").val().trim().length <= 0 || + var disabled = ($("#user_firstname").val().trim().length <= 0 || $("#user_surname").val().trim().length <= 0 || validateEmail($("#user_email").val()) != '' || validateEmail($("#user_recovery_email").val()) != '' || diff --git a/lib/assets/javascripts/home/index.js b/lib/assets/javascripts/home/index.js index 96ec922..c4b0564 100644 --- a/lib/assets/javascripts/home/index.js +++ b/lib/assets/javascripts/home/index.js @@ -13,7 +13,7 @@ }); // Make the corresponding panel visible and the others hidden - let panel = $($(this).attr("href")); + var panel = $($(this).attr("href")); panel.show().attr("aria-hidden", 'false'); $.each($(panel).siblings(), function(i, p){ $(p).hide().attr("aria-hidden", 'true');