Skip to content

Commit

Permalink
emoji display support
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Jan 26, 2016
1 parent 75d12a1 commit 9af35a4
Show file tree
Hide file tree
Showing 26 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion app/assets/stylesheets/main.css.scss
Expand Up @@ -79,6 +79,11 @@
}
}

img.emoji {
height: 18px;
width: 18px;
}

.input {
width: 100%;
border: 1px solid #ccc;
Expand Down Expand Up @@ -672,4 +677,4 @@ img.photo {

.right {
float: right !important;
}
}
9 changes: 6 additions & 3 deletions app/decorators/base_decorator.rb
Expand Up @@ -3,12 +3,15 @@ class BaseDecorator < Draper::Decorator
include Twitter::Autolink
include CruiseMonkeyHelper

@@emojiRE = Regexp.new('\:(buffet|die-ship|die|fez|hottub|joco|pirate|ship-front|ship|towel-monkey|tropical-drink|zombie)\:')
@@emojiReplace = '<img src="/img/emoji/small/\1.png" class="emoji">'

def clean_text(text)
CGI.escapeHTML(text)
CGI.escapeHTML(text).gsub(@@emojiRE, @@emojiReplace)
end

def clean_text_with_cr(text)
CGI.escapeHTML(text || '').gsub("\n", '<br />')
CGI.escapeHTML(text || '').gsub("\n", '<br />').gsub(@@emojiRE, @@emojiReplace)
end

def twitarr_auto_linker(text, options = {})
Expand All @@ -22,4 +25,4 @@ def twitarr_auto_linker(text, options = {})
end
end

end
end
Binary file added public/img/emoji/large/buffet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/large/die-ship.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/large/die.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/large/fez.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/large/hottub.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/large/joco.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/large/pirate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/large/ship-front.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/large/ship.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/large/towel-monkey.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/large/tropical-drink.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/large/zombie.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/buffet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/die-ship.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/die.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/fez.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/hottub.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/joco.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/pirate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/ship-front.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/ship.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/towel-monkey.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/tropical-drink.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/emoji/small/zombie.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9af35a4

Please sign in to comment.