33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-11-12 00:06:27 +00:00

to don't duplicate hardcoded strings

This commit is contained in:
Denis Ryabov 2022-01-19 19:43:31 +03:00
parent ab08b0b35b
commit ef9a51aec7

View File

@ -4,12 +4,11 @@
let jedOptions;
try {
jedOptions = JSON.parse(document.getElementById('jed-rules-json').innerHTML);
if (!jedOptions) throw new Error();
} catch (e) {
throw new Error('Initialization data is missing');
}
if (!jedOptions) throw new Error('Initialization data is missing');
const add_validation = () => {
// Loop over them and prevent submission
[...document.querySelectorAll('.needs-validation')].forEach((form) => {