Plugin: Whispeak Improve UI - refs BT#15941

pull/3377/head
Angel Fernando Quiroz Campos 6 years ago
parent 9c24a9972e
commit e770574479
  1. 2
      plugin/whispeakauth/ajax/authentify_password.php
  2. 11
      plugin/whispeakauth/assets/js/RecordAudio.js
  3. 6
      plugin/whispeakauth/view/authentify_password.html.twig

@ -66,7 +66,7 @@ if (!$isValidPassword || !$isActive || !$isExpired) {
ChamiloSession::write(WhispeakAuthPlugin::SESSION_FAILED_LOGINS, ++$failedLogins);
if ($maxAttempts && $failedLogins >= $maxAttempts) {
$message .= PHP_EOL.$plugin->get_lang('MaxAttemptsReached');
$message .= PHP_EOL.'<span data-reach-attempts="true">'.$plugin->get_lang('MaxAttemptsReached').'</span>';
} else {
$message .= PHP_EOL.$plugin->get_lang('TryAgain');
}

@ -50,13 +50,18 @@ window.RecordAudio = (function () {
} else {
tagAudio.parents('#audio-wrapper').removeClass('hidden').addClass('show');
}
}).always(function () {
btnStop.prop('disabled', true).html(btnStopText).parent().addClass('hidden');
btnStart.prop('disabled', false).parent().removeClass('hidden');
if ($('#messages-deck > .alert.alert-warning [data-reach-attempts]').length > 0) {
if ($('#messages-deck > .alert.alert-success').length > 0 ||
$('#messages-deck > .alert.alert-warning [data-reach-attempts]').length > 0
) {
btnStart.prop('disabled', true);
} else {
btnStart.prop('disabled', false);
}
btnStart.parent().removeClass('hidden');
});
}

@ -30,6 +30,12 @@
$('#frm-login-result').html(response);
self.children().prop('disabled', false);
self.find(':submit em.fa').get(0).className = 'fa fa-check';
if ($('#frm-login-result > .alert.alert-success').length > 0 ||
$('#frm-login-result > .alert.alert-danger [data-reach-attempts]').length > 0
) {
self.find(':submit').prop('disabled', true);
}
});
this.reset();

Loading…
Cancel
Save