关于jsp使用兼容版kindeditor编辑器的方法.docx
《关于jsp使用兼容版kindeditor编辑器的方法.docx》由会员分享,可在线阅读,更多相关《关于jsp使用兼容版kindeditor编辑器的方法.docx(19页珍藏版)》请在冰点文库上搜索。
关于jsp使用兼容版kindeditor编辑器的方法
jsp关于使用兼容版kindeditor编辑器的方法
备注:
js能取值,修改能改值
1、增加页面调用add.jsp
《如图》代码在下
<%@pagecontentType="text/html;charset=GBK"errorPage="../error.jsp"%>
<%@pageimport="zr.zrpower.ewebeditor.fileService.FileManageService"%>
<%@pageimport="zr.zrpower.entity.sys.SessionUser"%>
<%@pageimport="zr.zrpower.ejb.sys.UIService"%>
<%@pageimport="java.util.*"%>
<%@pageimport="java.text.*"%>
<%
FileManageServicefileManage=newFileManageService();
UIServiceuserUI=newUIService();
SessionUseruser=(SessionUser)session.getAttribute("userinfo");
Stringstate=request.getParameter("state");
StringstrRECORDID=request.getParameter("RECORDID");
if(strRECORDID==null){strRECORDID="";}
if(strRECORDID.length()==0)
{
strRECORDID=fileManage.GlobalID("");//生成附件编号
}
%>
文章添加
">
//编辑器应用开始
functiondoCheck(){
//检测表单的有效性
//如:
标题不能为空,内容不能为空,等等....
if(eWebEditor1.getHTML()==""){
alert("内容不能为空!
");
return;
}
//表单有效性检测完后,自动上传远程文件
//函数:
remoteUpload(strEventUploadAfter)
//参数:
strEventUploadAfter;上传完后,触发的函数名,如果上传完后不需动作可不填参数
eWebEditor1.remoteUpload();
}
//有效性检察
functionCheck(theForm){
alert(theForm.content.value);
if(theForm.content.value!
=""){
theForm.FCONTENT.value=theForm.content.value;
}
if(trim(theForm.TITLE1.value)==""){
alert("文章标题不能为空!
");
theForm.TITLE1.focus();
return;
}
if(theForm.TITLE1.value.length>100){
alert("文章标题长度不能超过100!
");
theForm.TITLE1.focus();
return;
}
if(theForm.TITLE2.value.length>100){
alert("文章副标题长度不能超过100!
");
theForm.TITLE2.focus();
return;
}
if(theForm.FSOURCE.value.length>100){
alert("文章来源长度不能超过100!
");
theForm.FSOURCE.focus();
return;
}
if(theForm.KEYWORDS.value.length>100){
alert("文章关键字长度不能超过100!
");
theForm.KEYWORDS.focus();
return;
}
if(theForm.AUTHOR.value.length>100){
alert("文章作者长度不能超过100!
");
theForm.AUTHOR.focus();
return;
}
if(theForm.content.value==""){
alert("内容不能为空!
");
return;
//returnfalse;
}
document.form1.submit();
}
<%
StringID=fileManage.GetMaxFieldNo();
Calendarcal=Calendar.getInstance();
SimpleDateFormatformatter=newSimpleDateFormat("yyyy-MM-ddHH:
mm:
ss");
StringmDateTime=formatter.format(cal.getTime());
%>
'/>
'/>
'/>
'/>
">
--HTMLHead-->
--HTMLHead表单头显示[显示内容,用户肤色的图片文件夹]-->
<%=userUI.ShowHeadHtml("公共文件管理",user.getUserImage())%>
--HTMLBodyStart显示表单开始部分-->
<%=userUI.ShowBodyStartHtml()%>
absolute;width:
100%;height:
100%;overflow:
auto'>
98%">
|
文章标题:
* |
文章副标题:
|
文章来源:
|
审核:
|
作者:
|
''">
文章内容:
|
none">
''">
<%--编辑器开始--%>
KindEditor.ready(function(K){
window.editor=K.create('textarea[name="content"]',{
cssPath:
'../webedit/plugins/code/prettify.css',
uploadJson:
'../webedit/jsp/upload_json.jsp',
fileManagerJson:
'../webedit/jsp/file_manager_json.jsp',
allowFileManager:
true,
afterBlur:
function(){this.sync();}
});
});
96%;height:
350px;visibility:
hidden;">
<%--编辑器结束--%>
|
FLOWID=mail&DOCID=<%=strRECORDID%>&AID=mail&TYPE=1"border=0frameborder=0width=100%height=100%>
|
|
<%=userUI.ClickButton("远程采集","JavaScript:
getContent();","buttonSave.gif",user.getUserImage())%>
<%=userUI.ClickButton("保存","JavaScript:
Check(form1);","buttonSave.gif",user.getUserImage())%>
<%=userUI.ClickButton("重填","JavaScript:
document.form1.reset();","buttonReset.gif",user.getUserImage())%>
<%=userUI.ClickButton("返回","JavaScript:
history.back();","buttonReturn.gif",user.getUserImage())%>
|