From 106d52a47f90dfd7d4965a7109825c57518739f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 22 May 2019 12:35:56 -0400 Subject: [PATCH] fix: #7598, use notice element instead of alert --- public/src/client/reset_code.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/src/client/reset_code.js b/public/src/client/reset_code.js index bc305147c7..ae74037d88 100644 --- a/public/src/client/reset_code.js +++ b/public/src/client/reset_code.js @@ -14,13 +14,17 @@ define('forum/reset_code', ['zxcvbn'], function (zxcvbn) { resetEl.on('click', function () { var strength = zxcvbn(password.val()); if (password.val().length < ajaxify.data.minimumPasswordLength) { - app.alertError('[[reset_password:password_too_short]]'); + $('#notice').removeClass('hidden'); + $('#notice strong').translateText('[[reset_password:password_too_short]]'); } else if (password.val().length > 512) { - app.alertError('[[error:password-too-long]]'); + $('#notice').removeClass('hidden'); + $('#notice strong').translateText('[[error:password-too-long]]'); } else if (password.val() !== repeat.val()) { - app.alertError('[[reset_password:passwords_do_not_match]]'); + $('#notice').removeClass('hidden'); + $('#notice strong').translateText('[[reset_password:passwords_do_not_match]]'); } else if (strength.score < ajaxify.data.minimumPasswordStrength) { - app.alertError('[[user:weak_password]]'); + $('#notice').removeClass('hidden'); + $('#notice strong').translateText('[[user:weak_password]]'); } else { resetEl.prop('disabled', true).html(' Changing Password'); socket.emit('user.reset.commit', {