I wanted to post some code I developed for when the "native" css file needs to be dynamic: (I'm not so expert on javascript so this may not be that elegant but it gets the css files of a parent page and loads them here - plus an override css page if present - you can probably figure this out..)
if(window.parent.CMSBGetNativeStyleSheets=='popup'){
o=window.parent.opener.document.getElementsByTagName('head')[0].innerHTML;
o=o.split("\n");
FCKConfig.EditorAreaCSS=[];
for(i=0; i<o.length; i++){
t=o[i];
if(t.indexOf('<link')<0)continue;
start=t.indexOf('href="')+6;
t=t.substring(start,1000);
end=t.indexOf('"');
t=t.substring(0,end);
//convert
t=t.replace(/(\.\.\/)*/g,'');
t=t.replace(/^\//,'');
t='/'+t;
FCKConfig.EditorAreaCSS[FCKConfig.EditorAreaCSS.length]=t;
}
//in case any CSS in the native stylesheets does something wierd, include this file in site-local to override it
FCKConfig.EditorAreaCSS[FCKConfig.EditorAreaCSS.length]='/site-local/CMSB_CSS_override.css';
}else{
FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
}
Re: native CSS is not seen in the editor
Re: native CSS is not seen in the editor
(I'm not so expert on javascript so this may not be that elegant but it gets the css files of a parent page and loads them here - plus an override css page if present - you can probably figure this out..)
if(window.parent.CMSBGetNativeStyleSheets=='popup'){ o=window.parent.opener.document.getElementsByTagName('head')[0].innerHTML; o=o.split("\n"); FCKConfig.EditorAreaCSS=[]; for(i=0; i<o.length; i++){ t=o[i]; if(t.indexOf('<link')<0)continue; start=t.indexOf('href="')+6; t=t.substring(start,1000); end=t.indexOf('"'); t=t.substring(0,end); //convert t=t.replace(/(\.\.\/)*/g,''); t=t.replace(/^\//,''); t='/'+t; FCKConfig.EditorAreaCSS[FCKConfig.EditorAreaCSS.length]=t; } //in case any CSS in the native stylesheets does something wierd, include this file in site-local to override it FCKConfig.EditorAreaCSS[FCKConfig.EditorAreaCSS.length]='/site-local/CMSB_CSS_override.css'; }else{ FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ; }Samuel