05传智_jbpm与OA项目_部门模块中增加部门的jsp页面增加一个在线编辑器功能

时间:2021-03-21 15:07:35

这篇文章讲的是在线编辑器功能,之前的部门模块中,增加部门的功能jsp页面起先是这么做的。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoQAAACvCAIAAADrIVjEAAAJT0lEQVR4nO3cwW4T1wLH4Xm7PFOegHWfgR1VxaJLhFSQur3obrqpSqjTS2QaiIFAYgjKXViyrDPjY8fneM7MnO/TT5ExE8cjRfp3bJfmr/e3kiSpYE3xZyBJUuU1r9/fSpKkgjWvP9xKkqSCGWNJkgrXvP6wlCRJBWvOPiwlSVLBjLEkSYXrGOOffjuXJEm91by5Wgb99Nv559s7SZLUT83fV8sgYyxJUp81fy+WQcZYkqQ+a2aLZdDmGN8DAEfWnC+WQcYYAPrU/LNYBhljAOhT88/HZZAxBoA+Nf/79C3IGANAn5q3n5ZBxhgA+tRcfPoWZIwBoE/NxefvQcYYAPrUzD9/DzLGANCnZn79PcgYA0CfmnfX34OMMQD0qfn3y12QMQaAPjWXX+6CjDEA9Kl5/+UuyBgDQJ+a91/vgowxAPSp+fD1LsgYM3lnb2bPnr/8+ZdfNeSePX959mZW+pcF+tBcfb0LMsZM3uz83fxyUfpZsMP8cvHn2dvSzwL60Cxu7oKMMZM3O39X+imwF2NMJYwxNTLGY2GMqUSzuL0LMsZMnjEeC2NMJZqPtz+CjDGTZ4zHwhhTiSmPcXNyus/fNien7R70UMGjHfp86Y8xHgtjTCWaT7c/giYwxu1l7RzabcO5/xjv/5gMijEeC2NMJaY5xm0PunINjtl56RyMceQKm4EwxmNhjKnENMe4fanaHuPIUu680t02xpGRZlCM8VgYYyrRfF7+CJrAGN9v2eA9X0+OfFf7QdrXwZ3fxaAY47EwxlRigmPc+aryYWMc3LPtlWcXxKNjjMfCGFOJCY5xp4Nfpl7fs89nuNpfGSZjPBbGmEpMc4wj18QHvGccudS+39jpyM9iaIzxWBhjKjHZMQ5uHzDGnS9udz7stneLjfFgGe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cd41KfQT8ZYkgbaaskKlmuMR30K/WSMJWmgPXr8onhOoZ+MsSRJhTPGkiQVzhhLklQ4YyxJUuGMsSRJhTPGkiQVzhhLklQ4YyxJUuGMsSRJhTPGkiQVzhhLklS4/wPJtPkkVCVdXwAAAABJRU5ErkJggg==" alt="" width="688" height="175" />

