栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP > php开源框架 > dedecms

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

dedecms 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

1. 找到文件includeckeditorpluginsimagedialogsimage.js

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样式


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/7528.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号