Ticket #6728: 6728_7.patch
File 6728_7.patch, 4.9 KB (added by , 13 years ago) |
---|
-
_source/plugins/bidi/plugin.js
1 /* 1 /* 2 2 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ 5 5 6 6 (function() 7 7 { 8 var guardElements = { table:1, tbody: 1, ul:1, ol:1, blockquote:1, div:1, tr:1 },8 var guardElements = { table:1, ul:1, ol:1, blockquote:1, div:1 }, 9 9 directSelectionGuardElements = {}, 10 10 // All guard elements which can have a direction applied on them. 11 11 allGuardElements = {}; … … 153 153 while ( ancestor && ancestor.type == CKEDITOR.NODE_ELEMENT 154 154 && ( parent = ancestor.getParent() ) 155 155 && parent.getChildCount() == 1 156 && ( !( ancestor.getName() in elements ) || ( parent.getName() in elements ) ) 157 ) 156 && !( ancestor.getName() in elements ) ) 158 157 ancestor = parent; 159 158 160 159 return ancestor.type == CKEDITOR.NODE_ELEMENT … … 209 208 { 210 209 return !! ( node.type == CKEDITOR.NODE_ELEMENT 211 210 && node.getName() in guardElements 212 && !( node.getName() == ( enterMode == CKEDITOR.ENTER_P ) ? 'p' : 'div'211 && !( node.getName() == ( enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ) 213 212 && node.getParent().type == CKEDITOR.NODE_ELEMENT 214 213 && node.getParent().getName() == 'blockquote' ) 215 214 // Element must be fully included in the range as well. (#6485). … … 225 224 226 225 while ( ( block = iterator.getNextParagraph() ) ) 227 226 !block.isReadOnly() && switchDir( block, dir, editor, database ); 228 }227 } 229 228 230 229 CKEDITOR.dom.element.clearAllMarkers( database ); 231 230 -
_source/plugins/domiterator/plugin.js
30 30 } 31 31 32 32 var beginWhitespaceRegex = /^[\r\n\t ]+$/, 33 isBookmark = CKEDITOR.dom.walker.bookmark(); 33 // Ignore bookmark nodes.(#3783) 34 bookmarkGuard = CKEDITOR.dom.walker.bookmark( false, true ); 34 35 36 // Get a reference for the next element, bookmark nodes are skipped. 37 function getNextSourceNode( node, startFromSibling, lastNode ) 38 { 39 var next = node.getNextSourceNode( startFromSibling, null, lastNode ); 40 while ( !bookmarkGuard( next ) ) 41 next = next.getNextSourceNode( startFromSibling, null, lastNode ); 42 return next; 43 } 44 35 45 iterator.prototype = { 36 46 getNextParagraph : function( blockTag ) 37 47 { … … 220 230 if ( includeNode ) 221 231 range.setEndAt( currentNode, CKEDITOR.POSITION_AFTER_END ); 222 232 223 currentNode = currentNode.getNextSourceNode( continueFromSibling, null, lastNode );233 currentNode = getNextSourceNode ( currentNode, continueFromSibling, lastNode ); 224 234 isLast = !currentNode; 225 235 226 236 // We have found a block boundary. Let's close the range and move out of the … … 256 266 // Create the fixed block. 257 267 block = this.range.document.createElement( blockTag || 'p' ); 258 268 259 // Move the contents of the temporary range to the fixed block.260 range.extractContents().appendTo( block );261 block.trim();269 // Move the contents of the temporary range to the fixed block. 270 range.extractContents().appendTo( block ); 271 block.trim(); 262 272 263 // Insert the fixed block into the DOM.264 range.insertNode( block );273 // Insert the fixed block into the DOM. 274 range.insertNode( block ); 265 275 266 removePreviousBr = removeLastBr = true;267 }276 removePreviousBr = removeLastBr = true; 277 } 268 278 else if ( block.getName() != 'li' ) 269 279 { 270 280 // If the range doesn't includes the entire contents of the … … 297 307 // the current range, which could be an <li> child (nested 298 308 // lists) or the next sibling <li>. 299 309 300 this._.nextNode = ( block.equals( lastNode ) ? null : 301 range.getBoundaryNodes().endNode.getNextSourceNode( true, null, lastNode ) ); 310 this._.nextNode = ( block.equals( lastNode ) ? null : getNextSourceNode( range.getBoundaryNodes().endNode, 1, lastNode ) ); 302 311 } 303 312 } 304 313 305 // Ignore bookmark nodes.(#3783)306 var bookmarkGuard = CKEDITOR.dom.walker.bookmark( false, true );307 308 314 if ( removePreviousBr ) 309 315 { 310 316 var previousSibling = block.getPrevious(); … … 336 342 if ( !this._.nextNode ) 337 343 { 338 344 this._.nextNode = ( isLast || block.equals( lastNode ) ) ? null : 339 block.getNextSourceNode( true, null, lastNode );345 getNextSourceNode( block, 1, lastNode ); 340 346 } 341 347 342 if ( !bookmarkGuard( this._.nextNode ) )343 {344 this._.nextNode = this._.nextNode.getNextSourceNode( true, null, function( node )345 { return !node.equals( lastNode ) && bookmarkGuard( node ); } );346 }347 348 348 return block; 349 349 } 350 350 };