Ticket #7492: 7492_2.patch
File 7492_2.patch, 3.1 KB (added by , 12 years ago) |
---|
-
_samples/output_xhtml.html
98 98 font_style : 99 99 { 100 100 element : 'span', 101 attributes : { 'class' : '#(family)' } 101 attributes : { 'class' : '#(family)' }, 102 overrides : [ { element : 'span', attributes : { 'class' : /^Font(?:Comic|Courier|Times)$/ } } ] 102 103 }, 103 104 104 105 /* … … 108 109 fontSize_style : 109 110 { 110 111 element : 'span', 111 attributes : { 'class' : '#(size)' } 112 attributes : { 'class' : '#(size)' }, 113 overrides : [ { element : 'span', attributes : { 'class' : /^Font(?:Smaller|Larger|Small|Big|Double)$/ } } ] 112 114 } , 113 115 114 116 /* … … 120 122 colorButton_foreStyle : 121 123 { 122 124 element : 'span', 123 attributes : { 'class' : '#(color)' } 125 attributes : { 'class' : '#(color)' }, 126 overrides : [ { element : 'span', attributes : { 'class' : /^FontColor(?:1|2|3)$/ } } ] 124 127 }, 125 128 126 129 colorButton_backStyle : 127 130 { 128 131 element : 'span', 129 attributes : { 'class' : '#(color)BG' } 132 attributes : { 'class' : '#(color)BG' }, 133 overrides : [ { element : 'span', attributes : { 'class' : /^FontColor(?:1|2|3)BG$/ } } ] 130 134 }, 131 135 132 136 /* -
_source/plugins/styles/plugin.js
1132 1132 function removeFromElement( style, element ) 1133 1133 { 1134 1134 var def = style._.definition, 1135 attributes = CKEDITOR.tools.extend( {}, def.attributes, getOverrides( style )[ element.getName() ] ),1135 attributes = def.attributes, 1136 1136 styles = def.styles, 1137 overrides = getOverrides( style )[ element.getName() ], 1137 1138 // If the style is only about the element itself, we have to remove the element. 1138 1139 removeEmpty = CKEDITOR.tools.isEmpty( attributes ) && CKEDITOR.tools.isEmpty( styles ); 1139 1140 … … 1159 1160 element.removeStyle( styleName ); 1160 1161 } 1161 1162 1163 // Remove overrides, but don't remove the element if it's a block element 1164 removeOverrides( element, overrides, blockElements[ element ] ) ; 1165 1162 1166 if ( removeEmpty ) 1163 1167 { 1164 1168 !CKEDITOR.dtd.$block[ element.getName() ] || style._.enterMode == CKEDITOR.ENTER_BR && !element.hasAttributes() ? … … 1200 1204 * Note: Remove the element if no attributes remain. 1201 1205 * @param {Object} element 1202 1206 * @param {Object} overrides 1207 * @param {Boolean} Don't remove the element 1203 1208 */ 1204 function removeOverrides( element, overrides )1209 function removeOverrides( element, overrides, dontRemove ) 1205 1210 { 1206 1211 var attributes = overrides && overrides.attributes ; 1207 1212 … … 1229 1234 } 1230 1235 } 1231 1236 1232 removeNoAttribsElement( element ); 1237 if ( !dontRemove ) 1238 removeNoAttribsElement( element ); 1233 1239 } 1234 1240 1235 1241 // If the element has no more attributes, remove it.