aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix dropdown module accessing (#34026)wxiaoguang2025-03-261-2/+5
| | | Follow #34014.
* Polyfill WeakRef (#34025)wxiaoguang2025-03-262-0/+23
| | | Fix #33407
* Fix dropdown delegating and some UI problems (#34014)wxiaoguang2025-03-263-45/+58
| | | | | | | | | | | | | | | | The old logic is incomplete. See the comment for the improved logic. Fix #34011 And more fixes: 1. use empty "alt" for images, otherwise the width is not right when the image fails to load 2. remove the "dropdown icon" patch, because it has been clearly done in "dropdown.js" now 3. remove the "dropdown filtered item" patch, added a clear callback, and improve the logic 4. fix global init when a node is removed and added back gain (eg: the "cherry pick" dialog with a dropdown)
* Fix some migration and repo name problems (#33986)wxiaoguang2025-03-244-8/+51
| | | | | | 1. Ignore empty inputs in `UnmarshalHandleDoubleEncode` 2. Ignore non-existing `stateEvent.User` in gitlab migration 3. Enable `release` and `wiki` units when they are selected in migration 4. Sanitize repo name for migration and new repo
* Fix "toAbsoluteLocaleDate" test when system locale is not en-US (#33939)YaFou2025-03-191-2/+2
|
* Simplify secure context check (#33906)silverwind2025-03-161-7/+4
| | | | As discussed in https://github.com/go-gitea/gitea/pull/33820/files#r1997532169.
* Update JS and PY deps, misc tweaks (#33903)silverwind2025-03-162-3/+5
| | | | | | | | | - Update all updateable dependencies - Add a few more unupgradable ones to updates blocklist - Adapt to breaking changes - Update to typescript 5.8, enable `erasableSyntaxOnly` which necessitated a change because of forbidden syntax - Misc cleanups - Tested htmx, easymde, swagger, chart.js
* Add file tree to file view page (#32721)Kerwin Bryant2025-03-155-0/+259
| | | | | | | | | | | Resolve #29328 This pull request introduces a file tree on the left side when reviewing files of a repository. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix various Fomantic UI and htmx problems (#33851)wxiaoguang2025-03-114-44/+4
| | | Also fix #31328, fix #33854
* Drop fomantic build (#33845)wxiaoguang2025-03-114-4/+23
| | | | | | | | | | | | We would never update or build fomantic again, we have forked it as a private library long time ago. So just put the JS and CSS files in "fomantic/build" into git. And use "import" to use them. Remove "form.js", rewrite "tab" component. All source code is from official Fomantic UI build. Will apply patches in separate PRs.
* Do not show passkey on http sites (#33820)wxiaoguang2025-03-071-1/+10
| | | Fix #33615
* Update TypeScript types (#33799)Kerwin Bryant2025-03-053-8/+8
| | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor repo-issue.ts (#33784)wxiaoguang2025-03-043-147/+110
| | | And remove jQuery
* Refactor repo-settings.ts (#33785)wxiaoguang2025-03-051-39/+39
| | | and remove jQuery
* Refactor admin/common.ts (#33788)wxiaoguang2025-03-041-87/+112
| | | Only remove jQuery
* Refactor initRepoBranchTagSelector to use new init framework (#33776)Kerwin Bryant2025-03-031-4/+5
| | | | | | | | Make "initRepoBranchTagSelector" to use new init framework and fix the abused "js-branch-tag-selector" styles --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor buttons to use new init framework (#33774)Kerwin Bryant2025-03-033-25/+27
| | | | | | | | | | Make buttons to use new init framework * "js-toggle-commit-body" * "show-panel/hide-panel/show-modal" * "copy-content" --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor markup and pdf-viewer to use new init framework (#33772)Kerwin Bryant2025-03-0312-198/+181
| | | | | | | | | | | | | | | | 1. Add some "render-content" classes to "markup" elements when the content is rendered 2. Use correct "markup" wrapper for "preview" (but not set that class on the tab) 3. Remove incorrect "markup" class from LFS file view, because there is no markup content * "edit-diff" is also removed because it does nothing 5. Use "initPdfViewer" for PDF viewer 6. Remove incorrect "content" class from milestone markup 7. Init all ".markup" elements by new init framework --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor global init code and add more comments (#33755)wxiaoguang2025-03-037-109/+135
| | | | | | | | | | | | | | | | | | | Follow up #33748 Now there are 3 "global" functions: * registerGlobalSelectorFunc: for all elements matching the selector, eg: `.ui.dropdown` * registerGlobalInitFunc: for `data-global-init="initInputAutoFocusEnd"` * registerGlobalEventFunc: for `data-global-click="onCommentReactionButtonClick"` And introduce `initGlobalInput` to replace old `initAutoFocusEnd` and `attachDirAuto`, use `data-global-init` to replace fragile `.js-autofocus-end` selector. Another benefit is that by the new approach, no matter how many times `registerGlobalInitFunc` is called, we only need to do one "querySelectorAll" in the last step, it could slightly improve the performance.
* Fix dynamic content loading init problem (#33748)wxiaoguang2025-03-017-122/+162
| | | | | | | | | | | | | | | | 1. Rewrite `dirauto.ts` to `observer.ts`. * We have been using MutationObserver for long time, it's proven that it is quite performant. * Now we extend its ability to handle more "init" works. 2. Use `observeAddedElement` to init all non-custom "dropdown". 3. Use `data-global-click` to handle click events from dynamically loaded elements. * By this new approach, the old fragile selector-based (`.comment-reaction-button`) mechanism is removed. 4. By the way, remove unused `.diff-box` selector, it was abused and never really used. A lot of FIXMEs in "repo-diff.ts" are completely fixed, newly loaded contents could work as expected.
* Refactor repo-diff.ts (#33746)wxiaoguang2025-02-282-67/+52
| | | Remove jQuery
* Use `git diff-tree` for `DiffFileTree` on diff pages (#33514)Alexander McRae2025-02-2810-196/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify Diff View FileTree to show all files ## Changes * removes Show Status button on diff * uses `git diff-tree` to generate the file tree for the diff * doesn't reload the diff tree each time we load more files in the preview * selecting and unloaded file will keep loading until that file is loaded * removes `DiffFileList.vue` and "Show Stats" in diff options ## Open Questions * selecting and unloaded file will keep loading until that file is loaded. Is this behaviour okay? It matches what github does. ### Demo In this demo I set `git.MAX_GIT_DIFF_FILES=1` in my `app.ini` to demonstrate a worst case example. In most cases the behaviour isn't nearly as jarring as we load a bunch of files at a time. https://github.com/user-attachments/assets/72f29663-d6fc-472d-94fa-7fb5950c2836 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve "generate new access token" form (#33730)Guillaume2025-02-273-103/+0
| | | | | | | | | | | | | | | | | | | | | Fix: https://github.com/go-gitea/gitea/issues/33519 As discussed in [PR #33614](https://github.com/go-gitea/gitea/pull/33614), the ScopedAccessTokenSelector Vue component is not particularly useful. This PR removes the component and reverts to using HTML templates. It also introduces some (hopefully) useful refactoring. The Vue component was causing the UX bug reported in the linked issue. Required form fields are now properly working, as expected (see screenshot). ![Screenshot from 2025-02-25 22-00-28](https://github.com/user-attachments/assets/41167854-0718-48b0-a3ee-75ca3a7b8b20) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Clone repository with Tea CLI (#33725)Quentin2025-02-271-8/+41
| | | | | | | | | | | | This PR adds "Tea CLI" as a clone method. <img width="350" alt="Capture d’écran 2025-02-25 à 23 38 47" src="https://github.com/user-attachments/assets/8e86e54a-998b-45d1-9f20-167b449e79b6" /> --------- Signed-off-by: Quentin Guidée <quentin.guidee@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Always show the "rerun" button for action jobs (#33692)wxiaoguang2025-02-241-9/+3
| | | And improve the mock code.
* Improve Open-with URL encoding (#33666)wxiaoguang2025-02-212-1/+16
| | | Fix #33665
* Fix mCaptcha bug (#33659)wxiaoguang2025-02-201-4/+9
| | | Fix #33658
* Fix typo in HTML attribute (#33599)silverwind2025-02-141-1/+1
|
* Optimize the dashboard (#32990)Kerwin Bryant2025-02-111-6/+29
| | | | | | | | | | | | | | | | | | | | | before: ![image](https://github.com/user-attachments/assets/d0b432e4-a521-4540-a489-d18b9c265674) after: ![image](https://github.com/user-attachments/assets/dbb8b387-d150-41e2-b12b-f9d8450e36d7) ----- ![image](https://github.com/user-attachments/assets/40dcd71e-344b-4043-9811-77227c71aed9) ----- Optimize the dashboard by adding welcoming messages or quick action entry points (such as adding a new repository or organization) to ensure that new users are not greeted by a blank page upon logging in. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove "class-name" from svg icon (#33540)wxiaoguang2025-02-095-30/+20
| | | Only use "class" attribute
* Add cropping support when modifying the user/org/repo avatar (#33498)Kerwin Bryant2025-02-065-13/+22
| | | | | | | | Fixed #33321 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Hide/disable unusable UI elements when a repository is archived (#33459)wxiaoguang2025-01-311-12/+6
| | | And by the way, remove some jQuery code
* Update `@github/text-expander-element`, adapt type imports (#33449)silverwind2025-01-311-1/+1
| | | | Followup to https://github.com/go-gitea/gitea/pull/33435, upstream issue is fixed so the imports are clean now.
* Fix issue sidebar dropdown keyboard support (#33447)wxiaoguang2025-01-301-1/+4
| | | Just a quick fix, fix #33444
* Update `@github/text-expander-element` to 2.9.0 (#33435)silverwind2025-01-291-15/+3
| | | | | | | | | Update and use their newly exported types. Tested, works. The import path is a bit suboptimal, to be fixed once https://github.com/github/text-expander-element/pull/75 is merged and released. Co-authored-by: Giteabot <teabot@gitea.io>
* Clone button enhancements (#33362)silverwind2025-01-272-2/+4
| | | | | | | | | | - Add box-shadow to default tippy theme - Make colors for tabs match the ones from `.ui.tabular.menu` - Remove tippy arrow and slightly offset tooltip closer to the button - Fix setting of `aria-haspopup` when default role is used with tippy --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix issue suggestion bug (#33389)wxiaoguang2025-01-261-8/+51
| | | Fix #33388
* Fix js error when edit issue (#33384)wxiaoguang2025-01-251-1/+1
|
* Enable Typescript `noImplicitAny` (#33322)silverwind2025-01-2261-265/+319
| | | | | | | Enable `noImplicitAny` and fix all issues. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Make issue suggestion work for all editors (#33340)wxiaoguang2025-01-215-16/+34
| | | And do not handle special keys when the text-expander popup exists
* Make tracked time representation display as hours (#33315)Vladimir Sysoev2025-01-191-20/+7
| | | | | | | | | | Estimated time represented in hours it might be convenient to have tracked time represented in the same way to be compared and managed. --------- Co-authored-by: Sysoev, Vladimir <i@vsysoev.ru> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Trivial fixes (#33304)wxiaoguang2025-01-172-7/+18
| | | | | | | 1. the error check was added for go-git, it was caused by the empty `.keep` file in the test fixtures. 2. use `PostFormValue` instead of `PostForm.Get` (`Get` needs to parse the form ahead) 3. fix incorrect container text (it should show "Images" in the header but not "OS/Arch") 4. align maven xml 5. fix closed PR color&icon
* Enable Typescript `noImplicitThis` (#33250)silverwind2025-01-1628-190/+208
| | | | | | | | | | | | - Enable https://www.typescriptlang.org/tsconfig/#noImplicitThis - Wrap Vue Template-Syntax SFCs in [`defineComponent`](https://vuejs.org/api/general#definecomponent) which makes type inference and linter work better - Move `createApp` calls outside the SFCs into separate files - Use [`PropType`](https://vuejs.org/api/utility-types#proptype-t) where appropriate - Some top-level component properties changed order as dictated by the linter - Fix all tsc and lint issues that popped up during these refactors
* Fix upload file form (#33230)wxiaoguang2025-01-131-3/+5
| | | Fix #33228
* Fix editor markdown not incrementing in a numbered list (#33187)Harry Vince2025-01-102-33/+273
| | | | | | | | | | | | | | | Amended the logic for newPrefix in the MarkdownEditor to resolve incorrect number ordering. Fixes #33184 Attached screenshot of fixed input similar to issue <img width="175" alt="Screenshot 2025-01-09 at 23 59 24" src="https://github.com/user-attachments/assets/dfa23cf1-f3db-4b5e-99d2-a71bbcb289a8" /> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Automerge supports deleting branch automatically after merging (#32343)Lunny Xiao2025-01-101-1/+1
| | | | | | | | | | | | Resolve #32341 ~Depends on #27151~ - [x] It will display a checkbox of deleting the head branch on the pull request view page when starting an auto-merge task. - [x] Add permission check before deleting the branch - [x] Add delete branch comment for those closing pull requests because of head branch or base branch was deleted. - [x] Merge `RetargetChildrenOnMerge` and `AddDeletePRBranchComment` into `service.DeleteBranch`.
* Refactor HTMLFormat, update chroma render, fix js error (#33136)wxiaoguang2025-01-083-2/+4
| | | | | | A small refactor to improve HTMLFormat, to help to prevent low-level mistakes. And fix #33141, fix #33139
* add submodule diff links (#33097)Rowan Bohde2025-01-082-1/+11
| | | | | | | | | | | | This adds links to submodules in diffs, similar to the existing link when viewing a repo at a specific commit. It does this by expanding diff parsing to recognize changes to submodules, and find the specific refs that are added, deleted or changed. Related #25888 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove extended glob pattern from branch protection UI (#33125)TheFox0x72025-01-071-1/+1
| | | | | | | | | | | | | | Underlying go library has no support for it Fixes: https://github.com/go-gitea/gitea/issues/33121 --- I never touched frontend tests so pointers how to write them are welcome. This can be either fix or workaround, depending if this is something gitea should support in the future or not. The golang side is unlikely to get updates though.
* Refactor legacy JS (#33115)wxiaoguang2025-01-064-28/+30
|