⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmdtemplate.jsp

📁 eNews新闻发布系统 JSP+Struts+JSTL+EL+mysql
💻 JSP
📖 第 1 页 / 共 2 页
字号:
            Strtemp="<td"
        elseif Instr(arrcontent(i),"</table>")>0 then
            Numtemp=True
            if Strtemp<>"</table>" and Strtemp<>"<table" then
              Num=Num-2
            End if 
            Strtemp="</table>"
        elseif Instr(arrcontent(i),"</tr>")>0 then
            Numtemp=True
            if Strtemp<>"</tr>" and Strtemp<>"<tr" then
              Num=Num-2
            End if 
            Strtemp="</tr>"
        elseif Instr(arrcontent(i),"</td>")>0 then
            Numtemp=True
            if Strtemp<>"</td>" and Strtemp<>"<td" then
              Num=Num-2
            End if 
            Strtemp="</td>"
        elseif Instr(arrcontent(i),"<!--")>0 then
            Numtemp=True
        End if
        if Num< 0 then Num = 0
        if trim(arrcontent(i))<>"" then
            if i=0 then
                strHtml2= string(Num," ") & arrcontent(i) 
            elseif Numtemp=True then
                strHtml2= strHtml2 & vbCrLf & string(Num," ") & arrcontent(i) 
            else
                strHtml2= strHtml2 & vbCrLf & arrcontent(i) 
            end if
        end if
    Next
 Resumeblank=strHtml2
End function
    function setcontent(zhi,templateType)
    if zhi="get" then
        if templateType=1 then
            if Strsave="A" then Exit Function
            Strsave="A"
            Templatecontent= document.form1.content.value
            Templatecontent2= editor.HtmlEdit.document.body.innerHTML
        else
            if Strsave2="A" then Exit Function
            Strsave2="A"
            Templatecontent= document.form1.content2.value
            Templatecontent2= editor2.HtmlEdit.document.body.innerHTML
        End if
        if Templatecontent="" then 
            alert "您删除了代码框网页,请您务必填写网页 !"
            Exit function
        End if
        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
                alert "您加载的文本框没有包含 <body> 或您没有给body 参数这会使网页很难看,请最少给出 <body> !"
                Exit function
            End If 
        Else
            StrBody="<body>" 
        End if
        arrcontent = Split(Templatecontent, StrBody)
        if ubound(arrcontent)=0 then 
           alert "您加载的文本框没有包含 <body> 或您没有给body 参数这会使网页很难看,请最少给出 <body> !"
           exit function
        End if
        content1 = arrcontent(0) & StrBody
        content2 = arrcontent(1)
        regEx.Pattern = "\<IMG(.[^\<]*)\}\'\>"
        Set Matches = regEx.Execute(Templatecontent2)
        For Each Match In Matches
            regEx.Pattern = "\{\$(.*)\}"
            Set strTemp = regEx.Execute(replace(Match.Value," ",""))
            For Each Match2 In strTemp
                strTemp2 = Replace(Match2.Value, "?", """")
                Templatecontent2 = Replace(Templatecontent2, Match.Value, "<!--" & strTemp2 & "-->")
            Next
        Next
        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, "&amp;", "&")
                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, "http://www.v246.com/","{$InstallDir}")
        Templatecontent2=Replace(Templatecontent2, "http://www.v246.com/","{$InstallDir}")
        Templatecontent2=Resumeblank(Templatecontent2)
        Templatecontent2=Replace(Templatecontent2,"{$InstallDir}{$rsClass_ClassUrl}","{$rsClass_ClassUrl}")
        Templatecontent2=Replace(Templatecontent2,"{$InstallDir}$","#")
        if templateType =1 then
            document.form1.content.value=content1& vbCrLf &Templatecontent2& vbCrLf &"</body>"& vbCrLf &"</html>"
        else
            document.form1.content2.value=content1 & vbCrLf &Templatecontent2& vbCrLf &"</body>"& vbCrLf &"</html>"
        End if
    Else
        if templateType =1 then    
            if Strsave="B" then Exit Function
            Strsave="B"
            Templatecontent= document.form1.content.value
        else 
            if Strsave2="B" then Exit Function
            Strsave2="B"
            Templatecontent= document.form1.content2.value
        End if    
        if Templatecontent="" then 
            alert "您删除了代码框网页,请您务必填写网页 !"
            Exit function
           
        End if
        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
                alert "您加载的文本框没有包含 <body> 或您没有给body 参数这会使网页很难看,请最少给出 <body> !"
                Exit function
            End If 
        Else
            StrBody="<body>" 
        End if
        arrcontent = Split(Templatecontent, StrBody)
        if ubound(arrcontent)=0 then 
           alert "您加载的文本框没有包含 <body> 或您没有给body 参数这会使网页很难看,请最少给出 <body> !"
           exit function
        End if
        content1 = arrcontent(0) & StrBody
        content2 = arrcontent(1)
        content2 = Replace(content2, "<!--$", "{$--")
        content2 = Replace(content2, "$-->", "--}")
        content2 = Replace(content2, "<!--{$", "{$")
        content2 = Replace(content2, "}-->", "}")
        '图片替换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=""/editor/images/jscript.gif"" border=0 $>"
            content2 = Replace(content2, Match.Value, strTemp)
        Next
        '图片替换超级标签
        regEx.Pattern = "(\{\$GetPicArticle|\{\$GetArticleList|\{\$GetSlidePicArticle|\{\$GetPicSoft|\{\$GetSoftList|\{\$GetSlidePicSoft|\{\$GetPicPhoto|\{\$GetPhotoList|\{\$GetSlidePicPhoto|\{\$GetPicProduct|\{\$GetProductList|\{\$GetSlidePicProduct)\((.[^(\{\$)]*)\)\}"
        content2 = regEx.Replace(content2, "<IMG src=""/editor/images/label.gif"" border=0 zzz='""$1($2)}'>")
        regEx.Pattern = "\{\$InstallDir\}"
        content2 = regEx.Replace(content2,"http://www.v246.com/")
        regEx.Pattern = "\[\/textarea\]"
        content2 = regEx.Replace(content2,"</textarea>")
        content2=Replace(content2,"href=""#""","href=""$""")
        content2=Replace(content2,"href='#'","href=""$""")
        if templateType=1 then
            editor.HtmlEdit.document.body.innerHTML=content2
            editor.showBorders()
            editor.showBorders()
        else
            editor2.HtmlEdit.document.body.innerHTML=content2
            editor2.showBorders()
            editor2.showBorders()
        End if
    End if
    End function
    function setstatus()
    end function
