From 9daf92dbb111397c19bcf3e93f52842e5b1e75c6 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 20 Nov 2013 18:19:02 +0000 Subject: Modify listfiles to use tablesorter --- weblog-listfiles-html.lsp | 49 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/weblog-listfiles-html.lsp b/weblog-listfiles-html.lsp index 2139c2b..fcca5b3 100644 --- a/weblog-listfiles-html.lsp +++ b/weblog-listfiles-html.lsp @@ -3,18 +3,51 @@ htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> +<% +function convertsize(size) + if string.find(size, "k$") then + return tonumber(string.match(size, "%d*")) * 1024 + elseif string.find(string.match(size, "%d*"), "M$") then + return tonumber(size) * 1024 * 1024 + elseif string.find(size, "G$") then + return tonumber(string.match(size, "%d*")) + 1024 * 1024 * 1024 + else + return tonumber(size) + end +end +%> + + + + + + + <% htmlviewfunctions.displaycommandresults({"editfile"}, session) %>

File List

- - - - - - +
FileSizeLast Modified
+ + + + + + <% for k,v in ipairs( view.value ) do - io.write( "\n" ) + io.write( "\n" ) end %> -
FileSizeLast Modified
" .. html.html_escape(v.filename) .. "" .. html.html_escape(v.size) .."" .. html.html_escape(v.mtime) .."
" .. html.html_escape(v.filename) .. ''..convertsize(v.size).."b" .. html.html_escape(v.size) .."" .. html.html_escape(v.mtime) .."
+
-- cgit v1.2.3