Ticket #5144: 5144.patch

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

Proposed patch

  • _source/plugins/clipboard/plugin.js

     
    184184                var pastebin = new CKEDITOR.dom.element( mode == 'text' ? 'textarea' : 'div', doc );
    185185                pastebin.setAttribute( 'id', 'cke_pastebin' );
    186186                // Safari requires a filler node inside the div to have the content pasted into it. (#4882)
    187                 CKEDITOR.env.webkit && pastebin.append( doc.createText( '\xa0' ) );
     187                CKEDITOR.env.webkit && pastebin.append( CKEDITOR.dom.element.createFromHtml( '<div>\xa0</div>' ) );
    188188                doc.getBody().append( pastebin );
    189189
    190190                // It's definitely a better user experience if we make the paste-bin pretty unnoticed
     
    237237                        pastebin.remove();
    238238
    239239                        // Grab the HTML contents.
    240                         // We need to look for a apple style wrapper on webkit it also adds
     240                        // In WebKit we always add an empty div inside the pastebin.
     241                        // After that, we need to look for an apple style wrapper on webkit it also adds
    241242                        // a div wrapper if you copy/paste the body of the editor.
    242243                        // Remove hidden div and restore selection.
    243244                        var bogusSpan;
    244                         pastebin = ( CKEDITOR.env.webkit
    245                                                  && ( bogusSpan = pastebin.getFirst() )
     245                        CKEDITOR.env.webkit && ( pastebin = pastebin.getFirst() )
     246                                                 && ( pastebin = ( bogusSpan = pastebin.getFirst() )
    246247                                                 && ( bogusSpan.is && bogusSpan.hasClass( 'Apple-style-span' ) ) ?
    247248                                                        bogusSpan : pastebin );
    248249
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy