<%@ page language="VB" autoeventwireup="false" inherits="parrot_admin_diyhtml, App_Web_admin_diyhtml.aspx.25f04327" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>自定义页面管理</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="css/css.css" rel="stylesheet" type="text/css"/>
<link href="css/text.css" rel="stylesheet" type="text/css"/>
<link href="css/button.css" rel="stylesheet" type="text/css" />
<link href="css/body.css" rel="stylesheet" type="text/css" />
<script src="js/intjs.js" type="text/javascript"></script>
<script charset="utf-8" src="../kindeditor/kindeditor.js" type="text/javascript"></script>
<script charset="utf-8" src="../kindeditor/lang/zh_CN.js" type="text/javascript"></script>


<script language="javascript" type="text/javascript">

    function img_mappath(img_val, input_val) {
        var arr = showModalDialog("admin_select_img.aspx?temp=" + Math.random, "", "dialogWidth:963px; dialogHeight:600px; status:0; help:0");
        if (arr != null) {
            document.getElementById(input_val).value = arr;
        }
    }



    function CheckAll(form) //传一个表单作参数
    {
        for (var i = 0; i < form.elements.length; i++) //对这个表单里的元素进行循环
        {
            var e = form.elements[i]; //一个一个元素判断
            if (e.Name != "checkbox_diyhtml" && e.disabled != true) //如果该元素的name属性为chkAll并且disabled!=true.即:该控件可用时.
                e.checked = form.chkAll.checked; //控元素的checked与当前选中的控件checked保持一致.即:全选/全不选.
        }
    }

<%if CheckBox1.checked=true then %>	
	
var editor;
 KindEditor.ready(function (K) {
	        var editor = K.create('#html_code', {
				resizeType : 1,
				allowImageUpload: false,
				allowFlashUpload: false,
				allowMediaUpload: false,
				allowFileUpload:false,
                filterMode: false,
				afterChange: function () {
                var self = this;
                document.getElementById('html_code').value = self.html();
            }
	        });
			
			K('input[name=insertimage]').click(function(e) {
					
					var image_url=document.getElementById('image_url').value;//用户名
              if(image_url==""){
                alert('请打开图像库选择相应图片后再插入图片');
                }else{

            editor.insertHtml('<img src="'+ image_url +'"/>');
           document.getElementById('image_url').value='';

                 }
				 
					
				});

	      
	    });
        <%else %>
		

function Insert(str) { 
var obj = document.getElementById('html_code'); 
if(document.selection) { 
obj.focus(); 
var sel=document.selection.createRange(); 
document.selection.empty(); 
sel.text = str; 
} else { 
var prefix, main, suffix; 
prefix = obj.value.substring(0, obj.selectionStart); 
main = obj.value.substring(obj.selectionStart, obj.selectionEnd); 
suffix = obj.value.substring(obj.selectionEnd); 
obj.value = prefix + str + suffix; 
} 
obj.focus(); 
} 

function insertIMG(){
var image_url=document.getElementById('image_url').value;//用户名
   if(image_url==""){
                alert('请打开图像库选择相应图片后再插入图片');
                }else{

           Insert('<img src="'+ image_url +'"/>');
           document.getElementById('image_url').value='';

                 }
}
    <%end if  %>
				document.oncontextmenu=new Function('event.returnValue=false;'); 
    </script>

</head>
<body>
    <form id="form1" runat="server">
 <table width="100%" border="0" cellspacing="3" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td bgcolor="#E7E7E7"><table width="100%" border="0" cellspacing="5" cellpadding="0">
          <tr>
            <td bgcolor="#CACACA"><table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#D4D0C8">
                <tr>
                  <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td><table width="100%" border="1" cellpadding="0" cellspacing="1" bordercolor="#E7E7E7">
                            <tr>
                              <td width="20%" height="30" align="center" bgcolor="#F6F6F6" class="huise12">页面名称：</td>
                              <td width="80%"  class="wuse12"><table border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td><asp:TextBox ID="html_name" runat="server" CssClass="text_autox22_cccccc" 
                                                      Width="400px" onkeyup="value=value.replace(/[\W]/g,'')" 
                                                MaxLength="30"></asp:TextBox></td>
                                      <td width="20" align="center"><span class="hongse12">*</span></td>
                                      <td><asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" 
                                              CssClass="wuse12" Text="可视化编辑" />                                      </td>
                                    </tr>
                                  </table></td>
                            </tr>
                            <tr>
                              <td height="30" colspan="2" bgcolor="#F6F6F6" class="huise12" style="word-break: break-all"><asp:TextBox CssClass="text_autox22_cccccc" Height="300px" ID="html_code" runat="server" Width="100%" TextMode="MultiLine">
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /&gt;
&lt;title&gt;网页名称&lt;/title&gt;
&lt;meta name="keywords" content="网页关键字"/&gt;
&lt;meta name="description" content="网页介绍" /&gt;

