Changeset 7538
- Timestamp:
- 07/04/12 13:17:15 (11 months ago)
- Location:
- CKEditor/trunk
- Files:
-
- 6 edited
-
CHANGES.html (modified) (1 diff)
-
_source/core/dom/element.js (modified) (1 diff)
-
_source/core/dom/range.js (modified) (4 diffs)
-
_source/core/dom/walker.js (modified) (1 diff)
-
_source/plugins/horizontalrule/plugin.js (modified) (1 diff)
-
_source/plugins/wysiwygarea/plugin.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/trunk/CHANGES.html
r7534 r7538 75 75 <li><a href="http://dev.ckeditor.com/ticket/8941">#8941</a> : [Webkit] Content region disappeared when resizing the browser.</li> 76 76 <li><a href="http://dev.ckeditor.com/ticket/8968">#8968</a> : [Firefox] The forcePasteAsPlainText configuration is not working when using Ctrl/Cmd-V.</li> 77 <li><a href="http://dev.ckeditor.com/ticket/6217">#6217</a> : Handled DEL/BACKSPACE key at the boundary of table to unifiy the cursor position.</li> 78 <li><a href="http://dev.ckeditor.com/ticket/8950">#8950</a> : Chagend the cursor position after calling editor::insertElement on block element.</li> 77 79 </ul> 78 80 <h3> -
CKEditor/trunk/_source/core/dom/element.js
r7525 r7538 737 737 || this.getComputedStyle( 'visibility' ) == 'hidden' 738 738 || this.is( 'a' ) && this.data( 'cke-saved-name' ) && !this.getChildCount() 739 || CKEDITOR.dtd.$nonEditable[ name ] ) 739 || CKEDITOR.dtd.$nonEditable[ name ] 740 || CKEDITOR.dtd.$empty[ name ] ) 740 741 { 741 742 return false; -
CKEditor/trunk/_source/core/dom/range.js
r7537 r7538 529 529 { 530 530 baseId = 'cke_bm_' + CKEDITOR.tools.getNextNumber(); 531 startNode.setAttribute( 'id', baseId + 'S');531 startNode.setAttribute( 'id', baseId + ( collapsed ? 'C' : 'S' ) ); 532 532 } 533 533 … … 560 560 561 561 return { 562 startNode : serializable ? baseId + 'S': startNode,562 startNode : serializable ? baseId + ( collapsed ? 'C' : 'S' ) : startNode, 563 563 endNode : serializable ? baseId + 'E' : endNode, 564 564 serializable : serializable, … … 1956 1956 var next; 1957 1957 1958 if ( node.type == CKEDITOR.NODE_ELEMENT 1959 && node.isEditable( false ) 1960 && !CKEDITOR.dtd.$nonEditable[ node.getName() ] ) 1961 { 1958 if ( node.type == CKEDITOR.NODE_ELEMENT && node.isEditable( false ) ) 1962 1959 next = node[ isMoveToEnd ? 'getLast' : 'getFirst' ]( nonWhitespaceOrBookmarkEval ); 1963 }1964 1960 1965 1961 if ( !childOnly && !next ) … … 1967 1963 1968 1964 return next; 1965 } 1966 1967 // Handle non-editable element e.g. HR. 1968 if ( el.type == CKEDITOR.NODE_ELEMENT && !el.isEditable( false ) ) 1969 { 1970 this.moveToPosition( el, isMoveToEnd ? 1971 CKEDITOR.POSITION_AFTER_END : 1972 CKEDITOR.POSITION_BEFORE_START ); 1973 return true; 1969 1974 } 1970 1975 -
CKEditor/trunk/_source/core/dom/walker.js
r7477 r7538 447 447 }; 448 448 449 CKEDITOR.dom.walker.bogus = function( type,isReject )449 CKEDITOR.dom.walker.bogus = function( isReject ) 450 450 { 451 451 function nonEmpty( node ) -
CKEditor/trunk/_source/plugins/horizontalrule/plugin.js
r7477 r7538 15 15 exec : function( editor ) 16 16 { 17 var hr = editor.document.createElement( 'hr' ), 18 range = new CKEDITOR.dom.range( editor.document ); 19 17 var hr = editor.document.createElement( 'hr' ); 20 18 editor.insertElement( hr ); 21 22 // If there's nothing or a non-editable block followed by, establish a new paragraph23 // to make sure cursor is not trapped.24 range.moveToPosition( hr, CKEDITOR.POSITION_AFTER_END );25 var next = hr.getNext();26 if ( !next || next.type == CKEDITOR.NODE_ELEMENT && !next.isEditable() )27 range.fixBlock( true, editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );28 29 range.select();30 19 } 31 20 }; -
CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js
r7537 r7538 14 14 var emptyParagraphRegexp = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi; 15 15 16 var notWhitespaceEval = CKEDITOR.dom.walker.whitespaces( true ); 16 var notWhitespaceEval = CKEDITOR.dom.walker.whitespaces( true ), 17 notBogus = CKEDITOR.dom.walker.bogus( true ), 18 notEmpty = function( node ) { return notWhitespaceEval( node ) && notBogus( node ); }; 17 19 18 20 // Elements that could blink the cursor anchoring beside it, like hr, page-break. (#6554) … … 268 270 range.moveToPosition( lastElement, CKEDITOR.POSITION_AFTER_END ); 269 271 270 // If we're inserting a block element immediatel ly followed by271 // another block element, the selection must move there. (#3100,#5436)272 // If we're inserting a block element immediately followed by 273 // another block element, the selection must be optimized. (#3100,#5436,#8950) 272 274 if ( isBlock ) 273 275 { 274 var next = lastElement.getNext( not WhitespaceEval),276 var next = lastElement.getNext( notEmpty ), 275 277 nextName = next && next.type == CKEDITOR.NODE_ELEMENT && next.getName(); 276 278 277 // Check if it's a block element that accepts text. 278 if ( nextName && CKEDITOR.dtd.$block[ nextName ] && CKEDITOR.dtd[ nextName ]['#'] ) 279 // If the next one is a text block, move cursor to the start of it's content. 280 if ( nextName && CKEDITOR.dtd.$block[ nextName ] ) 281 { 282 if ( CKEDITOR.dtd[ nextName ][ '#' ] ) 283 range.moveToElementEditStart( next ); 284 // Otherwise move cursor to the before end of the last element. 285 else 286 range.moveToElementEditEnd( lastElement ); 287 } 288 // Open a new line if the block is inserted at the end of parent. 289 else if ( !next ) 290 { 291 next = range.fixBlock( true, this.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' ); 279 292 range.moveToElementEditStart( next ); 293 } 280 294 } 281 295 }
Note: See TracChangeset
for help on using the changeset viewer.
