mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-10 07:11:53 +00:00
Added emoji to chat fixes #48
This commit is contained in:
parent
b45b60e822
commit
852745f6d2
3 changed files with 12 additions and 2 deletions
|
@ -93,7 +93,8 @@ var Chatroom = React.createClass({
|
|||
|
||||
var ChatMessage = React.createClass({
|
||||
mixins: [
|
||||
ReactAutolink
|
||||
ReactAutolink,
|
||||
ReactEmoji
|
||||
],
|
||||
|
||||
getInitialState() {
|
||||
|
@ -124,9 +125,16 @@ var ChatMessage = React.createClass({
|
|||
},
|
||||
|
||||
messageContent: function () {
|
||||
return this.autolink(this.props.message.content, {
|
||||
let self = this;
|
||||
return self.autolink(self.props.message.content, {
|
||||
target: "_blank",
|
||||
rel: "nofollow"
|
||||
}).map((elem) => {
|
||||
if (_.isString(elem)) {
|
||||
return self.emojify(elem);
|
||||
} else {
|
||||
return elem;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
1
public/js/emoji.min.js
vendored
Normal file
1
public/js/emoji.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -21,5 +21,6 @@
|
|||
<script src="/js/howler.min.js"></script>
|
||||
<script src="/js/lodash.min.js"></script>
|
||||
<script src="/js/autolinker.min.js"></script>
|
||||
<script src="/js/emoji.min.js"></script>
|
||||
<script src="/js/helper.js"></script>
|
||||
</head>
|
Loading…
Reference in a new issue