Merge branch 'rs-emoji' into 'master'

Update Gemojione for new hotness 

Before | After
------ | -----
![Screen_Shot_2016-02-12_at_3.38.43_PM](/uploads/299e5ffe38c91657085741261a678f81/Screen_Shot_2016-02-12_at_3.38.43_PM.png) | ![Screen_Shot_2016-02-12_at_3.38.09_PM](/uploads/ccee29719a6445a9efd2498391a7eea0/Screen_Shot_2016-02-12_at_3.38.09_PM.png)

See merge request !2800
This commit is contained in:
Douwe Maan 2016-02-19 08:11:02 +00:00
commit ad12f11f3e
13 changed files with 20104 additions and 3052 deletions

View file

@ -204,7 +204,7 @@ gem 'jquery-turbolinks', '~> 2.1.0'
gem 'addressable', '~> 2.3.8'
gem 'bootstrap-sass', '~> 3.3.0'
gem 'font-awesome-rails', '~> 4.2'
gem 'gitlab_emoji', '~> 0.2.0'
gem 'gitlab_emoji', '~> 0.3.0'
gem 'gon', '~> 6.0.1'
gem 'jquery-atwho-rails', '~> 1.3.2'
gem 'jquery-rails', '~> 4.0.0'

View file

@ -336,7 +336,7 @@ GEM
ruby-progressbar (~> 1.4)
gemnasium-gitlab-service (0.2.6)
rugged (~> 0.21)
gemojione (2.1.1)
gemojione (2.2.1)
json
get_process_mem (0.2.0)
gherkin-ruby (0.3.2)
@ -355,8 +355,8 @@ GEM
diff-lcs (~> 1.1)
mime-types (~> 1.15)
posix-spawn (~> 0.3)
gitlab_emoji (0.2.0)
gemojione (~> 2.1)
gitlab_emoji (0.3.1)
gemojione (~> 2.2, >= 2.2.1)
gitlab_git (8.1.0)
activesupport (~> 4.0)
charlock_holmes (~> 0.7.3)
@ -931,7 +931,7 @@ DEPENDENCIES
github-linguist (~> 4.7.0)
github-markup (~> 1.3.1)
gitlab-flowdock-git-hook (~> 1.0.1)
gitlab_emoji (~> 0.2.0)
gitlab_emoji (~> 0.3.0)
gitlab_git (~> 8.1)
gitlab_meta (= 7.0)
gitlab_omniauth-ldap (~> 1.2.1)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 813 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

File diff suppressed because it is too large Load diff

View file

@ -236,7 +236,7 @@ class ProjectsController < ApplicationController
Emoji.emojis.map do |name, emoji|
{
name: name,
path: view_context.image_url("emoji/#{emoji["unicode"]}.png")
path: view_context.image_url("#{emoji["unicode"]}.png")
}
end
end

View file

@ -118,12 +118,6 @@ module ApplicationHelper
grouped_options_for_select(options, @ref || @project.default_branch)
end
def emoji_autocomplete_source
# should be an array of strings
# so to_s can be called, because it is sufficient and to_json is too slow
Emoji.names.to_s
end
# Define whenever show last push event
# with suggestion to create MR
def show_last_push_widget?(event)

View file

@ -45,8 +45,8 @@ module Gitlab
# Enable the asset pipeline
config.assets.enabled = true
config.assets.paths << Emoji.images_path
config.assets.precompile << "emoji/*.png"
config.assets.paths << Gemojione.index.images_path
config.assets.precompile << "*.png"
config.assets.precompile << "print.css"
# Version of your assets, change this if you want to expire all your assets

View file

