Ticket #901 (new New Feature)

Opened 3 years ago

Last modified 12 months ago

Parse stylesheet to make styles list

Reported by: poeg@… Owned by:
Priority: Normal Milestone: CKEditor 3.x
Component: Core : Styles Version:
Keywords: SF Confirmed HasPatch Cc: kazador@…, astpaul@…, gazou78@…

Description

I would like it if the editor parsed the stylesheet defined in FCKConfig.EditorAreaCSS (or another stylesheet) and made its styles list with that instead of having to make a seperate XML Styles file.


Moved from SF:
 http://sourceforge.net/tracker/index.php?func=detail&aid=1498014&group_id=75348&atid=543656

Attachments

parseCSS.zip Download (2.6 KB) - added by alfonsoml 2 years ago.

Change History

Changed 3 years ago by martinkou

  • cc alfonsoml added
  • reporter changed from martinkou to poeg@…

Changed 3 years ago by alfonsoml

  • cc alfonsoml removed
  • component changed from General to Core : Styles

Changed 2 years ago by alfonsoml

  • milestone set to FCKeditor 2.5

Changed 2 years ago by fredck

  • milestone changed from FCKeditor 2.5 to FCKeditor 3.0

The 2.5 is about to be released. No new important features will be added to it. Postponing.

Changed 2 years ago by fredck

Changed 2 years ago by alfonsoml

  • cc kazador@… added

i had the same problem and i did the following:

in my asp file that invokes this great editor, add a css stylesheet in the head section:

<LINK REL="STYLESHEET" TYPE="text/css" HREF="<%=CSS%>"/>

In my case i have decided that the css is a param of the page, so i can use the stylesheet if certain conditions are executed.

and i have modified the js/fck_config.js file substituting:

//##
//## Style Names
//##
config.StyleNames = ';Main Header;Blue Title;Centered Title' ;
config.StyleValues = ';MainHeader;BlueTitle;CenteredTitle' ;

by the following code:

//##
//## Style Names
//##
// kazador: 24/05/2004
if (!parent.document.styleSheets)
{
config.StyleNames = ';Main Header;Blue Title;Centered Title' ;
config.StyleValues = ';MainHeader;BlueTitle;CenteredTitle' ;
}
else
{
var valores='';
var regla='';
var oStyleSheet=parent.document.styleSheets[0].rules;
for (var j=0;j<oStyleSheet.length-1;j++)
{
regla=oStyleSheet[j].selectorText;
if (regla.indexOf(':')==-1) {
valores=valores+';'+regla.substring(1,oStyleSheet[j].length); }
}
config.StyleNames = valores ;
config.StyleValues = valores ;
}
// fin kazador: 24/05/2004

in this way, if i dont pass any value to css variable at first page, i use default style definition; if not i use my own css and show it in combobox. The little parsing is to avoid show the event of class (:hover, etc) and eliminate the dot at begining of class.


Moved from  sourceforge
Original author: kazador

Changed 2 years ago by alfonsoml

Changed 2 years ago by alfonsoml

  • cc astpaul@… added

I needed to include in the Style combo box the styles of a given CSS file so i modified 2 files:

  • fckEditor.php, implementing new variables
  • test.php, for example purposes

I think the comments should be self explaining.


Moved from  sourceforge
Original Author Arnaud Saint-Paul

Changed 2 years ago by alfonsoml

  • cc gazou78@… added

Thank 4 this great add-on

Tips : don't forget to put the complete css path in the $oFCKeditor->EditorAreaCSS variable (it was the only missing point to be able to use this great work)

Regards,
Simon (France)


Moved from sourceforge Original author gazou78

Changed 2 years ago by w.olchawa

  • keywords Confirmed HasPatch added

Changed 12 months ago by fredck

  • milestone changed from CKEditor 3.0 to CKEditor 3.x
Note: See TracTickets for help on using tickets.