Drupal 7 在编辑器中删除fMath图像属性对话框
我有点被这件事缠住了,所以如果你能帮助我,那就太好了 我正在使用Drupal7和ckeditor4.3。我正在开发一个网站,其中集成了fmath方程编辑器 我已经禁用了图像按钮,因为我不希望最终用户能够上传他们自己的图像。另一方面,用户可以使用fMath插入方程。fMath处理公式插入的方式是插入img标记 当用户双击此图像或在图像上单击鼠标右键时,他们将访问“图像属性”对话框,可以在其中更改图像的源url和其他一些内容。在url输入文本上,他们可以更改图像的来源,以便在页面上插入自己的图像,这是我不想要的 到目前为止,他们一直在使用两种不同的不成功方法来解决此问题:Drupal 7 在编辑器中删除fMath图像属性对话框,drupal-7,ckeditor,Drupal 7,Ckeditor,我有点被这件事缠住了,所以如果你能帮助我,那就太好了 我正在使用Drupal7和ckeditor4.3。我正在开发一个网站,其中集成了fmath方程编辑器 我已经禁用了图像按钮,因为我不希望最终用户能够上传他们自己的图像。另一方面,用户可以使用fMath插入方程。fMath处理公式插入的方式是插入img标记 当用户双击此图像或在图像上单击鼠标右键时,他们将访问“图像属性”对话框,可以在其中更改图像的源url和其他一些内容。在url输入文本上,他们可以更改图像的来源,以便在页面上插入自己的图像,这
我没有成功。你知道我如何处理这种不受欢迎的行为吗?好的,我在plugin.js文件中得到了类似的结果: 正如您所看到的,我没有禁用对话框本身,而是禁用了不有用的元素。我希望这能对其他人有所帮助
CKEDITOR.plugins.add( 'custom_doubleclick',
{
init: function( editor )
{
// First part, dialogDefinition allow us to remove the
// "Link" and "Advanced" tabs on the dialog
CKEDITOR.on( 'dialogDefinition', function( ev ) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
if ( dialogName == 'image' ) {
dialogDefinition.removeContents( 'Link' );
dialogDefinition.removeContents( 'advanced' );
}
});
// Second part, it disables the textUrl and txtAlt input text boxes
editor.on( 'dialogShow', function( ev ) {
var dialog = ev.data;
var dialogName = dialog.getName();
if ( dialogName == 'image' ) {
//var dialog = CKEDITOR.dialog.getCurrent();
// Get a reference to the Link Info tab.
console.log(dialog)
dialog.getContentElement( 'info','txtUrl' ).disable();
dialog.getContentElement( 'info','txtAlt' ).disable();
}
});
}
});