Opened 14 years ago

Closed 14 years ago

#5290 closed Task (fixed)

Create a editor.getStylesSet function

Reported by: Alfonso Martínez de Lizarrondo Owned by: Alfonso Martínez de Lizarrondo
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 Alfonso Martínez de Lizarrondo 14 years ago.
Proposed patch
5290_2.patch (16.1 KB) - added by Alfonso Martínez de Lizarrondo 14 years ago.
Updated patch

Download all attachments as: .zip

Change History (7)

Changed 14 years ago by Alfonso Martínez de Lizarrondo

Attachment: 5290.patch added

Proposed patch

comment:1 Changed 14 years ago by Alfonso Martínez de Lizarrondo

Keywords: Review? added
Status: newassigned
Summary: Create a editor.GetStyles functionCreate 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 14 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 14 years ago by Alfonso Martínez de Lizarrondo

Attachment: 5290_2.patch added

Updated patch

comment:3 Changed 14 years ago by Alfonso Martínez de Lizarrondo

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 14 years ago by Garry Yao

Keywords: Review+ added; Review? removed

Very complete :)

comment:5 Changed 14 years ago by Alfonso Martínez de Lizarrondo

Resolution: fixed
Status: assignedclosed

Fixed with [5269]

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy