简体   繁体   English

如何删除ckeditor中的链接目标选项?

[英]How to remove link target options in ckeditor?

I would like to either remove some of the options from the link target select element or specify which options to show. 我想从链接目标选择元素中删除一些选项或指定要显示的选项。 For example, the default has several that I don't need such as frame and popup window. 例如,默认有几个我不需要的,例如框架和弹出窗口。

My question is, how can you specify the link target options or remove certain target options on ckeditor? 我的问题是,如何在ckeditor上指定链接目标选项或删除某些目标选项?

Please see screenshot 请看截图

note that I have already removed the advanced tab using 请注意我已经删除了高级选项卡

config.removeDialogTabs = 'link:advanced';
config.removeDialogTabs = 'image:advanced';

在此输入图像描述

using the example here . 这里使用示例。

You can set the items using this:- 您可以使用此设置items : -

CKEDITOR.on('dialogDefinition', function(ev) {

  var dialogName = ev.data.name;

  if (dialogName == 'link') {

    var dialogDefinition = ev.data.definition;
    var informationTab = dialogDefinition.getContents('target');
    var targetField = informationTab.get('linkTargetType');

    // just <not set> and New Window (_blank)
    targetField.items = targetField.items.filter(x => x[1] == '_blank' || x[1] == 'notSet');

  }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM