<%@ Page Language="c#" Inherits="WebApp.Wpdcc.PublicNews" CodeBehind="PublicNews.aspx.cs" %>

<!DOCTYPE html>
<html>
<head>
    <title>新闻编辑</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../assets/head.htm" -->
    <script charset="utf-8" src="../Wpedt/kindeditor.js"></script>
    <script charset="utf-8" src="../Wpedt/lang/zh_CN.js"></script>
</head>
<body class="no-skin">
    <form id="frmPublicNews" method="post" runat="server">
    <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <div class="breadcrumbs" id="breadcrumbs">
                <script type="text/javascript">
                    try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }
                </script>

                <ul class="breadcrumb">
                    <li>
                        <i class="ace-icon fa fa-home home-icon"></i>
                        主页
                    </li>
                    <li>站点运行监控</li>
                    <li class="active">共享信息维护</li>
                </ul>
                <!-- /.breadcrumb -->

                <!-- /section:basics/content.searchbox -->
            </div>
            <!-- /section:basics/content.breadcrumbs -->

            <div class="page-content">
                <!-- PAGE CONTENT BEGINS -->
                
            <table class="table table-striped table-bordered">
                <tr>
                    <th>
                        新闻标题：
                    </th>
                    <td>
                        <asp:TextBox ID="intactTitle" runat="server" CssClass="input-txt input-txt3" notnull="true" MaxLength="100" msgname="新闻标题"></asp:TextBox>
                        <asp:CheckBox ID="isTop" Style="cursor: hand" runat="server" Text="固顶新闻"></asp:CheckBox>
                    </td>
                    <th>
                        副标题：
                    </th>
                    <td>
                        <asp:TextBox ID="subheading" runat="server" CssClass="input-txt input-txt3" MaxLength="100"></asp:TextBox>
                        <asp:CheckBox ID="useListTitle" Style="cursor: hand" runat="server" Text="使用副标题">
                        </asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        作者：
                    </th>
                    <td>
                        <asp:TextBox ID="author" runat="server" CssClass="input-txt input-txt1" MaxLength="100"></asp:TextBox>
                    </td>
                    <th>
                        来源：
                    </th>
                    <td>
                        <asp:TextBox ID="copyFrom" runat="server" CssClass="input-txt input-txt1" MaxLength="100"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        信箱：
                    </th>
                    <td>
                        <asp:TextBox ID="authorMail" runat="server" CssClass="input-txt input-txt1" MaxLength="100"></asp:TextBox>
                    </td>
                    <th>
                        来源地址：
                    </th>
                    <td>
                        <asp:TextBox ID="copyFromLink" runat="server" CssClass="input-txt input-txt1"
                            MaxLength="100"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        相关信息：
                    </th>
                    <td colspan="3">
                        <asp:TextBox ID="about" runat="server" CssClass="input-txt input-txt1" MaxLength="100"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="非法字符串！"
                            ControlToValidate="about" Display="Dynamic" ValidationExpression="[^&quot;^'^\*^\?^,^\.^(^)]+"></asp:RegularExpressionValidator>用来查找相关文章，中间用“|”隔开；不能出现""'*?,.()等字符
                    </td>
                </tr>
                <tr>
                    <th>
                        新闻内容：
                    </th>
                    <td colspan="3">
                        <input id="content1" type="hidden" name="content1" runat="server" />
                        <textarea  name="content" style="width: 100%; height: 480px; visibility: hidden;"></textarea>
                        <p style="color: Green">
                            【如子站无法显示图片等内容，可点其右键查看属性设置，url链接须使用格式为“http://网站域名/图片路径”的完整地址】</p>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                    <div class="action-field text-center">
                        <asp:Button ID="ok" runat="server" Text="添 加" CssClass="btn btn-sm btn-primary" OnClientClick="return checkall();" OnClick="ok_Click"></asp:Button>
                        &nbsp;
                        <asp:Button ID="cancel" runat="server" Text="取 消" CssClass="btn btn-sm btn-primary" OnClick="cancel_Click"></asp:Button>
                    </div>
                    </td>
                </tr>
            </table>
        </div>
        <div class="ft">
            <!--/action-field-->
        </div>
    </div>

    <script src="../assets/js/validate.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">

        //声明编辑器
        var editor;
        
		KindEditor.ready(function(K) {
		    //把textarea变为编辑器
		    editor = K.create('textarea[name="content"]', {
					        resizeType : 1,
                            allowFileManager : true,
                            allowFileUpload : true,
					        uploadJson : '../Wpedt/aspnet/upload_json.ashx',
                            fileManagerJson : '../Wpedt/aspnet/file_manager_json.ashx'
				        });
 		
		    //加载内容至编辑器
            var initcontxt=document.getElementById("content1");
            editor.insertHtml(initcontxt.value);     
            
		});	
			
    function checkall()
    {
                if (checkAllValidate())
                {
                        if (editor.isEmpty())
                        {
                            alert("文章内容不能为空！");
                            return false;
                        }
                        //给隐藏的content1赋值
                        $("#content1").val(editor.html()) ;  
                        return true;
                }else{
                        return false;
                }  
     }  
    </script>

    </form>
</body>
</html>
