Ticket #5242: 5242.patch
File 5242.patch, 2.3 KB (added by , 14 years ago) |
---|
-
_source/plugins/styles/plugin.js
199 199 continue; 200 200 201 201 var elementAttr = element.getAttribute( attName ) || ''; 202 if ( att ribs[ attName ] ==203 ( attName == 'style' ?204 normalizeCssText( elementAttr, false ) : elementAttr ))202 if ( attName == 'style' ? 203 compareCssText( attribs[ attName ], normalizeCssText( elementAttr, false ) ) 204 : attribs[ attName ] == elementAttr ) 205 205 { 206 206 if ( !fullMatch ) 207 207 return true; … … 1208 1208 .replace( /,\s+/g, ',' ) // Trimming spaces after comma (e.g. font-family name)(#4107). 1209 1209 .toLowerCase(); 1210 1210 } 1211 1211 1212 // Turn inline style text properties into one hash. 1213 function parseStyleText( styleText ) 1214 { 1215 var retval = {}; 1216 styleText 1217 .replace( /"/g, '"' ) 1218 .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function( match, name, value ) 1219 { 1220 retval[ name ] = value; 1221 } ); 1222 return retval; 1223 } 1224 1225 function compareCssText( source, target ) 1226 { 1227 typeof source == 'string' && ( source = parseStyleText( source ) ); 1228 typeof target == 'string' && ( target = parseStyleText( target ) ); 1229 for( var name in source ) 1230 { 1231 // Value 'inheirt' is treated as a wildcard, 1232 // which will matches any value. 1233 if ( !( name in target && 1234 ( target[ name ] == source[ name ] 1235 || source[ name ] == 'inherit' 1236 || target[ name ] == 'inherit' ) ) ) 1237 { 1238 return false; 1239 } 1240 } 1241 return true; 1242 } 1243 1212 1244 function applyStyle( document, remove ) 1213 1245 { 1214 1246 // Get all ranges from the selection. -
_source/plugins/colorbutton/plugin.js
86 86 87 87 panel.hide(); 88 88 89 var style = new CKEDITOR.style( config['colorButton_' + type + 'Style'], color && { color : color} );89 var style = new CKEDITOR.style( config['colorButton_' + type + 'Style'], { color : color || 'inherit' } ); 90 90 91 91 editor.fire( 'saveSnapshot' ); 92 92 if ( color )