Ticket #5352: 5352_2.patch
File 5352_2.patch, 2.3 KB (added by , 14 years ago) |
---|
-
_source/plugins/styles/plugin.js
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( ':' ), 1329 styleSetName = partsStylesSet[ 0 ], 1330 externalPath = partsStylesSet[ 1 ], 1331 pluginPath = CKEDITOR.plugins.registered.styles.path; 1327 configStyleSet = editor.config.stylesCombo_stylesSet || editor.config.stylesSet || 'default', 1328 styleSetName; 1329 1330 1331 // #5352 Allow to define the styles directly in the config object 1332 if ( configStyleSet instanceof Array ) 1333 { 1334 styleSetName = 'default'; 1335 CKEDITOR.stylesSet.add( styleSetName, configStyleSet ); 1336 } 1337 else 1338 { 1339 var partsStylesSet = configStyleSet.split( ':' ), 1340 styleSetName = partsStylesSet[ 0 ], 1341 externalPath = partsStylesSet[ 1 ], 1342 pluginPath = CKEDITOR.plugins.registered.styles.path; 1332 1343 1333 CKEDITOR.stylesSet.addExternal( styleSetName,1334 externalPath ?1344 CKEDITOR.stylesSet.addExternal( styleSetName, 1345 externalPath ? 1335 1346 partsStylesSet.slice( 1 ).join( ':' ) : 1336 1347 pluginPath + 'styles/' + styleSetName + '.js', '' ); 1348 } 1337 1349 1338 1339 1350 CKEDITOR.stylesSet.load( styleSetName, function( stylesSet ) 1340 1351 { 1341 1352 editor._.stylesDefinitions = stylesSet[ styleSetName ]; … … 1356 1367 * Otherwise, this setting has the "name:url" syntax, making it 1357 1368 * possible to set the URL from which loading the styles file.<br> 1358 1369 * Previously this setting was available as config.stylesCombo_stylesSet<br> 1359 * @type string 1370 * @name CKEDITOR.config.stylesSet 1371 * @type String|Array 1360 1372 * @default 'default' 1361 1373 * @since 3.3 1362 1374 * @example … … 1368 1380 * @example 1369 1381 * // Load from a full URL. 1370 1382 * config.stylesSet = 'mystyles:http://www.example.com/editorstyles/styles.js'; 1383 * @example 1384 * // Load from a list of definitions. 1385 * config.stylesSet = [ 1386 * { name : 'Strong Emphasis', element : 'strong' }, 1387 * { name : 'Emphasis', element : 'em' }, ... ]; 1371 1388 */ 1372 CKEDITOR.config.stylesSet = 'default';