<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="../css/webkitBase.css" type="text/css" />
    <link rel="stylesheet" href="../css/scrollstyle.css" type="text/css" />
    <link rel="stylesheet" href="task.css" type="text/css" />
        
    <script src="../js/jquery.min.js" type="text/javascript"></script>
    <script src="../js/webkitBase.js" type="text/javascript"></script>
    <script src="taskDoing.js" type="text/javascript"></script>
	<script src="../js/template.js"></script>

</head>
<body id="container" onselectstart="return false">
    <div class="menuBar">
<!-- 
        <div id="startTask" onclick="startTask()" class="menu-nav disable">&nbsp;&nbsp;开始</div>
        <div class="menu-nav-split"></div>
 -->
        <div id="deleteTask" onclick="deleteTask(this)" class="menu-nav disable"><div class="cancelIcon"></div>{{taskDoing_html_deleteTask_lang}}</div>
        <div class="menu-nav-split"></div>
        <div id="openApkPath" onclick="openApkPath()" class="menu-nav"><div class="fileIcon"></div>打开下载文件夹</div>
        <div class="taskDoingThunder"><a href="http://open.xunlei.com/?from=vivomobilemanager" target="_blank">迅雷在为你加速<span id="speedText">!</span></a></div>
    </div>
    <div id="taskContent" class="taskContainer">
        <div class="w-page">
            <div id="task_Title">
                <div class="task_name_title"><div id="allSelect" class="sn" onmousedown="allSd(this)"></div>&nbsp;&nbsp;{{taskDoing_html_task_name_title_lang}}</div>
                <div class="task_size_title"><div class="empty">&nbsp;&nbsp;</div>&nbsp;{{taskDoing_html_task_size_title_lang}}</div>
                <div class="task_process_title"><div class="empty">&nbsp;&nbsp;</div>&nbsp;{{taskDoing_html_task_process_title_lang}}</div>
                <div class="task_op_title"><div class="empty">&nbsp;&nbsp;</div>&nbsp;{{taskDoing_html_task_op_title_lang}}</div>
            </div>
            <ul id="taskList">
<!-- 
		        <li id="1" onmouseover="h(this)" onmouseout="o(this)" onmousedown="d(this)">
		        <div class="task_name_li"><div class="sn" onmousedown="sd(this)"></div><div class="task_nametext_li">愤怒的小鸟</div></div>
		        <div class="task_size_li">11.3M</div>
		        <div class="task_process_li">正在下载(68%) </div>
		        <div class="task_op_li onclick="delTask(this)">删除 </div>
		        </li>
 -->
            </ul>
        </div>
    </div>
	
	<script id="task_list_template" type="text/html">
	<%for (var i=0;i<list.length;i++) {%>
		<li id=<%=list[i]["id"]%> onmouseover="h(this)" onmouseout="o(this)" onmousedown="d(this)">
		<%=setNum(i)%>
		<%include('task_content_template')%>
		</li>
	<%}%>
	</script>
	
	<script id="task_content_template" type="text/html">
		<div class="task_name_li"><div class="sn" onmousedown="sd(this)"></div><div class="task_nametext_li"><%=list[num]["text"]%></div></div>
		<div class="task_size_li"><%=list[num]["size"]%></div>
		<div class="task_process_li"><%=list[num]["process"]%></div>
		<div class="task_op_li">
			<%if (list[num]["state"] == 0) {%>
			<%	if (list[num]["connected"]) {%>
				<div class="task_op_li_install" onclick="installApk(this)"><span>{{taskDoing_html_task_op_li_install_lang}}</span></div>
			<%	} else {%>
				<div class="task_op_li_install disable" onclick="installApk(this)"><span>{{taskDoing_html_task_op_li_install_lang}}</span></div>
			<%	}%>
			<%} else if (list[num]["state"] == 1) {%>
			<%	if (list[num]["connected"]) {%>
				<div class="task_op_li_install" onclick="redoTask(this)"><span>{{taskDoing_html_task_op_li_redo_lang}}</span></div>
			<%	} else {%>
				<div class="task_op_li_install disable" onclick="redoTask(this)"><span>{{taskDoing_html_task_op_li_redo_lang}}</span></div>
			<%	}%>
			<%} else if (list[num]["state"] == 2) {%>
				<div class="task_op_li_pause_continue" onclick="redoTask(this)"><span>{{taskDoing_html_task_op_li_continue_lang}}</span></div>
			<%} else{%>
				<div class="task_op_li_pause_continue<%if(list[num]["canBePause"]==false || list[num]["bPauseHandled"]==false){%> disable<%}%>" onclick="pauseTask(this)"><span>{{taskDoing_html_task_op_li_pause_lang}}</span></div>
			<%}%>
				<div class="task_op_li_delete<%if(list[num]["canBeCancel"]==false || list[num]["bPauseHandled"]==false){%> disable<%}%>" onclick="delTask(this)"><span>{{taskDoing_html_task_op_li_delete_lang}}</span></div>
		</div>
	</script>
</body>
</html>