mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 04:09:29 +02:00
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:
parent
c124014115
commit
9420d3d0a5
9 changed files with 34 additions and 31 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue