<%@ page language="VB" autoeventwireup="false" inherits="parrot_admin_diyclass, App_Web_admin_diyclass.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_diyclass" && e.disabled != true) //如果该元素的name属性为chkAll并且disabled!=true.即:该控件可用时.
e.checked = form.chkAll.checked; //控元素的checked与当前选中的控件checked保持一致.即:全选/全不选.
} 
} 

   function copyToClipBoard(a){ 
    window.clipboardData.setData("Text",a); 
    alert("复制成功！"); 
} 

<%if CheckBox1.checked=true then %>	
var editor;
 KindEditor.ready(function (K) {
	        var editor = K.create('#class_code', {
				resizeType : 1,
				allowImageUpload: false,
				allowFlashUpload: false,
				allowMediaUpload: false,
				allowFileUpload:false,
                filterMode: false
				
	        });
			
			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('class_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="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%" colspan="3" >
                                                      
                                <table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                <td>
                                <asp:TextBox ID="class_name" runat="server" CssClass="text_autox22_cccccc" 
                                                      Width="250px"></asp:TextBox>                                </td>
                                  <td width="55" align="right" class="huise12">约显码：</td>
                                  <td><asp:TextBox ID="class_jsnumber" runat="server" CssClass="text_autox22_cccccc" 
                                                        Width="30px" onkeydown="intjs()"></asp:TextBox></td>
                                  
                                  <td>&nbsp;</td>
                                  <td><asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" 
                                              CssClass="wuse12" Text="可视化编辑" /></td>
                                </tr>
                            </table>
                            </td>
                          </tr>
                          <tr>
                            <td height="30" align="center" bgcolor="#F6F6F6" class="huise12">样式参数：</td>
                            <td colspan="3"  class="wuse12"><table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td><asp:RadioButtonList ID="class_config" runat="server" CssClass="wuse12" 
                                                        RepeatDirection="Horizontal">
                                      <asp:ListItem Selected="True" Value="For">循环模式</asp:ListItem>
                                      <asp:ListItem Value="Fill">填充模式</asp:ListItem>
                                  </asp:RadioButtonList></td>
                                  <td><asp:RadioButtonList ID="class_LoseHtml" runat="server" CssClass="wuse12" 
                                                        RepeatDirection="Horizontal">
                                      <asp:ListItem Selected="True" Value="False">保留内容HTML</asp:ListItem>
                                      <asp:ListItem Value="True">去除内容HTML</asp:ListItem>
                                  </asp:RadioButtonList></td>
                              </tr>
                            </table></td>
                          </tr>
                          <tr>
                            <td height="30" align="center" bgcolor="#F6F6F6" class="huise12">显示参数：</td>
                            <td colspan="3"  class="wuse12"><table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td><asp:DropDownList ID="class_item" runat="server" AutoPostBack="True">
                                      <asp:ListItem Value="-1">请选择显示项</asp:ListItem>
                                      <asp:ListItem Value="wn_nav">导航显示</asp:ListItem>
                                      <asp:ListItem Value="wn_wz">资讯显示</asp:ListItem>
                                      <asp:ListItem Value="news_category">文章分类</asp:ListItem>
                                      <asp:ListItem Value="wn_new">文章显示</asp:ListItem>
                                      <asp:ListItem Value="shop_category">商品分类</asp:ListItem>
                                      <asp:ListItem Value="wn_cp">商品显示</asp:ListItem>
                                      <asp:ListItem Value="wn_bbs_text">论坛主题显示</asp:ListItem>
                                      
                                    </asp:DropDownList>
                                      <asp:DropDownList ID="class_category" runat="server" Visible="False"> </asp:DropDownList></td>
                                  <td width="70" align="right"><span class="huise12">显示条数：</span></td>
                                  <td><asp:TextBox ID="class_count" runat="server" CssClass="text_autox22_cccccc" 
                                                        Width="30px" onkeydown="intjs()">5</asp:TextBox>                                  </td>
                                </tr>
                            </table></td>
                          </tr>
                          <tr>
                            <td height="30" align="center" bgcolor="#F6F6F6" class="huise12">筛选规则：</td>
                            <td colspan="3"  class="wuse12"><table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td><asp:TextBox ID="class_sqlsing" runat="server" CssClass="text_autox22_cccccc" Width="330px"></asp:TextBox></td>
                                  <td width="70" align="right"><span class="huise12">时间格式：</span></td>
                                  <td><asp:TextBox ID="class_timesing" runat="server" CssClass="text_autox22_cccccc" 
                                                        Width="125px">yyyy-MM-dd HH:mm</asp:TextBox></td>
                                </tr>
                            </table>                            </td>
                          </tr>
                          <tr>
                            <td colspan="4" class="huise12" style="word-break: break-all">
                            <asp:TextBox CssClass="text_autox22_cccccc" Height="300px" ID="class_code" runat="server" Width="100%" TextMode="MultiLine"></asp:TextBox>
                          
                            </td>
                          </tr>
                          <tr>
                            <td height="30" align="center" bgcolor="#F6F6F6" class="huise12"><a href="?">新建</a></td>
                            <td colspan="3"  class="wuse12"><table width="100%" border="0" cellpadding="0" cellspacing="5">
                                <tr><td width="20"><input name="image_url" type="text" style="display :none;" /><input type="button" class="btn_2k3" onclick="img_mappath(this,'image_url');" value="打开图库" style="height:26px" /></td>
                                  <td width="20">
                                   <%if CheckBox1.checked=true then %>	
                                   <input type="button" class="btn_2k3" value="插入图片" name="insertimage" style="height:26px;"/>
                                        <%Else%>
                                    <input type="button" class="btn_2k3" value="插入图片" onclick="insertIMG()" style="height:26px;"/>
                                        <%End If%>
                                  </td>
                                  <td>
                                      <asp:Button ID="code_come" runat="server" Text="导入代码" CssClass="btn_2k3" 
                                          Height="26px" />
                                      <asp:Button ID="diy_class_ok" runat="server" 
                                                      CssClass="btn_2k3" Text="保存调用" height="26px"/>      
                                      <asp:Button ID="update_class_ok" runat="server" 
                                                      CssClass="btn_2k3" Text="修改调用" Visible="False" height="26px"/>        
                                      </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="diyclass_data" runat="server">
                            <ItemTemplate>
                              <tr>
                                <td width="5%" height="30" align="center" class="huise12"><input name="checkbox_diyclass" type="checkbox" id="checkbox_diyclass" value="<%#Eval("class_id")%>" /></td>
                                <td colspan="3"  class="wuse12">&nbsp;<%# Eval("class_name")%></td>
                                <td width="20%" align="center" class="wuse12"><%#Eval("class_time")%></td>
                                <td width="30%" align="center" class="wuse12"><a href="?update=True&amp;id=<%# Eval("class_id")%>">编辑</a> | <a href="javascript:copyToClipBoard('&lt;script src=&quot;http://<%=Request.Url.Authority & ubb.url%>web_js/web_diyclass.aspx?id=<%#Eval("class_id")%>&jsno=<%#Eval("class_jsnumber")%>&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;');" >获取调用代码</a> | <a href="?codeout_id=<%# Eval("class_id")%>">导出代码</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="new_quantity_delete" runat="server" 
                                      Text="批量删除" Width="60px"/>      
                            </span></td>
                          </tr>
                      </table></td>
                    </tr>
                </table></td>
              </tr>
          </table></td>
        </tr>
      </table>
    </form>
</body>
</html>
