<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="commentinfo_parameter.aspx.cs" Inherits="YXShop.Web.admin.templates.label.commentinfo_parameter" %>

<!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 id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../style/admin.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function ReturnValue()
{
   var ShowMode;//显示方式
   o=document.getElementsByName("rblShowMode");//布局方式
   var len=o.length;   
   for (var i=0;i<len ;i++ )       
   {
      if( o[i].checked==true )
      {
         ShowMode=o[i].value;
      }
   }
   var CommentLevel;//评论等级
   o=document.getElementsByName("rblCommentLevel");//布局方式
   var len=o.length;   
   for (var i=0;i<len ;i++ )       
   {
      if( o[i].checked==true )
      {
         CommentLevel=o[i].value;
      }
   }
   var CompositorType;//评论等级  
   o=document.getElementsByName("rbl_CompositorType");//布局方式
   var len=o.length;   
   for (var i=0;i<len ;i++ )       
   {
      if( o[i].checked==true )
      {
         CompositorType=o[i].value;
      }
   }
   var CompositorField =document.getElementById("ddl_filed").value; //排序字段
   var ShowRows = document.getElementById("Tb_rows").value;//显示行数
   var ShowColumns = document.getElementById("Tb_Columns").value;//显示列数
   var NameCharacter =document.getElementById("tb_namelength").value;//名称最大字符数
   var WhetherPagination;
   o=document.getElementsByName("rbl_page");//是否分页
   var len=o.length;   
   for (var i=0;i<len ;i++ )
   {
      if( o[i].checked==true )
      {
         WhetherPagination=o[i].value;
      }
   }
   var TempletLayout;      
   o=document.getElementsByName("Rbl_TempletLayout");//布局方式
   var len=o.length;   
   for (var i=0;i<len ;i++ )       
   {
      if( o[i].checked==true )
      {
         TempletLayout=o[i].value;
      }
   }
   var WhetherOmit;
   o=document.getElementsByName("rbl_WhetherOmit");//是否省略
   var len=o.length;   
   for (var i=0;i<len ;i++ )       
   {
      if( o[i].checked==true )
      {
          WhetherOmit=o[i].value;
      }
   }     
    //自定义内容
    var mystyle = document.getElementById("txtLabelContent").value;
	var cnm ="[YX:Loop,YX:LableType=Comment,YX:Option=CommentInfo,YX:ShowMode="+ShowMode+",YX:CommentLevel="+CommentLevel+",YX:CompositorType="+CompositorType+",YX:CompositorField="
	+CompositorField+ ",YX:ShowRows="+ ShowRows+",YX:ShowColumns="+ShowColumns+",YX:NameCharacter="+NameCharacter+",YX:WhetherPagination="+WhetherPagination+
	",YX:TempletLayout="+TempletLayout+
	",YX:WhetherOmit="+WhetherOmit+"]"+mystyle+"[/YX:Loop]"; 
    parent.getValue(cnm);
	 CloseDiv();

}

    function getValue(value)
    {
        var textObj=document.getElementById("txtLabelContent");
        var textFeildValue=value;
        if(value!="") 
        {
            if(document.all)
            {     
                if(textObj.createTextRange && textObj.caretPos)
                {   
                    var caretPos=textObj.caretPos;   
                    caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==''?textFeildValue+'':textFeildValue;   
                }
                else
                {   
                    textObj.value=textFeildValue;   
                }   
            }
            else
            {   
                if(textObj.setSelectionRange)
                {   
                    var rangeStart =textObj.selectionStart;   
                    var rangeEnd=textObj.selectionEnd;   
                    var tempStr1=textObj.value.substring(0,rangeStart);   
                    var tempStr2 =textObj.value.substring(rangeEnd);   
                    textObj.value=tempStr1+textFeildValue+tempStr2;   
                }
                else
                {   
                    alert("This version of Mozilla based browser does not support setSelectionRange");   
                }   
            }
        }
    }
    function setCaret(textObj)
    {   
        if(textObj.createTextRange)
        {   
            textObj.caretPos=document.selection.createRange().duplicate();   
        }   
    } 
