📄 admin_page.asp
字号:
<Select Name="ItemID" <%if Action = "ModifyPage" then%>Disabled<%End if%>>
<option value='0'>请选择项目</option><%
Set Rs=Cl.Execute("Select ItemID,ItemName From Cl_PageItem order by ItemID desc")
Do while Not Rs.Eof
if ItemID=rs(0) then
Response.write "<option value='"&rs(0)&"' selected>"&rs(1)&"</option>"
else
Response.write "<option value='"&rs(0)&"'>"&rs(1)&"</option>"
end if
Rs.MoveNext
Loop
Rs.Close : Set Rs=Nothing
%></Select> <font color="red">*</font></td>
</tr>
<tr class="tdbg">
<td width="150" align="right"><strong>页面名称:</strong></td>
<td><input name="PageName" type="text" id="PageName" value="<%=PageName%>" size="60" maxlength="200"> <font color="red">*</font></td>
</tr>
<tr class="tdbg">
<td width="150" align="right"><strong>生成文件:</strong></td>
<td><input name="FileName" type="text" id="FileName" size="30" maxlength="200" value="<%=FileName%>">.<input name="FileExt" type="text" id="FileExt" size="8" maxlength="10" value="<%=FileExt%>"> <font color="red">*</font> <font color="#888888">注意,扩展名不能为ASP或其它可执行文件的扩展名。</font></td>
</tr>
<tr class="tdbg">
<td width="150" align="right"><strong>项目说明:</strong></td>
<td><textarea name="PageIntro" cols="50" rows="5" id="PageIntro"><%=PageIntro%></textarea></td>
</tr>
<tr class="title">
<td height="22" colspan="2"><strong>页 面 内 容</strong></td>
</tr>
<tr class="tdbg">
<td align="center" colspan="2"><font color="#888888">页面内容可调用所属项目的模板头部"{$showhead}"和尾部"{$showfooter}"及支持所有标签。</font><br /><textarea name="Content" rows="15" style="width:100%" id="Content" onMouseUp="setContent('get');"><%=Server.HtmlEnCode(Content)%></textarea></td>
</tr>
<tr style="display:none">
<td align="center" colspan="2"><textarea id="ContentTemp" name="ContentTemp" style="display:none"><%=Server.HtmlEnCode(Content)%></textarea></td>
</tr>
<tr><td align="center" colspan="2">
<iframe ID="editor" src="../Editor/Editor.asp?id=ContentTemp&style=Template&cid=0&CssID=0" frameborder="0" scrolling="no" width="100%" height="0"></iframe>
</td></tr>
<tr class="tdbg">
<td colspan="2" align="center">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="22" width="30%"><Input id="isshowcode" name="isshowcode" type="Checkbox" value="1" onclick="showcode()" checked><span id="showc">关闭代码</span> <Input id="isshowedit" name="isshowedit" type="Checkbox" value="1" onclick="showedit()"><span id="showe">可视编辑</span></td>
<td height="22" align="center" width="40%">
<input name="Action" type="hidden" id="Action" value="<%=sAction%>">
<input name="PageID" type="hidden" id="PageID" value="<%=PageID%>">
<input type="button" name="editbutton" value=" [<%=SubmitValue%>] " onClick="SaveContent();selfedit()">
<input name="Cancel" type="button" id="Cancel" value=" [取 消] " onClick="window.location.href='Admin_Page.asp'" style="cursor:hand;">
</td>
<td height="22" align="right" width="30%"><a href="javascript:sizeChange('-')"><img src="images/minus.gif" unselectable="on" border="0"></a> <a href="javascript:sizeChange('+')"><img src="images/plus.gif" unselectable="on" border="0"></a> </td>
</tr></table>
</td>
</tr>
</table>
</form>
<script language="JavaScript" type="text/javascript">
<!--
function selfedit(){
if (editor.ModeEdit.value!='EDIT'){
alert('请先转到编辑模式!');
return false;
}
if (document.FormEdit.PageName.value == "") {
alert("请输入项目名称!");
document.FormEdit.PageName.focus();
return false;
}
if (document.FormEdit.FileName.value == "") {
alert("生成文件名不能为空,请输入带扩展名的文件名!");
document.FormEdit.FileName.focus();
return false;
}
document.FormEdit.submit();
}
function showcode(){
if (document.getElementById('isshowcode').checked == true) {
document.FormEdit.Content.style.display='';
document.getElementById('showc').innerText='关闭代码';
}else{
document.FormEdit.Content.style.display='none';
document.getElementById('showc').innerText='显示代码';
document.getElementById('isshowedit').checked = true;
document.getElementById('editor').style.height=520;
document.getElementById('showe').innerText='关闭编辑';
}
}
function showedit(){
if (document.getElementById('isshowedit').checked == true) {
document.getElementById('editor').style.height=520;
document.getElementById('showe').innerText='关闭编辑';
}else{
document.getElementById('editor').style.height=0;
document.getElementById('showe').innerText='可视编辑';
document.getElementById('isshowcode').checked = true;
document.FormEdit.Content.style.display='';
document.getElementById('showc').innerText='关闭代码';
}
}
function sizeChange(st){
if (document.getElementById('isshowedit').checked == true) {
var obj=document.getElementById('editor');
var sh=parseInt(obj.style.height);
if (st=="+"){
obj.style.height=sh+100;
}
else if (sh>200) {
obj.style.height=sh-100;
}
}else if (document.getElementById('isshowcode').checked == true){
var obj=document.FormEdit.Content
var sc=parseInt(obj.rows);
if (st=="+"){
obj.rows=sc+10;
}
else if (sc>15) {
obj.rows=sc-10;
}
}
}
//-->
</script>
<script language="VBScript" type="text/vbscript">
Dim regEx, Match, Matches, StrBody,strTemp,strTemp2,strMatch,arrMatch,i
Dim Content1,Content2,TemplateContent,TemplateContent2,arrContent
Function setContent(sType)
Set regEx = New RegExp
regEx.IgnoreCase = True
regEx.Global = True
if sType="set" then
TemplateContent = document.FormEdit.Content.value
TemplateContent2 = editor.Editor.document.body.innerHTML
if TemplateContent2="" then Exit function
regEx.Pattern = "\<IMG(.[^\<]*)\$\>"
Set Matches = regEx.Execute(TemplateContent2)
For Each Match In Matches
regEx.Pattern = "\#(.*)\#"
Set strTemp = regEx.Execute(Match.Value)
For Each Match2 In strTemp
strTemp2 = Replace(Match2.Value, "&", "&")
strTemp2 = Replace(strTemp2, "#", "")
'strTemp2 = Replace(strTemp2, "$}", "}")
strTemp2 = Replace(strTemp2,"&13;&10;",vbCrLf)
strTemp2 = Replace(strTemp2,"&9;",vbTab)
strTemp2 = Replace(strTemp2, "[!", "<")
strTemp2 = Replace(strTemp2, "!]", ">")
TemplateContent2=Replace(TemplateContent2, Match.Value, strTemp2)
Next
Next
TemplateContent2=Replace(TemplateContent2, "$}", "}")
'TemplateContent2=Replace(TemplateContent2,"<%'=sInsTallDir & Cl.CssPicUrl%>","{$picurl}")
TemplateContent2=Replace(TemplateContent2, "<%=sInsTallDir%>","{$webdir}")
TemplateContent2=Replace(TemplateContent2,"[$uploaddir$]","{$uploaddir}")
TemplateContent2=Replace(TemplateContent2,"[$channelid$]","{$channelid}")
TemplateContent2=Replace(TemplateContent2,"[$classid$]","{$classid}")
TemplateContent2=Replace(TemplateContent2,"{$webdir}Editor/","")
TemplateContent2=Resumeblank(TemplateContent2)
if TemplateContent="" then document.FormEdit.Content.value=TemplateContent2 : Exit Function
if Instr(TemplateContent,"<body>")=0 then
regEx.Pattern = "(\<body)(.[^\<]*)(\>)"
Set Matches = regEx.Execute(TemplateContent)
For Each Match In Matches
StrBody = Match.Value
Next
If StrBody = "" Then
document.FormEdit.Content.value=TemplateContent2
Exit Function
else
arrContent = Split(TemplateContent, StrBody)
Content1 = arrContent(0) & StrBody
Content2 = arrContent(1)
End If
Else
arrContent = Split(TemplateContent, "<body>")
Content1 = arrContent(0) & "<body>"
Content2 = arrContent(1)
End if
document.FormEdit.Content.value=Content1& vbCrLf &TemplateContent2 & Vbcrlf & "</body>" & Vbcrlf & "</html>"
Else
TemplateContent= document.FormEdit.Content.value
if TemplateContent="" then Exit function
if Instr(TemplateContent,"<body>")=0 then
StrBody = ""
regEx.Pattern = "(\<body)(.[^\<]*)(\>)"
Set Matches = regEx.Execute(TemplateContent)
For Each Match In Matches
StrBody = Match.Value
Next
If StrBody = "" Then
Content1 = ""
Content2 = TemplateContent
else
arrContent = Split(TemplateContent, StrBody)
Content1 = arrContent(0) & StrBody
Content2 = arrContent(1)
End If
Else
arrContent = Split(TemplateContent, "<body>")
Content1 = arrContent(0) & "<body>"
Content2 = arrContent(1)
End if
Content2 = Replace(Content2,"{$webdir}","<%=sInsTallDir%>")
Content2 = Replace(Content2,"{$uploaddir}","[$uploaddir$]")
'Content2 = Replace(Content2,"{$picurl}","<%'=sInsTallDir & Cl.CssPicUrl%>")
Content2 = Replace(Content2,"{$channelid}","[$channelid$]")
Content2 = Replace(Content2,"{$classid}","[$classid$]")
'图片替换JS
regEx.Pattern = "(\<" & "Script)(.[^\<]*)(\<\/Script\>)"
Set Matches = regEx.Execute(Content2)
For Each Match In Matches
strTemp = Replace(Match.Value, "<", "[!")
strTemp = Replace(strTemp, ">", "!]")
strTemp = Replace(strTemp, "'", """")
strTemp = "<IMG alt='#" & strTemp & "#' src=""<%=Cl.WebDir%>Editor/Images/Template/Js.gif"" border=0 $>"
Content2 = Replace(Content2, Match.Value, strTemp)
Next
'图片替换超级标签
regEx.Pattern = "(\{\$ShowArticle|\{\$ShowSoft|\{\$ShowPhoto|\{\$ShowMovie|\{\$ShowProduct|\{\$ShowPicArticle|\{\$ShowPicSoft|\{\$ShowPicPhoto|\{\$ShowPicMovie|\{\$ShowPicProduct)\((.[^(\{\$)]*)\)\}"
Content2 = regEx.Replace(Content2, "<IMG alt='#$1($2)}#' src=""<%=Cl.WebDir%>Editor/Images/Template/Label.gif"" border=0 $>")
'图片替换其它标签(带参数的)
'regEx.Pattern = "(\{\$([^{$}])*)}"
regEx.Pattern = "(\{$)(.[^\{]*)(\})"
Set Matches = regEx.Execute(Content2)
For Each Match In Matches
if Instr(Match.Value,"(")>0 and Instr(Match.Value,")")>0 then
strTemp = Replace(Match.Value, "<", "[!")
strTemp = Replace(strTemp, ">", "!]")
strTemp = "<IMG alt='#" & Match.Value & "#' src=""<%=Cl.WebDir%>Editor/Images/Template/Label2.gif"" border=0 $>"
Content2 = Replace(Content2, Match.Value, strTemp)
end if
Next
editor.Editor.document.body.innerHTML=Content2
editor.showBorders()
End if
End function
Function SaveContent()
Dim TContent
Content = document.FormEdit.Content.value
if Content="" then Exit function
if Instr(Content,"<!--clhead-->")>0 and Instr(Content,"<!--clheadend-->")>0 then
TContent=Split(Content,"<!--clheadend-->")
if Ubound(TContent) > 0 then
Content="{$showhead}" & TContent(1)
end if
end if
if Instr(Content,"<!--clfooter-->")>0 and Instr(Content,"<!--clfooterend-->")>0 then
TContent=Split(Content,"<!--clfooter-->")
if Ubound(TContent) > 0 then
Content=TContent(0) & "{$showfooter}"
end if
'elseif Instr(Content,"{$showfooter}")=0 and (Instr(Content,"{$showhead}")>0 or Instr(Lcase(Content),"<html>")>0) then
' Content=Replace(Content,"</body>","")
' Content=Replace(Content,"</html>","")
' Content=Content & Vbcrlf & "</body>" & Vbcrlf & "</html>"
end if
Content=Replace(Content,"<!--/body-->","</body>")
Content=Replace(Content,"<!--/html-->","</html>")
document.FormEdit.Content.value=Content
End Function
Function Resumeblank(byval Content)
Dim strHtml,strHtml2,Num,Numtemp,Strtemp
Dim regEx,Match,Matches,TempValue
Set regEx = New RegExp
regEx.IgnoreCase = True
regEx.Global = True
regEx.Pattern = "<(\/?a|br|img|\/?font|\/?strong|\/?div|\/?ul|\/li|\/?table|\/?tbody|\/?tr|\/?th|\/?td|\/?select|\/?option|input|\/?script|\/?form|\/?textarea)"
strHtml=Content
Set Matches = regEx.Execute(strHtml)
For Each Match in Matches
strHtml = Replace(strHtml,Match.Value,LCase(Match.Value))
Next
Set regEx = nothing
strHtml=Replace(strHtml, "&","&")
arrContent = Split(strHtml,vbCrLf)
For i = 0 To UBound(arrContent)
Numtemp=false
if Instr(arrContent(i),"<table")>0 then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -