I would like to be able to ALWAYS force a PASTE AS TEXT,
I realise that I can configure the toolbar ti have only the paste text icon but I would like to have anything on the clipboard pasted as pure text even when the user presses Ctrl-V from directly within the editor.

I read on a forum somewhere that I could use...

CKEDITOR.on('instanceReady', function(ev)
{
ev.editor._.commands.paste = ev.editor._.commands.pastetext;
});

coupled with...

  config.keystrokes = [
  [ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ],
  [ CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ],

  [ CKEDITOR.SHIFT + 121 /*F10*/, 'contextMenu' ],

  [ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ],
  [ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ],
  [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'redo' ],

  [ CKEDITOR.CTRL + 76 /*L*/, 'link' ],

  [ CKEDITOR.CTRL + 66 /*B*/, 'bold' ],
  [ CKEDITOR.CTRL + 73 /*I*/, 'italic' ],
  [ CKEDITOR.CTRL + 85 /*U*/, 'underline' ],

  [ CKEDITOR.CTRL + 86 /*V*/, 'pastetext' ],
  [ CKEDITOR.SHIFT + 45 /*INS*/, 'pastetext' ],

  [ CKEDITOR.ALT + 109 /*-*/, 'toolbarCollapse' ]
  ];
<?code>

and I have tried splicing these into the
<code>...\sites\all\modules\core\ckeditor\ckeditor.config.js

file but to no avail.

I then tried splicing them directly into the
...\sites\all\modules\core\ckeditor\ckeditor\config.js file but also to no avail.

Any advice gratefully received.
Thanks

Comments

nfw’s picture

subscribing

wwalc’s picture

Status: Active » Fixed

Check this:

http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.forc...

in other words, add:

config.forcePasteAsPlainText = true;

to ckeditor.config.js

and clear Drupal and browser cache.

dman’s picture

Gawd yes, this would be wonderful.
These days I can't even paste from an email without the editor thinking I want all the style coming along for the ride.
I'll have to try that option out!

wwalc’s picture

I have created a separate issue for making it easier to configure: #703428: Add forcePasteAsPlainText to CKEditor profile.

dman’s picture

I tried out the named option, and it's not what I was looking for. Forcing the pop-up each time is just awkward. I think I really need to transparently 'paste without inline styles'. Ah well, it was worth a try.

sirclickalot’s picture

Great, thank you - that sorted me out.

I must say though that I wholeheartedly agree with #5 - why give the user an extra dialogue, why not just do it!

Chad_Dupuis’s picture

sub

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.