IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
78 | 78 | && node.getName() in CKEDITOR.dtd.$removeEmpty; |
79 | 79 | } |
80 | 80 | |
81 | | function singletonBlock( node ) |
82 | | { |
83 | | var body = range.document.getBody(); |
84 | | return !node.is( 'body' ) && body.getChildCount() == 1; |
85 | | } |
86 | | |
87 | 81 | var start = range.startContainer, |
88 | 82 | offset = range.startOffset; |
89 | 83 | |
… |
… |
|
91 | 85 | return false; |
92 | 86 | |
93 | 87 | // 1. Empty inline element. <span>^</span> |
94 | | // 2. Adjoin to inline element. <p><strong>text</strong>^</p> |
95 | | // 3. The only empty block in document. <body><p>^</p></body> (#7222) |
96 | | return !CKEDITOR.tools.trim( start.getHtml() ) ? isInlineCt( start ) || singletonBlock( start ) |
| 88 | // 2. Empty block. <p>^</p> (#7222) |
| 89 | // 3. Adjoin to inline element. <p><strong>text</strong>^</p> |
| 90 | return !CKEDITOR.tools.trim( start.getHtml() ) ? isInlineCt( start ) || start.isBlockBoundary() |
97 | 91 | : isInlineCt( start.getChild( offset - 1 ) ) || isInlineCt( start.getChild( offset ) ); |
98 | 92 | } |
99 | 93 | |
… |
… |
|
559 | 553 | |
560 | 554 | if ( CKEDITOR.env.webkit ) |
561 | 555 | { |
| 556 | // Before keystroke is handled by editor, check to remove the filling char. |
562 | 557 | doc.on( 'keydown', function( evt ) |
563 | 558 | { |
564 | 559 | var key = evt.data.getKey(); |
… |
… |
|
579 | 574 | removeFillingChar( editor.document ); |
580 | 575 | } |
581 | 576 | |
582 | | }, null, null, 10 ); |
| 577 | }, null, null, -1 ); |
583 | 578 | } |
584 | 579 | }); |
585 | 580 | |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
767 | 767 | |
768 | 768 | domDocument.getDocumentElement().addClass( domDocument.$.compatMode ); |
769 | 769 | // Override keystroke behaviors. |
770 | | editable && domDocument.on( 'keydown', function( evt ) |
| 770 | editor.on( 'key', function( evt ) |
771 | 771 | { |
772 | | var keyCode = evt.data.getKeystroke(); |
| 772 | var keyCode = evt.data.keyCode; |
773 | 773 | |
774 | 774 | // Backspace OR Delete. |
775 | 775 | if ( keyCode in { 8 : 1, 46 : 1 } ) |
… |
… |
|
799 | 799 | |
800 | 800 | editor.fire( 'saveSnapshot' ); |
801 | 801 | |
802 | | evt.data.preventDefault(); |
| 802 | evt.cancel(); |
803 | 803 | } |
804 | | else |
| 804 | else if ( range.collapsed ) |
805 | 805 | { |
806 | 806 | // Handle the following special cases: (#6217) |
807 | 807 | // 1. Del/Backspace key before/after table; |
… |
… |
|
823 | 823 | |
824 | 824 | editor.fire( 'saveSnapshot' ); |
825 | 825 | |
826 | | evt.data.preventDefault(); |
| 826 | evt.cancel(); |
827 | 827 | } |
828 | 828 | else if ( path.blockLimit.is( 'td' ) && |
829 | 829 | ( parent = path.blockLimit.getAscendant( 'table' ) ) && |
… |
… |
|
843 | 843 | |
844 | 844 | editor.fire( 'saveSnapshot' ); |
845 | 845 | |
846 | | evt.data.preventDefault(); |
| 846 | evt.cancel(); |
847 | 847 | } |
848 | 848 | |
849 | 849 | } |
… |
… |
|
865 | 865 | range = new CKEDITOR.dom.range( domDocument ); |
866 | 866 | range[ keyCode == 33 ? 'moveToElementEditStart' : 'moveToElementEditEnd']( body ); |
867 | 867 | range.select(); |
868 | | evt.data.preventDefault(); |
| 868 | evt.cancel(); |
869 | 869 | } |
870 | 870 | } |
871 | 871 | |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
784 | 784 | CKEDITOR.dtd[ node.getName() ][ '#' ]; |
785 | 785 | } |
786 | 786 | |
787 | | // Merge the visual line content at the cursor range into the block. |
| 787 | // Join visually two block lines. |
788 | 788 | function joinNextLineToCursor( editor, cursor, nextCursor ) |
789 | 789 | { |
790 | 790 | editor.fire( 'saveSnapshot' ); |
… |
… |
|
798 | 798 | |
799 | 799 | // Kill original bogus; |
800 | 800 | var currentPath = new CKEDITOR.dom.elementPath( cursor.startContainer ); |
801 | | var currentLi = currentPath.lastElement.getAscendant( 'li', 1 ); |
| 801 | var currentBlock = currentPath.lastElement.getAscendant( 'li', 1 ) || currentPath.block; |
802 | 802 | |
803 | 803 | var bogus = currentPath.block.getBogus(); |
804 | 804 | bogus && bogus.remove(); |
… |
… |
|
815 | 815 | else |
816 | 816 | cursor.startContainer.append( frag ); |
817 | 817 | |
818 | | var nextPath = new CKEDITOR.dom.elementPath( nextCursor.startContainer ); |
819 | | var nextLi = nextCursor.startContainer.getAscendant( 'li', 1 ); |
| 818 | var nextPath = new CKEDITOR.dom.elementPath( nextCursor.startContainer ), |
| 819 | nextLi = nextCursor.startContainer.getAscendant( 'li', 1 ); |
820 | 820 | |
821 | 821 | // Move the sub list nested in the next list item. |
822 | 822 | if ( nextLi ) |
… |
… |
|
825 | 825 | if ( sublist ) |
826 | 826 | { |
827 | 827 | // If next line is in the sub list of the current list item. |
828 | | if ( currentLi.contains( nextLi ) ) |
| 828 | if ( currentBlock.contains( nextLi ) ) |
829 | 829 | { |
830 | 830 | mergeChildren( sublist, nextLi.getParent(), nextLi ); |
831 | 831 | sublist.remove(); |
832 | 832 | } |
833 | 833 | // Migrate the sub list to current list item. |
834 | 834 | else |
835 | | currentLi.append( sublist ); |
| 835 | currentBlock.append( sublist ); |
836 | 836 | } |
837 | 837 | } |
838 | 838 | |
… |
… |
|
918 | 918 | if ( !range.collapsed ) |
919 | 919 | return; |
920 | 920 | |
| 921 | var path = new CKEDITOR.dom.elementPath( range.startContainer ); |
921 | 922 | var isBackspace = key == 8; |
922 | 923 | var body = editor.document.getBody(); |
923 | 924 | var walker = new CKEDITOR.dom.walker( range.clone() ); |
924 | 925 | walker.evaluator = function( node ) { return nonEmpty( node ) && !blockBogus( node ); }; |
| 926 | walker.guard = function( node, isOut ) { return !( isOut && node.type == CKEDITOR.NODE_ELEMENT && node.is( 'table' ) ) }; |
925 | 927 | |
926 | 928 | var cursor = range.clone(); |
927 | 929 | |
… |
… |
|
929 | 931 | { |
930 | 932 | var previous, joinWith; |
931 | 933 | |
932 | | var path = new CKEDITOR.dom.elementPath( range.startContainer ); |
933 | | |
934 | 934 | // Join a sub list's first line, with the previous visual line in parent. |
935 | 935 | if ( ( previous = path.contains( listNodeNames ) ) && |
936 | 936 | range.checkBoundaryOfElement( previous, CKEDITOR.START ) && |
… |
… |
|
973 | 973 | joinNextLineToCursor( editor, cursor, range ); |
974 | 974 | evt.cancel(); |
975 | 975 | } |
976 | | } |
977 | | else |
978 | | { |
979 | | var li = range.startContainer.getAscendant( 'li', 1 ); |
| 976 | else |
| 977 | { |
| 978 | var list = path.contains( listNodeNames ), li; |
| 979 | // Backspace pressed at the start of list outdents the first list item. (#9129) |
| 980 | if ( list && range.checkBoundaryOfElement( list, CKEDITOR.START ) ) |
| 981 | { |
| 982 | li = list.getFirst( nonEmpty ); |
| 983 | |
| 984 | if ( range.checkBoundaryOfElement( li, CKEDITOR.START ) ) |
| 985 | { |
| 986 | previous = list.getPrevious( nonEmpty ); |
| 987 | |
| 988 | // Only if the list item contains a sub list, do nothing but |
| 989 | // simply move cursor backward one character. |
| 990 | if ( getSubList( li ) ) |
| 991 | { |
| 992 | if ( previous ) { |
| 993 | range.moveToElementEditEnd( previous ); |
| 994 | range.select(); |
| 995 | } |
| 996 | |
| 997 | evt.cancel(); |
| 998 | } |
| 999 | else |
| 1000 | { |
| 1001 | editor.execCommand( 'outdent' ); |
| 1002 | evt.cancel(); |
| 1003 | } |
| 1004 | } |
| 1005 | } |
| 1006 | } |
| 1007 | } |
| 1008 | else |
| 1009 | { |
| 1010 | var next, |
| 1011 | nextLine, |
| 1012 | li = range.startContainer.getAscendant( 'li', 1 ); |
| 1013 | |
980 | 1014 | if ( li ) |
981 | 1015 | { |
982 | 1016 | walker.range.setEndAt( body, CKEDITOR.POSITION_BEFORE_END ); |
… |
… |
|
1007 | 1041 | if ( isAtEnd && next ) |
1008 | 1042 | { |
1009 | 1043 | // Put cursor range there. |
1010 | | var nextLine = range.clone(); |
| 1044 | nextLine = range.clone(); |
1011 | 1045 | nextLine.moveToElementEditStart( next ); |
1012 | 1046 | |
1013 | 1047 | joinNextLineToCursor( editor, cursor, nextLine ); |
1014 | 1048 | evt.cancel(); |
| 1049 | } |
| 1050 | } |
| 1051 | else |
| 1052 | { |
| 1053 | // Handle Del key pressed before the list. |
| 1054 | walker.range.setEndAt( body, CKEDITOR.POSITION_BEFORE_END ); |
| 1055 | next = walker.next(); |
| 1056 | |
| 1057 | if ( next && next.type == CKEDITOR.NODE_ELEMENT && |
| 1058 | next.getName() in listNodeNames ) |
| 1059 | { |
| 1060 | // The start <li> |
| 1061 | next = next.getFirst( nonEmpty ); |
| 1062 | |
| 1063 | // Simply remove the current empty block, move cursor to the |
| 1064 | // subsequent list. |
| 1065 | if ( path.block && |
| 1066 | range.checkStartOfBlock() && |
| 1067 | range.checkEndOfBlock() ) |
| 1068 | { |
| 1069 | path.block.remove(); |
| 1070 | range.moveToElementEditStart( next ); |
| 1071 | range.select(); |
| 1072 | evt.cancel(); |
| 1073 | } |
| 1074 | |
| 1075 | // Preventing the default (merge behavior), but simply move |
| 1076 | // the cursor one character forward if subsequent list item |
| 1077 | // contains sub list. |
| 1078 | else if ( getSubList( next ) ) |
| 1079 | { |
| 1080 | range.moveToElementEditStart( next ); |
| 1081 | range.select(); |
| 1082 | evt.cancel(); |
| 1083 | } |
1015 | 1084 | } |
1016 | 1085 | } |
1017 | 1086 | } |