eWebEditor.jsp
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:8k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%
  2. /** 名称:eWebEditor在线文本编辑器--国生修改版2007.5.3
  3. *   作者:国生
  4. *  日期:2007.5.3
  5. *   网址:http://www.gs008.com
  6. */
  7. %>
  8. <%@ page contentType="text/html; charset=GBK" %>
  9. <%@ page import="java.util.*,java.io.*"%>
  10. <%@ page import="org.ggs.editor.*" %>
  11. <%
  12. String  sContentID,
  13.          sStyleID,
  14.          sFullScreen,
  15.          sStyleName,
  16.                sStyleDir,
  17.              sStyleCSS,
  18.                sStyleUploadDir,
  19.                nStateFlag,
  20.                sDetectFromWord,
  21.                sInitMode,
  22.                sBaseUrl,
  23.                sVersion,
  24.                sReleaseDate,
  25. sAutoRemote,
  26.                sToolBar;
  27. EditWebhelper web = new EditWebhelper();
  28. //初始化处理bean
  29. web.filename = config.getServletContext().getRealPath("/")+"WEB-INF/style.xml";
  30. web.filename2 = config.getServletContext().getRealPath("/")+"WEB-INF/button.xml";
  31. web.getInstance();
  32. //初始化输出bean
  33. EditBean bean = web.InitPara();
  34. sVersion = bean.getSVersion();
  35. sReleaseDate = bean.getSReleaseDate();
  36. sStyleName = bean.getSStyleName();
  37. sStyleDir = bean.getSStyleDir();
  38. //sStyleUploadDir = bean.getSStyleUploadDir();
  39. //<add code start>
  40. //图片显示路径设置
  41. //此处设置上传文件保存路径,注意路径要由ROOT开始===3处======================
  42. //修改此处需修改WEB-INF/Style.xml文件对应处<suploaddir>/UploadFile/</suploaddir>=========
  43. //修改此处需修改eWebEditor.jsp文件对应处 =====www.ITstudy.cn=========
  44. //修改此处需修改upload.jsp文件对应处 =====www.ITstudy.cn=========
  45. String sUploadFilePath=request.getContextPath()+"/UploadFile/";
  46. String sStyleNameAdd;
  47. Calendar calendar = Calendar.getInstance();
  48. //sStyleNameAdd=config.getServletContext().getRealPath("/")+ sUploadFilePath +calendar.get(Calendar.YEAR) + 
  49. //"/"+ (calendar.get(Calendar.MONTH)+1) +"/"+ calendar.get(Calendar.DAY_OF_MONTH)+"/";
  50. sStyleNameAdd=config.getServletContext().getRealPath("/")+ sUploadFilePath +"/";
  51. //图片日期同步,并且将图片存放在UPLOAD下面
  52. //动态的创建UPLOAD目录
  53.            java.io.File picStoreDir=new java.io.File(sStyleNameAdd);
  54.    //do java.io.File.mkdirs()
  55. picStoreDir.mkdirs();
  56. //output sStyleNameAdd path
  57. //out.println(sStyleNameAdd);
  58. //此处设置上传文件保存路径,注意路径要由ROOT开始=========================
  59. //sStyleUploadDir =sUploadFilePath+calendar.get(Calendar.YEAR) + 
  60. //"/"+ (calendar.get(Calendar.MONTH)+1) +"/"+ calendar.get(Calendar.DAY_OF_MONTH)+"/";
  61. sStyleUploadDir =sUploadFilePath+"/";
  62. //sStyleUploadDir = bean.getSStyleUploadDir();
  63. //<add core end>
  64. sInitMode = bean.getSInitMode();
  65. sDetectFromWord = bean.getSDetectFromWord();
  66. sBaseUrl = bean.getSBaseUrl();
  67. sAutoRemote = bean.getSAutoRemote();
  68. sToolBar = bean.getSToolBar();
  69. nStateFlag = bean.getNStateFlag();
  70. //设置颜色样式
  71. sStyleCSS = request.getParameter("color");
  72.                 if (sStyleCSS == null)
  73.                  sStyleCSS = "CoolBlue";
  74.                 else
  75.                 sStyleCSS = request.getParameter("color").trim();
  76.                 //设置全屏幕选项
  77.                 sFullScreen = request.getParameter("fullscreen");
  78.                 if (sFullScreen == null)
  79.                  sFullScreen = "0";
  80.                 else
  81.                 sFullScreen = request.getParameter("fullscreen").trim();
  82.                 //设置内容选项
  83.                 sContentID = request.getParameter("id");
  84.                 if (sContentID == null)
  85.                  sContentID = "content1";
  86.                 else
  87.                 sContentID = request.getParameter("id").trim();
  88.                 //设置样式
  89.                 sStyleName = request.getParameter("style");
  90.                 if (sStyleName == null)
  91.                  sStyleName = "standard";
  92.                 else
  93.                 sStyleName = request.getParameter("style").trim();
  94.  %>
  95. <html>
  96. <head>
  97. <title>eWebEditor - eWebSoft在线文本编辑器</title>
  98. <meta http-equiv="Content-Type" content="text/html; charset=GBK">
  99. <link href="css/<%=sStyleCSS%>/Editor.css" type="text/css" rel="stylesheet">
  100. <Script Language=Javascript>
  101. var sPath = document.location.pathname;
  102. sPath = sPath.substr(0, sPath.length-14);
  103. var sLinkFieldName = "<%=sContentID%>" ;
  104. // 全局设置对象
  105. var config = new Object() ;
  106. config.Version = "<%=sVersion%>" ;
  107. config.ReleaseDate = "<%=sReleaseDate%>" ;
  108. config.StyleName = "<%=sStyleName%>";
  109. config.StyleEditorHeader = "<head><link href=""+sPath+"css/<%=sStyleCSS%>/EditorArea.css" type="text/css" rel="stylesheet"></head><body MONOSPACE>" ;
  110. config.StyleMenuHeader = "<head><link href=""+sPath+"css/<%=sStyleCSS%>/MenuArea.css" type="text/css" rel="stylesheet"></head><body scroll="no" onConTextMenu="event.returnValue=false;">";
  111. config.StyleDir = "<%=sStyleDir%>";
  112. config.StyleUploadDir = "<%=sStyleUploadDir%>";
  113. config.InitMode = "<%=sInitMode%>";
  114. config.AutoDetectPasteFromWord = <%=sDetectFromWord%>;
  115. config.BaseUrl = <%=sBaseUrl%>;
  116. config.AutoRemote = <%=sAutoRemote%>;
  117. </Script>
  118. <Script Language=Javascript src="include/editor.js"></Script>
  119. <Script Language=Javascript src="include/table.js"></Script>
  120. <Script Language=Javascript src="include/menu.js"></Script>
  121. <script language="javascript" event="onerror(msg, url, line)" for="window">
  122. //return true ;  // 隐藏错误
  123. </script>
  124. </head>
  125. <body SCROLLING=no onConTextMenu="event.returnValue=false;" onfocus="VerifyFocus()">
  126. <table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%'>
  127. <tr><td>
  128. <%=sToolBar%>
  129. </td></tr>
  130. <tr><td height='100%'>
  131. <table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%'>
  132. <tr><td height='100%'>
  133. <input type="hidden" ID="ContentEdit" value="">
  134. <input type="hidden" ID="ContentLoad" value="">
  135. <input type="hidden" ID="ContentFlag" value="0">
  136. <iframe class="Composition" ID="eWebEditor" MARGINHEIGHT="1" MARGINWIDTH="1" width="100%" height="100%" scrolling="yes">
  137. </iframe>
  138. </td></tr>
  139. </table>
  140. </td></tr>
  141. <% if(nStateFlag.equals("1")){ %>
  142. <tr><td height=25>
  143. <TABLE border="0" cellPadding="0" cellSpacing="0" width="100%" class=StatusBar height=25>
  144. <TR valign=middle>
  145. <td>
  146. <table border=0 cellpadding=0 cellspacing=0 height=20>
  147. <tr>
  148. <td width=10></td>
  149. <td class=StatusBarBtnOff id=eWebEditor_CODE onclick="setMode('CODE')"><img border=0 src="buttonimage/<%=sStyleDir%>/modecode.gif" width=50 height=15 align=absmiddle></td>
  150. <td width=5></td>
  151. <td class=StatusBarBtnOff id=eWebEditor_EDIT onclick="setMode('EDIT')"><img border=0 src="buttonimage/<%=sStyleDir%>/modeedit.gif" width=50 height=15 align=absmiddle></td>
  152. <td width=5></td>
  153. <td class=StatusBarBtnOff id=eWebEditor_VIEW onclick="setMode('VIEW')"><img border=0 src="buttonimage/<%=sStyleDir%>/modepreview.gif" width=50 height=15 align=absmiddle></td>
  154. </tr>
  155. </table>
  156. </td>
  157. <td align=right>
  158. <table border=0 cellpadding=0 cellspacing=0 height=20>
  159. <tr>
  160. <td style="cursor:pointer;" onclick="sizeChange(300)"><img border=0 SRC="buttonimage/<%=sStyleDir%>/sizeplus.gif" width=20 height=20 alt="增高编辑区"></td>
  161. <td width=5></td>
  162. <td style="cursor:pointer;" onclick="sizeChange(-300)"><img border=0 SRC="buttonimage/<%=sStyleDir%>/sizeminus.gif" width=20 height=20 alt="减小编辑区"></td>
  163. <td width=40></td>
  164. </tr>
  165. </table>
  166. </td>
  167. </TR>
  168. </Table>
  169. </td></tr>
  170. <% } %>
  171. </table>
  172. <div id="eWebEditor_Temp_HTML" style="VISIBILITY: hidden; OVERFLOW: hidden; POSITION: absolute; WIDTH: 1px; HEIGHT: 1px"></div>
  173. <form id="eWebEditor_UploadForm" action="upload.jsp?action=remote&type=remote&style=<%=sStyleName%>" method="post" target="eWebEditor_UploadTarget">
  174. <input type="hidden" name="eWebEditor_UploadText">
  175. </form>
  176. <iframe name="eWebEditor_UploadTarget" width=0 height=0></iframe>
  177. <div id=divProcessing style="width:200px;height:30px;position:absolute;display:none">
  178. <table border=0 cellpadding=0 cellspacing=1 bgcolor="#000000" width="100%" height="100%"><tr><td bgcolor=#3A6EA5><marquee align="middle" behavior="alternate" scrollamount="5" style="font-size:9pt"><font color=#FFFFFF>...远程文件收集中...请等待...</font></marquee></td></tr></table>
  179. </div>
  180. </body>
  181. </html>