CKEditor 4 上传图片

2019-05-22 06:32:51来源:博客园 阅读 ()

新老客户大回馈,云服务器低至5折

参考资料:Basic Configuration

直接Ctrl+v(粘贴图片)报错信息:上传文件时发生网络错误(networkError:Network error occurred during file upload)

版本:4.11.4

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    // config.language = 'fr';
    // config.uiColor = '#AADC6E';
    config.toolbarGroups = [
        { name: 'clipboard', groups: ['clipboard', 'undo'] },
        { name: 'editing', groups: ['find', 'selection', 'spellchecker', 'editing'] },
        { name: 'forms', groups: ['forms'] },
        { name: 'basicstyles', groups: ['basicstyles', 'cleanup'] },
        { name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align', 'bidi', 'paragraph'] },
        { name: 'links', groups: ['links'] },
        { name: 'insert', groups: ['insert'] },
        { name: 'styles', groups: ['styles'] },
        { name: 'colors', groups: ['colors'] },
        { name: 'document', groups: ['document', 'doctools', 'mode'] },
        { name: 'tools', groups: ['tools'] },
        { name: 'others', groups: ['others'] },
        { name: 'about', groups: ['about'] }
    ];

  //移除的按钮 config.removeButtons
= 'Templates,Print,Find,Replace,SelectAll,Scayt,Checkbox,Form,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,CreateDiv,Blockquote,BidiLtr,BidiRtl,Flash,PageBreak,Iframe,About,ShowBlocks,Smiley,SpecialChar,HorizontalRule,CopyFormatting,RemoveFormat'; //上传图片窗口用到的接口 config.filebrowserImageUploadUrl = "https://192.168.0.1/api/ECategoryDetail/UploadImg"; config.filebrowserUploadUrl = "https://192.168.0.1/api/ECategoryDetail/UploadImg"; // 使上传图片弹窗出现对应的“上传”tab标签 config.removeDialogTabs = 'image:advanced;link:advanced'; //粘贴图片时用得到 config.extraPlugins = 'uploadimage'; config.uploadUrl = 'https://192.168.0.1/api/ECategoryDetail/UploadImg'; };

 留下的按钮样式如下图:

建议大家有条件的直接用谷歌,百度找了半天没有有用的资料。

 


原文链接:https://www.cnblogs.com/dawenyang/p/10900546.html
如有疑问请与原作者联系

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:JavaScript的一些SAO操作

下一篇:D3.js 动画 过渡效果 (V3版本)