Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JavaScriptCollection/embed.js

Repository files navigation

Build Status npm Bower Twitter Producthunt

A JavaScript plugin that analyses the string and automatically embeds the supported emojis, media, maps, tweets, code and services.

screen

Important links

Installation

To install the stable version:

npm install --save embed-js

CDN

Simple Usage

Let's assume that the HTML structure is as written below

<div id="element">
 <!--===== your string here =======-->
</div>

Creating an instance of embed.js

var x = new EmbedJS({
 input: document.getElementById('element'),
 googleAuthKey : 'xxxx'
})

Next step is replacing the original text with the processed text.

//Render the result
x.render();

There may be cases where you just want the processed string to use it according to your need. You can get it by the following method.

//Get the resulting string
x.text(function(data){
 console.log(data); //The resultant string
})

If you wan't to destroy the instance. It will also replace the processed string with the original string.

//Destroy the instance
x.destroy()

Adding custom emojis

  1. Add the image to assets/images/emojis. Make sure the name of the file is same as emoji name.
  2. Pass the emoji name as the value to customEmoji. See the example here
  3. Run grunt build-emoji && grunt build

License

MIT © Ritesh Kumar

About

✨ A JavaScript plugin that embeds emojis, media, maps, tweets, gists, code, services and markdown. ✨

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 56.8%
  • JavaScript 33.1%
  • HTML 10.1%

AltStyle によって変換されたページ (->オリジナル) /