<%@ Page Language="C#" AutoEventWireup="true" Inherits="System_Label_AnomalyContent, QianboCMS" EnableEventValidation="false" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Import Namespace="Qianbo.Common" %>
<!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 runat="server">
    <title>添加不规则标签</title>
    <link rel="stylesheet" href="../Css/layout.css" type="text/css" />
    <script language="javascript" src="../../Js/Common.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        function PreListFun() {
            FieldPre($("txtContent").value);
        }
        function CheckValidate() {
            if ($("txtName").value.trim().length == 0) {
                alert("标签名称不能为空！");
                $("txtName").focus();
                return false;
            }
            if ($("txtContent").value.trim().length == 0) {
                alert("标签内容不能为空！");
                $("txtContent").focus();
                return false;
            }
            return true;
        }
        function setx(obj) {
            $('txtContent').focus();
            if (document.selection) {
                var range = document.selection.createRange();
                range.text = "<a href=\"" + obj.id + "\">" + coder(obj.title) + "</a>";
            }
        }
        function FieldPre(val) {
            document.getElementById("preList").innerHTML = "正在处理数据…";
            System_Label_AnomalyContent.AnomalyContent(val, FieldPre_CallBack);
        }
        function FieldPre_CallBack(res) {
            document.getElementById("preList").innerHTML = res.value;
        }
    </script>
</head>

<body>
    <form id="form1" runat="server">
        <table cellspacing="1" cellpadding="0" class="wzdh" align="center">
            <tr>
                <td style="padding-left: 10px;">
                    <img src="../Images/Skin/Default/you.gif" align="absmiddle" />
                    您现在的位置：<a href="../SystemInfo.aspx">后台管理</a> &gt;&gt; <a href="../Template/CreateFolder.aspx">标签&模板管理</a> &gt;&gt; <a href="LabelManager.aspx">标签管理</a> &gt;&gt; 添加不规则标签
				</td>
            </tr>
        </table>
        <table cellpadding="0" cellspacing="1" class="border" align="center">
            <tr class="tdbg">
                <td width="50%" valign="top">
                    <table width="100%%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>
								<span style="float: left;">
									标签名称：
									<asp:Label ID="lblPrefix" runat="server" Text="{Qianbo_" ForeColor="Red"></asp:Label>
									<asp:TextBox ID="txtName" runat="server" Width="80"></asp:TextBox>
									<asp:Label ID="lblPostfix" runat="server" Text="}" ForeColor="Red"></asp:Label>
								</span>
								<span style="float: right;">
									频道：
									<asp:DropDownList ID="ddlCh" runat="server" Width="80" OnSelectedIndexChanged="ddlCh_SelectedIndexChanged" AutoPostBack="True"></asp:DropDownList>
								</span>
							</td>
                        </tr>
                        <tr>
                            <td>
                                <table cellpadding="0" cellspacing="1" class="border" align="center">
                                    <asp:Repeater ID="repAnomaly" runat="server" OnItemCommand="repAnomaly_ItemCommand">
                                        <HeaderTemplate>
                                            <tr class="title">
                                                <td width="120px">栏目名称</td>
                                                <td>内容名称</td>
                                                <td width="30px">操作</td>
                                            </tr>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                                <td><%# Function.HtmlEncode(Eval("ColName"))%></td>
                                                <td><%# Function.HtmlEncode(Eval("Title"))%></td>
                                                <td>
                                                    <asp:HiddenField ID="hidAnomalyId" runat="server" Value='<%#Eval("Id") %>' />
                                                    <asp:LinkButton ID="linkbtnDelete" runat="server" CommandName="Delete" OnClientClick="return confirm('是否确定删除？');">删除</asp:LinkButton>
												</td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <webdiyer:AspNetPager ID="pageAnomaly" runat="server" AlwaysShow="True" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PageSize="20" HorizontalAlign="Right" PrevPageText="上一页" ShowInputBox="Never" UrlPageIndexName="" ShowCustomInfoSection="Left" Width="99%" OnPageChanging="pageAnomaly_PageChanging" LayoutType="Table" CustomInfoSectionWidth="10%"></webdiyer:AspNetPager>
							</td>
                        </tr>
                    </table>
                </td>
                <td width="50%">
                    <table width="100%%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>
								不规则标签格式：<br />
                                {$Qianbo row="1" length="10" style="color: red; font-size: 12px;" target="_blank"/}
							</td>
                        </tr>
                        <tr>
                            <td>
                                <textarea id="txtContent" style="width: 100%; border: solid 1px #ccc;" rows="15" runat="server"></textarea>
							</td>
                        </tr>
                        <tr>
                            <td style="padding: 5px;">
                                <input id="Submit1" type="button" value="预览列表" onclick="PreListFun()" class="btn" />
							</td>
                        </tr>
                        <tr>
                            <td id="preList" style="border: solid 1px #CCC;"></td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr class="tdbg">
                <td colspan="2" align="center">
                    <asp:Button ID="btnSave" runat="server" Text="保存" CssClass="btn" OnClientClick="return CheckValidate()" OnClick="btnSave_Click" />
                    <asp:Button ID="btnReset" runat="server" Text="取消" CssClass="btn" OnClick="btnReset_Click" />
				</td>
            </tr>
        </table>
    </form>
    <br />
</body>
</html>