Yup... Ive had to do quite a bit of searching to overcome this issue myself. Now that I know its quite straight forward.
Ive added some code at the end of the initEditor() function. The editor complies with certain JS styles... and thus:
//ive passed over the background color of the page which gives the editor a differet bgcolor objContent.DOM.body.bgColor=URLParams['bgcolor'];
//but it could be done as: objContent.DOM.body.bgColor='Black'
// remove margin within the editor objContent.DOM.body.topMargin='0'; objContent.DOM.body.rightMargin='0'; objContent.DOM.body.bottomMargin='0'; objContent.DOM.body.leftMargin='0';
Yes... I suppose it all depends on how dynamic your application is.
Of course "objContent.DOM.body.bgColor='Black'" works fine... if you know the bgcolorto the page to is black.
My app allows users to specify bgcolor to the page themselves and so Ive had to pass over "URLParams['bgcolor'];" thru my scripts. If you need to change the Bgcolor dynamically then you will need to do this programatically, else... as you say..
The simplest way i've found to do this, unless i'm misunderstanding the question is to edit fck_editorarea.css. I changed from the default: body { font-size: 12px; font-family: Arial; }
to
body { font-size: 12px; font-family: Arial; background-color:#cccccc; }
to change the bgcolor of the textarea, i edited fck_editor.css as follows:
RE: change bg-color in editor
Ive added some code at the end of the initEditor() function. The editor complies with certain JS styles... and thus:
//ive passed over the background color of the page which gives the editor a differet bgcolor
objContent.DOM.body.bgColor=URLParams['bgcolor'];
//but it could be done as:
objContent.DOM.body.bgColor='Black'
// remove margin within the editor
objContent.DOM.body.topMargin='0';
objContent.DOM.body.rightMargin='0';
objContent.DOM.body.bottomMargin='0';
objContent.DOM.body.leftMargin='0';
Hope this helps...!!
RE: change bg-color in editor
objContent.DOM.body.bgColor=URLParams['bgcolor'];
this doesn't work at all on my system. no bgcolor changed!
- from which place/page does this bgcolor come from ?
//but it could be done as:
objContent.DOM.body.bgColor='Black'
works fine!
my system configuration:
- win 2k
- ie6
- apche 2
- php 4.3.2
what's wrong ?
RE: change bg-color in editor
Of course "objContent.DOM.body.bgColor='Black'" works fine... if you know the bgcolorto the page to is black.
My app allows users to specify bgcolor to the page themselves and so Ive had to pass over "URLParams['bgcolor'];" thru my scripts. If you need to change the Bgcolor dynamically then you will need to do this programatically, else... as you say..
objContent.DOM.body.bgColor='Black'
objContent.DOM.body.bgColor='Red'
objContent.DOM.body.bgColor='Orange'
will work fine...
RE: change bg-color in editor
body
{
font-size: 12px;
font-family: Arial;
}
to
body
{
font-size: 12px;
font-family: Arial;
background-color:#cccccc;
}
to change the bgcolor of the textarea, i edited fck_editor.css as follows:
.EditorArea
{
padding-right: 0px;
padding-left: 0px;
padding-bottom: 0px;
margin: 0px;
width: 100%;
padding-top: 0px;
height: 100%;
}
to
.EditorArea
{
padding-right: 0px;
padding-left: 0px;
padding-bottom: 0px;
margin: 0px;
width: 100%;
padding-top: 0px;
height: 100%;
background-color:#cccccc;
}
simple, no?
RE: change bg-color in editor
I need a solution, where the editor takes over the bg-color from the user-stylesheet.
any idea?
RE: change bg-color in editor
So there should be a possibility to take the information for the "body"-background and the font-color from the users style-sheet as well?
Otherwise it's impossible to edit a text, when the the user switched to black background and white font-color.