SoFunction
Updated on 2025-04-13

FCKeditor usage method (FCKeditor_2.6.3) Detailed usage instructions


4. Modify /WebRoot/fckeditor/, the modification part is as follows:
Copy the codeThe code is as follows:

= + 'filemanager/browser/default/?Connector=/fckeditor/connector' ;
= + 'filemanager/browser/default/?Type=Image&Connector=/fckeditor/connector' ;
= + 'filemanager/browser/default/?Type=Flash&Connector=/fckeditor/connector' ;
= '/fckeditor/simpleuploader?Type=File' ;
= '/fckeditor/simpleuploader?Type=Image' ;
= '/fckeditor/simpleuploader?Type=Flash';

Notice:
(1) Steps 3 and 4 set the configuration for file browsing and uploading, and the <url-pattern> of the Servlet should be consistent with the URL reference in it;
(2) The prerequisite for this example to run normally is that WebRoot is deployed as the root path. If a virtual path is set, the servlet will not be found.
4. Use
This example uses the most direct js method, and the example exists in web-inf/:
Copy the codeThe code is as follows:

<%@ page contentType="text/html;charset=GBK"%>
<html>
<head>
<title>FCKeditor Test</title>
<script type="text/javascript" src="fckeditor/"></script>
</head>
<body>
<form action="" method="post">

<%
String content=("content");
if (content != null) {
content = ("\r\n", "");
content = ("\r", "");
content = ("\n", "");
content = ("\"", "'");
}else{
content = "";
}
%>

<table width=100%>
<tr>
<td colspan=4 style='text-align:center' width=100% height=50px>
<span>
<script type="text/javascript">
var oFCKeditor = new FCKeditor('content');//Pass the name of the form element (input or textarea generated by FCKeditor)
='fckeditor/';//Specify the root path of the FCKeditor, that is, the path it is located
='100%';
='Demo';//Specify the toolbar, note that ToolbarSets
="<%=content%>";//Default value
();
</script>
</span>
</td>
</tr>
<tr><td align=center><input type="submit" value="submit"></td></tr>
<tr><td> </td></tr>
<tr><td>Get the value (can be saved directly to the database): </td></tr>
<tr><td style="padding:10px;"><%=content%></td></tr>
</table>
</form>
</body>
</html>

V. Configuration file

1. DefaultLanguage: The default language can be changed to "zh-cn"
2. Custom toolbar: ToolbarSets can be modified or added, for example:
Copy the codeThe code is as follows:

["Demo"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','TextColor','BGColor','-','Style','-','Image','Flash','Table']
] ;

3. EnterMode and ShiftEnterMode: the line-winning behavior of "Enter" and "Shift+Enter", the comment prompts the optional mode
4. EditorAreaCss: Edit area style file
5. Other parameters (redirect):
Copy the codeThe code is as follows:

AutoDetectLanguage=true/false Automatic detection language
BaseHref="" Relative link base address
ContentLangDirection="ltr/rtl" Default text direction
ContextMenu=String array, right-click menu content
CustomConfigurationsPath="" Custom configuration file path and name
Debug=true/false Whether to enable the debugging function, so that when calling(), the content will be output in the debug window
When EnableSourceXHTML=true/false is TRUE, when switching from the visual interface to the code page, the HTML is processed into XHTML
EnableXHTML=true/false Whether to allow XHTML to replace HTML
FillEmptyBlocks=true/false Use this function to replace empty block-level elements with spaces.
FontColors="" Sets the text color list when displaying the color picker
FontFormats="" Sets the name displayed in the text format list
FontNames="" Font name in the font list
FontSizes="" List of font sizes in font size
ForcePasteAsPlainText=true/false Force paste as plain text
ForceSimpleAmpersand=true/false Whether to convert the & symbol to XML entity
FormatIndentator="" Characters used when indenting the code in the source code format
FormatOutput=true/false Whether to automatically format the code when outputting content
FormatSource=true/false Whether to automatically format code when switching to code view
FullPage=true/false Whether to allow editing of the entire HTML file, or only editing content between BODYs
GeckoUseSPAN=true/false Whether to allow SPAN tags to replace B, I, U tags
IeSpellDownloadUrl=""Download spellchecker URL
ImageBrowser=true/false Whether to allow browsing server functions
ImageBrowserURL="" The URL that runs when browsing the server
ImageBrowserWindowHeight="" Image BrowserWindowHeight="" Image BrowserWindowHeight
ImageBrowserWindowWidth="" Image Browser Window Width
LinkBrowser=true/false Does it allow browsing the server when the link is inserted
LinkBrowserURL="" The URL of the browsing server when inserting a link
LinkBrowserWindowHeight=""link target browser window height
LinkBrowserWindowWidth=""link target browser window width
Plugins=object Register plugin
PluginsPath="" Plugin folder
ShowBorders=true/false Merge borders
SkinPath="" Skin folder location
SmileyColumns=12 Number of columns in the figure window
SmileyImages=Array of image file names in the character window
SmileyPath="" icon folder path
SmileyWindowHeight Window Height
SmileyWindowWidth symbol window width
SpellChecker="ieSpell/Spellerpages" Set up the spellchecker
StartupFocus=true/false FOCUS to the editor when enabled
StylesXmlPath="" Set the location of the XML file that defines the CSS style list
TabSpaces=4 Number of space characters generated by the TAB key
ToolBarCanCollapse=true/false Whether to allow expansion/collapse toolbar
ToolbarSets=object Allows the use of TOOLBAR collections
ToolbarStartExpanded=true/false Is it true that TOOLBAR is expanded?
UseBROnCarriageReturn=true/false When entering, is it a BR mark or a P or DIV mark?

6. Custom styles

The Style option of the toolbar is generated by the specified configuration file:

= + '' ;
Custom styles can be modified.