File tree 1 file changed +3
-2
lines changed
app/assets/javascripts/backbone/plugins
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ class Kandan.Plugins.Emoticons
3
3
@options :
4
4
regex : / \( [a-zA-Z ] + \) / g
5
5
template : _ .template '''
6
- <img class="emoticon-embed" src="/assets/emoticons/<%= emoticon %>" height="30" width="30" />
6
+ <img class="emoticon-embed" src="/assets/emoticons/<%= emoticon %>" title="<%= title %>" height="30" width="30" />
7
7
'''
8
8
9
9
@@ -37,10 +37,11 @@ class Kandan.Plugins.Emoticons
37
37
matches = message .content .match (@options .regex )
38
38
for match in _ .unique (matches)
39
39
emoticon = @emoticons [match]
40
+ title = match .replace (/ \( | \) / g , " " )
40
41
needle = match .replace (' (' , ' \\ (' ).replace (' )' , ' \\ )' )
41
42
search = new RegExp (needle, ' g' )
42
43
console .log (search)
43
- replacement = @options .template ({ emoticon : emoticon })
44
+ replacement = @options .template ({ emoticon : emoticon, title : title })
44
45
message .content = message .content .replace (search, replacement) if emoticon
45
46
console .log (message .content )
46
47
return Kandan .Helpers .Activities .buildFromBaseTemplate (message)
You can’t perform that action at this time.
0 commit comments