</script>
<form name="form1" method="post" action="./addTemplate.do">
  <table class="border" border="0" cellpadding="2" cellspacing="1" width="100%">
    <tbody>
      <tr class="title"> 
        <td colspan="2" align="center" height="22"><strong>添 加 新 模 板</strong></td>
      </tr>
      <tr class="tdbg"> 
        <td>&nbsp;&nbsp;<strong> 模板类型: </strong> 
        	<select name="templateType" id="templateType">
       
            <option value="${modify[1]}">${modify[0]}</option> 
          </select></td>
      </tr>
      <tr class="tdbg"> 
        <td>&nbsp;&nbsp;<strong> 模板名称: </strong> <input name="templateName" id="templateName" value="${modify[2]}" size="50" maxlength="50" type="text"></td>
      </tr>
      <tr class="tdbg"> 
        <td align="center" valign="top"><b> 模 板 内 容 ↓</b> </td>
      </tr>
      <tr class="tdbg" id="showAlgebra"> 
        <td> <table>
            <tbody>
              <tr> 
                <td width="20"></td>
                <td><textarea name="content" rows="30" cols="128" wrap="OFF" id="content" class="body2" onmouseup="setcontent('get',1)">${modify[3]}</textarea></td>
              </tr>
            </tbody>
          </table></td>
      </tr>
      <tr class="tdbg"> 
        <td><table>
            <tbody>
              <tr> 
                <td width="95%">&nbsp;&nbsp;&nbsp;&nbsp; <input name="EditorAlgebra" disabled="disabled" id="EditorAlgebra" value=" 代码模式 " onclick="LoadEditorAlgebra(1);" onmouseover="this.style.backgroundColor='#BFDFFF'" onmouseout="this.style.backgroundColor=''" type="button"> 
                  &nbsp; <input name="EditorMix" id="EditorMix" value=" 混合模式 " disabled="disabled" onclick="LoadEditorMix(1);" onmouseover="this.style.backgroundColor='#BFDFFF'" onmouseout="this.style.backgroundColor=''" type="button"> 
                  &nbsp; <input name="EditorEdit" id="EditorEdit" value=" 编辑模式 " disabled="disabled" onclick="LoadEditorEdit(1);" onmouseover="this.style.backgroundColor='#BFDFFF'" onmouseout="this.style.backgroundColor=''" type="button"> 
                  &nbsp; <input name="Copy" id="Copy" value=" 复制代码 " onclick="copy(1);" onmouseover="this.style.backgroundColor='#BFDFFF'" onmouseout="this.style.backgroundColor=''" type="button"> 
                  &nbsp; <input name="Editorfullscreen" id="Editorfullscreen" value=" 全屏编辑 " disabled="disabled" onclick="fullscreen(1);" onmouseover="this.style.backgroundColor='#BFDFFF'" onmouseout="this.style.backgroundColor=''" type="button"> 
                  &nbsp; <input name="EditorSkin" id="EditorSkin" value=" 修改风格 " disabled="disabled" onclick="return Templateskin()" onmouseover="this.style.backgroundColor='#BFDFFF'" onmouseout="this.style.backgroundColor=''" type="button"> 
                </td>
                <td align="right" width="5%"><img src="images/sizeplus.gif" onclick="sizecontent(5,'content')" height="20" width="20">&nbsp;<img src="images/sizeminus.gif" onclick="sizecontent(-5,'content')" height="20" width="20">&nbsp;&nbsp;</td>
              </tr>
            </tbody>
          </table></td>
      </tr>
      <tr class="tdbg" id="showeditor" style="display: none;"> 
        <td valign="top"> <table>
            <tbody>
              <tr> 
                <td width="20"></td>
                <td> </td>
              </tr>
            </tbody>
          </table></td>
      </tr>
      <tr class="tdbg">
      <c:if test="${modify[4]=='true'}"> 
        <td valign="top">&nbsp;&nbsp; <input name="isDefault" id="isDefault" value="Yes" type="checkbox" checked>
          将此模板设为默认模板</td>
      </c:if>
      <c:if test="${modify[4]!='true'}">
      	<td valign="top">&nbsp;&nbsp; <input name="isDefault" id="isDefault" value="Yes" type="checkbox">
          将此模板设为默认模板</td>
      </c:if>
      </tr>
      <tr class="tdbg"> 
        <td align="center" height="50"><input name="ChannelID" id="ChannelID" value="1" type="hidden"> 
          <input name="action" id="action" value="modify" type="hidden"> <input name="modifyId" id="modifyId" value="${param.id}" type="hidden"> <input name="button" value=" 添 加 " onclick="return CheckForm(1);" type="button"> 
        </td>
      </tr>
    </tbody>
  </table>
</form>
	</c:when>
</c:choose>
<!-- Powered by: PowerEasy 2005 -->
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -