Hi,
I am having issues with styles, they are being stripped off when displayed in the editor.
1. First I draw the textarea as below:
<textarea id="description" name="description___textarea" rows="1" cols="60" style="{margin-bottom: 1px; margin-top: 1px; height: 1.8em}" /><p><span style=\"font-family: Tahoma;\">The font test</span></p></textarea>
2. Then I called the ReplaceTextArea() function in fckeditor.js as below. Note that the quotes around style value is escaped.
<script type="text/javascript">
var oFCKeditor = new FCKeditor('description___textarea');
oFCKeditor.BasePath = "netmarkets/javascript/util/fckeditor/";
oFCKeditor.Config["CustomConfigurationsPath"] = "/Windchill/netmarkets/javascript/util/fckeditor/fckconfig_local.js";
oFCKeditor.Value = "<p><span style=\"font-family: Tahoma;\">The font test</span></p>" ;
oFCKeditor.Height = '300';
oFCKeditor.Width = '800';
oFCKeditor.Config["FormatOutput"] = false;
oFCKeditor.Config["FormatSource"] = false;
oFCKeditor.Config["ProcessHTMLEntities"] = false;
oFCKeditor.Config["ProcessNumericEntities"] = true;
oFCKeditor.Config["ImageUpload"] = true;
oFCKeditor.Config["ImageDlgHideAdvanced"] = true;
oFCKeditor.Config["ImageDlgHideLink"] = true;
oFCKeditor.Config["ImageBrowser"] = false;
oFCKeditor.Config["LinkBrowser"] = false;
oFCKeditor.Config["LinkUpload"] = false;
oFCKeditor.Config["FlashBrowser"] = false;
oFCKeditor.Config["FlashUpload"] = false;
oFCKeditor.Config["ToolbarStartExpanded"] = false;
oFCKeditor.Config["AutoDetectLanguage"] = false ;
oFCKeditor.Config["DefaultLanguage"] = 'en';
oFCKeditor.Config['DynamicToolbar_buttons'] = "Source|Cut,Copy,Paste,PasteText,PasteWord,-,Undo,Redo,-,Find,Replace,-,SelectAll,RemoveFormat|Bold,Italic,Underline,StrikeThrough,-,Subscript,Superscript+OrderedList,UnorderedList,-,Outdent,Indent+JustifyLeft,JustifyCenter,JustifyRight,JustifyFull+Link,Unlink+Table,Rule|FontFormat,FontName,FontSize+TextColor,BGColor,FitWindow";
oFCKeditor.ToolbarSet = 'DynamicToolbar' ;
oFCKeditor.ReplaceTextarea();
</script>
The fckconfig_local.js included here has just one line as below:
FCKConfig.Plugins.Add('DynamicToolbar', null);
3. When this is displayed in the editor in Firefox version 3 browser, the value of style is no longer there. By looking at the Source in the editor it is:
<p><span style="">The font test</span></p>
Is there something wrong in the above script? Is there any configuration that is missing? Do I have to write style definition file for the font?
This is reproducible on the http://www.fckeditor.net/demo too by pasting below in the Source of the editor:
<p><span style=\"font-family: Tahoma;\">The font test</span></p>
Any Help on this issue is appreciated.
Thanks and regards,
Abby
Tue, 01/13/2009 - 20:06
#1
Re: style attribute being stripped off using ReplaceTextarea
But there is definitely an issue when FCKeditor.Value attribute is used, it does not retains inline styles values.