X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fclipboard%2Fplugin.js;h=d6470585fca24506560ca30040fe7d96d2dd08d6;hb=9afde8772159bd3436f1f5b7862960307710ae5a;hp=9dc230ebd1e0ff65f43078532fe353dd4b7334a9;hpb=e371ddf8abcb89013e20e6d0dd746adec344d0e5;p=ckeditor.git diff --git a/_source/plugins/clipboard/plugin.js b/_source/plugins/clipboard/plugin.js index 9dc230e..d647058 100644 --- a/_source/plugins/clipboard/plugin.js +++ b/_source/plugins/clipboard/plugin.js @@ -16,10 +16,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var doc = editor.document, body = doc.getBody(); - var enabled = false; + var enabled = 0; var onExec = function() { - enabled = true; + enabled = 1; }; // The following seems to be the only reliable way to detect that @@ -49,7 +49,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license try { // Other browsers throw an error if the command is disabled. - return editor.document.$.execCommand( type ); + return editor.document.$.execCommand( type, false, null ); } catch( e ) { @@ -163,16 +163,16 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { var doc = this.document; - // Avoid recursions on 'paste' event for IE. - if ( CKEDITOR.env.ie && doc.getById( 'cke_pastebin' ) ) + // Avoid recursions on 'paste' event or consequent paste too fast. (#5730) + if ( doc.getById( 'cke_pastebin' ) ) return; // If the browser supports it, get the data directly - if (mode == 'text' && evt.data && evt.data.$.clipboardData) + if ( mode == 'text' && evt.data && evt.data.$.clipboardData ) { // evt.data.$.clipboardData.types contains all the flavours in Mac's Safari, but not on windows. var plain = evt.data.$.clipboardData.getData( 'text/plain' ); - if (plain) + if ( plain ) { evt.data.preventDefault(); callback( plain ); @@ -254,7 +254,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Cutting off control type element in IE standards breaks the selection entirely. (#4881) function fixCut( editor ) { - if ( !CKEDITOR.env.ie || editor.document.$.compatMode == 'BackCompat' ) + if ( !CKEDITOR.env.ie || CKEDITOR.env.quirks ) return; var sel = editor.getSelection(); @@ -348,7 +348,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license editor.on( 'contentDom', function() { var body = editor.document.getBody(); - body.on( ( (mode == 'text' && CKEDITOR.env.ie) || CKEDITOR.env.webkit ) ? 'paste' : 'beforepaste', + body.on( ( (mode == 'text' && CKEDITOR.env.ie ) || CKEDITOR.env.webkit ) ? 'paste' : 'beforepaste', function( evt ) { if ( depressBeforeEvent )