Hi,
I build up a little plugin wich prevent deleting text if the backspace key
is holding down.
I grab the most part of the code from the keystrokes plugin, here's my code:
CKEDITOR.plugins.add('nobackspace, { init: function(editor) { var pluginName = 'nobackspace'; } }); (function() { var pressed; var onKeyPress = function( event ) { if( event.data.$.keyCode == 8 ) { if(pressed === true) event.data.$.preventDefault(); else pressed = true; }; } var onKeyUp = function( event ) { if ( event.data.$.keyCode == 8) pressed = false; } CKEDITOR.keystrokeHandler.prototype = { attach : function( domObject ) { domObject.on( 'keypress', onKeyPress, this); domObject.on( 'keyup', onKeyUp, this); } }; })();
It works fine except now the "ENTER_BR;" option has no
effect anymore.
If I press the enter key, a new paragraphe is still created in the editor.
Can someone please tells me why and how to fix it ?
Thanks.
Re: ENTER_BR option doesn't work anymore ?
config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;
My config file looks like this now.
Re: ENTER_BR option doesn't work anymore ?
I'm afraid that pb is deepest than that.
Any idea ?