<%@ Page Language="c#" Inherits="Web.User.addPicLink" CodeBehind="addPicLink.aspx.cs" %>
<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>addpicLink</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/head.htm" -->
    <!--#include file = "../Css/userCssEdit.htm" -->
    <script type="text/javascript">
        //预览图片高度宽度设置 （201407 shijian 统一把document.formID.objectID.**写法替换为 $("ID").写法）
        function change() {
            var arr = $("#pic").val();
            if (arr != "") {
                //if (arr.indexOf("http://") > -1 )
                //{
                //    arr = "" + arr;
                //}
                var imgstr = "<img src=" + arr + " height=" + $("#height").val() + " width=" + $("#width").val() + " />";
                $("#pho").html(imgstr);
            }
        }
        
        //关闭弹出层 刷新列表
        function divClose1(bigclassid,menuid){
            parent.$.fancybox.close();
            parent.location = "managePicLink.aspx?bigclassid=" + bigclassid + "&menuId=" + menuid;
        }

        function divClose() {
            parent.$.fancybox.close();
            parent.location = "AuditingLink.aspx" ;
        }

        function delayClose() {
            setTimeout("divClose()", 1000);
        }

        function delayClose1(bigclassid, menuid) {
            setTimeout("divClose1(" + bigclassid + "," + menuid + ")", 1000);
        }


    </script>

    
</head>
<body>
    <form id="addNews" method="post" runat="server">
    <div class="edit-func-box func-box">
        <div class="hd b">
            编辑</div>
        <div class="bd mb80">
            <table class="edit-table">
                <tr>
                    <th>
                        链接名称：
                    </th>
                    <td>
                        <asp:TextBox ID="name" runat="server" cssclass="input-md w3" notNull="true" msgName="链接名称"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        链接图片：
                    </th>
                    <td>
                        <div id="pho" runat="server" ></div><a id="uploadimg" href="#" class="blue">上传照片</a>
                    </td>
                </tr>
                <tr>
                    <th>
                        图片属性：
                    </th>
                    <td>
                        高度：<asp:TextBox ID="height" runat="server" cssclass="input-mini" onchange="change();" notNull="true" msgName="图片高度">35</asp:TextBox>PX&nbsp;&nbsp;
                        宽度：<asp:TextBox ID="width" runat="server" cssclass="input-mini" onchange="change();" notNull="true" msgName="图片宽度">125</asp:TextBox>PX&nbsp;&nbsp;
                    </td>
                </tr>
                <tr>
                    <th>
                        链接地址：
                    </th>
                    <td>
                        <asp:TextBox ID="url" runat="server" class="input-md w3" notNull="true" msgName="链接地址"></asp:TextBox>
                        <p><span class="lgrey">外链需加上http://，内链可用相对路径，#表示空链接</span></p>
                    </td>
                </tr>
                <tr>
                    <th>
                        显示等级：
                    </th>
                    <td>
                        <asp:DropDownList ID="grade" runat="server" DataTextField="name" DataValueField="pkId" CssClass="input-md">
                        </asp:DropDownList>
                    </td>
                </tr>
                <%--<tr>
                    <th>
                        浏览权限：
                    </th>
                    <td>
                        <asp:DropDownList ID="gate" runat="server" CssClass="input-md">
                            <asp:ListItem Value="0">无限制</asp:ListItem>
                            <asp:ListItem Value="1">仅内网可见</asp:ListItem>
                            <asp:ListItem Value="2">仅登录可见</asp:ListItem>
                            <asp:ListItem Value="3">内网或登录可见</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>--%>
                <tr>
                    <th>
                        是否固顶：
                    </th>
                    <td>
                        <asp:CheckBox ID="isTop" runat="server" Text="固顶"></asp:CheckBox>
                    </td>
                </tr>
            </table>
            <div class="ft ft02">
                <div class="action-field text-center">
                    <asp:Button ID="add" runat="server" cssclass="btn btn-sm btn-primary" Text="添 加" OnClientClick="return checkAllValidate();" OnClick="add_Click"></asp:Button>&nbsp;&nbsp;&nbsp;
                    <input type="button" class="btn btn-sm btn-primary" value="取 消" onclick="parent.$.fancybox.close();" />&emsp;
                    <asp:Label ID="lbTip" runat="server" ForeColor="Red" Text=""></asp:Label>
                </div>
                <!--/action-field-->
            </div>
            <input type="hidden" id="pic" name="Hidden1" runat="server" />
        </div>
    </div>
    </form>
        <!--#include file = "../Css/foot.htm" -->
     <script type="text/javascript">
         //自定义上传图片控件加载，支持自定义上传图片功能需先引用三个文件，[themes/default/default.css] [kindeditor.js] [lang/zh_CN.js]
         KindEditor.ready(function (K) {
             var editor = K.editor({
                 uploadJson: '../Wpedt/UserEditor/aspnet/upload_json.ashx',
                 fileManagerJson: '../Wpedt/UserEditor/aspnet/file_manager_json.ashx',
                 allowFileManager: true
             });
             K('#uploadimg').click(function () {
                 editor.loadPlugin('zdyimage', function () {
                     editor.plugin.zdyimageDialog({
                         zdyimageUrl: K('#pic').val(),
                         clickFn: function (url) {
                             K('#pic').val(K.formatUrl(url, 'domain'));
                             editor.hideDialog();
                             change();//加载预览图片
                         }
                     });
                 });
             });

         });

    </script>

</body>
</html>
