📄 edit.asp
字号:
<!--#include file = "Startup.asp"-->
<%
' 初始输入参数
Dim sContentID, sStyleID, sFullScreen, sInstallDir,sEditButton
Dim sStyleName, sStyleUploadDir, nStateFlag, sDetectFromWord, sInitMode, sBaseUrl, sAutoRemote, sShowBorder,sInitTool
Dim C_BottonStyle,E_BottonStyle,T_BottonStyle,V_BottonStyle
Dim sToolBar
' 初始化
Call Init()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Editor.css" type="text/css" rel="stylesheet">
<Script Language=Javascript>
var sPath = document.location.pathname;
sPath = sPath.substr(0, sPath.length-8);
var sLinkFieldName = "<%=sContentID%>" ;
var sLinkOriginalFileName = "<%=Request.QueryString("originalfilename")%>" ;
var sLinkSaveFileName = "<%=Request.QueryString("savefilename")%>" ;
var sLinkSavePathFileName = "<%=Request.QueryString("savepathfilename")%>" ;
// 全局设置对象
var config = new Object() ;
config.sInstallDir = "<%=sInstallDir%>";
config.Version = "" ;
config.ReleaseDate = "" ;
config.License = "" ;
config.StyleName = "<%=sStyleName%>";
config.StyleMenuHeader = "<head><link href=\""+sPath+"MenuArea.css\" type=\"text/css\" rel=\"stylesheet\"></head><body scroll=\"no\" onConTextMenu=\"event.returnValue=false;\">";
config.StyleUploadDir = "<%=sStyleUploadDir%>";
config.InitMode = "<%=sInitMode%>";
config.InitTool = "<%=sInitTool%>";
config.AutoDetectPasteFromWord = <%=sDetectFromWord%>;
config.BaseUrl = 1;
config.BaseHref = "";
config.AutoRemote = "<%=sAutoRemote%>";
config.ShowBorder = "<%=sShowBorder%>";
var sBaseHref = "";
if(config.BaseHref!=""){
sBaseHref = "<base href=\"" + document.location.protocol + "//" + document.location.host + config.BaseHref + "\">";
}
config.StyleEditorHeader = "<head><link href=\"" + sPath + "EditorArea.css\" type=\"text/css\" rel=\"stylesheet\">" + sBaseHref + "</head><body MONOSPACE>" ;
</Script>
<Script Language=Javascript src="Edit.js"></Script>
<script language="javascript" event="onerror(msg, url, line)" for="window">
return true ; // 隐藏错误
</script>
</head>
<body SCROLLING=no onConTextMenu="event.returnValue=false;">
<table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%' align="center">
<tr>
<td><%=sToolBar%></td>
</tr>
<tr>
<td height='100%'> <table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%'>
<tr>
<td height='100%'> <input type="hidden" ID="ContentEdit" value=""> <input type="hidden" ID="ModeEdit" value="">
<input type="hidden" ID="ContentLoad" value=""> <input type="hidden" ID="ContentFlag" value="0">
<iframe class="Composition" ID="HtmlEdit" MARGINHEIGHT="1" MARGINWIDTH="1" width="100%" height="100%" scrolling="yes"></iframe>
</td>
</tr>
</table></td>
</tr>
<% If nStateFlag = 1 Then %>
<%If Ucase(sEditButton) <> "NO" Then %>
<tr>
<td height=25> <TABLE border="0" cellPadding="0" cellSpacing="0" width="100%" class=StatusBar height=25>
<TR valign=middle>
<td> <table border=0 cellpadding=0 cellspacing=0 height=20>
<tr>
<td width=10></td>
<td class=StatusBarBtnOff id=HtmlEdit_CODE<%=C_BottonStyle%>><img border=0 src="../../Images/Button/modecode.gif" width=50 height=16 align=absmiddle></td>
<td width=5></td>
<td class=StatusBarBtnOff id=HtmlEdit_EDIT<%=E_BottonStyle%>><img border=0 src="../../Images/Button/modeedit.gif" width=50 height=16 align=absmiddle></td>
<td width=5></td>
<td class=StatusBarBtnOff id=HtmlEdit_TEXT<%=T_BottonStyle%>><img border=0 src="../../Images/Button/modetext.gif" width=50 height=16 align=absmiddle></td>
<td width=5></td>
<td class=StatusBarBtnOff id=HtmlEdit_VIEW<%=V_BottonStyle%>><img border=0 src="../../Images/Button/modepreview.gif" width=50 height=16 align=absmiddle></td>
</tr>
</table></td>
<td align=center style="font-size:9pt"></td>
<td align=right>
<%if request("action")<>"yes" then%>
<table border=0 cellpadding=0 cellspacing=0 height=20>
<tr>
<%If sFullScreen > 0 Then%>
<td style="cursor:pointer;" onclick="parent.Minimize()"><img border=0 SRC="../../Images/Button/Minimize.gif" width=20 height=20 alt="全屏返回"></td>
<%Else%>
<td style="cursor:pointer;" onclick="Maximize()"><img border=0 SRC="../../Images/Button/maximize.gif" width=20 height=20 alt="全屏修改"></td>
<%End If%>
<td width=5></td>
<td style="cursor:pointer;" onclick="sizeChange(300)"><img border=0 SRC="../../Images/Button/sizeplus.gif" width=20 height=20 alt="增高修改区"></td>
<td width=5></td>
<td style="cursor:pointer;" onclick="sizeChange(-300)"><img border=0 SRC="../../Images/Button/sizeminus.gif" width=20 height=20 alt="减小修改区"></td>
<td width=*></td>
</tr>
</table>
<%end if%>
</td>
</TR>
</Table></td>
</tr>
<% End If %>
<% End If %>
</table>
<div id="HtmlEdit_Temp_Html" style="VISIBILITY: hidden; OVERFLOW: hidden; POSITION: absolute; WIDTH: 1px; HEIGHT: 1px"></div>
</body>
</html>
<%
Sub Init()
'取网站安装路经
sInstallDir = WR_Setting(3)
'是否要编辑等按钮
sEditButton = Trim(Request.QueryString("EditButton"))
' 取全屏标志
sFullScreen = Trim(Request.QueryString("fullscreen"))
If sFullScreen = "" Then sFullScreen = 0
'获取得工具栏
sInitTool = Ucase(Trim(Request.QueryString("Tool")))
'If sInitTool="" Then ShowErr "请传入调用工具栏内容!"
sInitMode="EDIT"
C_BottonStyle = " onclick=setMode('CODE')"
E_BottonStyle = " onclick=setMode('EDIT')"
T_BottonStyle = " onclick=setMode('TEXT')"
V_BottonStyle = " onclick=setMode('VIEW')"
'初始模式 代码模式|修改模式|文本模式|预览模式 CODE|EDIT|TEXT|VIEW
sInitMode = Trim(Request.QueryString("sMode"))
If sInitMode="" Then sInitMode="EDIT"
' 取对应的内容ID
sContentID = Trim(Request.QueryString("ID"))
' 取样式初始值
sStyleName = "TradeSkin"
Dim s_SelfUrl, s_ApplicationName, n_Application, i
s_SelfUrl = UCase(Request.ServerVariables("SERVER_NAME") & ":" & Request.ServerVariables("SERVER_PORT") & Request.ServerVariables("SCRIPT_NAME") & "?sMode=" & sInitMode)
n_Application = 0
Dim aApplicationName, aApplicationUrl, aApplicationValue
aApplicationName = WRMPS.GetCache("EditName")
aApplicationUrl = WRMPS.GetCache("EditUrl")
If IsArray(aApplicationName) = True Then
n_Application = UBound(aApplicationName)
' 是否在内存中
For i = 1 To n_Application
If aApplicationUrl(i) = s_SelfUrl Then
s_ApplicationName = aApplicationName(i)
aApplicationValue = WRMPS.GetCache(s_ApplicationName)
sStyleID = aApplicationValue(0)
sStyleUploadDir = aApplicationValue(1)
nStateFlag = aApplicationValue(2)
sDetectFromWord = aApplicationValue(3)
sBaseUrl = aApplicationValue(4)
sAutoRemote = aApplicationValue(5)
sShowBorder = aApplicationValue(6)
sToolBar = aApplicationValue(7)
End If
Next
End If
' 判断不同用途时初始化工具栏
If WRMPS.GetCache("EditTool") = "" Or WRMPS.GetCache("EditTool") <> sInitTool Then
Call WRMPS.SCache("EditTool",sInitTool)
sToolBar = ""
ElseIf WRMPS.GetCache("EditTool") = sInitTool Then
If sToolBar <> "" Then Exit Sub
End If
' 取样式下的工具栏及按钮
Call InitToolBar(sInitTool)
sToolBar = sToolBarNormal
sStyleID = 1
sStyleName = "WRMPS"
sStyleUploadDir = "../../"
nStateFlag = 1
sAutoRemote = 0 '远程图片不自动上传
sShowBorder = CStr(0)
sDetectFromWord = "true"
sBaseUrl = 1
n_Application = n_Application + 1
If n_Application = 1 Then
Redim aApplicationName(1)
Redim aApplicationUrl(1)
Else
Redim Preserve aApplicationName(n_Application)
Redim Preserve aApplicationUrl(n_Application)
End If
Redim aApplicationValue(7)
s_ApplicationName = "EditHtml" & n_Application
aApplicationName(n_Application) = s_ApplicationName
aApplicationUrl(n_Application) = s_SelfUrl
aApplicationValue(0) = sStyleID
aApplicationValue(1) = sStyleUploadDir
aApplicationValue(2) = nStateFlag
aApplicationValue(3) = sDetectFromWord
aApplicationValue(4) = sBaseUrl
aApplicationValue(5) = sAutoRemote
aApplicationValue(6) = sShowBorder
aApplicationValue(7) = sToolBar
Application.Lock
Call WRMPS.SCache("EditName",aApplicationName)
Call WRMPS.SCache("EditUrl",aApplicationUrl)
Call WRMPS.SCache(s_ApplicationName,aApplicationValue)
Application.Unlock
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -