emojione-client.js 482 B

1234567891011121314
  1. Template.registerHelper('emojione', new Template('emojione', function () {
  2. var view = this;
  3. var content;
  4. if (view.templateContentBlock) {
  5. // this is for the block usage eg: {{#emoji}}:smile:{{/emoji}}
  6. content = Blaze._toText(view.templateContentBlock, HTML.TEXTMODE.STRING);
  7. } else {
  8. // this is for the direct usage eg: {{> emoji ':blush:'}}
  9. content = Blaze.getData(view);
  10. }
  11. return HTML.Raw(emojione.toImage(content));
  12. }));