<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="bigClassEdit.aspx.cs" Inherits="Web.Wpdcc.bigClassEdit" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>网站栏目添加、更改</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/head.htm" -->
   <script type="text/javascript">
       // 关闭弹出层 刷新栏目设置
       function divClose() {
           parent.$.fancybox.close();
           parent.jQuery.triggerSelect();
           parent.location = "bigclass.aspx";
       }
       //返回布局管理
       function divMenuClose() {
           parent.$.fancybox.close();
           parent.location = "manageMenuItem.aspx?parentid=<%=menuId%>";
             // parent.location="manageMenuTree.aspx?parentid=<%=menuId%>";
         }
       function delayClose() {
           setTimeout("divClose()", 1000);
       }
       function delayMenuClose() {
           setTimeout("divMenuClose()", 1000);
       }
   </script>
</head>
<body>
    <div class="edit-func-box func-box">
        <div class="hd b">
            网站栏目添加及更改</div>
        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="scriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="upd1" runat="server">
                <ContentTemplate>
                    <table id="Table2" class="edit-table">
                     <tr>
                            <th>
                                栏目类别：
                            </th>
                            <td>
                                <asp:DropDownList ID="ddlTpType" runat="server" CssClass="input-md" Width="90" AutoPostBack="True" OnSelectedIndexChanged="ddlTpType_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlTp" runat="server" CssClass="input-md" Width="120" onchange="selectCss(this.selectedIndex);" >
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlCss" Style="display: none" runat="server">
                                </asp:DropDownList>
                                &nbsp;<asp:DropDownList ID="itemPreview" runat="server" Visible="false" DataValueField="previewTemplate" DataTextField="name" onchange="previewItem(this.options[selectedIndex].value);">
                                </asp:DropDownList>
                            </td>
                            <th>
                                说明：
                            </th>
                            <td colspan="3">
                                <asp:TextBox ID="remark" runat="server" CssClass="input-md" title="常用于标记栏目所属频道，并可以按此说明查找栏目"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <strong class="required">*</strong>栏目名称：
                            </th>
                            <td colspan="3">
                            <asp:UpdatePanel ID="upd5" runat="server">
                                <ContentTemplate>
                                <asp:TextBox ID="name" runat="server" CssClass="input-md" notNull="true" msgName="栏目名称" title="栏目名可在频道版面中显示" ></asp:TextBox>
                                <asp:CheckBox  ID="ckbBatch" runat="server" 
                                    oncheckedchanged="ckbBatch_CheckedChanged" AutoPostBack="true"  Text=" 批量增加" class="tip"/>
                                  <asp:Panel ID="Panel1" runat="server" Visible="false" >
                                    <asp:TextBox ID="txtlm1" Width="82" CssClass="input-md" runat="server"></asp:TextBox>,
                                    <asp:TextBox ID="txtlm2" Width="82" CssClass="input-md" runat="server"></asp:TextBox>,
                                    <asp:TextBox ID="txtlm3" Width="82" CssClass="input-md" runat="server"></asp:TextBox>,
                                    <asp:TextBox ID="txtlm4" Width="82" CssClass="input-md" runat="server"></asp:TextBox>,
                                    <asp:TextBox ID="txtlm5" Width="82" CssClass="input-md" runat="server"></asp:TextBox>
                                    <br />
                                    <asp:TextBox ID="txtlm6" Width="82" CssClass="input-md" runat="server"></asp:TextBox>,
                                    <asp:TextBox ID="txtlm7" Width="82" CssClass="input-md" runat="server"></asp:TextBox>,
                                    <asp:TextBox ID="txtlm8" Width="82" CssClass="input-md" runat="server"></asp:TextBox>,
                                    <asp:TextBox ID="txtlm9" Width="82" CssClass="input-md" runat="server"></asp:TextBox>,
                                    <asp:TextBox ID="txtlm10" Width="82" CssClass="input-md" runat="server"></asp:TextBox>
                                    </div>
                                </asp:Panel>
                                </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                        <tr>
                          <th>
                                默认样式：
                            </th>
                            <td>
                               <asp:TextBox ID="txtCssDefault" runat="server" CssClass="input-md" Enabled="false" Width="140" ></asp:TextBox>
                                  <asp:TextBox ID="txtCss" runat="server" CssClass="input-md"  Visible ="false"></asp:TextBox>
                            </td>
                             <th>
                                更多列表：
                            </th>
                            <td colspan="3">
                                <asp:TextBox ID="txt_pagesize" runat="server" CssClass="input-md" Text="0"
                                    dataType="integer" minValue="0" maxvalue="100" MaxLength="2" msgName="更多页列表条目数"
                                    title="更多页列表的显示条数或行数，0表示按系统全局设置。"></asp:TextBox><span class="tip">(条)</span>
                            </td>
                           <%-- <th>
                                扩展样式：
                            </th>
                            <td>
                                <asp:TextBox ID="txtCss" runat="server" CssClass="input-txt" Width="100"></asp:TextBox>
                                <input type="button" name="editCss" value="编辑扩展样式" onclick="openCSS();" />
                            </td>--%>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        <div class="ft">
            <div class="action-field text-center">
                <asp:Button ID="btnSave" CssClass="btn btn-sm btn-primary" runat="server" Text="保存" OnClick="Btn_Click">
                </asp:Button>
                <asp:Button ID="btnRewrite" Cssclass="btn btn-sm btn-primary" runat="server" Visible="false" Text="重写"
                    CausesValidation="False" OnClick="Btn_Click"></asp:Button>
                <input type="button" value="关闭" class="btn btn-sm btn-primary" onclick="parent.$.fancybox.close();" />
                &emsp;<asp:Label ID="lbts" runat="server" Text="" ForeColor="Red"></asp:Label>
            </div>
            <div class="action-field txt-r">
            </div>
            <!--/action-field-->
        </div>
        </form>
    </div>
    <div id="divtmp">
        <div id="divtmp2" style="height:100px">
            <!--#include file = "bigclassview/tmpIndex.html" -->
        </div>
    </div>
       <!--#include file="../Css/foot.htm"-->
     <script type="text/javascript" language="javascript">
         
         $(document).ready(function () {
             var $divtmp = $('#divtmp');
             var $divtmp2 = $('#divtmp2');
             var $tableTmp = $divtmp2.find('ul');
             var $ddlCss = $('#ddlCss');
             $divtmp2.height($tableTmp.height());

             var $modelSelect = $('#ddlTp');

             $modelSelect.change(function () {

                 $divtmp.scrollTop(0);
                 $tableTmp.append($('#' + $ddlCss[0].options[$(this)[0].selectedIndex].value).prevAll());

             });

             //显示当前栏目效果图
             var tmpcode = $ddlCss[0].options[$modelSelect[0].selectedIndex].value;
             //document.getElementById("txtCssDefault").innerHTML = 'nsy-'+ tmpcode;
             document.getElementById("txtCssDefault").value = 'nsy-' + tmpcode;
             $tableTmp.append($('#' + tmpcode).prevAll());

             $("#btnSave").click(function () {
                 return checkAllValidate();
             });

         });
         function openCSS() {
             w = 746;
             h = 640;
             l = (screen.width) ? (screen.width - w) / 2 : 0;
             t = (screen.height) ? (screen.height - h) / 2 : 0;
             settings = 'height=' + h + ',width=' + w + ',top=' + t + ',left=' + l + ',toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no';
             window.open("editCss.aspx", "", settings);
         }

         //自动填充CSS样式名称
         function selectCss(selectedIndex) {
             //document.getElementById("txtCssDefault").innerHTML = 'nsy-'+ document.getElementById("ddlCss").options[selectedIndex].value;
             document.getElementById("txtCssDefault").value = 'nsy-' + document.getElementById("ddlCss").options[selectedIndex].value;
         }

    </script>
</body>
</html>
