Hello,
I did not find my problem in FAQ/Documentation/Forum, thus I post my message here.
I have developed a sit that works well in CKEditor 3.5. However, since I migrated to CKEditor 4.1.1, I have a strange problem that occurs most of the time (but not always).
The "Source" button does not show the HTML Source, instead I have an entry in the Error Console of Mozilla (I use FireFox 20.0 on ubuntu 12.04 LTS), that the variable is not defined in the bold line (see below). I use an output filter:
function configureHtmlOutput( ev )
{
var editor = ev.editor,
dataProcessor = editor.dataProcessor,
htmlFilter = dataProcessor && dataProcessor.htmlFilter;
dataProcessor.writer.selfClosingEnd = '>';
var dtd = CKEDITOR.dtd;
htmlFilter.addRules(
{
elements :
{
$ : function( element )
{
if ( element.name == 'table' )
{
alert ("Editor name is "+EDITOR_NAME);
var editor_area2 = document.getElementById('cke_contents_'+EDITOR_NAME);var style = element.attributes.style;
var cls = GetClass(element.attributes);
cls = " "+cls+" ";
//alert ("class is "+cls);
if ( style && cls.match(/relativeScaling/) )
{
//alert('width:'+editor_area.offsetWidth);
var ref_width = editor_area2.offsetWidth * 1;
var match = /(?:^|\s)width\s*:\s*(\d+)px/i.exec( style ),
width = match && match[1];width = Math.round( width / (ref_width/100) ) + '%';
if ( width )
{
element.attributes.style = element.attributes.style.replace( /(?:^|\s)width\s*:\s*(\d+)px;?/i , 'width: '+width+';' );
//element.attributes.width = width;
}
}
}
return element;
}
}
} );
}
I checked that EDITOR_NAME is set and is correct.
Is there anything I can do?
Thanks and kind regards
Ernst