Ticket #5352: 5352.patch
File 5352.patch, 2.7 KB (added by , 14 years ago) |
---|
-
_source/plugins/styles/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 */ … … 252 252 253 253 var elementAttr = element.getAttribute( attName ) || ''; 254 254 if ( attName == 'style' ? 255 compareCssText( attribs[ attName ], normalizeCssText( elementAttr, false ) ) 255 compareCssText( attribs[ attName ], normalizeCssText( elementAttr, false ) ) 256 256 : attribs[ attName ] == elementAttr ) 257 257 { 258 258 if ( !fullMatch ) … … 1230 1230 .replace( /,\s+/g, ',' ) // Trimming spaces after comma (e.g. font-family name)(#4107). 1231 1231 .toLowerCase(); 1232 1232 } 1233 1233 1234 1234 // Turn inline style text properties into one hash. 1235 1235 function parseStyleText( styleText ) 1236 1236 { … … 1251 1251 for( var name in source ) 1252 1252 { 1253 1253 // Value 'inheirt' is treated as a wildcard, 1254 // which will matches any value. 1254 // which will matches any value. 1255 1255 if ( !( name in target && 1256 1256 ( target[ name ] == source[ name ] 1257 1257 || source[ name ] == 'inherit' … … 1324 1324 { 1325 1325 var editor = this, 1326 1326 // Respect the backwards compatible definition entry 1327 configStyleSet = editor.config.stylesCombo_stylesSet || editor.config.stylesSet, 1328 partsStylesSet = configStyleSet.split( ':' ), 1327 configStyleSet = editor.config.stylesCombo_stylesSet || editor.config.stylesSet; 1328 1329 // #5352 Allow to define the styles directly in the config object 1330 if ( configStyleSet instanceof Array ) 1331 { 1332 editor._.stylesDefinitions = configStyleSet; 1333 callback( configStyleSet ); 1334 return; 1335 } 1336 1337 var partsStylesSet = configStyleSet.split( ':' ), 1329 1338 styleSetName = partsStylesSet[ 0 ], 1330 1339 externalPath = partsStylesSet[ 1 ], 1331 1340 pluginPath = CKEDITOR.plugins.registered.styles.path; … … 1356 1365 * Otherwise, this setting has the "name:url" syntax, making it 1357 1366 * possible to set the URL from which loading the styles file.<br> 1358 1367 * Previously this setting was available as config.stylesCombo_stylesSet<br> 1359 * @type string1368 * @type String|Array 1360 1369 * @default 'default' 1361 1370 * @since 3.3 1362 1371 * @example … … 1368 1377 * @example 1369 1378 * // Load from a full URL. 1370 1379 * config.stylesSet = 'mystyles:http://www.example.com/editorstyles/styles.js'; 1380 * @example 1381 * // Load from a list of definitions. 1382 * config.stylesSet = [ 1383 * { name : 'Strong Emphasis', element : 'strong' }, 1384 * { name : 'Emphasis', element : 'em' }, ... ]; 1371 1385 */ 1372 1386 CKEDITOR.config.stylesSet = 'default';