1 回答
TA贡献2003条经验 获得超2个赞
错误在这里
CKEDITOR.on( 'dialogDefinition', function(e) {
var dialogName = e.data.name,
dialogDefinition = e.data.definition;
if ( dialogName === 'link' ) {
dialogDefinition.onShow = function () {
var dialog = CKEDITOR.dialog.getCurrent(),
linkType = dialog.getContentElement( 'info' , 'linkType' ),
anchorOptions = dialog.getContentElement( 'info' , 'anchorOptions' ),
emailOptions = dialog.getContentElement( 'info' , 'emailOptions' ),
protocol = dialog.getContentElement( 'info' , 'protocol' );
linkType.getElement().hide();
anchorOptions.getElement().hide();
emailOptions.getElement().hide();
protocol.disable();
};
}
} );
我已经用下面的代码更新了这个
CKEDITOR.on( 'dialogDefinition', function(e) {
var dialogName = e.data.name,
dialogDefinition = e.data.definition;
if ( dialogName === 'link' ) {
dialogDefinition.getContents('info').get('protocol')['items'].splice(2, 6);
dialogDefinition.getContents('info').get('linkType')['items'].splice(1, 4);
var target = e.data.definition.getContents('target');
var options = target.get('linkTargetType').items;
for (var i = options.length-1; i >= 0; i--) {
var label = options[i][0];
if (!label.match(/new window/i)) {
options.splice(i, 1);
}
}
var targetField = target.get( 'linkTargetType' );
targetField['default'] = '_blank';
}
} );
添加回答
举报