如何在CKEditor中配置“图像属性”对话框? [英] How do I configure the Image Properties dialog box in CKEditor?

查看:372
本文介绍了如何在CKEditor中配置“图像属性”对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前的图像属性对话框仅具有图像信息链接选项卡。我想更改此对话框,以便:

My current Image Properties dialog box only has the Image Info and Link tabs available. I want to change this dialog box so that:


  1. 我要删除Width,Height,Border,HSpace,VSpace,Alignment和在图像信息屏幕上预览元素

  2. 我要删除 Link 标签

  3. 我要启用上传标签,以便用户可以选择位于其本地计算机上的图像文件

  1. I want to remove the Width, Height, Border, HSpace, VSpace, Alignment, and Preview elements from the Image Info screen
  2. I want to remove the Link tab
  3. I want to enable the Upload tab so that users can choose an image file that resides on their local computer

我一直在进行大量搜索,但完全不知道该怎么做。有指针吗?我正在使用CKEditor 4.4.6 Standard。

I've been doing lots of searches but can't understand how to do the above at all. Any pointers please? I am using CKEditor 4.4.6 Standard.

推荐答案

好的,这是有关如何处理图像对话框的代码

Okay, here's the code on how handle the Image dialog:

CKEDITOR.on('dialogDefinition', function(ev) {
    var dialogName = ev.data.name;
    var dialogDefinition = ev.data.definition;

    if (dialogName == 'image') {
        var infoTab = dialogDefinition.getContents( 'info' );
        infoTab.remove( 'txtBorder' ); //Remove Element Border From Tab Info
        infoTab.remove( 'txtHSpace' ); //Remove Element Horizontal Space From Tab Info
        infoTab.remove( 'txtVSpace' ); //Remove Element Vertical Space From Tab Info
        infoTab.remove( 'txtWidth' ); //Remove Element Width From Tab Info
        infoTab.remove( 'txtHeight' ); //Remove Element Height From Tab Info

        //Remove tab Link
        dialogDefinition.removeContents( 'Link' );
    }
});

对于第3点,默认的CKEditor不包含图像浏览功能...这意味着上传和浏览按钮将不会显示...

For point 3, the default CKEditor doesn't contain Image Browsing Facility... And this mean that the upload and browse button will not appear...

此处有3个选项,您可以在此页面上查看我的评论:链接有关如何执行此操作。

There is 3 options here, and you can see my comment on this page: link on how you can do this.

这篇关于如何在CKEditor中配置“图像属性”对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