加入在线编辑器之后要达到的效果是:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+0AAAEBCAIAAACCPNOUAAATPklEQVR4nO3d32tcZ3rAcf8HLbSw0J+wsKEXvSiB4kJ9FUEz7cWyV97SopsNS2v2btctGxLRhRoanBpVsHRTOm6KTJOJ06UluyDCkqXoYiEXVVAunGwC8SJB45jQMdRiXVFwL450dHxm5syZeWfm0Tvz+fBglNHoeDTHkr7z6p3Jhbv//b/GGGOMMcaYvObC1n8cGmOMMcYYY/KaC//z6P+MMcYYY4wxeY2ON8YYY4wxJr/R8cYYY4wxxuQ3Fx4DAAC50fEAAJAfHQ8AAPnR8QAAkB8dDwAA+dHxAACQHx0PAAD50fEAAJAfHQ8AAPnR8QAAkB8dDwAA+dHxAACQHx0PAAD50fEAAJAfHQ8AAPnR8Uzm7s8OfvTO7pvf/4E5z/Ojd3bv/uwg+h8LADBHOp7JHBze/+zzB9G3gjE++/zBx3f/K/pWAABzpOOZzMHh/eibQCs6HgCWm45nMjo+FzoeAJabjmcyOj4XOh4AlpuOZzI6Phc6HgCWW8Ydf+HZ59u898Kzzw/ORIeqHW3a27skdHwudDwALLcsO34wyoc2+qjmbt/x7Y+5OnR8LnQ8ACy3LDt+0ETr5bXrjF2wr3V8w7r+KtDxudDxALDcsuz4wQXywY5viOyx6+ujOr6h71eHjs+FjgeA5ZZlxz8eke8tN8A0fNTgQQZX34d+1OrQ8bnQ8QCw3PLr+KHbYKbr+Nolo7bKWIav0vG50PEAsNzy6/ihpt5XU17S5qmug3+uIB2fCx0PAMsty45vWImfYn98wwL/40riN/xdK0XH50LHA8Byy7Xja29P0fFDd+MMPeyonfE6nvN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PABAIh1PAB0PAJBIxxNAxwMAJNLxBNDxAACJdDwBdDwAQCIdTwAdDwCQSMcTQMcDACTS8QTQ8QAAiXQ8AXQ8AEAiHU8AHQ8AkEjHE0DHAwAk0vEE0PEAAIl0PAF0PABAIh1PAB0PAJBIxxNAxwMAJNLxBNDxAACJdDwBdDwAQCIdTwAdDwCQSMcTQMcDACTS8QTQ8QAAiXQ8AXQ8AEAiHU8AHQ8AkEjHE0DHAwAk0vEE0PEAAIl0PAF0PABAIh1PAB0PAJBIxxNAxwMAJNLxBNDxAACJdDwBrgAAkCwxyXQ8AADkR8cDAEB+dDwAAORHxwMAQH50PAAA5EfHAwBAfnQ8AADkR8cDAEB+dDwAAORHxwMAQH7+H9iG8KRsIGY8AAAAAElFTkSuQmCC" alt="" width="716" height="183" />

采用一个插件,名为FCKeditor-v2.6.3。要理解一个插件,要先从插件的例子开始,打开下载包里面的Fckeditor-v2.3.6->fckeditor->_samples->default.html。

这个是FCKeditor-v2.6.3插件的实例。default.html里面是这么写的。

<html>
    <head>
        <title>FCKeditor - Samples</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="robots" content="noindex, nofollow">
    </head>
    <frameset rows="60,*">
        <frame src="sampleslist.html" noresize scrolling="no">
        <frame name="Sample" src="html/sample01.html" noresize>
    </frameset>
</html>

上面的红色的代码是主要代码,<frame src="sampleslist.html" noresize scrolling="no">这行代码主要是展现一个列表的效果,这个不是主要的。最主要的代码是

<frame name="Sample" src="html/sample01.html" noresize>。
我们打开他的代码html/sample01.html看一下。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>FCKeditor - Sample</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<link href="../sample.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../fckeditor.js"></script>
</head>
<body>
<h1>
FCKeditor - JavaScript - Sample 1
</h1>
<div>
This sample displays a normal HTML form with an FCKeditor with full features enabled.
</div>
<hr />
<form action="../php/sampleposteddata.php" method="post" target="_blank">
<script type="text/javascript">
<!--
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ; var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.Height = 300 ;
oFCKeditor.Value = '<p>This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ;
oFCKeditor.Create() ;
//-->
</script>
<br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
 <script type="text/javascript" src="../../fckeditor.js"></script>这句代码很重要。引入了fckeditor.js。里面有最核心的函数->var FCKeditor = function( instanceName, width, height, toolbarSet, value )

介绍好了FCKeditor之后,我们看一下FCKeditor在这个项目中的应用。项目结构如下:
05传智_jbpm与OA项目_部门模块中增加部门的jsp页面增加一个在线编辑器功能

