Skip to content

Commit f491377

Browse files
silverwindSysoev, Vladimir
authored and
Sysoev, Vladimir
committed
Replace fomantic popup module with tippy.js (go-gitea#20428)
- replace fomantic popup module with tippy.js - fix chaining and add comment - add 100ms delay to tooltips - stopwatch improvments, raise default maxWidth - update web_src/js/features/common-global.js - use type=submit instead of js
1 parent 08daa7b commit f491377

28 files changed

+199
-2129
lines changed

templates/admin/user/edit.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
</div>
118118
</div>
119119
<div class="inline field"{{if DisableGitHooks}} hidden{{end}}>
120-
<div class="ui checkbox tooltip" data-content="{{.locale.Tr "admin.users.allow_git_hook_tooltip"}}" data-variation="very wide">
120+
<div class="ui checkbox tooltip" data-content="{{.locale.Tr "admin.users.allow_git_hook_tooltip"}}">
121121
<label><strong>{{.locale.Tr "admin.users.allow_git_hook"}}</strong></label>
122122
<input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}} {{if DisableGitHooks}}disabled{{end}}>
123123
</div>

templates/base/head_navbar.tmpl

+4-2
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@
8686
<span class="sr-mobile-only">{{.locale.Tr "active_stopwatch"}}</span>
8787
</span>
8888
</a>
89-
<div class="ui popup very wide">
89+
<div class="active-stopwatch-popup hide">
9090
<div class="df ac">
9191
<a class="stopwatch-link df ac" href="{{.ActiveStopwatch.IssueLink}}">
92-
{{svg "octicon-issue-opened"}}
92+
{{svg "octicon-issue-opened" 16 "mr-3"}}
9393
<span class="stopwatch-issue">{{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}}</span>
9494
<span class="ui primary label stopwatch-time my-0 mx-4" data-seconds="{{.ActiveStopwatch.Seconds}}">
9595
{{if .ActiveStopwatch}}{{Sec2Time .ActiveStopwatch.Seconds}}{{end}}
@@ -98,6 +98,7 @@
9898
<form class="stopwatch-commit" method="POST" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/toggle">
9999
{{.CsrfTokenHtml}}
100100
<button
101+
type="submit"
101102
class="ui button mini compact basic icon fitted tooltip"
102103
data-content="{{.locale.Tr "repo.issues.stop_tracking"}}"
103104
data-position="top right"
@@ -106,6 +107,7 @@
106107
<form class="stopwatch-cancel" method="POST" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/cancel">
107108
{{.CsrfTokenHtml}}
108109
<button
110+
type="submit"
109111
class="ui button mini compact basic icon fitted tooltip"
110112
data-content="{{.locale.Tr "repo.issues.cancel_tracking"}}"
111113
data-position="top right"

templates/repo/commit_statuses.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<a class="ui link commit-statuses-trigger">{{template "repo/commit_status" .Status}}</a>
2-
<div class="ui popup very wide fixed basic commit-statuses">
2+
<div class="ui commit-statuses-popup commit-statuses hide">
33
<div class="ui relaxed list divided">
44
{{range .Statuses}}
55
<div class="ui item singular-status df">

templates/repo/diff/stats.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{{Add .file.Addition .file.Deletion}}
2-
<span class="diff-stats-bar tooltip mx-3" data-content="{{.root.locale.Tr "repo.diff.stats_desc_file" (Add .file.Addition .file.Deletion) .file.Addition .file.Deletion | Str2html}}" data-variation="wide">
2+
<span class="diff-stats-bar tooltip mx-3" data-content="{{.root.locale.Tr "repo.diff.stats_desc_file" (Add .file.Addition .file.Deletion) .file.Addition .file.Deletion | Str2html}}">
33
<div class="diff-stats-add-bar" style="width: {{DiffStatsWidth .file.Addition .file.Deletion}}%"></div>
44
</span>

templates/repo/header.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
{{else if and (not $.CanSignedUserFork) (eq (len $.UserAndOrgForks) 0)}}
9999
data-content="{{$.locale.Tr "repo.fork_from_self"}}"
100100
{{end}}
101-
data-position="top center" data-variation="tiny" tabindex="0">
101+
data-position="top center" tabindex="0">
102102
<a class="ui compact{{if $.ShowForkModal}} show-modal{{end}} small basic button"
103103
{{if not $.CanSignedUserFork}}
104104
{{if gt (len $.UserAndOrgForks) 1}}

