diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 14:08:21 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 14:08:21 +0000 |
commit | b3f3ab92160e1f77ceb05d0ec60b2034a9ddfa7b (patch) | |
tree | f1c6b9c650cf05375e8c688d0b4bb8b1831f4e6c /samba-listfiles-html.lsp | |
parent | 34b319411e15c941f282396d7f3e1209b80fd4aa (diff) | |
download | acf-samba-b3f3ab92160e1f77ceb05d0ec60b2034a9ddfa7b.tar.bz2 acf-samba-b3f3ab92160e1f77ceb05d0ec60b2034a9ddfa7b.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 'samba-listfiles-html.lsp')
-rw-r--r-- | samba-listfiles-html.lsp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/samba-listfiles-html.lsp b/samba-listfiles-html.lsp index 8cfea46..b58e51e 100644 --- a/samba-listfiles-html.lsp +++ b/samba-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="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><%= 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> |