Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1a7473f

Browse files
wxiaoguanglunny6543
authoredOct 16, 2021
Split index.js to separate files (#17315)
* split `index.js` to separate files * tune clipboard * fix promise * fix document * remove intermediate empty file * fix async event listener * use `export function` instead of `export {}`, add more comments Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
1 parent 3728f1d commit 1a7473f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3687
-3502
lines changed
 

‎docs/content/doc/developers/guidelines-frontend.md

-7
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/h
3939
6. The backend can pass complex data to the frontend by using `ctx.PageData["myModuleData"] = map[]{}`
4040
7. Simple pages and SEO-related pages use Go HTML Template render to generate static Fomantic-UI HTML output. Complex pages can use Vue2 (or Vue3 in future).
4141

42-
## Legacy Problems and Solutions
43-
44-
### Too much code in `web_src/index.js`
45-
46-
Previously, most JavaScript code was written into `web_src/index.js` directly, making the file unmaintainable.
47-
Try to keep this file small by creating new modules instead. These modules can be put in the `web_src/js/features` directory for now.
48-
4942
### Vue2/Vue3 and JSX
5043

5144
Gitea is using Vue2 now, we plan to upgrade to Vue3. We decided not to introduce JSX to keep the HTML and the JavaScript code separated.

‎templates/repo/branch/list.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
{{if .IsDeleted}}
126126
<a class="ui basic jump button icon poping up undo-button" href data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID | urlquery}}&name={{.DeletedBranch.Name | urlquery}}" data-content="{{$.i18n.Tr "repo.branch.restore" (.Name)}}" data-variation="tiny inverted" data-position="top right"><span class="text blue">{{svg "octicon-reply"}}</span></a>
127127
{{else}}
128-
<a class="ui basic jump button icon poping up delete-branch-button" href data-url="{{$.Link}}/delete?name={{.Name | urlquery}}" data-content="{{$.i18n.Tr "repo.branch.delete" (.Name)}}" data-variation="tiny inverted" data-position="top right" data-name="{{.Name}}">
128+
<a class="ui basic jump button icon poping up delete-button delete-branch-button" href data-url="{{$.Link}}/delete?name={{.Name | urlquery}}" data-content="{{$.i18n.Tr "repo.branch.delete" (.Name)}}" data-variation="tiny inverted" data-position="top right" data-name="{{.Name}}">
129129
{{svg "octicon-trash"}}
130130
</a>
131131
{{end}}

0 commit comments

Comments
 (0)
Please sign in to comment.