From f65bfa9e75976d3dde11d7559dda0ed00ce37534 Mon Sep 17 00:00:00 2001 From: Yuki Date: Sat, 13 Jun 2015 20:23:11 +0530 Subject: [PATCH] Twitter Emoji --- Gemfile | 2 ++ Gemfile.lock | 3 +++ app/assets/javascripts/application.js.erb.coffee | 13 +++++++++++++ 3 files changed, 18 insertions(+) diff --git a/Gemfile b/Gemfile index 1cf52cf6..23ffa291 100644 --- a/Gemfile +++ b/Gemfile @@ -40,6 +40,8 @@ gem 'fog-aws' gem 'momentjs-rails', '>= 2.9.0' gem 'bootstrap3-datetimepicker-rails', '~> 4.7.14' +gem 'twemoji-rails' + gem 'ruby-progressbar' gem 'rails_admin' diff --git a/Gemfile.lock b/Gemfile.lock index 5f8b833d..fc219d56 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -435,6 +435,8 @@ GEM simple_oauth turbolinks (2.5.3) coffee-rails + twemoji-rails (1.2.1.3) + railties (>= 3.0.0) twitter (5.14.0) addressable (~> 2.3) buftok (~> 0.2.0) @@ -533,6 +535,7 @@ DEPENDENCIES thin tumblr_client turbolinks + twemoji-rails twitter uglifier (>= 1.3.0) unicorn diff --git a/app/assets/javascripts/application.js.erb.coffee b/app/assets/javascripts/application.js.erb.coffee index 6f7b98f3..5ac8d33c 100644 --- a/app/assets/javascripts/application.js.erb.coffee +++ b/app/assets/javascripts/application.js.erb.coffee @@ -3,6 +3,7 @@ #= require jquery.turbolinks #= require turbolinks #= require bootstrap +#= require twemoji #= require nprogress #= require nprogress-turbolinks #= require growl @@ -64,5 +65,17 @@ _ready = -> dotColor: '#5e35b1' lineColor: '#5e35b1' + if twemoji? + twemoji.parse document.body, + size: 16 + callback: (icon, options) -> + switch icon + # copyright, registered, trademark + when 'a9' or 'ae' or '2122' + false + else + ''.concat(options.base, options.size, '/', icon, options.ext) + + $(document).ready _ready $(document).on 'page:load', _ready