1.我们写一个JQuery插件,命名为Jquery-fackeditor.js.内容如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAi0AAADcCAIAAAAz2gawAAAgAElEQVR4nO2dXasdx5X3+/MYArowBu8bzYfwuTTGEPZVLgWSL8yZxxAIzIW3LzTyxegqIMTIjCGJdwiBI+Q5iRXbQig+loL2WIrsHI9ztq14FOsc2+NMPxf9Vi9rrVrVL7vr7P7/KIROv1RXVfde/15Vq6uyfBi+/fbb4j8HHsvzZ7KdS/52n4HKlhSrxSybL8cuRVdWi9lssRq7FACAU0k2UL6cDi3Pn8kyTobe+rdsZ7dOO28NVLYIVm9fzHZ2s3M3hrGxq8Usy1gZWs6zTNidEEU9sqAUlTUKHwgAmBBqHTraW1y4cOHChas6L4XWoeX5M1l25vwyLEKb0qG7853dbOcaY+rXi3NFYS4uDvu/9moxE00yo0OVMU9MpJbzgMAs50mVFwCQChodOrh64cKFxd7B3sLXoW+/+/7oy//Z//DuO3sf7H949+jL//n2u+9zWockFfr9+Z/sZju72U/+3djde2093r+WSTo0pD8UUiH+pNqYF38l41zINVrOEyoqACAhgjp0tLcotefI06GT776/9fHDO/c/O3z85Mn3/zh8/OTO/U9vffzw5LvvCR26tMP3yB38Zqf0gcyNw1TZJKRDw9HGOyC68dJyMoTStJJdAMAUiBgf8nXoL0d/++Deo/XJD+uTH9Yn/zg6+WF98sMH9x59+sVXvg5d2mGdIV6HDm/MLJ0oO8pmb6/zvNp77saqPMzYZbB8w+jue+OumQ+RygPss6h+udJV8g9QlYr1DqxeN3sshTTlhun3VMCXBTN3O6fVYpbNFqtqqMc4gB7EoiWHFyLoEACAoZMO/Xr/o48P//bnJ//76Mn3f67SweHXv97/yNMhxhu69P8YPfjJvy+VOuQmUzOK4R8rzd5ed9che2+Z5u/nulJp3RjHdpMnGceEdMj609WFWn/KA8z9/tAPG2DBVgw6BABg6KRDP//Ve384fPov/3rNTH84fPrzX73n6tDy/BmyU64nHSoOsPc2amFowPvXLNck2C9XXsJWkfKsSnhqVSuGkUKlykujHO5Ns203bfuNrbIOeXvtQni5S0IkiArn6CmrDACYHp106Bfv3vnw4fpP6+N76+N76+M/fXl8b3384cP1L9694+qQODjUrV/OEIlCeByV8nvqGlrpUClvZvCCmY9cqmKLblSnTx0iLmlJhqwTREmYY5mqQYYAAByddOjh51/9551PHjw+fvD45JPHxw8eHz94fPzunQcPP/fGh8bTITHkuosOVT14Rj4XF4ej6JCiX84bd3ICvwNCYRZFPJQuBHrkAAAsnXTo78ff7t++//uPPrn32Zeffv303l/W7330YP/2/b8ff6vtl5umP9SqX478QscUp1h/yL+WVKTae6oiGgKHiVUBAICaTjqU5/k3x9999sXj3/7uj//xm5u//d0f//LF42+Ov8uJ74cCDpGsQ4VNb4ILVDpEfoVKjw/xPhOlQ3WkXDU+VEVDFB6SQofaxSmE4gVcKSk8EXN8SBCCsDSWZZbzQZwCACCWrjrE4emQOKEP//0QHdim06EmoIA4t8CPbSt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是JQuery插件的固定格式。在中间写具体的代码。中间的代码是仿照那个官方给的例子,default.html->sample01.html,仿照sample01.html写。 2.department_add.js,内容为:
$().ready(function(){
//表示页面加载完之后就执行这个函数
$.fckeditor("description");
});
这个department_add.js的作用是当页面加载好之后,会自动执行 $.fckeditor("description")这个函数。其实这个department_add.js最后都是要加入到add.js(增加部门的jsp页面)
这解释一下为什么写成 $.fckeditor("description");这么写是调用var FCKeditor = function( instanceName, width, height, toolbarSet, value )函数里面的instanceName是
"description",为什么写成description呢?因为在add.js里面的 <td> <s:textarea name="description" class="TextareaStyle"></s:textarea>。我们要做的就是把textarea这个插件
给替换掉。;/构造函数的参数和textarea中的name属性的值保持一致。

