chore: enable no-jquery/no-trigger

- A lot of substitution to `.requestSubmit()`.
- Where possible, rewrite some other jquery to vanilla javascript to
ease the linter fix.
This commit is contained in:
Gusted 2025-04-01 04:41:57 +02:00
parent c124014115
commit 9420d3d0a5
No known key found for this signature in database
GPG key ID: FD821B732837125F
9 changed files with 34 additions and 31 deletions

View file

@ -175,7 +175,7 @@ export function initAdminCommon() {
onUsePagedSearchChange();
}
});
$('#auth_type').trigger('change');
document.getElementById('auth_type').dispatchEvent(new Event('change'));
document.getElementById('security_protocol')?.addEventListener('change', onSecurityProtocolChange);
document.getElementById('use_paged_search')?.addEventListener('change', onUsePagedSearchChange);
document.getElementById('oauth2_provider')?.addEventListener('change', () => onOAuth2Change(true));
@ -200,10 +200,12 @@ export function initAdminCommon() {
}
if (document.querySelector('.admin.authentication')) {
$('#auth_name').on('input', function () {
const authNameEl = document.getElementById('auth_name');
authNameEl.addEventListener('input', (el) => {
// appSubUrl is either empty or is a path that starts with `/` and doesn't have a trailing slash.
document.getElementById('oauth2-callback-url').textContent = `${window.location.origin}${appSubUrl}/user/oauth2/${encodeURIComponent(this.value)}/callback`;
}).trigger('input');
document.getElementById('oauth2-callback-url').textContent = `${window.location.origin}${appSubUrl}/user/oauth2/${encodeURIComponent(el.target.value)}/callback`;
});
authNameEl.dispatchEvent(new Event('input'));
}
// Notice