Skip to content
This repository has been archived by the owner on Oct 3, 2018. It is now read-only.

Commit

Permalink
[ci skip] Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Hassan Khan committed Sep 28, 2014
1 parent c48ec17 commit 8157345
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ Then add this to your Javascript code:

`npm install emojify.js#~1.0 --save`

## Setup and customisation
## Usage

### `setConfig()`

**This works in the browser and on Node**

To set configuration options, use `emojify.setConfig()` and a JSON object as a parameter with any of the following attributes:

Expand All @@ -61,12 +65,25 @@ For example:

```js
emojify.setConfig({emojify_tag_type : 'div'});
```

### `run()`

**This only works in the browser**

You can optionally pass an object to `emojify.run()` to restrict the emojification to that object only.

```js
emojify.run();
// OR
emojify.run( document.getElementById( 'my-element' ) )
```

You can optionally pass an object to `emojify.run()` to restrict the **emojification** to that object only: `emojify.run(document.getElementById('my-element'))`.
### `replace()`

**This works in the browser and on Node**

If you are running emojify.js from Node, you won't be able to use `emojify.run()`. This is because the `run()` method uses DOM manipulation to emojify strings. In this case, you should use `emojify.replace()` instead. You can also use `emojify.replace()` to replace emoji/emoticon keywords in plain Javascript strings:
You can also use `emojify.replace()` to replace emoji/emoticon keywords in plain Javascript strings:

```js
emojify.replace('I am happy :)');
Expand Down
4 changes: 4 additions & 0 deletions emojify.js.sublime-project
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"folders":
[
{
"folder_exclude_patterns":
[
"node_modules"
],
"follow_symlinks": true,
"path": "."
}
Expand Down

0 comments on commit 8157345

Please sign in to comment.