Tp6下ueditor设置

1:粘贴内容图片重载问题
修改 ueditor.config.js 在 window.UEDITOR_CONFIG 中 catchRemoteImageEnable:false 配置项
2:去掉编辑器图片中间的空白分割块,以及图片显示宽度
修改ueditor.all.js

render: function (container){
	//设置图片最大宽度,以免撑出滚动条
	'img{max-width:100%;vertical-align:top;outline-width:0px;}'+
	//设置段落间距
	"p{margin:0;}" +
	"p:last-child{margin-bottom:9px;}</style>" +
}

3:关闭本地保存
修改 ueditor.all.js

'contentchange': function () {
	if (!me.getOpt('enableAutoSave')) {
	    return;
	}
	...

4:大文件上传超时
修改 webuploader.js

Transport.options = {
	server: '',
	method: 'POST',
	// 跨域时,是否允许携带cookie, 只有html5 runtime才有效
	withCredentials: false,
	fileVal: 'file',
	timeout: 30 * 60 * 1000,    // luoyi 修改为30分钟
	formData: {},
	headers: {},
	sendAsBinary: false
	};

5:多图片上传图片顺序
修改 ueditor/dialogs/image/image.js

uploader.on('uploadSuccess', function (file, ret) {
	...
	if (json.state == 'SUCCESS') {
        // _this.imageList.push(json);
        _this.imageList[$file.index()] = json;
        $file.append('<span class="success"></span>');
    }
    ...

6:多图上传时,修改图片的尺寸
修改 ueditor/jsp/config.json

"imageCompressEnable": true, /* 是否压缩图片,默认是true */
"imageCompressBorder": 8800, /* 图片压缩最长边限制 */

7:单图上传
修改 ueditor.all.js

if(json.state == 'SUCCESS' && json.url) {
	loader = me.document.getElementById(loadingId);
	loader.setAttribute('src', link);
	loader.setAttribute('_src', link);
	loader.setAttribute('title', json.title || '');
	loader.setAttribute('alt', json.original || '');
	loader.setAttribute('width', 800); 修改
	loader.setAttribute('height', 600); 修改
	loader.removeAttribute('id');
	domUtils.removeClasses(loader, 'loadingclass');
}

8:去掉图片上传后的title以及alt
修改 ueditor.all.js

if(json.state == 'SUCCESS' && json.url) {
    loader = me.document.getElementById(loadingId);
    loader.setAttribute('src', link);
    loader.setAttribute('_src', link);
    loader.removeAttribute('title', json.title || '');  //去除title
    loader.removeAttribute('alt', json.original || '');  //去除alt
    loader.removeAttribute('id');
    domUtils.removeClasses(loader, 'loadingclass');
}
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

糯麦

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值