Code Monkey home page Code Monkey logo

emoji's Introduction

emoji

Build Status Coverage Status spm package

NPM

logo

This library allows the handling and conversion of Emoji in Javascript.

Usage

Browser

see demo.html

Use staticfile.org CDN:

<link href="http://cdn.staticfile.org/emoji/0.2.2/emoji.css" rel="stylesheet" type="text/css" />
<script src="http://cdn.staticfile.org/jquery/2.1.0/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/emoji/0.2.2/emoji.js"></script>
var $text = $('.emojstext');
var html = $text.html().trim().replace(/\n/g, '<br/>');
$text.html(jEmoji.unifiedToHTML(html));

Seajs

seajs.config({
  alias: {
    emoji: 'http://cdn.staticfile.org/emoji/0.2.2/emoji.js'
  }
});

seajs.use(['emoji'], function (emoji) {
  // TODO
});
// or
define('test', function (require, exports, modules) {
  var emoji = require('emoji');
});

RequireJS (AMD)

require.config({
  paths: {
    emoji: 'http://cdn.staticfile.org/emoji/0.2.2/emoji.js'
  }
});

require(['emoji'], function (emoji) {
  // TODO
});

Nodejs

$ npm install emoji
var emoji = require('emoji');
console.log('😎', emoji.unifiedToHTML('😎'));

test on nodejs:

$ make test

Sync data

Source data come from php-emoji.

Run bin/syncdata.sh script, will keep emoji.png, emoji.css, table.html update. And it will create emoji.js from table.html.

sh ./bin/syncdata.sh

Authors

Missing emojis support by: Nariman Haghighi [email protected] and Jonathan Ong [email protected].

$ git summary

 project  : emoji
 repo age : 1 year, 8 months
 active   : 18 days
 commits  : 61
 files    : 24
 authors  :
    48  fengmk2                 78.7%
     6  pachtymichuk            9.8%
     4  Jonathan Ong            6.6%
     2  Julian Bäume           3.3%
     1  Craig Condon            1.6%

License

(The MIT License)

Copyright (c) 2012 - 2014 fengmk2 [email protected].

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

emoji's People

Contributors

afc163 avatar fengmk2 avatar johnyb avatar jonathanong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emoji's Issues

export the regexp

i want to search throughout the documents, find any emojis, then replace them with the image. however, i'm not totally sure how to even find them right now. seems like the best way is to export these regexps via https://github.com/fengmk2/emoji/blob/master/lib/emoji.js#L779, then i can handle the searching myself.

how about exporting the regular expressions as lazy getters?

Retina image

It would be awesome if you add @2x version for retina display 😄

Different CDN

Not sure why, but if I try to move the emoji.js file to my CDN (I'm using S3), the script fails to run—and throws no errors.

Currently I've been able to move the .css file, and the .png sprite to my S3 bucket, but as soon as I try to reference the emoji.js file at any location besides http://cdn.staticfile.org/emoji/0.2.2/emoji.js, the script fails to run.

So in short:
Works
emoji.css -> my server
emoji.png-> my server
emoji.js-> cdn.staticfile.org

Does Not Work —Throws no errors in console.
emoji.css -> my server
emoji.png-> my server
emoji.js-> my server

Any help is appreciated. Thanks!

bower package

The bower does not contained a compiled version, can this be fixed? Since bower packages is recommended to keep outside vcs they have to be installed on production servers. I think you should pre-compile and then publish on bower.

如何防止xss注入呢?

我有一个比较旧的工程,使用的是knockout.js,因为emoji.js是将emoji转换为span,所以我ko需要使用html绑定,但是这样会带来xss注入问题,请问这有好的解决方案吗

edit emoji

if i want to edit the emoji on brower, how can i do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.