<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Add.aspx.cs" Inherits="Add" ValidateRequest="false" %>

<!DOCTYPE html>
<html>
<head>
   <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>50CMS后台框架</title>
    <link rel="shortcut icon" href="favicon.ico">
     <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="../css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link href="../css/style.css?v=4.1.0" rel="stylesheet">
    <link href="../css/plugins/iCheck/custom.css" rel="stylesheet">   
    <script src="../js/jquery.min.js?v=2.1.4"></script>
    <script type="text/javascript" src="../../js/jquery.form.js"></script>
    
    <link href="../50/imgup.css" rel="stylesheet" />
    <link href="../50/style.css" rel="stylesheet" />
    <script src="../50/function.js"></script>


    <script type="text/javascript" src="../../50Editor/kindeditor.js"></script>
    <script charset="utf-8" src="../../50Editor/lang/zh_CN.js"></script>
    

<script src="../../js/swfupload/ligerBuild.min.js" type="text/javascript"></script>
<script type='text/javascript' src="../../js/swfupload/swfupload.js"></script>
<script type='text/javascript' src="../../js/swfupload/swfupload.queue.js"></script>
<script src="../../js/swfupload/newaddswfupload.handlers.js" type="text/javascript"></script>    
<link href="../../js/swfupload/ligerui-dialog.css" rel="stylesheet" type="text/css" />

  <script type="text/javascript">
        var editor;
        KindEditor.ready(function(K) {
                editor = K.create('#txtContent', {
                        resizeType : 2,
                        uploadJson : '../../../Content/Tools/upload_json.ashx', // 相对于当前页面的路径
                        fileManagerJson : '../../../Content/Tools/file_manager_json.ashx',
                        allowFileManager: true
                });
        });




       $(function () {
       InitSWFUpload("../../Content/Tools/Hup_ajax.ashx?forid=piclib", "Filedata", "2 MB", "../../js/swfupload/swfupload.swf", 1, 1);
       
            //显示关闭高级选项
       $("#UPD").toggle(function () {
                $(this).text("关闭高级选项");
                $(this).removeClass();
                $(this).addClass("up-01");
                $(".upordown").show();
            }, function() {
                $(this).text("显示高级选项");
                $(this).removeClass();
                $(this).addClass("up-02");
                $(".upordown").hide();
            });

            var imgurl = document.getElementById("txtImgUrl").value;
            if (imgurl != "")
             {
            $(".imgbox").empty();
            $(".imgbox").css({ background: "none" });
            $(".imgbox").append("<img src=\"" + imgurl + "\" />");
            }
         
            
        });


    </script>

</head>
<body class="gray-bg">
<form id="form1" runat="server" class="form-horizontal">
  <div class="wrapper animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">

<div class="tabs-container" style="margin-top: 1em;">
                <ul class="nav nav-tabs">
                    <li class="active" id="tab1" ><a data-toggle="tab" href="#tab11" aria-expanded="true">
                        基础信息</a> </li>
                    <li class="" id="tab2" ><a data-toggle="tab" href="#tab22" aria-expanded="false">
                        封面图片</a> </li>
                    <li class="" id="tab3" ><a data-toggle="tab" href="#tab33" aria-expanded="false">
                        图片相册</a> </li>
                       <li class="" id="tab4" ><a data-toggle="tab" href="#tab44" aria-expanded="false">
                        扩展信息</a> </li>
                </ul>
                <div class="tab-content"  >
                    <div id="tab11" class="tab-pane active">
                        <div class="panel-body">


                            <div class="form-group">
                                <label class="col-sm-1 control-label">内容标题：</label>
                                <div class="col-sm-5">
                                    <asp:TextBox ID="txtTitle" runat="server" CssClass="form-control" required="true"
            maxlength="250" minlength="1" HintTitle="发布的文章标题" HintInfo="控制在100个字数内，标题文本尽量不要太长。"></asp:TextBox>
                                 </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">所属栏目：</label>
                                <div class="col-sm-5">
              <asp:DropDownList id="ddlClassId" CssClass="form-control" required="true" runat="server" HintTitle="类型" HintInfo="类型为单页或者跳转的默认只取该分类下最新一篇文章"></asp:DropDownList></td>
        
                             </div>
                            </div>
                           <div class="form-group">
                                <label class="col-sm-1 control-label">跳转地址：</label>
                                <div class="col-sm-5">
<asp:TextBox ID="txtUrl" runat="server" CssClass="form-control" 
            maxlength="100" HintTitle="跳转地址" HintInfo="外网地址请写完整URL如：http://www.lnkj.cc 本站地址可以用相对地址如：list12.aspx"></asp:TextBox>
                            </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">文章属性：</label>
                                <div class="col-sm-5">

<asp:CheckBoxList ID="cblItem" runat="server"  CssClass="checkbox-inline i-checks" 
                    RepeatDirection="Horizontal" RepeatLayout="Flow">
                    <asp:ListItem Value="1">锁定</asp:ListItem>
                    <asp:ListItem Value="1">置顶</asp:ListItem>
                    <asp:ListItem Value="1">推荐</asp:ListItem>
                    <asp:ListItem Value="1">热点</asp:ListItem>
                    <asp:ListItem Value="1">图片</asp:ListItem>
                </asp:CheckBoxList>       
                

                                </div>

                         <div class="col-sm-5">
                          <span id="UPD" class="up-02">显示高级选项</span>
                                   </div>
                            </div>


                           <div class="form-group upordown hide">
                                <label class="col-sm-1 control-label">文章作者：</label>
                                <div class="col-sm-7">
 <asp:TextBox ID="txtAuthor" runat="server" CssClass="input w250 required" 
            maxlength="50" HintTitle="文章作者" HintInfo="控制在50个字数内，如“管理员”。">管理员</asp:TextBox> 

                                </div>
                            </div>

                           <div class="form-group upordown hide">
                                <label class="col-sm-1 control-label">文章来源：</label>
                                <div class="col-sm-7">
    <asp:TextBox ID="txtForm" runat="server" 
            maxlength="100" HintTitle="信息来源" HintInfo="控制在50个字数内，如“本站”。">本站</asp:TextBox>
                                 </div>
                            </div>

                           <div class="form-group upordown hide">
                                <label class="col-sm-1 control-label">Word上传：</label>
                                <div class="col-sm-7">
  <input id="Fileword" type="file" runat="server"  class="fileword" />
  <asp:Button ID="Button2" runat="server" OnClick="btnUpload_Click" Text="提交"  CssClass="cancel"/> 
   
   <!--a href="javascript:void(0);" class="fileword"><input type="file" id="Fileip" name="Fileip" onchange="WordUpload('txtContent','Fileip')" /></a>
   <span class="uploadingw">正在上传，请稍候...</span-->

   可以直接上传word文件至发布系统，并自动上传WORD中的图片文件，注意word文件大小不要超过2m为宜。
                                 </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">文章内容：</label>
                                <div class="col-sm-11">
           <textarea id="txtContent" cols="100" rows="8" style="width:100%;height:400px;visibility:hidden;" runat="server"></textarea>
                             </div>
                            </div>



                            <div class="form-group">
                                <label class="col-sm-1 control-label"></label>
                                <div class="col-sm-11">
            <asp:Button ID="btnSave" runat="server" Text="确认保存" CssClass="btn btn-primary" onclick="btnSave_Click"  />
  &nbsp;
  <input type="button" class="btn btn-white" id="btnCancel" onclick="myclose();" value="取消" />
                             </div>
                            </div>
                            
                            
                    
                        </div>
                    </div>

                  <div id="tab22" class="tab-pane">
                        <div class="panel-body">

                       <table width="100%" border="0" cellspacing="0" cellpadding="0" class="msgtable">       
            <tr >
             <td width="343" rowspan="9" align=center>
             
              <div class="imgbox"></div>
         
             <asp:TextBox ID="txtImgUrl" runat="server" CssClass="input w250 left" style="display:none;"></asp:TextBox>
                <a href="javascript:void(0);" class="files">
                <input type="file" id="FileUpload" name="FileUpload" onchange="SingleUpload('txtImgUrl','FileUpload')" /></a>
                <a class="uploading">正在上传，请稍候...</a>
            
            </td>
           </tr>
      
           </table>    
                        
                        </div>
                    </div>
                
                    <div id="tab33" class="tab-pane">
                        <div class="panel-body">


                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label">标记代码：</label>
                                <div class="col-sm-5">
                                  
                                    <asp:TextBox ID="TextBox1" runat="server" size="10" 
            maxlength="10" HintTitle="代码" HintInfo="复制 此标记到内容页面中需要插入切换图片组处 ">{IMGS}</asp:TextBox>
                                 
                                </div>
                            </div>


                          <div class="form-group">
                                <label class="col-sm-1 control-label"></label>
                                <div class="col-sm-5">
                                    <div class="upload_btn"><span id="upload"></span></div><label>可以上传多张图片。</label>
                    <div class="clear"></div>
                    <!--封面隐藏值.开始-->
                    <!--
                    <input type="hidden" name="focus_photo" id="focus_photo" value=""/>
                    -->
                    <asp:HiddenField ID="focus_photo" runat="server" />
                    <!--封面隐藏值.结束-->
                    <!--上传提示.开始-->
                    <div id="show"></div>
                    <!--上传提示.结束-->
                    <!--图片列表.开始-->
                    <div id="show_list">
                        <ul>
    
                          <asp:Literal ID="LitAlbumList" runat="server"></asp:Literal>
                        </ul>
                    </div>
                                </div>
                            </div>
                  
      
                       

                   
                   
      

                        
                        </div>
                    </div>

                  <div id="tab44" class="tab-pane">
                        <div class="panel-body">

                                                        
                            <div class="form-group">
                                <label class="col-sm-1 control-label">Meta关键字：</label>
                                <div class="col-sm-5">
    <asp:TextBox ID="txtKeyword" runat="server" CssClass="form-control"
            maxlength="100" HintTitle="Meta关键字" HintInfo="用于搜索引擎，如有多个关健字请用英文的,号分隔，不填写将自动提取标题。"></asp:TextBox>
                                 
                                </div>
                            </div>                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label">Meta描述：</label>
                                <div class="col-sm-5">
                                  
                              <asp:TextBox ID="txtZhaiyao" runat="server" CssClass="form-control"
            maxlength="250" HintTitle="Meta描述" 
                    HintInfo="用于搜索引擎，控制在250个字数内，不填写将自动提取。" TextMode="MultiLine"></asp:TextBox>
                                </div>
                            </div>                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label">文章导读：</label>
                                <div class="col-sm-5">
                                  
                                  <asp:TextBox ID="txtDaodu" runat="server" CssClass="form-control" HintTitle="文章导读属性" 
                    maxlength="250" HintInfo="控制在250个字数内，纯文本，不填写将自动提取。" 
                    TextMode="MultiLine"></asp:TextBox>
                                 
                                </div>
                            </div>                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label">浏览次数：</label>
                                <div class="col-sm-1">
                                  
                                 <asp:TextBox ID="txtClick" runat="server" CssClass="form-control" size="10" 
            maxlength="10" HintTitle="文章的浏览次数" HintInfo="纯数字，本文章被阅读的次数。">0</asp:TextBox>
                                 
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">发布日期：</label>
                                <div class="col-sm-2">
                                
                                 <asp:TextBox ID="txtRQ" runat="server" CssClass="laydate-icon form-control layer-date"        
            maxlength="100" HintTitle="发布日期" HintInfo="日期为空自动取服务器当前日期"></asp:TextBox>

                                 
                                </div>
                            </div>



      
                        
                        </div>
                    </div>



</div>
</div>
</div>
</div>
</div>
    
    </form>


       
      <!-- 全局js -->

    <script src="../js/bootstrap.min.js?v=3.3.6"></script>

      <!-- 自定js -->
    <script src="../js/plugins/layer/laydate/laydate.js" type="text/javascript"></script>

            <script type="text/javascript">
                laydate.skin('yalan')
     var start = {
         elem: "#txtRQ",
            format: "YYYY/MM/DD hh:mm:ss",
            max: "2099-06-16 23:59:59",
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas;
                end.start = datas
            }
     };
    
        laydate(start);

    </script>

            <!-- iCheck -->
    <script src="../js/plugins/iCheck/icheck.min.js"></script>
    <script>
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green'

            });
        });
    </script>

    <script type="text/javascript" src="../js/layer/layer.js"></script>



    <link href="../css/plugins/sweetalert/sweetalert.css" rel="stylesheet" />
    <script src="../Js/plugins/sweetalert/sweetalert.min.js"></script>

    <script type="text/javascript">
      


                if (typeof (success) != "undefined") {

                    swal({ title: msg, type: "success", html: true, confirmButtonText: "再发一篇", showConfirmButton: true, timer: 1000 }
                        , function (isConfirm) {

                            if (isConfirm) {
                                swal("Deleted!", "Your imaginary file has been deleted.", "success");
          
                            }
                            else
                            {
                                var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引

                                if (typeof (index) != "undefined") {
                                    parent.layer.close(index); //执行关闭

                                }
                                else {
                                    parent.openItem(successurl, 1, '资讯管理');

                                }

                            }

                        
                        }

     
                       );
                }
                function myclose() {
                    var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
                    parent.layer.close(index); //执行关闭
                }

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