问问题
264 次
1 回答
0
This is something that you cannot have just by editing the config. Go ahead with the following code (+fiddle):
var codeStyle = new CKEDITOR.style( {
element: 'code'
} );
CKEDITOR.replace( 'editor', {
on: {
instanceReady: function() {
// Register a new command that applies the style.
this.addCommand( 'codeCommand', new CKEDITOR.styleCommand( codeStyle ) );
// Bind the command to CTRL+SHIFT+L.
this.setKeystroke( CKEDITOR.CTRL + CKEDITOR.SHIFT + 76, 'codeCommand' );
}
}
} );
Also see docs for: editor.addCommand
, editor.setKeystroke
and CKEDITOR.styleCommand
.
于 2013-08-30T07:41:07.017 回答