ckeditor超链接部分的

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 window you are interested in (the "Link" dialog window).
        if ( dialogName == 'link' )
        {
            // Get a reference to the "Link Info" tab.
            var infoTab = dialogDefinition.getContents( 'info' );

            // Set the default value for the URL field.
            var urlField = infoTab.get( 'url' );//这里设置超链接的默认值
            urlField['default'] = 'http://www.mingyunfengshui.com/web/miangxiangjichu.html';

            //var protocolField = infoTab.get( 'protocol' );//这里设置默认的链接协议属性
            //protocolField['default'] = "";

            // Get a reference to the "Target" tab.
            var targetTab = dialogDefinition.getContents( 'target' );

            // Set the default value for the target field.//这里设置超链接默认在新窗口打开
            var targetField = targetTab.get( 'linkTargetType' );
            targetField['default'] = '_blank';
        }
    });

主要设置了三个方面在新窗口打开超链接,超链接的默认值和默认协议

白发渔樵

白发渔樵

发表评论

电子邮件地址不会被公开。 必填项已用*标注