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!
This commit is contained in:
Connor Shea 2016-07-13 08:43:42 -06:00
parent 08264f4334
commit 6a06c5cfb9
No known key found for this signature in database
GPG Key ID: E52237E5B35A83E6
14 changed files with 11380 additions and 7074 deletions

View File

@ -34,6 +34,7 @@ v 8.10.0 (unreleased)
- Fix issue, preventing users w/o push access to sort tags !5105 (redetection)
- Add Spring EmojiOne updates.
- 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
- Fix viewing notification settings when a project is pending deletion
- Updated compare dropdown menus to use GL dropdown

View File

@ -223,7 +223,7 @@ gem 'jquery-turbolinks', '~> 2.1.0'
gem 'addressable', '~> 2.3.8'
gem 'bootstrap-sass', '~> 3.3.0'
gem 'font-awesome-rails', '~> 4.6.1'
gem 'gemojione', '~> 2.6'
gem 'gemojione', '~> 3.0'
gem 'gon', '~> 6.0.1'
gem 'jquery-atwho-rails', '~> 1.3.2'
gem 'jquery-rails', '~> 4.1.0'

View File

@ -255,7 +255,7 @@ GEM
ruby-progressbar (~> 1.4)
gemnasium-gitlab-service (0.2.6)
rugged (~> 0.21)
gemojione (2.6.1)
gemojione (3.0.1)
json
get_process_mem (0.2.0)
gherkin-ruby (0.3.2)
@ -857,7 +857,7 @@ DEPENDENCIES
foreman (~> 0.78.0)
fuubar (~> 2.0.0)
gemnasium-gitlab-service (~> 0.2)
gemojione (~> 2.6)
gemojione (~> 3.0)
github-linguist (~> 4.7.0)
github-markup (~> 1.4)
gitlab-flowdock-git-hook (~> 1.0.1)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1002 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
.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
- Gitlab::AwardEmoji.emoji_by_category.each do |category, emojis|
%h5.emoji-menu-title

View File

@ -76,7 +76,7 @@ module Gitlab
# Enable the asset pipeline
config.assets.enabled = true
config.assets.paths << Gemojione.index.images_path
config.assets.paths << Gemojione.images_path
config.assets.precompile << "*.png"
config.assets.precompile << "print.css"
config.assets.precompile << "notify.css"

View File

