With my Fx browser using the FCKeditor online demo I can see that <B> and <I> tags are inserted by the editor. I'm assuming the online demo is 2.4.2 and this is working as I would expect.
With the same Fx browser I bring up the 2.4.2 editor integrated with our application and when I bold something is uses spans, or sometimes existing font tags style attribute to set bold, italic, underlined:
For example (ignore font-size that's our modification, which is modified on a OnSelectionChange event):
Bold
<span _moz_dirty="" style="font-weight: bold;">This </span>
<font _moz_dirty="" style="font-size: 16px; color: rgb(204, 0, 0); font-weight: bold;">font</font>
Italic
<font _moz_dirty="" style="font-size: 16px; color: rgb(204, 0, 0); font-weight: bold; font-style: italic;">font</font>
<span _moz_dirty="" style="font-style: italic;">is </span>
Underlined
<font _moz_dirty="" style="font-size: 16px; color: rgb(204, 0, 0); font-weight: bold; font-style: italic; text-decoration: underline;">font</font>
<span _moz_dirty="" style="font-style: italic; text-decoration: underline;">is </span>
I verified that the following line in fckeditingarea.js gets called:
oDoc.execCommand( 'styleWithCSS', false, FCKConfig.GeckoUseSPAN ) ;
and that FCKConfig.GeckoUseSPAN is false ( using firebug )
I manually call "Bold" command using FCK apis and trace it down to this line in fck.js:
FCK.EditorDocument.execCommand( commandName, false, commandParameter ) ;
commandName = "Bold"
commandParameter = undefined
I see this is the resultant HTML:
<span _moz_dirty="" style="font-weight: bold;">has </span>
I looked at the HTML before the OnSelectionChange event is fired, so this is what Fx is doing, not some other FCK code or extension. Has anyone else seen this? Any ideas what is going on here? Any ideas on what to try next to fix this?
Thanks! FCK is awesome.
With the same Fx browser I bring up the 2.4.2 editor integrated with our application and when I bold something is uses spans, or sometimes existing font tags style attribute to set bold, italic, underlined:
For example (ignore font-size that's our modification, which is modified on a OnSelectionChange event):
Bold
<span _moz_dirty="" style="font-weight: bold;">This </span>
<font _moz_dirty="" style="font-size: 16px; color: rgb(204, 0, 0); font-weight: bold;">font</font>
Italic
<font _moz_dirty="" style="font-size: 16px; color: rgb(204, 0, 0); font-weight: bold; font-style: italic;">font</font>
<span _moz_dirty="" style="font-style: italic;">is </span>
Underlined
<font _moz_dirty="" style="font-size: 16px; color: rgb(204, 0, 0); font-weight: bold; font-style: italic; text-decoration: underline;">font</font>
<span _moz_dirty="" style="font-style: italic; text-decoration: underline;">is </span>
I verified that the following line in fckeditingarea.js gets called:
oDoc.execCommand( 'styleWithCSS', false, FCKConfig.GeckoUseSPAN ) ;
and that FCKConfig.GeckoUseSPAN is false ( using firebug )
I manually call "Bold" command using FCK apis and trace it down to this line in fck.js:
FCK.EditorDocument.execCommand( commandName, false, commandParameter ) ;
commandName = "Bold"
commandParameter = undefined
I see this is the resultant HTML:
<span _moz_dirty="" style="font-weight: bold;">has </span>
I looked at the HTML before the OnSelectionChange event is fired, so this is what Fx is doing, not some other FCK code or extension. Has anyone else seen this? Any ideas what is going on here? Any ideas on what to try next to fix this?
Thanks! FCK is awesome.
RE: GeckoUseSPAN=false and span still being u
From that I decided to try to set the browsers styleWithCSS setting in the on load complete event:
FCKeditor_OnComplete( editorInstance )
{
...
editorInstance.EditorDocument.execCommand( 'styleWithCSS', false,
editorInstance.EditorWindow.FCKConfig.GeckoUseSPAN );
...
}
This works for me, and I don't have to modify any FCKeditor code. I am not sure why the setting is reset, maybe someone who knows more about the FCKeditor load process can explain it. Sorry I don't have time to hunt this down further.
RE: GeckoUseSPAN=false and span still being u
I don't really understand why, but I noticed that if I issued
FCK.EditorDocument.execCommand( 'styleWithCSS', false, FCKConfig.GeckoUseSPAN )
right before
FCK.EditorDocument.execCommand( commandName, false, commandParameter )
in fck.js then the behavior was correct.
RE: GeckoUseSPAN=false and span still being u
In the onload processing the reference to the FCKConfig was incorrect, it should be:
editorInstance.EditorDocument.execCommand( 'styleWithCSS', false,
editorInstance.EditorWindow.parent.FCKConfig.GeckoUseSPAN );