- md5
- 61f4f96ed56c5d7f3f4061b54c485add
- sha1
- ee82caec5c882a63912335574345de402a0c3c93
- sha256
- 951e7b5722cf0941aa194cfbd2aae49e509f998f5181b6b8b640698d80b9b8ec
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
(function () {
'use strict';
/**
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(function () {
document.addEventListener('DOMContentLoaded', function () {
var elCodeField = document.getElementById('users-mfa-code');
var elValidateButton = document.getElementById('users-mfa-captive-button-submit');
var elToolbarButton = document.getElementById('toolbar-user-mfa-submit').querySelector('button');
// Focus the code field. If the code field is hidden, focus the submit button (useful e.g. for WebAuthn)
if (elCodeField && elCodeField.style.display !== 'none' && !elCodeField.classList.contains('visually-hidden') && elCodeField.type !== 'hidden') {
elCodeField.focus();
} else {
if (elValidateButton) {
elValidateButton.focus();
}
if (elToolbarButton) {
elToolbarButton.focus();
}
}
// Capture the admin toolbar buttons, make them click the inline buttons
document.querySelectorAll('.button-user-mfa-submit').forEach(function (elButton) {
elButton.addEventListener('click', function (e) {
e.preventDefault();
elValidateButton.click();
});
});
document.querySelectorAll('.button-user-mfa-logout').forEach(function (elButton) {
elButton.addEventListener('click', function (e) {
e.preventDefault();
var elLogout = document.getElementById('users-mfa-captive-button-logout');
if (elLogout) {
elLogout.click();
}
});
});
document.querySelectorAll('.button-user-mfa-choose-another').forEach(function (elButton) {
elButton.addEventListener('click', function (e) {
e.preventDefault();
var elChooseAnother = document.getElementById('users-mfa-captive-form-choose-another');
if (elChooseAnother) {
elChooseAnother.click();
}
});
});
});
})();
})();
The same content is in 13 releases, Joomla 4.3.0-alpha1 to 4.3.1. See them all, or every version of this file.