Ticket #9152: 9152_4.patch

File 9152_4.patch, 2.6 KB (added by Garry Yao, 12 years ago)
  • _source/plugins/list/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    797797                var bm = cursor.createBookmark();
    798798
    799799                // Kill original bogus;
    800                 var currentPath = new CKEDITOR.dom.elementPath( cursor.startContainer );
    801                 var currentBlock = currentPath.lastElement.getAscendant( 'li', 1 ) || currentPath.block;
     800                var currentPath = new CKEDITOR.dom.elementPath( cursor.startContainer ),
     801                                pathBlock = currentPath.block,
     802                                currentBlock = currentPath.lastElement.getAscendant( 'li', 1 ) || pathBlock,
     803                                nextPath = new CKEDITOR.dom.elementPath( nextCursor.startContainer ),
     804                                nextLi = nextPath.contains( CKEDITOR.dtd.$listItem ),
     805                                nextList = nextPath.contains( CKEDITOR.dtd.$list ),
     806                                last;
    802807
    803                 var bogus = currentPath.block.getBogus();
    804                 bogus && bogus.remove();
     808                // Remove bogus node the current block/pseudo block.
     809                if ( pathBlock )
     810                {
     811                        var bogus = pathBlock.getBogus();
     812                        bogus && bogus.remove();
     813                }
     814                else if ( nextList )
     815                {
     816                        last = nextList.getPrevious( nonEmpty );
     817                        if ( last && blockBogus( last ) )
     818                                last.remove();
     819                }
    805820
    806821                // Kill the tail br in extracted.
    807                 var last = frag.getLast();
     822                last = frag.getLast();
    808823                if ( last && last.type == CKEDITOR.NODE_ELEMENT && last.is( 'br' ) )
    809824                        last.remove();
    810825
     
    815830                else
    816831                        cursor.startContainer.append( frag );
    817832
    818                 var nextPath = new CKEDITOR.dom.elementPath( nextCursor.startContainer ),
    819                         nextLi = nextCursor.startContainer.getAscendant( 'li', 1 );
    820 
    821833                // Move the sub list nested in the next list item.
    822834                if ( nextLi )
    823835                {
     
    923935                                                var body = editor.document.getBody();
    924936                                                var walker = new CKEDITOR.dom.walker( range.clone() );
    925937                                                walker.evaluator = function( node ) { return nonEmpty( node ) && !blockBogus( node ); };
     938
     939                                                // Backspace/Del behavior at the start/end of table is handled in core.
    926940                                                walker.guard = function( node, isOut ) { return !( isOut && node.type == CKEDITOR.NODE_ELEMENT && node.is( 'table' ) ) };
    927941
    928942                                                var cursor = range.clone();
     
    10791093                                                                        {
    10801094                                                                                range.moveToElementEditStart( next );
    10811095                                                                                range.select();
     1096                                                                                evt.cancel();
     1097                                                                        }
     1098                                                                        // Merge the first list item with the current line.
     1099                                                                        else
     1100                                                                        {
     1101                                                                                nextLine = range.clone();
     1102                                                                                nextLine.moveToElementEditStart( next );
     1103                                                                                joinNextLineToCursor( editor, cursor, nextLine );
    10821104                                                                                evt.cancel();
    10831105                                                                        }
    10841106                                                                }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy