編集者が見出しを適用するためにキーボードショートカットを使用できるようにしたい。見出しのckeditorキーボードショートカットを有効にしますか?
私は、ckeditorサイトの"keystrokes" approachを実験しています。それはいくつかのものではなく、見出しでは機能します。例えば、以下はuがはCtrl +Shiftキー + を使用して '太字' の追加のマッピングを適用します。
config.keystrokes = [
[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 85 /*U*/, 'bold' ],
];
は、なぜ私が見出しを有効にすることはできませんか?私は(理想的にのみconfig.jsの内側)CKEditorバージョンのディレクトリに制限され、私の変更を保持するために望んでいる
CKEDITOR.editorConfig = function(config) {
// Define changes to default configuration here.
// For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbarGroups = [
{ name: 'styles', groups: [ 'styles' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'others' },
{ name: 'forms' },
{ name: 'tools' }
];
// Remove some buttons provided by the standard plugins, which are
// not needed in the Standard(s) toolbar.
config.removeButtons = 'Underline,Styles,Strike,Image,Outdent,Indent,Blockquote,Cut,Copy,Paste,PasteFromWord,Undo,Redo';
// Set the most common block elements.
config.format_tags = 'p;h1;h2;h3;h4';
// Simplify the dialog windows.
config.removeDialogTabs = 'image:advanced;link:advanced';
// Whether to escape basic HTML entities in the document, including:
// (nbsp,gt,lt,amp)
config.basicEntities = false;
config.entities_additional = 'lt,gt,amp,quot'
config.entities_latin = false;
config.entities_greek = false;
config.disableNativeSpellChecker = false;
config.removePlugins = 'wsc,scayt';
config.scayt_autoStartup = false;
config.height = 1000;
config.keystrokes =
[
[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 85 /*U*/, 'bold' ],
[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 73 /*I*/, 'h1' ],
];
};
:
今のところ、これはどのように見えるか、私のconfig.jsのです。
可能であれば、これをckeditorディレクトリ内に保存することをお勧めします。このアプローチをconfig.jsファイルまたは別の既存のckeditorファイルで使用できますか?または、これはカスタムプラグインである必要がありますか? – doub1ejack
config.jsやckeditorフォルダ内の別のファイルで実行できるかどうかは分かりませんが、カスタムプラグインとして実行できます。 – Wizard