Skip to content

Commit dfbda48

Browse files
committed
Merge pull request #2738 from andreynering/emogify
Render emojis in more places.
2 parents 260723e + 13e71ac commit dfbda48

File tree

11 files changed

+24
-19
lines changed

11 files changed

+24
-19
lines changed

public/js/gogs.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,10 @@ $(document).ready(function () {
878878
img_dir: suburl + '/img/emoji',
879879
ignore_emoticons: true
880880
});
881-
emojify.run();
881+
var hasEmoji = document.getElementsByClassName('has-emoji');
882+
for (var i = 0; i < hasEmoji.length; i++) {
883+
emojify.run(hasEmoji[i]);
884+
}
882885

883886
// Clipboard JS
884887
var clipboard = new Clipboard('.clipboard');

templates/explore/repo_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<span class="text grey"><i class="octicon octicon-git-branch"></i> {{.NumForks}}</span>
1717
</div>
1818
</div>
19-
{{if .Description}}<p>{{.Description}}</p>{{end}}
19+
{{if .Description}}<p class="has-emoji">{{.Description}}</p>{{end}}
2020
<p class="time">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Updated $.i18n.Lang}}</p>
2121
</div>
2222
{{end}}

templates/repo/commits_table.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;{{.Author.Name}}
3636
{{end}}
3737
</td>
38-
<td class="message collapsing">
38+
<td class="message collapsing has-emoji">
3939
<a rel="nofollow" class="ui sha label" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">{{ShortSha .ID.String}}</a>
4040
{{RenderCommitMessage false .Summary $.RepoLink $.Repository.ComposeMetas}}
4141
</td>

templates/repo/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{template "repo/header" .}}
44
<div class="ui container">
55
<p id="repo-desc">
6-
{{if .Repository.DescriptionHtml}}<span class="description">{{.Repository.DescriptionHtml}}</span>{{else}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
6+
{{if .Repository.DescriptionHtml}}<span class="description has-emoji">{{.Repository.DescriptionHtml}}</span>{{else}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
77
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
88
</p>
99
<div class="ui secondary menu">

templates/repo/issue/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
{{ $timeStr:= TimeSince .Created $.Lang }}
103103
<li class="item">
104104
<div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Index}}</div>
105-
<a class="title" href="{{$.Link}}/{{.Index}}">{{.Name}}</a>
105+
<a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Name}}</a>
106106

107107
{{range .Labels}}
108108
<a class="ui label" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}">{{.Name}}</a>

templates/repo/issue/view.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
{{if .Issue.IsPull}}
1717
{{template "repo/issue/view_title" .}}
1818
{{template "repo/pulls/tab_menu" .}}
19-
<div class="ui bottom attached tab pull segment active" data-tab="request-{{.ID}}">
19+
<div class="ui bottom attached tab pull segment active has-emoji" data-tab="request-{{.ID}}">
2020
{{template "repo/issue/view_content" .}}
2121
</div>
2222
{{else}}
23-
{{template "repo/issue/view_content" .}}
23+
<div class="has-emoji">
24+
{{template "repo/issue/view_content" .}}
25+
</div>
2426
{{end}}
2527
</div>
2628
</div>

templates/repo/issue/view_title.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="sixteen wide column title">
22
<div class="ui grid">
33
<h1 class="twelve wide column">
4-
<span class="index">#{{.Issue.Index}}</span> <span id="issue-title">{{.Issue.Name}}</span>
4+
<span class="index">#{{.Issue.Index}}</span> <span id="issue-title" class="has-emoji">{{.Issue.Name}}</span>
55
<div id="edit-title-input" class="ui input" style="display: none">
66
<input value="{{.Issue.Name}}">
77
</div>

templates/repo/view_file.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{{end}}
2525
</h4>
2626
<div class="ui attached table segment">
27-
<div class="file-view {{if .ReadmeExist}}markdown{{else if .IsFileText}}code-view{{end}}">
27+
<div class="file-view {{if .ReadmeExist}}markdown{{else if .IsFileText}}code-view{{end}} has-emoji">
2828
{{if .ReadmeExist}}
2929
{{if .FileContent}}{{.FileContent | Str2html}}{{end}}
3030
{{else if not .IsFileText}}

templates/repo/view_list.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<strong>{{.LastCommit.Author.Name}}</strong>
1111
{{end}}
1212
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.LastCommit.ID}}" rel="nofollow">{{ShortSha .LastCommit.ID.String}}</a>
13-
<span class="grey">{{RenderCommitMessage false .LastCommit.Summary .RepoLink $.Repository.ComposeMetas}}</span>
13+
<span class="grey has-emoji">{{RenderCommitMessage false .LastCommit.Summary .RepoLink $.Repository.ComposeMetas}}</span>
1414
</th>
1515
<th class="nine wide">
1616
</th>
@@ -42,7 +42,7 @@
4242
<a href="{{EscapePound $.BranchLink}}/{{EscapePound $.TreePath}}{{EscapePound $entry.Name}}">{{$entry.Name}}</a>
4343
</td>
4444
{{end}}
45-
<td class="message collapsing">
45+
<td class="message collapsing has-emoji">
4646
<a rel="nofollow" class="ui sha label" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{$commit.ID}}">{{ShortSha $commit.ID.String}}</a>
4747
{{RenderCommitMessage false $commit.Summary $.RepoLink $.Repository.ComposeMetas}}
4848
</td>

templates/user/dashboard/feeds.tmpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@
4646
{{ $repoLink := .GetRepoLink}}
4747
{{if $push.Commits}}
4848
{{range $push.Commits}}
49-
<li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a class="commit-id" href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey">{{.Message}}</span></li>
49+
<li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a class="commit-id" href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey has-emoji">{{.Message}}</span></li>
5050
{{end}}
5151
{{end}}
5252
{{if and (gt $push.Len 1) $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</a></li>{{end}}
5353
</ul>
5454
</div>
5555
{{else if eq .GetOpType 6}}
56-
<span class="text truncate issue title">{{index .GetIssueInfos 1}}</span>
56+
<span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
5757
{{else if eq .GetOpType 7}}
58-
<p class="text light grey">{{index .GetIssueInfos 1}}</p>
58+
<p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
5959
{{else if eq .GetOpType 10}}
60-
<span class="text truncate issue title">{{.GetIssueTitle}}</span>
61-
<p class="text light grey">{{index .GetIssueInfos 1}}</p>
60+
<span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
61+
<p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
6262
{{else if eq .GetOpType 11}}
63-
<p class="text light grey">{{index .GetIssueInfos 1}}</p>
63+
<p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
6464
{{else if (or (eq .GetOpType 12) (eq .GetOpType 13))}}
65-
<span class="text truncate issue title">{{.GetIssueTitle}}</span>
65+
<span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
6666
{{end}}
6767
<p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
6868
</div>

templates/user/dashboard/issues.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
{{ $timeStr:= TimeSince .Created $.Lang }}
6363
<li class="item">
6464
<div class="ui label">{{if not $.RepoID}}{{.Repo.Name}}{{end}}#{{.Index}}</div>
65-
<a class="title" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Name}}</a>
65+
<a class="title has-emoji" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Name}}</a>
6666

6767
{{if .NumComments}}
6868
<span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span>

0 commit comments

Comments
 (0)