<%@ Page Inherits="Caicai.Framework.UI.Admin.FileBrowse" %>
<!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">
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="style.css" rel="stylesheet" rev="stylesheet" media="all" />
<script type="text/javascript" src="../files/common/jquery.js"></script>
<script type="text/javascript" src="include/common.js"></script>
<script type="text/javascript">
$(function()
{
	$(".size").each(function()
	{
		var $size = $(this);
		var name = $size.prev().find("a").attr("title");
		$.ajax
		({
			url:"filebrowse.aspx?random=" + Math.random(),
			data:"action=size&name=" + name,
			dataType:"json",
			beforeSend:function(XMLHttpRequest)
			{
				$size.find("span").html("<img src='images/loading.gif' />");
			},
			success: function(msg) 
			{
				$size.find("span").html(msg[0].size);
			}
		});
	});

	var name;
	if($().urlget("action") == "open")
	{
		name = $().urlget("name");
	}
	else
	{
		name = "";
	}

	$.ajax
		({
			url:"filebrowse.aspx?random=" + Math.random(),
			data:"action=size&name=" + name,
			dataType:"json",
			beforeSend:function(XMLHttpRequest)
			{
				$(".sizeall").find("span").html("<img src='images/loading.gif' />");
			},
			success: function(msg) 
			{
				$(".sizeall").find("span").html(msg[0].size);
			}
		});

});

</script>
</head>
<body id="html">
<form id="form1" runat="server">
<table class="table">
	<thead>
		<tr>
			<td style="width:18px;"><a href="?action=open">...</a></td>
			<td><%= Caicai.Framework.Common.Language.Get("File") %></td>
			<td style="width:80px;"><%= Caicai.Framework.Common.Language.Get("Size") %></td>
			<td style="width:120px;"><%= Caicai.Framework.Common.Language.Get("CreateDate") %></td>
			<td style="width:40px;"><%= Caicai.Framework.Common.Language.Get("Manage") %></td>
		</tr>
	</thead>
<asp:Repeater ID="RepeaterDirectory" runat="server">
	<ItemTemplate>
		<tr>
			<td><a href="?action=open&name=<%# GetName %><%# Eval("Name") %>"><img src="images/ico_browsefolder.gif" /></a></td>
			<td><a href="?action=open&name=<%# GetName %><%# Eval("Name") %>" title="<%# GetName %><%# Eval("Name") %>"><strong><%# Eval("Name") %></strong></a></td>
			<td class="size"><span>&nbsp;</span></td>
			<td><span><%# Eval("LastWriteTime")%></span></td>
			<td>&nbsp;</td>
		</tr>
	</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="RepeaterFile" runat="server">
	<ItemTemplate>
		<tr>
			<td><img class="file" alt="file" src="images/ico_browsefiles.gif" /></td>
			<td><a href="../upload/<%#Caicai.Framework.Utils.CFetch.Get("name")%>/<%# Eval("Name") %>" target="_blank"><%# Eval("Name") %></a></td>
			<td><span><%# Caicai.Framework.Utils.CFile.FileLength(Eval("Length").ToString()) %></span></td>
			<td><span><%# Eval("LastWriteTime")%></span></td>
			<td><a href="?action=delete&name=<%# Eval("FullName") %>" class="delete" title="<%= Caicai.Framework.Common.Language.Get("DataDeleteTitle") %>"><%= Caicai.Framework.Common.Language.Get("Delete") %></a></td>
		</tr>
	</ItemTemplate>
</asp:Repeater>
<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td class="sizeall"><span>&nbsp;</span></td>
			<td>&nbsp;</td>
			<td></td>
		</tr>
</table>
</form>
</body>
</html>