Ticket #6091: 6091_2.patch
File 6091_2.patch, 2.1 KB (added by , 13 years ago) |
---|
-
_source/plugins/pagebreak/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 */ … … 78 78 requires : [ 'fakeobjects' ] 79 79 }); 80 80 81 // keep items on which page break cannot be done 82 var disallowedPagebrakeItems = { li:1 }; 83 81 84 CKEDITOR.plugins.pagebreakCmd = 82 85 { 83 86 exec : function( editor ) … … 102 105 if ( i < ranges.length -1 ) 103 106 breakObject = breakObject.clone( true ); 104 107 105 range.splitBlock( 'p' ); 108 var boundaryBlocks = range.getBoundaryBlocks(); 109 110 // split block on allowed items 111 if( !disallowedPagebrakeItems[ boundaryBlocks.startBlock.getName() ] && !disallowedPagebrakeItems[ boundaryBlocks.endBlock.getName() ] ) 112 range.splitBlock( 'p' ); 113 106 114 range.insertNode( breakObject ); 107 115 if ( i == ranges.length - 1 ) 108 116 { … … 118 126 119 127 editor.fire( 'saveSnapshot' ); 120 128 } 121 }; 129 }; 130 No newline at end of file -
_source/core/dom/range.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 */ … … 644 644 return { startNode : startNode, endNode : endNode }; 645 645 }, 646 646 647 getBoundaryBlocks : function() 648 { 649 var startPath = new CKEDITOR.dom.elementPath( this.startContainer ), 650 endPath = new CKEDITOR.dom.elementPath( this.endContainer ); 651 652 var startBlockLimit = startPath.blockLimit, 653 endBlockLimit = endPath.blockLimit; 654 655 return { startBlock : startPath.block, endBlock : endPath.block }; 656 657 }, 658 647 659 /** 648 660 * Find the node which fully contains the range. 649 661 * @param includeSelf