给出add.js的代码:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!-- 加载核心的fckeditor.js -->
<script language="javascript" src="${pageContext.request.contextPath}/fckeditor/fckeditor.js"></script>
<!-- 加载我们自己写的插件 -->
<script language="javascript" src="${pageContext.request.contextPath}/js/jquery-fackeditor.js"></script>
<!-- 加载这个js之后会执行里面的函数 -->
<script language="javascript" src="${pageContext.request.contextPath}/js/department_add.js"></script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>部门列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body> <!-- 标题显示 -->
<div id="Title_bar">
<div id="Title_bar_Head">
<div id="Title_Head"></div>
<div id="Title"><!--页面标题-->
<img border="0" width="13" height="13" src="${pageContext.request.contextPath}/css/images/title_arrow.gif"/> 部门信息
</div>
<div id="Title_End"></div>
</div>
</div>
<!--显示表单内容-->
<div id=MainArea>
<s:form action="DepartmentAction_add.action" method="Post">
<div class="ItemBlock_Title1"><!-- 信息说明<DIV CLASS="ItemBlock_Title1">
<IMG BORDER="0" WIDTH="4" HEIGHT="7" SRC="../style/blue/images/item_point.gif" /> 部门信息 </DIV> -->
</div> <!-- 表单内容显示 -->
<div class="ItemBlockBorder">
<div class="ItemBlock">
<table cellpadding="0" cellspacing="0" class="mainForm">
<tr><td>部门名称</td>
<!-- tr标签代表一行 -->
<!-- td代表行中的一列 -->
<td> <s:textfield name="dname"caaClass="InputStyle"></s:textfield>
</td></tr>
<tr><td>职能说明</td>
<td> <s:textarea name="description" class="TextareaStyle"></s:textarea>
</td>
</tr>
</table>
</div>
</div>
<!-- 表单操作 -->
<div id="InputDetailBar">
<input type="image" src="${pageContext.request.contextPath}/css/images/save.png"/>
<a href="javascript:history.go(-1);"><img src="${pageContext.request.contextPath}/css/images/goBack.png"/></a>
</div>
</s:form>
</div> <div class="Description">
说明:<br />
1,上级部门的列表是有层次结构的(树形)。<br/>
2,如果是修改:上级部门列表中不能显示当前修改的部门及其子孙部门。因为不能选择自已或自已的子部门作为上级部门。<br />
</div> </body>
</html>
总结如下:

步骤


*  应该导入fckeditor.js


*  写js代码


var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;//构造函数的参数和textarea中的name属性的值保持一致


oFCKeditor.BasePath = "fckeditor/";


oFCKeditor.ReplaceTextarea() ;


*  说明


*  创建一个在线编辑器,并且替换掉textarea


*  构造器函数的参数是textarea中name属性的值


*  BasePath的路径指向fckeditor的下一级


*  在fckeditor/中有一个fckconfig.js,这个js是做配置用的


FCKConfig.CustomConfigurationsPath = FCKConfig.EditorPath + "myconfig.js"


用户可以把自定义的匹配写在myconfig.js


可以通过改变myconfig.js中的一些内容动态的改变在线编辑器中的内容