`
lichangwei
  • 浏览: 74907 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

FCKEditor的使用

阅读更多
文档:
http://www.fckeditor.net/

http://docs.fckeditor.net/FCKeditor_2.x/Users_Guide

http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide

1.Download FCKeditor_2.6.3b.zip, copy FCKeditor directory to webapp/.
Delete some unused file:
(1)all folders whose name start with "_" under FCKeditor directory and its child directory.
(2)all files under FCKeditor directory except fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml.
(3)some files under editor/skins,editor/lang etc if you will not use them.

2.Download FCKeditor-2.3.zip,This is the JSP Integration Pack for using FCKeditor inside a java server page without the complexity of using a Java scriptlets or the javascript api.

3.Copy these two servlet,servlet-mapping from FCKeditor-2.3/web/WEB-INF/web.xml to web.xml in your project,
and do some change.
change servlet-mapping from
<servlet-mapping> 
<servlet-name>Connector</servlet-name> 
<url-pattern>/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern> 
  </servlet-mapping> 
  <servlet-mapping> 
<servlet-name>SimpleUploader</servlet-name> 
<url-pattern>/editor/filemanager/upload/simpleuploader</url-pattern> 
</servlet-mapping>
to
<servlet-mapping> 
<servlet-name>Connector</servlet-name> 
<url-pattern>/fckeditor/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern> 
  </servlet-mapping> 
  <servlet-mapping> 
<servlet-name>SimpleUploader</servlet-name> 
<url-pattern>/fckeditor/editor/filemanager/upload/simpleuploader</url-pattern> 
  </servlet-mapping>

4.Copy all libs under FCKeditor-2.3/web/WEB-INF/lib to /WEB-INF/lib of your project.

5.Copy xalan.jar to project if you want to browse and upload image etc.

6. Add a jsp.
<%
//It is mandatory. or
String content = (String)request.getAttribute("content");
if (content != null) {
//content = content.replaceAll("\r\n", "");
content = content.replaceAll("\r", "");
content = content.replaceAll("\n", "");
content = content.replaceAll("\"", "'");
} else {
content = "";
}
%>
<script type="text/javascript">

//传入参数为表单元素(由FCKeditor生成的input或textarea)的name
var oFCKeditor = new FCKeditor('content');

//指定FCKeditor根路径,也就是fckeditor.js所在的路径
oFCKeditor.BasePath='<session:constant name="ContextPath"/>/fckeditor/';

//The path of EditorAreaCSS should be passed from the server side.
  oFCKeditor.Config['EditorAreaCSS'] = '<session:constant name="ContextPath"/>/css/test.css';
 
oFCKeditor.Height='100%';
oFCKeditor.ToolbarSet='Default';
oFCKeditor.Value="<%=content%>";//默认值
oFCKeditor.Create();
</script>


7. fckconfig.js
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/jsp/connector';
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector';
FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector';
FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=File';
FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Image';
FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Flash';

8. Add a watermark picture in the edit textare.
body
{
   background-image: url(your image path);
   background-repeat: no-repeat;
}
分享到:
评论

相关推荐

    FCKEditor使用帮助文档

    **FCKEditor使用帮助文档** FCKEditor是一款开源的HTML编辑器,主要用于网站内容管理系统(CMS)和论坛等在线文本编辑场景。它以其强大的功能、易于集成和自定义而受到开发者的广泛欢迎。本帮助文档将详细介绍...

    asp.net文本编辑器FCKeditor使用方法详解

    ASP.NET 文本编辑器 FCKeditor 使用方法详解 FCKeditor 是一个功能强大且流行的 ASP.NET 文本编辑器,提供了许多实用的功能,如格式化文本、插入图片、上传文件、创建表格等。下面将详细介绍如何使用 FCKeditor 在 ...

    fckeditor使用手册

    **FCKeditor 使用手册** FCKeditor 是一款强大的开源富文本编辑器,广泛应用于网站内容管理系统,允许用户在网页上创建、编辑和格式化文本。本文档将详细介绍如何安装、配置、集成和优化 FCKeditor。 ### 安装 ...

    文本编辑器FCKeditor使用方法详解--图文详解

    【FCKeditor使用方法详解】 FCKeditor是一款强大的开源文本编辑器,主要用于在网页中创建和编辑富文本内容。它的功能强大,支持多种语言,并且提供了丰富的API供开发者进行自定义扩展。以下是对FCKeditor使用方法的...

    FCKEDITOR 使用说明

    **FCKEditor 使用详解** FCKEditor是一款曾经非常流行的开源HTML文本编辑器,它使得在网页上创建富文本内容变得更加简单。尽管现在已经被CKEditor所取代,但FCKEditor在许多旧项目中仍然广泛使用,因此理解其工作...

    FCKEditor使用方法

    **FCKEditor使用方法** FCKEditor是一款曾经非常流行的开源HTML文本编辑器,它允许用户在Web页面上创建和编辑富文本内容。FCKeditor以其强大的功能和易用性,被广泛应用于各种网站的后台管理系统中,使得非编程人员...

    FCKeditor使用方法详解

    【FCKeditor 使用方法详解】 FCKeditor 是一个基于JavaScript的开源富文本编辑器,它在Web开发领域中被广泛使用,尤其适用于那些需要提供用户友好、可视化的文本编辑功能的网站。FCKeditor 具备强大的功能,包括...

    FCKeditor使用方法技术详解.pdf

    ### FCKeditor使用方法技术详解 #### 一、概述 FCKeditor是一款杰出的富文本编辑器,以其直观的操作界面和强大的功能集受到广泛好评。它由JavaScript编写而成,能够轻松地集成到各种Web应用程序中,支持跨浏览器,...

    FCKeditor使用指南(FCKeditor_2.6.3)

    **FCKeditor 使用指南** **一、FCKeditor 简介** FCKeditor 是一个开源的、基于浏览器的富文本编辑器,它允许用户在网页上进行类似于Word的文本编辑操作。FCKeditor 2.6.3是其一个稳定版本,提供了丰富的功能,如...

    FCKeditor使用详解.doc

    FCKeditor 使用详解 FCKeditor 是一个功能强大、支持所见即所得功能的文本编辑器,可以为用户提供微软 Office 软件一样的在线文档编辑服务。它不需要安装任何形式的客户端,兼容绝大多数主流浏览器,支持 ASP.Net、...

    FCKeditor使用与代码

    FCKeditor使用JavaScript编写,支持多种浏览器,包括IE、Firefox、Chrome、Safari等。这款编辑器在Web开发中被广泛应用,特别是在内容管理系统(CMS)和论坛系统中。 **FCKeditor的配置**: FCKeditor的配置主要...

    FCKeditor使用方法技术详解.doc

    ### FCKeditor使用方法技术详解 #### 一、FCKeditor简介 FCKeditor是一款杰出的富文本编辑器,以其强大的功能、易于配置、跨浏览器兼容性、对多种编程语言的支持以及开源特性著称。这款编辑器在互联网上拥有广泛的...

    FCKeditor使用方法详解.doc

    ### FCKeditor使用方法详解 #### 一、引言 FCKeditor,一款基于JavaScript的网页编辑器,因其强大的功能、易配置性、跨浏览器兼容性以及对多种编程语言的支持而备受推崇。作为一款开源软件,FCKeditor不仅在国际上...

    FCKeditor使用方法详解 附:FCKeditor2.66版

    **FCKeditor 使用方法详解** FCKeditor 是一个开源的富文本编辑器,广泛应用于Web应用中,允许用户在浏览器端进行格式化文本编辑。它提供了丰富的文本格式化选项,如字体、字号、颜色、对齐方式等,还支持插入图片...

    FCKeditor 使用指南及 JavaScript 调用

    **FCKeditor 使用指南及 JavaScript 调用** FCKeditor 是一款开源的富文本编辑器,它在Web开发中广泛用于提供用户友好的在线文本编辑功能。通过JavaScript调用,开发者可以轻松地将FCKeditor集成到网页中,允许用户...

    FCKEditor使用指南.rar

    **FCKEditor 使用指南** FCKEditor 是一款广泛应用于网页开发中的开源富文本编辑器,它为用户提供了“所见即所得”的编辑体验,使得...而《FCKEditor使用指南.pdf》这份文档,将是你学习和掌握这个编辑器的宝贵资源。

    FCKEditor使用、修改源代码经验总结

    ### FCKEditor 使用及源代码修改经验总结 #### 前言 FCKeditor是一款流行的在线HTML编辑器,因其易用性和丰富的功能被广泛应用于Web开发中。它提供了类似于Word的编辑界面,使得非技术人员也能轻松编辑网页内容,...

Global site tag (gtag.js) - Google Analytics