Ticket #9129: 9129_2.patch

File 9129_2.patch, 3.5 KB (added by Garry Yao, 12 years ago)
  • _source/plugins/selection/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    8181                function singletonBlock( node )
    8282                {
    8383                        var body = range.document.getBody();
    84                         return !node.is( 'body' ) && body.getChildCount() == 1;
     84
     85                        if ( node.isBlockBoundary() &&
     86                             range.checkBoundaryOfElement( body, CKEDITOR.START ) &&
     87                             range.checkBoundaryOfElement( body, CKEDITOR.END ) )
     88                        {
     89                                return true;
     90                        }
    8591                }
    8692
    8793                var start = range.startContainer,
  • _source/plugins/wysiwygarea/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    767767
    768768                                                domDocument.getDocumentElement().addClass( domDocument.$.compatMode );
    769769                                                // Override keystroke behaviors.
    770                                                 editable && domDocument.on( 'keydown', function( evt )
     770                                                editor.on( 'key', function( evt )
    771771                                                {
    772                                                         var keyCode = evt.data.getKeystroke();
     772                                                        var keyCode = evt.data.keyCode;
    773773
    774774                                                        // Backspace OR Delete.
    775775                                                        if ( keyCode in { 8 : 1, 46 : 1 } )
     
    799799
    800800                                                                        editor.fire( 'saveSnapshot' );
    801801
    802                                                                         evt.data.preventDefault();
     802                                                                        evt.cancel();
    803803                                                                }
    804804                                                                else
    805805                                                                {
     
    823823
    824824                                                                                editor.fire( 'saveSnapshot' );
    825825
    826                                                                                 evt.data.preventDefault();
     826                                                                                evt.cancel();
    827827                                                                        }
    828828                                                                        else if ( path.blockLimit.is( 'td' ) &&
    829829                                                                                          ( parent = path.blockLimit.getAscendant( 'table' ) ) &&
     
    843843
    844844                                                                                editor.fire( 'saveSnapshot' );
    845845
    846                                                                                 evt.data.preventDefault();
     846                                                                                evt.cancel();
    847847                                                                        }
    848848
    849849                                                                }
     
    865865                                                                                range = new CKEDITOR.dom.range( domDocument );
    866866                                                                                range[ keyCode == 33 ? 'moveToElementEditStart' : 'moveToElementEditEnd']( body );
    867867                                                                                range.select();
    868                                                                                 evt.data.preventDefault();
     868                                                                                evt.cancel();
    869869                                                                        }
    870870                                                                }
    871871
  • _source/plugins/list/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    973973                                                                joinNextLineToCursor( editor, cursor, range );
    974974                                                                evt.cancel();
    975975                                                        }
     976                                                        else
     977                                                        {
     978                                                                var list = path.contains( listNodeNames ), li;
     979                                                                // Backspace pressed at the start of list, in first list item. (#9129)
     980                                                                if ( list && range.checkBoundaryOfElement( list, CKEDITOR.START ) )
     981                                                                {
     982                                                                        li = path.contains( CKEDITOR.dtd.$listItem );
     983
     984                                                                        // Outdent the list item if:
     985                                                                        // 1. Inside of empty list item.
     986                                                                        // 2. No content to merge before.
     987                                                                        if ( range.checkBoundaryOfElement( li, CKEDITOR.START ) )
     988                                                                        {
     989                                                                                previous = list.getPrevious( nonEmpty );
     990                                                                                if ( range.checkBoundaryOfElement( li, CKEDITOR.END ) ||
     991                                                                                     !previous ||
     992                                                                                     // A special case of "no content to merge before"
     993                                                                                     previous.is( 'table' ) )
     994                                                                                {
     995                                                                                        editor.execCommand( 'outdent' );
     996                                                                                        evt.cancel();
     997                                                                                }
     998                                                                        }
     999                                                                }
     1000                                                        }
    9761001                                                }
    9771002                                                else
    9781003                                                {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy