Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.6.6
[ckeditor.git]
/
_source
/
plugins
/
pastetext
/
plugin.js
diff --git
a/_source/plugins/pastetext/plugin.js
b/_source/plugins/pastetext/plugin.js
index
d7b1b34
..
d09f498
100644
(file)
--- a/
_source/plugins/pastetext/plugin.js
+++ b/
_source/plugins/pastetext/plugin.js
@@
-1,5
+1,5
@@
/*
\r
/*
\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
@@
-58,13
+58,25
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
// Intercept the default pasting process.
\r
editor.on( 'beforeCommandExec', function ( evt )
\r
{
\r
// 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.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
+
\r
+ editor.on( 'pasteState', function( evt )
\r
+ {
\r
+ editor.getCommand( 'pastetext' ).setState( evt.data );
\r
+ });
\r
},
\r
\r
requires : [ 'clipboard' ]
\r
},
\r
\r
requires : [ 'clipboard' ]
\r
@@
-77,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
* 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
* @name CKEDITOR.config.forcePasteAsPlainText
\r
* @type Boolean
\r
* @default false
\r