<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="css/reset.css" type="text/css" charset="UTF-8">
    <link rel="stylesheet" href="css/study.css" type="text/css" charset="UTF-8">
    <script src="js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/handlebars.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        // $("html").css("fontSize",$(window).width()/16);
        // $(window).resize(function() {
        //     $("html").css("fontSize",$(window).width()/16);
        // });
    </script>
</head>

<body>
<div id="tips_content" style="position:fixed;display: none;padding: 0 10px;font-size:18px;background-color: rgba(0,0,0,0.5);line-height: 26px;color: #fff;z-index: 1000;"></div>
    <div class="studyMain clearfix">
        <div class="studyLeft">
            <div class="studyPerson">
                <h2 class="personal">
                    个人
                </h2>
                <ul class="perList">
                    <li class="perListSel"  cid="">我的文件</li>
                    <li title="下载管理">下载管理</li>
                </ul>
            </div>
            <div class="studyClass">
                <h2 class="class" >
                    班级
                </h2>
                <!-- <div id="class_tips" style="position: fixed;top: 180px;height: 20px;line-height: 20px;text-indent: 0;border: 1px solid #F4F4F4;/* width: 1000px; */z-index: 1111111;font-size: 15px;display: none;background-color:#F4F4F4;"></div> -->
                <ul class="classList">
                </ul>
            </div>
        </div>
        <div class="studyRight">
            <ul class="rightTopNav clearfix">

            </ul>
            <div class="no_pic"></div>
            <div class="tab">
                <h2 class="rightTab">
                    <span class="rightName">资源名称</span>
                    <span class="rightSub">学科</span>
                    <span class="rightSize">大小</span>
                    <span class="rightTime" id="sendTime" style="display:none;">发送时间</span>
                    <span class="rightTime" id="loadTime">下载时间</span>
                    <span class="rightOper">操作</span>
                </h2>
                <ul class="tabList">
                </ul>
                <div class="pageList clearfix"></div>
            </div>
        </div>
        <div class="studyDownload none">
            <div class="downLoading">
                <h2>正在下载（<span class="loadingNumber">3</span>）</h2>
                <ul class="loading"></ul>
            </div>
            <div class="downLoaded">
                <h2>下载完成（<span class="loadNumber">2</span>）</h2>
                <ul class="loaded">

                </ul>
            </div>
        </div>
    </div>
    <div class="isDelete none">
        <div class="tip">提示</div>
        <div>
            <p class="isText">你是否确定删除该文件？</p>
            <div class="isBtns">
                <span class="sureDel sureDelSel">确定</span>
                <span class="cancelDel">取消</span>
            </div>
        </div>
    </div>
    <script src="js/study.js" type="text/javascript" charset="UTF-8"></script>
    <script id="classListTemp" type="text/x-handlebars-template">
    {{#each this}}
    <li cid="{{class_id}}" class="classList_li" style="position:relative;">
        <div  style="text-indent: 42px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;padding-right: 29px;" title="{{class_name}}">{{class_name}}</div>
    </li>
    <!-- <li cid="{{class_id}}" class="classList_li" style="text-indent: 42px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">{{class_name}}</li> -->
    {{/each}}
</script>
    <script id="subjectListTemp" type="text/template">
    <li class="docTypeSel enable" sid="">全部</li>
    {{#each this}}
          <li sid="{{subjectID}}" class="enable">{{subjectName}}</li>
    {{/each}}
</script>
    <script id="dataListTemp" type="text/template">
    {{#each this}}
         <li id='{{file_id}}'>
                    <p class="tabListName" onclick="openFile('{{rel_homework_id}}','{{file_url}}','{{url_flag}}')">{{title}}</p>
                    <p class="tabListSub">{{nullStr subject}}</p>
                    <p class="tabListSize">{{formatSize size}}</p>
                    <p class="tabListTime">{{formatTime send_time}}</p>
                    <p class="tabListOper">
                        <span class="iconEdit" onclick="openHomework('{{rel_homework_id}}')"></span>
                        <span class="iconDele{{showDel rel_homework_id file_url url_flag}}" onclick="deleteMyFile('{{file_id}}','{{rel_homework_id}}','{{file_url}}')"></span>
                        <span class="iconLoad{{fileExists rel_homework_id file_url url_flag}}" onclick="DownloadFile(this,'{{file_url}}','{{rel_homework_id}}','{{file_id}}','{{title}}','{{size}}','{{url_flag}}','{{source_file_id}}')">
                            <span class="downloadTip none">文件正在下载，请到下载管理里查看下载详情！</span>
</span>
                    </p>
                    
        </li>
    {{/each}}
</script>
    <script id="downloadTemp" type="type/template">
{{#each this}}
                <li class="" id="{{Id}}" hid="{{HomeworkID}}">
                    <div class="loadingLeft">
                        <p class="loadingName">{{FileTransferInf.Title}}</p>
                        <p class="loadingPro">
                            <span class="loadPro"></span>
                        </p>
                        <p class="loadingNet">
                            <span><span class="loadSpeed">0</span>/s</span>
                            <span class="loadState">正在下载</span>
                            <span class="loadNetRight">
                                <span class="loadPro">0</span>/<span class="loadSum">{{formatSize FileTransferInf.RemoteFileSize}}</span>
                            </span>
                        </p>
                    </div>
                    <div class="loadingRight">
                        <p class="loadOpe">
                            <span class="iconStart" onclick="PauseTask(this,'{{Id}}')"></span>
                            <span class="iconStop none" onclick="ResumeTask(this,'{{Id}}')"></span>
                            <span class="iconRestart none" onclick="ResumeTask(this,'{{Id}}')"></span>
                        </p>
                        <span class="iconDele" onclick="CancelTask(this,'{{Id}}')"></span>
                    </div>
                </li>
{{/each}}
</script>
    <script id="loadedTemp" type="text/template">
          {{#each this}}
          <li class="{{isDeleted LocalFullFileName HomeworkID}}">
                    <div class="loadingLeft">
                        <p class="loadingName">{{FileTransferInf.Title}}</p>
                        <span style="line-height: 44px;"><span class="loadSum">{{formatSize FileTransferInf.RemoteFileSize}}</span></span>
                        <span class="loadSum">{{formatTime FileTransferInf.TransferEndTime}}</span>
                        <span class="fileDelete">文件已删除</span>
                    </div>
                    <div class="loadingRight">
                        <span class="iconOpen" onclick="openFile('{{HomeworkID}}','{{FileTransferInf.RemoteFileName}}','0');"></span>
                        <span class="iconDele" onclick="DelComFile('{{FileTransferInf.ID}}');"></span>
                    </div>
                </li>
          {{/each}}      
    </script>
    <script type="text/javascript">
        function init(){
            /*$("#class_tips").hover(function(){
                $("#class_tips").show();
            },function(){
                $("#class_tips").hide();
            });
            $(".classList_li").hover(function (e) {
                var e = window.event || event; 
                console.log(e)
                console.log(e.clientX)
                console.log(e.clientY)
                var str_num=$(this).text();
                console.log(str_num);
                if(str_num.length>2){
                    if(document.getElementById("class_tips").style.display == "none"){
                        setTimeout(function(){
                            $("#class_tips").html(str_num).show();
                            //$(this).children(".classList_con").show();
                            $("#class_tips").css({
                                "top" : e.clientY-20,
                                "left" : e.clientX - 40
                            });
                        },500);
                    }
                }
            }, function () {
                    $("#class_tips").hide();
            });*/
            $(".classList_li").hover(function(){
                var str_num=$(this).children().eq(0).text();
                var x = $(this).offset().left;
                var y = $(this).offset().top;

                console.log(x);
                console.log(y);
                if(str_num.length>4){
                    $('#tips_content').text(str_num).css({
                        top:y - 20,
                        left:80
                    }).show();
                    /*$(this).children('.tips_content').show();*/
                }
            },function(){
                $('#tips_content').hide();
            });
            $(".iconEdit").hover(function () {
                    var x = $(this).offset().left;
                    var y = $(this).offset().top;
                    $('#tips_content').text('进入作业').css({
                        top:y - 20,
                        left:x
                    }).show();
            },function () {
                $('#tips_content').hide();
            });
            $(".iconDele").hover(function () {
                var x = $(this).offset().left;
                var y = $(this).offset().top;
                $('#tips_content').text('删除').css({
                    top:y - 20,
                    left:x
                }).show();
            },function () {
                $('#tips_content').hide();
            });
            $(".iconLoad").hover(function () {
                var x = $(this).offset().left;
                var y = $(this).offset().top;
                $('#tips_content').text('下载').css({
                    top:y - 20,
                    left:x
                }).show();
            },function () {
                $('#tips_content').hide();
            });

        }
    </script>
</body>

</html>