File tree Expand file tree Collapse file tree 6 files changed +64
-17
lines changed Expand file tree Collapse file tree 6 files changed +64
-17
lines changed Original file line number Diff line number Diff line change @@ -571,6 +571,7 @@ function initRepository() {
571
571
$editContentZone . html ( $ ( '#edit-content-form' ) . html ( ) ) ;
572
572
$textarea = $segment . find ( 'textarea' ) ;
573
573
issuesTribute . attach ( $textarea . get ( ) ) ;
574
+ emojiTribute . attach ( $textarea . get ( ) ) ;
574
575
575
576
// Give new write/preview data-tab name to distinguish from others
576
577
var $editContentForm = $editContentZone . find ( '.ui.comment.form' ) ;
Original file line number Diff line number Diff line change
1
+ .tribute-container {
2
+ box-shadow : 0px 1px 3px 1px #c7c7c7 ;
3
+ ul {
4
+ background : #ffffff ;
5
+ }
6
+ li {
7
+ padding : 8px 12px ;
8
+ border-bottom : 1px solid #dcdcdc ;
9
+ img {
10
+ display : inline-block ;
11
+ vertical-align : middle ;
12
+ width : 28px ;
13
+ height : 28px ;
14
+ margin-right : 5px ;
15
+ }
16
+ span .fullname {
17
+ font-weight : normal ;
18
+ font-size : 0.8rem ;
19
+ margin-left : 3px ;
20
+ }
21
+ }
22
+ li .highlight , li :hover {
23
+ background : #2185D0 ;
24
+ color : #ffffff ;
25
+ }
26
+ }
Original file line number Diff line number Diff line change
1
+ @import " _tribute" ;
1
2
@import " _emojify" ;
2
3
@import " _base" ;
3
4
@import " _markdown" ;
Original file line number Diff line number Diff line change 7
7
max-width : 500px ;
8
8
overflow : auto;
9
9
display : block;
10
- box-shadow : 0px 1px 3px 1px # c7c7c7 ;
11
10
z-index : 999999 ; }
12
11
.tribute-container ul {
13
12
margin : 0 ;
14
13
margin-top : 2px ;
15
14
padding : 0 ;
16
15
list-style : none;
17
- background : # ffffff ; }
16
+ background : # efefef ; }
18
17
.tribute-container li {
19
- padding : 8px 12px ;
20
- border-bottom : 1px solid # dcdcdc ;
18
+ padding : 5px 5px ;
21
19
cursor : pointer; }
22
20
.tribute-container li .highlight , .tribute-container li : hover {
23
- background : # 2185D0 ;
24
- color : # ffffff ;}
25
- .tribute-container li img {
26
- display : inline-block;
27
- vertical-align : middle;
28
- width : 28px ;
29
- margin-right : 5px ;
30
- }
21
+ background : # ddd ; }
31
22
.tribute-container li span {
32
23
font-weight : bold; }
33
- .tribute-container li span .fullname {
34
- font-weight : normal;
35
- font-size : 0.8rem ;
36
- margin-left : 3px ;}
37
24
.tribute-container li .no-match {
38
25
cursor : default; }
39
26
.tribute-container .menu-highlighted {
Original file line number Diff line number Diff line change 89
89
issuesTribute.attach(document.getElementById('content'))
90
90
</script>
91
91
{{end}}
92
+ <script>
93
+ var emojiTribute = new Tribute({
94
+ collection: [{
95
+ trigger: ':',
96
+ requireLeadingSpace: true,
97
+ values: function (text, cb) {
98
+ var array = emojify.emojiNames;
99
+ var data = [];
100
+ for(var j=0; j<array.length; j++) {
101
+ if(array[j].indexOf(text) !== -1) {
102
+ data.push(array[j]);
103
+ if(data.length > 5) {
104
+ break;
105
+ }
106
+ }
107
+ }
108
+ cb(data);
109
+ },
110
+ lookup: function (item) {
111
+ return item;
112
+ },
113
+ selectTemplate: function (item) {
114
+ if (typeof item === 'undefinied') return null;
115
+ return ':' + item.original + ':';
116
+ },
117
+ menuItemTemplate: function (item) {
118
+ return '<img class="emoji" src="{{AppSubUrl}}/vendor/plugins/emojify/images/' + item.original + '.png"/>' + item.original;
119
+ }
120
+ }]
121
+ });
122
+ emojiTribute.attach(document.getElementById('content'))
123
+ </script>
92
124
{{end}}
93
125
<script src="{{AppSubUrl}}/vendor/plugins/autolink/autolink.js"></script>
94
126
<script src="{{AppSubUrl}}/vendor/plugins/emojify/emojify.min.js"></script>
You can’t perform that action at this time.
0 commit comments