loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove jQuery class from the common admin functions (#30137)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the new authentication source form and the deletion of system
notices. They work as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 1551d73d3f95284965675b828e1eeceafa378437)

authored by

Yarden Shoham
Giteabot
and committed by
Earl Warren
708fdf2d 36ee0745

+6 -7
+6 -7
web_src/js/features/admin/common.js
··· 122 122 input.removeAttribute('required'); 123 123 } 124 124 125 - $('.binddnrequired').removeClass('required'); 125 + document.querySelector('.binddnrequired')?.classList.remove('required'); 126 126 127 127 const authType = this.value; 128 128 switch (authType) { ··· 131 131 for (const input of document.querySelectorAll('.binddnrequired input, .ldap div.required:not(.dldap) input')) { 132 132 input.setAttribute('required', 'required'); 133 133 } 134 - $('.binddnrequired').addClass('required'); 134 + document.querySelector('.binddnrequired')?.classList.add('required'); 135 135 break; 136 136 case '3': // SMTP 137 137 showElem('.smtp'); ··· 234 234 }); 235 235 document.getElementById('delete-selection')?.addEventListener('click', async function (e) { 236 236 e.preventDefault(); 237 - const $this = $(this); 238 - $this.addClass('is-loading disabled'); 237 + this.classList.add('is-loading', 'disabled'); 239 238 const data = new FormData(); 240 239 $checkboxes.each(function () { 241 240 if ($(this).checkbox('is checked')) { 242 - data.append('ids[]', $(this).data('id')); 241 + data.append('ids[]', this.getAttribute('data-id')); 243 242 } 244 243 }); 245 - await POST($this.data('link'), {data}); 246 - window.location.href = $this.data('redirect'); 244 + await POST(this.getAttribute('data-link'), {data}); 245 + window.location.href = this.getAttribute('data-redirect'); 247 246 }); 248 247 } 249 248 }