Ticket #4988: 4988.patch

File 4988.patch, 1.2 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Proposed patch

  • _source/plugins/clipboard/plugin.js

     
    164164                if ( CKEDITOR.env.ie && doc.getById( 'cke_pastebin' ) )
    165165                        return;
    166166
     167                // If the browser supports it, get the data directly
     168                if (mode == 'text' && evt.data && evt.data.$.clipboardData)
     169                {
     170                        // evt.data.$.clipboardData.types contains all the flavours in Mac's Safari, but not on windows.
     171                        var plain = evt.data.$.clipboardData.getData( 'text/plain' );
     172                        if (plain)
     173                        {
     174                                evt.data.preventDefault();
     175                                callback( plain );
     176                                return;
     177                        }
     178                }
     179
    167180                var sel = this.getSelection(),
    168181                        range = new CKEDITOR.dom.range( doc );
    169182
     
    305318                                editor.on( 'contentDom', function()
    306319                                {
    307320                                        var body = editor.document.getBody();
    308                                         body.on( ( mode == 'text' && CKEDITOR.env.ie ) ? 'paste' : 'beforepaste',
     321                                        body.on( ( (mode == 'text' && CKEDITOR.env.ie) || CKEDITOR.env.webkit ) ? 'paste' : 'beforepaste',
    309322                                                function( evt )
    310323                                                {
    311324                                                        if( depressBeforePasteEvent )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy