diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 14:05:47 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 14:05:47 +0000 |
commit | db70500c25e5162e36c88c6a78316ae8b8bc1c5d (patch) | |
tree | 3c6218129669034ca39bca5720fea92d9f70e3c3 /lighttpd-listfiles-html.lsp | |
parent | 9297525fc6d0ef49c7f3c0bb51feb0fc0e234838 (diff) | |
download | acf-lighttpd-db70500c25e5162e36c88c6a78316ae8b8bc1c5d.tar.bz2 acf-lighttpd-db70500c25e5162e36c88c6a78316ae8b8bc1c5d.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 'lighttpd-listfiles-html.lsp')
-rw-r--r-- | lighttpd-listfiles-html.lsp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/lighttpd-listfiles-html.lsp b/lighttpd-listfiles-html.lsp index 8cfea46..d1cba0b 100644 --- a/lighttpd-listfiles-html.lsp +++ b/lighttpd-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,7 +43,7 @@ end %> <tr> <td><% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="expert"}), page_info, -1) %></td> <td><%= html.html_escape(file.filename) %></td> - <td><span class="hide"><%= convertsize(file.filesize) %>b</span><%= html.html_escape(file.filesize) %></td> + <td><span class="hide"><%= html.html_escape(file.size or 0) %>b</span><%= format.formatfilesize(file.size) %></td> <td><%= html.html_escape(file.mtime) %></td> </tr> <% end %> |