我希望我的编辑能够使用键盘快捷键来应用标题。
我一直在 ckeditor 网站上试验“击键”方法。它适用于某些事情,但不适用于标题。例如,以下使用Ctrl++为'bold' 应用附加映射Shift:u
config.keystrokes = [
[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 85 /*U*/, 'bold' ],
];
为什么我不能启用标题?
现在这就是我的 config.js 的样子:
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' ],
];
};
我希望将我的更改限制在 ckeditor 目录中(最好只在 config.js 中)。