JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.4
[ckeditor.git] / _source / plugins / pastetext / plugin.js
index a523549..42dbf5d 100644 (file)
@@ -58,12 +58,19 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                // Intercept the default pasting process.\r
                                editor.on( 'beforeCommandExec', function ( evt )\r
                                {\r
-                                       if ( evt.data.name == 'paste' )\r
+                                       var mode = evt.data.commandData;\r
+                                       // Do NOT overwrite if HTML format is explicitly requested.\r
+                                       if ( evt.data.name == 'paste' && mode != 'html' )\r
                                        {\r
                                                editor.execCommand( 'pastetext' );\r
                                                evt.cancel();\r
                                        }\r
                                }, null, null, 0 );\r
+\r
+                               editor.on( 'beforePaste', function( evt )\r
+                               {\r
+                                       evt.data.mode = 'text';\r
+                               });\r
                        }\r
 \r
                        editor.on( 'pasteState', function( evt )\r
@@ -82,6 +89,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
  * Whether to force all pasting operations to insert on plain text into the\r
  * editor, loosing any formatting information possibly available in the source\r
  * text.\r
+ * <strong>Note:</strong> paste from word is not affected by this configuration.\r
  * @name CKEDITOR.config.forcePasteAsPlainText\r
  * @type Boolean\r
  * @default false\r