@ -1,22 +1,35 @@
{
{
"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",
"person_with_ball_tone3":"basketball_player_tone3",
"person_with_ball_tone4":"basketball_player_tone4",
"person_with_ball_tone5":"basketball_player_tone5",
"beach_with_umbrella":"beach",
"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",
"spiral_calendar_pad":"calendar_spiral",
"card_file_box":"card_box",
"tape_cartridge":"cartridge",
"bottle_with_popping_cork":"champagne",
"cheese_wedge":"cheese",
"city_sunrise":"city_sunset",
"mantlepiece_clock":"clock",
"clockwise_right_and_left_semicircle_arrows":"clockwise_arrows",
@ -30,6 +43,8 @@
"couple_with_heart_mm":"couple_mm",
"couple_with_heart_ww":"couple_ww",
"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",
@ -60,10 +75,13 @@
"al":"flag_al",
"am":"flag_am",
"ao":"flag_ao",
"aq":"flag_aq",
"ar":"flag_ar",
"as":"flag_as",
"at":"flag_at",
"au":"flag_au",
"aw":"flag_aw",
"ax":"flag_ax",
"az":"flag_az",
"ba":"flag_ba",
"bb":"flag_bb",
@ -74,37 +92,47 @@
"bh":"flag_bh",
"bi":"flag_bi",
"bj":"flag_bj",
"bl":"flag_bl",
"waving_black_flag":"flag_black",
"bm":"flag_bm",
"bn":"flag_bn",
"bo":"flag_bo",
"bq":"flag_bq",
"br":"flag_br",
"bs":"flag_bs",
"bt":"flag_bt",
"bv":"flag_bv",
"bw":"flag_bw",
"by":"flag_by",
"bz":"flag_bz",
"ca":"flag_ca",
"cc":"flag_cc",
"congo":"flag_cd",
"cf":"flag_cf",
"cg":"flag_cg",
"ch":"flag_ch",
"ci":"flag_ci",
"ck":"flag_ck",
"chile":"flag_cl",
"cm":"flag_cm",
"cn":"flag_cn",
"co":"flag_co",
"cp":"flag_cp",
"cr":"flag_cr",
"cu":"flag_cu",
"cv":"flag_cv",
"cw":"flag_cw",
"cx":"flag_cx",
"cy":"flag_cy",
"cz":"flag_cz",
"de":"flag_de",
"dg":"flag_dg",
"dj":"flag_dj",
"dk":"flag_dk",
"dm":"flag_dm",
"do":"flag_do",
"dz":"flag_dz",
"ea":"flag_ea",
"ec":"flag_ec",
"ee":"flag_ee",
"eg":"flag_eg",
@ -112,6 +140,7 @@
"er":"flag_er",
"es":"flag_es",
"et":"flag_et",
"eu":"flag_eu",
"fi":"flag_fi",
"fj":"flag_fj",
"fk":"flag_fk",
@ -122,26 +151,34 @@
"gb":"flag_gb",
"gd":"flag_gd",
"ge":"flag_ge",
"gf":"flag_gf",
"gg":"flag_gg",
"gh":"flag_gh",
"gi":"flag_gi",
"gl":"flag_gl",
"gm":"flag_gm",
"gn":"flag_gn",
"gp":"flag_gp",
"gq":"flag_gq",
"gr":"flag_gr",
"gs":"flag_gs",
"gt":"flag_gt",
"gu":"flag_gu",
"gw":"flag_gw",
"gy":"flag_gy",
"hk":"flag_hk",
"hm":"flag_hm",
"hn":"flag_hn",
"hr":"flag_hr",
"ht":"flag_ht",
"hu":"flag_hu",
"ic":"flag_ic",
"indonesia":"flag_id",
"ie":"flag_ie",
"il":"flag_il",
"im":"flag_im",
"in":"flag_in",
"io":"flag_io",
"iq":"flag_iq",
"ir":"flag_ir",
"is":"flag_is",
@ -176,6 +213,7 @@
"mc":"flag_mc",
"md":"flag_md",
"me":"flag_me",
"mf":"flag_mf",
"mg":"flag_mg",
"mh":"flag_mh",
"mk":"flag_mk",
@ -183,6 +221,8 @@
"mm":"flag_mm",
"mn":"flag_mn",
"mo":"flag_mo",
"mp":"flag_mp",
"mq":"flag_mq",
"mr":"flag_mr",
"ms":"flag_ms",
"mt":"flag_mt",
@ -195,6 +235,7 @@
"na":"flag_na",
"nc":"flag_nc",
"ne":"flag_ne",
"nf":"flag_nf",
"nigeria":"flag_ng",
"ni":"flag_ni",
"nl":"flag_nl",
@ -211,12 +252,15 @@
"ph":"flag_ph",
"pk":"flag_pk",
"pl":"flag_pl",
"pm":"flag_pm",
"pn":"flag_pn",
"pr":"flag_pr",
"ps":"flag_ps",
"pt":"flag_pt",
"pw":"flag_pw",
"py":"flag_py",
"qa":"flag_qa",
"re":"flag_re",
"ro":"flag_ro",
"rs":"flag_rs",
"ru":"flag_ru",
@ -230,20 +274,27 @@
"sg":"flag_sg",
"sh":"flag_sh",
"si":"flag_si",
"sj":"flag_sj",
"sk":"flag_sk",
"sl":"flag_sl",
"sm":"flag_sm",
"sn":"flag_sn",
"so":"flag_so",
"sr":"flag_sr",
"ss":"flag_ss",
"st":"flag_st",
"sv":"flag_sv",
"sx":"flag_sx",
"sy":"flag_sy",
"sz":"flag_sz",
"ta":"flag_ta",
"tc":"flag_tc",
"td":"flag_td",
"tf":"flag_tf",
"tg":"flag_tg",
"th":"flag_th",
"tj":"flag_tj",
"tk":"flag_tk",
"tl":"flag_tl",
"turkmenistan":"flag_tm",
"tn":"flag_tn",
@ -255,12 +306,14 @@
"tz":"flag_tz",
"ua":"flag_ua",
"ug":"flag_ug",
"um":"flag_um",
"us":"flag_us",
"uy":"flag_uy",
"uz":"flag_uz",
"va":"flag_va",
"vc":"flag_vc",
"ve":"flag_ve",
"vg":"flag_vg",
"vi":"flag_vi",
"vn":"flag_vn",
"vu":"flag_vu",
@ -269,6 +322,7 @@
"ws":"flag_ws",
"xk":"flag_xk",
"ye":"flag_ye",
"yt":"flag_yt",
"za":"flag_za",
"zm":"flag_zm",
"zw":"flag_zw",
@ -281,12 +335,24 @@
"frame_with_tiles":"frame_tiles",
"frame_with_an_x":"frame_x",
"anguished":"frowning",
"white_frowning_face":"frowning2",
"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",
"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",
@ -300,16 +366,36 @@
"left_hand_telephone_receiver":"left_receiver",
"man_in_business_suit_levitating":"levitate",
"weight_lifter":"lifter",
"weight_lifter_tone1":"lifter_tone1",
"weight_lifter_tone2":"lifter_tone2",
"weight_lifter_tone3":"lifter_tone3",
"weight_lifter_tone4":"lifter_tone4",
"weight_lifter_tone5":"lifter_tone5",
"light_mark":"light_check_mark",
"lion":"lion_face",
"world_map":"map",
"sports_medal":"medal",
"sign_of_the_horns":"metal",
"sign_of_the_horns_tone1":"metal_tone1",
"sign_of_the_horns_tone2":"metal_tone2",
"sign_of_the_horns_tone3":"metal_tone3",
"sign_of_the_horns_tone4":"metal_tone4",
"sign_of_the_horns_tone5":"metal_tone5",
"studio_microphone":"microphone2",
"reversed_hand_with_middle_finger_extended":"middle_finger",
"reversed_hand_with_middle_finger_extended_tone1":"middle_finger_tone1",
"reversed_hand_with_middle_finger_extended_tone2":"middle_finger_tone2",
"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",
"money_mouth_face":"money_mouth",
"lightning_mood_bubble":"mood_bubble_lightning",
"lightning_mood":"mood_lightning",
"racing_motorcycle":"motorcycle",
"snow_capped_mountain":"mountain_snow",
"one_button_mouse":"mouse_one",
"three_button_mouse":"mouse_three_button",
"nerd_face":"nerd",
"three_networked_computers":"network",
"rolled_up_newspaper":"newspaper2",
"note_page":"note",
@ -319,27 +405,40 @@
"spiral_note_pad":"notepad_spiral",
"oil_drum":"oil",
"grandma":"older_woman",
"grandma_tone1":"older_woman_tone1",
"grandma_tone2":"older_woman_tone2",
"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",
"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",
"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",
"robot_face":"robot",
"face_with_rolling_eyes":"rolling_eyes",
"skeleton":"skull",
"skull_and_crossbones":"skull_crossbones",
"slightly_frowning_face":"slight_frown",
"slightly_smiling_face":"slight_smile",
"speaking_head_in_silhouette":"speaking_head",
@ -348,20 +447,53 @@
"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",
"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",
"-1":"thumbsdown",
"-1_tone1":"thumbsdown_tone1",
"-1_tone2":"thumbsdown_tone2",
"-1_tone3":"thumbsdown_tone3",
"-1_tone4":"thumbsdown_tone4",
"-1_tone5":"thumbsdown_tone5",
"+1":"thumbsup",
"+1_tone1":"thumbsup_tone1",
"+1_tone2":"thumbsup_tone2",
"+1_tone3":"thumbsup_tone3",
"+1_tone4":"thumbsup_tone4",
"+1_tone5":"thumbsup_tone5",
"thunder_cloud_and_rain":"thunder_cloud_rain",
"admission_tickets":"tickets",
"timer_clock":"timer",
"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",
"unicorn_face":"unicorn",
"upside_down_face":"upside_down",
"funeral_urn":"urn",
"raised_hand_with_part_between_middle_and_ring_fingers":"vulcan",
"left_writing_hand":"writing_hand"
}
"raised_hand_with_part_between_middle_and_ring_fingers_tone1":"vulcan_tone1",
"raised_hand_with_part_between_middle_and_ring_fingers_tone2":"vulcan_tone2",
"raised_hand_with_part_between_middle_and_ring_fingers_tone3":"vulcan_tone3",
"raised_hand_with_part_between_middle_and_ring_fingers_tone4":"vulcan_tone4",
"raised_hand_with_part_between_middle_and_ring_fingers_tone5":"vulcan_tone5",
"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",
"zipper_mouth_face":"zipper_mouth"
}

