- clipboardDiv.setHtml( '' );\r
-\r
- clipboardDiv.appendTo( body );\r
- }\r
-\r
- // The "enabled" flag is used to check whether the paste operation has\r
- // been completed (the onpaste event has been fired).\r
- var enabled = false;\r
- var setEnabled = function()\r
- {\r
- enabled = true;\r
- };\r
-\r
- body.on( 'paste', setEnabled );\r
-\r
- // Create a text range and move it inside the div.\r
- var textRange = body.$.createTextRange();\r
- textRange.moveToElementText( clipboardDiv.$ );\r
-\r
- // The execCommand in will fire the "onpaste", only if the\r
- // security settings are enabled.\r
- textRange.execCommand( 'Paste' );\r
-\r
- // Get the DIV html and reset it.\r
- var html = clipboardDiv.getHtml();\r
- clipboardDiv.setHtml( '' );\r
+ editor.on( 'pasteState', function( evt )\r
+ {\r
+ editor.getCommand( 'pastetext' ).setState( evt.data );\r
+ });\r
+ },\r