如何在CKEditor中配置“图像属性”对话框? [英] How do I configure the Image Properties dialog box in 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:
- 我要删除Width,Height,Border,HSpace,VSpace,Alignment和在
图像信息
屏幕上预览元素 - 我要删除
Link
标签 - 我要启用
上传
标签,以便用户可以选择位于其本地计算机上的图像文件
- I want to remove the Width, Height, Border, HSpace, VSpace, Alignment, and Preview elements from the
Image Info
screen - I want to remove the
Link
tab - 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屋!