Commit 6a06c5cf authored by Connor Shea's avatar Connor Shea

Upgrade Gemojione from 2.6.1 to 3.0.1.

This adds the 2016 emoji as well as support for using SVG images instead of PNGs.

It also fixes a number of incorrectly categorized emoji and other minor issues.

Upgrade Rake task for Gemojione 3.0.0 and generate sprites.

Upgrade aliases.json by pulling down index.json from the gemojione repository and running the generate_aliases.rb file.

Changelog: https://github.com/jonathanwiesel/gemojione/blob/master/CHANGELOG.md#v301-2016-07-16

For the specific emoji added to the Unicode standard, see: http://emojione.com/releases/2.2.4/

Huge kudos to Jonathan Wiesel (@jonathanwiesel) for his work on the gemojione gem!
parent 08264f43
...@@ -34,6 +34,7 @@ v 8.10.0 (unreleased) ...@@ -34,6 +34,7 @@ v 8.10.0 (unreleased)
- Fix issue, preventing users w/o push access to sort tags !5105 (redetection) - Fix issue, preventing users w/o push access to sort tags !5105 (redetection)
- Add Spring EmojiOne updates. - Add Spring EmojiOne updates.
- Fix fetching LFS objects for private CI projects - Fix fetching LFS objects for private CI projects
- Add the new 2016 Emoji! Adds 72 new emoji including bacon, facepalm, and selfie. !5237
- Add syntax for multiline blockquote using `>>>` fence !3954 - Add syntax for multiline blockquote using `>>>` fence !3954
- Fix viewing notification settings when a project is pending deletion - Fix viewing notification settings when a project is pending deletion
- Updated compare dropdown menus to use GL dropdown - Updated compare dropdown menus to use GL dropdown
......
...@@ -223,7 +223,7 @@ gem 'jquery-turbolinks', '~> 2.1.0' ...@@ -223,7 +223,7 @@ gem 'jquery-turbolinks', '~> 2.1.0'
gem 'addressable', '~> 2.3.8' gem 'addressable', '~> 2.3.8'
gem 'bootstrap-sass', '~> 3.3.0' gem 'bootstrap-sass', '~> 3.3.0'
gem 'font-awesome-rails', '~> 4.6.1' gem 'font-awesome-rails', '~> 4.6.1'
gem 'gemojione', '~> 2.6' gem 'gemojione', '~> 3.0'
gem 'gon', '~> 6.0.1' gem 'gon', '~> 6.0.1'
gem 'jquery-atwho-rails', '~> 1.3.2' gem 'jquery-atwho-rails', '~> 1.3.2'
gem 'jquery-rails', '~> 4.1.0' gem 'jquery-rails', '~> 4.1.0'
......
...@@ -255,7 +255,7 @@ GEM ...@@ -255,7 +255,7 @@ GEM
ruby-progressbar (~> 1.4) ruby-progressbar (~> 1.4)
gemnasium-gitlab-service (0.2.6) gemnasium-gitlab-service (0.2.6)
rugged (~> 0.21) rugged (~> 0.21)
gemojione (2.6.1) gemojione (3.0.1)
json json
get_process_mem (0.2.0) get_process_mem (0.2.0)
gherkin-ruby (0.3.2) gherkin-ruby (0.3.2)
...@@ -857,7 +857,7 @@ DEPENDENCIES ...@@ -857,7 +857,7 @@ DEPENDENCIES
foreman (~> 0.78.0) foreman (~> 0.78.0)
fuubar (~> 2.0.0) fuubar (~> 2.0.0)
gemnasium-gitlab-service (~> 0.2) gemnasium-gitlab-service (~> 0.2)
gemojione (~> 2.6) gemojione (~> 3.0)
github-linguist (~> 4.7.0) github-linguist (~> 4.7.0)
github-markup (~> 1.4) github-markup (~> 1.4)
gitlab-flowdock-git-hook (~> 1.0.1) gitlab-flowdock-git-hook (~> 1.0.1)
......
app/assets/images/emoji.png

1000 KB | W: | H:

app/assets/images/emoji.png

1.04 MB | W: | H:

app/assets/images/emoji.png
app/assets/images/emoji.png
app/assets/images/emoji.png
app/assets/images/emoji.png
  • 2-up
  • Swipe
  • Onion skin
app/assets/images/emoji@2x.png

2.38 MB | W: | H:

app/assets/images/emoji@2x.png

2.53 MB | W: | H:

app/assets/images/emoji@2x.png
app/assets/images/emoji@2x.png
app/assets/images/emoji@2x.png
app/assets/images/emoji@2x.png
  • 2-up
  • Swipe
  • Onion skin
This source diff could not be displayed because it is too large. You can view the blob instead.
.emoji-menu .emoji-menu
= text_field_tag :emoji_search, "", class: "emoji-search search-input form-control", placeholder: "Seach emojis" = text_field_tag :emoji_search, "", class: "emoji-search search-input form-control", placeholder: "Search emoji"
.emoji-menu-content .emoji-menu-content
- Gitlab::AwardEmoji.emoji_by_category.each do |category, emojis| - Gitlab::AwardEmoji.emoji_by_category.each do |category, emojis|
%h5.emoji-menu-title %h5.emoji-menu-title
......
...@@ -76,7 +76,7 @@ module Gitlab ...@@ -76,7 +76,7 @@ module Gitlab
# Enable the asset pipeline # Enable the asset pipeline
config.assets.enabled = true config.assets.enabled = true
config.assets.paths << Gemojione.index.images_path config.assets.paths << Gemojione.images_path
config.assets.precompile << "*.png" config.assets.precompile << "*.png"
config.assets.precompile << "print.css" config.assets.precompile << "print.css"
config.assets.precompile << "notify.css" config.assets.precompile << "notify.css"
......
...@@ -53,3 +53,8 @@ Generating a sprite file containing all the Emoji can be done by running: ...@@ -53,3 +53,8 @@ Generating a sprite file containing all the Emoji can be done by running:
``` ```
bundle exec rake gemojione:sprite bundle exec rake gemojione:sprite
``` ```
If new emoji are added, the spritesheet may change size. To compensate for
such changes, first generate the `emoji.png` spritesheet with the above Rake
task, then check the dimensions of the new spritesheet and update the
`SPRITESHEET_WIDTH` and `SPRITESHEET_HEIGHT` constants accordingly.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
module Gitlab module Gitlab
class AwardEmoji class AwardEmoji
CATEGORIES = { CATEGORIES = {
other: "Other",
objects: "Objects", objects: "Objects",
places: "Places", travel: "Travel",
travel_places: "Travel", symbols: "Symbols",
emoticons: "Emoticons",
objects_symbols: "Symbols",
nature: "Nature", nature: "Nature",
celebration: "Celebration",
people: "People", people: "People",
activity: "Activity", activity: "Activity",
flags: "Flags", flags: "Flags",
food_drink: "Food" food: "Food"
}.with_indifferent_access
CATEGORY_ALIASES = {
symbols: "objects_symbols",
foods: "food_drink",
travel: "travel_places"
}.with_indifferent_access }.with_indifferent_access
def self.normalize_emoji_name(name) def self.normalize_emoji_name(name)
...@@ -35,7 +25,7 @@ module Gitlab ...@@ -35,7 +25,7 @@ module Gitlab
# Skip Fitzpatrick(tone) modifiers # Skip Fitzpatrick(tone) modifiers
next if data["category"] == "modifier" next if data["category"] == "modifier"
category = CATEGORY_ALIASES[data["category"]] || data["category"] category = data["category"]
@emoji_by_category[category] << data @emoji_by_category[category] << data
end end
...@@ -57,9 +47,9 @@ module Gitlab ...@@ -57,9 +47,9 @@ module Gitlab
def self.aliases def self.aliases
@aliases ||= @aliases ||=
begin begin
json_path = File.join(Rails.root, 'fixtures', 'emojis', 'aliases.json' ) json_path = File.join(Rails.root, 'fixtures', 'emojis', 'aliases.json')
JSON.parse(File.read(json_path)) JSON.parse(File.read(json_path))
end end
end end
# Returns an Array of Emoji names and their asset URLs. # Returns an Array of Emoji names and their asset URLs.
......
...@@ -4,7 +4,7 @@ namespace :gemojione do ...@@ -4,7 +4,7 @@ namespace :gemojione do
require 'digest/sha2' require 'digest/sha2'
require 'json' require 'json'
dir = Gemojione.index.images_path dir = Gemojione.images_path
digests = [] digests = []
aliases = Hash.new { |hash, key| hash[key] = [] } aliases = Hash.new { |hash, key| hash[key] = [] }
aliases_path = File.join(Rails.root, 'fixtures', 'emojis', 'aliases.json') aliases_path = File.join(Rails.root, 'fixtures', 'emojis', 'aliases.json')
...@@ -50,9 +50,14 @@ namespace :gemojione do ...@@ -50,9 +50,14 @@ namespace :gemojione do
SIZE = 20 SIZE = 20
RETINA = SIZE * 2 RETINA = SIZE * 2
# Update these values to the width and height of the spritesheet when
# new emoji are added.
SPRITESHEET_WIDTH = 860
SPRITESHEET_HEIGHT = 840
Dir.mktmpdir do |tmpdir| Dir.mktmpdir do |tmpdir|
# Copy the Gemojione assets to the temporary folder for resizing # Copy the Gemojione assets to the temporary folder for resizing
FileUtils.cp_r(Gemojione.index.images_path, tmpdir) FileUtils.cp_r(Gemojione.images_path, tmpdir)
Dir.chdir(tmpdir) do Dir.chdir(tmpdir) do
Dir["**/*.png"].each do |png| Dir["**/*.png"].each do |png|
...@@ -64,7 +69,7 @@ namespace :gemojione do ...@@ -64,7 +69,7 @@ namespace :gemojione do
# Combine the resized assets into a packed sprite and re-generate the SCSS # Combine the resized assets into a packed sprite and re-generate the SCSS
SpriteFactory.cssurl = "image-url('$IMAGE')" SpriteFactory.cssurl = "image-url('$IMAGE')"
SpriteFactory.run!(File.join(tmpdir, 'images'), { SpriteFactory.run!(File.join(tmpdir, 'png'), {
output_style: style_path, output_style: style_path,
output_image: "app/assets/images/emoji.png", output_image: "app/assets/images/emoji.png",
selector: '.emoji-', selector: '.emoji-',
...@@ -97,7 +102,7 @@ namespace :gemojione do ...@@ -97,7 +102,7 @@ namespace :gemojione do
only screen and (min-resolution: 192dpi), only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) { only screen and (min-resolution: 2dppx) {
background-image: image-url('emoji@2x.png'); background-image: image-url('emoji@2x.png');
background-size: 840px 820px; background-size: #{SPRITESHEET_WIDTH}px #{SPRITESHEET_HEIGHT}px;
} }
} }
CSS CSS
...@@ -107,7 +112,7 @@ namespace :gemojione do ...@@ -107,7 +112,7 @@ namespace :gemojione do
# Now do it again but for Retina # Now do it again but for Retina
Dir.mktmpdir do |tmpdir| Dir.mktmpdir do |tmpdir|
# Copy the Gemojione assets to the temporary folder for resizing # Copy the Gemojione assets to the temporary folder for resizing
FileUtils.cp_r(Gemojione.index.images_path, tmpdir) FileUtils.cp_r(Gemojione.images_path, tmpdir)
Dir.chdir(tmpdir) do Dir.chdir(tmpdir) do
Dir["**/*.png"].each do |png| Dir["**/*.png"].each do |png|
...@@ -116,7 +121,7 @@ namespace :gemojione do ...@@ -116,7 +121,7 @@ namespace :gemojione do
end end
# Combine the resized assets into a packed sprite and re-generate the SCSS # Combine the resized assets into a packed sprite and re-generate the SCSS
SpriteFactory.run!(File.join(tmpdir, 'images'), { SpriteFactory.run!(File.join(tmpdir), {
output_image: "app/assets/images/emoji@2x.png", output_image: "app/assets/images/emoji@2x.png",
style: false, style: false,
nocomments: true, nocomments: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment