Commit 60c3e841ce4f0bb29917bff6318167f5b417c426

Authored by Dmitriy Zaporozhets
2 parents c0090a3f 9afd0484

Merge branch 'gitlab_emoji_gem' into 'master'

Replace gemoji with open source PhantomOpenEmoji
@@ -29,6 +29,7 @@ v 6.7.0 @@ -29,6 +29,7 @@ v 6.7.0
29 - Better API responses for access_levels (sponsored by O'Reilly Media) 29 - Better API responses for access_levels (sponsored by O'Reilly Media)
30 - Requires at least 2 unicorn workers 30 - Requires at least 2 unicorn workers
31 - Requires gitlab-shell v1.9+ 31 - Requires gitlab-shell v1.9+
  32 + - Replaced gemoji(due to closed licencing problem) with Phantom Open Emoji library(combined SIL Open Font License, MIT License and the CC 3.0 License)
32 33
33 v 6.6.5 34 v 6.6.5
34 - Added option to remove issue assignee on project issue page and issue edit page (Jason Blanchard) 35 - Added option to remove issue assignee on project issue page and issue edit page (Jason Blanchard)
@@ -165,7 +165,7 @@ gem "modernizr", "2.6.2" @@ -165,7 +165,7 @@ gem "modernizr", "2.6.2"
165 gem "raphael-rails", "~> 2.1.2" 165 gem "raphael-rails", "~> 2.1.2"
166 gem 'bootstrap-sass', '~> 3.0' 166 gem 'bootstrap-sass', '~> 3.0'
167 gem "font-awesome-rails", '~> 3.2' 167 gem "font-awesome-rails", '~> 3.2'
168 -gem "gemoji", "~> 1.3.0" 168 +gem "gitlab_emoji", "~> 0.0.1.1"
169 gem "gon", '~> 5.0.0' 169 gem "gon", '~> 5.0.0'
170 gem 'nprogress-rails' 170 gem 'nprogress-rails'
171 171
@@ -128,6 +128,8 @@ GEM @@ -128,6 +128,8 @@ GEM
128 mail (~> 2.2) 128 mail (~> 2.2)
129 email_validator (1.4.0) 129 email_validator (1.4.0)
130 activemodel 130 activemodel
  131 + emoji (1.0.1)
  132 + json
131 enumerize (0.7.0) 133 enumerize (0.7.0)
132 activesupport (>= 3.2) 134 activesupport (>= 3.2)
133 equalizer (0.0.8) 135 equalizer (0.0.8)
@@ -165,7 +167,6 @@ GEM @@ -165,7 +167,6 @@ GEM
165 formatador (0.2.4) 167 formatador (0.2.4)
166 gemnasium-gitlab-service (0.2.1) 168 gemnasium-gitlab-service (0.2.1)
167 rugged (~> 0.19) 169 rugged (~> 0.19)
168 - gemoji (1.3.1)  
169 gherkin-ruby (0.3.1) 170 gherkin-ruby (0.3.1)
170 racc 171 racc
171 github-markdown (0.5.5) 172 github-markdown (0.5.5)
@@ -190,6 +191,8 @@ GEM @@ -190,6 +191,8 @@ GEM
190 charlock_holmes (~> 0.6.6) 191 charlock_holmes (~> 0.6.6)
191 escape_utils (~> 0.2.4) 192 escape_utils (~> 0.2.4)
192 mime-types (~> 1.19) 193 mime-types (~> 1.19)
  194 + gitlab_emoji (0.0.1.1)
  195 + emoji (~> 1.0.1)
