1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-23 21:34:43 +03: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 Add new JS linter rules (#17699) 2021-11-22 16:19:01 +08:00
testUtils Use weighted algorithm for string matching when finding files in repo (#21370) 2022-10-08 12:22:44 +01:00
bootstrap.js Bypass Firefox (iOS) bug (#20244) 2022-07-05 13:27:13 +01:00
index.js Add filetree on left of diff view (#21012) 2022-09-27 13:22:19 +08:00
jquery.js Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055) 2020-04-18 18:46:29 -04:00
serviceworker.js Fix serviceworker output file and misc improvements (#11562) 2020-05-24 08:36:40 +01:00
svg.js Refactor from Vue2 to Vue3 (#20044) 2022-10-01 22:26:38 +08:00
svg.test.js Add copy button to markdown code blocks (#17638) 2021-11-16 16:16:05 +08:00
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