css代码 和JS代码写这里

&lt;/head&gt;

&lt;body&gt;

&lt;form id="form1" name="form1" method="post" action=""&gt;

html代码写这里

&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt; </asp:TextBox></td>
                            </tr>
                            <tr>
                              <td height="30" colspan="2" align="center" bgcolor="#DEE1E7" class="huise12"><table width="100%" border="0" cellpadding="0" cellspacing="5">
                                  <tr>
                                    <td align="center" class="wuse12"><a href="?">新建</a></td>
                                    <td><input name="image_url" type="text" style="display :none;" /><input type="button" class="btn_2k3" onClick="img_mappath(this,'image_url');" value="打开图库" style="height:22px;width:65px" />
                                      <%if CheckBox1.checked=true then %>	
                                      <input type="button" class="btn_2k3" value="插入图片" name="insertimage" style="height:22px;width:65px"/>
                                        <%Else%>
                                        <input type="button" class="btn_2k3" value="插入图片" onclick="insertIMG()" style="height:22px;width:65px"/>
                                        <%End If%>                                    <asp:Button ID="diy_html_ok" runat="server" 
                                                      CssClass="btn_2k3" Text="创建Hthl页" style="height:22px" width="80px"/>                                                
                                        <asp:Button ID="update_html_ok" runat="server" 
                                                      CssClass="btn_2k3" Text="保存修改" Visible="False" style="height:22px"/>                                                  
                                        <asp:Label CssClass="hongse12" ID="diy_html_ts" runat="server">页面名称和页面代码都是必填项！</asp:Label></td>
                                    <td width="10"><img src="image/img-41.GIF" width="16" height="22" onClick="document.getElementById('html_code').style.height=(parseInt 
(document.getElementById('html_code').style.height)+150).toString()+'px'"  onmouseover= "this.style.cursor= 'hand' "   onmouseout= "this.style.cursor= 'normal'"/> </td>
                                    <td width="10"><img src="image/img-40.GIF" width="16" height="22" onClick="if(parseInt(document.getElementById('html_code').style.height)>150) 
{document.getElementById('html_code').style.height=(parseInt(document.getElementById('html_code').style.height)- 
150).toString()+'px'}"  onmouseover= "this.style.cursor= 'hand' "   onmouseout= "this.style.cursor= 'normal'"/> </td>
                                  </tr>
                              </table></td>
                            </tr>
                        </table></td>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td class="wuse14"><strong>现有自定义页面</strong></td>
          </tr>
          <tr>
            <td bgcolor="#CACACA"><table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#D4D0C8">
                <tr>
                  <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td><table width="100%" border="1" cellpadding="0" cellspacing="1" bordercolor="#E7E7E7">
                            <asp:Repeater ID="diyhtml_data" runat="server">
                              <ItemTemplate>
                                <tr>
                                  <td width="5%" height="30" align="center" class="huise12"><input name="checkbox_diyhtml" type="checkbox" id="checkbox_diyhtml" value="<%#Eval("htmlename")%>" /></td>
                                  <td colspan="3"  class="wuse12">&nbsp;<a href="../html/<%# Eval("htmlename")%>" target="_blank"><%# Eval("htmlename")%></a></td>
                                  <td width="20%" align="center" class="wuse12"><%# Eval("htmltime")%></td>
                                  <td width="20%" align="center" class="wuse12"><a href="?update=True&url=<%#Eval("htmlename")%>">编辑</a></td>
                                </tr>
                              </ItemTemplate>
                            </asp:Repeater>
                        </table></td>
                      </tr>
                      <tr>
                        <td><table border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="30" align="center"><span class="wuse12">
                                <input name="chkAll" type="checkbox" id="chkAll" onClick="CheckAll(this.form)" value="checkbox" style="border:0" />
                              </span></td>
                              <td width="65"><span class="wuse12">全选/反选</span></td>
                              <td width="80"><span class="wuse12">
                                <asp:Button CssClass="btn1_mouseout" ID="html_quantity_delete" runat="server" 
                                      Text="批量删除" Width="60px" height="22px"/>        
                              </span></td>
                              <td width="95" align="right" class="wuse12">上传Html文件：</td>
                              <td width="80"><span class="wuse12">
                                <asp:FileUpload ID="FileUpload_url" runat="server" class="text_autox22_cccccc" />
                              </span></td>
                              <td width="96" align="right"><span class="wuse12">
                                <asp:Button CssClass="btn_2k3" ID="fileupload_ok" runat="server" Text="上传Html文件" Width="95px" height="22px"/>                                
                              </span></td>
                            </tr>
                        </table></td>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
    </form>
</body>
</html>
