Skip to content

Latest commit

 

History

History
65 lines (54 loc) · 1.41 KB

README.md

File metadata and controls

65 lines (54 loc) · 1.41 KB

Emoticons

This meteor packages adds a helper function to your project which parses emoticon strings and replaces them with images. There is a basic set of 24 icons, but you can add as many as you want by populating Meteor.settings.public.extraEmoticons or you can completely replace the core set with your own icons by overwriting Meteor.settings.public.coreEmoticons.

alt tag

Quick Start

$ meteor add mattimo:emoticons

You will get a new helper

{{{parseEmoticons "text"}}}

All emoticons output will have the meteoremoticon css class like so:

<img class="meteoremoticon" src="{{url}}">

Adding Extra Icons

{
  "public": {
    "extraEmoticons": [
      {
        "image": "/path/to/beer.gif",
        "replacements": [":beer:", ":cheers", ":toast:"]
      },
      {
        "image": "/path/to/something.png",
        "replacements": [":somethingcool:"]
      }
    ]
  }
}

Replacing Core Icons

This will overwrite all of the core icons, so you need to define a full set.

{
  "public": {
    "coreEmoticons": [
      {
        "image": "/path/to/happy.png",
        "replacements": [":)", ":-)"]
      },
      {
        "image": "/path/to/wink.png",
        "replacements": [";)", ";-)"]
      }
    ]
  }
}