193 gitlab_git (5.7.1) 196 gitlab_git (5.7.1)
194 activesupport (~> 4.0.0) 197 activesupport (~> 4.0.0)
195 charlock_holmes (~> 0.6.9) 198 charlock_holmes (~> 0.6.9)
@@ -593,12 +596,12 @@ DEPENDENCIES @@ -593,12 +596,12 @@ DEPENDENCIES
593 font-awesome-rails (~> 3.2) 596 font-awesome-rails (~> 3.2)
594 foreman 597 foreman
595 gemnasium-gitlab-service (~> 0.2) 598 gemnasium-gitlab-service (~> 0.2)
596 - gemoji (~> 1.3.0)  
597 github-markup (~> 0.7.4)! 599 github-markup (~> 0.7.4)!
598 gitlab-flowdock-git-hook (~> 0.4.2) 600 gitlab-flowdock-git-hook (~> 0.4.2)
599 gitlab-gollum-lib (~> 1.1.0) 601 gitlab-gollum-lib (~> 1.1.0)
600 gitlab-grack (~> 2.0.0.pre) 602 gitlab-grack (~> 2.0.0.pre)
601 gitlab-linguist (~> 3.0.0) 603 gitlab-linguist (~> 3.0.0)
  604 + gitlab_emoji (~> 0.0.1.1)
602 gitlab_git (~> 5.7.1) 605 gitlab_git (~> 5.7.1)
603 gitlab_meta (= 6.0) 606 gitlab_meta (= 6.0)
604 gitlab_omniauth-ldap (= 1.0.4) 607 gitlab_omniauth-ldap (= 1.0.4)
app/models/note.rb
@@ -199,7 +199,8 @@ class Note < ActiveRecord::Base @@ -199,7 +199,8 @@ class Note < ActiveRecord::Base
199 def downvote? 199 def downvote?
200 votable? && (note.start_with?('-1') || 200 votable? && (note.start_with?('-1') ||
201 note.start_with?(':-1:') || 201 note.start_with?(':-1:') ||
202 - note.start_with?(':thumbsdown:') 202 + note.start_with?(':thumbsdown:') ||
  203 + note.start_with?(':thumbs_down_sign:')
203 ) 204 )
204 end 205 end
205 206
@@ -249,7 +250,8 @@ class Note < ActiveRecord::Base @@ -249,7 +250,8 @@ class Note < ActiveRecord::Base
249 def upvote? 250 def upvote?
250 votable? && (note.start_with?('+1') || 251 votable? && (note.start_with?('+1') ||
251 note.start_with?(':+1:') || 252 note.start_with?(':+1:') ||
252 - note.start_with?(':thumbsup:') 253 + note.start_with?(':thumbsup:') ||
  254 + note.start_with?(':thumbs_up_sign:')
253 ) 255 )
254 end 256 end
255 257
app/views/layouts/_init_auto_complete.html.haml
1 :javascript 1 :javascript
2 GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_project_path(@project)}" 2 GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_project_path(@project)}"
3 - GitLab.GfmAutoComplete.Emoji.assetBase = "#{Gitlab.config.gitlab.relative_url_root + '/assets/emoji'}" 3 + GitLab.GfmAutoComplete.Emoji.assetBase = "#{Gitlab.config.gitlab.relative_url_root + Emoji.asset_path}"
4 GitLab.GfmAutoComplete.setup(); 4 GitLab.GfmAutoComplete.setup();
app/views/projects/notes/_note.html.haml
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 %i.icon-thumbs-up 23 %i.icon-thumbs-up
24 \+1 24 \+1
25 - if note.downvote? 25 - if note.downvote?
26 - %span.vote.downvote.label.label-error 26 + %span.vote.downvote.label.label-danger
27 %i.icon-thumbs-down 27 %i.icon-thumbs-down
28 \-1 28 \-1
29 29
config/initializers/gemoji.rb
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -# Workaround for https://github.com/github/gemoji/pull/18  
2 -require 'gemoji'  
3 -Gitlab::Application.config.assets.paths << Emoji.images_path  
lib/gitlab/markdown.rb
@@ -152,7 +152,7 @@ module Gitlab @@ -152,7 +152,7 @@ module Gitlab
152 # 152 #
153 # Returns boolean 153 # Returns boolean
154 def valid_emoji?(emoji) 154 def valid_emoji?(emoji)
155 - Emoji.names.include? emoji 155 + Emoji.find_by_name emoji
156 end 156 end
157 157
158 # Private: Dispatches to a dedicated processing method based on reference 158 # Private: Dispatches to a dedicated processing method based on reference