about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/components/components/status_content.jsx9
-rw-r--r--app/assets/stylesheets/components.scss21
2 files changed, 28 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/components/status_content.jsx b/app/assets/javascripts/components/components/status_content.jsx
index 67fd9cb69..a6321d31c 100644
--- a/app/assets/javascripts/components/components/status_content.jsx
+++ b/app/assets/javascripts/components/components/status_content.jsx
@@ -1,5 +1,10 @@
 import ImmutablePropTypes from 'react-immutable-proptypes';
-import PureRenderMixin    from 'react-addons-pure-render-mixin';
+import PureRenderMixin from 'react-addons-pure-render-mixin';
+import emojione from 'emojione';
+
+emojione.imageType = 'png';
+emojione.sprites = false;
+emojione.imagePathPNG = '/emoji/';
 
 const StatusContent = React.createClass({
 
@@ -55,7 +60,7 @@ const StatusContent = React.createClass({
   },
 
   render () {
-    const content = { __html: this.props.status.get('content') };
+    const content = { __html: emojione.unicodeToImage(this.props.status.get('content')) };
     return <div className='status__content' dangerouslySetInnerHTML={content} />;
   },
 
diff --git a/app/assets/stylesheets/components.scss b/app/assets/stylesheets/components.scss
index 16327168c..71ef7f3a8 100644
--- a/app/assets/stylesheets/components.scss
+++ b/app/assets/stylesheets/components.scss
@@ -71,6 +71,17 @@
   }
 }
 
+.emojione {
+  display: inline-block;
+  font-size: inherit;
+  vertical-align: middle;
+  margin: -.2ex .15em .2ex;
+
+  img {
+    width: auto;
+  }
+}
+
 .status__content, .reply-indicator__content {
   font-size: 15px;
   line-height: 20px;
@@ -78,6 +89,11 @@
   font-weight: 300;
   overflow: hidden;
 
+  .emojione {
+    width: 18px;
+    height: 18px;
+  }
+
   p {
     margin-bottom: 20px;
 
@@ -110,6 +126,11 @@
   .status__content {
     font-size: 19px;
     line-height: 24px;
+
+    .emojione {
+      width: 22px;
+      height: 22px;
+    }
   }
 }