Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use native emoji code points instead #827

Merged
merged 3 commits into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions docs/demos/plugins/emoji.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,11 @@ <h2>Select an emoji !</h2>

<h4>The code</h4>
<pre><code class="js-code-to-eval javascript">
// Customize your emoji images base URL
emojify.setConfig({
img_dir : '//cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/images/basic/',
});

$('#editor')
.trumbowyg({
btns: [
['emoji']
]
});
emojify.run();

// Will transform an :emoji: to img tag at each input
$('.trumbowyg-editor').on('input propertychange', function() {
emojify.run();
});
</code></pre>
</div>
Expand All @@ -60,8 +49,6 @@ <h4>At the end of body</h4>
&lt;!-- Import jQuery -->
&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">&lt;/script>
&lt;script>window.jQuery || document.write('&lt;script src="js/vendor/jquery-3.2.1.min.js">&lt;\/script>')&lt;/script>
&lt;!-- Import emojify.js -->
&lt;script src="//cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/js/emojify.min.js">&lt;/script>
</code></pre>
</div>
</section>
Expand All @@ -71,8 +58,6 @@ <h4>At the end of body</h4>
<!-- Import jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="../../js/vendor/jquery-3.2.1.min.js"><\/script>')</script>
<!-- Import emojify.js -->
<script src="//cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/js/emojify.min.js"></script>

<!-- DO NOT COPY THIS LINES IN YOUR PROJECT, THEY ARE THERE JUST FOR THE EXAMPLE PAGE PRUPOSE -->
<script src="../js/loader.js"></script>
Expand Down
24 changes: 6 additions & 18 deletions docs/documentation/plugins/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,35 +232,23 @@ <h3 id="plugin-emoji">Emoji</h3>
</p>

<h4>How to use it?</h4>
<p>
This plugin require <strong>emojify.js</strong> which can be installed with:
<code>npm&nbsp;install&nbsp;emojify.js</code>
</p>
<pre><code class="html">
&lt;-- Import Trumbowyg emoji style in &lt;head>... -->
&lt;script src="node_modules/trumbowyg/dist/plugins/emoji/ui/trumbowyg.emoji.css">&lt;/script>
</code></pre>
<pre><code class="html">
&lt;-- Import emojify.js and Trumbowyg emoji at the end of &lt;body>... -->
&lt;script src="node_modules/emojify.js/dist/js/emojify.min.js">&lt;/script>
&lt;-- Import Trumbowyg emoji at the end of &lt;body>... -->
&lt;script src="node_modules/trumbowyg/dist/plugins/emoji/trumbowyg.emoji.min.js">&lt;/script>
</code></pre>
<p>
You should setup emojify.js, then you can use the new button definition <code>emoji</code>
Then you can use the new button definition <code>emoji</code>
</p>

<pre><code class="javascript">
// Setup emojify.js
emojify.setConfig({
img_dir : '//cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/images/basic/',
});

$('#my-editor').trumbowyg({
btns: [
['emoji']
]
});
emojify.run();

// Will transform an :emoji: to img tag at each input
$('.trumbowyg-editor').on('input propertychange', function() {
emojify.run();
});
</code></pre>
</div>
Expand Down
Loading