The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-emoji/client/lib/emojiRenderer.js

26 lines
808 B

/* globals HTML, isSetNotNull, renderEmoji:true */
import { Blaze } from 'meteor/blaze';
import { Template } from 'meteor/templating';
renderEmoji = function(emoji) {
if (isSetNotNull(() => RocketChat.emoji.list[emoji].emojiPackage)) {
const { emojiPackage } = RocketChat.emoji.list[emoji];
return RocketChat.emoji.packages[emojiPackage].render(emoji);
}
};
Blaze.registerHelper('renderEmoji', renderEmoji);
Template.registerHelper('renderEmoji', new Template('renderEmoji', function() {
const view = this;
const emoji = Blaze.getData(view);
if (isSetNotNull(() => RocketChat.emoji.list[emoji].emojiPackage)) {
const { emojiPackage } = RocketChat.emoji.list[emoji];
return new HTML.Raw(RocketChat.emoji.packages[emojiPackage].render(emoji));
}
return '';
}));
/* exported renderEmoji */