X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpastefromword%2Fplugin.js;h=a5a90d51074e1e386a44db3ae7a5d0b259cb3d9d;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hp=2e0b3d402d6c99d3e10f16946d93ec6741a89501;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/_source/plugins/pastefromword/plugin.js b/_source/plugins/pastefromword/plugin.js index 2e0b3d4..a5a90d5 100644 --- a/_source/plugins/pastefromword/plugin.js +++ b/_source/plugins/pastefromword/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() @@ -27,7 +27,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license exec : function() { forceFromWord = 1; - if( editor.execCommand( 'paste' ) === false ) + if ( editor.execCommand( 'paste' ) === false ) { editor.on( 'dialogHide', function ( evt ) { @@ -35,6 +35,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license resetFromWord(); }); } + else + resetFromWord(); } }); @@ -45,6 +47,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license command : 'pastefromword' }); + editor.on( 'pasteState', function( evt ) + { + editor.getCommand( 'pastefromword' ).setState( evt.data ); + }); + editor.on( 'paste', function( evt ) { var data = evt.data, @@ -59,7 +66,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Event continuation with the original data. if ( isLazyLoad ) editor.fire( 'paste', data ); - else if( !editor.config.pasteFromWordPromptCleanup + else if ( !editor.config.pasteFromWordPromptCleanup || ( forceFromWord || confirm( editor.lang.pastefromword.confirmCleanup ) ) ) { data[ 'html' ] = CKEDITOR.cleanWord( mswordHtml, editor ); @@ -87,17 +94,21 @@ For licensing, see LICENSE.html or http://ckeditor.com/license || ( this.path + 'filter/default.js' ) ); // Load with busy indicator. - CKEDITOR.scriptLoader.load( filterFilePath, callback, null, false, true ); + CKEDITOR.scriptLoader.load( filterFilePath, callback, null, true ); } return !isLoaded; - } + }, + + requires : [ 'clipboard' ] }); })(); /** - * Whether prompt the user about the clean-up of content from MS-Word. + * Whether to prompt the user about the clean up of content being pasted from + * MS Word. * @name CKEDITOR.config.pasteFromWordPromptCleanup + * @since 3.1 * @type Boolean * @default undefined * @example @@ -105,9 +116,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ /** - * The file that provides the MS-Word Filtering rules. - * Note: It's a global configuration which are shared by all editor instances. + * The file that provides the MS Word cleanup function for pasting operations. + * Note: This is a global configuration shared by all editor instances present + * in the page. * @name CKEDITOR.config.pasteFromWordCleanupFile + * @since 3.1 * @type String * @default 'default' * @example