日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發(fā)布時間:2025/3/20 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 05传智_jbpm与OA项目_部门模块中增加部门的jsp页面增加一个在线编辑器功能 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

這篇文章講的是在線編輯器功能,之前的部門模塊中,增加部門的功能jsp頁面起先是這么做的。

加入在線編輯器之后要達到的效果是:

?

采用一個插件,名為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">這行代碼主要是展現(xiàn)一個列表的效果,這個不是主要的。最主要的代碼是

<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。里面有最核心的函數(shù)->var FCKeditor = function( instanceName, width, height, toolbarSet, value )

介紹好了FCKeditor之后,我們看一下FCKeditor在這個項目中的應用。項目結構如下:




1.我們寫一個JQuery插件,命名為Jquery-fackeditor.js.內容如下

(function(jQuery){

//這里寫具體的代碼

})(jQuery);
這是JQuery插件的固定格式。在中間寫具體的代碼。中間的代碼是仿照那個官方給的例子,default.html->sample01.html,仿照sample01.html寫。



2.department_add.js,內容為:
$().ready(function(){//表示頁面加載完之后就執(zhí)行這個函數(shù)$.fckeditor("description"); }); 這個department_add.js的作用是當頁面加載好之后,會自動執(zhí)行 $.fckeditor("description")這個函數(shù)。其實這個department_add.js最后都是要加入到add.js(增加部門的jsp頁面)
這解釋一下為什么寫成 $.fckeditor("description");這么寫是調用var FCKeditor = function( instanceName, width, height, toolbarSet, value )函數(shù)里面的instanceName
"description",為什么寫成description呢?因為在add.js里面的 <td> <s:textarea name="description" class="TextareaStyle"></s:textarea>。我們要做的就是把textarea這個插件
給替換掉。;/構造函數(shù)的參數(shù)和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之后會執(zhí)行里面的函數(shù) --> <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' ) ;//構造函數(shù)的參數(shù)和textarea中的name屬性的值保持一致

????? oFCKeditor.BasePath = "fckeditor/";

????? oFCKeditor.ReplaceTextarea() ;

?? *? 說明?

?????? *? 創(chuàng)建一個在線編輯器,并且替換掉textarea

?????? *? 構造器函數(shù)的參數(shù)是textarea中name屬性的值

?????? *? BasePath的路徑指向fckeditor的下一級

?? *? 在fckeditor/中有一個fckconfig.js,這個js是做配置用的

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

??????? 用戶可以把自定義的匹配寫在myconfig.js

??????? 可以通過改變myconfig.js中的一些內容動態(tài)的改變在線編輯器中的內容




?

總結

以上是生活随笔為你收集整理的05传智_jbpm与OA项目_部门模块中增加部门的jsp页面增加一个在线编辑器功能的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 欧美精品在线免费观看 | 秋霞在线一区二区 | 国产一区二区免费在线观看 | 久久久久久久久久网站 | 久久亚洲精品小早川怜子 | www.4hu95.com四虎 极品在线视频 | aaa特级毛片 | 欧美午夜精品久久久久久孕妇 | 黄色在线免费观看 | 天天操天天舔天天干 | 国产性猛交xx乱 | 亚色成人| 亚洲成熟毛多妇女av毛片 | 丰满少妇被猛烈进入高清播放 | 日韩精品一区二区亚洲av | av导航大全 | 久久视频在线观看 | 在线观看视频中文字幕 | 久久伊人成人网 | 黑人3p波多野结衣在线观看 | 清冷男神被c的合不拢腿男男 | 我要爱爱网 | 农村老熟妇乱子伦视频 | 熟妇人妻久久中文字幕 | 亚洲不卡影院 | 被黑人啪到哭的番号922在线 | 无码人妻丰满熟妇区毛片蜜桃精品 | 美女久久久久久久 | 亚洲欧美天堂 | 久久国产精品无码一区二区 | 久久网站av | 欧美大黄 | 久操av| 亚洲av永久无码精品一百度影院 | 久久丫精品久久丫 | 国产在线伊人 | av资源在线播放 | 四虎国产精品永久免费观看视频 | 一区二区三区www污污污网站 | 欧美日韩国产激情 | 99精品福利 | 国产夫妻性爱视频 | 成人福利在线免费观看 | 亚洲中文字幕无码不卡电影 | 天天狠天天透 | h在线观看视频 | 久久伊人av| 欧美午夜精品 | 日本aⅴ视频 | 国产三级91 | 老汉色老汉首页av亚洲 | 操综合网| 天降女子在线 | 成人中文字幕+乱码+中文字幕 | 两口子交换真实刺激高潮 | 男男做爰猛烈啪啪高 | 国产精品伦一区二区 | 一节黄色片 | 91免费视频观看 | 天天谢天天干 | 欧美极品jizzhd欧美 | 无码人妻aⅴ一区二区三区玉蒲团 | av日韩在线免费观看 | 亚洲激情五月婷婷 | 亚洲av永久无码精品国产精品 | 女女同性被吸乳羞羞 | 久久青 | av片在线观看 | 欧美七区 | 好男人在线视频www 亚洲福利国产 | 欧美双性人妖o0 | 日韩视频第一页 | 欧美少妇bbw | 黑人操亚洲美女 | 国产亚洲欧美在线视频 | 98自拍视频 | 特黄视频 | 久久一区二区三区四区 | 欧美色图狠狠干 | 男人把女人捅爽 | 午夜成人免费视频 | 蝌蚪久久| 黄色小视频在线观看 | 黄色片免费视频 | 国产黄色www | 国产精品资源站 | 外国a级片| 国产粉嫩呻吟一区二区三区 | 日韩精品一区二区三区不卡 | 69精品久久久久久 | 国产无遮挡呻吟娇喘视频 | 免费毛片视频 | 99精品在线观看视频 | 波多野结衣一区二区三区四区 | av在线官网 | 久久精工是国产品牌吗 | 亚洲影院中文字幕 | 亚洲国产av一区 | 男人插女人网站 |