function CloseDiv()
{
    parent.document.getElementById("LabelDivid").style.display="none";
}
function ShowMode()
{
 var ShowMode;//显示方式
   o=document.getElementsByName("rblShowMode");//布局方式
   var len=o.length;   
   for (var i=0;i<len ;i++ )       
   {
      if( o[i].checked==true )
      {
         ShowMode=o[i].value;
      }
   }
   if(ShowMode==2)
   {
       document.getElementById("ProductInfo").style.display="";
       document.getElementById("StoreInfo").style.display="none";
   }
   else if(ShowMode==4)
   {
       document.getElementById("StoreInfo").style.display="";
       document.getElementById("ProductInfo").style.display="none";
   }
   else
   {
       document.getElementById("ProductInfo").style.display="none";
       document.getElementById("StoreInfo").style.display="none";
   }
}
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <table style="width: 100%;" class="form_table_input" >
            <tr>
                <td>显示方式</td>
                <td colspan="3">
                    <asp:RadioButtonList ID="rblShowMode" runat="server" RepeatDirection="Horizontal" onclick="ShowMode()">
                        <asp:ListItem Value="1" Selected=True>所有评论</asp:ListItem>
                        <asp:ListItem Value="2">商品点评</asp:ListItem>
                        <asp:ListItem Value="4">店铺点评</asp:ListItem>
                        <asp:ListItem Value="3">单条点评</asp:ListItem>
                        <asp:ListItem Value="5">单个商品点评</asp:ListItem>
                    </asp:RadioButtonList>
                    <span style="color:Red;">注：单条点评是指跟点评ID查询点评。</span>
                </td>
            </tr>
            <tr>
                <td>评论等级</td>
                <td colspan="3">
                    <asp:RadioButtonList ID="rblCommentLevel" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="1" Selected=True>无限制</asp:ListItem>
                        <asp:ListItem Value="2">好评</asp:ListItem>
                        <asp:ListItem Value="3">中评</asp:ListItem>
                        <asp:ListItem Value="4">差评</asp:ListItem>
                    </asp:RadioButtonList><span style="color:Red">注：评分5分为好评，4和3分为中评，2和1分为差评</span>
                </td>
            </tr>
            <tr>
             <td width="100">排序选择</td>
                <td width="200"><asp:RadioButtonList ID="rbl_CompositorType" runat="server" 
                        RepeatDirection="Horizontal" Height="24px" Width="119px">
                        <asp:ListItem Value="0" Selected="True">升序</asp:ListItem>
                        <asp:ListItem Value="1">降序</asp:ListItem>
                    </asp:RadioButtonList></td>
                <td width="100"></td>
                <td width="200"></td>
            </tr>
            <tr>
                <td>
                   显示几行</td>
                <td>
                    <asp:TextBox ID="Tb_rows" runat="server" Width="147px"  onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" >2</asp:TextBox>
                </td>
                <td>
                   排列方式</td>
                <td>
                    <asp:DropDownList ID="ddl_filed" runat="server" Height="25px" Width="137px">
                    <asp:ListItem Value="" Selected="True">排列方式</asp:ListItem>
                    <asp:ListItem Value="ComID">自动编号</asp:ListItem>
                     <asp:ListItem Value="CreateDate">点评时间</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    显示几列</td>
                <td>
                    <asp:TextBox ID="Tb_Columns" runat="server" Width="147px"  onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" >2</asp:TextBox>
                </td>
                <td>
                  是否分页</td>
                <td>
                    <asp:RadioButtonList ID="rbl_page" runat="server" 
                        RepeatDirection="Horizontal">
                        <asp:ListItem Value="0" Selected="True">分页</asp:ListItem>
                        <asp:ListItem Value="1">不分页</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                   名称长度</td>
                <td>
                    <asp:TextBox ID="tb_namelength" runat="server" Width="147px"  onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" >8</asp:TextBox>
                </td>
                <td>显示省略号
                   </td>
                <td>
                   <asp:RadioButtonList ID="rbl_WhetherOmit" runat="server" 
                        RepeatDirection="Horizontal">
                        <asp:ListItem Selected="True" Value="False">否</asp:ListItem>
                        <asp:ListItem Value="True">是</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    内容长度</td>
                <td>
                  
                   <asp:TextBox ID="tb_ContentCharacter" runat="server" Width="150px"  onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" >20</asp:TextBox>
                </td>
                <td>
                    布局方式</td>
                <td>
                  
                    <asp:RadioButtonList ID="Rbl_TempletLayout" runat="server" Height="26px" 
                        RepeatDirection="Horizontal" Width="116px">
                        <asp:ListItem Value="0" Selected="True">Div</asp:ListItem>
                        <asp:ListItem Value="1">Table</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    选择参数</td>
                <td>
                    <asp:DropDownList ID="ddl_Properties" runat="server" Height="18px" 
                        Width="150px" onchange="javascript:getValue(this.value);">
                     <asp:ListItem Value="">--请选择参数--</asp:ListItem>
                        <asp:ListItem Value="[#Comm_Title]">评论标题</asp:ListItem>
                        <asp:ListItem Value="[#Comm_Lable]">评论标签</asp:ListItem>
                        <asp:ListItem Value="[#Member_Name]">会员名称</asp:ListItem>
                        <asp:ListItem Value="[#Member_Level]">会员等级</asp:ListItem>
                        <asp:ListItem Value="[#Member_LevelPic]">等级图片</asp:ListItem>
                        <asp:ListItem Value="[#Reply_Count]">回复次数</asp:ListItem>
                        <asp:ListItem Value="[#Comm_DateTime]">评论时间</asp:ListItem>
                        <asp:ListItem Value="[#Comm_Flowers]">(次数)鲜花</asp:ListItem>
                        <asp:ListItem Value="[#Comm_Support]">(次数)支持</asp:ListItem>
                        <asp:ListItem Value="[#Comm_Combat]">(次数)反对</asp:ListItem>
                        <asp:ListItem Value="[#Comm_Content]">点评内容</asp:ListItem>
                        <asp:ListItem Value="[#Comm_ReplyButton]">回复按钮</asp:ListItem>
                        <asp:ListItem Value="[#Comm_ReplyLink]">回复链接</asp:ListItem>
                        <asp:ListItem Value="[#Comm_Count]">楼数</asp:ListItem>
                    </asp:DropDownList>
                    <span id="ProductInfo" style="display:none;">
                        <asp:DropDownList ID="DropDownList1" runat="server" Height="18px" 
                            Width="150px" onchange="javascript:getValue(this.value);">
                         <asp:ListItem Value="">--请选择参数--</asp:ListItem>
                            <asp:ListItem Value="[#Comment_Product_Images_Url]">商品图片</asp:ListItem>
                            <asp:ListItem Value="[#Comment_Product_Name]">商品名称</asp:ListItem>
                            <asp:ListItem Value="[#Comment_Product_Price]">商品价格</asp:ListItem>
                            <asp:ListItem Value="[#Comment_Product_Url]">商品详细页链接</asp:ListItem>
                        </asp:DropDownList>
                    </span>
                    <span id="StoreInfo" style=" display:none;">
                        <asp:DropDownList ID="DropDownList2" runat="server" 
                            Width="150px" onchange="javascript:getValue(this.value);">
                         <asp:ListItem Value="">--请选择参数--</asp:ListItem>
                            <asp:ListItem Value="[#Comment_Store_Images_Url]">商店标志</asp:ListItem>
                            <asp:ListItem Value="[#Comment_Store_Name]">商店名称</asp:ListItem>
                            <asp:ListItem Value="[#Comment_Store_Url]">商店链接</asp:ListItem>
                        </asp:DropDownList>
                    </span>
                </td>
                <td>
                    </td>
                <td>
                  
                  
                </td>
            </tr>
            
            <tr>
                
                <td colspan="4">
                    <asp:TextBox runat="server" ID="txtLabelContent" height="100" onselect="setCaret(this);"  onclick="setCaret(this);"  onkeyup="setCaret(this);" Width="600" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
            
            <tr>
                <td colspan="4" align="center" style="text-align:center">
                   <input id="Button1" type="button" value="提交" onclick="ReturnValue()" />
                    &nbsp;<input class="form" type="button" value=" 关 闭 "  onclick="javascript:CloseDiv();" /></td>
            </tr>
            </table>
    </div>
    </form>
</body>
</html>