Arek Wtykło

Dodanie nbsp (ctrl+space)

@@ -17,5 +17,5 @@ CKEDITOR.editorConfig = function( config ) { @@ -17,5 +17,5 @@ CKEDITOR.editorConfig = function( config ) {
17 ]; 17 ];
18 18
19 config.disableNativeSpellChecker = false; 19 config.disableNativeSpellChecker = false;
20 - config.extraPlugins = 'autolink,image2,widget,widgetselection,lineutils'; 20 + config.extraPlugins = 'autolink,image2,widget,widgetselection,lineutils,nbsp';
21 }; 21 };
  1 +/**
  2 + * @file insert Non-Breaking SPace for CKEditor
  3 + * Copyright (C) 2014 Alfonso Martínez de Lizarrondo
  4 + * Create a command and enable the Ctrl+Space shortcut to insert a non-breaking space in CKEditor
  5 + *
  6 + */
  7 +
  8 +CKEDITOR.plugins.add( 'nbsp',
  9 +{
  10 + init : function( editor )
  11 + {
  12 + // Insert   if Ctrl+Space is pressed:
  13 + editor.addCommand( 'insertNbsp', {
  14 + exec: function( editor ) {
  15 + editor.insertHtml( ' ' );
  16 + }
  17 + });
  18 + editor.setKeystroke( CKEDITOR.CTRL + 32 /* space */, 'insertNbsp' );
  19 + }
  20 +
  21 +} );