 
						EmojiOne表情符号所见即所得的文本编辑器
EmojiOne是一款强大的表情符号插件。它提供了1600+个不同类别的表情图标,支持PNG格式和SVG格式。并且可以在客户端使用js来进行符号解析,也可以在服务器端使用PHP代码来进行符号解析,功能非常强大。
2.1版

2.1版独立模式

3.0版

可以使用bower、npm或composer来安装该文本编辑器插件。
| 1 2 3 | bower install emojioneareanpm install emojioneareacomposer require mervick/emojionearea | 
使用该WYSIWYG文本编辑器插件需要在页面中引入emojionearea.min.css和jquery1.8.2+、emojionearea.min.js文件。例外要使用表情符号需要引入EmojiOne1.5+的相关文件
| 1 2 3 4 5 | <linkrel="stylesheet"href="to/path/css/emojionearea.min.css"><scripttype="text/javascript"src="to/path/js/jquery.min.js"></script><scripttype="text/javascript"src="to/path/js/emojionearea.min.js"></script> | 
最基本的使用方法是使用一个<textarea>来作为文本编辑器。
| 1 | <textareaid="example1"></textarea> | 
然后使用下面的方法来初始化文本编辑器。
| 1 2 3 4 5 6 7 8 9 10 | <script type="text/javascript">  $(document).ready(function() {    // define emojione location (optional, see more at /)    // emojione.imagePathPNG = '../vendor/emojione/emojione/assets/png/';    $("#example1").emojioneArea({      // options      autoHideFilters: true    });  });</script> | 
autoHideFilters属性表示自动隐藏表情符号选择区域。
使用div作为容器
你也可以使用<div>元素作为容器。
| 1 2 3 4 5 6 7 8 | <div id="example2">......</div><script type="text/javascript">  $(document).ready(function() {    $("#example2").emojioneArea();  });</script> | 
使用input作为容器
| 1 2 3 4 5 6 | <input id="example3"value="......"><script type="text/javascript">  $(document).ready(function() {    $("#example3").emojioneArea();  });</script> | 
使用图片来代替sprite雪碧图
| 1 2 3 4 5 6 7 8 9 10 | <textarea id="example4">......</textarea><script type="text/javascript">  $(document).ready(function() {    $("#example4").emojioneArea({      useSprite: false    });  });</script> | 
其它布局方式
| 1 2 3 4 5 6 7 8 9 10 | <textarea id="example5">......</textarea><script type="text/javascript">  $(document).ready(function() {    $("#example5").emojioneArea({      template: "<filters/><tabs/><editor/>"    });  });</script> | 
API
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | vardefault_options = {      template          : "<editor/><filters/><tabs/>",      dir               : "ltr",      spellcheck        : false,      autocomplete      : "off",      autocorrect       : "off",      autocapitalize    : "off",      placeholder       : null,      container         : null,      hideSource        : true,      autoHideFilters   : false,      useSprite         : true,      filters: {        // see in source file      }  };   .on(events, handler);  // - events  //   Type: String  //   One or more space-separated event types and optional namespaces  // - handler  //   Type: Function(jQuery Element, Event eventObject [, Anything extraParameter ] [, ... ] )  //   A function to execute when the event is triggered.   .off(events[, handler]);  // - events  //   Type: String  //   One or more space-separated event types and optional namespaces  // - handler  //   Type: Function(jQuery Element, Event eventObject [, Anything extraParameter ] [, ... ] )  //   A handler function previously attached for the event(s)   // built-in events:  //   "mousedown", "mouseup", "click", "keyup", "keydown",  //   "filter.click", "emojibtn.click", "arrowLeft.click", "arrowRight.click",  //   "focus", "blur", "paste", "resize", "change"   .setText(str);  // - str  //   Type: String  //   Set text   .getText();  //   Get text   // Usage methods, example:  varel = $("selector").emojioneArea();  el[0].emojioneArea.on("emojibtn.click", function(btn) {    console.log(btn.html());  }); | 
特别申明:
			本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
			本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
			如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com