Commit c2f39c98 authored by Tim Zallmann's avatar Tim Zallmann

Added new emoji map for future async loading

parent 9766ca6f
...@@ -32,6 +32,7 @@ namespace :gemojione do ...@@ -32,6 +32,7 @@ namespace :gemojione do
dir = Gemojione.images_path dir = Gemojione.images_path
resultant_emoji_map = {} resultant_emoji_map = {}
resultant_emoji_map_new = {}
Gitlab::Emoji.emojis.each do |name, emoji_hash| Gitlab::Emoji.emojis.each do |name, emoji_hash|
# Ignore aliases # Ignore aliases
...@@ -53,6 +54,16 @@ namespace :gemojione do ...@@ -53,6 +54,16 @@ namespace :gemojione do
} }
resultant_emoji_map[name] = entry resultant_emoji_map[name] = entry
# Our new map is only characters to make the json substantially smaller
new_entry = {
c: category,
e: emoji_hash['moji'],
d: emoji_hash['description'],
u: Gitlab::Emoji.emoji_unicode_version(name)
}
resultant_emoji_map_new[name] = new_entry
end end
end end
...@@ -60,6 +71,11 @@ namespace :gemojione do ...@@ -60,6 +71,11 @@ namespace :gemojione do
File.open(out, 'w') do |handle| File.open(out, 'w') do |handle|
handle.write(Gitlab::Json.pretty_generate(resultant_emoji_map)) handle.write(Gitlab::Json.pretty_generate(resultant_emoji_map))
end end
out_new = File.join(Rails.root, 'public', '-', 'emojis', '1', 'emojis.json')
File.open(out_new, 'w') do |handle|
handle.write(Gitlab::Json.pretty_generate(resultant_emoji_map_new))
end
end end
# This task will generate a standard and Retina sprite of all of the current # This task will generate a standard and Retina sprite of all of the current
......
This diff is collapsed.
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