How to remove link targets in ckeditor?

I would like to either remove some parameters from the link selection target, or indicate which parameters to show. For example, by default, I have several that I do not need, for example, a frame and a popup.

My question is, how can you specify the target parameters of the link or delete certain target parameters on ckeditor?

See screenshot

note that I have already removed the Advanced tab using

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

enter image description here

+4
source share
1 answer

using an example here .

You can install itemsusing the following: -

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');

  }
});
+4
source

Source: https://habr.com/ru/post/1658126/


All Articles