2016-12-01 6 views
0

CKEditor 4.4の場合、config.jsには、使用するプラグインとそのグループ化の方法を選択するセクションがあります。CKEditor 4.6のプラグインをオフにするにはどうすればいいですか?

このような何か:

config.toolbar = [ 
     { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, 
     { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] }, 
     { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] }, 
     '/', 
     { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }, 
     { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'] }, 
     { name: 'links', items: [ 'Link', 'Unlink', 'Anchor', 'magicformcustom' ] }, 
     { name: 'insert', items: [ 'Table', 'HorizontalRule', 'SpecialChar'] }, 
     { name: 'colors', items: [ 'TextColor', 'BGColor' ] }, 
    ]; 

    // Toolbar groups configuration. 
    config.toolbarGroups = [ 
     { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, 
     { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] }, 
     { name: 'styles' }, 
     '/', 
     { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, 
     { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] }, 
     { name: 'links' }, 
     { name: 'insert' }, 
     { name: 'colors' } 
    ]; 

私はCKEditorバージョン4.6でconfig.jsの中でこれらを検索するときしかし、それらがなくなっていました。自分のサイトの別の場所に別のプラグインを置く必要があるので、私はオンラインのカスタムビルダーを使いたくありません。プラグインを追加/削除する場所はどこですか?

あなたはこのようにCKEditorバージョンをインスタンス化するときは、削除/ Webページ内のプラグインを追加することができます

答えて

2

CKEDITOR.replace('editor1', { 
    extraPlugins: 'iframedialog,uploadimage,divarea,youtube', 
    removePlugins: 'pastetext,pastefromword' 
}); 

そして、あなたはこのようなツールバーに表示されますどのような項目Webページ内で選択することができます。

CKEDITOR.replace('editor1', { 
    toolbar: [ 
     { name: 'document', items: [ 'Source', 'Save' ] }, 
     { name: 'clipboard', items: [ 'Undo', 'Redo' ] }, 
     { name: 'editing', items: [ 'SelectAll' ] }, 
     { name: 'basicstyles', items: [ 'Bold', 'Italic', '-', 'RemoveFormat' ] }, 
     { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight' ] }, 
     { name: 'insert', items: [ 'Image', 'Table', 'Smiley' ] }, 
     { name: 'styles', items: [ 'Font', 'FontSize' ] }, 
     { name: 'colors', items: [ 'TextColor', 'BGColor' ] }, 
     { name: 'tools', items: [ 'Maximize' ] } 
    ] 
}); 

https://github.com/ckeditor/ckeditor-dev/tree/master/plugins

また、Toolbar Configuratorでは、基本設定と詳細設定の両方をチェックすることができますグループとアイテムをリストし、それらをあなたの設定ファイルにコピーするatorタイプ。

+0

これは問題を解決しますが、設定ファイルでこれを行う方法があるかどうかを知りたいですか?以前は、状況に応じていくつかの設定ファイルがありました。 – cytsunny

+0

もっと重要なのは、config.jsにもともと設定されていたプラグインの名前を取得できる方法はありますか? – cytsunny

+1

プラグインの名前はhttps://github.com/ckeditor/ckeditor-dev/tree/master/plugins – Wizard

0

CKEditor設定を設定する方法はたくさんあり、その詳細についてはSetting CKEditor Configurationのドキュメントを参照してください。ここでの主な問題は、デフォルトのCKEditor構成ファイル(config.js)の内容を変更していて、各アップグレードで変更が上書きされることです。これを避けるには、custom configuration fileまたはdefine the configuration in-pageを使用します。

+0

問題は、設定が上書きされずに消えてしまうことです。私は再構成しても構いませんが、上記の行をその位置に置いたときにはうまくいきません。 – cytsunny

関連する問題