If I understand it correctly there is a function in TinyMCE to strip all formatting when pasting text with ctrl V?

This is http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste it right?

How do I activate this in the TinyMCE (Wysiwyg module) in Drupal?

Comments

boborg’s picture

Well it seems this is the same as Force cleanup on standard paste?

But even with that enabled I get the formatting included using ctrl + v. I want ctrl + v to do the same as the paste as plain text button in Tinymce.

Isn't that possible?

I thought that enabling it would force the popup window where you paste text. But I don't get this window ctrl + v just paste the text with formatting in Firefox and Chrome. In IE it's pasted without formatting.

Hope someone can sort out this major issue for me.

choster’s picture

I'm pretty sure the "cleanup" means that TinyMCE tries to dump the extraneous markup that MS Office inserts. It would not strip out basic boldface, italics, etc. In cases where it's important to do that, I either disable the editor or instruct the user to paste first into Notepad.

boborg’s picture

That's certainly an option. If anybody should know an option to have ctrl + v invoke the plain text poup window then please let me know.

picco’s picture

I had the similar need.
I successfully created a new wysiwyg plugin that forces plain-text paste:

JS code:

Drupal.wysiwyg.plugins['pasteplain'] = {
  attach: function(content, settings, instanceId) {
	var instance = tinyMCE.getInstanceById(instanceId);
	instance.onPaste.add(function(ed, e, o) {
		instance.execCommand('mcePasteText', true);
		tinymce.dom.Event.cancel(e);
	})
  },
};
ZuluWarrior’s picture

Please forgive the simple mindedness of my question...

But where do you insert this code? Given the standard setup of Drupal 6, Wysiwyg Module and TinyMCE 3.5 ??

I am experimenting, but am keen to put this in the right place before uploading to my live sites...

Many Thanks...