templates/repo/issue/view_content/add_reaction.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="header">{{ .ctx.locale.Tr "repo.pick_reaction"}}</div>
88
<div class="divider"></div>
99
{{range $value := AllowedReactions}}
10-
<div class="item reaction" data-content="{{$value}}">{{ReactionToEmoji $value}}</div>
10+
<div class="item reaction tooltip" data-content="{{$value}}">{{ReactionToEmoji $value}}</div>
1111
{{end}}
1212
</div>
1313
</div>

templates/repo/settings/deploy_keys.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
</button>
5757
</div>
5858
<div class="left floated content">
59-
<i class="{{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.key_state_desc"}}" data-variation="inverted"{{end}}>{{svg "octicon-key" 32}}</i>
59+
<i class="tooltip{{if .HasRecentActivity}} green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</i>
6060
</div>
6161
<div class="content">
6262
<strong>{{.Name}}</strong>

templates/repo/settings/webhook/history.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<div class="right menu">
4545
<form class="item" action="{{$.Link}}/replay/{{.UUID}}" method="post">
4646
{{$.CsrfTokenHtml}}
47-
<button class="ui tiny button tooltip" data-content="{{$.locale.Tr "repo.settings.webhook.replay.description"}}" data-variation="inverted tiny">{{svg "octicon-sync"}}</button>
47+
<button class="ui tiny button tooltip" data-content="{{$.locale.Tr "repo.settings.webhook.replay.description"}}">{{svg "octicon-sync"}}</button>
4848
</form>
4949
</div>
5050
{{end}}

templates/repo/view_file.tmpl

+6-16
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,12 @@
120120
{{end}}
121121
</tbody>
122122
</table>
123-
<div class="code-line-menu ui fluid popup transition hidden">
124-
<div class="ui column relaxed equal height">
125-
<div class="column">
126-
{{if $.Permission.CanRead $.UnitTypeIssues}}
127-
<div class="ui link list">
128-
<a class="item ref-in-new-issue" href="{{.RepoLink}}/issues/new?body={{.Repository.HTMLURL}}{{printf "/src/commit/" }}{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}" rel="nofollow noindex">{{.locale.Tr "repo.issues.context.reference_issue"}}</a>
129-
</div>
130-
{{end}}
131-
<div class="ui link list">
132-
<a class="item view_git_blame" href="{{.Repository.HTMLURL}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.view_git_blame"}}</a>
133-
</div>
134-
<div class="ui link list">
135-
<a data-clipboard-text="{{.Repository.HTMLURL}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}" class="item copy-line-permalink">{{.locale.Tr "repo.file_copy_permalink"}}</a>
136-
</div>
137-
</div>
138-
</div>
123+
<div class="code-line-menu ui vertical pointing menu hide">
124+
{{if $.Permission.CanRead $.UnitTypeIssues}}
125+
<a class="item ref-in-new-issue" href="{{.RepoLink}}/issues/new?body={{.Repository.HTMLURL}}{{printf "/src/commit/" }}{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}" rel="nofollow noindex">{{.locale.Tr "repo.issues.context.reference_issue"}}</a>
126+
{{end}}
127+
<a class="item view_git_blame" href="{{.Repository.HTMLURL}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.view_git_blame"}}</a>
128+
<a class="item copy-line-permalink" data-url="{{.Repository.HTMLURL}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.file_copy_permalink"}}</a>
139129
</div>
140130
{{end}}
141131
{{end}}

templates/user/settings/applications.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{{$.locale.Tr "settings.delete_token"}}
2020
</button>
2121
</div>
22-
<i class="big send icon {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.token_state_desc"}}" data-variation="inverted tiny"{{end}}></i>
22+
<i class="big send icon tooltip{{if .HasRecentActivity}} green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.token_state_desc"}}"{{end}}></i>
2323
<div class="content">
2424
<strong>{{.Name}}</strong>
2525
<div class="activity meta">

templates/user/settings/keys_principal.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{{$.locale.Tr "settings.delete_key"}}
2222
</button>
2323
</div>
24-
<i class="big send icon {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.principal_state_desc"}}" data-variation="inverted tiny"{{end}}></i>
24+
<i class="big send icon tooltip{{if .HasRecentActivity}} green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.principal_state_desc"}}"{{end}}></i>
2525
<div class="content">
2626
<strong>{{.Name}}</strong>
2727
<div class="activity meta">

templates/user/settings/keys_ssh.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
</div>
4949
<div class="left floated content">
50-
<span class="{{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.key_state_desc"}}" data-variation="inverted tiny"{{end}}>{{svg "octicon-key" 32}}</span>
50+
<span class="tooltip{{if .HasRecentActivity}} green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
5151
</div>
5252
<div class="content">
5353
{{if .Verified}}

0 commit comments

Comments
 (0)