aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features
Commit message (Collapse)AuthorAgeFilesLines
* Add types to various low-level functions (#31781)silverwind2024-08-104-6/+6
| | | | | | | | Adds types to various low-level modules. All changes are type-only, no runtime changes. `tsc` now reports 38 less errors. One problem was that `@types/sortablejs` does not accept promise return in its functions which triggered the linter, so I disabled the rules on those line.
* Enable `no-jquery/no-parse-html-literal` and fix violation (#31684)silverwind2024-07-271-4/+8
| | | Tested it, path segment creation works just like before.
* Run `detectWebAuthnSupport` only if necessary (#31691)Jason Song2024-07-251-3/+3
| | | | | | Follow #31676, which is not correct, see https://github.com/go-gitea/gitea/pull/31676#issuecomment-2246658217 Fix #31675, regression of #31504.
* Run `detectWebAuthnSupport` only on sign-in page (#31676)Jason Song2024-07-231-0/+4
| | | Fix #31675, regression of #31504.
* add skip secondary authorization option for public oauth2 clients (#31454)Denys Konovalov2024-07-191-0/+5
|
* Enable `no-jquery/no-class-state` (#31639)silverwind2024-07-161-4/+4
| | | | | | Just 4 validations and I specifically tested this by selecting/unselecting issue labels. Co-authored-by: Giteabot <teabot@gitea.io>
* Code editor theme enhancements (#31629)silverwind2024-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 1. Fixed border-radius 2. Monaco ignores the alpha channel on the shadow color, introduce `color-shadow-opaque` 3. Remove scrollbar color which follows https://github.com/go-gitea/gitea/pull/29800 Before: <img width="34" alt="Screenshot 2024-07-13 at 15 38 18" src="https://github.com/user-attachments/assets/042d9bde-6db9-4467-a2a4-8f61ecc773eb"> <img width="35" alt="Screenshot 2024-07-13 at 15 38 31" src="https://github.com/user-attachments/assets/04146ee0-551c-4ff2-9636-bd119b33595a"> After: <img width="45" alt="Screenshot 2024-07-13 at 15 38 06" src="https://github.com/user-attachments/assets/1f58fa5a-1289-4e45-83c9-18ca82a5e266"> <img width="39" alt="Screenshot 2024-07-13 at 21 16 56" src="https://github.com/user-attachments/assets/e12ebe22-b29b-4798-9f0d-4c100f311562">
* Convert frontend code to typescript (#31559)silverwind2024-07-0782-189/+189
| | | | | | | | | | | None of the frontend js/ts files was touched besides these two commands (edit: no longer true, I touched one file in https://github.com/go-gitea/gitea/pull/31559/commits/61105d0618e285d97e95044bfb64415f364a4526 because of a deprecation that was not showing before the rename). `tsc` currently reports 778 errors, so I have disabled it in CI as planned. Everything appears to work fine.
* Add typescript guideline and typescript-specific eslint plugins and fix ↵silverwind2024-07-033-8/+8
| | | | | | | | issues (#31521) 1. Add some general guidelines how to write our typescript code 2. Add `@typescript-eslint/eslint-plugin`, general typescript rules 3. Add `eslint-plugin-deprecation` to detect deprecated code 4. Fix all new lint issues that came up
* Add Passkey login support (#31504)Anbraten2024-06-291-7/+70
| | | | | | | | | | | | | | | | closes #22015 After adding a passkey, you can now simply login with it directly by clicking `Sign in with a passkey`. ![Screenshot from 2024-06-26 12-18-17](https://github.com/go-gitea/gitea/assets/6918444/079013c0-ed70-481c-8497-4427344bcdfc) Note for testing. You need to run gitea using `https` to get the full passkeys experience. --------- Co-authored-by: silverwind <me@silverwind.io>
* Always use HTML attributes for avatar size (#31509)silverwind2024-06-281-1/+1
| | | | | | | | | | Many avatars were rendered in HTML with certain width/height but then resized again in CSS. This was pointless so I removed all these cases and made the HTML size match the previous render size. Also did a few CSS cleanups in the tribute rendering: <img width="648" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/cb2fafb3-5e20-46e9-814f-07df20038beb">
* Add initial typescript config and use it for eslint,vitest,playwright (#31186)silverwind2024-06-281-2/+2
| | | | | | | | | | | | | | | | | | | | This enables eslint to use the typescript parser and resolver which brings some benefits that eslint rules now have type information available and a tsconfig.json is required for the upcoming typescript migration as well. Notable changes done: - Add typescript parser and resolver - Move the vue-specific config into the root file - Enable `vue-scoped-css/enforce-style-type` rule, there was only one violation and I added a inline disable there. - Fix new lint errors that were detected because of the parser change - Update `i/no-unresolved` to remove now-unnecessary workaround for the resolver - Disable `i/no-named-as-default` as it seems to raise bogus issues in the webpack config - Change vitest config to typescript - Change playwright config to typescript - Add `eslint-plugin-playwright` and fix issues - Add `tsc` linting to `make lint-js`
* Fix JS error with disabled attachment and easymde (#31511)silverwind2024-06-281-1/+3
| | | | | | Not sure if this is a regression from https://github.com/go-gitea/gitea/pull/30513, but when attachments are disabled, `this.dropzone` is null and the code had failed in `initEasyMDEPaste` trying to access `dropzoneEl.dropzone`.
* Make toast support preventDuplicates (#31501)wxiaoguang2024-06-271-6/+2
| | | | | | | | | | make preventDuplicates default to true, users get a clear UI feedback and know that "a new message appears". Fixes: https://github.com/go-gitea/gitea/issues/26651 --------- Co-authored-by: silverwind <me@silverwind.io>
* Improve attachment upload methods (#30513)Tyrone Yeh2024-06-275-81/+137
| | | | | | | | | | | | * Use dropzone to handle file uploading for all cases, including pasting and dragging * Merge duplicate code, use consistent behavior for link generating Close #20130 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor dropzone (#31482)wxiaoguang2024-06-275-181/+158
| | | Refactor the legacy code and remove some jQuery calls.
* Disable issue/PR comment button given empty input (#31463)Kemal Zebari2024-06-231-12/+17
| | | | | | | | | | | Given an empty issue/PR comment, the comment history would not be updated if the user were to submit it. Therefore, it would make since to just disable the comment button when the text editor is empty. This is inline with what GitHub does when given empty text editor input. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Switch to "Write" tab when edit comment again (#31445)wxiaoguang2024-06-222-12/+17
| | | Fix #19031
* Refactor image diff (#31444)wxiaoguang2024-06-223-162/+179
| | | And remove some jQuery functions
* Improve markdown textarea for indentation and lists (#31406)wxiaoguang2024-06-213-18/+121
| | | | | | Almost works like GitHub * use Tab/Shift-Tab to indent/unindent the selected lines * use Enter to insert a new line with the same indentation and prefix
* Split common-global.js into separate files (#31438)wxiaoguang2024-06-219-470/+482
| | | To improve maintainability
* Bump htmx to 2.0.0 (#31413)Yarden Shoham2024-06-201-1/+0
| | | | | | | | | Tested Subscribe, Follow, Star, Watch, and System Status. --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix JS error when creating new issue (#31383)wxiaoguang2024-06-161-1/+1
| | | Fix #31336
* Use `querySelector` over alternative DOM methods (#31280)silverwind2024-06-1035-142/+142
| | | | | | | | | | | | | | | | As per https://github.com/go-gitea/gitea/pull/30115#discussion_r1626060164, prefer `querySelector` by enabling [`unicorn/prefer-query-selector`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md) and autofixing all except 10 issues. According to [this](https://old.reddit.com/r/learnjavascript/comments/i0f5o8/performance_of_getelementbyid_vs_queryselector/), querySelector may be faster as well, so it's a win-win. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Remove jQuery `.text()` (#30506)silverwind2024-06-108-157/+149
| | | | | | | | | Remove and forbid [.text()](https://api.jquery.com/text/). Tested some, but not all functionality, but I think these are pretty safe replacements. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix and clean up `ConfirmModal` (#31283)silverwind2024-06-073-15/+16
| | | | | | | | | | | | | | | | Bug: orange button color was removed in https://github.com/go-gitea/gitea/pull/30475, replaced with red Bug: translation text was not html-escaped Refactor: Replaced as much jQuery as possible, added useful `createElementFromHTML` Refactor: Remove colors checks that don't exist on `.link-action` <img width="381" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/5900bf6a-8a86-4a86-b368-0559cbfea66e"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* Fix Activity Page Contributors dropdown (#31264)wxiaoguang2024-06-061-0/+1
| | | Fix #31261
* Fix admin oauth2 custom URL settings (#31246)wxiaoguang2024-06-041-12/+17
| | | Fix #31244
* Replace `gt-word-break` with `tw-break-anywhere` (#31183)silverwind2024-06-041-1/+1
| | | | | `overflow-wrap: anywhere` is a superior alternative to `word-wrap: break-word` and we were already setting it in the class. I tested a few cases, all look good.
* Make pasted "img" tag has the same behavior as markdown image (#31235)wxiaoguang2024-06-041-1/+5
| | | | | | | Fix #31230 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Prevent simultaneous editing of comments and issues (#31053)metiftikci2024-05-271-0/+7
| | | | | | | | | | | fixes #22907 Tested: - [x] issue content edit - [x] issue content change tasklist - [x] pull request content edit - [x] pull request change tasklist ![issue-content-edit](https://github.com/go-gitea/gitea/assets/29250154/a0828889-fb96-4bc4-8600-da92e3205812)
* Fix JS error when editing a merged PR's title (#30990)wxiaoguang2024-05-161-1/+4
|
* Check if reverse proxy is correctly configured (#30890)wxiaoguang2024-05-102-1/+32
| | | | | | | | | Follow #27011 Follow #30885 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
* Fix incorrect issue form (#30881)wxiaoguang2024-05-081-16/+11
| | | Fix #30864
* Fix various problems around projects board view (#30696)Lunny Xiao2024-05-081-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | # The problem The previous implementation will start multiple POST requests from the frontend when moving a column and another bug is moving the default column will never be remembered in fact. # What's changed - [x] This PR will allow the default column to move to a non-first position - [x] And it also uses one request instead of multiple requests when moving the columns - [x] Use a star instead of a pin as the icon for setting the default column action - [x] Inserted new column will be append to the end - [x] Fix #30701 the newly added issue will be append to the end of the default column - [x] Fix when deleting a column, all issues in it will be displayed from UI but database records exist. - [x] Add a limitation for columns in a project to 20. So the sorting will not be overflow because it's int8. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove obsolete monaco workaround (#30893)silverwind2024-05-081-4/+0
| | | | | | This workaround is not neccessary any more since monaco 0.35.0. Ref: https://github.com/microsoft/monaco-editor/issues/2962 Ref: https://github.com/microsoft/vscode/pull/173688
* Fix some UI problems (dropdown/container) (#30849)wxiaoguang2024-05-061-2/+2
| | | | | | Follow #30345 Follow #30547 `ellipsis` / `white-space` shouldn't be put on the general dropdown components.
* Fix some UI problems (install/checkbox) (#30854)wxiaoguang2024-05-061-7/+7
| | | Fix the space between the box and label for checkboxes, and fix incorrect usages in "repo-issue.js"
* Fix issue/PR title edit (#30858)wxiaoguang2024-05-053-81/+75
| | | | | 1. "enter" doesn't work (I think it is the last enter support for #14843) 2. if a branch name contains something like `&`, then the branch selector doesn't update
* Fix JS error on pull request page (#30838)silverwind2024-05-031-0/+1
| | | | | | Fix this error seen on PR page, regression from https://github.com/go-gitea/gitea/pull/30803: Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix activity heat map padding & locale (#30823)wxiaoguang2024-05-021-7/+10
| | | | | | | Fix #30808 --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix branch selector UI (#30803)wxiaoguang2024-05-021-11/+14
| | | Fix #30802
* Improve logout from worker (#30775)wxiaoguang2024-04-302-2/+4
| | | A quick fix for #30756
* Rework and fix stopwatch (#30732)silverwind2024-04-304-42/+44
| | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/go-gitea/gitea/issues/30721 and overhauls the stopwatch. Time is now shown inside the "dot" icon and on both mobile and desktop. All rendering is now done by `<relative-time>`, the `pretty-ms` dependency is dropped. Desktop: <img width="557" alt="Screenshot 2024-04-29 at 22 33 27" src="https://github.com/go-gitea/gitea/assets/115237/3a46cdbf-6af2-4bf9-b07f-021348badaac"> Mobile: <img width="640" alt="Screenshot 2024-04-29 at 22 34 19" src="https://github.com/go-gitea/gitea/assets/115237/8a2beea7-bd5d-473f-8fff-66f63fd50877"> Note for tippy: Previously, tippy instances defaulted to "menu" theme, but that theme is really only meant for `.ui.menu`, so it was not optimal for the stopwatch popover. This introduces a unopinionated `default` theme that has no padding and should be suitable for all content. I reviewed all existing uses and explicitely set the desired `theme` on all of them.
* Fix issue label rendering in the issue popup (#30763)wxiaoguang2024-04-301-1/+1
|
* Fix all rounded borders, change affected tab menus to pills (#30707)silverwind2024-04-292-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/go-gitea/gitea/issues/30673, all 23 issues. Notes: - Tab bar menus had to change to pills because of unsolvable issue with the border-radius as tab bar renders a overlapping border onto the box below. And I think pills look better. - Added padding to code editor empty preview message - Hide monaco's built-in blue focus border, we don't need it and it never showed before either. - Label add menu is simplified, removing the nested segment. <img width="1322" alt="Screenshot 2024-04-25 at 22 26 19" src="https://github.com/go-gitea/gitea/assets/115237/7e394e0c-b7ad-417d-8e9f-12f1dea93ed1"> <img width="1326" alt="Screenshot 2024-04-25 at 22 28 00" src="https://github.com/go-gitea/gitea/assets/115237/66c8499f-aa9f-4d95-8cca-ef13dfa82c65"> <img width="997" alt="Screenshot 2024-04-25 at 22 36 53" src="https://github.com/go-gitea/gitea/assets/115237/07896102-c71d-4246-8173-c2bc2e1d3cae"> <img width="832" alt="Screenshot 2024-04-25 at 22 56 09" src="https://github.com/go-gitea/gitea/assets/115237/d83afc96-08ca-4adc-baf4-3d02804be57c"> <img width="361" alt="Screenshot 2024-04-25 at 22 57 12" src="https://github.com/go-gitea/gitea/assets/115237/c7371a68-00b5-47d8-84d0-ddc5268b2b2c"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Make Ctrl+Enter work for issue/comment edit (#30720)v1.22.0-rc1wxiaoguang2024-04-272-3/+8
| | | Fix #30710
* Refactor imagediff and fix regression bug (#30694)wxiaoguang2024-04-251-102/+102
| | | Fix #30683
* Fix issue comment form and quick-submit (#30623)wxiaoguang2024-04-222-7/+4
| | | | 1. Rewrite initGlobalEnterQuickSubmit (by the way, remove jQuery) 2. Fix issue comment form layout
* Refactor and fix archive link bug (#30535)wxiaoguang2024-04-191-32/+22
| | | | | | | | Regression of #29920 Fixes: #30569 Also this is a rewriting to eliminate the remaining jQuery usages from code. Co-authored-by: Giteabot <teabot@gitea.io>