This code adds two new configuration settings to make
it easy apply a class or id to the body in order to be
able to reuse the web stylesheet if the styles need to
be applied only under a container.
That's it, the editing content will be placed under a
<div id="news">, so the stylesheet says
h1 {
color:black;
}
#news h1 {
color:green;
}
we want the h1 inside the editor to become green.
So add two new settings in your fckconfig.js:
FCKConfig.BodyId = 'borde';
FCKConfig.BodyClass = 'azul';
now to apply them, in internals\fck_1.js SetHtml change
sHtml += FCK.TempBaseTag ;
sHtml += '</head><body>' ;
TO
sHtml += FCK.TempBaseTag ;
//Alfonso: add ID and Class to the body
sHtml += '</head><body'
if (FCKConfig.BodyId)
sHtml += ' id="' + FCKConfig.BodyId +'"';
if (FCKConfig.BodyClass)
sHtml += ' class="' + FCKConfig.BodyClass +'"';
sHtml += '>' ;
//end
and it would be nice to have the styles combo match the
styles also (to change the id and class of the body it
was just neccesary to listen to the OnAfterSetHTML event)
so in classes\fcktoolbarstylescombo.js change the
FCKToolbarStyleCombo.prototype.CreateItems function:
for ( var i = 0 ; i < aCSSs.length ; i++ )
FCKTools.AppendStyleSheet( oTargetDoc, aCSSs[i] ) ;
//Alfonso: add ID and Class to the body
if (FCKConfig.BodyId)
oTargetDoc.body.id = FCKConfig.BodyId;
if (FCKConfig.BodyClass)
oTargetDoc.body.className += ' ' + FCKConfig.BodyClass;
//end
oTargetDoc.body.className += ' ForceBaseFont' ;
Logged In: YES
user_id=1356422
Originator: YES
This patch, or a similar implementation, has been included in
FCKeditor and has been committed in the SVN. It will be available
in the next release.
For more information about the FCKeditor SVN system, please use
the following URL:
http://wiki.fckeditor.net/SVN
----
http://www.fckeditor.net
"Support Open Source Software"
PS.: This is a canned response.