添加ckeditor的自定义表情,也是修改config配置.
首先看ckeditor目录:
自定义表情放到plugins下的指定目录,在配置文件里面定义:
CKEDITOR.editorConfig = function( config ) { config.language = 'zh-cn'; config.toolbar_A = [ ['Source'], ['Cut','Copy','Paste','PasteText','PasteFromWord'], ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], '/', ['Styles','Format','Font','FontSize'], ['TextColor','BGColor'], ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'], ]; config.toolbar = 'A'; config.width = 700; //宽度 config.height = 180; //高度 config.skin='kama'; //工具栏 config.toolbar = [ ['Source','Bold','Italic'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Smiley'], ['Styles','Font','FontSize'], ['TextColor'], ['Undo','Redo'], ['Image','Flash'] ]; //自定义表情的放置目录 config.smiley_path= "ckeditor/plugins/smiley/self/"; //设置对话框一行显示几个表情 config.smiley_columns = 11; //设置对话框表情 每一个表情的名字 config.smiley_images = ['b.gif','b1.gif','b2.gif','b3.gif','b4.gif','b5.gif','b6.gif', 'b7.gif','b8.gif','b9.gif','b10.gif','b11.gif','b12.gif', 'b13.gif','b14.gif','b15.gif','b16.gif','b17.gif','b18.gif', 'b19.gif','b20.gif','b21.gif','b22.gif','b23.gif','b24.gif', 'b25.gif','b26.gif','b27.gif','b28.gif','b29.gif']; };
效果图:
版权声明:本文为博主原创文章,未经博主允许不得转载。