View file

@ -0,0 +1,18 @@
#!/usr/bin/env ruby
require 'json'
aliases = {}
index_file = File.expand_path("./index.json")
index = JSON.parse(File.read(index_file))
index.each_pair do |key, data|
data['aliases'].each do |a|
a.tr!(':', '')
aliases[a] = key
end
end
puts JSON.pretty_generate(aliases, indent: ' ', space: '', space_before: '')

File diff suppressed because it is too large Load diff

View file

@ -45,7 +45,8 @@ module Banzai
private
def emoji_url(name)
emoji_path = "emoji/#{emoji_filename(name)}"
emoji_path = emoji_filename(name)
if context[:asset_host]
# Asset host is specified.
url_to_image(emoji_path)

View file

@ -113,7 +113,7 @@ describe GitlabMarkdownHelper do
it 'should replace commit message with emoji to link' do
actual = link_to_gfm(':book:Book', '/foo')
expect(actual).
to eq %Q(<img class="emoji" title=":book:" alt=":book:" src="http://localhost/assets/emoji/1F4D6.png" height="20" width="20" align="absmiddle"><a href="/foo">Book</a>)
to eq %Q(<img class="emoji" title=":book:" alt=":book:" src="http://localhost/assets/1F4D6.png" height="20" width="20" align="absmiddle"><a href="/foo">Book</a>)
end
end

View file

@ -14,7 +14,7 @@ describe Banzai::Filter::EmojiFilter, lib: true do
it 'replaces supported emoji' do
doc = filter('<p>:heart:</p>')
expect(doc.css('img').first.attr('src')).to eq 'https://foo.com/assets/emoji/2764.png'
expect(doc.css('img').first.attr('src')).to eq 'https://foo.com/assets/2764.png'
end
it 'ignores unsupported emoji' do
@ -25,7 +25,7 @@ describe Banzai::Filter::EmojiFilter, lib: true do
it 'correctly encodes the URL' do
doc = filter('<p>:+1:</p>')
expect(doc.css('img').first.attr('src')).to eq 'https://foo.com/assets/emoji/1F44D.png'
expect(doc.css('img').first.attr('src')).to eq 'https://foo.com/assets/1F44D.png'
end
it 'matches at the start of a string' do