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

<!DOCTYPE html>

<html>
<!--<![endif]-->
<head>
    <title>addPhoto</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file="../Css/head.htm"-->
    <!--#include file = "../Css/userCssEdit.htm" -->
    <link rel="stylesheet" href="../Wpedt/WpdccEditor/themes/default/default.css" />

    <script language="javascript" type="text/javascript" src="../Wpedt/My97DatePicker/WdatePicker.js"></script>
    <script language="javascript" src="../Js/ColorPicker.js" charset="utf-8"></script>
    <script type="text/javascript" src="../Wpedt/WpdccEditor/kindeditor.js"></script>

    <script type="text/javascript" src="../Wpedt/WpdccEditor/lang/zh_CN.js" charset="utf-8"></script>
    <%--    <script type="text/javascript">
    //关闭弹出层 刷新列表
    function divClose(bigclassid,menuid){
        parent.$.fancybox.close();
        parent.location="manageInfoSearch1.aspx?type="+bigclassid+"&menuId="+menuid;
    }
    </script>--%>

    <script type="text/javascript">
        jQuery(function ($) {
            $("input[type='checkbox']").addClass("ace");
            $("input[type='checkbox']").next().addClass("lbl");
        })

    </script>
    <script type="text/javascript" language="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('#imageName').val(),
                        clickFn: function (url) {
                            K('#imageName').val(K.formatUrl(url, 'domain'));
                            editor.hideDialog();
                            var arr = K("#imageName").val();
                            if (arr != "") {
                                K("#pho").attr('src', arr);
                            }//加载预览图片
                        }
                    });
                });
            });

        });
    </script>

    <script language="javascript" type="text/javascript">
        //保存前验证（改用统一验证js）
        function editCheck() {
            if (checkAllValidate()) {
                return true;
            }
            else {
                return false;
            }
        }

        function setcolor(type) {
            var arr = showModalDialog("../Wpedt/WpdccEditor/Dialog/selcolor.htm", "", "dialogWidth:300px; dialogHeight:260px; status:0");
            if (arr != null) {
                var button = eval("document.system." + type);
                button.value = arr;
                var table = eval(type + "Table");
                table.bgColor = arr;
            }
        }

        function setTableColor(type) {

            var button = eval("document.system." + type);
            var table = eval(type + "Table");
            table.bgColor = button.value;
        }
    </script>
</head>
<body>
    <form id="addNews" method="post" runat="server">
        <div class="edit-func-box func-box">
            <div class="hd">添加相片</div>
            <div class="bd mb80">
                <table class="edit-table" id="Table1">
                    <tr>
                        <th style="width: 20%;">相片标题：
                        </th>
                        <td colspan="3">
                            <asp:TextBox ID="photoName" runat="server" notNull="true" msgName="相片标题" class="input-md w3" MaxLength="250"></asp:TextBox>&nbsp;&nbsp;
                        <asp:CheckBox ID="isTop" runat="server" Text="固顶" CssClass="form-checkbox"></asp:CheckBox>&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <th>相片：
                        </th>
                        <td>
                            <div class="addpicnews-div pull-left">
                                <img alt="" src="../images/uploadfiles/nopic.gif" runat="server" id="pho" class="pic-div pull-left img" width="220" height="160" />
                            </div>
                            <p class="fn-pt30">
                                <a id="uploadimg" href="javascript:void(0);" class="blue">上传图片</a>
                            </p>
                            <p class="fn-pt30">
                                <span class="lgrey">封面若未上传，则会使用默认相片</span>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <th>摘要：
                        </th>
                        <td>
                            <asp:TextBox ID="tbDescript" msgName="相片摘要" runat="server" Width="400px" TextMode="MultiLine" Height="90px" MaxLength="50" CssClass="input-md"></asp:TextBox>
                            <p>
                                <span class="lgrey">摘要字数建议不超过100字！</span>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <th>创建时间：
                        </th>
                        <td colspan="3">
                            <asp:TextBox ID="releasetime" runat="server" MaxLength="19" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" CssClass="input-md w3"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="ft ft02">
                <div class="action-field text-center">
                    <asp:Button ID="ok" class="btn btn-sm btn-primary" runat="server" Text="添 加" OnClientClick="return checkAll();" OnClick="ok_Click"></asp:Button>&nbsp;
                <asp:Button ID="cancel" runat="server" class="btn btn-sm btn-primary" Text="取 消" CausesValidation="False" OnClick="cancel_Click"></asp:Button>&nbsp;
                </div>
                <!--/action-field-->
                <input id="imageName" type="hidden" name="imageName" runat="server" value="../Images/uploadfiles/nopic.gif" />
            </div>
        </div>

        <script type="text/javascript">

            //在保存之前,验证输入是否正确；将有效日期值转换成相应的有效天数
            function checkAll() {
                //验证
                if (checkAllValidate()) {
                    return esave();
                } else {
                    return false;
                }
            }

            //添加保存
            function esave() {

                //判断是否使用了链接标题
                if (document.getElementById("useListTitle").checked == true) {
                    var uzdyurl = document.getElementById("txtZDYUrl");
                    if (uzdyurl.value == "" || uzdyurl.value == null) {
                        alert("使用链接标题时，自定义网址不能为空！");
                        return false;
                    }
                }
                return true;
            }

        </script>
    </form>
    <!--#include file = "../Css/foot.htm" -->
</body>
</html>
