Compare commits
174 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d7c6fa4e3 | ||
|
|
21c4e27ee2 | ||
|
|
aed88bb347 | ||
|
|
b04991b001 | ||
|
|
8d6aff3fc6 | ||
|
|
3f6057146c | ||
|
|
61e16ae891 | ||
|
|
9b8ad85de0 | ||
|
|
09125ab983 | ||
|
|
b9ce241bf1 | ||
|
|
ed954928d7 | ||
|
|
7858e79566 | ||
|
|
7bdd3f657f | ||
|
|
68af9e3320 | ||
|
|
7d27517382 | ||
|
|
53325ab398 | ||
|
|
09f66fc38a | ||
|
|
342b76f06e | ||
|
|
6b556ba8b2 | ||
|
|
74a321c07a | ||
|
|
7e10d1a38a | ||
|
|
8ff20db97f | ||
|
|
492e18f849 | ||
|
|
cf852befd9 | ||
|
|
9d313238bd | ||
|
|
840655ad6b | ||
|
|
f394c85d80 | ||
|
|
42a606c804 | ||
|
|
21c4cfe247 | ||
|
|
31a6c8b97b | ||
|
|
36d295f2b7 | ||
|
|
d3b9f412c9 | ||
|
|
a71ba68b6d | ||
|
|
380fd48cfd | ||
|
|
1e485abfe0 | ||
|
|
537ccc48ed | ||
|
|
9cf53bf513 | ||
|
|
0e72fb70cc | ||
|
|
8db519ecbe | ||
|
|
d0d9227065 | ||
|
|
72e9749225 | ||
|
|
16c7e21e5e | ||
|
|
cb3ab19847 | ||
|
|
9ffd0e63aa | ||
|
|
50865e8895 | ||
|
|
a76d5f02f4 | ||
|
|
be21932d23 | ||
|
|
ee403f0b7d | ||
|
|
75d8b4374b | ||
|
|
6de1de2fa1 | ||
|
|
be21f6efc6 | ||
|
|
f21379209f | ||
|
|
b84bf23a5b | ||
|
|
b05ddab3b9 | ||
|
|
365c7a184c | ||
|
|
3db7811891 | ||
|
|
22e198644d | ||
|
|
677084b5ed | ||
|
|
859778cc4b | ||
|
|
a8204fd8d3 | ||
|
|
694f862f73 | ||
|
|
11b4f69f5a | ||
|
|
4e6ce27ed6 | ||
|
|
9308a10b52 | ||
|
|
b841e20394 | ||
|
|
ac3620cf89 | ||
|
|
60a473bfe5 | ||
|
|
df1b6fac6e | ||
|
|
eda537e1a9 | ||
|
|
9967b2ef28 | ||
|
|
d41a53d459 | ||
|
|
06a2df3427 | ||
|
|
757584d2b9 | ||
|
|
f5092b7aa4 | ||
|
|
8a9a8572aa | ||
|
|
3d35b9f862 | ||
|
|
5dea160045 | ||
|
|
6984758915 | ||
|
|
29c25127d0 | ||
|
|
701f434b60 | ||
|
|
112cc8fb8b | ||
|
|
5162959546 | ||
|
|
75ada7cc89 | ||
|
|
0bb789e3e6 | ||
|
|
9beb9c0172 | ||
|
|
ea70c98946 | ||
|
|
7d416739ba | ||
|
|
96295d7871 | ||
|
|
584939127e | ||
|
|
680d1bc59b | ||
|
|
2c58377420 | ||
|
|
3bb3cea8d3 | ||
|
|
5e6dcae949 | ||
|
|
2aaf9693a9 | ||
|
|
0d1a82dc6a | ||
|
|
6b9cdd6eb5 | ||
|
|
75f837e6b5 | ||
|
|
c2286e7c5b | ||
|
|
3e21d95409 | ||
|
|
a86999a7f1 | ||
|
|
b7c2b8e4d8 | ||
|
|
1212951bc6 | ||
|
|
b1736a387c | ||
|
|
f9aba615af | ||
|
|
2741be5eb6 | ||
|
|
58f2f068c1 | ||
|
|
c5ee5ebb29 | ||
|
|
2b26bb9b0d | ||
|
|
be4946fbbe | ||
|
|
3b65ee2f15 | ||
|
|
0bea2df7ba | ||
|
|
e9480a983b | ||
|
|
3935375ca8 | ||
|
|
77ff183d85 | ||
|
|
06c5d0993b | ||
|
|
f73921aacd | ||
|
|
e2ae300270 | ||
|
|
bbfae32663 | ||
|
|
65031cfcd2 | ||
|
|
7477247802 | ||
|
|
ef06de5305 | ||
|
|
097fbafcb7 | ||
|
|
608ddd58fd | ||
|
|
72aecc9105 | ||
|
|
6a781b6474 | ||
|
|
cb55354db9 | ||
|
|
490b07b49e | ||
|
|
1a7a23fd46 | ||
|
|
d7b020fd16 | ||
|
|
a9112090fa | ||
|
|
01394ed139 | ||
|
|
2530b24121 | ||
|
|
5d2401222a | ||
|
|
70db910026 | ||
|
|
0845c3898a | ||
|
|
07e15fde99 | ||
|
|
2fad57ed49 | ||
|
|
c8c9805bfc | ||
|
|
f1d0bfedaf | ||
|
|
204ace76da | ||
|
|
824a0ee189 | ||
|
|
4536894c48 | ||
|
|
28983a9ea9 | ||
|
|
11c08bdd2f | ||
|
|
c77cd152ba | ||
|
|
73f48e4b57 | ||
|
|
633bd4ff33 | ||
|
|
8c96cb878f | ||
|
|
dc06bc9a6b | ||
|
|
7755a8a181 | ||
|
|
69f625f36c | ||
|
|
13bcea9b4a | ||
|
|
19ddee2bdc | ||
|
|
9cd56f6e3d | ||
|
|
56da9a86e3 | ||
|
|
c180447c5b | ||
|
|
150c509735 | ||
|
|
8e098547ad | ||
|
|
968373beae | ||
|
|
cb85b7b105 | ||
|
|
bfbc8c5e98 | ||
|
|
2d799338d9 | ||
|
|
8b45468c6e | ||
|
|
d7f9549261 | ||
|
|
17946e381b | ||
|
|
f9f0527fbe | ||
|
|
a844c2c1f7 | ||
|
|
ece49a0f11 | ||
|
|
27e6ef7bc0 | ||
|
|
b67f98a130 | ||
|
|
282ae85ea0 | ||
|
|
808cb099de | ||
|
|
8441803d17 | ||
|
|
8781d47ddb |
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/bin/*
|
||||
!/bin/gemoji
|
||||
.bundle
|
||||
.ruby-version
|
||||
Gemfile.lock
|
||||
db/emoji-test.txt
|
||||
db/ucd.nounihan.grouped.xml
|
||||
images/unicode/*.png
|
||||
vendor/
|
||||
9
.travis.yml
Normal file
9
.travis.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
sudo: false
|
||||
script: script/test
|
||||
rvm:
|
||||
- 1.9.3
|
||||
- '2.1'
|
||||
- '2.2'
|
||||
- 2.3.0
|
||||
notifications:
|
||||
email: false
|
||||
54
CONTRIBUTING.md
Normal file
54
CONTRIBUTING.md
Normal file
@@ -0,0 +1,54 @@
|
||||
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE).
|
||||
|
||||
This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to uphold this code.
|
||||
[code-of-conduct]: http://todogroup.org/opencodeofconduct/#gemoji/opensource@github.com
|
||||
|
||||
Our emoji set is based off Apple's emoji character palette, plus some custom
|
||||
emoji such as :octocat: :shipit: :metal:.
|
||||
|
||||
Some useful tools in development are:
|
||||
|
||||
```
|
||||
script/bootstrap
|
||||
```
|
||||
|
||||
Sets up the development environment. The prerequisites are:
|
||||
|
||||
* Ruby 1.9+
|
||||
* Bundler
|
||||
|
||||
```
|
||||
rake db:generate
|
||||
```
|
||||
|
||||
On OS X, this will rebuild the `db/Category-Emoji.json` file from the system
|
||||
one, pulling in any new emoji that Apple may have added in the meantime.
|
||||
|
||||
```
|
||||
script/test
|
||||
```
|
||||
|
||||
Runs the test suite, including the integrity test where we assert that we have
|
||||
covered each of Apple's emoji.
|
||||
|
||||
```
|
||||
script/regenerate
|
||||
```
|
||||
|
||||
Rebuilds the `db/emoji.json` file which is our main list of emoji: their
|
||||
canonical representations, descriptions, aliases, and tags. This requires OS X
|
||||
because Safari is used in the process to verify which character render as emoji
|
||||
and which render as ordinary Unicode glyphs from the current font.
|
||||
|
||||
```
|
||||
script/console
|
||||
```
|
||||
|
||||
Opens `irb` console with gemoji library preloded for experimentation.
|
||||
|
||||
```
|
||||
script/release
|
||||
```
|
||||
|
||||
For maintainers only: after the gemspec has been edited, this commits the
|
||||
change, tags a release, and pushes it to both GitHub and RubyGems.org.
|
||||
6
Gemfile
Normal file
6
Gemfile
Normal file
@@ -0,0 +1,6 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "rake", "~> 10.3.2"
|
||||
gem "minitest", "~> 5.3.5"
|
||||
|
||||
gemspec
|
||||
26
LICENSE
26
LICENSE
@@ -10,5 +10,27 @@ Copyright (c) 2013 id Software. All rights reserved.
|
||||
trollface
|
||||
Copyright (c) 2013 whynne@deviantart. All rights reserved.
|
||||
|
||||
All other images
|
||||
Copyright (c) 2013 Apple Inc. All rights reserved.
|
||||
Source code:
|
||||
|
||||
Copyright (c) 2013 GitHub, Inc.
|
||||
|
||||
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.
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# Maintainers
|
||||
|
||||
## Releasing a new gem
|
||||
|
||||
If you are just adding new emoji or making a small fix, only increment the patch level "1.0.x". If you need to rename a ton of emojis or making any other radical (but still mostly backwards compatible changes), bump the minor version "1.x.x".
|
||||
|
||||
### Make a release commit
|
||||
|
||||
To prepare the release commit, edit the [gemoji.gemspec](https://github.com/github/gemoji/blob/master/gemoji.gemspec) `version` value. Then make a single commit with the description as "Gemoji 1.x.x". Finally, tag the commit with `v1.x.x`.
|
||||
|
||||
Example commit https://github.com/github/gemoji/commit/v1.0.0
|
||||
|
||||
```
|
||||
$ git ci -m "Gemoji 1.0.0"
|
||||
$ git tag v1.0.0
|
||||
$ git push
|
||||
$ git push --tags
|
||||
```
|
||||
|
||||
### Publish the gem
|
||||
|
||||
Build and push the new gem with
|
||||
|
||||
```
|
||||
$ gem build gemoji.gemspec
|
||||
$ gem push gemoji-1.0.0.gem
|
||||
```
|
||||
112
README.md
112
README.md
@@ -1,63 +1,47 @@
|
||||
gemoji
|
||||
======
|
||||
|
||||
Emoji images and names. See the LICENSE for copyright information.
|
||||
This library contains character information about native emoji, as well as image
|
||||
files for a few custom emoji.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Add `gemoji` to you Gemfile.
|
||||
Add `gemoji` to your Gemfile.
|
||||
|
||||
``` ruby
|
||||
gem 'gemoji'
|
||||
```
|
||||
|
||||
**Sync images**
|
||||
### Extract images
|
||||
|
||||
Images can be copied to your public directory with `rake emoji` in your Rails app. This is the recommended approach since the images will be available at a consistent location. This works best with cached formatted user content generated by tools like [html-pipeline](https://github.com/jch/html-pipeline).
|
||||
To obtain image files as fallbacks for browsers and OS's that don't support
|
||||
emoji, run the `gemoji extract` command **on macOS Sierra or later**:
|
||||
|
||||
``` ruby
|
||||
# Rakefile
|
||||
load 'tasks/emoji.rake'
|
||||
``` sh
|
||||
bundle exec gemoji extract public/images/emoji
|
||||
```
|
||||
|
||||
```
|
||||
$ rake emoji
|
||||
```
|
||||
This will extract images into filenames such as:
|
||||
|
||||
**Assets Precompiling**
|
||||
|
||||
If you must, you can manually add all the images to your asset load path.
|
||||
|
||||
``` ruby
|
||||
# config/application.rb
|
||||
config.assets.paths << Emoji.images_path
|
||||
```
|
||||
|
||||
Then have them compiled to public on deploy.
|
||||
|
||||
``` ruby
|
||||
# config/application.rb
|
||||
config.assets.precompile << "emoji/*.png"
|
||||
```
|
||||
|
||||
**WARNING** Since there are a ton of images, just adding the path may slow down other lookups if you aren't using it. Compiling all the emojis on deploy will add overhead to your deploy if even the images haven't changed. Theres just so many more superfluous files to iterate over. Also, the urls will be fingerprinted which may not be ideal for referencing from cached content.
|
||||
* `public/images/emoji/octocat.png`
|
||||
* `public/images/emoji/unicode/1f9c0.png` (the `:cheese:` emoji)
|
||||
|
||||
|
||||
Example Rails Helper
|
||||
--------------------
|
||||
|
||||
This would allow emojifying content such as: `it's raining :cats: and :dogs:!`
|
||||
This would allow emojifying content such as: `it's raining :cat:s and :dog:s!`
|
||||
|
||||
See the [Emoji cheat sheet](http://www.emoji-cheat-sheet.com) for more examples.
|
||||
|
||||
```ruby
|
||||
module EmojiHelper
|
||||
def emojify(content)
|
||||
h(content).to_str.gsub(/:([a-z0-9\+\-_]+):/) do |match|
|
||||
if Emoji.names.include?($1)
|
||||
'<img alt="' + $1 + '" height="20" src="' + asset_path("emoji/#{$1}.png") + '" style="vertical-align:middle" width="20" />'
|
||||
def emojify(content)
|
||||
h(content).to_str.gsub(/:([\w+-]+):/) do |match|
|
||||
if emoji = Emoji.find_by_alias($1)
|
||||
%(<img alt="#$1" src="#{image_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20" />)
|
||||
else
|
||||
match
|
||||
end
|
||||
@@ -65,3 +49,67 @@ module EmojiHelper
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
Unicode mapping
|
||||
---------------
|
||||
|
||||
Translate emoji names to unicode and vice versa.
|
||||
|
||||
```ruby
|
||||
>> Emoji.find_by_alias("cat").raw
|
||||
=> "🐱" # Don't see a cat? That's U+1F431.
|
||||
|
||||
>> Emoji.find_by_unicode("\u{1f431}").name
|
||||
=> "cat"
|
||||
```
|
||||
|
||||
Adding new emoji
|
||||
----------------
|
||||
|
||||
You can add new emoji characters to the `Emoji.all` list:
|
||||
|
||||
```ruby
|
||||
emoji = Emoji.create("music") do |char|
|
||||
char.add_alias "song"
|
||||
char.add_unicode_alias "\u{266b}"
|
||||
char.add_tag "notes"
|
||||
end
|
||||
|
||||
emoji.name #=> "music"
|
||||
emoji.raw #=> "♫"
|
||||
emoji.image_filename #=> "unicode/266b.png"
|
||||
|
||||
# Creating custom emoji (no Unicode aliases):
|
||||
emoji = Emoji.create("music") do |char|
|
||||
char.add_tag "notes"
|
||||
end
|
||||
|
||||
emoji.custom? #=> true
|
||||
emoji.image_filename #=> "music.png"
|
||||
```
|
||||
|
||||
As you create new emoji, you must ensure that you also create and put the images
|
||||
they reference by their `image_filename` to your assets directory.
|
||||
|
||||
You can customize `image_filename` with:
|
||||
|
||||
```ruby
|
||||
emoji = Emoji.create("music") do |char|
|
||||
char.image_filename = "subdirectory/my_emoji.gif"
|
||||
end
|
||||
```
|
||||
|
||||
For existing emojis, you can edit the list of aliases or add new tags in an edit block:
|
||||
|
||||
```ruby
|
||||
emoji = Emoji.find_by_alias "musical_note"
|
||||
|
||||
Emoji.edit_emoji(emoji) do |char|
|
||||
char.add_alias "music"
|
||||
char.add_unicode_alias "\u{266b}"
|
||||
char.add_tag "notes"
|
||||
end
|
||||
|
||||
Emoji.find_by_alias "music" #=> emoji
|
||||
Emoji.find_by_unicode "\u{266b}" #=> emoji
|
||||
```
|
||||
|
||||
50
Rakefile
50
Rakefile
@@ -1,7 +1,45 @@
|
||||
desc "Checks for missing aliases to unicode sources"
|
||||
task :unnamed do
|
||||
unicodes = Dir["./images/emoji/unicode/*.png"].map { |fn| File.basename(fn) }
|
||||
aliases = Dir["./images/emoji/*.png"].select { |fn| File.symlink?(fn) }.map { |fn| File.basename(fn) }
|
||||
used_unicodes = aliases.map { |name| File.basename(File.readlink("./images/emoji/#{name}")) }.uniq
|
||||
puts unicodes - used_unicodes
|
||||
require 'rake/testtask'
|
||||
|
||||
task :default => :test
|
||||
|
||||
Rake::TestTask.new do |t|
|
||||
t.libs << "test"
|
||||
t.test_files = FileList["test/*_test.rb"]
|
||||
end
|
||||
|
||||
namespace :db do
|
||||
desc %(Generate Emoji data files needed for development)
|
||||
task :generate => [
|
||||
'db/Category-Emoji.json',
|
||||
'db/ucd.nounihan.grouped.xml',
|
||||
'db/emoji-test.txt',
|
||||
]
|
||||
|
||||
desc %(Dump a list of supported Emoji with Unicode descriptions and aliases)
|
||||
task :dump => :generate do
|
||||
system 'ruby', '-Ilib', 'db/dump.rb'
|
||||
end
|
||||
end
|
||||
|
||||
task 'db/Category-Emoji.json' do |t|
|
||||
system 'plutil', '-convert', 'json', '-r',
|
||||
'/System/Library/Input Methods/CharacterPalette.app/Contents/Resources/Category-Emoji.plist',
|
||||
'-o', t.name
|
||||
end
|
||||
|
||||
file 'db/ucd.nounihan.grouped.xml' do
|
||||
Dir.chdir('db') do
|
||||
system 'curl', '-fsSLO', 'http://www.unicode.org/Public/9.0.0/ucdxml/ucd.nounihan.grouped.zip'
|
||||
system 'unzip', '-q', 'ucd.nounihan.grouped.zip'
|
||||
rm 'ucd.nounihan.grouped.zip'
|
||||
end
|
||||
end
|
||||
|
||||
file 'db/emoji-test.txt' do |t|
|
||||
system 'curl', '-fsSL', 'http://unicode.org/Public/emoji/4.0/emoji-test.txt', '-o', t.name
|
||||
end
|
||||
|
||||
directory 'images/unicode' do
|
||||
require 'emoji/extractor'
|
||||
Emoji::Extractor.new(64, Emoji.images_path).extract!
|
||||
end
|
||||
|
||||
5
bin/gemoji
Executable file
5
bin/gemoji
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'emoji/cli'
|
||||
|
||||
exit_code = Emoji::CLI.dispatch(ARGV)
|
||||
exit exit_code
|
||||
71
db/Category-Emoji.json
Normal file
71
db/Category-Emoji.json
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"EmojiDataArray" : [
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-People",
|
||||
"CVCategoryImage" : "Emoji-HumanImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "😀,😃,😄,😁,😆,😅,😂,🤣,☺️,😊,😇,🙂,🙃,😉,😌,😍,😘,😗,😙,😚,😋,😜,😝,😛,🤑,🤗,🤓,😎,🤡,🤠,😏,😒,😞,😔,😟,😕,🙁,☹️,😣,😖,😫,😩,😤,😠,😡,😶,😐,😑,😯,😦,😧,😮,😲,😵,😳,😱,😨,😰,😢,😥,🤤,😭,😓,😪,😴,🙄,🤔,🤥,😬,🤐,🤢,🤧,😷,🤒,🤕,😈,👿,👹,👺,💩,👻,💀,☠️,👽,👾,🤖,🎃,😺,😸,😹,😻,😼,😽,🙀,😿,😾,👐,🙌,👏,🙏,🤝,👍,👎,👊,✊,🤛,🤜,🤞,✌️,🤘,👌,👈,👉,👆,👇,☝️,✋,🤚,🖐,🖖,👋,🤙,💪,🖕,✍️,🤳,💅,💍,💄,💋,👄,👅,👂,👃,👣,👁,👀,🗣,👤,👥,👶,👦,👧,👨,👩,👱♀️,👱,👴,👵,👲,👳♀️,👳,👮♀️,👮,👷♀️,👷,💂♀️,💂,🕵️♀️,🕵️,👩⚕️,👨⚕️,👩🌾,👨🌾,👩🍳,👨🍳,👩🎓,👨🎓,👩🎤,👨🎤,👩🏫,👨🏫,👩🏭,👨🏭,👩💻,👨💻,👩💼,👨💼,👩🔧,👨🔧,👩🔬,👨🔬,👩🎨,👨🎨,👩🚒,👨🚒,👩✈️,👨✈️,👩🚀,👨🚀,👩⚖️,👨⚖️,🤶,🎅,👸,🤴,👰,🤵,👼,🤰,🙇♀️,🙇,💁,💁♂️,🙅,🙅♂️,🙆,🙆♂️,🙋,🙋♂️,🤦♀️,🤦♂️,🤷♀️,🤷♂️,🙎,🙎♂️,🙍,🙍♂️,💇,💇♂️,💆,💆♂️,🕴,💃,🕺,👯,👯♂️,🚶♀️,🚶,🏃♀️,🏃,👫,👭,👬,💑,👩❤️👩,👨❤️👨,💏,👩❤️💋👩,👨❤️💋👨,👪,👨👩👧,👨👩👧👦,👨👩👦👦,👨👩👧👧,👩👩👦,👩👩👧,👩👩👧👦,👩👩👦👦,👩👩👧👧,👨👨👦,👨👨👧,👨👨👧👦,👨👨👦👦,👨👨👧👧,👩👦,👩👧,👩👧👦,👩👦👦,👩👧👧,👨👦,👨👧,👨👧👦,👨👦👦,👨👧👧,👚,👕,👖,👔,👗,👙,👘,👠,👡,👢,👞,👟,👒,🎩,🎓,👑,⛑,🎒,👝,👛,👜,💼,👓,🕶,🌂,☂️"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Nature",
|
||||
"CVCategoryImage" : "Emoji-NatureImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "🐶,🐱,🐭,🐹,🐰,🦊,🐻,🐼,🐨,🐯,🦁,🐮,🐷,🐽,🐸,🐵,🙈,🙉,🙊,🐒,🐔,🐧,🐦,🐤,🐣,🐥,🦆,🦅,🦉,🦇,🐺,🐗,🐴,🦄,🐝,🐛,🦋,🐌,🐚,🐞,🐜,🕷,🕸,🐢,🐍,🦎,🦂,🦀,🦑,🐙,🦐,🐠,🐟,🐡,🐬,🦈,🐳,🐋,🐊,🐆,🐅,🐃,🐂,🐄,🦌,🐪,🐫,🐘,🦏,🦍,🐎,🐖,🐐,🐏,🐑,🐕,🐩,🐈,🐓,🦃,🕊,🐇,🐁,🐀,🐿,🐾,🐉,🐲,🌵,🎄,🌲,🌳,🌴,🌱,🌿,☘️,🍀,🎍,🎋,🍃,🍂,🍁,🍄,🌾,💐,🌷,🌹,🥀,🌻,🌼,🌸,🌺,🌎,🌍,🌏,🌕,🌖,🌗,🌘,🌑,🌒,🌓,🌔,🌚,🌝,🌞,🌛,🌜,🌙,💫,⭐️,🌟,✨,⚡️,🔥,💥,☄️,☀️,🌤,⛅️,🌥,🌦,🌈,☁️,🌧,⛈,🌩,🌨,☃️,⛄️,❄️,🌬,💨,🌪,🌫,🌊,💧,💦,☔️"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Foods",
|
||||
"CVCategoryImage" : "Emoji-FoodsImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "🍏,🍎,🍐,🍊,🍋,🍌,🍉,🍇,🍓,🍈,🍒,🍑,🍍,🥝,🥑,🍅,🍆,🥒,🥕,🌽,🌶,🥔,🍠,🌰,🥜,🍯,🥐,🍞,🥖,🧀,🥚,🍳,🥓,🥞,🍤,🍗,🍖,🍕,🌭,🍔,🍟,🥙,🌮,🌯,🥗,🥘,🍝,🍜,🍲,🍥,🍣,🍱,🍛,🍚,🍙,🍘,🍢,🍡,🍧,🍨,🍦,🍰,🎂,🍮,🍭,🍬,🍫,🍿,🍩,🍪,🥛,🍼,☕️,🍵,🍶,🍺,🍻,🥂,🍷,🥃,🍸,🍹,🍾,🥄,🍴,🍽"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Activity",
|
||||
"CVCategoryImage" : "Emoji-ActivityImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "⚽️,🏀,🏈,⚾️,🎾,🏐,🏉,🎱,🏓,🏸,🥅,🏒,🏑,🏏,⛳️,🏹,🎣,🥊,🥋,⛸,🎿,⛷,🏂,🏋️♀️,🏋️,🤺,🤼♀️,🤼♂️,🤸♀️,🤸♂️,⛹️♀️,⛹️,🤾♀️,🤾♂️,🏌️♀️,🏌️,🏄♀️,🏄,🏊♀️,🏊,🤽♀️,🤽♂️,🚣♀️,🚣,🏇,🚴♀️,🚴,🚵♀️,🚵,🎽,🏅,🎖,🥇,🥈,🥉,🏆,🏵,🎗,🎫,🎟,🎪,🤹♀️,🤹♂️,🎭,🎨,🎬,🎤,🎧,🎼,🎹,🥁,🎷,🎺,🎸,🎻,🎲,🎯,🎳,🎮,🎰"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Places",
|
||||
"CVCategoryImage" : "Emoji-PlacesImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "🚗,🚕,🚙,🚌,🚎,🏎,🚓,🚑,🚒,🚐,🚚,🚛,🚜,🛴,🚲,🛵,🏍,🚨,🚔,🚍,🚘,🚖,🚡,🚠,🚟,🚃,🚋,🚞,🚝,🚄,🚅,🚈,🚂,🚆,🚇,🚊,🚉,🚁,🛩,✈️,🛫,🛬,🚀,🛰,💺,🛶,⛵️,🛥,🚤,🛳,⛴,🚢,⚓️,🚧,⛽️,🚏,🚦,🚥,🗺,🗿,🗽,⛲️,🗼,🏰,🏯,🏟,🎡,🎢,🎠,⛱,🏖,🏝,⛰,🏔,🗻,🌋,🏜,🏕,⛺️,🛤,🛣,🏗,🏭,🏠,🏡,🏘,🏚,🏢,🏬,🏣,🏤,🏥,🏦,🏨,🏪,🏫,🏩,💒,🏛,⛪️,🕌,🕍,🕋,⛩,🗾,🎑,🏞,🌅,🌄,🌠,🎇,🎆,🌇,🌆,🏙,🌃,🌌,🌉,🌁"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Objects",
|
||||
"CVCategoryImage" : "Emoji-ObjectsImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "⌚️,📱,📲,💻,⌨️,🖥,🖨,🖱,🖲,🕹,🗜,💽,💾,💿,📀,📼,📷,📸,📹,🎥,📽,🎞,📞,☎️,📟,📠,📺,📻,🎙,🎚,🎛,⏱,⏲,⏰,🕰,⌛️,⏳,📡,🔋,🔌,💡,🔦,🕯,🗑,🛢,💸,💵,💴,💶,💷,💰,💳,💎,⚖️,🔧,🔨,⚒,🛠,⛏,🔩,⚙️,⛓,🔫,💣,🔪,🗡,⚔️,🛡,🚬,⚰️,⚱️,🏺,🔮,📿,💈,⚗️,🔭,🔬,🕳,💊,💉,🌡,🚽,🚰,🚿,🛁,🛀,🛎,🔑,🗝,🚪,🛋,🛏,🛌,🖼,🛍,🛒,🎁,🎈,🎏,🎀,🎊,🎉,🎎,🏮,🎐,✉️,📩,📨,📧,💌,📥,📤,📦,🏷,📪,📫,📬,📭,📮,📯,📜,📃,📄,📑,📊,📈,📉,🗒,🗓,📆,📅,📇,🗃,🗳,🗄,📋,📁,📂,🗂,🗞,📰,📓,📔,📒,📕,📗,📘,📙,📚,📖,🔖,🔗,📎,🖇,📐,📏,📌,📍,✂️,🖊,🖋,✒️,🖌,🖍,📝,✏️,🔍,🔎,🔏,🔐,🔒,🔓"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Symbols",
|
||||
"CVCategoryImage" : "Emoji-SymbolImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "❤️,💛,💚,💙,💜,🖤,💔,❣️,💕,💞,💓,💗,💖,💘,💝,💟,☮️,✝️,☪️,🕉,☸️,✡️,🔯,🕎,☯️,☦️,🛐,⛎,♈️,♉️,♊️,♋️,♌️,♍️,♎️,♏️,♐️,♑️,♒️,♓️,🆔,⚛️,🉑,☢️,☣️,📴,📳,🈶,🈚️,🈸,🈺,🈷️,✴️,🆚,💮,🉐,㊙️,㊗️,🈴,🈵,🈹,🈲,🅰️,🅱️,🆎,🆑,🅾️,🆘,❌,⭕️,🛑,⛔️,📛,🚫,💯,💢,♨️,🚷,🚯,🚳,🚱,🔞,📵,🚭,❗️,❕,❓,❔,‼️,⁉️,🔅,🔆,〽️,⚠️,🚸,🔱,⚜️,🔰,♻️,✅,🈯️,💹,❇️,✳️,❎,🌐,💠,Ⓜ️,🌀,💤,🏧,🚾,♿️,🅿️,🈳,🈂️,🛂,🛃,🛄,🛅,🚹,🚺,🚼,🚻,🚮,🎦,📶,🈁,🔣,ℹ️,🔤,🔡,🔠,🆖,🆗,🆙,🆒,🆕,🆓,0️⃣,1️⃣,2️⃣,3️⃣,4️⃣,5️⃣,6️⃣,7️⃣,8️⃣,9️⃣,🔟,🔢,#️⃣,*️⃣,▶️,⏸,⏯,⏹,⏺,⏭,⏮,⏩,⏪,⏫,⏬,◀️,🔼,🔽,➡️,⬅️,⬆️,⬇️,↗️,↘️,↙️,↖️,↕️,↔️,↪️,↩️,⤴️,⤵️,🔀,🔁,🔂,🔄,🔃,🎵,🎶,➕,➖,➗,✖️,💲,💱,™️,©️,®️,〰️,➰,➿,🔚,🔙,🔛,🔝,🔜,✔️,☑️,🔘,⚪️,⚫️,🔴,🔵,🔺,🔻,🔸,🔹,🔶,🔷,🔳,🔲,▪️,▫️,◾️,◽️,◼️,◻️,⬛️,⬜️,🔈,🔇,🔉,🔊,🔔,🔕,📣,📢,👁🗨,💬,💭,🗯,♠️,♣️,♥️,♦️,🃏,🎴,🀄️,🕐,🕑,🕒,🕓,🕔,🕕,🕖,🕗,🕘,🕙,🕚,🕛,🕜,🕝,🕞,🕟,🕠,🕡,🕢,🕣,🕤,🕥,🕦,🕧"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Flags",
|
||||
"CVCategoryImage" : "Emoji-FlagsImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "🏳️,🏴,🏁,🚩,🏳️🌈,🇦🇫,🇦🇽,🇦🇱,🇩🇿,🇦🇸,🇦🇩,🇦🇴,🇦🇮,🇦🇶,🇦🇬,🇦🇷,🇦🇲,🇦🇼,🇦🇺,🇦🇹,🇦🇿,🇧🇸,🇧🇭,🇧🇩,🇧🇧,🇧🇾,🇧🇪,🇧🇿,🇧🇯,🇧🇲,🇧🇹,🇧🇴,🇧🇶,🇧🇦,🇧🇼,🇧🇷,🇮🇴,🇻🇬,🇧🇳,🇧🇬,🇧🇫,🇧🇮,🇨🇻,🇰🇭,🇨🇲,🇨🇦,🇮🇨,🇰🇾,🇨🇫,🇹🇩,🇨🇱,🇨🇳,🇨🇽,🇨🇨,🇨🇴,🇰🇲,🇨🇬,🇨🇩,🇨🇰,🇨🇷,🇨🇮,🇭🇷,🇨🇺,🇨🇼,🇨🇾,🇨🇿,🇩🇰,🇩🇯,🇩🇲,🇩🇴,🇪🇨,🇪🇬,🇸🇻,🇬🇶,🇪🇷,🇪🇪,🇪🇹,🇪🇺,🇫🇰,🇫🇴,🇫🇯,🇫🇮,🇫🇷,🇬🇫,🇵🇫,🇹🇫,🇬🇦,🇬🇲,🇬🇪,🇩🇪,🇬🇭,🇬🇮,🇬🇷,🇬🇱,🇬🇩,🇬🇵,🇬🇺,🇬🇹,🇬🇬,🇬🇳,🇬🇼,🇬🇾,🇭🇹,🇭🇳,🇭🇰,🇭🇺,🇮🇸,🇮🇳,🇮🇩,🇮🇷,🇮🇶,🇮🇪,🇮🇲,🇮🇱,🇮🇹,🇯🇲,🇯🇵,🎌,🇯🇪,🇯🇴,🇰🇿,🇰🇪,🇰🇮,🇽🇰,🇰🇼,🇰🇬,🇱🇦,🇱🇻,🇱🇧,🇱🇸,🇱🇷,🇱🇾,🇱🇮,🇱🇹,🇱🇺,🇲🇴,🇲🇰,🇲🇬,🇲🇼,🇲🇾,🇲🇻,🇲🇱,🇲🇹,🇲🇭,🇲🇶,🇲🇷,🇲🇺,🇾🇹,🇲🇽,🇫🇲,🇲🇩,🇲🇨,🇲🇳,🇲🇪,🇲🇸,🇲🇦,🇲🇿,🇲🇲,🇳🇦,🇳🇷,🇳🇵,🇳🇱,🇳🇨,🇳🇿,🇳🇮,🇳🇪,🇳🇬,🇳🇺,🇳🇫,🇲🇵,🇰🇵,🇳🇴,🇴🇲,🇵🇰,🇵🇼,🇵🇸,🇵🇦,🇵🇬,🇵🇾,🇵🇪,🇵🇭,🇵🇳,🇵🇱,🇵🇹,🇵🇷,🇶🇦,🇷🇪,🇷🇴,🇷🇺,🇷🇼,🇧🇱,🇸🇭,🇰🇳,🇱🇨,🇵🇲,🇻🇨,🇼🇸,🇸🇲,🇸🇹,🇸🇦,🇸🇳,🇷🇸,🇸🇨,🇸🇱,🇸🇬,🇸🇽,🇸🇰,🇸🇮,🇸🇧,🇸🇴,🇿🇦,🇬🇸,🇰🇷,🇸🇸,🇪🇸,🇱🇰,🇸🇩,🇸🇷,🇸🇿,🇸🇪,🇨🇭,🇸🇾,🇹🇼,🇹🇯,🇹🇿,🇹🇭,🇹🇱,🇹🇬,🇹🇰,🇹🇴,🇹🇹,🇹🇳,🇹🇷,🇹🇲,🇹🇨,🇹🇻,🇺🇬,🇺🇦,🇦🇪,🇬🇧,🇺🇸,🇻🇮,🇺🇾,🇺🇿,🇻🇺,🇻🇦,🇻🇪,🇻🇳,🇼🇫,🇪🇭,🇾🇪,🇿🇲,🇿🇼"
|
||||
}
|
||||
}
|
||||
],
|
||||
"CVViewFontList" : [
|
||||
"AppleColorEmoji"
|
||||
]
|
||||
}
|
||||
13
db/aliases.applescript
Normal file
13
db/aliases.applescript
Normal file
@@ -0,0 +1,13 @@
|
||||
set jsCode to "document.getElementById('output').value"
|
||||
set json to missing value
|
||||
|
||||
tell application "Safari"
|
||||
repeat
|
||||
set json to (do JavaScript jsCode in current tab of window 1)
|
||||
if (json is not missing value) then exit repeat
|
||||
delay 0.5
|
||||
end repeat
|
||||
close current tab of window 1
|
||||
end tell
|
||||
|
||||
return json
|
||||
86
db/aliases.html
Normal file
86
db/aliases.html
Normal file
@@ -0,0 +1,86 @@
|
||||
<!DOCTYPE html>
|
||||
<title>Emoji alias detection</title>
|
||||
<style>
|
||||
textarea {
|
||||
font-family: monospace;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>Save the following as <tt>emoji.json</tt>:</p>
|
||||
|
||||
<textarea id="output" rows="50" cols="80"></textarea>
|
||||
|
||||
<script>
|
||||
const VARIATION_SELECTOR_16 = /\ufe0f$/
|
||||
|
||||
function detectAliases(db) {
|
||||
const canvas = document.createElement('canvas')
|
||||
|
||||
for (const emoji of db) {
|
||||
const raw = emoji.emoji
|
||||
if (!raw) continue
|
||||
|
||||
const candidates = [raw]
|
||||
if (VARIATION_SELECTOR_16.test(raw)) {
|
||||
candidates.unshift(raw.replace(VARIATION_SELECTOR_16, ''))
|
||||
} else {
|
||||
candidates.push(`${raw}\u{fe0f}`)
|
||||
}
|
||||
|
||||
const newRaw = candidates.filter(e => detectEmoji(canvas, e))[0]
|
||||
|
||||
if (newRaw && newRaw != raw) {
|
||||
emoji.emoji = newRaw
|
||||
console.info('new raw representation found for %s :%s:', raw, emoji.aliases[0])
|
||||
}
|
||||
if (!newRaw) {
|
||||
console.warn('no raw representation for %s :%s:', raw, emoji.aliases[0])
|
||||
}
|
||||
}
|
||||
|
||||
dump(db)
|
||||
}
|
||||
|
||||
function detectEmoji(canvas, emoji) {
|
||||
const context = canvas.getContext('2d')
|
||||
drawEmoji(context, emoji)
|
||||
|
||||
let supported = false
|
||||
const data = context.getImageData(0, 16, 64, 1).data
|
||||
|
||||
for (let x = 0; x <= 64; x++) {
|
||||
if (x <= 32) {
|
||||
// character is supported if there are any colored pixels found
|
||||
if (data[4*x] || data[4*x + 1] || data[4*x + 2]) supported = true
|
||||
} else if (x >= 48 && data[4*x + 3] > 0) {
|
||||
// however, if more than one character got rendered, treat as unsupported
|
||||
supported = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return supported
|
||||
}
|
||||
|
||||
function drawEmoji(context, emoji) {
|
||||
context.clearRect(0, 0, 400, 400)
|
||||
context.fillStyle = '#000'
|
||||
context.textBaseline = 'top'
|
||||
context.font = '32px sans-serif, "Apple Color Emoji", "Segoe UI", "Segoe UI Emoji", "Segoe UI Symbol"'
|
||||
context.fillText(emoji+'___', 0, 0)
|
||||
}
|
||||
|
||||
function dump(db) {
|
||||
var json = JSON.stringify(db, null, ' ')
|
||||
.replace(/^( +)(.+)\[\](,?)$/mg, "$1$2[\n$1]$3")
|
||||
.replace(/,\n( *) /g, "\n$1, ")
|
||||
document.getElementById('output').value = `${json}\n`
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest
|
||||
xhr.onload = function() {
|
||||
detectAliases(JSON.parse(xhr.responseText))
|
||||
};
|
||||
xhr.open('GET', 'emoji.json', false)
|
||||
xhr.send(null)
|
||||
</script>
|
||||
138
db/dump.rb
Normal file
138
db/dump.rb
Normal file
@@ -0,0 +1,138 @@
|
||||
require 'emoji'
|
||||
require 'json'
|
||||
require 'rexml/document'
|
||||
|
||||
class UnicodeCharacter
|
||||
attr_reader :code, :description, :version, :aliases
|
||||
|
||||
class CharListener
|
||||
CHAR_TAG = "char".freeze
|
||||
|
||||
def self.parse(io, &block)
|
||||
REXML::Document.parse_stream(io, self.new(&block))
|
||||
end
|
||||
|
||||
def initialize(&block)
|
||||
@callback = block
|
||||
end
|
||||
|
||||
def tag_start(name, attributes)
|
||||
if CHAR_TAG == name
|
||||
@callback.call(
|
||||
attributes.fetch("cp") { return },
|
||||
attributes.fetch("na") { return },
|
||||
attributes.fetch("age", nil),
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def method_missing(*) end
|
||||
end
|
||||
|
||||
def self.index
|
||||
return @index if defined? @index
|
||||
@index = {}
|
||||
File.open(File.expand_path('../ucd.nounihan.grouped.xml', __FILE__)) do |source|
|
||||
CharListener.parse(source) do |char, desc, age|
|
||||
uc = UnicodeCharacter.new(char, desc, age)
|
||||
@index[uc.code] = uc
|
||||
end
|
||||
end
|
||||
@index
|
||||
end
|
||||
|
||||
def self.fetch(code)
|
||||
code = code.to_s(16).rjust(4, '0') if code.is_a?(Integer)
|
||||
self.index.fetch(code)
|
||||
end
|
||||
|
||||
def initialize(code, description, version)
|
||||
@code = code.downcase
|
||||
@description = description.downcase
|
||||
@version = version
|
||||
@aliases = []
|
||||
@references = []
|
||||
end
|
||||
|
||||
def add_alias(string)
|
||||
@aliases.concat string.split(/\s*,\s*/)
|
||||
end
|
||||
|
||||
def add_reference(code)
|
||||
@references << code.downcase
|
||||
end
|
||||
end
|
||||
|
||||
unless $stdin.tty?
|
||||
codepoints = STDIN.read.chomp.codepoints.map { |code|
|
||||
UnicodeCharacter.fetch(code)
|
||||
}
|
||||
codepoints.each do |char|
|
||||
printf "%5s: %s", char.code.upcase, char.description
|
||||
printf " (%s)", char.version if char.version
|
||||
puts
|
||||
end
|
||||
exit
|
||||
end
|
||||
|
||||
trap(:PIPE) { abort }
|
||||
|
||||
normalize = -> (raw) {
|
||||
raw.sub(Emoji::VARIATION_SELECTOR_16, '')
|
||||
}
|
||||
|
||||
emojidesc = {}
|
||||
File.open(File.expand_path('../emoji-test.txt', __FILE__)) do |file|
|
||||
file.each do |line|
|
||||
next if line =~ /^(#|$)/
|
||||
line = line.chomp.split('# ', 2)[1]
|
||||
emoji, description = line.split(' ', 2)
|
||||
emojidesc[normalize.(emoji)] = description
|
||||
end
|
||||
end
|
||||
|
||||
items = []
|
||||
|
||||
for category, emojis in Emoji.apple_palette
|
||||
for raw in emojis
|
||||
emoji = Emoji.find_by_unicode(raw)
|
||||
unicode_version = emoji ? emoji.unicode_version : ''
|
||||
ios_version = emoji ? emoji.ios_version : ''
|
||||
|
||||
unless raw.include?(Emoji::ZERO_WIDTH_JOINER)
|
||||
uchar = UnicodeCharacter.fetch(raw.codepoints[0])
|
||||
unicode_version = uchar.version unless uchar.version.nil?
|
||||
end
|
||||
|
||||
description = emojidesc.fetch(normalize.(raw))
|
||||
|
||||
if unicode_version == ''
|
||||
warn "#{description} (#{raw}) doesn't have Unicode version"
|
||||
end
|
||||
|
||||
if ios_version == ''
|
||||
ios_version = '10.2'
|
||||
end
|
||||
|
||||
items << {
|
||||
emoji: raw,
|
||||
description: description,
|
||||
category: category,
|
||||
aliases: emoji ? emoji.aliases : [description.gsub(/\W+/, '_').downcase],
|
||||
tags: emoji ? emoji.tags : [],
|
||||
unicode_version: unicode_version,
|
||||
ios_version: ios_version,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
for emoji in Emoji.all.select(&:custom?)
|
||||
items << {
|
||||
aliases: emoji.aliases,
|
||||
tags: emoji.tags,
|
||||
}
|
||||
end
|
||||
|
||||
puts JSON.pretty_generate(items)
|
||||
.gsub("\n\n", "\n")
|
||||
.gsub(/,\n( +)/) { "\n%s, " % $1[2..-1] }
|
||||
17969
db/emoji.json
Normal file
17969
db/emoji.json
Normal file
File diff suppressed because it is too large
Load Diff
113
db/index.html
Normal file
113
db/index.html
Normal file
@@ -0,0 +1,113 @@
|
||||
<!doctype html>
|
||||
<title>Emoji preview</title>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
font: 14px/18px Verdana, Arial, sans-serif;
|
||||
padding: 2em;
|
||||
}
|
||||
ol {
|
||||
list-style: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
li {
|
||||
margin-left: 0;
|
||||
margin-top: 5px;
|
||||
clear: left;
|
||||
}
|
||||
li:first-child { display: none; }
|
||||
li > span {
|
||||
display: block;
|
||||
}
|
||||
.emoji {
|
||||
font-size: 50px;
|
||||
line-height: 50px;
|
||||
float: left;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.description {
|
||||
font-style: italic;
|
||||
color: gray;
|
||||
}
|
||||
.aliases span:before, .aliases span:after {
|
||||
content: ":";
|
||||
color: gray;
|
||||
}
|
||||
.tags {
|
||||
font-size: 11px;
|
||||
}
|
||||
.tags span {
|
||||
display: inline-block;
|
||||
padding: 1px 5px 2px;
|
||||
border-radius: 3px;
|
||||
background: #dadada;
|
||||
line-height: 11px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p><input type=search placeholder="Search..."></p>
|
||||
|
||||
<ol>
|
||||
<li>
|
||||
<span class="emoji"></span>
|
||||
<span class="description"></span>
|
||||
<span class="aliases"></span>
|
||||
<span class="tags"></span>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<script>
|
||||
function renderEmoji(emojis) {
|
||||
var item, els, template = document.querySelector('li')
|
||||
for (var emoji, i=0; i < emojis.length; i++) {
|
||||
emoji = emojis[i]
|
||||
item = template.cloneNode(true)
|
||||
els = item.querySelectorAll('span')
|
||||
if (emoji.emoji) els[0].textContent = emoji.emoji
|
||||
else {
|
||||
var img = document.createElement('img')
|
||||
img.src = "../images/" + emoji.aliases[0] + ".png"
|
||||
els[0].appendChild(img)
|
||||
}
|
||||
els[1].textContent = emoji.description || ''
|
||||
els[2].innerHTML = emoji.aliases.map(function(n){ return '<span>'+n+'</span>' }).join(' ')
|
||||
els[3].innerHTML = emoji.tags.map(function(n){ return '<span>'+n+'</span>' }).join(' ')
|
||||
template.parentNode.appendChild(item)
|
||||
|
||||
item._emojiText = (els[2].textContent + ' ' + els[3].textContent).replace(/_/g, '-')
|
||||
}
|
||||
}
|
||||
|
||||
xhr = new XMLHttpRequest
|
||||
xhr.onreadystatechange = function() {
|
||||
if (this.readyState == 4) {
|
||||
json = JSON.parse(this.responseText)
|
||||
renderEmoji(json)
|
||||
}
|
||||
}
|
||||
xhr.open('GET', 'emoji.json', false)
|
||||
xhr.send(null)
|
||||
|
||||
function searchEmoji(query) {
|
||||
var el,
|
||||
re = new RegExp('\\b' + query),
|
||||
els = document.querySelectorAll('li')
|
||||
|
||||
for (var i=1; i < els.length; i++) {
|
||||
el = els[i]
|
||||
if ( !query || re.test(el._emojiText) ) {
|
||||
el.style.display = 'list-item'
|
||||
} else {
|
||||
el.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var timeout, search = document.querySelector('input[type=search]')
|
||||
search.addEventListener('input', function() {
|
||||
var $this = this
|
||||
if (timeout) clearTimeout(timeout)
|
||||
timeout = setTimeout(function(){ searchEmoji($this.value) }, 200)
|
||||
}, false)
|
||||
search.focus()
|
||||
</script>
|
||||
@@ -1,12 +1,23 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "gemoji"
|
||||
s.version = "1.3.1"
|
||||
s.summary = "Emoji Assets"
|
||||
s.description = "Emoji assets"
|
||||
s.version = "3.0.1"
|
||||
s.summary = "Emoji library"
|
||||
s.description = "Character information and metadata for standard and custom emoji."
|
||||
s.executables = ["gemoji"]
|
||||
|
||||
s.required_ruby_version = '> 1.9'
|
||||
|
||||
s.authors = ["GitHub"]
|
||||
s.email = "support@github.com"
|
||||
s.homepage = "https://github.com/github/gemoji"
|
||||
s.licenses = ["MIT"]
|
||||
|
||||
s.files = Dir["README.md", "images/**/*.png", "lib/**/*.rb", "lib/tasks/*.rake"]
|
||||
s.files = Dir[
|
||||
"README.md",
|
||||
"bin/gemoji",
|
||||
"images/*.png",
|
||||
"db/Category-Emoji.json",
|
||||
"db/emoji.json",
|
||||
"lib/**/*.rb",
|
||||
]
|
||||
end
|
||||
|
||||
BIN
images/basecamp.png
Normal file
BIN
images/basecamp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 898 B |
BIN
images/basecampy.png
Normal file
BIN
images/basecampy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
BIN
images/bowtie.png
Normal file
BIN
images/bowtie.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
@@ -1 +0,0 @@
|
||||
unicode/1f44d.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f44e.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f4af.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f522.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f3b1.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f170.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f18e.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f524.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f521.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f251.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f6a1.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2708.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/23f0.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f47d.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f691.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2693.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f47c.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f4a2.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f620.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f627.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f41c.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f34e.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2652.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2648.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/25c0.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/23ec.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/23eb.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2b07.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f53d.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/25b6.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2935.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2934.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2b05.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2199.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2198.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/27a1.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/21aa.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2b06.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2195.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f53c.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2196.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2197.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f503.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f504.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f3a8.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f69b.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f632.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f45f.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f3e7.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f171.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f476.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f37c.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f424.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f6bc.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f519.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f6c4.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f388.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/2611.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f38d.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f34c.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/203c.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f3e6.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f4ca.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f488.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/26be.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f3c0.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f6c0.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f6c1.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f50b.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f43b.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f41d.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f37a.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f37b.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f41e.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f530.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f514.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f371.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f6b4.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f6b2.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f459.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/1f426.png
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user