<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="storetype_parameter.aspx.cs" Inherits="YXShop.Web.admin.templates.label.storetype_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 IsOmit;//是否省略
    var o=document.getElementsByName("rblIsOmit");
    for (var i=0;i<o.length ;i++ )
    {
        if( o[i].checked==true )
        {
            IsOmit=o[i].value;
        }
    }
    var LayoutMode;//布局方式
    o=document.getElementsByName("rblLayoutMode");
    for (var i=0;i<o.length ;i++ )
    {
        if( o[i].checked==true )
        {
            LayoutMode=o[i].value;
        }
    }
    var SortMode;//排序方式
    o=document.getElementsByName("rblSortMode");
    for (var i=0;i<o.length ;i++ )
    {
        if( o[i].checked==true )
        {
            SortMode=o[i].value;
        }
    }

    var SortField;//排序字段
    o=document.getElementsByName("ddlSortField");
    for (var i=0;i<o.length ;i++ )
    {
        if( o[i].checked==true )
        {
            SortField=o[i].value;
        }
    }
    var ShowSeries;//显示级数
    o=document.getElementsByName("rblShowSeries");
    for (var i=0;i<o.length ;i++ )
    {
        if( o[i].checked==true )
        {
            ShowSeries=o[i].value;
        }
    }
    
    var OneRows = document.getElementById("txtOneRows").value;//一级显示行数
    var OneColumn=document.getElementById("txtOneColumn").value;//一级显示列数
    var OneMaxCharacter=document.getElementById("txtOneMaxCharacter").value;//一级显示字符数
    
    var TowRows = document.getElementById("txtTowRows").value;//二级显示行数
    var TowColumn=document.getElementById("txtTowColumn").value;//二级显示列数
    var TowMaxCharacter=document.getElementById("txtRowMaxCharacter").value;//二级显示字符数
    
    var mystyle =document.getElementById("txtLabelContent").value;
    var cnm ="[YX:Loop,YX:LableType=StoreType,YX:IsOmit="+IsOmit+",YX:LayoutMode="+LayoutMode+",YX:SortMode="+SortMode+",YX:SortField="+SortField+",YX:ShowSeries="
    +ShowSeries+",YX:OneRows="+OneRows+",YX:OneColumn="+OneColumn+",YX:OneMaxCharacter="+OneMaxCharacter+",YX:TowRows="+TowRows+",YX:TowColumn="+TowColumn+",YX:TowMaxCharacter="+TowMaxCharacter+"]"+mystyle+"[/YX:Loop]";
    parent.getValue(cnm);
    CloseDiv();
}
function CloseDiv()
{
    parent.document.getElementById("LabelDivid").style.display="none";
}

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 ShowSeries()
{
    var ShowSeries;//显示级数
    o=document.getElementsByName("rblShowSeries");
    for (var i=0;i<o.length ;i++ )
    {
        if( o[i].checked==true )
        {
            ShowSeries=o[i].value;
        }
    }
    if(ShowSeries==1)
    {
       document.getElementById("TowSeries").style.display="none";
       document.getElementById("TowContent").style.display="none";
    }
    else
    {
        document.getElementById("TowSeries").style.display="";
        document.getElementById("TowContent").style.display="";
    }
}
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table style="width: 100%;" class="form_table_input" >
        <tr>
            <td>是否省略</td>
            <td>
                <asp:RadioButtonList ID="rblIsOmit" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="true" Selected="true">是</asp:ListItem>
                    <asp:ListItem Value="false">否</asp:ListItem>
                </asp:RadioButtonList>
            </td>
            <td>布局方式</td>
            <td>
                <asp:RadioButtonList ID="rblLayoutMode" runat="server" RepeatDirection="Horizontal"> 
                    <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:RadioButtonList ID="rblSortMode" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="desc" Selected="True">降序</asp:ListItem>
                    <asp:ListItem Value="asc">升序</asp:ListItem>
                </asp:RadioButtonList>
            </td>
            <td>排序字段</td>
            <td>
                <asp:DropDownList runat="server" ID="ddlSortField">
                    <asp:ListItem Value="id">自动编号</asp:ListItem>
                    <asp:ListItem Value="sort" Selected="True">排列顺序</asp:ListItem>
                    <asp:ListItem Value="adddate">创建时间</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>显示级数</td>
            <td colspan="3">
                <asp:RadioButtonList ID="rblShowSeries" runat="server" RepeatDirection="Horizontal" onclick="ShowSeries()">
                    <asp:ListItem Value="1" Selected="True">一级</asp:ListItem>
                    <asp:ListItem Value="2">二级</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr id="OneSeries">
            <td>一级显示</td>
            <td>
                行数<asp:TextBox ID="txtOneRows" runat="server" Width="40px"></asp:TextBox>&nbsp;&nbsp;列数<asp:TextBox ID="txtOneColumn" runat="server" Width="40px"></asp:TextBox>
            </td>
            <td>最长字符数</td>
            <td>
                <asp:TextBox ID="txtOneMaxCharacter" runat="server" Width="40px"></asp:TextBox>
            </td>
        </tr>
        <tr id="TowSeries" style="display:none;">
            <td>二级显示</td>
            <td>
                行数<asp:TextBox ID="txtTowRows" runat="server" Width="40px"></asp:TextBox>&nbsp;&nbsp;列数<asp:TextBox ID="txtTowColumn" runat="server" Width="40px"></asp:TextBox>
            </td>
            <td>最长字符数</td>
            <td>
                <asp:TextBox ID="txtRowMaxCharacter" runat="server" Width="40px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
             	显示属性
             </td>
            <td  align="left">
                <asp:DropDownList ID="LabelList1" runat="server" onchange="javascript:getValue(this.value);">
                    <asp:ListItem Value="">-类型标签-</asp:ListItem>
                    <asp:ListItem Value="[#StairName]">一级类型名称</asp:ListItem>
                    <asp:ListItem Value="[#SecondName]">二级类型名称</asp:ListItem>
                    <asp:ListItem Value="[#URL]">URL地址</asp:ListItem>
                </asp:DropDownList>
                <span id="TowContent" style="display:none">
                    <input type="button" value="插入二级分类" onclick="getValue('{# 您要加的内容 #}')" /><span style="color:Red">点击按钮可以在标示中插入二级分类</span>
                </span>
            </td>
        </tr>
        <tr>
            <td>标签内容</td>
            <td colspan="3"  align="left">
                 <asp:TextBox runat="server" ID="txtLabelContent" height="200" onselect="setCaret(this);"  onclick="setCaret(this);"  onkeyup="setCaret(this);" Width="500" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        </table>
    </div>
    </form>
    <table style="width: 100%;" class="form_table_input">
        <tr><td style="width: 100%;" align="center"><input type="button" id="bt_back" value="提交" onclick="ReturnValue()" />
        </td></tr>
    </table>
    </div>
    </form>
</body>
</html>