Ticket #4129: 4129_2.patch
File 4129_2.patch, 5.4 KB (added by , 15 years ago) |
---|
-
_source/plugins/list/plugin.js
402 402 ranges[ 0 ].selectNodeContents( paragraph ); 403 403 selection.selectRanges( ranges ); 404 404 } 405 } 405 // Maybe a single range there enclosing the whole list, 406 // turn on the list state manually(#4129). 407 else 408 { 409 var range = ranges.length == 1 && ranges[ 0 ], 410 enclosedNode = range && range.getEnclosedNode(); 411 if ( enclosedNode && enclosedNode.is 412 && this.type == enclosedNode.getName() ) 413 { 414 setState.call( this, editor, CKEDITOR.TRISTATE_ON ); 415 } 416 } 417 } 406 418 407 419 var bookmarks = selection.createBookmarks( true ); 408 420 -
_source/plugins/wysiwygarea/plugin.js
190 190 191 191 // Inserting the padding-br before body if it's preceded by an 192 192 // unexitable block. 193 var lastNode = body.getLast( true);193 var lastNode = body.getLast( CKEDITOR.dom.walker.whitespaces( true ) ); 194 194 if ( lastNode && lastNode.getName && ( lastNode.getName() in nonExitableElementNames ) ) 195 195 { 196 196 var paddingBlock = editor.document.createElement( -
_source/core/dom/element.js
641 641 }, 642 642 643 643 /** 644 * @param ignoreEmpty Skip empty text nodes.644 * @param {Function} evaluator Filtering the result node. 645 645 */ 646 getLast : function( ignoreEmpty)646 getLast : function( evaluator ) 647 647 { 648 var $ = this.$.lastChild;649 if ( ignoreEmpty && $ && ( $.nodeType == CKEDITOR.NODE_TEXT )650 && !CKEDITOR.tools.trim( $.nodeValue) )651 ret urn new CKEDITOR.dom.node( $ ).getPrevious( true);652 else 653 return $ ? new CKEDITOR.dom.node( $ ) : null;648 var last = this.$.lastChild, 649 retval = last && new CKEDITOR.dom.node( last ); 650 if ( retval && evaluator && !evaluator( retval ) ) 651 retval = retval.getPrevious( evaluator ); 652 653 return retval; 654 654 }, 655 655 656 656 getStyle : function( name ) -
_source/tests/core/dom/element.html
536 536 } 537 537 }, 538 538 539 // Test get last non-spaces child node. 540 test_getLast : function() 541 { 542 var element = new CKEDITOR.dom.element( document.getElementById( 'append' ) ); 543 var span1 = new CKEDITOR.dom.element( 'span' ); 544 element.append( span1 ); 545 element.append( new CKEDITOR.dom.text( ' ' ) ); 546 element.append( new CKEDITOR.dom.text( ' ' ) ); 547 var last = element.getLast( CKEDITOR.dom.walker.whitespaces( true ) ); 548 assert.areSame( span1.$, last.$ ); 549 }, 550 551 539 552 name : document.title 540 553 }; 541 554 })() ); -
_source/core/dom/range.js
1610 1610 return false; 1611 1611 }, 1612 1612 1613 /** 1614 * Get the single node enclosed within the range if there's one. 1615 */ 1616 getEnclosedNode : function() 1617 { 1618 var walkerRange = this.clone(), 1619 walker = new CKEDITOR.dom.walker( walkerRange ), 1620 isNotBookmarks = CKEDITOR.dom.walker.bookmark( true ), 1621 isNotWhitespaces = CKEDITOR.dom.walker.whitespaces( true ), 1622 evaluator = function( node ) 1623 { 1624 return isNotWhitespaces( node ) && isNotBookmarks( node ); 1625 }; 1626 walkerRange.evaluator = evaluator; 1627 var node = walker.next(); 1628 walker.reset(); 1629 return node && node.equals( walker.previous() ) ? node : null; 1630 }, 1631 1613 1632 getTouchedStartNode : function() 1614 1633 { 1615 1634 var container = this.startContainer ; -
_source/plugins/domiterator/plugin.js
83 83 // Probably the document end is reached, we need a marker node. 84 84 if ( !this._.lastNode ) 85 85 { 86 this._.lastNode= range.document.createText( '' );87 86 this._.lastNode = this._.docEndMarker = range.document.createText( '' ); 87 this._.lastNode.insertAfter( lastNode ); 88 88 } 89 89 90 90 // Let's reuse this variable. … … 239 239 // If no range has been found, this is the end. 240 240 if ( !range ) 241 241 { 242 this._.docEndMarker && this._.docEndMarker.remove(); 242 243 this._.nextNode = null; 243 244 return null; 244 245 } -
_source/core/dom/walker.js
304 304 lastBackward : function() 305 305 { 306 306 return iterateToLast.call( this, true ); 307 }, 308 309 reset : function() 310 { 311 delete this.current; 312 this._ = {}; 307 313 } 308 314 309 315 }