Opened 7 years ago

Closed 7 years ago

#5290 closed Task (fixed)

Create a editor.getStylesSet function

Reported by: alfonsoml Owned by: alfonsoml
Priority: Normal Milestone: CKEditor 3.3
Component: Core : Styles Version: 3.2
Keywords: Confirmed Review+ Cc:

Description

Currently both the styleCombo and the div dialog include code to check the config data and request the load of the styles data.

In the future other dialogs should have also the same combo like the div, and also it should be possible to manually add extra styles to the data for example by parsing the css file.

In order to do that the first step should be to simplify the loading of the styles data. Instead of doing

 // Reuse the 'stylescombo' plugin's styles definition.
 customStylesConfig =  editor.config.stylesCombo_stylesSet,
 stylesSetName = customStylesConfig && customStylesConfig.split( ':' )[ 0 ];

if ( stylesSetName )
{
	CKEDITOR.stylesSet.load( stylesSetName,
		function( stylesSet )
		{
			var stylesDefinitions = stylesSet[ stylesSetName ],

we should provide a function that abstracts that code to

editor.getStyles( function( stylesDefinitions )
{

Attachments (2)

5290.patch (5.5 KB) - added by alfonsoml 7 years ago.
Proposed patch
5290_2.patch (16.1 KB) - added by alfonsoml 7 years ago.
Updated patch

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by alfonsoml

Proposed patch

comment:1 Changed 7 years ago by alfonsoml

  • Keywords Review? added
  • Status changed from new to assigned
  • Summary changed from Create a editor.GetStyles function to Create a editor.getStylesSet function

I think that the next step would be to move the getStylesSet function as well as the default location for the stylesSet file to the Styles plugin, but this isn't part of this ticket.

comment:2 Changed 7 years ago by garry.yao

  • Keywords Review- added; Review? removed

Based on your idea, we're talking now the global custom styles shared by all plugins, which means the 'stylescombo' plugin would not be the proper homeland for this method.

Changed 7 years ago by alfonsoml

Updated patch

comment:3 Changed 7 years ago by alfonsoml

  • Keywords Review? added; Review- removed

The new patch moves the function to the styles plugin, as well as the "styles" subfolder and renames the config entry accordingly.

comment:4 Changed 7 years ago by garry.yao

  • Keywords Review+ added; Review? removed

Very complete :)

comment:5 Changed 7 years ago by alfonsoml

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed with [5269]

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy