Commit da0953e6 authored by Douwe Maan's avatar Douwe Maan Committed by Rémy Coutable

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
parent f3000481
......@@ -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'
......
......@@ -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)
......
app/assets/images/emoji.png

813 KB | W: | H:

app/assets/images/emoji.png

1.08 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
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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
......
......@@ -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)
......
......@@ -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
......
This diff is collapsed.
#!/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: '')
This diff is collapsed.
......@@ -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)
......
......@@ -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
......
......@@ -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
......
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