0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-27 13:04:16 +01:00
gitea/web_src/js
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
..
components Refactor from Vue2 to Vue3 (#20044) 2022-10-01 22:26:38 +08:00
features Use weighted algorithm for string matching when finding files in repo (#21370) 2022-10-08 12:22:44 +01:00
markup Add KaTeX rendering to Markdown. (#20571) 2022-09-14 00:33:37 +08:00
modules Improve commit status icons (#21124) 2022-09-09 17:03:18 -04:00
standalone
testUtils Use weighted algorithm for string matching when finding files in repo (#21370) 2022-10-08 12:22:44 +01:00
bootstrap.js
index.js Add filetree on left of diff view (#21012) 2022-09-27 13:22:19 +08:00
jquery.js
serviceworker.js
svg.js Refactor from Vue2 to Vue3 (#20044) 2022-10-01 22:26:38 +08:00
svg.test.js
utils.js Use weighted algorithm for string matching when finding files in repo (#21370) 2022-10-08 12:22:44 +01:00
utils.test.js Use weighted algorithm for string matching when finding files in repo (#21370) 2022-10-08 12:22:44 +01:00