summaryrefslogtreecommitdiffstats
path: root/dansguardian-listfiles-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-12-30 13:57:01 +0000
committerTed Trask <ttrask01@yahoo.com>2015-12-30 13:57:01 +0000
commit2d2c9b994ca22a82cb7578e005ac7ab1ee9f88d2 (patch)
treef3b2f0a6b4f665d08bb2d9673aa2d6de00cea40c /dansguardian-listfiles-html.lsp
parente22d15e2ae87f8e12d3bbb4e78107a9fbfc536d4 (diff)
downloadacf-dansguardian-2d2c9b994ca22a82cb7578e005ac7ab1ee9f88d2.tar.bz2
acf-dansguardian-2d2c9b994ca22a82cb7578e005ac7ab1ee9f88d2.tar.xz
Change listfiles filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions
Diffstat (limited to 'dansguardian-listfiles-html.lsp')
-rw-r--r--dansguardian-listfiles-html.lsp18
1 files changed, 2 insertions, 16 deletions
diff --git a/dansguardian-listfiles-html.lsp b/dansguardian-listfiles-html.lsp
index df2685e..08ec66e 100644
--- a/dansguardian-listfiles-html.lsp
+++ b/dansguardian-listfiles-html.lsp
@@ -3,20 +3,6 @@ htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>
-<%
-function convertsize(size)
- if string.find(size, "k$") then
- return tonumber(string.match(size, "[%d.]*")) * 1024.0
- elseif string.find(size, "M$") then
- return tonumber(string.match(size, "[%d.]*")) * 1024.0 * 1024.0
- elseif string.find(size, "G$") then
- return tonumber(string.match(size, "[%d.]*")) + 1024.0 * 1024.0 * 1024.0
- else
- return tonumber(string.match(size, "[%d.]*"))
- end
-end
-%>
-
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>');
@@ -57,8 +43,8 @@ end %>
<tr>
<td><% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="edit"}), page_info, -1) %></td>
<td><%= html.html_escape(file.filename) %></td>
- <td><span class="hide"><%= convertsize(file.size) %>b</span><%= html.html_escape(file.size) %></td>
- <td><%= html.html_escape(file.mtime) %></td>
+ <td><span class="hide"><%= html.html_escape(file.size or 0) %>b</span><%= format.formatfilesize(file.size) %></td>
+ <td><%= format.formattime(file.mtime) %></td>
<tr>
<% end %>
</tbody></table>