-/**\r
- * Whether the "Ignore font face definitions" checkbox is enabled by default in\r
- * the Paste from Word dialog.\r
- * @type Boolean\r
- * @default true\r
- * @example\r
- * config.pasteFromWordIgnoreFontFace = false;\r
- */\r
-CKEDITOR.config.pasteFromWordIgnoreFontFace = true;\r
+ editor.on( 'pasteState', function( evt )\r
+ {\r
+ editor.getCommand( 'pastefromword' ).setState( evt.data );\r
+ });\r
+\r
+ editor.on( 'paste', function( evt )\r
+ {\r
+ var data = evt.data,\r
+ mswordHtml;\r
+\r
+ // MS-WORD format sniffing.\r
+ if ( ( mswordHtml = data[ 'html' ] )\r
+ && ( forceFromWord || ( /(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/ ).test( mswordHtml ) ) )\r
+ {\r
+ var isLazyLoad = this.loadFilterRules( function()\r
+ {\r
+ // Event continuation with the original data.\r
+ if ( isLazyLoad )\r
+ editor.fire( 'paste', data );\r
+ else if ( !editor.config.pasteFromWordPromptCleanup\r
+ || ( forceFromWord || confirm( editor.lang.pastefromword.confirmCleanup ) ) )\r
+ {\r
+ data[ 'html' ] = CKEDITOR.cleanWord( mswordHtml, editor );\r
+ }\r
+ });\r
+\r
+ // The cleanup rules are to be loaded, we should just cancel\r
+ // this event.\r
+ isLazyLoad && evt.cancel();\r
+ }\r
+ }, this );\r
+ },\r
+\r
+ loadFilterRules : function( callback )\r
+ {\r
+\r
+ var isLoaded = CKEDITOR.cleanWord;\r
+\r
+ if ( isLoaded )\r
+ callback();\r
+ else\r
+ {\r
+ var filterFilePath = CKEDITOR.getUrl(\r
+ CKEDITOR.config.pasteFromWordCleanupFile\r
+ || ( this.path + 'filter/default.js' ) );\r
+\r
+ // Load with busy indicator.\r
+ CKEDITOR.scriptLoader.load( filterFilePath, callback, null, true );\r
+ }\r
+\r
+ return !isLoaded;\r
+ },\r
+\r
+ requires : [ 'clipboard' ]\r
+ });\r
+})();\r