<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ResourceLibrary_List.aspx.cs"
    Inherits="RM.Web.Training.ResourceLibrary.ResourceLibrary_List" %>

<%@ Register Src="~/UserControl/PageControl.ascx" TagName="PageControl" TagPrefix="uc1" %>
<%@ Register Src="~/UserControl/LoadButton.ascx" TagName="LoadButton" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>
        资源列表</title>
    <link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <link href="/Themes/Scripts/artDialog/skins/aero.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/jQuery.lightMenu-1.0.0.min.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
         资源列表
        </div>
    </div>
    <div class="btnbarcontetn">
        <div style="text-align: right">
            <a title="转化" onclick="chang();" class="button green"><span class="icon-botton" style="background: url('/Themes/images/16/20130406015709810_easyicon_net_16.png') no-repeat scroll 0px 4px;"></span>转化</a>
            <uc2:LoadButton ID="LoadButton1" runat="server" />
        </div>
    </div>
    <div class="div-body">
        <%=TableHtml %>
    </div>
    <uc1:PageControl ID="PageControl1" runat="server" />
    </form>
    <script type="text/javascript">
        $(function () {
            //把分页定位到屏幕下面
            divresize(90);
            FixedTableHeader("#table1", $(window).height() - 121);
        })
        function add() {
            var url = "/Training/ResourceLibrary/ResourceLibrary_Form.aspx";
            top.openDialog(url, 'ResourceLibrary_Form', '资源库-新增', 1000, 350, 50, 50);
        }
        //删除
        function Delete() {
            if (IsEditdata(CheckboxValue())) {
                delConfig('/Training/ResourceLibrary/ResourceLibrary_Delete.ashx', 'key=' + CheckboxValue(), "<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Ques_delwant")%>");
               
            }
        }
        //编辑
        function edit() {
            if (IsEditdata(CheckboxValue())) {
                top.openDialog("/Training/ResourceLibrary/ResourceLibraryEdit.aspx?key=" + CheckboxValue(), 'ResourceLibraryEdit', '资源库-编辑', 500, 350, 50, 50);
            }
        }
        globalSetTags('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Plan_pxjh")%>', 'primaryId');

        var flag = 0;
        function chang() {
            if (CheckboxValue()) {
                var type = CheckboxValue().split('`')[1];
                if (type.split['.'] == "docx" || type.split['.'] == "pptx" || type.split['.'] == "doc") {
                    if (flag == 1) {
                        showTipsMsg("有文档正在转换，请稍等！", 2000, 5);
                    } else {
                        flag = 1;  //在转化
                        var url = CheckboxValue().split('`')[1];
                        $.post("/Training/Courseware/Office/GetOffice.ashx", { p: url },
                    function (data) {
                        flag = 0;
                    });
                    }
                } else {
                showTipsMsg("您转化的文件格式有误，仅允许【.docx/.pptx/.doc】", 2000, 5);
                }
                
            }
        }
    </script>   
    <script src="/Themes/Scripts/CreateContextJs.js" type="text/javascript"></script>
</body>
</html>
