summaryrefslogtreecommitdiffstats
path: root/web_src
Commit message (Collapse)AuthorAgeFilesLines
* Improve behavior of "Fork" button (#17288)qwerty2872021-12-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Improbe behaviour of fork button * Apply suggestions from code review * Remove old lines * Apply suggestions * Fix test * Remove unnecessary or * Update templates/repo/header.tmpl Co-authored-by: silverwind <me@silverwind.io> * Add comment * Fix situation if you can't fork but don't have forks * Fix lint * Apply changes from #17783 * fmt * fmt * Apply tweaks Co-authored by: silverwind <me@silverwind.io> * Rm dupl css * Fix build Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Prefer "Hiragino Kaku Gothic ProN" in system-ui-ja (#17954)rinsuki2021-12-131-1/+1
|
* Fix overflow in commit graph (#17947)silverwind2021-12-112-0/+7
| | | | | | | | | | | | | | | | * Fix overflow in commit graph Limit commit message to 50% width. This is rather crude but should work for common use cases with not too-long author names. Fixes: https://github.com/go-gitea/gitea/issues/17944 * Make it work with dynamic width * use span * use explicit none Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Clean legacy SimpleMDE code (#17926)wxiaoguang2021-12-107-61/+83
| | | | | | | | | | | Since we are using EasyMDE now, we do not need to keep the SimpleMDE code anymore. This PR removes all legacy SimpleMDE code, and makes some related changes: * `createCommentEasyMDE` can accept native DOM element, and it doesn't need `jQuery.data` to store EasyMDE editor object (as discussed about the frontend guideline). * introduce `getAttachedEasyMDE` to get the attached EasyMDE editor object, it's easier to find all the usage of EasyMDE. * rename variable names from `$simplemde` to `easyMDE`, the `$` was incorrect because it is a EasyMDE editor, not a jQuery object. With this PR, it will be easier to do more refactoring or replacing EasyMDE with other editors.
* Support sorting for project board issuses (#17152)Anbraten2021-12-081-14/+26
| | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove unnecessary `X-Remote` HTTP header in AJAX request (#17932)wxiaoguang2021-12-082-7/+0
|
* Refactor install page (db type) (#17919)wxiaoguang2021-12-072-37/+28
| | | | | | | | | | | | * Refactor install page (db type) * set correct default DB HOST for different DB TYPE * remove legacy TiDB from documents * unify the usage of DB TYPE, in code we only use "mysql". "MySQL" is only shown to users for friendly name. * Gitea can use TiDB via MySQL protocol Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Apply CSS Variables to all message elements (#17920)silverwind2021-12-062-85/+76
| | | | | Fixes #17918. Applies color variables to all ui message on both themes. The colorization on .segment is a customization not present in fomantic ui, only used on user/repo/org delete pages.
* Fix loading content history on show more (#17819)Gusted2021-12-061-1/+3
| | | | | | | | | | | | | | | * Fix loading content history on show more - Call `initRepoIssueContentHistory` so that the newly loaded issues also get their content history. - Resolves #17767 * apply history to show diff too Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Fix svg colors in file list table (#17903)silverwind2021-12-042-10/+5
| | | | | | | | | | * Fix svg colors in file list table Turns out this can be fixed by just removing rules. Directory and file icons have other rules that still make them color correctly. * tweak color on file icons Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update JS dependencies, adjust eslint config (#17904)silverwind2021-12-044-6/+5
| | | | | - Update all JS dependencies to latest versions - Add new lint rules, enable es2022 eslint parser features - Disable github/no-then, I feel the rule was too restricting
* Add migrate from Codebase (#16768)KN4CK3R2021-12-021-0/+13
| | | | | | | | | | This PR adds [Codebase](https://www.codebasehq.com/) as migration source. Supported: - Milestones - Issues - Pull Requests - Comments - Labels
* Added missing `data-` prefix. (#17884)KN4CK3R2021-12-031-3/+3
|
* Improve install code to avoid low-level mistakes. (#17779)wxiaoguang2021-12-011-9/+22
| | | | | | | | | | | | | | * Improve install code to avoid low-level mistakes. If a user tries to do a re-install in a Gitea database, they gets a warning and double check. When Gitea runs, it never create empty app.ini automatically. Also some small (related) refactoring: * Refactor db.InitEngine related logic make it more clean (especially for the install code) * Move some i18n strings out from setting.go to make the setting.go can be easily maintained. * Show errors in CLI code if an incorrect app.ini is used. * APP_DATA_PATH is created when installing, and checked when starting (no empty directory is created any more).
* Rework commit page header (#17849)silverwind2021-12-014-158/+64
| | | | | | | | | | | - Remove blue background and use regular header styling - Use flexbox on author and signature segments - Add shield-type icons besides gpg key, replacing icon font icons - Ensure author and signature line are same height - Remove erronous green background on arc-green signature line - Turn signing colors into CSS variables - Consolidate the two warning states into one Co-authored-by: zeripath <art27@cantab.net>
* Fix position of label color picker colors (#17866)silverwind2021-11-301-4/+4
|
* Refactor commit graph styling to use css variables (#17860)silverwind2021-11-302-53/+15
| | | | - Use common variables for colors and font - Alter graph color 5 to provide enough contrast on both themes
* Switch archive URL code back to href attributes (#17796)fnetX (aka fralix)2021-11-291-1/+1
| | | | | | * Add fallback href link * Switch async archive generation to use href links * Edit all templates to use href instead of data-url for archives * Add consistent rel="nofollow" as per wxiaoguang
* Fixed org styles. (#17807)KN4CK3R2021-11-251-2/+0
| | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Detect dark theme via css variable (#17800)ThetaDev2021-11-252-7/+3
| | | | | | | * detect dark theme via css variable * minor refactor, add documentation If your custom theme is considered a dark theme, set the global css variable `--is-dark-theme` to `true`. This allows gitea to adjust the Monaco code editor's theme accordingly.
* Create menus for organization pages (#17802)Lunny Xiao2021-11-251-0/+6
| | | | | | | * Create menus for organization pages * Fix frontend lint * Fix frontend lint
* Preserve color when inverting emojis (#17797)silverwind2021-11-241-1/+1
| | | Fixes: https://github.com/go-gitea/gitea/issues/17795
* Improve ellipsis buttons (#17773)silverwind2021-11-223-4/+15
| | | | | | | | | | | | * Improve ellipsis buttons - Remove icon font usage - Add aria-expanded attribute * rename function to match Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add copy Commit ID button in commits list (#17759)velengel2021-11-222-1/+8
| | | | | | | | | | | | | | | | | | | * fix: implement commit id copy to clipboard * fix: remove abundant attributes / consider edge-case * fix: locale_en fixed * fix: use ui button * tune copy button * fix: button size * Fix merge Co-authored-by: Ysmr-Ry <ryo.yossy@live.jp> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Improvements to content history (#17746)Jimmy Praet2021-11-221-3/+6
| | | | | | | | | | | * Improvements to content history * initialize content history when making an edit to an old item created before the introduction of content history * show edit history for code comments on pull request files tab * Fix a flaw in keepLimitedContentHistory Fix a flaw in keepLimitedContentHistory, the first and the last should never be deleted * Remove obsolete eager initialization of content history
* Fix project board bug and improve documents (#17753)wxiaoguang2021-11-221-9/+12
| | | | * the project board was broken, this PR fixes it, and refactor the code, and we prevent the uncategorized column from being dragged. * improve the frontend guideline (as discussed in https://github.com/go-gitea/gitea/pull/17699)
* Add new JS linter rules (#17699)silverwind2021-11-2214-89/+100
| | | | | | | | | | | | | | | | | | | | * Add new JS linter rules Adds a few useful rules from eslint-plugin-github. Notable changes: - Forbid dataset usage, its camel-casing behaviour makes it hard to grep for attributes. - Forbid .then() and .catch(), we should generally prefer await for new code. For rare cases where they are useful, a eslint-disable-line directive can be set. - Add docs js to linting * also enable github/array-foreach * small tweak Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Allow Loading of Diffs that are too large (#17739)zeripath2021-11-221-1/+28
| | | | | | | | | | | * Allow Loading of Diffs that are too large This PR allows the loading of diffs that are suppressed because the file is too large. It does not handle diffs of files which have lines which are too long. Fix #17738 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make a.add-code-comment click handler an event handler (#17737)zeripath2021-11-201-1/+1
| | | | | | | | | Instead of directly attaching the add-code-comment on click handler to the a.add-code-comment elements - make this an event handler on the document instead. Fix #17736 Signed-off-by: Andrew Thornton <art27@cantab.net>
* perf: sent `data-path` once for each file (#17657)Gusted2021-11-192-5/+5
| | | | | | | | | | | | | | - Don't sent it with each line, instead send it at the top-element for each file. - Related: https://github.com/go-gitea/gitea/pull/17618#issuecomment-968192761 2.5K Additions: No-Patch: Unified: 2.14 MB (2.14 MB size) Split: 2.59 MB (2.59 MB size) Patch: Unified: 2.10 MB (2.10 MB size) (-1.8%) Split: 2.55 MB (2.55 MB size) (-1.5%)
* Refactor repo-legacy.js, remove messy global variables. Fix errors. (#17646)wxiaoguang2021-11-192-200/+197
| | | | | Refactor repo-legacy.js, remove messy global variables. Fix errors. Fix an error in Sortable Fix a incorrect call assignMenuAttributes from the template
* Cleanup and use global style on popups (#17674)silverwind2021-11-182-6/+14
| | | | | | | | | | | | | * Cleanup and use global style on popups - Fix typo 'poping' to 'popping' - Remove most inline 'data-variation' attributes - Initialize all popups with 'inverted tiny' variation * misc tweaks * rename to .tooltip, use jQuery Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Sanitize user-input on file name (#17666)Gusted2021-11-171-1/+2
| | | | | | | | | | | * Sanitize user-input on file name - Sanitize user-input before it get passed into the DOM. - Prevent things like "<iframe onload=alert(1)></iframe>" from being executed. This isn't a XSS attack as the server seems to be santizing the path as well. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Multiple Escaping Improvements (#17551)zeripath2021-11-161-1/+1
| | | | | | | | | | | | | | There are multiple places where Gitea does not properly escape URLs that it is building and there are multiple places where it builds urls when there is already a simpler function available to use this. This is an extensive PR attempting to fix these issues. 1. The first commit in this PR looks through all href, src and links in the Gitea codebase and has attempted to catch all the places where there is potentially incomplete escaping. 2. Whilst doing this we will prefer to use functions that create URLs over recreating them by hand. 3. All uses of strings should be directly escaped - even if they are not currently expected to contain escaping characters. The main benefit to doing this will be that we can consider relaxing the constraints on user names and reponames in future. 4. The next commit looks at escaping in the wiki and re-considers the urls that are used there. Using the improved escaping here wiki files containing '/'. (This implementation will currently still place all of the wiki files the root directory of the repo but this would not be difficult to change.) 5. The title generation in feeds is now properly escaped. 6. EscapePound is no longer needed - urls should be PathEscaped / QueryEscaped as necessary but then re-escaped with Escape when creating html with locales Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove superfluous argument (#17667)Gusted2021-11-161-1/+1
| | | As title.
* Add copy button to markdown code blocks (#17638)silverwind2021-11-1610-21/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add copy button to markdown code blocks Done mostly in JS because I think it's better not to try getting buttons past the markup sanitizer. * add svg module tests * fix sanitizer regexp * remove outdated comment * vertically center button in issue comments as well * add comment to css * fix undefined on view file line copy * combine animation less files * Update modules/markup/markdown/markdown.go Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> * add test for different sizes * add cloneNode and add tests for it * use deep clone * remove useless optional chaining * remove the svg node cache * unify clipboard copy string and i18n * remove unused var * remove unused localization * minor css tweaks to the button * comment tweak * remove useless attribute Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Migrating wiki don't require token, so we should move it out of the require ↵Lunny Xiao2021-11-161-1/+0
| | | | | | | form (#17645) * Migrating wiki don't require token, so we should move it out of the require form * Fix lint
* Fix GitBucket icon (#17644)silverwind2021-11-161-1/+1
| | | | | Partial fix for https://github.com/go-gitea/gitea/issues/17642. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix database deadlock when update issue labels (#17649)wxiaoguang2021-11-162-26/+22
| | | | This fix updates issue labels one by one, and won't cause database deadlock. In future, we can use a batch API to update all changed labels by one request.
* Add icon to vscode clone link (#17641)silverwind2021-11-141-0/+1
|
* Add migration from GitBucket (#16767)KN4CK3R2021-11-141-0/+39
| | | | | | | | | | | | | This PR adds [GitBucket](https://gitbucket.github.io/) as migration source. Supported: - Milestones - Issues - Pull Requests - Comments - Reviews - Labels There is no public usable instance so no integration tests added.
* perf: only generate data-comment-url once (#17618)Gusted2021-11-141-1/+1
|
* Fix some incorrect async functions, improve frontend document. (#17597)wxiaoguang2021-11-126-44/+48
|
* Update JS dependencies (#17611)silverwind2021-11-115-8/+7
| | | | | | | | | - Update monaco, adapting to breaking changes - Update dropzone, adapting to breaking changes - Update linters, fix new issues, disable opinionated stylelint rules - Rebuild SVGs and images - Tested Dropzone and Monaco Replaces: https://github.com/go-gitea/gitea/pull/17574
* Move merge-section to `> .content` (#17582)Gusted2021-11-091-8/+15
| | | | | | | | | | | | * Move `> .merge-section` to `> .content` scope - Fixes a issue that started from https://github.com/go-gitea/gitea/pull/17317 - Move `> .merge-section` to the `> .content` scope. - Resolves #17480 * Move `.merge-section` back to outside scope Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Improve async/await usage, and sort init calls in `index.js` (#17386)wxiaoguang2021-11-0921-202/+214
| | | | * clean up async/await, and sort init calls in `index.js * use `const _promise` to indicate that we do not need await an async function
* Remove appSubUrl from pasted images (#17572)zeripath2021-11-081-3/+3
| | | | | | | | | | * Remove appSubUrl from pasted images Since we fixed the url base for the links in repositories we no longer need to add the appsuburl to pasted image links. Fix #17057 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move key forms before list and add cancel button (#17432)qwerty2872021-10-281-1/+2
| | | | | | | * Move GPG form before list and add cancel button * Move SSH form before list and add cancel button Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* make commit-statuses popup can be shown correctly. (#17447)wxiaoguang2021-10-282-3/+19
| | | | | | | | | | Close #17443 Maybe we do not need to backport this PR, the bug doesn't break daily usage. After the fix, the commit statuses popup can show a lot of lines with scroll bars: ![image](https://user-images.githubusercontent.com/2114189/139026160-f01b484c-6207-494a-a190-a6dd184ceb2b.png)
* Fix a UI error when folding a file content in a commit view (#17446)wxiaoguang2021-10-271-2/+1
|