Ticket #6217: 6217.patch

File 6217.patch, 3.0 KB (added by Garry Yao, 12 years ago)
  • _source/plugins/wysiwygarea/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    751751                                                        {
    752752                                                                var sel = editor.getSelection(),
    753753                                                                        selected = sel.getSelectedElement(),
    754                                                                         range  = sel.getRanges()[ 0 ];
     754                                                                        range = sel.getRanges()[ 0 ],
     755                                                                        path = new CKEDITOR.dom.elementPath( range.startContainer ),
     756                                                                        block,
     757                                                                        parent,
     758                                                                        next,
     759                                                                        previous;
    755760
    756761                                                                // Override keystrokes which should have deletion behavior
    757762                                                                //  on fully selected element . (#4047) (#7645)
     
    770775                                                                        editor.fire( 'saveSnapshot' );
    771776
    772777                                                                        evt.data.preventDefault();
    773                                                                         return;
     778                                                                }
     779                                                                else
     780                                                                {
     781                                                                        // Handle the following special cases: (#6217)
     782                                                                        // 1. Del key before table;
     783                                                                        // 2. Backspace key after start of table.
     784                                                                        if ( keyCode == 46 &&
     785                                                                                 ( block = path.block ) &&
     786                                                                                 range.checkEndOfBlock() &&
     787                                                                                 ( next = block.getNext( notWhitespaceEval ) ) &&
     788                                                                                 next.is( 'table' ) )
     789                                                                        {
     790                                                                                editor.fire( 'saveSnapshot' );
     791
     792                                                                                // Remove the current empty block.
     793                                                                                if ( range.checkStartOfBlock() )
     794                                                                                        block.remove();
     795
     796                                                                                // Move cursor to the beginning of table cell.
     797                                                                                range.moveToElementEditStart( next );
     798                                                                                range.select();
     799
     800                                                                                editor.fire( 'saveSnapshot' );
     801
     802                                                                                evt.data.preventDefault();
     803                                                                        }
     804                                                                        else if ( keyCode == 8 &&
     805                                                                                          path.blockLimit.is( 'td' ) &&
     806                                                                                          ( parent = path.blockLimit.getAscendant( 'table' ) ) &&
     807                                                                                          range.checkBoundaryOfElement( parent, CKEDITOR.START ) &&
     808                                                                                          ( previous = parent.getPrevious( notWhitespaceEval ) ) )
     809                                                                        {
     810                                                                                editor.fire( 'saveSnapshot' );
     811
     812                                                                                // Move cursor to the end of previous block.
     813                                                                                range.moveToElementEditEnd( previous );
     814
     815                                                                                // Remove any previous empty block.
     816                                                                                if ( range.checkStartOfBlock() && range.checkEndOfBlock() )
     817                                                                                        previous.remove();
     818                                                                                else
     819                                                                                        range.select();
     820
     821                                                                                editor.fire( 'saveSnapshot' );
     822
     823                                                                                evt.data.preventDefault();
     824                                                                        }
     825
    774826                                                                }
    775827                                                        }
    776828
  • _source/core/dom/range.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    19751975                                                                                                 CKEDITOR.POSITION_AFTER_START );
    19761976                                                found = 1;
    19771977                                        }
     1978                                        // Move before bogus br.
     1979                                        else if ( isMoveToEnd && el.is( 'br' ) && this.checkEndOfBlock() )
     1980                                                this.moveToPosition( el, CKEDITOR.POSITION_BEFORE_START );
    19781981                                }
    19791982
    19801983                                el = nextDFS( el, found );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy