Created
July 27, 2015 19:42
-
-
Save adamkudrna/84b44f18d91afdf136aa to your computer and use it in GitHub Desktop.
CKEditor nbsp plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file insert Non-Breaking SPace for CKEditor | |
* Copyright (C) 2014 Alfonso Martínez de Lizarrondo | |
* Create a command and enable the Ctrl+Space shortcut to insert a non-breaking space in CKEditor | |
* | |
*/ | |
CKEDITOR.plugins.add( 'nbsp', | |
{ | |
init : function( editor ) | |
{ | |
// Insert if Ctrl+Space is pressed: | |
editor.addCommand( 'insertNbsp', { | |
exec: function( editor ) { | |
editor.insertHtml( ' ' ); | |
} | |
}); | |
editor.setKeystroke( CKEDITOR.CTRL + 32 /* space */, 'insertNbsp' ); | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Download from http://ckeditor.com/addon/nbsp, does not have public repository.