How do I set a plugin on CKEditor when is used from the CDN?

后端 未结 1 756
时光取名叫无心
时光取名叫无心 2021-01-19 03:26

I followed the steps on the CDN Guidelines page for CKEditior, but I can\'t make it work. The plugin that I\'m trying to install is \"autoembed\" (or any plugin that lets me

1条回答
  •  天涯浪人
    2021-01-19 04:03

    There's a method in CKEDITOR.resourceManager called addExternal. You can use it like

    // Loads a plugin from '/myplugin/samples/plugin.js'.
    CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' );
    

    Then simply add autoembed to config.extraPlugins = 'autoembed' like

    CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' );
    
    CKEDITOR.replace( 'element', {
        extraPlugins: 'sample'
    } );
    

    or in config.js:

    CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' );
    
    CKEDITOR.editorConfig = function( config ) {
        config.plugins = 
            'sample,' +
            ...    
    };
    

    0 讨论(0)
提交回复
热议问题