找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3105|回复: 0

百度UEditor编辑器改变初始模式

[复制链接]

6

主题

0

回帖

36

积分

管理员

积分
36
发表于 2023-2-13 23:59:41 | 显示全部楼层 |阅读模式
百度UEditor文档默认编辑器模式黏贴会带有样式,所以想将默认模式换成纯文本贴图模式,今天看了UEditor文档重新修改一下配置文件pasteplain为即可true。
原生UEditor编辑器修改ueditor.config.js文件
  1. var ue = UE.getEditor('container', {
  2.     toolbars: [
  3.         ['fullscreen', 'source', 'undo', 'redo', 'bold']
  4.     ],
  5.     autoHeightEnabled: true,
  6.     autoFloatEnabled: true,
  7.     pasteplain: true});
复制代码
我本人用的zbolg系统,需要修改ueditor插件里面的ueditor.config.php文件
  1. $array_config = array(
  2.     'UEDITOR_HOME_URL' => 'URL',
  3.     'HOST_URL'         => 'bloghost',
  4.     'serverUrl'        => 'URL + "php/controller.php"',
  5.     'toolbars'         => "[ " .
  6.     "[ 'source', '|', 'undo', 'redo', '|', 'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript','forecolor', 'backcolor', '|', " .
  7.     "'insertorderedlist', 'insertunorderedlist','indent', 'justifyleft', 'justifycenter', 'justifyright','|', 'removeformat','formatmatch','autotypeset', 'pasteplain'], " .
  8.     "['paragraph', 'fontfamily', 'fontsize','|', 'emotion','link','insertimage','scrawl','insertvideo', 'attachment','spechars', 'map','|', "
  9.     . ($zbp->option['ZC_SYNTAXHIGHLIGHTER_ENABLE'] ? "'insertcode'," : '')
  10.     . "'blockquote', 'wordimage','inserttable', 'horizontal','fullscreen']]",
  11.     'shortcutMenu'           => "['fontfamily', 'fontsize', 'bold', 'italic', 'underline', 'forecolor', 'backcolor']",
  12.     'maximumWords'           => 1000000000,
  13.     'wordCountMsg'           => '"当前已输入 {#count} 个字符" ',
  14.     'initialContent'         => '"<p></p>"',
  15.     'initialStyle'           => '"body{font-size:14px;font-family:微软雅黑,宋体,Arial,Helvetica,sans-serif;}"',
  16.     'wordCount'              => 'true',
  17.     'elementPathEnabled'     => 'true',
  18.     'initialFrameHeight'     => '300',
  19.     'imageMaxSize'           => $zbp->option['ZC_UPLOAD_FILESIZE'] * 1024 * 1024,
  20.     'fileMaxSize'            => $zbp->option['ZC_UPLOAD_FILESIZE'] * 1024 * 1024,
  21.     'toolbarTopOffset'       => '200',
  22.     'sourceEditor'           => '\'' . ($zbp->option['ZC_CODEMIRROR_ENABLE'] ? 'codemirror' : 'textarea') . '\'',
  23.     'theme'                  => '"default"',
  24.     'themePath'              => 'URL +"themes/"',
  25.     'lang'                   => '\'' . $lang . '\'',
  26.     'langPath'               => 'URL+"lang/"',
  27.     'codeMirrorJsUrl'        => 'URL+ "third-party/codemirror/codemirror.js"',
  28.     'codeMirrorCssUrl'       => 'URL+ "third-party/codemirror/codemirror.css"',
  29.     "maxUpFileSize"          => $zbp->option['ZC_UPLOAD_FILESIZE'],
  30.     "allowDivTransToP"       => 'false',
  31.     "catchRemoteImageEnable" => "false",
  32.     "pasteplain" => "true",
  33. );
复制代码
百度UEditor编辑器文档前端配置地址:http://fex.baidu.com/ueditor/#start-config



您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|乐啊乐科技 ( 鄂ICP备2021015077号-2|鄂公网安备42050202000673 )

GMT+8, 2024-5-9 09:14 , Processed in 0.117496 second(s), 28 queries .

Powered by Discuz! X3.5

Copyright © 2001-2023 Tencent Cloud.

快速回复 返回顶部 返回列表