Ticket #6107: 6107_2.patch
File 6107_2.patch, 2.6 KB (added by , 13 years ago) |
---|
-
_source/plugins/styles/plugin.js
149 149 return ( this.removeFromRange = 150 150 this.type == CKEDITOR.STYLE_INLINE ? 151 151 removeInlineStyle 152 : this.type == CKEDITOR.STYLE_BLOCK ? 153 removeBlockStyle 152 154 : this.type == CKEDITOR.STYLE_OBJECT ? 153 155 removeObjectStyle 154 156 : null ).call( this, range ); … … 881 883 range.moveToBookmark( bookmark ); 882 884 } 883 885 886 function removeBlockStyle( range ) 887 { 888 // Serializible bookmarks is needed here since 889 // elements may be merged. 890 var bookmark = range.createBookmark( 1 ); 891 892 var iterator = range.createIterator(); 893 iterator.enforceRealBlocks = true; 894 895 iterator.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR; 896 897 var block; 898 var doc = range.document; 899 900 while ( ( block = iterator.getNextParagraph() ) ) 901 { 902 if ( !this.checkElementRemovable( block ) ) 903 continue; 904 905 if ( this._.enterMode == CKEDITOR.ENTER_BR ) 906 block.remove( 1 ); 907 else 908 replaceBlock( block, new CKEDITOR.dom.element( this._.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' ) ); 909 } 910 911 range.moveToBookmark( bookmark ); 912 } 913 884 914 // Replace the original block with new one, with special treatment 885 915 // for <pre> blocks to make sure content format is well preserved, and merging/splitting adjacent 886 916 // when necessary.(#3188) … … 1433 1463 1434 1464 var iterator = ranges.createIterator(); 1435 1465 while ( ( range = iterator.getNextRange() ) ) 1436 {1437 1466 func.call( this, range ); 1438 }1439 1467 1440 1468 selection.selectRanges( ranges ); 1441 1469 -
_source/plugins/stylescombo/plugin.js
105 105 selection = editor.getSelection(); 106 106 107 107 var elementPath = new CKEDITOR.dom.elementPath( selection.getStartElement() ); 108 109 style[ style.checkActive( elementPath ) ? 'remove' : 'apply' ]( editor.document ); 108 110 109 if ( style.type == CKEDITOR.STYLE_INLINE && style.checkActive( elementPath ) )110 style.remove( editor.document );111 else if ( style.type == CKEDITOR.STYLE_OBJECT && style.checkActive( elementPath ) )112 style.remove( editor.document );113 else114 style.apply( editor.document );115 116 111 editor.fire( 'saveSnapshot' ); 117 112 }, 118 113