0byt3m1n1
Path:
/
home
/
mgatv524
/
www
/
mctv
/
vendor
/
emojione
/
emojione
/
demos
/
[
Home
]
File: jstoimage.html
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>.toImage(str) - Javascript - Emoji One Labs</title> <!-- Emoji One CSS: --> <link rel="stylesheet" href="./../assets/css/emojione.min.css" type="text/css" media="all" /> <!-- jQuery: --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <!-- Demos Stylesheet: --> <link rel="stylesheet" href="styles/demos.css"/> <!-- Typekit: --> <script type="text/javascript" src="//use.typekit.net/ivu8ilu.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> <!-- Syntax Highlighting --> <script type="text/javascript" src="scripts/shCore.js"></script> <script type="text/javascript" src="scripts/shBrushJScript.js"></script> <script type="text/javascript" src="scripts/shBrushCss.js"></script> <script type="text/javascript" src="scripts/shBrushPhp.js"></script> <script type="text/javascript">SyntaxHighlighter.all();</script> <link rel="stylesheet" href="styles/shCoreRDark.css"/> <!-- Emoji One JS --> <script src="./../lib/js/emojione.js"></script> <script type="text/javascript"> // ################################################# // # Optional // default is PNG but you may also use SVG emojione.imageType = 'svg'; // default is ignore ASCII smileys like :) but you can easily turn them on emojione.ascii = true; // if you want to host the images somewhere else // you can easily change the default paths emojione.imagePathPNG = './../assets/png/'; emojione.imagePathSVG = './../assets/svg/'; // ################################################# </script> </head> <body> <!-- Masthead --> <header class="masthead"> <div class="container"> <h1 class="masthead-title">Emoji One Labs</h1><span class="version">version <span>1.5.1</span></span> </div> </header> <!-- Breadcrum Navigation --> <nav class="breadcrumbs"> <div class="container"> <a class="breadcrumb-item top-level" href="index.html">All Demos</a> › <a href="index.html#js">Javascript</a> › <a class="breadcrumb-item active" href="jstoimage.html">.toImage(str)</a> </div> </nav> <!-- Page: --> <main> <div class="container"> <h1>.toImage(str)</h1> <h2>convert native unicode emoji and shortnames directly to images</h2> <p>This function is simply a shorthand for <a href="./jsunicodetoimage.html">.unicodeToImage(str)</a> and <a href="./jsshortnametoimage.html">.shortnameToImage(str)</a>. First it will convert native unicode emoji directly to images and then convert any shortnames to images. This function can be useful to take mixed input and convert it directly to images if, for example, you wanted to give clients a live preview of their inputted text. Also, if your source text contains both unicode characters and shortnames (you didn't unify it) then this function will be useful to you.</p> <p>Feel free to enter native unicode emoji and/or shortnames in the input below to test the conversion process. For a complete list of emoji and their shortnames check out <a href="http://emoji.codes/" target="_blank">emoji.codes</a>.</p> <div class="clearfix"> <div class="column-1-2 input"> <h3>Input:</h3> <input type="text" id="inputText" name="inputText" value="Hello world! 😄 :smile:"/> <input type="button" value="Convert" onclick="convert()"/> </div> <div class="column-1-2 output"> <h3>Output:</h3> <p id="outputText"></p> <script type="text/javascript"> function convert() { var input = document.getElementById('inputText').value; var output = emojione.toImage(input); document.getElementById('outputText').innerHTML = output; } </script> </div> </div> <h3>JS Snippet:</h3> <pre class="brush: js"> // <input type="button" value="Convert" onclick="convert()"/> <script type="text/javascript"> function convert() { var input = document.getElementById('inputText').value; var output = emojione.toImage(input); document.getElementById('outputText').innerHTML = output; } </script> </pre> </div> </main> <footer class="demo-footer"> <div class="container"> <small>© Copyright 2014-2015 Ranks.com.</small> <small>Emoji One artwork is licensed under the <a href="https://creativecommons.org/licenses/by/4.0/legalcode">CC-BY-SA-4.0</a> License</small> <small>Emoji One demos, documentation, scripts, stylesheets and all other non-artwork is licensed under the <a href="http://opensource.org/licenses/MIT">MIT</a> License</small> </div> </footer> </body> </html>