Как удалить «ссылку на якорь» из редактора «Ссылка» в CKeditor - PullRequest
5 голосов
/ 22 июля 2011

По сути, я удалил кнопку привязки, чтобы в моем окне ссылок не было ссылки на параметр привязки.

Любой способ удалить эту опцию

enter image description here?

Ответы [ 3 ]

6 голосов
/ 28 июля 2011

разобрался

if ( dialogName == 'link' )
    {
      var infoTab = dialogDefinition.getContents( 'info' );
      var linktypeField = infoTab.get( 'linkType' );

      /* Remove it from the array of items */
      linktypeField['items'].splice(1, 1);

    }
3 голосов
/ 27 июля 2011

dialogDefinition позволяет полностью изменить дизайн диалоговых окон.

Я сделал это так, основываясь на примере на http://nightly.ckeditor.com/7156/_samples/api_dialog.html

CKEDITOR.on( 'dialogDefinition', function( ev )
{
    // Take the dialog name and its definition from the event
    // data.
    var dialogName = ev.data.name;
    var dialogDefinition = ev.data.definition;

    // Check if the definition is from the dialog we're
    // interested on (the "Link" dialog).
    if ( dialogName == 'link' )
    {
        // Get a reference to the "Link Info" tab.
        var infoTab = dialogDefinition.getContents( 'info' );
        infoTab.remove( 'linkType' );
    }
});

$("#mydiv").ckeditor(function(){}, {
    removeDialogTabs: 'link:advanced;link:target'
    // any other customizations go here.
});
0 голосов
/ 25 января 2016

Это моё решение:

CKEDITOR.on('dialogDefinition', function (ev) {
// Take the dialog name and its definition from the event data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
// Check if the definition is from the dialog we're
// interested in (the 'link' dialog).
if (dialogName == 'link') {
    // Remove the 'Target' and 'Advanced' tabs from the 'Link' dialog.
    //dialogDefinition.removeContents('target');
    //dialogDefinition.removeContents('advanced');

    // Get a reference to the 'Link Info' tab.
    var infoTab = dialogDefinition.getContents('info');
    infoTab.remove('protocol');
    infoTab.get('linkType').style = 'display: none';
}

});

Если вы избавитесь от Тип ссылки , используя infoTab.remove('linkType');, не удастся создать ссылку

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...