Module: Gitlab::Emoji
Constant Summary collapse
- EMOJI_VERSION =
When updating emoji assets increase the version below and update the version number in ‘app/assets/javascripts/emoji/index.js`
2
Instance Method Summary collapse
- #custom_emoji_tag(name, image_source) ⇒ Object
-
#emoji_public_absolute_path ⇒ Pathname
Return a Pathname to emoji’s current versioned folder.
-
#gl_emoji_tag(emoji, options = {}) ⇒ Object
CSS sprite fallback takes precedence over image fallback.
Instance Method Details
#custom_emoji_tag(name, image_source) ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/gitlab/emoji.rb', line 33 def custom_emoji_tag(name, image_source) data = { name: name, fallback_src: image_source, unicode_version: 'custom' # Prevents frontend to check for Unicode support } = { title: name, data: data } ActionController::Base.helpers.content_tag('gl-emoji', "", ) end |
#emoji_public_absolute_path ⇒ Pathname
Return a Pathname to emoji’s current versioned folder
14 15 16 |
# File 'lib/gitlab/emoji.rb', line 14 def emoji_public_absolute_path Rails.root.join("public/-/emojis/#{EMOJI_VERSION}") end |
#gl_emoji_tag(emoji, options = {}) ⇒ Object
CSS sprite fallback takes precedence over image fallback
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/gitlab/emoji.rb', line 21 def gl_emoji_tag(emoji, = {}) return unless emoji data = { name: emoji.name, unicode_version: emoji.unicode_version } = { title: emoji.description, data: data }.merge() ActionController::Base.helpers.content_tag('gl-emoji', emoji.codepoints, ) end |