Added emoji to chat fixes #48

This commit is contained in:
Chris Blanchard 2015-09-23 17:00:15 +01:00
parent b45b60e822
commit 852745f6d2
3 changed files with 12 additions and 2 deletions

View file

@ -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

File diff suppressed because one or more lines are too long

View file

@ -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>