I am having some problems getting overrides to work and haven't been able to find much documentation on it. So here is my problem.
I have 4 spans:
<span class = "text">
<span class = "instructions">
<span class = "chart">
<span class = "comment">
When I have <span class = "text"> Some text </span> and someone changes the text to instructions I need the text tag to be removed and replaced with instructions. This sounds exactly like what overrides do. Here is what I have, however it doesn't work. Can anyone give me a suggestion for how to change it?
I have them defined in fckstyles.xml:
<Styles>
<Style name="Text" element="span">
<Attribute name="class" value="text" />
</Style>
<Style name="Instructions" element="span">
<Attribute name="class" value="instructions" />
</Style>
<Style name="Comment" element="span">
<Attribute name="class" value="comment" />
</Style>
<Style name="Chart" element="span">
<Attribute name="class" value="chart" />
</Style>
</Styles>
Then in fckconfig.js I have:
FCKConfig.CoreStyles.text =
{
Element : 'span',
Attributes : { 'class' : '#("text")' },
Overrides : [ { Element : 'span', Attributes : { 'class' : /^text|instructions|comment|chart$/ } } ]
} ;
FCKConfig.CoreStyles.instructions =
{
Element : 'span',
Attributes : { 'class' : '#("instructions")' },
Overrides : [ { Element : 'span', Attributes : { 'class' : /^text|instructions|comment|chart$/ } } ]
} ;
FCKConfig.CoreStyles.comment =
{
Element : 'span',
Attributes : { 'class' : '#("comment")' },
Overrides : [ { Element : 'span', Attributes : { 'class' : /^text|instructions|comment|chart$/ } } ]
} ;
FCKConfig.CoreStyles.chart =
{
Element : 'span',
Attributes : { 'class' : '#("chart")' },
Overrides : [ { Element : 'span', Attributes : { 'class' : /^text|instructions|comment|chart$/ } } ]
} ;
I have 4 spans:
<span class = "text">
<span class = "instructions">
<span class = "chart">
<span class = "comment">
When I have <span class = "text"> Some text </span> and someone changes the text to instructions I need the text tag to be removed and replaced with instructions. This sounds exactly like what overrides do. Here is what I have, however it doesn't work. Can anyone give me a suggestion for how to change it?
I have them defined in fckstyles.xml:
<Styles>
<Style name="Text" element="span">
<Attribute name="class" value="text" />
</Style>
<Style name="Instructions" element="span">
<Attribute name="class" value="instructions" />
</Style>
<Style name="Comment" element="span">
<Attribute name="class" value="comment" />
</Style>
<Style name="Chart" element="span">
<Attribute name="class" value="chart" />
</Style>
</Styles>
Then in fckconfig.js I have:
FCKConfig.CoreStyles.text =
{
Element : 'span',
Attributes : { 'class' : '#("text")' },
Overrides : [ { Element : 'span', Attributes : { 'class' : /^text|instructions|comment|chart$/ } } ]
} ;
FCKConfig.CoreStyles.instructions =
{
Element : 'span',
Attributes : { 'class' : '#("instructions")' },
Overrides : [ { Element : 'span', Attributes : { 'class' : /^text|instructions|comment|chart$/ } } ]
} ;
FCKConfig.CoreStyles.comment =
{
Element : 'span',
Attributes : { 'class' : '#("comment")' },
Overrides : [ { Element : 'span', Attributes : { 'class' : /^text|instructions|comment|chart$/ } } ]
} ;
FCKConfig.CoreStyles.chart =
{
Element : 'span',
Attributes : { 'class' : '#("chart")' },
Overrides : [ { Element : 'span', Attributes : { 'class' : /^text|instructions|comment|chart$/ } } ]
} ;
Re: spans and overrides
FCKConfig.CustomStyles =
{
'Text' :
{
Element : 'span',
Attributes : { 'class' : 'text' },
Overrides : [ { Element : 'span', Attributes : { 'class' : comment|instructions|chart } } ]
} ,
'Instructions' :
{
Element : 'span',
Attributes : { 'class' : 'instructions' },
Overrides : [ { Element : 'span', Attributes : { 'class' : text|comments|chart } } ]
} ,
'Comment' :
{
Element : 'span',
Attributes : { 'class' : 'comment' },
Overrides : [ { Element : 'span', Attributes : { 'class' : /^text|instructions|chart$/ } } ]
} ,
'Chart' :
{
Element : 'span',
Attributes : { 'class' : 'chart' },
Overrides : [ { Element : 'span', Attributes : { 'class' : /^text|instructions|comment$/ } } ]
}
} ;