@ -53,3 +53,8 @@ Generating a sprite file containing all the Emoji can be done by running:
```
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.

View File

@ -1,16 +1,9 @@
{
"northeast_pointing_airplane":"airplane_northeast",
"small_airplane":"airplane_small",
"up_pointing_small_airplane":"airplane_small_up",
"up_pointing_airplane":"airplane_up",
"left_anger_bubble":"anger_left",
"right_anger_bubble":"anger_right",
"keycap_asterisk":"asterisk",
"atom_symbol":"atom",
"ballot_box_with_ballot":"ballot_box",
"ballot_box_with_bold_check":"ballot_box_check",
"ballot_box_with_script_x":"ballot_box_x",
"ballot_script_x":"ballot_x",
"person_with_ball":"basketball_player",
"person_with_ball_tone1":"basketball_player_tone1",
"person_with_ball_tone2":"basketball_player_tone2",
@ -21,51 +14,65 @@
"umbrella_on_ground":"beach_umbrella",
"bellhop_bell":"bellhop",
"biohazard_sign":"biohazard",
"bouquet_of_flowers":"bouquet2",
"archery":"bow_and_arrow",
"bullhorn_with_sound_waves":"bullhorn_waves",
"pocket calculator":"calculator",
"boxing_gloves":"boxing_glove",
"spiral_calendar_pad":"calendar_spiral",
"call_me_hand":"call_me",
"call_me_hand_tone1":"call_me_tone1",
"call_me_hand_tone2":"call_me_tone2",
"call_me_hand_tone3":"call_me_tone3",
"call_me_hand_tone4":"call_me_tone4",
"call_me_hand_tone5":"call_me_tone5",
"kayak":"canoe",
"card_file_box":"card_box",
"tape_cartridge":"cartridge",
"person_doing_cartwheel":"cartwheel",
"person_doing_cartwheel_tone1":"cartwheel_tone1",
"person_doing_cartwheel_tone2":"cartwheel_tone2",
"person_doing_cartwheel_tone3":"cartwheel_tone3",
"person_doing_cartwheel_tone4":"cartwheel_tone4",
"person_doing_cartwheel_tone5":"cartwheel_tone5",
"bottle_with_popping_cork":"champagne",
"clinking_glass":"champagne_glass",
"cheese_wedge":"cheese",
"city_sunrise":"city_sunset",
"mantlepiece_clock":"clock",
"clockwise_right_and_left_semicircle_arrows":"clockwise_arrows",
"cloud_with_lightning":"cloud_lightning",
"cloud_with_rain":"cloud_rain",
"cloud_with_snow":"cloud_snow",
"cloud_with_tornado":"cloud_tornado",
"old_personal_computer":"computer_old",
"building_construction":"contruction_site",
"clown_face":"clown",
"building_construction":"construction_site",
"couch_and_lamp":"couch",
"couple_with_heart_mm":"couple_mm",
"couple_with_heart_ww":"couple_ww",
"face_with_cowboy_hat":"cowboy",
"lower_left_crayon":"crayon",
"cricket_bat_ball":"cricket",
"latin_cross":"cross",
"heavy_latin_cross":"cross_heavy",
"white_latin_cross":"cross_white",
"black_skull_and_crossbones":"crossbones",
"passenger_ship":"cruise_ship",
"dagger_knife":"dagger",
"desktop_computer":"desktop",
"card_index_dividers":"dividers",
"document_with_text":"document_text",
"dove_of_peace":"dove",
"drool":"drooling_face",
"drum_with_drumsticks":"drum",
"email":"e-mail",
"back_of_envelope":"envelope_back",
"flying_envelope":"envelope_flying",
"stamped_envelope":"envelope_stamped",
"pen_over_stamped_envelope":"envelope_stamped_pen",
"white_down_pointing_left_hand_index":"finger_pointing_down",
"sideways_white_down_pointing_index":"finger_pointing_down2",
"sideways_white_left_pointing_index":"finger_pointing_left",
"sideways_white_right_pointing_index":"finger_pointing_right",
"sideways_white_up_pointing_index":"finger_pointing_up",
"eject_symbol":"eject",
"facepalm":"face_palm",
"facepalm_tone1":"face_palm_tone1",
"facepalm_tone2":"face_palm_tone2",
"facepalm_tone3":"face_palm_tone3",
"facepalm_tone4":"face_palm_tone4",
"facepalm_tone5":"face_palm_tone5",
"fencing":"fencer",
"hand_with_index_and_middle_finger_crossed":"fingers_crossed",
"hand_with_index_and_middle_fingers_crossed_tone1":"fingers_crossed_tone1",
"hand_with_index_and_middle_fingers_crossed_tone2":"fingers_crossed_tone2",
"hand_with_index_and_middle_fingers_crossed_tone3":"fingers_crossed_tone3",
"hand_with_index_and_middle_fingers_crossed_tone4":"fingers_crossed_tone4",
"hand_with_index_and_middle_fingers_crossed_tone5":"fingers_crossed_tone5",
"flame":"fire",
"oncoming_fire_engine":"fire_engine_oncoming",
"first_place_medal":"first_place",
"ac":"flag_ac",
"ad":"flag_ad",
"ae":"flag_ae",
@ -326,44 +333,51 @@
"za":"flag_za",
"zm":"flag_zm",
"zw":"flag_zw",
"clamshell_mobile_phone":"flip_phone",
"black_hard_shell_floppy_disk":"floppy_black",
"white_hard_shell_floppy_disk":"floppy_white",
"open_folder":"folder_open",
"fork_and_knife_with_plate":"fork_knife_plate",
"fox_face":"fox",
"frame_with_picture":"frame_photo",
"frame_with_tiles":"frame_tiles",
"frame_with_an_x":"frame_x",
"baguette_bread":"french_bread",
"anguished":"frowning",
"white_frowning_face":"frowning2",
"goal_net":"goal",
"hammer_and_pick":"hammer_pick",
"raised_hand_with_fingers_splayed":"hand_splayed",
"reversed_raised_hand_with_fingers_splayed":"hand_splayed_reverse",
"raised_hand_with_fingers_splayed_tone1":"hand_splayed_tone1",
"raised_hand_with_fingers_splayed_tone2":"hand_splayed_tone2",
"raised_hand_with_fingers_splayed_tone3":"hand_splayed_tone3",
"raised_hand_with_fingers_splayed_tone4":"hand_splayed_tone4",
"raised_hand_with_fingers_splayed_tone5":"hand_splayed_tone5",
"reversed_victory_hand":"hand_victory",
"shaking_hands":"handshake",
"shaking_hands_tone1":"handshake_tone1",
"shaking_hands_tone2":"handshake_tone2",
"shaking_hands_tone3":"handshake_tone3",
"shaking_hands_tone4":"handshake_tone4",
"shaking_hands_tone5":"handshake_tone5",
"face_with_head_bandage":"head_bandage",
"heavy_heart_exclamation_mark_ornament":"heart_exclamation",
"heart_with_tip_on_the_left":"heart_tip",
"helmet_with_white_cross":"helmet_with_cross",
"house_buildings":"homes",
"hot_dog":"hotdog",
"derelict_house_building":"house_abandoned",
"hugging_face":"hugging",
"circled_information_source":"info",
"desert_island":"island",
"up_pointing_military_airplane":"jet_up",
"juggler":"juggling",
"juggler_tone1":"juggling_tone1",
"juggler_tone2":"juggling_tone2",
"juggler_tone3":"juggling_tone3",
"juggler_tone4":"juggling_tone4",
"juggler_tone5":"juggling_tone5",
"old_key":"key2",
"wired_keyboard":"keyboard",
"keyboard_and_mouse":"keyboard_mouse",
"musical_keyboard_with_jacks":"keyboard_with_jacks",
"couplekiss_mm":"kiss_mm",
"couplekiss_ww":"kiss_ww",
"kiwifruit":"kiwi",
"satisfied":"laughing",
"left_hand_telephone_receiver":"left_receiver",
"left_fist":"left_facing_fist",
"left_fist_tone1":"left_facing_fist_tone1",
"left_fist_tone2":"left_facing_fist_tone2",
"left_fist_tone3":"left_facing_fist_tone3",
"left_fist_tone4":"left_facing_fist_tone4",
"left_fist_tone5":"left_facing_fist_tone5",
"man_in_business_suit_levitating":"levitate",
"weight_lifter":"lifter",
"weight_lifter_tone1":"lifter_tone1",
@ -371,9 +385,21 @@
"weight_lifter_tone3":"lifter_tone3",
"weight_lifter_tone4":"lifter_tone4",
"weight_lifter_tone5":"lifter_tone5",
"light_mark":"light_check_mark",
"lion":"lion_face",
"liar":"lying_face",
"male_dancer":"man_dancing",
"male_dancer_tone1":"man_dancing_tone1",
"male_dancer_tone2":"man_dancing_tone2",
"male_dancer_tone3":"man_dancing_tone3",
"male_dancer_tone4":"man_dancing_tone4",
"male_dancer_tone5":"man_dancing_tone5",
"tuxedo_tone1":"man_in_tuxedo_tone1",
"tuxedo_tone2":"man_in_tuxedo_tone2",
"tuxedo_tone3":"man_in_tuxedo_tone3",
"tuxedo_tone4":"man_in_tuxedo_tone4",
"tuxedo_tone5":"man_in_tuxedo_tone5",
"world_map":"map",
"karate_uniform":"martial_arts_uniform",
"sports_medal":"medal",
"sign_of_the_horns":"metal",
"sign_of_the_horns_tone1":"metal_tone1",
@ -388,21 +414,23 @@
"reversed_hand_with_middle_finger_extended_tone3":"middle_finger_tone3",
"reversed_hand_with_middle_finger_extended_tone4":"middle_finger_tone4",
"reversed_hand_with_middle_finger_extended_tone5":"middle_finger_tone5",
"glass_of_milk":"milk",
"money_mouth_face":"money_mouth",
"lightning_mood_bubble":"mood_bubble_lightning",
"lightning_mood":"mood_lightning",
"motorbike":"motor_scooter",
"racing_motorcycle":"motorcycle",
"snow_capped_mountain":"mountain_snow",
"one_button_mouse":"mouse_one",
"three_button_mouse":"mouse_three_button",
"mother_christmas":"mrs_claus",
"mother_christmas_tone1":"mrs_claus_tone1",
"mother_christmas_tone2":"mrs_claus_tone2",
"mother_christmas_tone3":"mrs_claus_tone3",
"mother_christmas_tone4":"mrs_claus_tone4",
"mother_christmas_tone5":"mrs_claus_tone5",
"sick":"nauseated_face",
"nerd_face":"nerd",
"three_networked_computers":"network",
"rolled_up_newspaper":"newspaper2",
"note_page":"note",
"empty_note_page":"note_empty",
"note_pad":"notepad",
"empty_note_pad":"notepad_empty",
"spiral_note_pad":"notepad_spiral",
"stop_sign":"octagonal_sign",
"oil_drum":"oil",
"grandma":"older_woman",
"grandma_tone1":"older_woman_tone1",
@ -410,57 +438,66 @@
"grandma_tone3":"older_woman_tone3",
"grandma_tone4":"older_woman_tone4",
"grandma_tone5":"older_woman_tone5",
"optical_disc_icon":"optical_disk",
"lower_left_paintbrush":"paintbrush",
"linked_paperclips":"paperclips",
"national_park":"park",
"double_vertical_bar":"pause_button",
"peace_symbol":"peace",
"shelled_peanut":"peanuts",
"lower_left_ballpoint_pen":"pen_ballpoint",
"lower_left_fountain_pen":"pen_fountain",
"memo":"pencil",
"lower_left_pencil":"pencil3",
"black_pennant":"pennant_black",
"white_pennant":"pennant_white",
"table_tennis":"ping_pong",
"no_piracy":"piracy",
"worship_symbol":"place_of_worship",
"shit":"poop",
"hankey":"poop",
"poo":"poop",
"prohibited_sign":"prohibited",
"expecting_woman":"pregnant_woman",
"expecting_woman_tone1":"pregnant_woman_tone1",
"expecting_woman_tone2":"pregnant_woman_tone2",
"expecting_woman_tone3":"pregnant_woman_tone3",
"expecting_woman_tone4":"pregnant_woman_tone4",
"expecting_woman_tone5":"pregnant_woman_tone5",
"film_projector":"projector",
"racing_car":"race_car",
"radioactive_sign":"radioactive",
"railroad_track":"railway_track",
"right_speaker_with_one_sound_wave":"right_speaker_one",
"right_speaker_with_three_sound_waves":"right_speaker_three",
"back_of_hand":"raised_back_of_hand",
"back_of_hand_tone1":"raised_back_of_hand_tone1",
"back_of_hand_tone2":"raised_back_of_hand_tone2",
"back_of_hand_tone3":"raised_back_of_hand_tone3",
"back_of_hand_tone4":"raised_back_of_hand_tone4",
"back_of_hand_tone5":"raised_back_of_hand_tone5",
"rhinoceros":"rhino",
"right_fist":"right_facing_fist",
"right_fist_tone1":"right_facing_fist_tone1",
"right_fist_tone2":"right_facing_fist_tone2",
"right_fist_tone3":"right_facing_fist_tone3",
"right_fist_tone4":"right_facing_fist_tone4",
"right_fist_tone5":"right_facing_fist_tone5",
"robot_face":"robot",
"rolling_on_the_floor_laughing":"rofl",
"face_with_rolling_eyes":"rolling_eyes",
"green_salad":"salad",
"second_place_medal":"second_place",
"paella":"shallow_pan_of_food",
"shopping_trolley":"shopping_cart",
"skeleton":"skull",
"skull_and_crossbones":"skull_crossbones",
"slightly_frowning_face":"slight_frown",
"slightly_smiling_face":"slight_smile",
"sneeze":"sneezing_face",
"speaking_head_in_silhouette":"speaking_head",
"left_speech_bubble":"speech_left",
"right_speech_bubble":"speech_right",
"three_speech_bubbles":"speech_three",
"two_speech_bubbles":"speech_two",
"sleuth_or_spy":"spy",
"sleuth_or_spy_tone1":"spy_tone1",
"sleuth_or_spy_tone2":"spy_tone2",
"sleuth_or_spy_tone3":"spy_tone3",
"sleuth_or_spy_tone4":"spy_tone4",
"sleuth_or_spy_tone5":"spy_tone5",
"portable_stereo":"stereo",
"black_touchtone_telephone":"telephone_black",
"white_touchtone_telephone":"telephone_white",
"stuffed_pita":"stuffed_flatbread",
"face_with_thermometer":"thermometer_face",
"thinking_face":"thinking",
"left_thought_bubble":"thought_left",
"right_thought_bubble":"thought_right",
"reversed_thumbs_down_sign":"thumbs_down_reverse",
"reversed_thumbs_up_sign":"thumbs_up_reverse",
"third_place_medal":"third_place",
"-1":"thumbsdown",
"-1_tone1":"thumbsdown_tone1",
"-1_tone2":"thumbsdown_tone2",
@ -479,9 +516,7 @@
"hammer_and_wrench":"tools",
"next_track":"track_next",
"previous_track":"track_previous",
"diesel_locomotive":"train_diesel",
"triangle_with_rounded_corners":"triangle_round",
"turned_ok_hand_sign":"turned_ok_hand",
"whisky":"tumbler_glass",
"unicorn_face":"unicorn",
"upside_down_face":"upside_down",
"funeral_urn":"urn",
@ -494,6 +529,12 @@
"white_sun_behind_cloud":"white_sun_cloud",
"white_sun_behind_cloud_with_rain":"white_sun_rain_cloud",
"white_sun_with_small_cloud":"white_sun_small_cloud",
"left_writing_hand":"writing_hand",
"wilted_flower":"wilted_rose",
"wrestling":"wrestlers",
"wrestling_tone1":"wrestlers_tone1",
"wrestling_tone2":"wrestlers_tone2",
"wrestling_tone3":"wrestlers_tone3",
"wrestling_tone4":"wrestlers_tone4",
"wrestling_tone5":"wrestlers_tone5",
"zipper_mouth_face":"zipper_mouth"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,14 @@
module Gitlab
class AwardEmoji
CATEGORIES = {
other: "Other",
objects: "Objects",
places: "Places",
travel_places: "Travel",
emoticons: "Emoticons",
objects_symbols: "Symbols",
travel: "Travel",
symbols: "Symbols",
nature: "Nature",
celebration: "Celebration",
people: "People",
activity: "Activity",
flags: "Flags",
food_drink: "Food"
}.with_indifferent_access
CATEGORY_ALIASES = {
symbols: "objects_symbols",
foods: "food_drink",
travel: "travel_places"
food: "Food"
}.with_indifferent_access
def self.normalize_emoji_name(name)
@ -35,7 +25,7 @@ module Gitlab
# Skip Fitzpatrick(tone) modifiers
next if data["category"] == "modifier"
category = CATEGORY_ALIASES[data["category"]] || data["category"]
category = data["category"]
@emoji_by_category[category] << data
end
@ -57,9 +47,9 @@ module Gitlab
def self.aliases
@aliases ||=
begin
json_path = File.join(Rails.root, 'fixtures', 'emojis', 'aliases.json' )
JSON.parse(File.read(json_path))
end
json_path = File.join(Rails.root, 'fixtures', 'emojis', 'aliases.json')
JSON.parse(File.read(json_path))
end
end
# Returns an Array of Emoji names and their asset URLs.

View File

@ -4,7 +4,7 @@ namespace :gemojione do
require 'digest/sha2'
require 'json'
dir = Gemojione.index.images_path
dir = Gemojione.images_path
digests = []
aliases = Hash.new { |hash, key| hash[key] = [] }
aliases_path = File.join(Rails.root, 'fixtures', 'emojis', 'aliases.json')
@ -50,9 +50,14 @@ namespace :gemojione do
SIZE = 20
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|
# 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["**/*.png"].each do |png|
@ -64,7 +69,7 @@ namespace :gemojione do
# Combine the resized assets into a packed sprite and re-generate the SCSS
SpriteFactory.cssurl = "image-url('$IMAGE')"
SpriteFactory.run!(File.join(tmpdir, 'images'), {
SpriteFactory.run!(File.join(tmpdir, 'png'), {
output_style: style_path,
output_image: "app/assets/images/emoji.png",
selector: '.emoji-',
@ -97,7 +102,7 @@ namespace :gemojione do
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
background-image: image-url('emoji@2x.png');
background-size: 840px 820px;
background-size: #{SPRITESHEET_WIDTH}px #{SPRITESHEET_HEIGHT}px;
}
}
CSS
@ -107,7 +112,7 @@ namespace :gemojione do
# Now do it again but for Retina
Dir.mktmpdir do |tmpdir|
# 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["**/*.png"].each do |png|
@ -116,7 +121,7 @@ namespace :gemojione do
end
# 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",
style: false,
nocomments: true,