Ticket #3151: 3151.patch

File 3151.patch, 5.4 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/blockquote/plugin.js

     
    105105                                // If no paragraphs, create one from the current selection position.
    106106                                if ( paragraphs.length < 1 )
    107107                                {
    108                                         var para = editor.document.createElement( editor.config.enterMode ),
     108                                        var para = editor.document.createElement( editor.config.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ),
    109109                                                firstBookmark = bookmarks.shift();
    110110                                        range.insertNode( para );
    111111                                        para.append( new CKEDITOR.dom.text( '\ufeff', editor.document ) );
     
    245245                                                bqBlock.remove();
    246246                                }
    247247
    248                                 if ( editor.config.enterMode == 'br' )
     248                                if ( editor.config.enterMode == CKEDITOR.ENTER_BR )
    249249                                {
    250250                                        var firstTime = true;
    251251                                        while ( movedNodes.length )
  • _source/plugins/wysiwygarea/plugin.js

     
    5252                                var toSplit;
    5353
    5454                                // If the new node is a block element, split the current block (if any).
    55                                 if ( this.config.enterMode != 'br' && isBlock )
     55                                if ( this.config.enterMode != CKEDITOR.ENTER_BR && isBlock )
    5656                                {
    5757                                        var startPath = new CKEDITOR.dom.elementPath( range.startContainer ),
    5858                                                j = 0,
  • _source/plugins/list/plugin.js

     
    7777                                rootNode = null,
    7878                                currentIndex = baseIndex,
    7979                                indentLevel = Math.max( listArray[ baseIndex ].indent, 0 ),
    80                                 currentListItem = null;
     80                                currentListItem = null,
     81                                paragraphName = ( paragraphMode == CKEDITOR.ENTER_P ? 'p' : 'div' );
    8182                        while ( true )
    8283                        {
    8384                                var item = listArray[ currentIndex ];
     
    8586                                {
    8687                                        if ( !rootNode || listArray[ currentIndex ].parent.getName() != rootNode.getName() )
    8788                                        {
    88                                                 rootNode = listArray[ currentIndex ].parent.clone( false );
     89                                                rootNode = listArray[ currentIndex ].parent.clone( false, true );
    8990                                                retval.append( rootNode );
    9091                                        }
    9192                                        currentListItem = rootNode.append( doc.createElement( 'li' ) );
    9293                                        for ( var i = 0 ; i < item.contents.length ; i++ )
    93                                                 currentListItem.append( item.contents[i].clone( true ) );
     94                                                currentListItem.append( item.contents[i].clone( true, true ) );
    9495                                        currentIndex++;
    9596                                }
    9697                                else if ( item.indent == Math.max( indentLevel, 0 ) + 1 )
     
    106107                                                currentListItem = doc.createElement( 'li' );
    107108                                        else
    108109                                        {
    109                                                 if ( paragraphMode != 'br' && item.grandparent.getName() != 'td' )
    110                                                         currentListItem = doc.createElement( paragraphMode );
     110                                                if ( paragraphMode != CKEDITOR.ENTER_BR && item.grandparent.getName() != 'td' )
     111                                                        currentListItem = doc.createElement( paragraphName );
    111112                                                else
    112113                                                        currentListItem = new CKEDITOR.dom.documentFragment( doc );
    113114                                        }
    114115
    115116                                        for ( var i = 0 ; i < item.contents.length ; i++ )
    116                                                 currentListItem.append( item.contents[i].clone( true ) );
     117                                                currentListItem.append( item.contents[i].clone( true, true ) );
    117118
    118119                                        if ( currentListItem.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT )
    119120                                        {
     
    124125                                                currentListItem.append( doc.createElement( 'br' ) );
    125126                                        }
    126127
    127                                         if ( currentListItem.getName() == paragraphMode && currentListItem.$.firstChild )
     128                                        if ( currentListItem.getName() == paragraphName && currentListItem.$.firstChild )
    128129                                        {
    129130                                                currentListItem.trim();
    130131                                                var firstChild = currentListItem.getFirst();
     
    364365                                body.trim();
    365366                                if ( !body.getFirst() )
    366367                                {
    367                                         var paragraph = doc.createElement( editor.config.enterMode );
     368                                        var paragraph = doc.createElement( editor.config.enterMode == CKEDITOR.ENTER_P ? 'p' :
     369                                                        ( editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'br' ) );
    368370                                        paragraph.appendTo( body );
    369371                                        ranges = [ new CKEDITOR.dom.range( doc ) ];
    370372                                        ranges[0].selectNodeContents( paragraph );
  • _source/core/dom/node.js

     
    9292                        return element;
    9393                },
    9494
    95                 clone : function( includeChildren )
     95                clone : function( includeChildren, cloneId )
    9696                {
    9797                        var $clone = this.$.cloneNode( includeChildren );
    9898                       
    99                         if ( this.type == CKEDITOR.NODE_ELEMENT )
     99                        if ( this.type == CKEDITOR.NODE_ELEMENT && !cloneId )
    100100                        {
    101101                                // The "id" attribute should never be cloned to avoid duplication.
    102102                                $clone.removeAttribute( 'id', false ) ;
  • _source/core/dom/documentFragment.js

     
    3434                'getLast' : 1,
    3535                'appendTo' : 1,
    3636                'moveChildren' : 1,
     37                'insertBefore' : 1,
    3738                'insertAfterNode' : 1,
    3839                'replace' : 1,
    3940                'trim' : 1,
     
    4344                'getChildCount' : 1,
    4445                'getChild' : 1,
    4546                'getChildren' : 1
    46         } );
    47  No newline at end of file
     47        } );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy