Skip to content

Commit

Permalink
Merge pull request joypixels#473 from kevinranks/3.0
Browse files Browse the repository at this point in the history
EmojiOne 3.0 Update
  • Loading branch information
caseyahenson authored Apr 19, 2017
2 parents eb13dba + 979f469 commit ec13266
Show file tree
Hide file tree
Showing 10,244 changed files with 39,244 additions and 25,707 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ build/
emojipy-*/
emojipy.egg-info/
npm-debug.log
lib/js/tests/npm-debug.log
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##How to contribute to the Emoji One library
##How to contribute to the EmojiOne library
---
###code format
* Try to maintain the general code convention currently found in the library.
Expand All @@ -9,8 +9,8 @@
* Include a brief description of the issue and how your patch will solve it.
* If there are tests available in the library run your patch through them before submitting your pull request. If no tests are available in the library test the patch as thoroughly as possible before submitting.

###emoji art (PNG & SVG)
* We unfortunately cannot accept submissions for emoji art revisions. Due to the copyright of the art and the potential for it's licensing in different situations this isn't possible.
###emoji art
* We unfortunately cannot accept submissions for emoji art revisions. Due to the copyright of the art and the potential for its licensing in different situations this isn't possible.
* Design suggestions are welcome. They will be considered by the designers. There's no guarantee they will be adopted.
* Notes on visual errors are also accepted.
* Both can be submitted through the contact form at http://emojione.com/contact/
Expand All @@ -19,4 +19,4 @@
Thank you for your interest in contributing to this library.

Regards,
Emoji One Team
EmojiOne Team
45 changes: 45 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
### Installation

We've teamed up with [JSDelivr](http://www.jsdelivr.com/#!emojione) to provide a simple way to install these emoji on any javascript-enabled website. Add the following script and stylesheet links to the head of your webpage:

```
<script src="https://cdn.jsdelivr.net/emojione/3.0/lib/js/emojione.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/emojione/3.0/assets/css/emojione.min.css"/>
```

Alternatively, CDNjs is also available as a [CDN Host for EmojiOne](https://cdnjs.com/libraries/emojione).

Quick installs can also be done using NPM and Bower (for the Javascript toolkit) or Composer (for the PHP toolkit). **If you wish to serve image assets locally you'll need to install [emojione-assets](https://www.github.com/Ranks/emojione-assets) and include the pngs and/or sprites into your project.** Many of our [demos](https://demos.emojione.com/latest/) use assets locally simply by pointing the `imagePathPNG` variable to your local asset location.

#### NPM
```
> npm install emojione
```

#### Bower
```
> bower install emojione
```


#### Composer
```
$ composer require emojione/emojione
```

#### Meteor
```
meteor add emojione:emojione
```

### Version 2 Installation
If you're looking to use emojione < version 3.0, refer to the 2.2.7 branch. **CDN (jsdelivr) dependency has been preserved for version 2.**


### Character Encoding &mdash; UTF-8

If you're getting serious about implementing emoji into your website, you will want to consider your web stack's character encoding. You should make sure that all connection points are using the same encoding. There are a lot of options and configuration possibilities here, so you'll have to figure what works best for your own situation.

A quick Google search will bring up a lot of information on how to get your entire web stack to use UTF-8, which is needed to properly handle Unicode emoji.

To get you started, here's a nice guide: [UTF-8: The Secret of Character Encoding](http://htmlpurifier.org/docs/enduser-utf8.html).
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#### EmojiOne Artwork

* Applies to all PNG and SVG files as well as any adaptations made.
* Applies to all PNG files found in the emojione-assets repo as well as any adaptations made.
* License: Creative Commons Attribution 4.0 International
* Human Readable License: http://creativecommons.org/licenses/by/4.0/
* Complete Legal Terms: http://creativecommons.org/licenses/by/4.0/legalcode


#### EmojiOne Non-Artwork

* Applies to the Javascript, JSON, PHP, CSS, HTML files, and everything else not covered under the artwork license above.
* Applies to the Javascript, JSON, PHP, CSS, HTML files, and everything else not covered under the artwork license above, found in both the emojione and emojione-assets repos.
* License: MIT
* Complete Legal Terms: http://opensource.org/licenses/MIT
222 changes: 25 additions & 197 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,190 +1,39 @@
#![EmojiOne Logo](http://git.emojione.com/assets/logo.png) EmojiOne [![Build Status](https://travis-ci.org/Ranks/emojione.svg?branch=master)](https://travis-ci.org/Ranks/emojione)
> bringing you [emojione.com](http://emojione.com/) & [emoji.codes](http://emoji.codes/)
# ![EmojiOne Logo](https://prod.emojione.com/images/vectors/emojione-typeface.svg)

The web's first and only complete open source emoji set. It is 100% free and super easy to integrate.
> [![npm version](https://img.shields.io/npm/v/emojione.svg)](https://www.npmjs.com/package/emojione) [![npm downloads](https://img.shields.io/npm/dt/emojione.svg)](https://www.npmjs.com/package/emojione)
The web's first and only complete open source emoji set. It is 100% free for digital use and super easy to integrate.


## The Idea

To standardize emoji on the web through the use of common :shortnames:.

When storing user inputted text in your database, say from a guestbook or through a CMS admin, it is recommended that you store text containing only :shortnames: and not Unicode emoji characters or emoji images. Then, when you are displaying that content to the user, you can convert it server-side with the PHP toolkit provided, or client-side using the Javascript toolkit which is also provided. Demos of this process using Javascript, jQuery, and PHP are included in the repo, and we have example code snippets below.


#### _What are Shortnames?_

Shortnames are semi-standardized human-readable identifiers for each emoji icon. Many online web applications will accept these shortnames as alternatives for the actual unicode character. We've compiled the full list over at [emoji.codes](http://emoji.codes/) with quick copy & search functions.

## What's Included?

- This project includes libraries used to convert emoji into various formats, including conversion to EmojiOne emoji images.
- All libraries included here are available free under the MIT license.


## License to Use EmojiOne Images

### EmojiOne Version 3

EmojiOne launched version 3.0 in 2017, which has several licensing options available. PNG 32px, 64px, and 128px as well as 32px and 64px sprites are available for digital use, with attribution. See [emojione.com/developers/free-license](https://prod.emojione.com/developers/free-license) for more information on usage and attribution requirements.

*Premium Licenses are available for larger PNG assets and SVG assets, for digital and print use.* See [emojione.com/developers/premium-license](https://prod.emojione.com/developers/premium-license) for more information or to obtain a Premium License.

### EmojiOne Version 2

EmojiOne version 2 assets (all SVG and PNG) remain available for digital use, with attribution, under the Creative Commons license. Please see [INSTALLATION.md](INSTALLATION.md) for instructions on installing version 2, and [UPGRADE.md](UPGRADE.md) for instructions on upgrading from version 2 to version 3.


## Installation
To install emojione, please refer to the guide at [INSTALLATION.md](INSTALLATION.md). **Version 3 introduces many potentially-breaking changes.** Refer to the [UPGRADE.md](UPGRADE.md) documentation for more details.

We've teamed up with [JSDelivr](http://www.jsdelivr.com/#!emojione) to provide a simple way to install these emoji on any javascript-enabled website. Add the following script and stylesheet links to the head of your webpage:

```
<script src="https://cdn.jsdelivr.net/emojione/2.2.7/lib/js/emojione.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/emojione/2.2.7/assets/css/emojione.min.css"/>
```

Alternatively, CDNjs is also available as a [CDN Host for EmojiOne](https://cdnjs.com/libraries/emojione).

Quick installs can also be done using NPM and Bower (for the Javascript toolkit) or Composer (for the PHP toolkit).

#### NPM
```
> npm install emojione
```

#### Bower
```
> bower install emojione
```


#### Composer
```
$ composer require emojione/emojione
```

#### Meteor
```
meteor add emojione:emojione
```


## Usage Examples

Below there are some examples of how you will actually use the libraries to convert Unicode emoji characters to :shortnames: and :shortnames: to emoji images.


### Javascript Conversion


**[.toShort\(str\)](http://git.emojione.com/demos/latest/jstoshort.html)** - _native unicode -> shortnames_

This demo shows you how to take native unicode emoji input, such as that from your mobile device, and translate it to their corresponding shortnames. (we recommend this for database storage)

**[.shortnameToImage\(str\)](http://git.emojione.com/demos/latest/jsshortnametoimage.html)** - _shortname -> images_

This demo shows you how to take input containing only shortnames and translate it directly to EmojiOne images. (when displaying the unified input to clients)

**[.unicodeToImage\(str\)](http://git.emojione.com/demos/latest/jsunicodetoimage.html)** - _native unicode -> images_

This demo shows you how to take native unicode emoji input, such as that from your mobile device, and translate it directly to EmojiOne images. (would be great for a live editor preview)

**[.toImage\(str\)](http://git.emojione.com/demos/latest/jstoimage.html)** - _native unicode + shortnames -> images (mixed input)_

This demo shows you how to take input containing both native unicode emoji and shortnames, and translate it into EmojiOne images for display.


### PHP Conversion

##### As of version 1.4.1 this library syntax has changed.

**[toShort\($str\)](http://git.emojione.com/demos/latest/phptoshort.php)** - _native unicode -> shortnames_

This demo shows you how to take native unicode emoji input, such as that from your mobile device, and translate it to their corresponding shortnames. (we recommend this for database storage)

**[shortnameToImage\($str\)](http://git.emojione.com/demos/latest/phpshortnametoimage.php)** - _shortname -> images_

This demo shows you how to take input containing only shortnames and translate it directly to EmojiOne images. (when displaying the unified input to clients)

**[unicodeToImage\($str\)](http://git.emojione.com/demos/latest/phpunicodetoimage.php)** - _native unicode -> images_

This demo shows you how to take native unicode emoji input, such as that from your mobile device, and translate it directly to EmojiOne images. (would be great for a live editor preview)

**[toImage\($str\)](http://git.emojione.com/demos/latest/phptoimage.php)** - _native unicode + shortnames -> images (mixed input)_

This demo shows you how to take input containing both native unicode emoji and shortnames, and translate it into EmojiOne images for display.


##### Note: As of version 1.4.1 the following implementation has been deprecated. It's included in the library for backwards compatibility but will be removed at a later date.

**[::toShort\($str\)](http://git.emojione.com/demos/1.4.0/phptoshort.php)** - _native unicode -> shortnames_

This demo shows you how to take native unicode emoji input, such as that from your mobile device, and translate it to their corresponding shortnames. (we recommend this for database storage)
## Contributing
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more info on contributing to the emojione project. For artwork comments and questions please see the emojione-assets repo.

**[::shortnameToImage\($str\)](http://git.emojione.com/demos/1.4.0/phpshortnametoimage.php)** - _shortname -> images_
## Usage
You'll find basic usage examples here in the [/examples/](examples/) directory, and links to usage demos in [USAGE.md](USAGE.md).

This demo shows you how to take input containing only shortnames and translate it directly to EmojiOne images. (when displaying the unified input to clients)

**[::unicodeToImage\($str\)](http://git.emojione.com/demos/1.4.0/phpunicodetoimage.php)** - _native unicode -> images_

This demo shows you how to take native unicode emoji input, such as that from your mobile device, and translate it directly to EmojiOne images. (would be great for a live editor preview)

**[::toImage\($str\)](http://git.emojione.com/demos/1.4.0/phptoimage.php)** - _native unicode + shortnames -> images (mixed input)_

This demo shows you how to take input containing both native unicode emoji and shortnames, and translate it into EmojiOne images for display.

### Meteor Conversion

#### Template helpers

```handlebars
My emoji {{> emojione ':beers:'}} text.
```

Or

```handlebars
{{#emojione}}My emoji :beers: text.{{/emojione}}
```

### Swift Conversion

```swift
Emojione.transform(string: "Rocket.Chat: :rocket:")
```

### Extras

**[shortnameToUnicode(str)](http://git.emojione.com/demos/latest/shortnametounicode.html)**

Change from shortnames to native unicode emoji.

**[Shortname Autocomplete](http://git.emojione.com/demos/latest/autocomplete.html)**

Easily add shortname autocomplete functionality to any text input on your page.

**[ASCII Smiley Conversion](http://git.emojione.com/demos/latest/ascii-smileys.html)**

With one quick step you can start converting common ASCII smileys to their corresponding images.

**[Alternate Alt Tags](http://git.emojione.com/demos/latest/alternate-alt-tags.html)**

Change from the native unicode emoji in the resulting alt tags to their shortnames instead.

**[Live Preview Box](http://git.emojione.com/demos/latest/live-preview.html)**

Display converted Emoji in a preview box as the user is typing.

**[Conversion HTML Class](http://git.emojione.com/demos/latest/class-convert.html)**

Stick a class of .emojione-convert on any HTML element and automatically convert native unicode emoji and/or shortnames to images after page load.

**[Convert on Form Submission](http://git.emojione.com/demos/latest/convert-on-submit.html)**

Converts unicode input to shortnames once the user submits the form.

**[Sprites (PNG)](http://git.emojione.com/demos/latest/sprites-png.html)**

With an additional CSS file you can use EmojiOne as resizable PNG sprites (up to 64x64).

**[Sprites (SVG)](http://git.emojione.com/demos/latest/sprites-svg.html)**

This sprite method requires no extra CSS, and is infinitely resizable.


## Other Considerations
### Character Encoding &mdash; UTF-8

If you're getting serious about implementing emoji into your website, you will want to consider your web stack's character encoding. You should make sure that all connection points are using the same encoding. There are a lot of options and configuration possibilities here, so you'll have to figure what works best for your own situation.

A quick Google search will bring up a lot of information on how to get your entire web stack to use UTF-8, which is needed to properly handle Unicode emoji.

To get you started, here's a nice guide: [UTF-8: The Secret of Character Encoding](http://htmlpurifier.org/docs/enduser-utf8.html).

## Information

Expand Down Expand Up @@ -215,25 +64,4 @@ We sincerely hope that you choose to use EmojiOne and support our project, but i
* https://github.com/steveklabnik/emoji
* https://github.com/rockerhieu/emojicon
* https://github.com/HenrikJoreteg/emoji-images
* https://github.com/frissdiegurke/emoji-parser

## Licenses

### EmojiOne Artwork

* Applies to all PNG and SVG files as well as any adaptations made.
* The following applies to artwork included in EmojiOne GitHub libraries versions < 2.0.0.
* License: Creative Commons Attribution-ShareAlike 4.0 International
* Human Readable License: http://creativecommons.org/licenses/by-sa/4.0/
* Complete Legal Terms: http://creativecommons.org/licenses/by-sa/4.0/legalcode
* The following applies to artwork included in EmojiOne GitHub libraries versions >= 2.0.0.
* License: Creative Commons Attribution 4.0 International
* Human Readable License: http://creativecommons.org/licenses/by/4.0/
* Complete Legal Terms: http://creativecommons.org/licenses/by/4.0/legalcode


### EmojiOne Non-Artwork

* Applies to: Javascript, JSON, PHP, CSS, HTML files, and everything else not covered under the artwork license above.
* License: MIT
* Complete Legal Terms: http://opensource.org/licenses/MIT
* https://github.com/frissdiegurke/emoji-parser
63 changes: 63 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Upgrading from emojione v2 to emojione v3

* emojione v3 brings about several breaking changes and new considerations
* please review EmojiOne Licensing for more information on using SVG or PNG (larger than 128px) assets

## Libraries
**JS**
- Deprecated vars:
- [emojione.js] imagePathSVG, imagePathSVGSprites, imageType (now defaulted to png)
- Tests also updated (added explicit protocol for cdn, included previously-added title attribute to img tag)
- Added vars:
- emojiVersion (str)
- emojiSize (str)
- matchGreedy (bool)

**PHP**
- Deprecated vars:
- [src/Client.php] imagePathSVG, imagePathSVGSprites
- [src/Emojione.php] imagePathSVG, imagePathSVGSprites, imageType
- Added vars:
- emojiVersion (str)
- emojiSize (str)
- matchGreedy (bool)
- Tests
- [tests/ConversionTest.php] removed testSmileyInsideAnObject()
- [tests/ConversionTest.php] removed testShortnameInsideOfObjectTag()

## Demos
Replaced by ‘examples’. Contains code snippets of each of the functions previously demonstrated. Updated demos can be found at <a href="https://demos.emojione.com/latest"></a>.

## JSON Files
**EMOJI.JSON (updated)**
- primary key is now *base code point* rather than shortname
- base code point is the full unicode code point minus VS16 and ZWJ
- base code point is used as an identifier for emoji file names (PNG) as well as within sprites (CSS)
- **unicode** (str) and **unicode_alt** (str) are depricated. code points are now organized within **code_points** (array)
- **output** (str) is the recommended code point to use for conversion to native unicode
- **match_default** (array) contains one or more code points used to identify native unicode
- **match_greedy** (array) contains one or more code points used to identify potential native unicode variants
- note: the match_greedy code point(s) may replace non-emoji variants producing undesired results
- **decimal** (str) replaces **code_decimal** (str)
- **emoji_order** (int) is now simply **order** (int)
- **display** (int) determines whether an emoji should be shown on a keyboard
- **aliases** (array) is now **shortname_alternates** (array)
- **aliases_ascii** (array) is now **ascii** (array)
- **diversity** (str) is either `null` or the base code point of the corresponding Fitzpatrick Emoji Modifier
- **diversities** (array) contains the base code points of the diversity children for a diversity parent (non-diverse, diversity base)
- **gender** (str) is either `null` or the base code point of the corresponding male/female emoji symbol
- **genders** (array) contains the base code points of the gender children for a gender parent (gender-neutral, gender base)

**EMOJI_STRATEGY.JSON (updated)**
- primary key is now *base code point* rather than short name
- **aliases** (str) is now **shortname_alternates** (array)
- **keywords** (str) is now **keywords** (array)
- **unicode** (str) is now **unicode_output** (str)

**EMOJI_CATEGORIES.JSON (new)**
- **order** (str)
- **category** (str)
- **category_label** (str)

## Shortname Changes
Along with the many changes to emojione version 3.0 comes a number of shortname updates. **Any shortnames that change will still appear as an alternate shortname (or alias) in the data files.** You can view the complete list of primary shortname changes in the [extras/alpha-codes readme](extras/alpha-codes/).
Loading

0 comments on commit ec13266

Please sign in to comment.