热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

织梦DedeCMSckeditor编辑器通过修改js去除img标签内的width和height样式

1.找到文件\include\ckeditor\plugins\image\dialogs\image.js2.使用工具美化js代码3.搜索setStyle(width,CKEDI

1. 找到文件\include\ckeditor\plugins\image\dialogs\image.js

织梦DedeCMSckeditor编辑器通过修改js去除img标签内的width和height样式

2. 使用工具美化js代码

3. 搜索 setStyle(‘width’, CKEDITOR.tools.cssLength

找到下面设置width的代码并注释掉

if (C == d) {

if (F) D.setStyle(‘width’, CKEDITOR.tools.cssLength(F));

else D.removeStyle(‘width’);

!E && D.removeAttribute(‘width’);

} else if (C == f) {

var G = F.match(h);

if (!G) {

var H = this.getDialog().originalElement;

if (H.getCustomData(‘isReady’) == ‘true’) D.setStyle(‘width’, H.$.width + ‘px’);

} else D.setStyle(‘width’, CKEDITOR.tools.cssLength(F));

} else if (C == g) {

D.removeAttribute(‘width’);

D.removeStyle(‘width’);

}

4. 搜索 setStyle(‘height’, CKEDITOR.tools.cssLength

找到下面设置height的代码并注释掉

if (C == d) {

if (F) D.setStyle(‘height’, CKEDITOR.tools.cssLength(F));

else D.removeStyle(‘height’);

!E && D.removeAttribute(‘height’);

} else if (C == f) {

var G = F.match(h);

if (!G) {

var H = this.getDialog().originalElement;

if (H.getCustomData(‘isReady’) == ‘true’) D.setStyle(‘height’, H.$.height + ‘px’);

} else D.setStyle(‘height’, CKEDITOR.tools.cssLength(F));

} else if (C == g) {

D.removeAttribute(‘height’);

D.removeStyle(‘height’);

}

这样即可去除织梦自带编辑器ckeditor上传图片自动生成的style样式



推荐阅读
author-avatar
广东庚舞飞扬
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有