- md5
- ffabdd74c31e91922be585c1819475a8
- sha1
- 6e5d487413a432c7b3770791d07a75888063c5cb
- sha256
- c52525347f5cfcd7ae0f20ff9e30c98e6a67cc9cd2d8e486920e20058fd214b6
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
(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 21 releases, Joomla 4.2.0-beta1 to 4.2.9. See them all, or every version of this file.