}\r
};\r
\r
+ function cancel( evt ) { evt.cancel(); }\r
+\r
// Allow to peek clipboard content by redirecting the\r
// pasting content into a temporary bin and grab the content of it.\r
function getClipboardData( evt, mode, callback )\r
\r
var bms = sel.createBookmarks();\r
\r
+ this.on( 'selectionChange', cancel, null, null, 0 );\r
+\r
// Turn off design mode temporarily before give focus to the paste bin.\r
if ( mode == 'text' )\r
{\r
{\r
mode == 'text' && CKEDITOR.env.gecko && editor.focusGrabber.focus();\r
pastebin.remove();\r
+ editor.removeListener( 'selectionChange', cancel );\r
\r
// Grab the HTML contents.\r
// We need to look for a apple style wrapper on webkit it also adds\r
else if ( data[ 'text' ] )\r
editor.insertText( data[ 'text' ] );\r
\r
+ setTimeout( function () { editor.fire( 'afterPaste' ); }, 0 );\r
+\r
}, null, null, 1000 );\r
\r
editor.on( 'pasteDialog', function( evt )\r
{\r
// The very last guard to make sure the\r
// paste has successfully happened.\r
- if ( !data )\r
+ if ( !CKEDITOR.tools.trim( data.toLowerCase().replace( /<span[^>]+data-cke-bookmark[^<]*?<\/span>/g,'' ) ) )\r
return;\r
\r
var dataTransfer = {};\r