I have a drop down select menu that has several different CSS files that I would like to be able to use within the currently active editor. I have the menu set for onchange="seteditorstyle(this)" .
seteditorstyle = function(el){
var fck = FCKeditorAPI.GetInstance('sc_text');
fck.Config['EditorAreaCSS']= '\["/themes/css/'+el.value+'"\]';
console.log(fck.Config['EditorAreaCSS']);
console.log(fck);
}
This seems to be having some effect, as when I switch to the source view and then back to wysiwyg view in the editor the originaly loaded CSS is no longer used. The "net" tab in terminal shows that FCKeditor is trying to load an individual file for each letter in the path I set for fck.Config['EditorAreaCSS'].
If someone could point out what I am doing wrong, that would be great!
Also how would I force the editor to redraw itself using the new CSS. (toggoling the source view seems to do it, but ther must be some command I can add to my function...
Cheers.
seteditorstyle = function(el){
var fck = FCKeditorAPI.GetInstance('sc_text');
fck.Config['EditorAreaCSS']= '\["/themes/css/'+el.value+'"\]';
console.log(fck.Config['EditorAreaCSS']);
console.log(fck);
}
This seems to be having some effect, as when I switch to the source view and then back to wysiwyg view in the editor the originaly loaded CSS is no longer used. The "net" tab in terminal shows that FCKeditor is trying to load an individual file for each letter in the path I set for fck.Config['EditorAreaCSS'].
If someone could point out what I am doing wrong, that would be great!
Also how would I force the editor to redraw itself using the new CSS. (toggoling the source view seems to do it, but ther must be some command I can add to my function...
Cheers.
RE: change EditorAreaCSS via external javascr
fck.Config['EditorAreaCSS']= ['/themes/css/'+el.value];
Worked great.
But I still need to refresh the editor so us uses the new CSS file...
The best bet I can come up with is to call
fck.SwitchEditMode();
twice. it works, but I am sure there must be a better way..