1
1
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-20 01:35:21 +01:00
gitea/web_src/js/features
wxiaoguang 768e16dad1
Use weighted algorithm for string matching when finding files in repo (#21370)
This PR is for:
* https://github.com/go-gitea/gitea/issues/20231

Now, when a user searches `word`, they always see `/{word}.txt` before
`/{w}e-g{o}t-{r}esult.{d}at`

Demo:

When searching "a", "a.ext" comes first. 

Then when searching "at", the longer matched "template" comes first.

<details>


![image](https://user-images.githubusercontent.com/2114189/194588738-3644d891-956f-40e4-b79b-b97d34265456.png)


![image](https://user-images.githubusercontent.com/2114189/194588797-9b124670-4e1e-4510-a170-780295ed89b8.png)

</details>

This PR also makes the frontend tests could import feature JS files by
introducing `jestSetup.js`

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: silverwind <me@silverwind.io>
2022-10-08 12:22:44 +01:00
..
comp
admin-common.js
admin-emails.js
admin-users.js
aria.js
aria.md Remove customized (unmaintained) dropdown, improve aria a11y for dropdown (#19861) 2022-06-03 17:38:26 -04:00
clipboard.js
codeeditor.js
colorpicker.js
common-global.js
common-issue.js
common-organization.js
contextpopup.js Refactor from Vue2 to Vue3 (#20044) 2022-10-01 22:26:38 +08:00
dropzone.js
emoji.js
eventsource.sharedworker.js Fix the JS error "EventSource is not defined" caused by some non-standard browsers (#20584) 2022-08-03 22:58:27 +03:00
file-fold.js
formatting.js
heatmap.js Refactor from Vue2 to Vue3 (#20044) 2022-10-01 22:26:38 +08:00
imagediff.js
install.js
mcaptcha.js Add support mCaptcha as captcha provider (#20458) 2022-08-10 15:20:10 +02:00
notification.js
org-team.js
pull-view-file.js
repo-branch.js
repo-code.js
repo-commit.js
repo-common.js
repo-diff-filetree.js Refactor from Vue2 to Vue3 (#20044) 2022-10-01 22:26:38 +08:00
repo-diff.js
repo-editor.js Use explicit jQuery import, remove unused eslint globals (#18435) 2022-01-28 21:00:11 +00:00
repo-findfile.js
repo-findfile.test.js
repo-graph.js
repo-home.js
repo-issue-content.js
repo-issue-pr-form.js
repo-issue.js
repo-legacy.js
repo-migrate.js
repo-migration.js Use explicit jQuery import, remove unused eslint globals (#18435) 2022-01-28 21:00:11 +00:00
repo-projects.js
repo-release.js
repo-settings.js Remove customized (unmaintained) dropdown, improve aria a11y for dropdown (#19861) 2022-06-03 17:38:26 -04:00
repo-template.js
repo-unicode-escape.js
repo-wiki.js
serviceworker.js Enable contenthash in filename for dynamic assets (#20813) 2022-08-23 20:58:04 +08:00
sshkey-helper.js
stopwatch.js
tablesort.js
tribute.js
user-auth-webauthn.js Prevent security failure due to bad APP_ID (#18678) 2022-02-09 15:37:58 +08:00
user-auth.js
user-settings.js Use explicit jQuery import, remove unused eslint globals (#18435) 2022-01-28 21:00:11 +00:00