zoukankan      html  css  js  c++  java
  • CKEditor 4 上传图片

    参考资料:Basic Configuration

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

    版本:4.11.4,API接口直接返回图片地址即可

    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'; };

     留下的按钮样式如下图:

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

  • 相关阅读:
    Django学习(二) Django框架简单搭建
    Django学习(一) Django安装配置
    Python学习(一) Python安装配置
    注册第一天,纪念一下
    小程序笔记
    详解HTML5中的进度条progress元素简介及兼容性处理
    服务管理
    yum
    管道,输出,管道,重定向,grep
    VIM
  • 原文地址:https://www.cnblogs.com/dawenyang/p/10900546.html
Copyright © 2011-2022 走看看