mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-18 06:15:07 +02:00
- Enable a few more rules, fix issues. The 2 `value` issues are false-positives. - Add exact types for `window.pageData` and `window.notificationSettings`. - peerDependencyRules for eslint-plugin-github unrestricted, the plugin works in v10, but does not declare compatibility, pending https://github.com/github/eslint-plugin-github/issues/680. - Added [eslint-plugin-de-morgan](https://github.com/azat-io/eslint-plugin-de-morgan), no violations. --------- Signed-off-by: silverwind <me@silverwind.io> Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
24 lines
752 B
TypeScript
24 lines
752 B
TypeScript
export function initRepositorySearch() {
|
|
const repositorySearchForm = document.querySelector<HTMLFormElement>('#repo-search-form');
|
|
if (!repositorySearchForm) return;
|
|
|
|
repositorySearchForm.addEventListener('change', (e: Event) => {
|
|
e.preventDefault();
|
|
|
|
const params = new URLSearchParams();
|
|
for (const [key, value] of new FormData(repositorySearchForm).entries()) {
|
|
params.set(key, value as string);
|
|
}
|
|
if ((e.target as HTMLInputElement).name === 'clear-filter') {
|
|
params.delete('archived');
|
|
params.delete('fork');
|
|
params.delete('mirror');
|
|
params.delete('template');
|
|
params.delete('private');
|
|
}
|
|
|
|
params.delete('clear-filter');
|
|
window.location.search = params.toString();
|
|
});
|
|
}
|